~ubuntu-branches/ubuntu/precise/clutter-1.0/precise

« back to all changes in this revision

Viewing changes to clutter/clutter-behaviour-opacity.c

  • Committer: Bazaar Package Importer
  • Author(s): Emilio Pozuelo Monfort
  • Date: 2010-03-21 13:27:56 UTC
  • mto: (2.1.3 experimental) (1.3.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20100321132756-nf8yd30yxo3zzwcm
Tags: upstream-1.2.2
ImportĀ upstreamĀ versionĀ 1.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 * Lesser General Public License for more details.
19
19
 *
20
20
 * You should have received a copy of the GNU Lesser General Public
21
 
 * License along with this library; if not, write to the
22
 
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23
 
 * Boston, MA 02111-1307, USA.
 
21
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
24
22
 */
25
23
 
26
24
/**
113
111
                                        const GValue *value,
114
112
                                        GParamSpec   *pspec)
115
113
{
116
 
  ClutterBehaviourOpacity *opacityb = CLUTTER_BEHAVIOUR_OPACITY (gobject);
 
114
  ClutterBehaviourOpacity *self = CLUTTER_BEHAVIOUR_OPACITY (gobject);
117
115
 
118
116
  switch (prop_id)
119
117
    {
120
118
    case PROP_OPACITY_START:
121
 
      opacityb->priv->opacity_start = g_value_get_uint (value);
 
119
      clutter_behaviour_opacity_set_bounds (self,
 
120
                                            g_value_get_uint (value),
 
121
                                            self->priv->opacity_end);
122
122
      break;
 
123
 
123
124
    case PROP_OPACITY_END:
124
 
      opacityb->priv->opacity_end = g_value_get_uint (value);
 
125
      clutter_behaviour_opacity_set_bounds (self,
 
126
                                            self->priv->opacity_start,
 
127
                                            g_value_get_uint (value));
125
128
      break;
 
129
 
126
130
    default:
127
131
      G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
128
132
      break;
135
139
                                        GValue     *value,
136
140
                                        GParamSpec *pspec)
137
141
{
138
 
  ClutterBehaviourOpacity *opacityb = CLUTTER_BEHAVIOUR_OPACITY (gobject);
 
142
  ClutterBehaviourOpacity *self = CLUTTER_BEHAVIOUR_OPACITY (gobject);
139
143
 
140
144
  switch (prop_id)
141
145
    {
142
146
    case PROP_OPACITY_START:
143
 
      g_value_set_uint (value, opacityb->priv->opacity_start);
 
147
      g_value_set_uint (value, self->priv->opacity_start);
144
148
      break;
 
149
 
145
150
    case PROP_OPACITY_END:
146
 
      g_value_set_uint (value, opacityb->priv->opacity_end);
 
151
      g_value_set_uint (value, self->priv->opacity_end);
147
152
      break;
 
153
 
148
154
    default:
149
155
      G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
150
156
      break;
156
162
{
157
163
  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
158
164
  ClutterBehaviourClass *behave_class = CLUTTER_BEHAVIOUR_CLASS (klass);
 
165
  GParamSpec *pspec;
 
166
 
 
167
  g_type_class_add_private (klass, sizeof (ClutterBehaviourOpacityPrivate));
159
168
 
160
169
  gobject_class->set_property = clutter_behaviour_opacity_set_property;
161
170
  gobject_class->get_property = clutter_behaviour_opacity_get_property;
167
176
   *
168
177
   * Since: 0.2
169
178
   */
170
 
  g_object_class_install_property (gobject_class,
171
 
                                   PROP_OPACITY_START,
172
 
                                   g_param_spec_uint ("opacity-start",
173
 
                                                      "Opacity Start",
174
 
                                                      "Initial opacity level",
175
 
                                                      0, 255,
176
 
                                                      0,
177
 
                                                      CLUTTER_PARAM_READWRITE));
 
179
  pspec = g_param_spec_uint ("opacity-start",
 
180
                             "Opacity Start",
 
181
                             "Initial opacity level",
 
182
                             0, 255,
 
183
                             0,
 
184
                             CLUTTER_PARAM_READWRITE);
 
185
  g_object_class_install_property (gobject_class, PROP_OPACITY_START, pspec);
 
186
 
178
187
  /**
179
188
   * ClutterBehaviourOpacity:opacity-end:
180
189
   *
182
191
   *
183
192
   * Since: 0.2
184
193
   */
185
 
  g_object_class_install_property (gobject_class,
186
 
                                   PROP_OPACITY_END,
187
 
                                   g_param_spec_uint ("opacity-end",
188
 
                                                      "Opacity End",
189
 
                                                      "Final opacity level",
190
 
                                                      0, 255,
191
 
                                                      0,
192
 
                                                      CLUTTER_PARAM_READWRITE));
 
194
  pspec = g_param_spec_uint ("opacity-end",
 
195
                             "Opacity End",
 
196
                             "Final opacity level",
 
197
                             0, 255,
 
198
                             0,
 
199
                             CLUTTER_PARAM_READWRITE);
 
200
  g_object_class_install_property (gobject_class, PROP_OPACITY_END, pspec);
193
201
 
194
202
  behave_class->alpha_notify = clutter_behaviour_alpha_notify;
195
 
 
196
 
  g_type_class_add_private (klass, sizeof (ClutterBehaviourOpacityPrivate));
197
203
}
198
204
 
199
205
static void