27 #define EV_TRANSITION_ANIMATION_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EV_TYPE_TRANSITION_ANIMATION, EvTransitionAnimationPriv))
67 g_object_unref (priv->
effect);
69 priv->
effect = g_value_dup_object (value);
73 g_value_get_pointer (value));
77 g_value_get_pointer (value));
80 G_OBJECT_WARN_INVALID_PROPERTY_ID (
object, prop_id, pspec);
96 g_value_set_object (value, priv->
effect);
105 G_OBJECT_WARN_INVALID_PROPERTY_ID (
object, prop_id, pspec);
117 g_object_unref (priv->
effect);
125 G_OBJECT_CLASS (ev_transition_animation_parent_class)->finalize (
object);
130 guint n_construct_properties,
131 GObjectConstructParam *construct_params)
138 object = G_OBJECT_CLASS (ev_transition_animation_parent_class)->constructor (type,
139 n_construct_properties,
145 g_object_get (effect,
"duration", &duration, NULL);
154 GObjectClass *object_class = G_OBJECT_CLASS (klass);
161 g_object_class_install_property (object_class,
163 g_param_spec_object (
"effect",
165 "Transition effect description",
167 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE |
168 G_PARAM_STATIC_STRINGS));
169 g_object_class_install_property (object_class,
171 g_param_spec_pointer (
"origin-surface",
173 "Cairo surface from which the animation will happen",
175 G_PARAM_STATIC_STRINGS));
176 g_object_class_install_property (object_class,
178 g_param_spec_pointer (
"dest-surface",
179 "Destination surface",
180 "Cairo surface to which the animation will happen",
182 G_PARAM_STATIC_STRINGS));
189 cairo_surface_t *surface,
193 GdkRectangle page_area)
197 gdk_cairo_rectangle (cr, &page_area);
199 cairo_surface_set_device_offset (surface, x_offset, y_offset);
200 cairo_set_source_surface (cr, surface, 0, 0);
205 cairo_paint_with_alpha (cr, alpha);
216 GdkRectangle page_area)
224 width = page_area.width;
225 height = page_area.height;
227 g_object_get (effect,
228 "alignment", &alignment,
229 "direction", &direction,
238 height * progress / 2,
240 height * (1 - progress));
243 width * progress / 2,
245 width * (1 - progress),
258 (height / 2) - (height * progress / 2),
263 (width / 2) - (width * progress / 2),
280 GdkRectangle page_area)
284 gint width, height, i;
287 width = page_area.width;
288 height = page_area.height;
290 g_object_get (effect,
291 "alignment", &alignment,
302 height / N_BLINDS * i,
304 height / N_BLINDS * progress);
307 width / N_BLINDS * i,
309 width / N_BLINDS * progress,
324 GdkRectangle page_area)
331 width = page_area.width;
332 height = page_area.height;
334 g_object_get (effect,
335 "direction", &direction,
342 width * progress / 2,
343 height * progress / 2,
344 width * (1 - progress),
345 height * (1 - progress));
353 (width / 2) - (width * progress / 2),
354 (height / 2) - (height * progress / 2),
368 GdkRectangle page_area)
375 width = page_area.width;
376 height = page_area.height;
378 g_object_get (effect,
390 }
else if (angle <= 90) {
394 height * (1 - progress),
397 }
else if (angle <= 180) {
400 width * (1 - progress),
404 }
else if (angle <= 270) {
422 GdkRectangle page_area)
437 GdkRectangle page_area)
444 width = page_area.width;
445 height = page_area.height;
447 g_object_get (effect,
467 GdkRectangle page_area)
474 width = page_area.width;
475 height = page_area.height;
477 g_object_get (effect,
497 GdkRectangle page_area)
504 width = page_area.width;
505 height = page_area.height;
507 g_object_get (effect,
527 GdkRectangle page_area)
540 GdkRectangle page_area)
556 g_object_get (priv->
effect,
"type", &type, NULL);
592 GEnumValue *enum_value;
594 enum_value = g_enum_get_value (g_type_class_peek (EV_TYPE_TRANSITION_EFFECT_TYPE), type);
596 g_warning (
"Unimplemented transition animation: '%s', "
597 "please post a bug report in Evince bugzilla "
598 "(http://bugzilla.gnome.org) with a testcase.",
599 enum_value->value_nick);
619 cairo_surface_t *origin_surface)
622 cairo_surface_t *surface;
631 surface = cairo_surface_reference (origin_surface);
637 g_object_notify (G_OBJECT (animation),
"origin-surface");
645 cairo_surface_t *dest_surface)
648 cairo_surface_t *surface;
657 surface = cairo_surface_reference (dest_surface);
663 g_object_notify (G_OBJECT (animation),
"dest-surface");