From 93b965f71d3da7d02e942e88aeb6ff262920788f Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Sun, 7 Oct 2012 21:48:02 +0100 Subject: [PATCH] 2.0: Remove deprecated symbols from the tree And fix the fallout. --- clutter/clutter-enums.h | 78 +- clutter/clutter-group.h | 95 - clutter/clutter-main.c | 27 +- clutter/clutter-main.h | 2 - clutter/clutter-master-clock.c | 4 +- clutter/clutter-private.h | 1 + clutter/clutter-script.c | 3 - clutter/clutter-stage.h | 2 +- clutter/clutter-texture.h | 128 - clutter/clutter-types.h | 9 - clutter/clutter.h | 2 - clutter/clutter.symbols | 5 - clutter/deprecated/clutter-actor-deprecated.c | 411 --- clutter/deprecated/clutter-actor.h | 161 - clutter/deprecated/clutter-alpha.c | 959 ----- clutter/deprecated/clutter-alpha.h | 144 - clutter/deprecated/clutter-animatable.h | 47 - clutter/deprecated/clutter-animation.c | 2663 -------------- clutter/deprecated/clutter-animation.h | 206 -- clutter/deprecated/clutter-animator.c | 2176 ------------ clutter/deprecated/clutter-animator.h | 186 - clutter/deprecated/clutter-backend.h | 64 - clutter/deprecated/clutter-behaviour-depth.c | 309 -- clutter/deprecated/clutter-behaviour-depth.h | 101 - .../deprecated/clutter-behaviour-ellipse.c | 1068 ------ .../deprecated/clutter-behaviour-ellipse.h | 159 - .../deprecated/clutter-behaviour-opacity.c | 322 -- .../deprecated/clutter-behaviour-opacity.h | 115 - clutter/deprecated/clutter-behaviour-path.c | 477 --- clutter/deprecated/clutter-behaviour-path.h | 135 - clutter/deprecated/clutter-behaviour-rotate.c | 697 ---- clutter/deprecated/clutter-behaviour-rotate.h | 119 - clutter/deprecated/clutter-behaviour-scale.c | 443 --- clutter/deprecated/clutter-behaviour-scale.h | 107 - clutter/deprecated/clutter-behaviour.c | 669 ---- clutter/deprecated/clutter-behaviour.h | 170 - clutter/deprecated/clutter-bin-layout.h | 56 - clutter/deprecated/clutter-box.c | 737 ---- clutter/deprecated/clutter-box.h | 143 - clutter/deprecated/clutter-cairo-texture.c | 1177 ------ clutter/deprecated/clutter-cairo-texture.h | 139 - clutter/deprecated/clutter-container.h | 93 - clutter/deprecated/clutter-fixed.c | 205 -- clutter/deprecated/clutter-fixed.h | 97 - clutter/deprecated/clutter-frame-source.c | 267 -- clutter/deprecated/clutter-frame-source.h | 49 - clutter/deprecated/clutter-group.c | 564 --- clutter/deprecated/clutter-group.h | 62 - .../clutter-input-device-deprecated.c | 38 - clutter/deprecated/clutter-input-device.h | 41 - clutter/deprecated/clutter-keysyms.h | 2306 ------------ .../clutter-layout-manager-deprecated.c | 89 - clutter/deprecated/clutter-main.h | 96 - clutter/deprecated/clutter-media.c | 665 ---- clutter/deprecated/clutter-media.h | 121 - clutter/deprecated/clutter-rectangle.c | 559 --- clutter/deprecated/clutter-rectangle.h | 117 - clutter/deprecated/clutter-score.c | 1168 ------ clutter/deprecated/clutter-score.h | 144 - clutter/deprecated/clutter-shader.c | 942 ----- clutter/deprecated/clutter-shader.h | 182 - clutter/deprecated/clutter-stage-manager.h | 42 - clutter/deprecated/clutter-stage.h | 102 - clutter/deprecated/clutter-state.c | 2315 ------------ clutter/deprecated/clutter-state.h | 187 - clutter/deprecated/clutter-texture.c | 3156 ----------------- clutter/deprecated/clutter-texture.h | 138 - clutter/deprecated/clutter-timeline.h | 41 - clutter/deprecated/clutter-timeout-interval.c | 142 - clutter/deprecated/clutter-timeout-interval.h | 58 - clutter/deprecated/clutter-timeout-pool.c | 500 --- clutter/deprecated/clutter-timeout-pool.h | 69 - clutter/deprecated/clutter-util.h | 40 - clutter/gdk/clutter-stage-gdk.h | 1 - clutter/x11/clutter-backend-x11.c | 28 +- clutter/x11/clutter-device-manager-xi2.c | 1 + clutter/x11/clutter-stage-x11.c | 31 - clutter/x11/clutter-stage-x11.h | 3 - clutter/x11/clutter-x11.h | 12 +- 79 files changed, 30 insertions(+), 29157 deletions(-) delete mode 100644 clutter/clutter-group.h delete mode 100644 clutter/clutter-texture.h delete mode 100644 clutter/deprecated/clutter-actor-deprecated.c delete mode 100644 clutter/deprecated/clutter-actor.h delete mode 100644 clutter/deprecated/clutter-alpha.c delete mode 100644 clutter/deprecated/clutter-alpha.h delete mode 100644 clutter/deprecated/clutter-animatable.h delete mode 100644 clutter/deprecated/clutter-animation.c delete mode 100644 clutter/deprecated/clutter-animation.h delete mode 100644 clutter/deprecated/clutter-animator.c delete mode 100644 clutter/deprecated/clutter-animator.h delete mode 100644 clutter/deprecated/clutter-backend.h delete mode 100644 clutter/deprecated/clutter-behaviour-depth.c delete mode 100644 clutter/deprecated/clutter-behaviour-depth.h delete mode 100644 clutter/deprecated/clutter-behaviour-ellipse.c delete mode 100644 clutter/deprecated/clutter-behaviour-ellipse.h delete mode 100644 clutter/deprecated/clutter-behaviour-opacity.c delete mode 100644 clutter/deprecated/clutter-behaviour-opacity.h delete mode 100644 clutter/deprecated/clutter-behaviour-path.c delete mode 100644 clutter/deprecated/clutter-behaviour-path.h delete mode 100644 clutter/deprecated/clutter-behaviour-rotate.c delete mode 100644 clutter/deprecated/clutter-behaviour-rotate.h delete mode 100644 clutter/deprecated/clutter-behaviour-scale.c delete mode 100644 clutter/deprecated/clutter-behaviour-scale.h delete mode 100644 clutter/deprecated/clutter-behaviour.c delete mode 100644 clutter/deprecated/clutter-behaviour.h delete mode 100644 clutter/deprecated/clutter-bin-layout.h delete mode 100644 clutter/deprecated/clutter-box.c delete mode 100644 clutter/deprecated/clutter-box.h delete mode 100644 clutter/deprecated/clutter-cairo-texture.c delete mode 100644 clutter/deprecated/clutter-cairo-texture.h delete mode 100644 clutter/deprecated/clutter-container.h delete mode 100644 clutter/deprecated/clutter-fixed.c delete mode 100644 clutter/deprecated/clutter-fixed.h delete mode 100644 clutter/deprecated/clutter-frame-source.c delete mode 100644 clutter/deprecated/clutter-frame-source.h delete mode 100644 clutter/deprecated/clutter-group.c delete mode 100644 clutter/deprecated/clutter-group.h delete mode 100644 clutter/deprecated/clutter-input-device-deprecated.c delete mode 100644 clutter/deprecated/clutter-input-device.h delete mode 100644 clutter/deprecated/clutter-keysyms.h delete mode 100644 clutter/deprecated/clutter-layout-manager-deprecated.c delete mode 100644 clutter/deprecated/clutter-main.h delete mode 100644 clutter/deprecated/clutter-media.c delete mode 100644 clutter/deprecated/clutter-media.h delete mode 100644 clutter/deprecated/clutter-rectangle.c delete mode 100644 clutter/deprecated/clutter-rectangle.h delete mode 100644 clutter/deprecated/clutter-score.c delete mode 100644 clutter/deprecated/clutter-score.h delete mode 100644 clutter/deprecated/clutter-shader.c delete mode 100644 clutter/deprecated/clutter-shader.h delete mode 100644 clutter/deprecated/clutter-stage-manager.h delete mode 100644 clutter/deprecated/clutter-stage.h delete mode 100644 clutter/deprecated/clutter-state.c delete mode 100644 clutter/deprecated/clutter-state.h delete mode 100644 clutter/deprecated/clutter-texture.c delete mode 100644 clutter/deprecated/clutter-texture.h delete mode 100644 clutter/deprecated/clutter-timeline.h delete mode 100644 clutter/deprecated/clutter-timeout-interval.c delete mode 100644 clutter/deprecated/clutter-timeout-interval.h delete mode 100644 clutter/deprecated/clutter-timeout-pool.c delete mode 100644 clutter/deprecated/clutter-timeout-pool.h delete mode 100644 clutter/deprecated/clutter-util.h diff --git a/clutter/clutter-enums.h b/clutter/clutter-enums.h index 1fa5389d9..2a30e65a7 100644 --- a/clutter/clutter-enums.h +++ b/clutter/clutter-enums.h @@ -30,38 +30,6 @@ G_BEGIN_DECLS -/** - * ClutterGravity: - * @CLUTTER_GRAVITY_NONE: Do not apply any gravity - * @CLUTTER_GRAVITY_NORTH: Scale from topmost downwards - * @CLUTTER_GRAVITY_NORTH_EAST: Scale from the top right corner - * @CLUTTER_GRAVITY_EAST: Scale from the right side - * @CLUTTER_GRAVITY_SOUTH_EAST: Scale from the bottom right corner - * @CLUTTER_GRAVITY_SOUTH: Scale from the bottom upwards - * @CLUTTER_GRAVITY_SOUTH_WEST: Scale from the bottom left corner - * @CLUTTER_GRAVITY_WEST: Scale from the left side - * @CLUTTER_GRAVITY_NORTH_WEST: Scale from the top left corner - * @CLUTTER_GRAVITY_CENTER: Scale from the center. - * - * Gravity of the scaling operations. When a gravity different than - * %CLUTTER_GRAVITY_NONE is used, an actor is scaled keeping the position - * of the specified portion at the same coordinates. - * - * - */ -typedef enum { /*< prefix=CLUTTER_GRAVITY >*/ - CLUTTER_GRAVITY_NONE = 0, - CLUTTER_GRAVITY_NORTH, - CLUTTER_GRAVITY_NORTH_EAST, - CLUTTER_GRAVITY_EAST, - CLUTTER_GRAVITY_SOUTH_EAST, - CLUTTER_GRAVITY_SOUTH, - CLUTTER_GRAVITY_SOUTH_WEST, - CLUTTER_GRAVITY_WEST, - CLUTTER_GRAVITY_NORTH_WEST, - CLUTTER_GRAVITY_CENTER -} ClutterGravity; - /** * ClutterRotateAxis: * @CLUTTER_X_AXIS: Rotate around the X axis @@ -161,37 +129,31 @@ typedef enum { /*< prefix=CLUTTER_REQUEST >*/ * @CLUTTER_EASE_IN_OUT_BOUNCE: exponentially decaying parabolic (bounce) * tweening, with bounce on both ends * @CLUTTER_STEPS: parametrized step function; see clutter_timeline_set_step_progress() - * for further details. (Since 1.12) + * for further details. * @CLUTTER_STEP_START: equivalent to %CLUTTER_STEPS with a number of steps - * equal to 1, and a step mode of %CLUTTER_STEP_MODE_START. (Since 1.12) + * equal to 1, and a step mode of %CLUTTER_STEP_MODE_START. * @CLUTTER_STEP_END: equivalent to %CLUTTER_STEPS with a number of steps - * equal to 1, and a step mode of %CLUTTER_STEP_MODE_END. (Since 1.12) + * equal to 1, and a step mode of %CLUTTER_STEP_MODE_END. * @CLUTTER_CUBIC_BEZIER: cubic bezier between (0, 0) and (1, 1) with two - * control points; see clutter_timeline_set_cubic_bezier_progress(). (Since 1.12) + * control points; see clutter_timeline_set_cubic_bezier_progress(). * @CLUTTER_EASE: equivalent to %CLUTTER_CUBIC_BEZIER with control points - * in (0.25, 0.1) and (0.25, 1.0). (Since 1.12) + * in (0.25, 0.1) and (0.25, 1.0). * @CLUTTER_EASE_IN: equivalent to %CLUTTER_CUBIC_BEZIER with control points - * in (0.42, 0) and (1.0, 1.0). (Since 1.12) + * in (0.42, 0) and (1.0, 1.0). * @CLUTTER_EASE_OUT: equivalent to %CLUTTER_CUBIC_BEZIER with control points - * in (0, 0) and (0.58, 1.0). (Since 1.12) + * in (0, 0) and (0.58, 1.0). * @CLUTTER_EASE_IN_OUT: equivalent to %CLUTTER_CUBIC_BEZIER with control points - * in (0.42, 0) and (0.58, 1.0). (Since 1.12) - * @CLUTTER_ANIMATION_LAST: last animation mode, used as a guard for - * registered global alpha functions + * in (0.42, 0) and (0.58, 1.0). + * @CLUTTER_ANIMATION_LAST: last animation mode, used as a guard when enumerating * - * The animation modes used by #ClutterAlpha and #ClutterAnimation. This - * enumeration can be expanded in later versions of Clutter. + * The animation modes used by #ClutterTimeline. + * + * This enumeration can be expanded in later versions of Clutter. * *
* Easing modes provided by Clutter * *
- * - * Every global alpha function registered using clutter_alpha_register_func() - * or clutter_alpha_register_closure() will have a logical id greater than - * %CLUTTER_ANIMATION_LAST. - * - * */ typedef enum { CLUTTER_CUSTOM_MODE = 0, @@ -261,7 +223,7 @@ typedef enum { CLUTTER_EASE_OUT, CLUTTER_EASE_IN_OUT, - /* guard, before registered alpha functions */ + /* guard */ CLUTTER_ANIMATION_LAST } ClutterAnimationMode; @@ -452,20 +414,6 @@ typedef enum { /*< prefix=CLUTTER_ALIGN >*/ CLUTTER_ALIGN_BOTH } ClutterAlignAxis; -/** - * ClutterInterpolation: - * @CLUTTER_INTERPOLATION_LINEAR: linear interpolation - * @CLUTTER_INTERPOLATION_CUBIC: cubic interpolation - * - * The mode of interpolation between key frames - * - * - */ -typedef enum { - CLUTTER_INTERPOLATION_LINEAR, - CLUTTER_INTERPOLATION_CUBIC -} ClutterInterpolation; - /** * ClutterBindCoordinate: * @CLUTTER_BIND_X: Bind the X coordinate diff --git a/clutter/clutter-group.h b/clutter/clutter-group.h deleted file mode 100644 index e0021b2c0..000000000 --- a/clutter/clutter-group.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * Copyright (C) 2006 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_GROUP_H__ -#define __CLUTTER_GROUP_H__ - -#include -#include -#include - -G_BEGIN_DECLS - -#define CLUTTER_TYPE_GROUP (clutter_group_get_type ()) -#define CLUTTER_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_GROUP, ClutterGroup)) -#define CLUTTER_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_GROUP, ClutterGroupClass)) -#define CLUTTER_IS_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_GROUP)) -#define CLUTTER_IS_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_GROUP)) -#define CLUTTER_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_GROUP, ClutterGroupClass)) - -/* XXX - ClutterGroup is to be considered fully deprecated; the only - * reason we keep this header is because ClutterStage inherits from - * ClutterGroup, and thus we need to have a structure definition for - * the Stage object to expand. - */ - -typedef struct _ClutterGroup ClutterGroup; -typedef struct _ClutterGroupClass ClutterGroupClass; -typedef struct _ClutterGroupPrivate ClutterGroupPrivate; - -/** - * ClutterGroup: - * - * The #ClutterGroup structure contains only private data - * and should be accessed using the provided API - * - * - */ -struct _ClutterGroup -{ - /*< private >*/ - ClutterActor parent_instance; - - ClutterGroupPrivate *priv; -}; - -/** - * ClutterGroupClass: - * - * The #ClutterGroupClass structure contains only private data - * - * - */ -struct _ClutterGroupClass -{ - /*< private >*/ - ClutterActorClass parent_class; - - /* padding for future expansion */ - void (*_clutter_reserved1) (void); - void (*_clutter_reserved2) (void); - void (*_clutter_reserved3) (void); - void (*_clutter_reserved4) (void); - void (*_clutter_reserved5) (void); - void (*_clutter_reserved6) (void); -}; - -GType clutter_group_get_type (void) G_GNUC_CONST; - -G_END_DECLS - -#endif /* __CLUTTER_GROUP_H__ */ diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c index bcb740fd7..693e26579 100644 --- a/clutter/clutter-main.c +++ b/clutter/clutter-main.c @@ -467,6 +467,14 @@ _clutter_context_get_show_fps (void) return context->show_fps; } +guint +_clutter_context_get_frame_rate (void) +{ + ClutterMainContext *context = _clutter_context_get_default (); + + return context->frame_rate; +} + /** * clutter_get_accessibility_enabled: * @@ -2635,25 +2643,6 @@ clutter_base_init (void) } } -/** - * clutter_get_default_frame_rate: - * - * Retrieves the default frame rate. See clutter_set_default_frame_rate(). - * - * Return value: the default frame rate - * - * - */ -guint -clutter_get_default_frame_rate (void) -{ - ClutterMainContext *context; - - context = _clutter_context_get_default (); - - return context->frame_rate; -} - static void on_grab_actor_destroy (ClutterActor *actor, ClutterInputDevice *device) diff --git a/clutter/clutter-main.h b/clutter/clutter-main.h index 7138ef3da..9a3764d0f 100644 --- a/clutter/clutter-main.h +++ b/clutter/clutter-main.h @@ -141,8 +141,6 @@ PangoFontMap * clutter_get_font_map (void); ClutterTextDirection clutter_get_default_text_direction (void); -guint clutter_get_default_frame_rate (void); - G_END_DECLS #endif /* _CLUTTER_MAIN_H__ */ diff --git a/clutter/clutter-master-clock.c b/clutter/clutter-master-clock.c index 104ea0c81..d16d55bfc 100644 --- a/clutter/clutter-master-clock.c +++ b/clutter/clutter-master-clock.c @@ -326,12 +326,12 @@ master_clock_next_frame_delay (ClutterMasterClock *master_clock) return 0; } - next += (1000000L / clutter_get_default_frame_rate ()); + next += (1000000L / _clutter_context_get_frame_rate ()); if (next <= now) { CLUTTER_NOTE (SCHEDULER, "Less than %lu microsecs", - 1000000L / (gulong) clutter_get_default_frame_rate ()); + 1000000L / (gulong) _clutter_context_get_frame_rate ()); return 0; } diff --git a/clutter/clutter-private.h b/clutter/clutter-private.h index 2136efe75..506916f8d 100644 --- a/clutter/clutter-private.h +++ b/clutter/clutter-private.h @@ -211,6 +211,7 @@ guint32 _clutter_context_acquire_id (gpointe void _clutter_context_release_id (guint32 id_); gboolean _clutter_context_get_motion_events_enabled (void); gboolean _clutter_context_get_show_fps (void); +guint _clutter_context_get_frame_rate (void); const gchar *_clutter_gettext (const gchar *str); diff --git a/clutter/clutter-script.c b/clutter/clutter-script.c index 5ef8d8f13..00c2b52b2 100644 --- a/clutter/clutter-script.c +++ b/clutter/clutter-script.c @@ -131,11 +131,8 @@ #include #include -#define CLUTTER_DISABLE_DEPRECATION_WARNINGS - #include "clutter-actor.h" #include "clutter-stage.h" -#include "clutter-texture.h" #include "clutter-script.h" #include "clutter-script-private.h" diff --git a/clutter/clutter-stage.h b/clutter/clutter-stage.h index 6c8c2a0a0..9c49c1841 100644 --- a/clutter/clutter-stage.h +++ b/clutter/clutter-stage.h @@ -29,7 +29,7 @@ #define __CLUTTER_STAGE_H__ #include -#include +#include G_BEGIN_DECLS diff --git a/clutter/clutter-texture.h b/clutter/clutter-texture.h deleted file mode 100644 index f30fef3f9..000000000 --- a/clutter/clutter-texture.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * Copyright (C) 2006 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_TEXTURE_H__ -#define __CLUTTER_TEXTURE_H__ - -#include -#include - -G_BEGIN_DECLS - -#define CLUTTER_TYPE_TEXTURE (clutter_texture_get_type ()) -#define CLUTTER_TEXTURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_TEXTURE, ClutterTexture)) -#define CLUTTER_TEXTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_TEXTURE, ClutterTextureClass)) -#define CLUTTER_IS_TEXTURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_TEXTURE)) -#define CLUTTER_IS_TEXTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_TEXTURE)) -#define CLUTTER_TEXTURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_TEXTURE, ClutterTextureClass)) - -/** - * ClutterTextureError: - * @CLUTTER_TEXTURE_ERROR_OUT_OF_MEMORY: OOM condition - * @CLUTTER_TEXTURE_ERROR_NO_YUV: YUV operation attempted but no YUV support - * found - * @CLUTTER_TEXTURE_ERROR_BAD_FORMAT: The requested format for - * clutter_texture_set_from_rgb_data or - * clutter_texture_set_from_yuv_data is unsupported. - * - * Error enumeration for #ClutterTexture - * - * - */ -typedef enum { - CLUTTER_TEXTURE_ERROR_OUT_OF_MEMORY, - CLUTTER_TEXTURE_ERROR_NO_YUV, - CLUTTER_TEXTURE_ERROR_BAD_FORMAT -} ClutterTextureError; - -/** - * CLUTTER_TEXTURE_ERROR: - * - * Error domain for #ClutterTexture errors - * - * - */ -#define CLUTTER_TEXTURE_ERROR (clutter_texture_error_quark ()) -GQuark clutter_texture_error_quark (void); - -typedef struct _ClutterTexture ClutterTexture; -typedef struct _ClutterTextureClass ClutterTextureClass; -typedef struct _ClutterTexturePrivate ClutterTexturePrivate; - -/** - * ClutterTexture: - * - * The #ClutterTexture structure contains only private data - * and should be accessed using the provided API - * - * - */ -struct _ClutterTexture -{ - /*< private >*/ - ClutterActor parent; - - ClutterTexturePrivate *priv; -}; - -/** - * ClutterTextureClass: - * @size_change: handler for the #ClutterTexture::size-change signal - * @pixbuf_change: handler for the #ClutterTexture::pixbuf-change signal - * @load_finished: handler for the #ClutterTexture::load-finished signal - * - * The #ClutterTextureClass structure contains only private data - * - * - */ -struct _ClutterTextureClass -{ - /*< private >*/ - ClutterActorClass parent_class; - - /*< public >*/ - void (* size_change) (ClutterTexture *texture, - gint width, - gint height); - void (* pixbuf_change) (ClutterTexture *texture); - void (* load_finished) (ClutterTexture *texture, - const GError *error); - - /*< private >*/ - /* padding, for future expansion */ - void (*_clutter_texture1) (void); - void (*_clutter_texture2) (void); - void (*_clutter_texture3) (void); - void (*_clutter_texture4) (void); - void (*_clutter_texture5) (void); -}; - -GType clutter_texture_get_type (void) G_GNUC_CONST; - -G_END_DECLS - -#endif /* __CLUTTER_TEXTURE_H__ */ diff --git a/clutter/clutter-types.h b/clutter/clutter-types.h index dd3c98a82..670507b8d 100644 --- a/clutter/clutter-types.h +++ b/clutter/clutter-types.h @@ -85,11 +85,6 @@ typedef struct _ClutterRect ClutterRect; typedef struct _ClutterSize ClutterSize; typedef struct _ClutterVertex ClutterVertex; -typedef struct _ClutterAlpha ClutterAlpha; -typedef struct _ClutterAnimation ClutterAnimation; -typedef struct _ClutterAnimator ClutterAnimator; -typedef struct _ClutterState ClutterState; - typedef struct _ClutterInputDevice ClutterInputDevice; typedef CoglMatrix ClutterMatrix; @@ -106,10 +101,6 @@ typedef union _ClutterEvent ClutterEvent; */ typedef struct _ClutterEventSequence ClutterEventSequence; -typedef struct _ClutterFog ClutterFog; /* deprecated */ -typedef struct _ClutterBehaviour ClutterBehaviour; /* deprecated */ -typedef struct _ClutterShader ClutterShader; /* deprecated */ - /** * ClutterPaintVolume: * diff --git a/clutter/clutter.h b/clutter/clutter.h index 5bdd6bcf5..750fc326a 100644 --- a/clutter/clutter.h +++ b/clutter/clutter.h @@ -67,7 +67,6 @@ #include "clutter-flow-layout.h" #include "clutter-gesture-action.h" #include "clutter-grid-layout.h" -#include "clutter-group.h" #include "clutter-image.h" #include "clutter-input-device.h" #include "clutter-interval.h" @@ -100,7 +99,6 @@ #include "clutter-stage-manager.h" #include "clutter-table-layout.h" #include "clutter-tap-action.h" -#include "clutter-texture.h" #include "clutter-text.h" #include "clutter-timeline.h" #include "clutter-transition-group.h" diff --git a/clutter/clutter.symbols b/clutter/clutter.symbols index bc5da5d3a..c75cda176 100644 --- a/clutter/clutter.symbols +++ b/clutter/clutter.symbols @@ -513,7 +513,6 @@ clutter_get_accessibility_enabled clutter_get_current_event clutter_get_current_event_time clutter_get_default_backend -clutter_get_default_frame_rate clutter_get_default_text_direction clutter_get_font_map clutter_get_keyboard_grab @@ -523,7 +522,6 @@ clutter_get_pointer_grab clutter_get_script_id clutter_grab_keyboard clutter_grab_pointer -clutter_gravity_get_type clutter_grid_child_get_type clutter_grid_layout_get_type clutter_grid_layout_new @@ -556,7 +554,6 @@ clutter_init clutter_init_error_get_type clutter_init_error_quark clutter_init_with_args -clutter_interpolation_get_type clutter_interval_clone clutter_interval_compute clutter_interval_compute_value @@ -1185,10 +1182,8 @@ clutter_x11_filter_return_get_type clutter_x11_get_current_event_time clutter_x11_get_default_display clutter_x11_get_default_screen -clutter_x11_get_input_devices clutter_x11_get_root_window clutter_x11_get_stage_from_window -clutter_x11_get_stage_visual clutter_x11_get_stage_window clutter_x11_get_use_argb_visual clutter_x11_get_visual_info diff --git a/clutter/deprecated/clutter-actor-deprecated.c b/clutter/deprecated/clutter-actor-deprecated.c deleted file mode 100644 index 436d4f668..000000000 --- a/clutter/deprecated/clutter-actor-deprecated.c +++ /dev/null @@ -1,411 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#define CLUTTER_DISABLE_DEPRECATION_WARNINGS -#include "deprecated/clutter-actor.h" - -#include "clutter-actor-private.h" -#include "clutter-private.h" -#include "clutter-shader.h" - -typedef struct _ShaderData ShaderData; - -struct _ShaderData -{ - ClutterShader *shader; - - /* back pointer to the actor */ - ClutterActor *actor; - - /* list of values that should be set on the shader - * before each paint cycle - */ - GHashTable *value_hash; -}; - -static void -shader_value_free (gpointer data) -{ - GValue *var = data; - g_value_unset (var); - g_slice_free (GValue, var); -} - -static void -destroy_shader_data (gpointer data) -{ - ShaderData *shader_data = data; - - if (shader_data == NULL) - return; - - if (shader_data->shader != NULL) - { - g_object_unref (shader_data->shader); - shader_data->shader = NULL; - } - - if (shader_data->value_hash != NULL) - { - g_hash_table_destroy (shader_data->value_hash); - shader_data->value_hash = NULL; - } - - g_slice_free (ShaderData, shader_data); -} - -/** - * clutter_actor_get_shader: - * @self: a #ClutterActor - * - * Queries the currently set #ClutterShader on @self. - * - * Return value: (transfer none): The currently set #ClutterShader - * or %NULL if no shader is set. - * - * - * - * Deprecated: 1.8: Use clutter_actor_get_effect() instead. - */ -ClutterShader * -clutter_actor_get_shader (ClutterActor *self) -{ - ShaderData *shader_data; - - g_return_val_if_fail (CLUTTER_IS_ACTOR (self), NULL); - - shader_data = g_object_get_data (G_OBJECT (self), "-clutter-actor-shader-data"); - if (shader_data != NULL) - return shader_data->shader; - - return NULL; -} - -/** - * clutter_actor_set_shader: - * @self: a #ClutterActor - * @shader: (allow-none): a #ClutterShader or %NULL to unset the shader. - * - * Sets the #ClutterShader to be used when rendering @self. - * - * If @shader is %NULL this function will unset any currently set shader - * for the actor. - * - * Any #ClutterEffect applied to @self will take the precedence - * over the #ClutterShader set using this function. - * - * Return value: %TRUE if the shader was successfully applied - * or removed - * - * - * - * Deprecated: 1.8: Use #ClutterShaderEffect and - * clutter_actor_add_effect() instead. - */ -gboolean -clutter_actor_set_shader (ClutterActor *self, - ClutterShader *shader) -{ - ShaderData *shader_data; - - g_return_val_if_fail (CLUTTER_IS_ACTOR (self), FALSE); - g_return_val_if_fail (shader == NULL || CLUTTER_IS_SHADER (shader), FALSE); - - if (shader != NULL) - g_object_ref (shader); - else - { - /* if shader passed in is NULL we destroy the shader */ - g_object_set_data (G_OBJECT (self), "-clutter-actor-shader-data", NULL); - return TRUE; - } - - shader_data = g_object_get_data (G_OBJECT (self), "-clutter-actor-shader-data"); - if (shader_data == NULL) - { - shader_data = g_slice_new (ShaderData); - shader_data->actor = self; - shader_data->shader = NULL; - shader_data->value_hash = - g_hash_table_new_full (g_str_hash, g_str_equal, - g_free, - shader_value_free); - - g_object_set_data_full (G_OBJECT (self), "-clutter-actor-shader-data", - shader_data, - destroy_shader_data); - } - - if (shader_data->shader != NULL) - g_object_unref (shader_data->shader); - - shader_data->shader = shader; - - clutter_actor_queue_redraw (self); - - return TRUE; -} - -static void -set_each_param (gpointer key, - gpointer value, - gpointer user_data) -{ - ClutterShader *shader = user_data; - const gchar *uniform = key; - GValue *var = value; - - clutter_shader_set_uniform (shader, uniform, var); -} - -void -_clutter_actor_shader_pre_paint (ClutterActor *actor, - gboolean repeat) -{ - ShaderData *shader_data; - ClutterShader *shader; - - shader_data = g_object_get_data (G_OBJECT (actor), "-clutter-actor-shader-data"); - if (shader_data == NULL) - return; - - shader = shader_data->shader; - if (shader != NULL) - { - clutter_shader_set_is_enabled (shader, TRUE); - - g_hash_table_foreach (shader_data->value_hash, set_each_param, shader); - - if (!repeat) - _clutter_context_push_shader_stack (actor); - } -} - -void -_clutter_actor_shader_post_paint (ClutterActor *actor) -{ - ShaderData *shader_data; - ClutterShader *shader; - - shader_data = g_object_get_data (G_OBJECT (actor), "-clutter-actor-shader-data"); - if (G_LIKELY (shader_data == NULL)) - return; - - shader = shader_data->shader; - if (shader != NULL) - { - ClutterActor *head; - - clutter_shader_set_is_enabled (shader, FALSE); - - /* remove the actor from the shaders stack; if there is another - * actor inside it, then call pre-paint again to set its shader - * but this time with the second argument being TRUE, indicating - * that we are re-applying an existing shader and thus should it - * not be prepended to the stack - */ - head = _clutter_context_pop_shader_stack (actor); - if (head != NULL) - _clutter_actor_shader_pre_paint (head, TRUE); - } -} - -static inline void -clutter_actor_set_shader_param_internal (ClutterActor *self, - const gchar *param, - const GValue *value) -{ - ShaderData *shader_data; - GValue *var; - - shader_data = g_object_get_data (G_OBJECT (self), "-clutter-actor-shader-data"); - if (shader_data == NULL) - return; - - var = g_slice_new0 (GValue); - g_value_init (var, G_VALUE_TYPE (value)); - g_value_copy (value, var); - g_hash_table_insert (shader_data->value_hash, g_strdup (param), var); - - clutter_actor_queue_redraw (self); -} - -/** - * clutter_actor_set_shader_param: - * @self: a #ClutterActor - * @param: the name of the parameter - * @value: the value of the parameter - * - * Sets the value for a named parameter of the shader applied - * to @actor. - * - * - * - * Deprecated: 1.8: Use clutter_shader_effect_set_uniform_value() instead - */ -void -clutter_actor_set_shader_param (ClutterActor *self, - const gchar *param, - const GValue *value) -{ - g_return_if_fail (CLUTTER_IS_ACTOR (self)); - g_return_if_fail (param != NULL); - g_return_if_fail (CLUTTER_VALUE_HOLDS_SHADER_FLOAT (value) || - CLUTTER_VALUE_HOLDS_SHADER_INT (value) || - CLUTTER_VALUE_HOLDS_SHADER_MATRIX (value) || - G_VALUE_HOLDS_FLOAT (value) || - G_VALUE_HOLDS_INT (value)); - - clutter_actor_set_shader_param_internal (self, param, value); -} - -/** - * clutter_actor_set_shader_param_float: - * @self: a #ClutterActor - * @param: the name of the parameter - * @value: the value of the parameter - * - * Sets the value for a named float parameter of the shader applied - * to @actor. - * - * - * - * Deprecated: 1.8: Use clutter_shader_effect_set_uniform() instead - */ -void -clutter_actor_set_shader_param_float (ClutterActor *self, - const gchar *param, - gfloat value) -{ - GValue var = { 0, }; - - g_value_init (&var, G_TYPE_FLOAT); - g_value_set_float (&var, value); - - clutter_actor_set_shader_param_internal (self, param, &var); - - g_value_unset (&var); -} - -/** - * clutter_actor_set_shader_param_int: - * @self: a #ClutterActor - * @param: the name of the parameter - * @value: the value of the parameter - * - * Sets the value for a named int parameter of the shader applied to - * @actor. - * - * - * - * Deprecated: 1.8: Use clutter_shader_effect_set_uniform() instead - */ -void -clutter_actor_set_shader_param_int (ClutterActor *self, - const gchar *param, - gint value) -{ - GValue var = { 0, }; - - g_value_init (&var, G_TYPE_INT); - g_value_set_int (&var, value); - - clutter_actor_set_shader_param_internal (self, param, &var); - - g_value_unset (&var); -} - -/** - * clutter_actor_set_geometry: - * @self: A #ClutterActor - * @geometry: A #ClutterGeometry - * - * Sets the actor's fixed position and forces its minimum and natural - * size, in pixels. This means the untransformed actor will have the - * given geometry. This is the same as calling clutter_actor_set_position() - * and clutter_actor_set_size(). - * - * Deprecated: 1.10: Use clutter_actor_set_position() and - * clutter_actor_set_size() instead. - */ -void -clutter_actor_set_geometry (ClutterActor *self, - const ClutterGeometry *geometry) -{ - g_object_freeze_notify (G_OBJECT (self)); - - clutter_actor_set_position (self, geometry->x, geometry->y); - clutter_actor_set_size (self, geometry->width, geometry->height); - - g_object_thaw_notify (G_OBJECT (self)); -} - -/** - * clutter_actor_get_geometry: - * @self: A #ClutterActor - * @geometry: (out caller-allocates): A location to store actors #ClutterGeometry - * - * Gets the size and position of an actor relative to its parent - * actor. This is the same as calling clutter_actor_get_position() and - * clutter_actor_get_size(). It tries to "do what you mean" and get the - * requested size and position if the actor's allocation is invalid. - * - * Deprecated: 1.10: Use clutter_actor_get_position() and - * clutter_actor_get_size(), or clutter_actor_get_allocation_geometry() - * instead. - */ -void -clutter_actor_get_geometry (ClutterActor *self, - ClutterGeometry *geometry) -{ - gfloat x, y, width, height; - - g_return_if_fail (CLUTTER_IS_ACTOR (self)); - g_return_if_fail (geometry != NULL); - - clutter_actor_get_position (self, &x, &y); - clutter_actor_get_size (self, &width, &height); - - geometry->x = (int) x; - geometry->y = (int) y; - geometry->width = (int) width; - geometry->height = (int) height; -} - -/** - * clutter_actor_get_allocation_geometry: - * @self: A #ClutterActor - * @geom: (out): allocation geometry in pixels - * - * Gets the layout box an actor has been assigned. The allocation can - * only be assumed valid inside a paint() method; anywhere else, it - * may be out-of-date. - * - * An allocation does not incorporate the actor's scale or anchor point; - * those transformations do not affect layout, only rendering. - * - * The returned rectangle is in pixels. - * - * - * - * Deprecated: 1.12: Use clutter_actor_get_allocation_box() instead. - */ -void -clutter_actor_get_allocation_geometry (ClutterActor *self, - ClutterGeometry *geom) -{ - ClutterActorBox box; - - g_return_if_fail (CLUTTER_IS_ACTOR (self)); - g_return_if_fail (geom != NULL); - - clutter_actor_get_allocation_box (self, &box); - - geom->x = CLUTTER_NEARBYINT (clutter_actor_box_get_x (&box)); - geom->y = CLUTTER_NEARBYINT (clutter_actor_box_get_y (&box)); - geom->width = CLUTTER_NEARBYINT (clutter_actor_box_get_width (&box)); - geom->height = CLUTTER_NEARBYINT (clutter_actor_box_get_height (&box)); -} diff --git a/clutter/deprecated/clutter-actor.h b/clutter/deprecated/clutter-actor.h deleted file mode 100644 index 9302e9423..000000000 --- a/clutter/deprecated/clutter-actor.h +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * Copyright (C) 2006, 2007, 2008 OpenedHand Ltd - * Copyright (C) 2009, 2010 Intel Corp - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_ACTOR_DEPRECATED_H__ -#define __CLUTTER_ACTOR_DEPRECATED_H__ - -#include - -G_BEGIN_DECLS - -CLUTTER_DEPRECATED_IN_1_10 -void clutter_actor_set_geometry (ClutterActor *self, - const ClutterGeometry *geometry); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_get_allocation_geometry) -void clutter_actor_get_geometry (ClutterActor *self, - ClutterGeometry *geometry); -CLUTTER_DEPRECATED_IN_1_8 -guint32 clutter_actor_get_gid (ClutterActor *self); - -CLUTTER_DEPRECATED_IN_1_8 -ClutterActor * clutter_get_actor_by_gid (guint32 id_); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_remove_child() and clutter_actor_add_child()) -void clutter_actor_reparent (ClutterActor *self, - ClutterActor *new_parent); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_add_child) -void clutter_actor_set_parent (ClutterActor *self, - ClutterActor *parent); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_remove_child) -void clutter_actor_unparent (ClutterActor *self); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_set_child_above_sibling) -void clutter_actor_raise (ClutterActor *self, - ClutterActor *below); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_set_child_below_sibling) -void clutter_actor_lower (ClutterActor *self, - ClutterActor *above); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_set_child_above_sibling() with NULL sibling) -void clutter_actor_raise_top (ClutterActor *self); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_set_child_below_sibling() with NULL sibling) -void clutter_actor_lower_bottom (ClutterActor *self); - -CLUTTER_DEPRECATED_IN_1_10 -void clutter_actor_push_internal (ClutterActor *self); - -CLUTTER_DEPRECATED_IN_1_10 -void clutter_actor_pop_internal (ClutterActor *self); - -CLUTTER_DEPRECATED_IN_1_10 -void clutter_actor_show_all (ClutterActor *self); - -CLUTTER_DEPRECATED_IN_1_10 -void clutter_actor_hide_all (ClutterActor *self); - -CLUTTER_DEPRECATED_IN_1_12_FOR(clutter_actor_set_z_position) -void clutter_actor_set_depth (ClutterActor *self, - gfloat depth); - -CLUTTER_DEPRECATED_IN_1_12_FOR(clutter_actor_get_z_position) -gfloat clutter_actor_get_depth (ClutterActor *self); - -CLUTTER_DEPRECATED_IN_1_12_FOR(clutter_actor_set_rotation_angle) -void clutter_actor_set_rotation (ClutterActor *self, - ClutterRotateAxis axis, - gdouble angle, - gfloat x, - gfloat y, - gfloat z); -CLUTTER_DEPRECATED_IN_1_12_FOR(clutter_actor_set_rotation_angle and clutter_actor_set_pivot_point) -void clutter_actor_set_z_rotation_from_gravity (ClutterActor *self, - gdouble angle, - ClutterGravity gravity); -CLUTTER_DEPRECATED_IN_1_12_FOR(clutter_actor_get_rotation_angle) -gdouble clutter_actor_get_rotation (ClutterActor *self, - ClutterRotateAxis axis, - gfloat *x, - gfloat *y, - gfloat *z); -CLUTTER_DEPRECATED_IN_1_12 -ClutterGravity clutter_actor_get_z_rotation_gravity (ClutterActor *self); - -CLUTTER_DEPRECATED_IN_1_12_FOR(clutter_actor_set_scale and clutter_actor_set_pivot_point) -void clutter_actor_set_scale_full (ClutterActor *self, - gdouble scale_x, - gdouble scale_y, - gfloat center_x, - gfloat center_y); -CLUTTER_DEPRECATED_IN_1_12_FOR(clutter_actor_set_scale and clutter_actor_set_pivot_point) -void clutter_actor_set_scale_with_gravity (ClutterActor *self, - gdouble scale_x, - gdouble scale_y, - ClutterGravity gravity); -CLUTTER_DEPRECATED_IN_1_12_FOR(clutter_actor_get_pivot_point) -void clutter_actor_get_scale_center (ClutterActor *self, - gfloat *center_x, - gfloat *center_y); -CLUTTER_DEPRECATED_IN_1_12_FOR(clutter_actor_get_pivot_point) -ClutterGravity clutter_actor_get_scale_gravity (ClutterActor *self); - -CLUTTER_DEPRECATED_IN_1_12 -void clutter_actor_set_anchor_point (ClutterActor *self, - gfloat anchor_x, - gfloat anchor_y); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_actor_move_anchor_point (ClutterActor *self, - gfloat anchor_x, - gfloat anchor_y); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_actor_get_anchor_point (ClutterActor *self, - gfloat *anchor_x, - gfloat *anchor_y); -CLUTTER_DEPRECATED_IN_1_12 -ClutterGravity clutter_actor_get_anchor_point_gravity (ClutterActor *self); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_actor_set_anchor_point_from_gravity (ClutterActor *self, - ClutterGravity gravity); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_actor_move_anchor_point_from_gravity (ClutterActor *self, - ClutterGravity gravity); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_actor_get_transformation_matrix (ClutterActor *self, - ClutterMatrix *matrix); - -CLUTTER_DEPRECATED_IN_1_12_FOR (clutter_actor_get_allocation_box) -void clutter_actor_get_allocation_geometry (ClutterActor *self, - ClutterGeometry *geom); - -G_END_DECLS - -#endif /* __CLUTTER_ACTOR_DEPRECATED_H__ */ diff --git a/clutter/deprecated/clutter-alpha.c b/clutter/deprecated/clutter-alpha.c deleted file mode 100644 index f2f30c148..000000000 --- a/clutter/deprecated/clutter-alpha.c +++ /dev/null @@ -1,959 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * Jorn Baayen - * Emmanuele Bassi - * Tomas Frydrych - * - * Copyright (C) 2006, 2007, 2008 OpenedHand - * Copyright (C) 2009, 2010 Intel Corp. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -/** - * SECTION:clutter-alpha - * @short_description: A class for calculating a value as a function of time - * - * #ClutterAlpha is a class for calculating an floating point value - * dependent only on the position of a #ClutterTimeline. - * - * For newly written code, it is recommended to use the - * #ClutterTimeline:progress-mode property of #ClutterTimeline, or the - * clutter_timeline_set_progress_func() function instead of #ClutterAlpha. - * The #ClutterAlpha class will be deprecated in the future, and will not - * be available any more in the next major version of Clutter. - * - * A #ClutterAlpha binds a #ClutterTimeline to a progress function which - * translates the time T into an adimensional factor alpha. The factor can - * then be used to drive a #ClutterBehaviour, which will translate the - * alpha value into something meaningful for a #ClutterActor. - * - * You should provide a #ClutterTimeline and bind it to the #ClutterAlpha - * instance using clutter_alpha_set_timeline(). You should also set an - * "animation mode", either by using the #ClutterAnimationMode values that - * Clutter itself provides or by registering custom functions using - * clutter_alpha_register_func(). - * - * Instead of a #ClutterAnimationMode you may provide a function returning - * the alpha value depending on the progress of the timeline, using - * clutter_alpha_set_func() or clutter_alpha_set_closure(). The alpha - * function will be executed each time a new frame in the #ClutterTimeline - * is reached. - * - * Since the alpha function is controlled by the timeline instance, you can - * pause, stop or resume the #ClutterAlpha from calling the alpha function by - * using the appropriate functions of the #ClutterTimeline object. - * - * #ClutterAlpha is used to "drive" a #ClutterBehaviour instance, and it - * is internally used by the #ClutterAnimation API. - * - * - * ClutterAlpha custom properties for #ClutterScript - * #ClutterAlpha defines a custom "function" property for - * #ClutterScript which allows to reference a custom alpha function - * available in the source code. Setting the "function" property - * is equivalent to calling clutter_alpha_set_func() with the - * specified function name. No user data or #GDestroyNotify is - * available to be passed. - * - * Defining a ClutterAlpha in ClutterScript - * The following JSON fragment defines a #ClutterAlpha - * using a #ClutterTimeline with id "sine-timeline" and an alpha - * function called my_sine_alpha. The defined - * #ClutterAlpha instance can be reused in multiple #ClutterBehaviour - * definitions or for #ClutterAnimation definitions. - * - * - * For the way to define the #ClutterAlpha:mode property - * inside a ClutterScript fragment, see the corresponding section - * in #ClutterAnimation. - * - * - * #ClutterAlpha is available since Clutter 0.2. - * - * #ClutterAlpha is deprecated since Clutter 1.12; use #ClutterTimeline and the - * #ClutterTimeline:progress-mode property. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include - -#define CLUTTER_DISABLE_DEPRECATION_WARNINGS - -#include "clutter-alpha.h" -#include "clutter-debug.h" -#include "clutter-enum-types.h" -#include "clutter-easing.h" -#include "clutter-main.h" -#include "clutter-marshal.h" -#include "clutter-private.h" -#include "clutter-scriptable.h" -#include "clutter-script-private.h" - -static void clutter_scriptable_iface_init (ClutterScriptableIface *iface); - -G_DEFINE_TYPE_WITH_CODE (ClutterAlpha, - clutter_alpha, - G_TYPE_INITIALLY_UNOWNED, - G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_SCRIPTABLE, - clutter_scriptable_iface_init)); - -struct _ClutterAlphaPrivate -{ - ClutterTimeline *timeline; - guint timeline_new_frame_id; - - gdouble alpha; - - GClosure *closure; - - ClutterAlphaFunc func; - gpointer user_data; - GDestroyNotify notify; - - gulong mode; -}; - -enum -{ - PROP_0, - - PROP_TIMELINE, - PROP_ALPHA, - PROP_MODE, - - PROP_LAST -}; - -static GParamSpec *obj_props[PROP_LAST]; - -static void -timeline_new_frame_cb (ClutterTimeline *timeline, - guint msecs, - ClutterAlpha *alpha) -{ - ClutterAlphaPrivate *priv = alpha->priv; - - /* Update alpha value and notify */ - priv->alpha = clutter_alpha_get_alpha (alpha); - g_object_notify_by_pspec (G_OBJECT (alpha), obj_props[PROP_ALPHA]); -} - -static void -clutter_alpha_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - ClutterAlpha *alpha = CLUTTER_ALPHA (object); - - switch (prop_id) - { - case PROP_TIMELINE: - clutter_alpha_set_timeline (alpha, g_value_get_object (value)); - break; - - case PROP_MODE: - clutter_alpha_set_mode (alpha, g_value_get_ulong (value)); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -clutter_alpha_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - ClutterAlphaPrivate *priv = CLUTTER_ALPHA (object)->priv; - - switch (prop_id) - { - case PROP_TIMELINE: - g_value_set_object (value, priv->timeline); - break; - - case PROP_ALPHA: - g_value_set_double (value, priv->alpha); - break; - - case PROP_MODE: - g_value_set_ulong (value, priv->mode); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -clutter_alpha_finalize (GObject *object) -{ - ClutterAlphaPrivate *priv = CLUTTER_ALPHA (object)->priv; - - if (priv->notify != NULL) - priv->notify (priv->user_data); - else if (priv->closure != NULL) - g_closure_unref (priv->closure); - - G_OBJECT_CLASS (clutter_alpha_parent_class)->finalize (object); -} - -static void -clutter_alpha_dispose (GObject *object) -{ - ClutterAlpha *self = CLUTTER_ALPHA(object); - - clutter_alpha_set_timeline (self, NULL); - - G_OBJECT_CLASS (clutter_alpha_parent_class)->dispose (object); -} - -static ClutterAlphaFunc -resolve_alpha_func (const gchar *name) -{ - static GModule *module = NULL; - ClutterAlphaFunc func; - - CLUTTER_NOTE (SCRIPT, "Looking up '%s' alpha function", name); - - if (G_UNLIKELY (module == NULL)) - module = g_module_open (NULL, 0); - - if (g_module_symbol (module, name, (gpointer) &func)) - { - CLUTTER_NOTE (SCRIPT, "Found '%s' alpha function in the symbols table", - name); - return func; - } - - return NULL; -} - -static void -clutter_alpha_set_custom_property (ClutterScriptable *scriptable, - ClutterScript *script, - const gchar *name, - const GValue *value) -{ - if (strncmp (name, "function", 8) == 0) - { - g_assert (G_VALUE_HOLDS (value, G_TYPE_POINTER)); - if (g_value_get_pointer (value) != NULL) - { - clutter_alpha_set_func (CLUTTER_ALPHA (scriptable), - g_value_get_pointer (value), - NULL, NULL); - } - } - else - g_object_set_property (G_OBJECT (scriptable), name, value); -} - -static gboolean -clutter_alpha_parse_custom_node (ClutterScriptable *scriptable, - ClutterScript *script, - GValue *value, - const gchar *name, - JsonNode *node) -{ - if (strncmp (name, "function", 8) == 0) - { - const gchar *func_name = json_node_get_string (node); - - g_value_init (value, G_TYPE_POINTER); - g_value_set_pointer (value, resolve_alpha_func (func_name)); - - return TRUE; - } - - /* we need to do this because we use gulong in place - * of ClutterAnimationMode for ClutterAlpha:mode - */ - if (strncmp (name, "mode", 4) == 0) - { - gulong mode; - - mode = _clutter_script_resolve_animation_mode (node); - - g_value_init (value, G_TYPE_ULONG); - g_value_set_ulong (value, mode); - - return TRUE; - } - - return FALSE; -} - -static void -clutter_scriptable_iface_init (ClutterScriptableIface *iface) -{ - iface->parse_custom_node = clutter_alpha_parse_custom_node; - iface->set_custom_property = clutter_alpha_set_custom_property; -} - -static void -clutter_alpha_class_init (ClutterAlphaClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - - object_class->set_property = clutter_alpha_set_property; - object_class->get_property = clutter_alpha_get_property; - object_class->finalize = clutter_alpha_finalize; - object_class->dispose = clutter_alpha_dispose; - - g_type_class_add_private (klass, sizeof (ClutterAlphaPrivate)); - - /** - * ClutterAlpha:timeline: - * - * A #ClutterTimeline instance used to drive the alpha function. - * - * - * - * Deprecated: 1.12 - */ - obj_props[PROP_TIMELINE] = - g_param_spec_object ("timeline", - P_("Timeline"), - P_("Timeline used by the alpha"), - CLUTTER_TYPE_TIMELINE, - CLUTTER_PARAM_READWRITE); - - /** - * ClutterAlpha:alpha: - * - * The alpha value as computed by the alpha function. The linear - * interval is 0.0 to 1.0, but the Alpha allows overshooting by - * one unit in each direction, so the valid interval is -1.0 to 2.0. - * - * - * Deprecated: 1.12 - */ - obj_props[PROP_ALPHA] = - g_param_spec_double ("alpha", - P_("Alpha value"), - P_("Alpha value as computed by the alpha"), - -1.0, 2.0, - 0.0, - CLUTTER_PARAM_READABLE); - - /** - * ClutterAlpha:mode: - * - * The progress function logical id - either a value from the - * #ClutterAnimationMode enumeration or a value returned by - * clutter_alpha_register_func(). - * - * If %CLUTTER_CUSTOM_MODE is used then the function set using - * clutter_alpha_set_closure() or clutter_alpha_set_func() - * will be used. - * - * - * Deprecated: 1.12 - */ - obj_props[PROP_MODE] = - g_param_spec_ulong ("mode", - P_("Mode"), - P_("Progress mode"), - 0, G_MAXULONG, - CLUTTER_CUSTOM_MODE, - G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE); - - g_object_class_install_properties (object_class, - PROP_LAST, - obj_props); -} - -static void -clutter_alpha_init (ClutterAlpha *self) -{ - self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, - CLUTTER_TYPE_ALPHA, - ClutterAlphaPrivate); - - self->priv->mode = CLUTTER_CUSTOM_MODE; - self->priv->alpha = 0.0; -} - -/** - * clutter_alpha_get_alpha: - * @alpha: A #ClutterAlpha - * - * Query the current alpha value. - * - * Return Value: The current alpha value for the alpha - * - * - * - * Deprecated: 1.12 - */ -gdouble -clutter_alpha_get_alpha (ClutterAlpha *alpha) -{ - ClutterAlphaPrivate *priv; - gdouble retval = 0; - - g_return_val_if_fail (CLUTTER_IS_ALPHA (alpha), 0); - - priv = alpha->priv; - - if (G_LIKELY (priv->func)) - { - return priv->func (alpha, priv->user_data); - } - else if (priv->closure) - { - GValue params = G_VALUE_INIT; - GValue result_value = G_VALUE_INIT; - - g_object_ref (alpha); - - g_value_init (&result_value, G_TYPE_DOUBLE); - - g_value_init (¶ms, CLUTTER_TYPE_ALPHA); - g_value_set_object (¶ms, alpha); - - g_closure_invoke (priv->closure, &result_value, 1, ¶ms, NULL); - - retval = g_value_get_double (&result_value); - - g_value_unset (&result_value); - g_value_unset (¶ms); - - g_object_unref (alpha); - } - - return retval; -} - -/* - * clutter_alpha_set_closure_internal: - * @alpha: a #ClutterAlpha - * @closure: a #GClosure - * - * Sets the @closure for @alpha. This function does not - * set the #ClutterAlpha:mode property and does not emit - * the #GObject::notify signal for it. - */ -static inline void -clutter_alpha_set_closure_internal (ClutterAlpha *alpha, - GClosure *closure) -{ - ClutterAlphaPrivate *priv = alpha->priv; - - if (priv->notify != NULL) - priv->notify (priv->user_data); - else if (priv->closure != NULL) - g_closure_unref (priv->closure); - - priv->func = NULL; - priv->user_data = NULL; - priv->notify = NULL; - - if (closure == NULL) - return; - - /* need to take ownership of the closure before sinking it */ - priv->closure = g_closure_ref (closure); - g_closure_sink (closure); - - /* set the marshaller */ - if (G_CLOSURE_NEEDS_MARSHAL (closure)) - { - GClosureMarshal marshal = _clutter_marshal_DOUBLE__VOID; - - g_closure_set_marshal (priv->closure, marshal); - } -} - -/** - * clutter_alpha_set_closure: - * @alpha: A #ClutterAlpha - * @closure: A #GClosure - * - * Sets the #GClosure used to compute the alpha value at each - * frame of the #ClutterTimeline bound to @alpha. - * - * - * - * Deprecated: 1.12 - */ -void -clutter_alpha_set_closure (ClutterAlpha *alpha, - GClosure *closure) -{ - ClutterAlphaPrivate *priv; - - g_return_if_fail (CLUTTER_IS_ALPHA (alpha)); - g_return_if_fail (closure != NULL); - - priv = alpha->priv; - - clutter_alpha_set_closure_internal (alpha, closure); - - priv->mode = CLUTTER_CUSTOM_MODE; - g_object_notify_by_pspec (G_OBJECT (alpha), obj_props[PROP_MODE]); -} - -/** - * clutter_alpha_set_func: - * @alpha: A #ClutterAlpha - * @func: A #ClutterAlphaFunc - * @data: user data to be passed to the alpha function, or %NULL - * @destroy: notify function used when disposing the alpha function - * - * Sets the #ClutterAlphaFunc function used to compute - * the alpha value at each frame of the #ClutterTimeline - * bound to @alpha. - * - * This function will not register @func as a global alpha function. - * - * - * - * Deprecated: 1.12 - */ -void -clutter_alpha_set_func (ClutterAlpha *alpha, - ClutterAlphaFunc func, - gpointer data, - GDestroyNotify destroy) -{ - ClutterAlphaPrivate *priv; - - g_return_if_fail (CLUTTER_IS_ALPHA (alpha)); - g_return_if_fail (func != NULL); - - priv = alpha->priv; - - if (priv->notify != NULL) - { - priv->notify (priv->user_data); - } - else if (priv->closure != NULL) - { - g_closure_unref (priv->closure); - priv->closure = NULL; - } - - priv->func = func; - priv->user_data = data; - priv->notify = destroy; - - priv->mode = CLUTTER_CUSTOM_MODE; - - g_object_notify_by_pspec (G_OBJECT (alpha), obj_props[PROP_MODE]); -} - -/** - * clutter_alpha_set_timeline: - * @alpha: A #ClutterAlpha - * @timeline: A #ClutterTimeline - * - * Binds @alpha to @timeline. - * - * - * - * Deprecated: 1.12 - */ -void -clutter_alpha_set_timeline (ClutterAlpha *alpha, - ClutterTimeline *timeline) -{ - ClutterAlphaPrivate *priv; - - g_return_if_fail (CLUTTER_IS_ALPHA (alpha)); - g_return_if_fail (timeline == NULL || CLUTTER_IS_TIMELINE (timeline)); - - priv = alpha->priv; - - if (priv->timeline == timeline) - return; - - if (priv->timeline) - { - g_signal_handlers_disconnect_by_func (priv->timeline, - timeline_new_frame_cb, - alpha); - - g_object_unref (priv->timeline); - priv->timeline = NULL; - } - - if (timeline) - { - priv->timeline = g_object_ref (timeline); - - g_signal_connect (priv->timeline, "new-frame", - G_CALLBACK (timeline_new_frame_cb), - alpha); - } - - g_object_notify_by_pspec (G_OBJECT (alpha), obj_props[PROP_TIMELINE]); -} - -/** - * clutter_alpha_get_timeline: - * @alpha: A #ClutterAlpha - * - * Gets the #ClutterTimeline bound to @alpha. - * - * Return value: (transfer none): a #ClutterTimeline instance - * - * - * - * Deprecated: 1.12 - */ -ClutterTimeline * -clutter_alpha_get_timeline (ClutterAlpha *alpha) -{ - g_return_val_if_fail (CLUTTER_IS_ALPHA (alpha), NULL); - - return alpha->priv->timeline; -} - -/** - * clutter_alpha_new: - * - * Creates a new #ClutterAlpha instance. You must set a function - * to compute the alpha value using clutter_alpha_set_func() and - * bind a #ClutterTimeline object to the #ClutterAlpha instance - * using clutter_alpha_set_timeline(). - * - * You should use the newly created #ClutterAlpha instance inside - * a #ClutterBehaviour object. - * - * Return value: the newly created empty #ClutterAlpha instance. - * - * - * - * Deprecated: 1.12 - */ -ClutterAlpha * -clutter_alpha_new (void) -{ - return g_object_new (CLUTTER_TYPE_ALPHA, NULL); -} - -/** - * clutter_alpha_new_full: - * @timeline: #ClutterTimeline timeline - * @mode: animation mode - * - * Creates a new #ClutterAlpha instance and sets the timeline - * and animation mode. - * - * See also clutter_alpha_set_timeline() and clutter_alpha_set_mode(). - * - * Return Value: the newly created #ClutterAlpha - * - * - * - * Deprecated: 1.12 - */ -ClutterAlpha * -clutter_alpha_new_full (ClutterTimeline *timeline, - gulong mode) -{ - g_return_val_if_fail (CLUTTER_IS_TIMELINE (timeline), NULL); - g_return_val_if_fail (mode != CLUTTER_ANIMATION_LAST, NULL); - - return g_object_new (CLUTTER_TYPE_ALPHA, - "timeline", timeline, - "mode", mode, - NULL); -} - -/** - * clutter_alpha_new_with_func: - * @timeline: a #ClutterTimeline - * @func: a #ClutterAlphaFunc - * @data: data to pass to the function, or %NULL - * @destroy: function to call when removing the alpha function, or %NULL - * - * Creates a new #ClutterAlpha instances and sets the timeline - * and the alpha function. - * - * This function will not register @func as a global alpha function. - * - * See also clutter_alpha_set_timeline() and clutter_alpha_set_func(). - * - * Return value: the newly created #ClutterAlpha - * - * - * - * Deprecated: 1.12 - */ -ClutterAlpha * -clutter_alpha_new_with_func (ClutterTimeline *timeline, - ClutterAlphaFunc func, - gpointer data, - GDestroyNotify destroy) -{ - ClutterAlpha *retval; - - g_return_val_if_fail (CLUTTER_IS_TIMELINE (timeline), NULL); - g_return_val_if_fail (func != NULL, NULL); - - retval = clutter_alpha_new (); - clutter_alpha_set_timeline (retval, timeline); - clutter_alpha_set_func (retval, func, data, destroy); - - return retval; -} - -/** - * clutter_alpha_get_mode: - * @alpha: a #ClutterAlpha - * - * Retrieves the #ClutterAnimationMode used by @alpha. - * - * Return value: the animation mode - * - * - * - * Deprecated: 1.12 - */ -gulong -clutter_alpha_get_mode (ClutterAlpha *alpha) -{ - g_return_val_if_fail (CLUTTER_IS_ALPHA (alpha), CLUTTER_CUSTOM_MODE); - - return alpha->priv->mode; -} - -typedef struct _AlphaData { - guint closure_set : 1; - - ClutterAlphaFunc func; - gpointer data; - - GClosure *closure; -} AlphaData; - -static GPtrArray *clutter_alphas = NULL; - -static gdouble -clutter_alpha_easing_func (ClutterAlpha *alpha, - gpointer data G_GNUC_UNUSED) -{ - ClutterAlphaPrivate *priv = alpha->priv; - ClutterTimeline *timeline = priv->timeline; - gdouble t, d; - - if (G_UNLIKELY (priv->timeline == NULL)) - return 0.0; - - t = clutter_timeline_get_elapsed_time (timeline); - d = clutter_timeline_get_duration (timeline); - - return clutter_easing_for_mode (priv->mode, t, d); -} - -/** - * clutter_alpha_set_mode: - * @alpha: a #ClutterAlpha - * @mode: a #ClutterAnimationMode - * - * Sets the progress function of @alpha using the symbolic value - * of @mode, as taken by the #ClutterAnimationMode enumeration or - * using the value returned by clutter_alpha_register_func(). - * - * - * - * Deprecated: 1.12 - */ -void -clutter_alpha_set_mode (ClutterAlpha *alpha, - gulong mode) -{ - ClutterAlphaPrivate *priv; - - g_return_if_fail (CLUTTER_IS_ALPHA (alpha)); - g_return_if_fail (mode != CLUTTER_ANIMATION_LAST); - - priv = alpha->priv; - - if (mode == CLUTTER_CUSTOM_MODE) - { - priv->mode = mode; - } - else if (mode < CLUTTER_ANIMATION_LAST) - { - if (priv->mode == mode) - return; - - /* sanity check to avoid getting an out of sync - * enum/function mapping - */ - g_assert (clutter_get_easing_func_for_mode (mode) != NULL); - - clutter_alpha_set_closure_internal (alpha, NULL); - - priv->mode = mode; - - CLUTTER_NOTE (ANIMATION, "New easing mode '%s'[%lu]\n", - clutter_get_easing_name_for_mode (priv->mode), - priv->mode); - - priv->func = clutter_alpha_easing_func; - priv->user_data = NULL; - priv->notify = NULL; - } - else if (mode > CLUTTER_ANIMATION_LAST) - { - AlphaData *alpha_data = NULL; - gulong real_index = 0; - - if (priv->mode == mode) - return; - - if (G_UNLIKELY (clutter_alphas == NULL)) - { - g_warning ("No alpha functions defined for ClutterAlpha to use. " - "Use clutter_alpha_register_func() to register an " - "alpha function."); - return; - } - - real_index = mode - CLUTTER_ANIMATION_LAST - 1; - - alpha_data = g_ptr_array_index (clutter_alphas, real_index); - if (G_UNLIKELY (alpha_data == NULL)) - { - g_warning ("No alpha function registered for mode %lu.", - mode); - return; - } - - if (alpha_data->closure_set) - clutter_alpha_set_closure (alpha, alpha_data->closure); - else - { - clutter_alpha_set_closure_internal (alpha, NULL); - - priv->func = alpha_data->func; - priv->user_data = alpha_data->data; - priv->notify = NULL; - } - - priv->mode = mode; - } - else - g_assert_not_reached (); - - g_object_notify_by_pspec (G_OBJECT (alpha), obj_props[PROP_MODE]); -} - -static gulong -register_alpha_internal (AlphaData *alpha_data) -{ - if (G_UNLIKELY (clutter_alphas == NULL)) - clutter_alphas = g_ptr_array_new (); - - g_ptr_array_add (clutter_alphas, alpha_data); - - return clutter_alphas->len + CLUTTER_ANIMATION_LAST; -} - -/** - * clutter_alpha_register_func: (skip) - * @func: a #ClutterAlphaFunc - * @data: user data to pass to @func, or %NULL - * - * Registers a global alpha function and returns its logical id - * to be used by clutter_alpha_set_mode() or by #ClutterAnimation. - * - * The logical id is always greater than %CLUTTER_ANIMATION_LAST. - * - * Return value: the logical id of the alpha function - * - * - * - * Deprecated: 1.12 - */ -gulong -clutter_alpha_register_func (ClutterAlphaFunc func, - gpointer data) -{ - AlphaData *alpha_data; - - g_return_val_if_fail (func != NULL, 0); - - alpha_data = g_slice_new (AlphaData); - alpha_data->closure_set = FALSE; - alpha_data->func = func; - alpha_data->data = data; - - return register_alpha_internal (alpha_data); -} - -/** - * clutter_alpha_register_closure: - * @closure: a #GClosure - * - * #GClosure variant of clutter_alpha_register_func(). - * - * Registers a global alpha function and returns its logical id - * to be used by clutter_alpha_set_mode() or by #ClutterAnimation. - * - * The logical id is always greater than %CLUTTER_ANIMATION_LAST. - * - * Rename to: clutter_alpha_register_func - * - * Return value: the logical id of the alpha function - * - * - * - * Deprecated: 1.12 - */ -gulong -clutter_alpha_register_closure (GClosure *closure) -{ - AlphaData *alpha_data; - - g_return_val_if_fail (closure != NULL, 0); - - alpha_data = g_slice_new (AlphaData); - alpha_data->closure_set = TRUE; - alpha_data->closure = closure; - - return register_alpha_internal (alpha_data); -} diff --git a/clutter/deprecated/clutter-alpha.h b/clutter/deprecated/clutter-alpha.h deleted file mode 100644 index 0ff1476e0..000000000 --- a/clutter/deprecated/clutter-alpha.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * Jorn Baayen - * Emmanuele Bassi - * Tomas Frydrych - * - * Copyright (C) 2006, 2007, 2008 OpenedHand - * Copyright (C) 2009 Intel Corp. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_ALPHA_H__ -#define __CLUTTER_ALPHA_H__ - -#include -#include - -G_BEGIN_DECLS - -#define CLUTTER_TYPE_ALPHA (clutter_alpha_get_type ()) -#define CLUTTER_ALPHA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_ALPHA, ClutterAlpha)) -#define CLUTTER_ALPHA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_ALPHA, ClutterAlphaClass)) -#define CLUTTER_IS_ALPHA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_ALPHA)) -#define CLUTTER_IS_ALPHA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_ALPHA)) -#define CLUTTER_ALPHA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_ALPHA, ClutterAlphaClass)) - -typedef struct _ClutterAlphaClass ClutterAlphaClass; -typedef struct _ClutterAlphaPrivate ClutterAlphaPrivate; - -/** - * ClutterAlphaFunc: - * @alpha: a #ClutterAlpha - * @user_data: user data passed to the function - * - * A function returning a value depending on the position of - * the #ClutterTimeline bound to @alpha. - * - * Return value: a floating point value - * - * - */ -typedef gdouble (*ClutterAlphaFunc) (ClutterAlpha *alpha, - gpointer user_data); - -/** - * ClutterAlpha: - * - * #ClutterAlpha combines a #ClutterTimeline and a function. - * The contents of the #ClutterAlpha structure are private and should - * only be accessed using the provided API. - * - * - */ -struct _ClutterAlpha -{ - /*< private >*/ - GInitiallyUnowned parent; - - ClutterAlphaPrivate *priv; -}; - -/** - * ClutterAlphaClass: - * - * Base class for #ClutterAlpha - * - * - */ -struct _ClutterAlphaClass -{ - /*< private >*/ - GInitiallyUnownedClass parent_class; - - void (*_clutter_alpha_1) (void); - void (*_clutter_alpha_2) (void); - void (*_clutter_alpha_3) (void); - void (*_clutter_alpha_4) (void); - void (*_clutter_alpha_5) (void); -}; - -CLUTTER_DEPRECATED_IN_1_12 -GType clutter_alpha_get_type (void) G_GNUC_CONST; - -CLUTTER_DEPRECATED_IN_1_12 -ClutterAlpha * clutter_alpha_new (void); -CLUTTER_DEPRECATED_IN_1_12 -ClutterAlpha * clutter_alpha_new_full (ClutterTimeline *timeline, - gulong mode); -CLUTTER_DEPRECATED_IN_1_12 -ClutterAlpha * clutter_alpha_new_with_func (ClutterTimeline *timeline, - ClutterAlphaFunc func, - gpointer data, - GDestroyNotify destroy); - -CLUTTER_DEPRECATED_IN_1_12 -gdouble clutter_alpha_get_alpha (ClutterAlpha *alpha); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_alpha_set_func (ClutterAlpha *alpha, - ClutterAlphaFunc func, - gpointer data, - GDestroyNotify destroy); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_alpha_set_closure (ClutterAlpha *alpha, - GClosure *closure); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_alpha_set_timeline (ClutterAlpha *alpha, - ClutterTimeline *timeline); -CLUTTER_DEPRECATED_IN_1_12 -ClutterTimeline *clutter_alpha_get_timeline (ClutterAlpha *alpha); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_alpha_set_mode (ClutterAlpha *alpha, - gulong mode); -CLUTTER_DEPRECATED_IN_1_12 -gulong clutter_alpha_get_mode (ClutterAlpha *alpha); - -CLUTTER_DEPRECATED_IN_1_12 -gulong clutter_alpha_register_func (ClutterAlphaFunc func, - gpointer data); -CLUTTER_DEPRECATED_IN_1_12 -gulong clutter_alpha_register_closure (GClosure *closure); - -G_END_DECLS - -#endif /* __CLUTTER_ALPHA_H__ */ diff --git a/clutter/deprecated/clutter-animatable.h b/clutter/deprecated/clutter-animatable.h deleted file mode 100644 index df40e288e..000000000 --- a/clutter/deprecated/clutter-animatable.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Copyright (C) 2009 Intel Corporation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - * Author: - * Emmanuele Bassi - */ - -#ifndef __CLUTTER_ANIMATABLE_DEPRECATED_H__ -#define __CLUTTER_ANIMATABLE_DEPRECATED_H__ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#include - -G_BEGIN_DECLS - -CLUTTER_DEPRECATED_IN_1_8_FOR(clutter_animatable_interpolate_value) -gboolean clutter_animatable_animate_property (ClutterAnimatable *animatable, - ClutterAnimation *animation, - const gchar *property_name, - const GValue *initial_value, - const GValue *final_value, - gdouble progress, - GValue *value); - -G_END_DECLS - -#endif /* __CLUTTER_ANIMATABLE_DEPRECATED_H__ */ diff --git a/clutter/deprecated/clutter-animation.c b/clutter/deprecated/clutter-animation.c deleted file mode 100644 index f31798d02..000000000 --- a/clutter/deprecated/clutter-animation.c +++ /dev/null @@ -1,2663 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Copyright (C) 2008 Intel Corporation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - * Author: - * Emmanuele Bassi - */ - -/** - * SECTION:clutter-animation - * @short_description: Simple implicit animations - * @See_Also: #ClutterAnimatable, #ClutterInterval, #ClutterAlpha, - * #ClutterTimeline - * - * #ClutterAnimation is an object providing simple, implicit animations - * for #GObjects. - * - * #ClutterAnimation instances will bind one or more #GObject properties - * belonging to a #GObject to a #ClutterInterval, and will then use a - * #ClutterAlpha to interpolate the property between the initial and final - * values of the interval. - * - * The duration of the animation is set using clutter_animation_set_duration(). - * The easing mode of the animation is set using clutter_animation_set_mode(). - * - * If you want to control the animation you should retrieve the - * #ClutterTimeline using clutter_animation_get_timeline() and then - * use #ClutterTimeline functions like clutter_timeline_start(), - * clutter_timeline_pause() or clutter_timeline_stop(). - * - * A #ClutterAnimation will emit the #ClutterAnimation::completed signal - * when the #ClutterTimeline used by the animation is completed; unlike - * #ClutterTimeline, though, the #ClutterAnimation::completed will not be - * emitted if #ClutterAnimation:loop is set to %TRUE - that is, a looping - * animation never completes. - * - * If your animation depends on user control you can force its completion - * using clutter_animation_completed(). - * - * If the #GObject instance bound to a #ClutterAnimation implements the - * #ClutterAnimatable interface it is possible for that instance to - * control the way the initial and final states are interpolated. - * - * #ClutterAnimations are distinguished from #ClutterBehaviours - * because the former can only control #GObject properties of a single - * #GObject instance, while the latter can control multiple properties - * using accessor functions inside the #ClutterBehaviour - * alpha_notify virtual function, and can control - * multiple #ClutterActors as well. - * - * For convenience, it is possible to use the clutter_actor_animate() - * function call which will take care of setting up and tearing down - * a #ClutterAnimation instance and animate an actor between its current - * state and the specified final state. - * - * - * Defining ClutterAnimationMode inside ClutterScript - * When defining a #ClutterAnimation inside a ClutterScript - * file or string the #ClutterAnimation:mode can be defined either - * using the #ClutterAnimationMode enumeration values through their - * "nick" (the short string used inside #GEnumValue), their numeric - * id, or using the following strings: - * - * - * easeInQuad, easeOutQuad, easeInOutQuad - * Corresponding to the quadratic easing - * modes - * - * - * easeInCubic, easeOutCubic, easeInOutCubic - * Corresponding to the cubic easing - * modes - * - * - * easeInQuart, easeOutQuart, easeInOutQuart - * Corresponding to the quartic easing - * modes - * - * - * easeInQuint, easeOutQuint, easeInOutQuint - * Corresponding to the quintic easing - * modes - * - * - * easeInSine, easeOutSine, easeInOutSine - * Corresponding to the sine easing - * modes - * - * - * easeInExpo, easeOutExpo, easeInOutExpo - * Corresponding to the exponential easing - * modes - * - * - * easeInCirc, easeOutCirc, easeInOutCirc - * Corresponding to the circular easing - * modes - * - * - * easeInElastic, easeOutElastic, easeInOutElastic - * Corresponding to the overshooting elastic - * easing modes - * - * - * easeInBack, easeOutBack, easeInOutBack - * Corresponding to the overshooting cubic - * easing modes - * - * - * easeInBounce, easeOutBounce, easeInOutBounce - * Corresponding to the bouncing easing - * modes - * - * - * - * - * - * Tweening using clutter_actor_animate() - * - * - * FIXME: MISSING XINCLUDE CONTENT - * - * - * - * - * #ClutterAnimation is available since Clutter 1.0. - * - * #ClutterAnimation has been deprecated in Clutter 1.12. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#define CLUTTER_DISABLE_DEPRECATION_WARNINGS - -#include "clutter-alpha.h" -#include "clutter-animatable.h" -#include "clutter-animation.h" -#include "clutter-debug.h" -#include "clutter-enum-types.h" -#include "clutter-interval.h" -#include "clutter-marshal.h" -#include "clutter-private.h" -#include "clutter-scriptable.h" -#include "clutter-script-private.h" - -#include "deprecated/clutter-animation.h" - -enum -{ - PROP_0, - - PROP_OBJECT, - PROP_MODE, - PROP_DURATION, - PROP_LOOP, - PROP_TIMELINE, - PROP_ALPHA, - - PROP_LAST -}; - -static GParamSpec *obj_props[PROP_LAST]; - -enum -{ - STARTED, - COMPLETED, - - LAST_SIGNAL -}; - -#define CLUTTER_ANIMATION_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_ANIMATION, ClutterAnimationPrivate)) - -struct _ClutterAnimationPrivate -{ - GObject *object; - - GHashTable *properties; - - ClutterAlpha *alpha; - ClutterTimeline *timeline; - - guint timeline_started_id; - guint timeline_completed_id; - guint timeline_frame_id; -}; - -static guint animation_signals[LAST_SIGNAL] = { 0, }; - -static GQuark quark_object_animation = 0; - -static void clutter_scriptable_init (ClutterScriptableIface *iface); - -static void clutter_animation_set_alpha_internal (ClutterAnimation *animation, - ClutterAlpha *alpha); -static ClutterAlpha * clutter_animation_get_alpha_internal (ClutterAnimation *animation); -static ClutterTimeline * clutter_animation_get_timeline_internal (ClutterAnimation *animation); - -G_DEFINE_TYPE_WITH_CODE (ClutterAnimation, clutter_animation, G_TYPE_OBJECT, - G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_SCRIPTABLE, - clutter_scriptable_init)); - -static ClutterAlpha * -clutter_animation_get_alpha_internal (ClutterAnimation *animation) -{ - ClutterAnimationPrivate *priv = animation->priv; - - if (priv->alpha == NULL) - { - ClutterAlpha *alpha; - - alpha = clutter_alpha_new (); - clutter_alpha_set_mode (alpha, CLUTTER_LINEAR); - - priv->alpha = g_object_ref_sink (alpha); - - g_object_notify_by_pspec (G_OBJECT (animation), obj_props[PROP_ALPHA]); - } - - return priv->alpha; -} - -static void -on_actor_destroy (ClutterActor *actor, - ClutterAnimation *animation) -{ - ClutterAnimationPrivate *priv = animation->priv; - GObject *obj = G_OBJECT (actor); - - if (obj == priv->object) - { - g_object_set_qdata (priv->object, quark_object_animation, NULL); - g_signal_handlers_disconnect_by_func (priv->object, - G_CALLBACK (on_actor_destroy), - animation); - g_object_unref (animation); - } -} - -static void -clutter_animation_real_completed (ClutterAnimation *self) -{ - ClutterAnimationPrivate *priv = self->priv; - ClutterAnimatable *animatable = NULL; - ClutterAnimation *animation; - ClutterTimeline *timeline; - ClutterTimelineDirection direction; - gpointer key, value; - GHashTableIter iter; - - timeline = clutter_animation_get_timeline (self); - direction = clutter_timeline_get_direction (timeline); - - if (CLUTTER_IS_ANIMATABLE (priv->object)) - animatable = CLUTTER_ANIMATABLE (priv->object); - - /* explicitly set the final state of the animation */ - CLUTTER_NOTE (ANIMATION, "Set final state on object [%p]", priv->object); - g_hash_table_iter_init (&iter, priv->properties); - while (g_hash_table_iter_next (&iter, &key, &value)) - { - const gchar *p_name = key; - ClutterInterval *interval = value; - GValue *p_value; - - if (direction == CLUTTER_TIMELINE_FORWARD) - p_value = clutter_interval_peek_final_value (interval); - else - p_value = clutter_interval_peek_initial_value (interval); - - if (animatable != NULL) - clutter_animatable_set_final_state (animatable, p_name, p_value); - else - g_object_set_property (priv->object, p_name, p_value); - } - - /* at this point, if this animation was created by clutter_actor_animate() - * and friends, the animation will be attached to the object's data; since - * we want to allow developers to use g_signal_connect_after("completed") - * to concatenate a new animation, we need to remove the animation back - * pointer here, and unref() the animation. FIXME - we might want to - * provide a clutter_animation_attach()/clutter_animation_detach() pair - * to let the user reattach an animation - */ - animation = g_object_get_qdata (priv->object, quark_object_animation); - if (animation == self) - { - CLUTTER_NOTE (ANIMATION, "Unsetting animation for actor [%p]", - priv->object); - - g_object_set_qdata (priv->object, quark_object_animation, NULL); - g_signal_handlers_disconnect_by_func (priv->object, - G_CALLBACK (on_actor_destroy), - animation); - - CLUTTER_NOTE (ANIMATION, "Releasing the reference Animation [%p]", - animation); - g_object_unref (animation); - } -} - -static void -clutter_animation_finalize (GObject *gobject) -{ - ClutterAnimationPrivate *priv = CLUTTER_ANIMATION (gobject)->priv; - - CLUTTER_NOTE (ANIMATION, - "Destroying properties table for Animation [%p]", - gobject); - g_hash_table_destroy (priv->properties); - - G_OBJECT_CLASS (clutter_animation_parent_class)->finalize (gobject); -} - -static void -clutter_animation_dispose (GObject *gobject) -{ - ClutterAnimationPrivate *priv = CLUTTER_ANIMATION (gobject)->priv; - ClutterTimeline *timeline; - - if (priv->alpha != NULL) - timeline = clutter_alpha_get_timeline (priv->alpha); - else - timeline = priv->timeline; - - if (timeline != NULL && priv->timeline_started_id != 0) - g_signal_handler_disconnect (timeline, priv->timeline_started_id); - - if (timeline != NULL && priv->timeline_completed_id != 0) - g_signal_handler_disconnect (timeline, priv->timeline_completed_id); - - if (timeline != NULL && priv->timeline_frame_id != 0) - g_signal_handler_disconnect (timeline, priv->timeline_frame_id); - - priv->timeline_started_id = 0; - priv->timeline_completed_id = 0; - priv->timeline_frame_id = 0; - - if (priv->alpha != NULL) - { - g_object_unref (priv->alpha); - priv->alpha = NULL; - } - - if (priv->object != NULL) - { - g_object_unref (priv->object); - priv->object = NULL; - } - - G_OBJECT_CLASS (clutter_animation_parent_class)->dispose (gobject); -} - -static void -clutter_animation_set_property (GObject *gobject, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - ClutterAnimation *animation = CLUTTER_ANIMATION (gobject); - - switch (prop_id) - { - case PROP_OBJECT: - clutter_animation_set_object (animation, g_value_get_object (value)); - break; - - case PROP_MODE: - clutter_animation_set_mode (animation, g_value_get_ulong (value)); - break; - - case PROP_DURATION: - clutter_animation_set_duration (animation, g_value_get_uint (value)); - break; - - case PROP_LOOP: - clutter_animation_set_loop (animation, g_value_get_boolean (value)); - break; - - case PROP_TIMELINE: - clutter_animation_set_timeline (animation, g_value_get_object (value)); - break; - - case PROP_ALPHA: - clutter_animation_set_alpha_internal (animation, g_value_get_object (value)); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); - break; - } -} - -static void -clutter_animation_get_property (GObject *gobject, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - ClutterAnimation *animation = CLUTTER_ANIMATION (gobject); - ClutterAnimationPrivate *priv = animation->priv; - - switch (prop_id) - { - case PROP_OBJECT: - g_value_set_object (value, priv->object); - break; - - case PROP_MODE: - g_value_set_ulong (value, clutter_animation_get_mode (animation)); - break; - - case PROP_DURATION: - g_value_set_uint (value, clutter_animation_get_duration (animation)); - break; - - case PROP_LOOP: - g_value_set_boolean (value, clutter_animation_get_loop (animation)); - break; - - case PROP_TIMELINE: - g_value_set_object (value, clutter_animation_get_timeline (animation)); - break; - - case PROP_ALPHA: - g_value_set_object (value, clutter_animation_get_alpha_internal (animation)); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); - break; - } -} - -static gboolean -clutter_animation_parse_custom_node (ClutterScriptable *scriptable, - ClutterScript *script, - GValue *value, - const gchar *name, - JsonNode *node) -{ - if (strncmp (name, "mode", 4) == 0) - { - gulong mode; - - mode = _clutter_script_resolve_animation_mode (node); - - g_value_init (value, G_TYPE_ULONG); - g_value_set_ulong (value, mode); - - return TRUE; - } - - return FALSE; -} - -static void -clutter_scriptable_init (ClutterScriptableIface *iface) -{ - iface->parse_custom_node = clutter_animation_parse_custom_node; -} - -static void -clutter_animation_class_init (ClutterAnimationClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - - quark_object_animation = - g_quark_from_static_string ("clutter-actor-animation"); - - g_type_class_add_private (klass, sizeof (ClutterAnimationPrivate)); - - klass->completed = clutter_animation_real_completed; - - gobject_class->set_property = clutter_animation_set_property; - gobject_class->get_property = clutter_animation_get_property; - gobject_class->dispose = clutter_animation_dispose; - gobject_class->finalize = clutter_animation_finalize; - - /** - * ClutterAnimation:object: - * - * The #GObject to which the animation applies. - * - * - * Deprecated: 1.12: Use #ClutterPropertyTransition instead - */ - obj_props[PROP_OBJECT] = - g_param_spec_object ("object", - P_("Object"), - P_("Object to which the animation applies"), - G_TYPE_OBJECT, - CLUTTER_PARAM_READWRITE); - - /** - * ClutterAnimation:mode: - * - * The animation mode, either a value from #ClutterAnimationMode - * or a value returned by clutter_alpha_register_func(). The - * default value is %CLUTTER_LINEAR. - * - * - * Deprecated: 1.12: Use #ClutterPropertyTransition instead - */ - obj_props[PROP_MODE] = - g_param_spec_ulong ("mode", - P_("Mode"), - P_("The mode of the animation"), - 0, G_MAXULONG, - CLUTTER_LINEAR, - CLUTTER_PARAM_READWRITE); - - /** - * ClutterAnimation:duration: - * - * The duration of the animation, expressed in milliseconds. - * - * - * Deprecated: 1.12: Use #ClutterPropertyTransition instead - */ - obj_props[PROP_DURATION] = - g_param_spec_uint ("duration", - P_("Duration"), - P_("Duration of the animation, in milliseconds"), - 0, G_MAXUINT, - 0, - CLUTTER_PARAM_READWRITE); - - /** - * ClutterAnimation:loop: - * - * Whether the animation should loop. - * - * - * Deprecated: 1.12: Use #ClutterPropertyTransition instead - */ - obj_props[PROP_LOOP] = - g_param_spec_boolean ("loop", - P_("Loop"), - P_("Whether the animation should loop"), - FALSE, - CLUTTER_PARAM_READWRITE); - - /** - * ClutterAnimation:timeline: - * - * The #ClutterTimeline used by the animation. - * - * - * Deprecated: 1.12: Use #ClutterPropertyTransition instead - */ - obj_props[PROP_TIMELINE] = - g_param_spec_object ("timeline", - P_("Timeline"), - P_("The timeline used by the animation"), - CLUTTER_TYPE_TIMELINE, - CLUTTER_PARAM_READWRITE); - - /** - * ClutterAnimation:alpha: - * - * The #ClutterAlpha used by the animation. - * - * - * - * Deprecated: 1.10: Use the #ClutterAnimation:timeline property and - * the #ClutterTimeline:progress-mode property instead. - */ - obj_props[PROP_ALPHA] = - g_param_spec_object ("alpha", - P_("Alpha"), - P_("The alpha used by the animation"), - CLUTTER_TYPE_ALPHA, - CLUTTER_PARAM_READWRITE | G_PARAM_DEPRECATED); - - g_object_class_install_properties (gobject_class, - PROP_LAST, - obj_props); - - /** - * ClutterAnimation::started: - * @animation: the animation that emitted the signal - * - * The ::started signal is emitted once the animation has been - * started - * - * - * Deprecated: 1.12: Use #ClutterPropertyTransition instead - */ - animation_signals[STARTED] = - g_signal_new (I_("started"), - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ClutterAnimationClass, started), - NULL, NULL, - _clutter_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - /** - * ClutterAnimation::completed: - * @animation: the animation that emitted the signal - * - * The ::completed signal is emitted once the animation has - * been completed. - * - * The @animation instance is guaranteed to be valid for the entire - * duration of the signal emission chain. - * - * - * Deprecated: 1.12: Use #ClutterPropertyTransition instead - */ - animation_signals[COMPLETED] = - g_signal_new (I_("completed"), - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ClutterAnimationClass, completed), - NULL, NULL, - _clutter_marshal_VOID__VOID, - G_TYPE_NONE, 0); -} - -static void -clutter_animation_init (ClutterAnimation *self) -{ - self->priv = CLUTTER_ANIMATION_GET_PRIVATE (self); - - self->priv->properties = - g_hash_table_new_full (g_str_hash, g_str_equal, - (GDestroyNotify) g_free, - (GDestroyNotify) g_object_unref); -} - -static inline void -clutter_animation_bind_property_internal (ClutterAnimation *animation, - const gchar *property_name, - GParamSpec *pspec, - ClutterInterval *interval) -{ - ClutterAnimationPrivate *priv = animation->priv; - - if (!clutter_interval_validate (interval, pspec)) - { - g_warning ("Cannot bind property '%s': the interval is out " - "of bounds", - property_name); - return; - } - - g_hash_table_insert (priv->properties, - g_strdup (property_name), - g_object_ref_sink (interval)); -} - -static inline void -clutter_animation_update_property_internal (ClutterAnimation *animation, - const gchar *property_name, - GParamSpec *pspec, - ClutterInterval *interval) -{ - ClutterAnimationPrivate *priv = animation->priv; - - if (!clutter_interval_validate (interval, pspec)) - { - g_warning ("Cannot bind property '%s': the interval is out " - "of bounds", - property_name); - return; - } - - g_hash_table_replace (priv->properties, - g_strdup (property_name), - g_object_ref_sink (interval)); -} - -static GParamSpec * -clutter_animation_validate_bind (ClutterAnimation *animation, - const char *property_name, - GType argtype) -{ - ClutterAnimationPrivate *priv; - GParamSpec *pspec; - GType pspec_type; - - priv = animation->priv; - - if (G_UNLIKELY (!priv->object)) - { - g_warning ("Cannot bind property '%s': the animation has no " - "object set. You need to call clutter_animation_set_object() " - "first to be able to bind a property", - property_name); - return NULL; - } - - if (G_UNLIKELY (clutter_animation_has_property (animation, property_name))) - { - g_warning ("Cannot bind property '%s': the animation already has " - "a bound property with the same name", - property_name); - return NULL; - } - - if (CLUTTER_IS_ANIMATABLE (priv->object)) - { - ClutterAnimatable *animatable = CLUTTER_ANIMATABLE (priv->object); - - pspec = clutter_animatable_find_property (animatable, property_name); - } - else - { - GObjectClass *klass = G_OBJECT_GET_CLASS (priv->object); - - pspec = g_object_class_find_property (klass, property_name); - } - - if (pspec == NULL) - { - g_warning ("Cannot bind property '%s': objects of type '%s' have " - "no such property", - property_name, - g_type_name (G_OBJECT_TYPE (priv->object))); - return NULL; - } - - if (!(pspec->flags & G_PARAM_WRITABLE)) - { - g_warning ("Cannot bind property '%s': the property is not writable", - property_name); - return NULL; - } - - pspec_type = G_PARAM_SPEC_VALUE_TYPE (pspec); - - if (g_value_type_transformable (argtype, pspec_type)) - return pspec; - else - { - g_warning ("Cannot bind property '%s': the interval value of " - "type '%s' is not compatible with the property value " - "of type '%s'", - property_name, - g_type_name (argtype), - g_type_name (pspec_type)); - return NULL; - } -} - -/** - * clutter_animation_bind_interval: - * @animation: a #ClutterAnimation - * @property_name: the property to control - * @interval: (transfer full): a #ClutterInterval - * - * Binds @interval to the @property_name of the #GObject - * attached to @animation. The #ClutterAnimation will take - * ownership of the passed #ClutterInterval. For more information - * about animations, see clutter_actor_animate(). - * - * If you need to update the interval instance use - * clutter_animation_update_interval() instead. - * - * Return value: (transfer none): The animation itself. - * - * Deprecated: 1.12: Use #ClutterPropertyTransition instead - */ -ClutterAnimation * -clutter_animation_bind_interval (ClutterAnimation *animation, - const gchar *property_name, - ClutterInterval *interval) -{ - GParamSpec *pspec; - - g_return_val_if_fail (CLUTTER_IS_ANIMATION (animation), NULL); - g_return_val_if_fail (property_name != NULL, NULL); - g_return_val_if_fail (CLUTTER_IS_INTERVAL (interval), NULL); - - pspec = clutter_animation_validate_bind (animation, property_name, - clutter_interval_get_value_type (interval)); - if (pspec == NULL) - return NULL; - - clutter_animation_bind_property_internal (animation, property_name, - pspec, - interval); - - return animation; -} - - -/** - * clutter_animation_bind: - * @animation: a #ClutterAnimation - * @property_name: the property to control - * @final: The final value of the property - * - * Adds a single property with name @property_name to the - * animation @animation. For more information about animations, - * see clutter_actor_animate(). - * - * This method returns the animation primarily to make chained - * calls convenient in language bindings. - * - * Return value: (transfer none): The animation itself. - * - * - * Deprecated: 1.12: Use #ClutterPropertyTransition instead - */ -ClutterAnimation * -clutter_animation_bind (ClutterAnimation *animation, - const gchar *property_name, - const GValue *final) -{ - ClutterAnimationPrivate *priv; - GParamSpec *pspec; - ClutterInterval *interval; - GType type; - GValue initial = G_VALUE_INIT; - GValue real_final = G_VALUE_INIT; - - g_return_val_if_fail (CLUTTER_IS_ANIMATION (animation), NULL); - g_return_val_if_fail (property_name != NULL, NULL); - - priv = animation->priv; - - type = G_VALUE_TYPE (final); - pspec = clutter_animation_validate_bind (animation, property_name, type); - if (pspec == NULL) - return NULL; - - g_value_init (&real_final, G_PARAM_SPEC_VALUE_TYPE (pspec)); - if (!g_value_transform (final, &real_final)) - { - g_value_unset (&real_final); - g_warning ("Unable to transform the value of type '%s' to a value " - "of '%s' compatible with the property '%s'of the object " - "of type '%s'", - g_type_name (type), - g_type_name (G_PARAM_SPEC_VALUE_TYPE (pspec)), - property_name, - G_OBJECT_TYPE_NAME (priv->object)); - return NULL; - } - - g_value_init (&initial, G_PARAM_SPEC_VALUE_TYPE (pspec)); - - if (CLUTTER_IS_ANIMATABLE (priv->object)) - clutter_animatable_get_initial_state (CLUTTER_ANIMATABLE (priv->object), - property_name, - &initial); - else - g_object_get_property (priv->object, property_name, &initial); - - interval = clutter_interval_new_with_values (G_PARAM_SPEC_VALUE_TYPE (pspec), - &initial, - &real_final); - - g_value_unset (&initial); - g_value_unset (&real_final); - - clutter_animation_bind_property_internal (animation, property_name, - pspec, - interval); - - return animation; -} - - -/** - * clutter_animation_unbind_property: - * @animation: a #ClutterAnimation - * @property_name: name of the property - * - * Removes @property_name from the list of animated properties. - * - * - * Deprecated: 1.12: Use #ClutterPropertyTransition instead - */ -void -clutter_animation_unbind_property (ClutterAnimation *animation, - const gchar *property_name) -{ - ClutterAnimationPrivate *priv; - - g_return_if_fail (CLUTTER_IS_ANIMATION (animation)); - g_return_if_fail (property_name != NULL); - - priv = animation->priv; - - if (!clutter_animation_has_property (animation, property_name)) - { - g_warning ("Cannot unbind property '%s': the animation has " - "no bound property with that name", - property_name); - return; - } - - g_hash_table_remove (priv->properties, property_name); -} - -/** - * clutter_animation_has_property: - * @animation: a #ClutterAnimation - * @property_name: name of the property - * - * Checks whether @animation is controlling @property_name. - * - * Return value: %TRUE if the property is animated by the - * #ClutterAnimation, %FALSE otherwise - * - * - * Deprecated: 1.12: Use #ClutterPropertyTransition instead - */ -gboolean -clutter_animation_has_property (ClutterAnimation *animation, - const gchar *property_name) -{ - ClutterAnimationPrivate *priv; - - g_return_val_if_fail (CLUTTER_IS_ANIMATION (animation), FALSE); - g_return_val_if_fail (property_name != NULL, FALSE); - - priv = animation->priv; - - return g_hash_table_lookup (priv->properties, property_name) != NULL; -} - -/** - * clutter_animation_update_interval: - * @animation: a #ClutterAnimation - * @property_name: name of the property - * @interval: a #ClutterInterval - * - * Changes the @interval for @property_name. The #ClutterAnimation - * will take ownership of the passed #ClutterInterval. - * - * - * Deprecated: 1.12: Use #ClutterPropertyTransition instead - */ -void -clutter_animation_update_interval (ClutterAnimation *animation, - const gchar *property_name, - ClutterInterval *interval) -{ - ClutterAnimationPrivate *priv; - GParamSpec *pspec; - GType pspec_type, int_type; - - g_return_if_fail (CLUTTER_IS_ANIMATION (animation)); - g_return_if_fail (property_name != NULL); - g_return_if_fail (CLUTTER_IS_INTERVAL (interval)); - - priv = animation->priv; - - if (!clutter_animation_has_property (animation, property_name)) - { - g_warning ("Cannot update property '%s': the animation has " - "no bound property with that name", - property_name); - return; - } - - if (CLUTTER_IS_ANIMATABLE (priv->object)) - { - ClutterAnimatable *animatable = CLUTTER_ANIMATABLE (priv->object); - - pspec = clutter_animatable_find_property (animatable, property_name); - } - else - { - GObjectClass *klass = G_OBJECT_GET_CLASS (priv->object); - - pspec = g_object_class_find_property (klass, property_name); - } - - if (pspec == NULL) - { - g_warning ("Cannot update property '%s': objects of type '%s' have " - "no such property", - property_name, - g_type_name (G_OBJECT_TYPE (priv->object))); - return; - } - - pspec_type = G_PARAM_SPEC_VALUE_TYPE (pspec); - int_type = clutter_interval_get_value_type (interval); - - if (!g_value_type_compatible (int_type, pspec_type) || - !g_value_type_transformable (int_type, pspec_type)) - { - g_warning ("Cannot update property '%s': the interval value of " - "type '%s' is not compatible with the property value " - "of type '%s'", - property_name, - g_type_name (int_type), - g_type_name (pspec_type)); - return; - } - - clutter_animation_update_property_internal (animation, property_name, - pspec, - interval); -} - -/** - * clutter_animation_update: - * @animation: a #ClutterAnimation - * @property_name: name of the property - * @final: The final value of the property - * - * Updates the @final value of the interval for @property_name - * - * Return value: (transfer none): The animation itself. - * - * - * Deprecated: 1.12: Use #ClutterPropertyTransition instead - */ -ClutterAnimation * -clutter_animation_update (ClutterAnimation *animation, - const gchar *property_name, - const GValue *final) -{ - ClutterInterval *interval; - GType int_type; - - g_return_val_if_fail (CLUTTER_IS_ANIMATION (animation), NULL); - g_return_val_if_fail (property_name != NULL, NULL); - g_return_val_if_fail (final != NULL, NULL); - g_return_val_if_fail (G_VALUE_TYPE (final) != G_TYPE_INVALID, NULL); - - interval = clutter_animation_get_interval (animation, property_name); - if (interval == NULL) - { - g_warning ("Cannot update property '%s': the animation has " - "no bound property with that name", - property_name); - return NULL; - } - - int_type = clutter_interval_get_value_type (interval); - - if (!g_value_type_compatible (G_VALUE_TYPE (final), int_type) || - !g_value_type_transformable (G_VALUE_TYPE (final), int_type)) - { - g_warning ("Cannot update property '%s': the interval value of " - "type '%s' is not compatible with the property value " - "of type '%s'", - property_name, - g_type_name (int_type), - g_type_name (G_VALUE_TYPE (final))); - return NULL; - } - - clutter_interval_set_final_value (interval, final); - - return animation; -} - -/** - * clutter_animation_get_interval: - * @animation: a #ClutterAnimation - * @property_name: name of the property - * - * Retrieves the #ClutterInterval associated to @property_name - * inside @animation. - * - * Return value: (transfer none): a #ClutterInterval or %NULL if no - * property with the same name was found. The returned interval is - * owned by the #ClutterAnimation and should not be unreferenced - * - * - * Deprecated: 1.12: Use #ClutterPropertyTransition instead - */ -ClutterInterval * -clutter_animation_get_interval (ClutterAnimation *animation, - const gchar *property_name) -{ - ClutterAnimationPrivate *priv; - - g_return_val_if_fail (CLUTTER_IS_ANIMATION (animation), NULL); - g_return_val_if_fail (property_name != NULL, NULL); - - priv = animation->priv; - - return g_hash_table_lookup (priv->properties, property_name); -} - -static void -on_timeline_started (ClutterTimeline *timeline, - ClutterAnimation *animation) -{ - g_signal_emit (animation, animation_signals[STARTED], 0); -} - -static void -on_timeline_completed (ClutterTimeline *timeline, - ClutterAnimation *animation) -{ - CLUTTER_NOTE (ANIMATION, "Timeline [%p] complete", timeline); - - if (!clutter_animation_get_loop (animation)) - g_signal_emit (animation, animation_signals[COMPLETED], 0); -} - -static void -on_timeline_frame (ClutterTimeline *timeline, - gint elapsed, - ClutterAnimation *animation) -{ - ClutterAnimationPrivate *priv; - GList *properties, *p; - gdouble alpha_value; - gboolean is_animatable = FALSE; - ClutterAnimatable *animatable = NULL; - - /* make sure the animation survives the notification */ - g_object_ref (animation); - - priv = animation->priv; - - if (priv->alpha != NULL) - alpha_value = clutter_alpha_get_alpha (priv->alpha); - else - alpha_value = clutter_timeline_get_progress (priv->timeline); - - if (CLUTTER_IS_ANIMATABLE (priv->object)) - { - animatable = CLUTTER_ANIMATABLE (priv->object); - is_animatable = TRUE; - } - - g_object_freeze_notify (priv->object); - - properties = g_hash_table_get_keys (priv->properties); - for (p = properties; p != NULL; p = p->next) - { - const gchar *p_name = p->data; - ClutterInterval *interval; - GValue value = G_VALUE_INIT; - gboolean apply; - - interval = g_hash_table_lookup (priv->properties, p_name); - g_assert (CLUTTER_IS_INTERVAL (interval)); - - g_value_init (&value, clutter_interval_get_value_type (interval)); - - if (is_animatable) - { - apply = clutter_animatable_interpolate_value (animatable, p_name, - interval, - alpha_value, - &value); - } - else - { - apply = clutter_interval_compute_value (interval, - alpha_value, - &value); - } - - if (apply) - { - if (is_animatable) - clutter_animatable_set_final_state (animatable, p_name, &value); - else - g_object_set_property (priv->object, p_name, &value); - } - - g_value_unset (&value); - } - - g_list_free (properties); - - g_object_thaw_notify (priv->object); - - g_object_unref (animation); -} - -static ClutterTimeline * -clutter_animation_get_timeline_internal (ClutterAnimation *animation) -{ - ClutterAnimationPrivate *priv = animation->priv; - ClutterTimeline *timeline; - - if (priv->timeline != NULL) - return priv->timeline; - - if (priv->alpha != NULL) - { - timeline = clutter_alpha_get_timeline (priv->alpha); - if (timeline != NULL) - return timeline; - } - - timeline = g_object_new (CLUTTER_TYPE_TIMELINE, NULL); - - priv->timeline_started_id = - g_signal_connect (timeline, "started", - G_CALLBACK (on_timeline_started), - animation); - - priv->timeline_completed_id = - g_signal_connect (timeline, "completed", - G_CALLBACK (on_timeline_completed), - animation); - - priv->timeline_frame_id = - g_signal_connect (timeline, "new-frame", - G_CALLBACK (on_timeline_frame), - animation); - - if (priv->alpha != NULL) - { - clutter_alpha_set_timeline (priv->alpha, timeline); - - /* the alpha owns the timeline now */ - g_object_unref (timeline); - } - - priv->timeline = timeline; - - g_object_notify_by_pspec (G_OBJECT (animation), obj_props[PROP_TIMELINE]); - - return priv->timeline; -} - -static void -clutter_animation_set_alpha_internal (ClutterAnimation *animation, - ClutterAlpha *alpha) -{ - ClutterAnimationPrivate *priv; - ClutterTimeline *timeline; - - priv = animation->priv; - - if (priv->alpha == alpha) - return; - - g_object_freeze_notify (G_OBJECT (animation)); - - if (priv->alpha != NULL) - timeline = clutter_alpha_get_timeline (priv->alpha); - else - timeline = NULL; - - /* disconnect the old timeline first */ - if (timeline != NULL && priv->timeline_started_id != 0) - { - g_signal_handler_disconnect (timeline, priv->timeline_started_id); - priv->timeline_started_id = 0; - } - - if (timeline != NULL && priv->timeline_completed_id != 0) - { - g_signal_handler_disconnect (timeline, priv->timeline_completed_id); - priv->timeline_completed_id = 0; - } - - /* then we need to disconnect the signal handler from the old alpha */ - if (timeline != NULL && priv->timeline_frame_id != 0) - { - g_signal_handler_disconnect (timeline, priv->timeline_frame_id); - priv->timeline_frame_id = 0; - } - - if (priv->alpha != NULL) - { - /* this will take care of any reference we hold on the timeline */ - g_object_unref (priv->alpha); - priv->alpha = NULL; - } - - if (alpha == NULL) - goto out; - - priv->alpha = g_object_ref_sink (alpha); - - /* if the alpha has a timeline then we use it, otherwise we create one */ - timeline = clutter_alpha_get_timeline (priv->alpha); - if (timeline != NULL) - { - priv->timeline_started_id = - g_signal_connect (timeline, "started", - G_CALLBACK (on_timeline_started), - animation); - priv->timeline_completed_id = - g_signal_connect (timeline, "completed", - G_CALLBACK (on_timeline_completed), - animation); - priv->timeline_frame_id = - g_signal_connect (timeline, "new-frame", - G_CALLBACK (on_timeline_frame), - animation); - } - else - { - /* FIXME - add a create_timeline_internal() because this does - * not look very good - */ - (void) clutter_animation_get_timeline_internal (animation); - } - -out: - /* emit all relevant notifications */ - g_object_notify_by_pspec (G_OBJECT (animation), obj_props[PROP_MODE]); - g_object_notify_by_pspec (G_OBJECT (animation), obj_props[PROP_DURATION]); - g_object_notify_by_pspec (G_OBJECT (animation), obj_props[PROP_LOOP]); - g_object_notify_by_pspec (G_OBJECT (animation), obj_props[PROP_ALPHA]); - g_object_notify_by_pspec (G_OBJECT (animation), obj_props[PROP_TIMELINE]); - - g_object_thaw_notify (G_OBJECT (animation)); -} - -/** - * clutter_animation_new: - * - * Creates a new #ClutterAnimation instance. You should set the - * #GObject to be animated using clutter_animation_set_object(), - * set the duration with clutter_animation_set_duration() and the - * easing mode using clutter_animation_set_mode(). - * - * Use clutter_animation_bind() or clutter_animation_bind_interval() - * to define the properties to be animated. The interval and the - * animated properties can be updated at runtime. - * - * The clutter_actor_animate() and relative family of functions provide - * an easy way to animate a #ClutterActor and automatically manage the - * lifetime of a #ClutterAnimation instance, so you should consider using - * those functions instead of manually creating an animation. - * - * Return value: the newly created #ClutterAnimation. Use g_object_unref() - * to release the associated resources - * - * - * Deprecated: 1.12: Use #ClutterPropertyTransition instead - */ -ClutterAnimation * -clutter_animation_new (void) -{ - return g_object_new (CLUTTER_TYPE_ANIMATION, NULL); -} - -/** - * clutter_animation_set_object: - * @animation: a #ClutterAnimation - * @object: a #GObject - * - * Attaches @animation to @object. The #ClutterAnimation will take a - * reference on @object. - * - * - * Deprecated: 1.12: Use #ClutterPropertyTransition instead - */ -void -clutter_animation_set_object (ClutterAnimation *animation, - GObject *object) -{ - ClutterAnimationPrivate *priv; - - g_return_if_fail (CLUTTER_IS_ANIMATION (animation)); - g_return_if_fail (object == NULL || G_IS_OBJECT (object)); - - priv = animation->priv; - - if (priv->object != NULL) - { - g_object_set_qdata (priv->object, quark_object_animation, NULL); - - g_object_unref (priv->object); - priv->object = NULL; - } - - if (object != NULL) - priv->object = g_object_ref (object); - - g_object_notify_by_pspec (G_OBJECT (animation), obj_props[PROP_OBJECT]); -} - -/** - * clutter_animation_get_object: - * @animation: a #ClutterAnimation - * - * Retrieves the #GObject attached to @animation. - * - * Return value: (transfer none): a #GObject - * - * - * Deprecated: 1.12: Use #ClutterPropertyTransition instead - */ -GObject * -clutter_animation_get_object (ClutterAnimation *animation) -{ - g_return_val_if_fail (CLUTTER_IS_ANIMATION (animation), NULL); - - return animation->priv->object; -} - -/** - * clutter_animation_set_mode: - * @animation: a #ClutterAnimation - * @mode: an animation mode logical id - * - * Sets the animation @mode of @animation. The animation @mode is - * a logical id, either coming from the #ClutterAnimationMode enumeration - * or the return value of clutter_alpha_register_func(). - * - * This function will also set #ClutterAnimation:alpha if needed. - * - * - * Deprecated: 1.12: Use #ClutterPropertyTransition instead - */ -void -clutter_animation_set_mode (ClutterAnimation *animation, - gulong mode) -{ - g_return_if_fail (CLUTTER_IS_ANIMATION (animation)); - - g_object_freeze_notify (G_OBJECT (animation)); - - if (animation->priv->alpha != NULL || mode > CLUTTER_ANIMATION_LAST) - { - ClutterAlpha *alpha; - - if (animation->priv->alpha == NULL) - alpha = clutter_animation_get_alpha_internal (animation); - else - alpha = animation->priv->alpha; - - clutter_alpha_set_mode (alpha, mode); - } - else - { - ClutterTimeline *timeline; - - timeline = clutter_animation_get_timeline_internal (animation); - - clutter_timeline_set_progress_mode (timeline, mode); - } - - g_object_notify_by_pspec (G_OBJECT (animation), obj_props[PROP_MODE]); - - g_object_thaw_notify (G_OBJECT (animation)); -} - -/** - * clutter_animation_get_mode: - * @animation: a #ClutterAnimation - * - * Retrieves the animation mode of @animation, as set by - * clutter_animation_set_mode(). - * - * Return value: the mode for the animation - * - * - * Deprecated: 1.12: Use #ClutterPropertyTransition instead - */ -gulong -clutter_animation_get_mode (ClutterAnimation *animation) -{ - ClutterTimeline *timeline; - - g_return_val_if_fail (CLUTTER_IS_ANIMATION (animation), CLUTTER_LINEAR); - - if (animation->priv->alpha != NULL) - return clutter_alpha_get_mode (animation->priv->alpha); - - timeline = clutter_animation_get_timeline_internal (animation); - - return clutter_timeline_get_progress_mode (timeline); -} - -/** - * clutter_animation_set_duration: - * @animation: a #ClutterAnimation - * @msecs: the duration in milliseconds - * - * Sets the duration of @animation in milliseconds. - * - * This function will set #ClutterAnimation:alpha and - * #ClutterAnimation:timeline if needed. - * - * - * Deprecated: 1.12: Use #ClutterPropertyTransition instead - */ -void -clutter_animation_set_duration (ClutterAnimation *animation, - guint msecs) -{ - ClutterTimeline *timeline; - - g_return_if_fail (CLUTTER_IS_ANIMATION (animation)); - - g_object_freeze_notify (G_OBJECT (animation)); - - timeline = clutter_animation_get_timeline_internal (animation); - clutter_timeline_set_duration (timeline, msecs); - clutter_timeline_rewind (timeline); - - g_object_notify_by_pspec (G_OBJECT (animation), obj_props[PROP_DURATION]); - - g_object_thaw_notify (G_OBJECT (animation)); -} - -/** - * clutter_animation_set_loop: - * @animation: a #ClutterAnimation - * @loop: %TRUE if the animation should loop - * - * Sets whether @animation should loop over itself once finished. - * - * A looping #ClutterAnimation will not emit the #ClutterAnimation::completed - * signal when finished. - * - * This function will set #ClutterAnimation:alpha and - * #ClutterAnimation:timeline if needed. - * - * - * Deprecated: 1.12: Use #ClutterPropertyTransition instead - */ -void -clutter_animation_set_loop (ClutterAnimation *animation, - gboolean loop) -{ - ClutterTimeline *timeline; - - g_return_if_fail (CLUTTER_IS_ANIMATION (animation)); - - g_object_freeze_notify (G_OBJECT (animation)); - - timeline = clutter_animation_get_timeline_internal (animation); - clutter_timeline_set_repeat_count (timeline, loop ? -1 : 0); - - g_object_notify_by_pspec (G_OBJECT (animation), obj_props[PROP_LOOP]); - - g_object_thaw_notify (G_OBJECT (animation)); -} - -/** - * clutter_animation_get_loop: - * @animation: a #ClutterAnimation - * - * Retrieves whether @animation is looping. - * - * Return value: %TRUE if the animation is looping - * - * - * Deprecated: 1.12: Use #ClutterPropertyTransition instead - */ -gboolean -clutter_animation_get_loop (ClutterAnimation *animation) -{ - ClutterTimeline *timeline; - - g_return_val_if_fail (CLUTTER_IS_ANIMATION (animation), FALSE); - - timeline = clutter_animation_get_timeline_internal (animation); - - return clutter_timeline_get_repeat_count (timeline) != 0; -} - -/** - * clutter_animation_get_duration: - * @animation: a #ClutterAnimation - * - * Retrieves the duration of @animation, in milliseconds. - * - * Return value: the duration of the animation - * - * - * Deprecated: 1.12: Use #ClutterPropertyTransition instead - */ -guint -clutter_animation_get_duration (ClutterAnimation *animation) -{ - ClutterTimeline *timeline; - - g_return_val_if_fail (CLUTTER_IS_ANIMATION (animation), 0); - - timeline = clutter_animation_get_timeline_internal (animation); - - return clutter_timeline_get_duration (timeline); -} - -/** - * clutter_animation_set_timeline: - * @animation: a #ClutterAnimation - * @timeline: (allow-none): a #ClutterTimeline, or %NULL to unset the - * current #ClutterTimeline - * - * Sets the #ClutterTimeline used by @animation. - * - * This function will take a reference on the passed @timeline. - * - * - * Deprecated: 1.12: Use #ClutterPropertyTransition instead - */ -void -clutter_animation_set_timeline (ClutterAnimation *animation, - ClutterTimeline *timeline) -{ - ClutterAnimationPrivate *priv; - ClutterTimeline *cur_timeline; - - g_return_if_fail (CLUTTER_IS_ANIMATION (animation)); - g_return_if_fail (timeline == NULL || CLUTTER_IS_TIMELINE (timeline)); - - priv = animation->priv; - - if (priv->alpha != NULL) - cur_timeline = clutter_alpha_get_timeline (priv->alpha); - else - cur_timeline = priv->timeline; - - if (cur_timeline == timeline) - return; - - g_object_freeze_notify (G_OBJECT (animation)); - - if (cur_timeline != NULL && priv->timeline_started_id != 0) - g_signal_handler_disconnect (cur_timeline, priv->timeline_started_id); - - if (cur_timeline != NULL && priv->timeline_completed_id != 0) - g_signal_handler_disconnect (cur_timeline, priv->timeline_completed_id); - - if (cur_timeline != NULL && priv->timeline_frame_id != 0) - g_signal_handler_disconnect (cur_timeline, priv->timeline_frame_id); - - priv->timeline_started_id = 0; - priv->timeline_completed_id = 0; - priv->timeline_frame_id = 0; - - /* Release previously set timeline if any */ - g_clear_object (&priv->timeline); - - if (priv->alpha != NULL) - clutter_alpha_set_timeline (priv->alpha, timeline); - else - { - /* Hold a reference to the timeline if it's not reffed by the priv->alpha */ - priv->timeline = timeline; - - if (priv->timeline) - g_object_ref (priv->timeline); - } - - g_object_notify_by_pspec (G_OBJECT (animation), obj_props[PROP_TIMELINE]); - g_object_notify_by_pspec (G_OBJECT (animation), obj_props[PROP_DURATION]); - g_object_notify_by_pspec (G_OBJECT (animation), obj_props[PROP_LOOP]); - - if (timeline != NULL) - { - priv->timeline_started_id = - g_signal_connect (timeline, "started", - G_CALLBACK (on_timeline_started), - animation); - priv->timeline_completed_id = - g_signal_connect (timeline, "completed", - G_CALLBACK (on_timeline_completed), - animation); - priv->timeline_frame_id = - g_signal_connect (timeline, "new-frame", - G_CALLBACK (on_timeline_frame), - animation); - } - - g_object_thaw_notify (G_OBJECT (animation)); -} - -/** - * clutter_animation_get_timeline: - * @animation: a #ClutterAnimation - * - * Retrieves the #ClutterTimeline used by @animation - * - * Return value: (transfer none): the timeline used by the animation - * - * - * Deprecated: 1.12: Use #ClutterPropertyTransition instead - */ -ClutterTimeline * -clutter_animation_get_timeline (ClutterAnimation *animation) -{ - g_return_val_if_fail (CLUTTER_IS_ANIMATION (animation), NULL); - - return clutter_animation_get_timeline_internal (animation); -} - -/** - * clutter_animation_set_alpha: - * @animation: a #ClutterAnimation - * @alpha: a #ClutterAlpha, or %NULL to unset the current #ClutterAlpha - * - * Sets @alpha as the #ClutterAlpha used by @animation. - * - * If @alpha is not %NULL, the #ClutterAnimation will take ownership - * of the #ClutterAlpha instance. - * - * - * - * Deprecated: 1.10: Use clutter_animation_get_timeline() and - * clutter_timeline_set_progress_mode() instead. - */ -void -clutter_animation_set_alpha (ClutterAnimation *animation, - ClutterAlpha *alpha) -{ - g_return_if_fail (CLUTTER_IS_ANIMATION (animation)); - g_return_if_fail (alpha == NULL || CLUTTER_IS_ALPHA (alpha)); - - clutter_animation_set_alpha_internal (animation, alpha); -} - -/** - * clutter_animation_get_alpha: - * @animation: a #ClutterAnimation - * - * Retrieves the #ClutterAlpha used by @animation. - * - * Return value: (transfer none): the alpha object used by the animation - * - * - * - * Deprecated: 1.10: Use clutter_animation_get_timeline() and - * clutter_timeline_get_progress_mode() instead. - */ -ClutterAlpha * -clutter_animation_get_alpha (ClutterAnimation *animation) -{ - g_return_val_if_fail (CLUTTER_IS_ANIMATION (animation), NULL); - - return clutter_animation_get_alpha_internal (animation); -} - -/** - * clutter_animation_completed: - * @animation: a #ClutterAnimation - * - * Emits the ::completed signal on @animation - * - * When using this function with a #ClutterAnimation created - * by the clutter_actor_animate() family of functions, @animation - * will be unreferenced and it will not be valid anymore, - * unless g_object_ref() was called before calling this function - * or unless a reference was taken inside a handler for the - * #ClutterAnimation::completed signal - * - * - * Deprecated: 1.12: Use #ClutterPropertyTransition instead - */ -void -clutter_animation_completed (ClutterAnimation *animation) -{ - g_return_if_fail (CLUTTER_IS_ANIMATION (animation)); - - g_signal_emit (animation, animation_signals[COMPLETED], 0); -} - -/* - * starts the timeline - */ -static void -clutter_animation_start (ClutterAnimation *animation) -{ - ClutterTimeline *timeline; - - timeline = clutter_animation_get_timeline_internal (animation); - - if (G_LIKELY (timeline != NULL)) - clutter_timeline_start (timeline); - else - { - /* sanity check */ - g_warning (G_STRLOC ": no timeline found, unable to start the animation"); - } -} - -static void -clutter_animation_setup_property (ClutterAnimation *animation, - const gchar *property_name, - const GValue *value, - GParamSpec *pspec, - gboolean is_fixed) -{ - ClutterAnimationPrivate *priv = animation->priv; - GValue real_value = G_VALUE_INIT; - - if (pspec->flags & G_PARAM_CONSTRUCT_ONLY) - { - g_warning ("Cannot bind property '%s': the property is " - "construct-only", - property_name); - return; - } - - if (!(pspec->flags & G_PARAM_WRITABLE)) - { - g_warning ("Cannot bind property '%s': the property is " - "not writable", - property_name); - return; - } - - /* initialize the real value that will be used to store the - * final state of the animation - */ - g_value_init (&real_value, G_PARAM_SPEC_VALUE_TYPE (pspec)); - - /* if it's not the same type of the GParamSpec value, try to - * convert it using the GValue transformation API, otherwise - * just copy it - */ - if (!g_type_is_a (G_VALUE_TYPE (value), G_VALUE_TYPE (&real_value))) - { - /* are these two types compatible (can be directly copied)? */ - if (g_value_type_compatible (G_VALUE_TYPE (value), - G_VALUE_TYPE (&real_value))) - { - g_value_copy (value, &real_value); - goto done; - } - - /* are these two type transformable? */ - if (g_value_type_transformable (G_VALUE_TYPE (value), - G_VALUE_TYPE (&real_value))) - { - if (g_value_transform (value, &real_value)) - goto done; - } - - /* if not compatible and not transformable then we can't do much */ - g_warning ("%s: Unable to convert from %s to %s for " - "the property '%s' of object %s", - G_STRLOC, - g_type_name (G_VALUE_TYPE (value)), - g_type_name (G_VALUE_TYPE (&real_value)), - property_name, - G_OBJECT_TYPE_NAME (priv->object)); - g_value_unset (&real_value); - return; - } - else - g_value_copy (value, &real_value); - -done: - /* create an interval and bind it to the property, in case - * it's not a fixed property, otherwise just set it - */ - if (G_LIKELY (!is_fixed)) - { - ClutterInterval *interval; - GValue cur_value = G_VALUE_INIT; - - g_value_init (&cur_value, G_PARAM_SPEC_VALUE_TYPE (pspec)); - - if (CLUTTER_IS_ANIMATABLE (priv->object)) - clutter_animatable_get_initial_state (CLUTTER_ANIMATABLE (priv->object), - property_name, - &cur_value); - else - g_object_get_property (priv->object, property_name, &cur_value); - - interval = - clutter_interval_new_with_values (G_PARAM_SPEC_VALUE_TYPE (pspec), - &cur_value, - &real_value); - - if (!clutter_animation_has_property (animation, property_name)) - clutter_animation_bind_property_internal (animation, property_name, - pspec, - interval); - else - clutter_animation_update_property_internal (animation, property_name, - pspec, - interval); - - g_value_unset (&cur_value); - } - else - { - if (CLUTTER_IS_ANIMATABLE (priv->object)) - clutter_animatable_set_final_state (CLUTTER_ANIMATABLE (priv->object), - property_name, - &real_value); - else - g_object_set_property (priv->object, property_name, &real_value); - } - - g_value_unset (&real_value); -} - -static void -clutter_animation_setupv (ClutterAnimation *animation, - gint n_properties, - const gchar * const properties[], - const GValue *values) -{ - ClutterAnimationPrivate *priv = animation->priv; - ClutterAnimatable *animatable = NULL; - GObjectClass *klass = NULL; - gint i; - - if (CLUTTER_IS_ANIMATABLE (priv->object)) - animatable = CLUTTER_ANIMATABLE (priv->object); - else - klass = G_OBJECT_GET_CLASS (priv->object); - - for (i = 0; i < n_properties; i++) - { - const gchar *property_name = properties[i]; - GParamSpec *pspec; - gboolean is_fixed = FALSE; - - if (g_str_has_prefix (property_name, "fixed::")) - { - property_name += 7; /* strlen("fixed::") */ - is_fixed = TRUE; - } - - if (animatable != NULL) - pspec = clutter_animatable_find_property (animatable, property_name); - else - pspec = g_object_class_find_property (klass, property_name); - - if (pspec == NULL) - { - g_warning ("Cannot bind property '%s': objects of type '%s' do " - "not have this property", - property_name, - g_type_name (G_OBJECT_TYPE (priv->object))); - break; - } - - clutter_animation_setup_property (animation, property_name, - &values[i], - pspec, - is_fixed); - } -} - -static const struct -{ - const gchar *name; - GConnectFlags flags; -} signal_prefixes[] = - { - { "::", 0 }, - { "-swapped::", G_CONNECT_SWAPPED }, - { "-after::", G_CONNECT_AFTER }, - { "-swapped-after::", G_CONNECT_SWAPPED | G_CONNECT_AFTER } - }; - -static gboolean -clutter_animation_has_signal_prefix (const gchar *property_name, - GConnectFlags *flags, - int *offset) -{ - int i; - - if (!g_str_has_prefix (property_name, "signal")) - return FALSE; - - for (i = 0; i < G_N_ELEMENTS (signal_prefixes); i++) - if (g_str_has_prefix (property_name + 6, signal_prefixes[i].name)) - { - *offset = strlen (signal_prefixes[i].name) + 6; - *flags = signal_prefixes[i].flags; - return TRUE; - } - - return FALSE; -} - -static void -clutter_animation_setup_valist (ClutterAnimation *animation, - const gchar *first_property_name, - va_list var_args) -{ - ClutterAnimationPrivate *priv = animation->priv; - ClutterAnimatable *animatable = NULL; - GObjectClass *klass = NULL; - const gchar *property_name; - - if (CLUTTER_IS_ANIMATABLE (priv->object)) - animatable = CLUTTER_ANIMATABLE (priv->object); - else - klass = G_OBJECT_GET_CLASS (priv->object); - - property_name = first_property_name; - while (property_name != NULL) - { - GParamSpec *pspec; - GValue final = G_VALUE_INIT; - gchar *error = NULL; - gboolean is_fixed = FALSE; - GConnectFlags flags; - int offset; - - if (clutter_animation_has_signal_prefix (property_name, - &flags, - &offset)) - { - const gchar *signal_name = property_name + offset; - GCallback callback = va_arg (var_args, GCallback); - gpointer userdata = va_arg (var_args, gpointer); - - g_signal_connect_data (animation, signal_name, - callback, userdata, - NULL, flags); - } - else - { - if (g_str_has_prefix (property_name, "fixed::")) - { - property_name += 7; /* strlen("fixed::") */ - is_fixed = TRUE; - } - - if (animatable != NULL) - pspec = clutter_animatable_find_property (animatable, - property_name); - else - pspec = g_object_class_find_property (klass, property_name); - - if (pspec == NULL) - { - g_warning ("Cannot bind property '%s': objects of type '%s' do " - "not have this property", - property_name, - g_type_name (G_OBJECT_TYPE (priv->object))); - break; - } - - G_VALUE_COLLECT_INIT (&final, G_PARAM_SPEC_VALUE_TYPE (pspec), - var_args, 0, - &error); - - if (error) - { - g_warning ("%s: %s", G_STRLOC, error); - g_free (error); - break; - } - - clutter_animation_setup_property (animation, property_name, - &final, - pspec, - is_fixed); - - - g_value_unset (&final); - } - - property_name = va_arg (var_args, gchar*); - } -} - -static ClutterAnimation * -animation_create_for_actor (ClutterActor *actor) -{ - ClutterAnimation *animation; - GObject *object = G_OBJECT (actor); - - animation = g_object_get_qdata (object, quark_object_animation); - if (animation == NULL) - { - animation = clutter_animation_new (); - clutter_animation_set_object (animation, object); - g_object_set_qdata (object, quark_object_animation, animation); - - /* use the ::destroy signal to get a notification - * that the actor went away mid-animation - */ - g_signal_connect (object, "destroy", - G_CALLBACK (on_actor_destroy), - animation); - - CLUTTER_NOTE (ANIMATION, - "Created new Animation [%p] for actor [%p]", - animation, - actor); - } - else - { - CLUTTER_NOTE (ANIMATION, - "Reusing Animation [%p] for actor [%p]", - animation, - actor); - } - - return animation; -} - -/** - * clutter_actor_animate_with_alpha: - * @actor: a #ClutterActor - * @alpha: a #ClutterAlpha - * @first_property_name: the name of a property - * @...: a %NULL terminated list of property names and - * property values - * - * Animates the given list of properties of @actor between the current - * value for each property and a new final value. The animation has a - * definite behaviour given by the passed @alpha. - * - * See clutter_actor_animate() for further details. - * - * This function is useful if you want to use an existing #ClutterAlpha - * to animate @actor. - * - * Return value: (transfer none): a #ClutterAnimation object. The object is owned by the - * #ClutterActor and should not be unreferenced with g_object_unref() - * - * - * - * Deprecated: 1.10: Use clutter_actor_animate_with_timeline() instead - */ -ClutterAnimation * -clutter_actor_animate_with_alpha (ClutterActor *actor, - ClutterAlpha *alpha, - const gchar *first_property_name, - ...) -{ - ClutterAnimation *animation; - ClutterTimeline *timeline; - va_list args; - - g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), NULL); - g_return_val_if_fail (CLUTTER_IS_ALPHA (alpha), NULL); - g_return_val_if_fail (first_property_name != NULL, NULL); - - timeline = clutter_alpha_get_timeline (alpha); - if (timeline == NULL) - { - g_warning ("The passed ClutterAlpha does not have an " - "associated ClutterTimeline."); - return NULL; - } - - animation = animation_create_for_actor (actor); - clutter_animation_set_alpha_internal (animation, alpha); - - va_start (args, first_property_name); - clutter_animation_setup_valist (animation, first_property_name, args); - va_end (args); - - clutter_animation_start (animation); - - return animation; -} - -/** - * clutter_actor_animate_with_timeline: - * @actor: a #ClutterActor - * @mode: an animation mode logical id - * @timeline: a #ClutterTimeline - * @first_property_name: the name of a property - * @...: a %NULL terminated list of property names and - * property values - * - * Animates the given list of properties of @actor between the current - * value for each property and a new final value. The animation has a - * definite duration given by @timeline and a speed given by the @mode. - * - * See clutter_actor_animate() for further details. - * - * This function is useful if you want to use an existing timeline - * to animate @actor. - * - * Return value: (transfer none): a #ClutterAnimation object. The object is - * owned by the #ClutterActor and should not be unreferenced with - * g_object_unref() - * - * - * Deprecated: 1.12: Use the implicit transition for animatable properties - * in #ClutterActor instead. - */ -ClutterAnimation * -clutter_actor_animate_with_timeline (ClutterActor *actor, - gulong mode, - ClutterTimeline *timeline, - const gchar *first_property_name, - ...) -{ - ClutterAnimation *animation; - va_list args; - - g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), NULL); - g_return_val_if_fail (CLUTTER_IS_TIMELINE (timeline), NULL); - g_return_val_if_fail (first_property_name != NULL, NULL); - - animation = animation_create_for_actor (actor); - clutter_animation_set_mode (animation, mode); - clutter_animation_set_timeline (animation, timeline); - - va_start (args, first_property_name); - clutter_animation_setup_valist (animation, first_property_name, args); - va_end (args); - - clutter_animation_start (animation); - - return animation; -} - -/** - * clutter_actor_animate: - * @actor: a #ClutterActor - * @mode: an animation mode logical id - * @duration: duration of the animation, in milliseconds - * @first_property_name: the name of a property - * @...: a %NULL terminated list of property names and - * property values - * - * Animates the given list of properties of @actor between the current - * value for each property and a new final value. The animation has a - * definite duration and a speed given by the @mode. - * - * For example, this: - * - * |[ - * clutter_actor_animate (rectangle, CLUTTER_LINEAR, 250, - * "width", 100.0, - * "height", 100.0, - * NULL); - * ]| - * - * will make width and height properties of the #ClutterActor "rectangle" - * grow linearly between the current value and 100 pixels, in 250 milliseconds. - * - * The animation @mode is a logical id, either from the #ClutterAnimationMode - * enumeration of from clutter_alpha_register_func(). - * - * All the properties specified will be animated between the current value - * and the final value. If a property should be set at the beginning of - * the animation but not updated during the animation, it should be prefixed - * by the "fixed::" string, for instance: - * - * |[ - * clutter_actor_animate (actor, CLUTTER_EASE_IN_SINE, 100, - * "rotation-angle-z", 360.0, - * "fixed::rotation-center-z", &center, - * NULL); - * ]| - * - * Will animate the "rotation-angle-z" property between the current value - * and 360 degrees, and set the "rotation-center-z" property to the fixed - * value of the #ClutterVertex "center". - * - * This function will implicitly create a #ClutterAnimation object which - * will be assigned to the @actor and will be returned to the developer - * to control the animation or to know when the animation has been - * completed. - * - * If a name argument starts with "signal::", "signal-after::", - * "signal-swapped::" or "signal-swapped-after::" the two following arguments - * are used as callback function and data for a signal handler installed on - * the #ClutterAnimation object for the specified signal name, for instance: - * - * |[ - * - * static void - * on_animation_completed (ClutterAnimation *animation, - * ClutterActor *actor) - * { - * clutter_actor_hide (actor); - * } - * - * clutter_actor_animate (actor, CLUTTER_EASE_IN_CUBIC, 100, - * "opacity", 0, - * "signal::completed", on_animation_completed, actor, - * NULL); - * ]| - * - * or, to automatically destroy an actor at the end of the animation: - * - * |[ - * clutter_actor_animate (actor, CLUTTER_EASE_IN_CUBIC, 100, - * "opacity", 0, - * "signal-swapped-after::completed", - * clutter_actor_destroy, - * actor, - * NULL); - * ]| - * - * The "signal::" modifier is the equivalent of using g_signal_connect(); - * the "signal-after::" modifier is the equivalent of using - * g_signal_connect_after() or g_signal_connect_data() with the - * %G_CONNECT_AFTER; the "signal-swapped::" modifier is the equivalent - * of using g_signal_connect_swapped() or g_signal_connect_data() with the - * %G_CONNECT_SWAPPED flah; finally, the "signal-swapped-after::" modifier - * is the equivalent of using g_signal_connect_data() with both the - * %G_CONNECT_AFTER and %G_CONNECT_SWAPPED flags. The clutter_actor_animate() - * function will not keep track of multiple connections to the same signal, - * so it is your responsability to avoid them when calling - * clutter_actor_animate() multiple times on the same actor. - * - * Calling this function on an actor that is already being animated - * will cause the current animation to change with the new final values, - * the new easing mode and the new duration - that is, this code: - * - * |[ - * clutter_actor_animate (actor, CLUTTER_LINEAR, 250, - * "width", 100.0, - * "height", 100.0, - * NULL); - * clutter_actor_animate (actor, CLUTTER_EASE_IN_CUBIC, 500, - * "x", 100.0, - * "y", 100.0, - * "width", 200.0, - * NULL); - * ]| - * - * is the equivalent of: - * - * |[ - * clutter_actor_animate (actor, CLUTTER_EASE_IN_CUBIC, 500, - * "x", 100.0, - * "y", 100.0, - * "width", 200.0, - * "height", 100.0, - * NULL); - * ]| - * - * Unless the animation is looping, the #ClutterAnimation created by - * clutter_actor_animate() will become invalid as soon as it is - * complete. - * - * Since the created #ClutterAnimation instance attached to @actor - * is guaranteed to be valid throughout the #ClutterAnimation::completed - * signal emission chain, you will not be able to create a new animation - * using clutter_actor_animate() on the same @actor from within the - * #ClutterAnimation::completed signal handler unless you use - * g_signal_connect_after() to connect the callback function, for instance: - * - * |[ - * static void - * on_animation_completed (ClutterAnimation *animation, - * ClutterActor *actor) - * { - * clutter_actor_animate (actor, CLUTTER_EASE_OUT_CUBIC, 250, - * "x", 500.0, - * "y", 500.0, - * NULL); - * } - * - * ... - * animation = clutter_actor_animate (actor, CLUTTER_EASE_IN_CUBIC, 250, - * "x", 100.0, - * "y", 100.0, - * NULL); - * g_signal_connect (animation, "completed", - * G_CALLBACK (on_animation_completed), - * actor); - * ... - * ]| - * - * Return value: (transfer none): a #ClutterAnimation object. The object is - * owned by the #ClutterActor and should not be unreferenced with - * g_object_unref() - * - * - * Deprecated: 1.12: Use the implicit transition for animatable properties - * in #ClutterActor instead. - */ -ClutterAnimation * -clutter_actor_animate (ClutterActor *actor, - gulong mode, - guint duration, - const gchar *first_property_name, - ...) -{ - ClutterAnimation *animation; - va_list args; - - g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), NULL); - g_return_val_if_fail (mode != CLUTTER_CUSTOM_MODE, NULL); - g_return_val_if_fail (duration > 0, NULL); - g_return_val_if_fail (first_property_name != NULL, NULL); - - animation = animation_create_for_actor (actor); - clutter_animation_set_mode (animation, mode); - clutter_animation_set_duration (animation, duration); - - va_start (args, first_property_name); - clutter_animation_setup_valist (animation, first_property_name, args); - va_end (args); - - clutter_animation_start (animation); - - return animation; -} - -/** - * clutter_actor_animatev: - * @actor: a #ClutterActor - * @mode: an animation mode logical id - * @duration: duration of the animation, in milliseconds - * @n_properties: number of property names and values - * @properties: (array length=n_properties) (element-type utf8): a vector - * containing the property names to set - * @values: (array length=n_properties): a vector containing the - * property values to set - * - * Animates the given list of properties of @actor between the current - * value for each property and a new final value. The animation has a - * definite duration and a speed given by the @mode. - * - * This is the vector-based variant of clutter_actor_animate(), useful - * for language bindings. - * - * Unlike clutter_actor_animate(), this function will not - * allow you to specify "signal::" names and callbacks. - * - * Return value: (transfer none): a #ClutterAnimation object. The object is - * owned by the #ClutterActor and should not be unreferenced with - * g_object_unref() - * - * - * Deprecated: 1.12: Use the implicit transition for animatable properties - * in #ClutterActor instead. - */ -ClutterAnimation * -clutter_actor_animatev (ClutterActor *actor, - gulong mode, - guint duration, - gint n_properties, - const gchar * const properties[], - const GValue *values) -{ - ClutterAnimation *animation; - - g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), NULL); - g_return_val_if_fail (mode != CLUTTER_CUSTOM_MODE, NULL); - g_return_val_if_fail (duration > 0, NULL); - g_return_val_if_fail (properties != NULL, NULL); - g_return_val_if_fail (values != NULL, NULL); - - animation = animation_create_for_actor (actor); - clutter_animation_set_mode (animation, mode); - clutter_animation_set_duration (animation, duration); - clutter_animation_setupv (animation, n_properties, properties, values); - clutter_animation_start (animation); - - return animation; -} - -/** - * clutter_actor_animate_with_timelinev: - * @actor: a #ClutterActor - * @mode: an animation mode logical id - * @timeline: a #ClutterTimeline - * @n_properties: number of property names and values - * @properties: (array length=n_properties) (element-type utf8): a vector - * containing the property names to set - * @values: (array length=n_properties): a vector containing the - * property values to set - * - * Animates the given list of properties of @actor between the current - * value for each property and a new final value. The animation has a - * definite duration given by @timeline and a speed given by the @mode. - * - * See clutter_actor_animate() for further details. - * - * This function is useful if you want to use an existing timeline - * to animate @actor. - * - * This is the vector-based variant of clutter_actor_animate_with_timeline(), - * useful for language bindings. - * - * Unlike clutter_actor_animate_with_timeline(), this function - * will not allow you to specify "signal::" names and callbacks. - * - * Return value: (transfer none): a #ClutterAnimation object. The object is - * owned by the #ClutterActor and should not be unreferenced with - * g_object_unref() - * - * - * Deprecated: 1.12: Use the implicit transition for animatable properties - * in #ClutterActor instead. - */ -ClutterAnimation * -clutter_actor_animate_with_timelinev (ClutterActor *actor, - gulong mode, - ClutterTimeline *timeline, - gint n_properties, - const gchar * const properties[], - const GValue *values) -{ - ClutterAnimation *animation; - - g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), NULL); - g_return_val_if_fail (CLUTTER_IS_TIMELINE (timeline), NULL); - g_return_val_if_fail (properties != NULL, NULL); - g_return_val_if_fail (values != NULL, NULL); - - animation = animation_create_for_actor (actor); - clutter_animation_set_mode (animation, mode); - clutter_animation_set_timeline (animation, timeline); - clutter_animation_setupv (animation, n_properties, properties, values); - clutter_animation_start (animation); - - return animation; -} - -/** - * clutter_actor_animate_with_alphav: - * @actor: a #ClutterActor - * @alpha: a #ClutterAlpha - * @n_properties: number of property names and values - * @properties: (array length=n_properties) (element-type utf8): a vector - * containing the property names to set - * @values: (array length=n_properties): a vector containing the - * property values to set - * - * Animates the given list of properties of @actor between the current - * value for each property and a new final value. The animation has a - * definite behaviour given by the passed @alpha. - * - * See clutter_actor_animate() for further details. - * - * This function is useful if you want to use an existing #ClutterAlpha - * to animate @actor. - * - * This is the vector-based variant of clutter_actor_animate_with_alpha(), - * useful for language bindings. - * - * Unlike clutter_actor_animate_with_alpha(), this function will - * not allow you to specify "signal::" names and callbacks. - * - * Return value: (transfer none): a #ClutterAnimation object. The object is owned by the - * #ClutterActor and should not be unreferenced with g_object_unref() - * - * - * - * Deprecated: 1.10: Use clutter_actor_animate_with_timelinev() instead - */ -ClutterAnimation * -clutter_actor_animate_with_alphav (ClutterActor *actor, - ClutterAlpha *alpha, - gint n_properties, - const gchar * const properties[], - const GValue *values) -{ - ClutterAnimation *animation; - ClutterTimeline *timeline; - - g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), NULL); - g_return_val_if_fail (CLUTTER_IS_ALPHA (alpha), NULL); - g_return_val_if_fail (properties != NULL, NULL); - g_return_val_if_fail (values != NULL, NULL); - - timeline = clutter_alpha_get_timeline (alpha); - if (timeline == NULL) - { - g_warning ("The passed ClutterAlpha does not have an " - "associated ClutterTimeline."); - return NULL; - } - - animation = animation_create_for_actor (actor); - clutter_animation_set_alpha_internal (animation, alpha); - clutter_animation_setupv (animation, n_properties, properties, values); - clutter_animation_start (animation); - - return animation; -} - -/** - * clutter_actor_get_animation: - * @actor: a #ClutterActor - * - * Retrieves the #ClutterAnimation used by @actor, if clutter_actor_animate() - * has been called on @actor. - * - * Return value: (transfer none): a #ClutterAnimation, or %NULL - * - * - * Deprecated: 1.12: Use the implicit transition for animatable properties - * in #ClutterActor instead, and clutter_actor_get_transition() to retrieve - * the transition. - */ -ClutterAnimation * -clutter_actor_get_animation (ClutterActor *actor) -{ - g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), NULL); - - return g_object_get_qdata (G_OBJECT (actor), quark_object_animation); -} - -/** - * clutter_actor_detach_animation: - * @actor: a #ClutterActor - * - * Detaches the #ClutterAnimation used by @actor, if clutter_actor_animate() - * has been called on @actor. - * - * Once the animation has been detached, it loses a reference. If it was - * the only reference then the #ClutterAnimation becomes invalid. - * - * The #ClutterAnimation::completed signal will not be emitted. - * - * - * Deprecated: 1.12: Use the implicit transition for animatable properties - * in #ClutterActor instead, and clutter_actor_remove_transition() to - * remove the transition. - */ -void -clutter_actor_detach_animation (ClutterActor *actor) -{ - ClutterAnimation *animation; - ClutterAnimationPrivate *priv; - - g_return_if_fail (CLUTTER_IS_ACTOR (actor)); - - animation = g_object_get_qdata (G_OBJECT (actor), quark_object_animation); - if (animation == NULL) - return; - - priv = animation->priv; - - g_assert (priv->object == G_OBJECT (actor)); - - /* we can't call get_timeline_internal() here because it would be - * pointless to create a timeline on an animation we want to detach - */ - if (priv->alpha != NULL) - { - ClutterTimeline *timeline; - - timeline = clutter_alpha_get_timeline (priv->alpha); - if (timeline != NULL) - clutter_timeline_stop (timeline); - } - - /* disconnect the ::destroy handler added by animation_create_for_actor() */ - g_signal_handlers_disconnect_by_func (actor, - G_CALLBACK (on_actor_destroy), - animation); - - clutter_animation_set_object (animation, NULL); - - /* drop the reference on the animation */ - g_object_unref (animation); -} diff --git a/clutter/deprecated/clutter-animation.h b/clutter/deprecated/clutter-animation.h deleted file mode 100644 index 814e9f18c..000000000 --- a/clutter/deprecated/clutter-animation.h +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Copyright (C) 2008 Intel Corporation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - * Author: - * Emmanuele Bassi - */ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_ANIMATION_H__ -#define __CLUTTER_ANIMATION_H__ - -#include - -G_BEGIN_DECLS - -#define CLUTTER_TYPE_ANIMATION (clutter_animation_get_type ()) -#define CLUTTER_ANIMATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_ANIMATION, ClutterAnimation)) -#define CLUTTER_IS_ANIMATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_ANIMATION)) -#define CLUTTER_ANIMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_ANIMATION, ClutterAnimationClass)) -#define CLUTTER_IS_ANIMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_ANIMATION)) -#define CLUTTER_ANIMATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_ANIMATION, ClutterAnimationClass)) - -typedef struct _ClutterAnimationPrivate ClutterAnimationPrivate; -typedef struct _ClutterAnimationClass ClutterAnimationClass; - -/** - * ClutterAnimation: - * - * The #ClutterAnimation structure contains only private data and should - * be accessed using the provided functions. - * - * - */ -struct _ClutterAnimation -{ - /*< private >*/ - GObject parent_instance; - - ClutterAnimationPrivate *priv; -}; - -/** - * ClutterAnimationClass: - * @started: class handler for the #ClutterAnimation::started signal - * @completed: class handler for the #ClutterAnimation::completed signal - * - * The #ClutterAnimationClass structure contains only private data and - * should be accessed using the provided functions. - * - * - */ -struct _ClutterAnimationClass -{ - /*< private >*/ - GObjectClass parent_class; - - /*< public >*/ - void (* started) (ClutterAnimation *animation); - void (* completed) (ClutterAnimation *animation); - - /*< private >*/ - /* padding for future expansion */ - void (*_clutter_reserved1) (void); - void (*_clutter_reserved2) (void); - void (*_clutter_reserved3) (void); - void (*_clutter_reserved4) (void); - void (*_clutter_reserved5) (void); - void (*_clutter_reserved6) (void); - void (*_clutter_reserved7) (void); - void (*_clutter_reserved8) (void); -}; - -CLUTTER_DEPRECATED_IN_1_12 -GType clutter_animation_get_type (void) G_GNUC_CONST; - -CLUTTER_DEPRECATED_IN_1_12_FOR(clutter_property_transition_new) -ClutterAnimation * clutter_animation_new (void); - -CLUTTER_DEPRECATED_IN_1_12_FOR(clutter_transition_set_animatable) -void clutter_animation_set_object (ClutterAnimation *animation, - GObject *object); -CLUTTER_DEPRECATED_IN_1_12_FOR(clutter_transition_get_animatable) -GObject * clutter_animation_get_object (ClutterAnimation *animation); -CLUTTER_DEPRECATED_IN_1_12_FOR(clutter_timeline_set_progress_mode) -void clutter_animation_set_mode (ClutterAnimation *animation, - gulong mode); -CLUTTER_DEPRECATED_IN_1_12_FOR(clutter_timeline_get_progress_mode) -gulong clutter_animation_get_mode (ClutterAnimation *animation); -CLUTTER_DEPRECATED_IN_1_12_FOR(clutter_timeline_set_duration) -void clutter_animation_set_duration (ClutterAnimation *animation, - guint msecs); -CLUTTER_DEPRECATED_IN_1_12_FOR(clutter_timeline_get_duration) -guint clutter_animation_get_duration (ClutterAnimation *animation); -CLUTTER_DEPRECATED_IN_1_12_FOR(clutter_timeline_set_repeat_count) -void clutter_animation_set_loop (ClutterAnimation *animation, - gboolean loop); -CLUTTER_DEPRECATED_IN_1_12_FOR(clutter_timeline_get_repeat_count) -gboolean clutter_animation_get_loop (ClutterAnimation *animation); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_animation_set_timeline (ClutterAnimation *animation, - ClutterTimeline *timeline); -CLUTTER_DEPRECATED_IN_1_12 -ClutterTimeline * clutter_animation_get_timeline (ClutterAnimation *animation); -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_animation_set_timeline) -void clutter_animation_set_alpha (ClutterAnimation *animation, - ClutterAlpha *alpha); -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_animation_get_timeline) -ClutterAlpha * clutter_animation_get_alpha (ClutterAnimation *animation); -CLUTTER_DEPRECATED_IN_1_12 -ClutterAnimation * clutter_animation_bind (ClutterAnimation *animation, - const gchar *property_name, - const GValue *final); -CLUTTER_DEPRECATED_IN_1_12_FOR(clutter_transition_set_interval) -ClutterAnimation * clutter_animation_bind_interval (ClutterAnimation *animation, - const gchar *property_name, - ClutterInterval *interval); -CLUTTER_DEPRECATED_IN_1_12 -gboolean clutter_animation_has_property (ClutterAnimation *animation, - const gchar *property_name); -CLUTTER_DEPRECATED_IN_1_12 -ClutterAnimation * clutter_animation_update (ClutterAnimation *animation, - const gchar *property_name, - const GValue *final); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_animation_update_interval (ClutterAnimation *animation, - const gchar *property_name, - ClutterInterval *interval); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_animation_unbind_property (ClutterAnimation *animation, - const gchar *property_name); -CLUTTER_DEPRECATED_IN_1_12 -ClutterInterval * clutter_animation_get_interval (ClutterAnimation *animation, - const gchar *property_name); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_animation_completed (ClutterAnimation *animation); - -/* - * ClutterActor API - */ - -CLUTTER_DEPRECATED_IN_1_12 -ClutterAnimation * clutter_actor_animate (ClutterActor *actor, - gulong mode, - guint duration, - const gchar *first_property_name, - ...) G_GNUC_NULL_TERMINATED; -CLUTTER_DEPRECATED_IN_1_12 -ClutterAnimation * clutter_actor_animate_with_timeline (ClutterActor *actor, - gulong mode, - ClutterTimeline *timeline, - const gchar *first_property_name, - ...) G_GNUC_NULL_TERMINATED; -CLUTTER_DEPRECATED_IN_1_12 -ClutterAnimation * clutter_actor_animatev (ClutterActor *actor, - gulong mode, - guint duration, - gint n_properties, - const gchar * const properties[], - const GValue *values); -CLUTTER_DEPRECATED_IN_1_12 -ClutterAnimation * clutter_actor_animate_with_timelinev (ClutterActor *actor, - gulong mode, - ClutterTimeline *timeline, - gint n_properties, - const gchar * const properties[], - const GValue *values); -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_animate_with_timeline) -ClutterAnimation * clutter_actor_animate_with_alpha (ClutterActor *actor, - ClutterAlpha *alpha, - const gchar *first_property_name, - ...) G_GNUC_NULL_TERMINATED; -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_animate_with_timelinev) -ClutterAnimation * clutter_actor_animate_with_alphav (ClutterActor *actor, - ClutterAlpha *alpha, - gint n_properties, - const gchar * const properties[], - const GValue *values); - -CLUTTER_DEPRECATED_IN_1_12 -ClutterAnimation * clutter_actor_get_animation (ClutterActor *actor); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_actor_detach_animation (ClutterActor *actor); - -G_END_DECLS - -#endif /* __CLUTTER_ANIMATION_DEPRECATED_H__ */ diff --git a/clutter/deprecated/clutter-animator.c b/clutter/deprecated/clutter-animator.c deleted file mode 100644 index eb1b74cdb..000000000 --- a/clutter/deprecated/clutter-animator.c +++ /dev/null @@ -1,2176 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Copyright (C) 2010 Intel Corporation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - * Author: - * Øyvind KolÃ¥s - */ - -/** - * SECTION:clutter-animator - * @short_description: Multi-actor tweener - * @See_Also: #ClutterAnimatable, #ClutterInterval, #ClutterAlpha, - * #ClutterTimeline - * - * #ClutterAnimator is an object providing declarative animations for - * #GObject properties belonging to one or more #GObjects to - * #ClutterIntervals. - * - * #ClutterAnimator is used to build and describe complex animations - * in terms of "key frames". #ClutterAnimator is meant to be used - * through the #ClutterScript definition format, but it comes with a - * convenience C API. - * - * - * Key Frames - * Every animation handled by a #ClutterAnimator can be - * described in terms of "key frames". For each #GObject property - * there can be multiple key frames, each one defined by the end - * value for the property to be computed starting from the current - * value to a specific point in time, using a given easing - * mode. - * The point in time is defined using a value representing - * the progress in the normalized interval of [ 0, 1 ]. This maps - * the value returned by clutter_timeline_get_duration(). - *
- * Key Frames - * - *
- * In the image above the duration of the animation is - * represented by the blue line. Each key frame is the white dot, - * along with its progress. The red line represents the computed - * function of time given the easing mode. - *
- * - * - * ClutterAnimator description for #ClutterScript - * #ClutterAnimator defines a custom "properties" property - * which allows describing the key frames for objects. - * The "properties" property has the following syntax: - * - * - * - * - * ClutterAnimator definition - * The following JSON fragment defines a #ClutterAnimator - * with the duration of 1 second and operating on the x and y - * properties of a #ClutterActor named "rect-01", with two frames - * for each property. The first frame will linearly move the actor - * from its current position to the 100, 100 position in 20 percent - * of the duration of the animation; the second will using a cubic - * easing to move the actor to the 200, 200 coordinates. - * - * - * - * - * #ClutterAnimator is available since Clutter 1.2 - * - * #ClutterAnimator has been deprecated in Clutter 1.12 - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include - -#define CLUTTER_DISABLE_DEPRECATION_WARNINGS - -#include "clutter-animator.h" - -#include "clutter-alpha.h" -#include "clutter-debug.h" -#include "clutter-enum-types.h" -#include "clutter-interval.h" -#include "clutter-private.h" -#include "clutter-script-private.h" -#include "clutter-scriptable.h" - -#define CLUTTER_ANIMATOR_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_ANIMATOR, ClutterAnimatorPrivate)) - -/* progress values varying by less than this are considered equal */ -#define PROGRESS_EPSILON 0.00001 - -struct _ClutterAnimatorPrivate -{ - ClutterTimeline *timeline; - ClutterTimeline *slave_timeline; - - GList *score; - - GHashTable *properties; -}; - -struct _ClutterAnimatorKey -{ - GObject *object; - const gchar *property_name; - guint mode; - - GValue value; - - /* normalized progress, between 0.0 and 1.0 */ - gdouble progress; - - /* back-pointer to the animator which owns the key */ - ClutterAnimator *animator; - - /* interpolation mode */ - ClutterInterpolation interpolation; - - /* ease from the current object state into the animation when it starts */ - guint ease_in : 1; - - /* This key is already being destroyed and shouldn't - * trigger additional weak unrefs - */ - guint is_inert : 1; - - gint ref_count; -}; - -enum -{ - PROP_0, - - PROP_DURATION, - PROP_TIMELINE, - - PROP_LAST -}; - -static GParamSpec *obj_props[PROP_LAST]; - -static void clutter_scriptable_init (ClutterScriptableIface *iface); - -G_DEFINE_TYPE_WITH_CODE (ClutterAnimator, - clutter_animator, - G_TYPE_OBJECT, - G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_SCRIPTABLE, - clutter_scriptable_init)); -/** - * clutter_animator_new: - * - * Creates a new #ClutterAnimator instance - * - * Return value: a new #ClutterAnimator. - * - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition instead - */ -ClutterAnimator * -clutter_animator_new (void) -{ - return g_object_new (CLUTTER_TYPE_ANIMATOR, NULL); -} - -/***/ - -typedef struct _PropObjectKey { - GObject *object; - const gchar *property_name; - guint mode; - gdouble progress; -} PropObjectKey; - -/* Iterator that walks the keys of a property*/ -typedef struct _PropertyIter { - PropObjectKey *key; - ClutterInterval *interval; - ClutterAlpha *alpha; - - GList *current; - - gdouble start; /* the progress of current */ - gdouble end; /* until which progress it is valid */ - ClutterInterpolation interpolation; - - guint ease_in : 1; -} PropertyIter; - -static PropObjectKey * -prop_actor_key_new (GObject *object, - const gchar *property_name) -{ - PropObjectKey *key = g_slice_new0 (PropObjectKey); - - key->object = object; - key->property_name = g_intern_string (property_name); - - return key; -} - -static void -prop_actor_key_free (gpointer key) -{ - if (key != NULL) - g_slice_free (PropObjectKey, key); -} - -static void -property_iter_free (gpointer key) -{ - if (key != NULL) - { - PropertyIter *property_iter = key; - - g_object_unref (property_iter->interval); - g_object_unref (property_iter->alpha); - - g_slice_free (PropertyIter, property_iter); - } -} - -static PropertyIter * -property_iter_new (ClutterAnimator *animator, - PropObjectKey *key, - GType type) -{ - ClutterAnimatorPrivate *priv = animator->priv; - PropertyIter *property_iter = g_slice_new (PropertyIter); - ClutterInterval *interval = g_object_new (CLUTTER_TYPE_INTERVAL, - "value-type", type, - NULL); - - /* we own this interval */ - g_object_ref_sink (interval); - - property_iter->interval = interval; - property_iter->key = key; - property_iter->alpha = clutter_alpha_new (); - clutter_alpha_set_timeline (property_iter->alpha, priv->slave_timeline); - - /* as well as the alpha */ - g_object_ref_sink (property_iter->alpha); - - return property_iter; -} - -static guint -prop_actor_hash (gconstpointer value) -{ - const PropObjectKey *info = value; - - return GPOINTER_TO_INT (info->property_name) - ^ GPOINTER_TO_INT (info->object); -} - -static gboolean -prop_actor_equal (gconstpointer a, gconstpointer b) -{ - const PropObjectKey *infoa = a; - const PropObjectKey *infob = b; - - /* property name strings are interned so we can just compare pointers */ - if (infoa->object == infob->object && - (infoa->property_name == infob->property_name)) - return TRUE; - - return FALSE; -} - -static gint -sort_actor_prop_progress_func (gconstpointer a, - gconstpointer b) -{ - const ClutterAnimatorKey *pa = a; - const ClutterAnimatorKey *pb = b; - - if (pa->object == pb->object) - { - gint pdiff = pb->property_name - pa->property_name; - - if (pdiff) - return pdiff; - - if (fabs (pa->progress - pb->progress) < PROGRESS_EPSILON) - return 0; - - if (pa->progress > pb->progress) - return 1; - - return -1; - } - - return pa->object - pb->object; -} - -static gint -sort_actor_prop_func (gconstpointer a, - gconstpointer b) -{ - const ClutterAnimatorKey *pa = a; - const ClutterAnimatorKey *pb = b; - - if (pa->object == pb->object) - return pa->property_name - pb->property_name; - - return pa->object - pb->object; -} - -static void -clutter_animator_remove_key_internal (ClutterAnimator *animator, - GObject *object, - const gchar *property_name, - gdouble progress, - gboolean is_inert); - -static void -object_disappeared (gpointer data, - GObject *where_the_object_was) -{ - clutter_animator_remove_key_internal (data, where_the_object_was, NULL, -1.0, - TRUE); -} - -static ClutterAnimatorKey * -clutter_animator_key_new (ClutterAnimator *animator, - GObject *object, - const gchar *property_name, - gdouble progress, - guint mode) -{ - ClutterAnimatorKey *animator_key; - - animator_key = g_slice_new (ClutterAnimatorKey); - - animator_key->ref_count = 1; - animator_key->animator = animator; - animator_key->object = object; - animator_key->mode = mode; - memset (&(animator_key->value), 0, sizeof (GValue)); - animator_key->progress = progress; - animator_key->property_name = g_intern_string (property_name); - animator_key->interpolation = CLUTTER_INTERPOLATION_LINEAR; - animator_key->ease_in = FALSE; - animator_key->is_inert = FALSE; - - /* keep a weak reference on the animator, so that we can release the - * back-pointer when needed - */ - g_object_weak_ref (object, object_disappeared, - animator_key->animator); - - return animator_key; -} - -static gpointer -clutter_animator_key_copy (gpointer boxed) -{ - ClutterAnimatorKey *key = boxed; - - if (key != NULL) - key->ref_count += 1; - - return key; -} - -static void -clutter_animator_key_free (gpointer boxed) -{ - ClutterAnimatorKey *key = boxed; - - if (key == NULL) - return; - - key->ref_count -= 1; - - if (key->ref_count > 0) - return; - - if (!key->is_inert) - g_object_weak_unref (key->object, object_disappeared, key->animator); - - g_slice_free (ClutterAnimatorKey, key); -} - -static void -clutter_animator_dispose (GObject *object) -{ - ClutterAnimator *animator = CLUTTER_ANIMATOR (object); - ClutterAnimatorPrivate *priv = animator->priv; - - clutter_animator_set_timeline (animator, NULL); - g_object_unref (priv->slave_timeline); - - G_OBJECT_CLASS (clutter_animator_parent_class)->dispose (object); -} - -static void -clutter_animator_finalize (GObject *object) -{ - ClutterAnimator *animator = CLUTTER_ANIMATOR (object); - ClutterAnimatorPrivate *priv = animator->priv; - - g_list_foreach (priv->score, (GFunc) clutter_animator_key_free, NULL); - g_list_free (priv->score); - priv->score = NULL; - - g_hash_table_destroy (priv->properties); - - G_OBJECT_CLASS (clutter_animator_parent_class)->finalize (object); -} - -/* XXX: this is copied and slightly modified from glib, - * there is only one way to do this. */ -static GList * -list_find_custom_reverse (GList *list, - gconstpointer data, - GCompareFunc func) -{ - while (list) - { - if (! func (list->data, data)) - return list; - - list = list->prev; - } - - return NULL; -} - -/* Ensures that the interval provided by the animator is correct - * for the requested progress value. - */ -static void -animation_animator_ensure_animator (ClutterAnimator *animator, - PropertyIter *property_iter, - PropObjectKey *key, - gdouble progress) -{ - - if (progress > property_iter->end) - { - while (progress > property_iter->end) - { - ClutterAnimatorKey *initial_key, *next_key; - GList *initial, *next; - - initial = g_list_find_custom (property_iter->current->next, - key, - sort_actor_prop_func); - - if (initial) - { - initial_key = initial->data; - - clutter_interval_set_initial_value (property_iter->interval, - &initial_key->value); - property_iter->current = initial; - property_iter->start = initial_key->progress; - - next = g_list_find_custom (initial->next, - key, - sort_actor_prop_func); - if (next) - { - next_key = next->data; - - property_iter->end = next_key->progress; - } - else - { - next_key = initial_key; - - property_iter->end = property_iter->start; - } - - clutter_interval_set_final_value (property_iter->interval, - &next_key->value); - - if ((clutter_alpha_get_mode (property_iter->alpha) != next_key->mode)) - clutter_alpha_set_mode (property_iter->alpha, next_key->mode); - } - else /* no relevant interval */ - { - ClutterAnimatorKey *current_key = property_iter->current->data; - clutter_interval_set_initial_value (property_iter->interval, - ¤t_key->value); - clutter_interval_set_final_value (property_iter->interval, - ¤t_key->value); - break; - } - } - } - else if (progress < property_iter->start) - { - while (progress < property_iter->start) - { - ClutterAnimatorKey *initial_key, *next_key; - GList *initial; - GList *old = property_iter->current; - - initial = list_find_custom_reverse (property_iter->current->prev, - key, - sort_actor_prop_func); - - if (initial) - { - initial_key = initial->data; - - clutter_interval_set_initial_value (property_iter->interval, - &initial_key->value); - property_iter->current = initial; - property_iter->end = property_iter->start; - property_iter->start = initial_key->progress; - - if (old) - { - next_key = old->data; - - property_iter->end = next_key->progress; - } - else - { - next_key = initial_key; - - property_iter->end = 1.0; - } - - clutter_interval_set_final_value (property_iter->interval, - &next_key->value); - if ((clutter_alpha_get_mode (property_iter->alpha) != next_key->mode)) - clutter_alpha_set_mode (property_iter->alpha, next_key->mode); - } - else - break; - } - } -} - -/* XXX - this might be useful as an internal function exposed somewhere */ -static gdouble -cubic_interpolation (const gdouble dx, - const gdouble prev, - const gdouble j, - const gdouble next, - const gdouble nextnext) -{ - return (((( - prev + 3 * j - 3 * next + nextnext ) * dx + - ( 2 * prev - 5 * j + 4 * next - nextnext ) ) * dx + - ( - prev + next ) ) * dx + (j + j) ) / 2.0; -} - -/* try to get a floating point key value from a key for a property, - * failing use the closest key in that direction or the starting point. - */ -static gfloat -list_try_get_rel (GList *list, - gint count) -{ - ClutterAnimatorKey *key; - GList *iter = list; - GList *best = list; - - if (count > 0) - { - while (count -- && iter != NULL) - { - iter = g_list_find_custom (iter->next, list->data, - sort_actor_prop_func); - if (iter != NULL) - best = iter; - } - } - else - { - while (count ++ < 0 && iter != NULL) - { - iter = list_find_custom_reverse (iter->prev, list->data, - sort_actor_prop_func); - if (iter != NULL) - best = iter; - } - } - - if (best != NULL && best->data != NULL) - { - key = best->data; - - return g_value_get_float (&(key->value)); - } - - return 0; -} - -static void -animation_animator_new_frame (ClutterTimeline *timeline, - gint msecs, - ClutterAnimator *animator) -{ - gdouble progress; - GHashTableIter iter; - gpointer key, value; - - progress = 1.0 * msecs / clutter_timeline_get_duration (timeline); - - /* for each property that is managed figure out the GValue to set, - * avoid creating new ClutterInterval's for each interval crossed - */ - g_hash_table_iter_init (&iter, animator->priv->properties); - - key = value = NULL; - while (g_hash_table_iter_next (&iter, &key, &value)) - { - PropObjectKey *prop_actor_key = key; - PropertyIter *property_iter = value; - ClutterAnimatorKey *start_key; - gdouble sub_progress; - - animation_animator_ensure_animator (animator, property_iter, - key, - progress); - start_key = property_iter->current->data; - - if (property_iter->end == property_iter->start) - sub_progress = 0.0; /* we're past the final value */ - else - sub_progress = (progress - property_iter->start) - / (property_iter->end - property_iter->start); - - /* only change values if we active (delayed start) */ - if (sub_progress >= 0.0 && sub_progress <= 1.0) - { - GValue tmp_value = G_VALUE_INIT; - GType int_type; - - g_value_init (&tmp_value, G_VALUE_TYPE (&start_key->value)); - - clutter_timeline_advance (animator->priv->slave_timeline, - sub_progress * 10000); - - sub_progress = clutter_alpha_get_alpha (property_iter->alpha); - int_type = clutter_interval_get_value_type (property_iter->interval); - - if (property_iter->interpolation == CLUTTER_INTERPOLATION_CUBIC && - int_type == G_TYPE_FLOAT) - { - gdouble prev, current, next, nextnext; - gdouble res; - - if ((property_iter->ease_in == FALSE || - (property_iter->ease_in && - list_find_custom_reverse (property_iter->current->prev, - property_iter->current->data, - sort_actor_prop_func)))) - { - current = g_value_get_float (&start_key->value); - prev = list_try_get_rel (property_iter->current, -1); - } - else - { - /* interpolated and easing in */ - clutter_interval_get_initial_value (property_iter->interval, - &tmp_value); - prev = current = g_value_get_float (&tmp_value); - } - - next = list_try_get_rel (property_iter->current, 1); - nextnext = list_try_get_rel (property_iter->current, 2); - res = cubic_interpolation (sub_progress, prev, current, next, - nextnext); - - g_value_set_float (&tmp_value, res); - } - else - clutter_interval_compute_value (property_iter->interval, - sub_progress, - &tmp_value); - - g_object_set_property (prop_actor_key->object, - prop_actor_key->property_name, - &tmp_value); - - g_value_unset (&tmp_value); - } - } -} - -static void -animation_animator_started (ClutterTimeline *timeline, - ClutterAnimator *animator) -{ - GList *k; - - /* Ensure that animators exist for all involved properties */ - for (k = animator->priv->score; k != NULL; k = k->next) - { - ClutterAnimatorKey *key = k->data; - PropertyIter *property_iter; - PropObjectKey *prop_actor_key; - - prop_actor_key = prop_actor_key_new (key->object, key->property_name); - property_iter = g_hash_table_lookup (animator->priv->properties, - prop_actor_key); - if (property_iter) - { - prop_actor_key_free (prop_actor_key); - } - else - { - GObjectClass *klass = G_OBJECT_GET_CLASS (key->object); - GParamSpec *pspec; - - pspec = g_object_class_find_property (klass, key->property_name); - - property_iter = property_iter_new (animator, prop_actor_key, - G_PARAM_SPEC_VALUE_TYPE (pspec)); - g_hash_table_insert (animator->priv->properties, - prop_actor_key, - property_iter); - } - } - - /* initialize animator with initial list pointers */ - { - GHashTableIter iter; - gpointer key, value; - - g_hash_table_iter_init (&iter, animator->priv->properties); - while (g_hash_table_iter_next (&iter, &key, &value)) - { - PropertyIter *property_iter = value; - ClutterAnimatorKey *initial_key, *next_key; - GList *initial; - GList *next; - - initial = g_list_find_custom (animator->priv->score, - key, - sort_actor_prop_func); - g_assert (initial != NULL); - initial_key = initial->data; - clutter_interval_set_initial_value (property_iter->interval, - &initial_key->value); - - property_iter->current = initial; - property_iter->start = initial_key->progress; - property_iter->ease_in = initial_key->ease_in; - property_iter->interpolation = initial_key->interpolation; - - if (property_iter->ease_in) - { - GValue tmp_value = G_VALUE_INIT; - GType int_type; - - int_type = clutter_interval_get_value_type (property_iter->interval); - g_value_init (&tmp_value, int_type); - - g_object_get_property (initial_key->object, - initial_key->property_name, - &tmp_value); - - clutter_interval_set_initial_value (property_iter->interval, - &tmp_value); - - g_value_unset (&tmp_value); - } - - next = g_list_find_custom (initial->next, key, sort_actor_prop_func); - if (next) - { - next_key = next->data; - property_iter->end = next_key->progress; - } - else - { - next_key = initial_key; - property_iter->end = 1.0; - } - - clutter_interval_set_final_value (property_iter->interval, - &next_key->value); - if ((clutter_alpha_get_mode (property_iter->alpha) != next_key->mode)) - clutter_alpha_set_mode (property_iter->alpha, next_key->mode); - } - } -} - -/** - * clutter_animator_compute_value: - * @animator: a #ClutterAnimator - * @object: a #GObject - * @property_name: the name of the property on object to check - * @progress: a value between 0.0 and 1.0 - * @value: an initialized value to store the computed result - * - * Compute the value for a managed property at a given progress. - * - * If the property is an ease-in property, the current value of the property - * on the object will be used as the starting point for computation. - * - * Return value: %TRUE if the computation yields has a value, otherwise (when - * an error occurs or the progress is before any of the keys) %FALSE is - * returned and the #GValue is left untouched - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition instead - */ -gboolean -clutter_animator_compute_value (ClutterAnimator *animator, - GObject *object, - const gchar *property_name, - gdouble progress, - GValue *value) -{ - ClutterAnimatorPrivate *priv; - ClutterAnimatorKey key; - ClutterAnimatorKey *previous; - ClutterAnimatorKey *next = NULL; - GParamSpec *pspec; - GList *initial_l; - GList *previous_l; - GList *next_l; - gboolean ease_in; - ClutterInterpolation interpolation; - - g_return_val_if_fail (CLUTTER_IS_ANIMATOR (animator), FALSE); - g_return_val_if_fail (G_IS_OBJECT (object), FALSE); - g_return_val_if_fail (property_name, FALSE); - g_return_val_if_fail (value, FALSE); - - priv = animator->priv; - - ease_in = clutter_animator_property_get_ease_in (animator, object, - property_name); - interpolation = clutter_animator_property_get_interpolation (animator, - object, property_name); - - property_name = g_intern_string (property_name); - - pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (object), - property_name); - - key.object = object; - key.property_name = property_name; - - initial_l = g_list_find_custom (animator->priv->score, &key, - sort_actor_prop_func); - if (initial_l == NULL) - return FALSE; - - /* first find the interval we belong in, that is the first interval - * existing between keys - */ - - for (previous_l = initial_l, next_l = previous_l->next ; - previous_l->next ; - previous_l = previous_l->next, next_l = previous_l->next) - { - previous = previous_l->data; - if (next_l) - { - next = next_l->data; - if (next->object != object || - next->property_name != property_name) - { - next_l = NULL; - next = NULL; - } - } - else - next = NULL; - - if (progress < previous->progress) - { - /* we are before the defined values */ - - /* value has not been set */ - return FALSE; - } - - if (!next && previous->progress <= progress) - { - /* we only had one key for this object/property */ - /* and we are past it, that is our value */ - g_value_copy (&previous->value, value); - return TRUE; - } - - if (next && next->progress >= progress) - { - ClutterInterval *interval; - ClutterAlpha *alpha; - - gdouble sub_progress = (progress - previous->progress) - / (next->progress - previous->progress); - /* this should be our interval */ - interval = g_object_new (CLUTTER_TYPE_INTERVAL, - "value-type", pspec->value_type, - NULL); - - if (ease_in && previous_l == initial_l) - { - GValue tmp_value = {0, }; - g_value_init (&tmp_value, pspec->value_type); - g_object_get_property (object, property_name, &tmp_value); - clutter_interval_set_initial_value (interval, &tmp_value); - g_value_unset (&tmp_value); - } - else - clutter_interval_set_initial_value (interval, &previous->value); - - clutter_interval_set_final_value (interval, &next->value); - - alpha = clutter_alpha_new (); - clutter_alpha_set_timeline (alpha, priv->slave_timeline); - clutter_alpha_set_mode (alpha, next->mode); - - clutter_timeline_advance (priv->slave_timeline, - sub_progress * 10000); - sub_progress = clutter_alpha_get_alpha (alpha); - - if (interpolation == CLUTTER_INTERPOLATION_CUBIC && - pspec->value_type == G_TYPE_FLOAT) - { - gdouble prev, current, nextv, nextnext; - gdouble res; - - if ((ease_in == FALSE || - (ease_in && - list_find_custom_reverse (previous_l->prev, - previous_l->data, - sort_actor_prop_func)))) - { - current = g_value_get_float (&previous->value); - prev = list_try_get_rel (previous_l, -1); - } - else - { - /* interpolated and easing in */ - GValue tmp_value = {0, }; - g_value_init (&tmp_value, pspec->value_type); - clutter_interval_get_initial_value (interval, - &tmp_value); - prev = current = g_value_get_float (&tmp_value); - g_value_unset (&tmp_value); - } - - nextv = list_try_get_rel (previous_l, 1); - nextnext = list_try_get_rel (previous_l, 2); - res = cubic_interpolation (sub_progress, prev, current, nextv, - nextnext); - g_value_set_float (value, res); - } - else - clutter_interval_compute_value (interval, - sub_progress, - value); - - g_object_ref_sink (interval); - g_object_unref (interval); - g_object_ref_sink (alpha); - g_object_unref (alpha); - - return TRUE; - } - - } - - if (!next) - return FALSE; - - /* We're at, or past the end, use the last value */ - g_value_copy (&next->value, value); - - return TRUE; -} - - -/** - * clutter_animator_set_timeline: - * @animator: a #ClutterAnimator - * @timeline: a #ClutterTimeline - * - * Sets an external timeline that will be used for driving the animation - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition instead - */ -void -clutter_animator_set_timeline (ClutterAnimator *animator, - ClutterTimeline *timeline) -{ - ClutterAnimatorPrivate *priv; - - g_return_if_fail (CLUTTER_IS_ANIMATOR (animator)); - - priv = animator->priv; - - if (priv->timeline != NULL) - { - g_signal_handlers_disconnect_by_func (priv->timeline, - animation_animator_new_frame, - animator); - g_signal_handlers_disconnect_by_func (priv->timeline, - animation_animator_started, - animator); - g_object_unref (priv->timeline); - } - - priv->timeline = timeline; - if (timeline != NULL) - { - g_object_ref (priv->timeline); - - g_signal_connect (priv->timeline, "new-frame", - G_CALLBACK (animation_animator_new_frame), - animator); - g_signal_connect (priv->timeline, "started", - G_CALLBACK (animation_animator_started), - animator); - } -} - -/** - * clutter_animator_get_timeline: - * @animator: a #ClutterAnimator - * - * Get the timeline hooked up for driving the #ClutterAnimator - * - * Return value: (transfer none): the #ClutterTimeline that drives the animator - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition instead - */ -ClutterTimeline * -clutter_animator_get_timeline (ClutterAnimator *animator) -{ - g_return_val_if_fail (CLUTTER_IS_ANIMATOR (animator), NULL); - return animator->priv->timeline; -} - -/** - * clutter_animator_start: - * @animator: a #ClutterAnimator - * - * Start the ClutterAnimator, this is a thin wrapper that rewinds - * and starts the animators current timeline. - * - * Return value: (transfer none): the #ClutterTimeline that drives - * the animator. The returned timeline is owned by the #ClutterAnimator - * and it should not be unreferenced - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition instead - */ -ClutterTimeline * -clutter_animator_start (ClutterAnimator *animator) -{ - ClutterAnimatorPrivate *priv; - - g_return_val_if_fail (CLUTTER_IS_ANIMATOR (animator), NULL); - - priv = animator->priv; - - clutter_timeline_rewind (priv->timeline); - clutter_timeline_start (priv->timeline); - - return priv->timeline; -} - -/** - * clutter_animator_set_duration: - * @animator: a #ClutterAnimator - * @duration: milliseconds a run of the animator should last. - * - * Runs the timeline of the #ClutterAnimator with a duration in msecs - * as specified. - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition instead - */ -void -clutter_animator_set_duration (ClutterAnimator *animator, - guint duration) -{ - g_return_if_fail (CLUTTER_IS_ANIMATOR (animator)); - - clutter_timeline_set_duration (animator->priv->timeline, duration); -} - -/** - * clutter_animator_get_duration: - * @animator: a #ClutterAnimator - * - * Retrieves the current duration of an animator - * - * Return value: the duration of the animation, in milliseconds - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition instead - */ -guint -clutter_animator_get_duration (ClutterAnimator *animator) -{ - g_return_val_if_fail (CLUTTER_IS_ANIMATOR (animator), 0); - - return clutter_timeline_get_duration (animator->priv->timeline); -} - -/** - * clutter_animator_set: - * @animator: a #ClutterAnimator - * @first_object: a #GObject - * @first_property_name: the property to specify a key for - * @first_mode: the id of the alpha function to use - * @first_progress: at which stage of the animation this value applies; the - * range is a normalized floating point value between 0 and 1 - * @...: the value first_property_name should have for first_object - * at first_progress, followed by more (object, property_name, mode, - * progress, value) tuples, followed by %NULL - * - * Adds multiple keys to a #ClutterAnimator, specifying the value a given - * property should have at a given progress of the animation. The mode - * specified is the mode used when going to this key from the previous key of - * the @property_name - * - * If a given (object, property, progress) tuple already exist the mode and - * value will be replaced with the new values. - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition instead - */ -void -clutter_animator_set (ClutterAnimator *animator, - gpointer first_object, - const gchar *first_property_name, - guint first_mode, - gdouble first_progress, - ...) -{ - GObject *object; - const gchar *property_name; - guint mode; - gdouble progress; - va_list args; - - g_return_if_fail (CLUTTER_IS_ANIMATOR (animator)); - - object = first_object; - property_name = first_property_name; - - g_return_if_fail (object); - g_return_if_fail (property_name); - - mode = first_mode; - progress = first_progress; - - va_start (args, first_progress); - - while (object != NULL) - { - GParamSpec *pspec; - GObjectClass *klass; - GValue value = G_VALUE_INIT; - gchar *error = NULL; - - klass = G_OBJECT_GET_CLASS (object); - pspec = g_object_class_find_property (klass, property_name); - - if (!pspec) - { - g_warning ("Cannot bind property '%s': object of type '%s' " - "do not have this property", - property_name, G_OBJECT_TYPE_NAME (object)); - break; - } - - G_VALUE_COLLECT_INIT (&value, G_PARAM_SPEC_VALUE_TYPE (pspec), - args, 0, - &error); - - if (error) - { - g_warning ("%s: %s", G_STRLOC, error); - g_free (error); - break; - } - - clutter_animator_set_key (animator, - object, - property_name, - mode, - progress, - &value); - - object= va_arg (args, GObject *); - if (object) - { - property_name = va_arg (args, gchar*); - if (!property_name) - { - g_warning ("%s: expected a property name", G_STRLOC); - break; - } - mode = va_arg (args, guint); - progress = va_arg (args, gdouble); - } - } - - va_end (args); -} - -static inline void -clutter_animator_set_key_internal (ClutterAnimator *animator, - ClutterAnimatorKey *key) -{ - ClutterAnimatorPrivate *priv = animator->priv; - GList *old_item; - GList *initial_item; - ClutterAnimatorKey *initial_key = NULL; - - if ((initial_item = g_list_find_custom (animator->priv->score, key, - sort_actor_prop_func))) - initial_key = initial_item->data; - - /* The first key for a property specifies ease-in and interpolation, - * if we are replacing; or becoming a new first key we should - * inherit the old flags. - */ - if (initial_key && - initial_key->progress >= key->progress) - { - key->interpolation = initial_key->interpolation; - key->ease_in = initial_key->ease_in; - } - - old_item = g_list_find_custom (priv->score, key, - sort_actor_prop_progress_func); - - /* replace the key if we already have a similar one */ - if (old_item != NULL) - { - ClutterAnimatorKey *old_key = old_item->data; - - clutter_animator_key_free (old_key); - - priv->score = g_list_remove (priv->score, old_key); - } - - priv->score = g_list_insert_sorted (priv->score, key, - sort_actor_prop_progress_func); - - /* if the animator is already running reinitialize internal iterators */ - if (clutter_timeline_is_playing (priv->timeline)) - animation_animator_started (priv->timeline, animator); -} - -/** - * clutter_animator_set_key: - * @animator: a #ClutterAnimator - * @object: a #GObject - * @property_name: the property to specify a key for - * @mode: the id of the alpha function to use - * @progress: the normalized range at which stage of the animation this - * value applies - * @value: the value property_name should have at progress. - * - * Sets a single key in the #ClutterAnimator for the @property_name of - * @object at @progress. - * - * See also: clutter_animator_set() - * - * Return value: (transfer none): The animator instance - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition instead - */ -ClutterAnimator * -clutter_animator_set_key (ClutterAnimator *animator, - GObject *object, - const gchar *property_name, - guint mode, - gdouble progress, - const GValue *value) -{ - ClutterAnimatorKey *animator_key; - - g_return_val_if_fail (CLUTTER_IS_ANIMATOR (animator), NULL); - g_return_val_if_fail (G_IS_OBJECT (object), NULL); - g_return_val_if_fail (property_name, NULL); - g_return_val_if_fail (value, NULL); - - property_name = g_intern_string (property_name); - - animator_key = clutter_animator_key_new (animator, - object, property_name, - progress, - mode); - - g_value_init (&animator_key->value, G_VALUE_TYPE (value)); - g_value_copy (value, &animator_key->value); - - clutter_animator_set_key_internal (animator, animator_key); - - return animator; -} - -/** - * clutter_animator_get_keys: - * @animator: a #ClutterAnimator instance - * @object: (allow-none): a #GObject to search for, or %NULL for all objects - * @property_name: (allow-none): a specific property name to query for, - * or %NULL for all properties - * @progress: a specific progress to search for, or a negative value for all - * progresses - * - * Returns a list of pointers to opaque structures with accessor functions - * that describe the keys added to an animator. - * - * Return value: (transfer container) (element-type Clutter.AnimatorKey): a - * list of #ClutterAnimatorKeys; the contents of the list are owned - * by the #ClutterAnimator, but you should free the returned list when done, - * using g_list_free() - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition instead - */ -GList * -clutter_animator_get_keys (ClutterAnimator *animator, - GObject *object, - const gchar *property_name, - gdouble progress) -{ - GList *keys = NULL; - GList *k; - - g_return_val_if_fail (CLUTTER_IS_ANIMATOR (animator), NULL); - g_return_val_if_fail (object == NULL || G_IS_OBJECT (object), NULL); - - property_name = g_intern_string (property_name); - - for (k = animator->priv->score; k; k = k->next) - { - ClutterAnimatorKey *key = k->data; - - if ((object == NULL || (object == key->object)) && - (property_name == NULL || (property_name == key->property_name)) && - (progress < 0 || fabs (progress - key->progress) < PROGRESS_EPSILON)) - { - keys = g_list_prepend (keys, key); - } - } - - return g_list_reverse (keys); -} - -static void -clutter_animator_remove_key_internal (ClutterAnimator *animator, - GObject *object, - const gchar *property_name, - gdouble progress, - gboolean is_inert) -{ - ClutterAnimatorPrivate *priv; - GList *k; - - g_return_if_fail (CLUTTER_IS_ANIMATOR (animator)); - g_return_if_fail (object == NULL || G_IS_OBJECT (object)); - - property_name = g_intern_string (property_name); - - priv = animator->priv; - -again: - for (k = priv->score; k != NULL; k = k->next) - { - ClutterAnimatorKey *key = k->data; - - if ((object == NULL || (object == key->object)) && - (property_name == NULL || ((property_name == key->property_name))) && - (progress < 0 || fabs (progress - key->progress) < PROGRESS_EPSILON) - ) - { - ClutterAnimatorKey *prev_key = NULL; - key->is_inert = is_inert; - - - /* FIXME: non performant since we reiterate the list many times */ - - prev_key = k->prev ? k->prev->data : NULL; - - if (!prev_key || prev_key->object != key->object || - prev_key->property_name != key->property_name) - { /* We are removing the first key for a property ... */ - ClutterAnimatorKey *next_key = k->next ? k->next->data : NULL; - if (next_key && next_key->object == key->object && - next_key->property_name == key->property_name) - { - /* ... and there is a key of our own type following us, - * copy interpolation/ease_in flags to the new first key - */ - next_key->interpolation = key->interpolation; - next_key->ease_in = key->ease_in; - } - } - - clutter_animator_key_free (key); - priv->score = g_list_remove (priv->score, key); - goto again; - } - } - - /* clear off cached state for all properties, this is regenerated in a - * correct state by animation_animator_started - */ - g_hash_table_remove_all (priv->properties); - - /* if the animator is already running reinitialize internal iterators */ - if (priv->timeline != NULL && clutter_timeline_is_playing (priv->timeline)) - animation_animator_started (priv->timeline, animator); -} - -/** - * clutter_animator_remove_key: - * @animator: a #ClutterAnimator - * @object: (allow-none): a #GObject to search for, or %NULL for all - * @property_name: (allow-none): a specific property name to query for, - * or %NULL for all - * @progress: a specific progress to search for or a negative value - * for all - * - * Removes all keys matching the conditions specificed in the arguments. - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition instead - */ -void -clutter_animator_remove_key (ClutterAnimator *animator, - GObject *object, - const gchar *property_name, - gdouble progress) -{ - clutter_animator_remove_key_internal (animator, object, property_name, - progress, FALSE); -} - - - - -typedef struct _ParseClosure { - ClutterAnimator *animator; - ClutterScript *script; - - GValue *value; - - gboolean result; -} ParseClosure; - -static ClutterInterpolation -resolve_interpolation (JsonNode *node) -{ - if ((JSON_NODE_TYPE (node) != JSON_NODE_VALUE)) - return CLUTTER_INTERPOLATION_LINEAR; - - if (json_node_get_value_type (node) == G_TYPE_INT64) - { - return json_node_get_int (node); - } - else if (json_node_get_value_type (node) == G_TYPE_STRING) - { - const gchar *str = json_node_get_string (node); - gboolean res; - gint enum_value; - - res = _clutter_script_enum_from_string (CLUTTER_TYPE_INTERPOLATION, - str, - &enum_value); - if (res) - return enum_value; - } - - return CLUTTER_INTERPOLATION_LINEAR; -} - -static void -parse_animator_property (JsonArray *array, - guint index_, - JsonNode *element, - gpointer data) -{ - ParseClosure *clos = data; - JsonObject *object; - JsonArray *keys; - GObject *gobject; - const gchar *id_, *pname; - GObjectClass *klass; - GParamSpec *pspec; - GSList *valid_keys = NULL; - GList *array_keys, *k; - ClutterInterpolation interpolation = CLUTTER_INTERPOLATION_LINEAR; - gboolean ease_in = FALSE; - - if (JSON_NODE_TYPE (element) != JSON_NODE_OBJECT) - { - g_warning ("The 'properties' member of a ClutterAnimator description " - "should be an array of objects, but the element %d of the " - "array is of type '%s'. The element will be ignored.", - index_, - json_node_type_name (element)); - return; - } - - object = json_node_get_object (element); - - if (!json_object_has_member (object, "object") || - !json_object_has_member (object, "name") || - !json_object_has_member (object, "keys")) - { - g_warning ("The property description at index %d is missing one of " - "the mandatory fields: object, name and keys", - index_); - return; - } - - id_ = json_object_get_string_member (object, "object"); - gobject = clutter_script_get_object (clos->script, id_); - if (gobject == NULL) - { - g_warning ("No object with id '%s' has been defined.", id_); - return; - } - - pname = json_object_get_string_member (object, "name"); - klass = G_OBJECT_GET_CLASS (gobject); - pspec = g_object_class_find_property (klass, pname); - if (pspec == NULL) - { - g_warning ("The object of type '%s' and name '%s' has no " - "property named '%s'", - G_OBJECT_TYPE_NAME (gobject), - id_, - pname); - return; - } - - if (json_object_has_member (object, "ease-in")) - ease_in = json_object_get_boolean_member (object, "ease-in"); - - if (json_object_has_member (object, "interpolation")) - { - JsonNode *node = json_object_get_member (object, "interpolation"); - - interpolation = resolve_interpolation (node); - } - - keys = json_object_get_array_member (object, "keys"); - if (keys == NULL) - { - g_warning ("The property description at index %d has an invalid " - "key field of type '%s' when an array was expected.", - index_, - json_node_type_name (json_object_get_member (object, "keys"))); - return; - } - - if (G_IS_VALUE (clos->value)) - valid_keys = g_slist_reverse (g_value_get_pointer (clos->value)); - else - g_value_init (clos->value, G_TYPE_POINTER); - - array_keys = json_array_get_elements (keys); - for (k = array_keys; k != NULL; k = k->next) - { - JsonNode *node = k->data; - JsonArray *key = json_node_get_array (node); - ClutterAnimatorKey *animator_key; - gdouble progress; - gulong mode; - gboolean res; - - progress = json_array_get_double_element (key, 0); - mode = _clutter_script_resolve_animation_mode (json_array_get_element (key, 1)); - - animator_key = clutter_animator_key_new (clos->animator, - gobject, - pname, - progress, - mode); - - res = _clutter_script_parse_node (clos->script, - &(animator_key->value), - pname, - json_array_get_element (key, 2), - pspec); - if (!res) - { - g_warning ("Unable to parse the key value for the " - "property '%s' (progress: %.2f) at index %d", - pname, - progress, - index_); - continue; - } - - animator_key->ease_in = ease_in; - animator_key->interpolation = interpolation; - - valid_keys = g_slist_prepend (valid_keys, animator_key); - } - - g_list_free (array_keys); - - g_value_set_pointer (clos->value, g_slist_reverse (valid_keys)); - - clos->result = TRUE; -} - -static gboolean -clutter_animator_parse_custom_node (ClutterScriptable *scriptable, - ClutterScript *script, - GValue *value, - const gchar *name, - JsonNode *node) -{ - ParseClosure parse_closure; - - if (strcmp (name, "properties") != 0) - return FALSE; - - if (JSON_NODE_TYPE (node) != JSON_NODE_ARRAY) - return FALSE; - - parse_closure.animator = CLUTTER_ANIMATOR (scriptable); - parse_closure.script = script; - parse_closure.value = value; - parse_closure.result = FALSE; - - json_array_foreach_element (json_node_get_array (node), - parse_animator_property, - &parse_closure); - - /* we return TRUE if we had at least one key parsed */ - - return parse_closure.result; -} - -static void -clutter_animator_set_custom_property (ClutterScriptable *scriptable, - ClutterScript *script, - const gchar *name, - const GValue *value) -{ - if (strcmp (name, "properties") == 0) - { - ClutterAnimator *animator = CLUTTER_ANIMATOR (scriptable); - GSList *keys = g_value_get_pointer (value); - GSList *k; - - for (k = keys; k != NULL; k = k->next) - clutter_animator_set_key_internal (animator, k->data); - - g_slist_free (keys); - } - else - g_object_set_property (G_OBJECT (scriptable), name, value); -} - -static void -clutter_scriptable_init (ClutterScriptableIface *iface) -{ - iface->parse_custom_node = clutter_animator_parse_custom_node; - iface->set_custom_property = clutter_animator_set_custom_property; -} - -static void -clutter_animator_set_property (GObject *gobject, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - ClutterAnimator *self = CLUTTER_ANIMATOR (gobject); - - switch (prop_id) - { - case PROP_DURATION: - clutter_animator_set_duration (self, g_value_get_uint (value)); - break; - - case PROP_TIMELINE: - clutter_animator_set_timeline (self, g_value_get_object (value)); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); - break; - } -} - -static void -clutter_animator_get_property (GObject *gobject, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - ClutterAnimatorPrivate *priv = CLUTTER_ANIMATOR (gobject)->priv; - - switch (prop_id) - { - case PROP_DURATION: - g_value_set_uint (value, clutter_timeline_get_duration (priv->timeline)); - break; - - case PROP_TIMELINE: - g_value_set_object (value, priv->timeline); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); - break; - } -} - -static void -clutter_animator_class_init (ClutterAnimatorClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - - g_type_class_add_private (klass, sizeof (ClutterAnimatorPrivate)); - - gobject_class->set_property = clutter_animator_set_property; - gobject_class->get_property = clutter_animator_get_property; - gobject_class->dispose = clutter_animator_dispose; - gobject_class->finalize = clutter_animator_finalize; - - /** - * ClutterAnimator:duration: - * - * The duration of the #ClutterTimeline used by the #ClutterAnimator - * to drive the animation - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition instead - */ - obj_props[PROP_DURATION] = - g_param_spec_uint ("duration", - P_("Duration"), - P_("The duration of the animation"), - 0, G_MAXUINT, - 2000, - CLUTTER_PARAM_READWRITE); - - /** - * ClutterAnimator:timeline: - * - * The #ClutterTimeline used by the #ClutterAnimator to drive the - * animation - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition instead - */ - obj_props[PROP_TIMELINE] = - g_param_spec_object ("timeline", - P_("Timeline"), - P_("The timeline of the animation"), - CLUTTER_TYPE_TIMELINE, - CLUTTER_PARAM_READWRITE); - - g_object_class_install_properties (gobject_class, - PROP_LAST, - obj_props); -} - -static void -clutter_animator_init (ClutterAnimator *animator) -{ - ClutterAnimatorPrivate *priv; - ClutterTimeline *timeline; - - animator->priv = priv = CLUTTER_ANIMATOR_GET_PRIVATE (animator); - - priv->properties = g_hash_table_new_full (prop_actor_hash, - prop_actor_equal, - prop_actor_key_free, - property_iter_free); - - timeline = clutter_timeline_new (2000); - clutter_animator_set_timeline (animator, timeline); - g_object_unref (timeline); - - priv->slave_timeline = clutter_timeline_new (10000); -} - - -/** - * clutter_animator_property_get_ease_in: - * @animator: a #ClutterAnimatorKey - * @object: a #GObject - * @property_name: the name of a property on object - * - * Checks if a property value is to be eased into the animation. - * - * Return value: %TRUE if the property is eased in - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition instead - */ -gboolean -clutter_animator_property_get_ease_in (ClutterAnimator *animator, - GObject *object, - const gchar *property_name) -{ - ClutterAnimatorKey key, *initial_key; - GList *initial; - - g_return_val_if_fail (CLUTTER_IS_ANIMATOR (animator), FALSE); - g_return_val_if_fail (G_IS_OBJECT (object), FALSE); - g_return_val_if_fail (property_name, FALSE); - - key.object = object; - key.property_name = g_intern_string (property_name); - initial = g_list_find_custom (animator->priv->score, &key, - sort_actor_prop_func); - if (initial != NULL) - { - initial_key = initial->data; - - return initial_key->ease_in; - } - - return FALSE; -} - -/** - * clutter_animator_property_set_ease_in: - * @animator: a #ClutterAnimatorKey - * @object: a #GObject - * @property_name: the name of a property on object - * @ease_in: we are going to be easing in this property - * - * Sets whether a property value is to be eased into the animation. - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition instead - */ -void -clutter_animator_property_set_ease_in (ClutterAnimator *animator, - GObject *object, - const gchar *property_name, - gboolean ease_in) -{ - ClutterAnimatorKey key, *initial_key; - GList *initial; - - g_return_if_fail (CLUTTER_IS_ANIMATOR (animator)); - g_return_if_fail (G_IS_OBJECT (object)); - g_return_if_fail (property_name); - - key.object = object; - key.property_name = g_intern_string (property_name); - initial = g_list_find_custom (animator->priv->score, &key, - sort_actor_prop_func); - if (initial) - { - initial_key = initial->data; - initial_key->ease_in = ease_in; - } - else - g_warning ("The animator has no object of type '%s' with a " - "property named '%s'", - G_OBJECT_TYPE_NAME (object), - property_name); -} - - -/** - * clutter_animator_property_get_interpolation: - * @animator: a #ClutterAnimatorKey - * @object: a #GObject - * @property_name: the name of a property on object - * - * Get the interpolation used by animator for a property on a particular - * object. - * - * Returns: a ClutterInterpolation value. - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition instead - */ -ClutterInterpolation -clutter_animator_property_get_interpolation (ClutterAnimator *animator, - GObject *object, - const gchar *property_name) -{ - GList *initial; - ClutterAnimatorKey key, *initial_key; - - g_return_val_if_fail (CLUTTER_IS_ANIMATOR (animator), - CLUTTER_INTERPOLATION_LINEAR); - g_return_val_if_fail (G_IS_OBJECT (object), - CLUTTER_INTERPOLATION_LINEAR); - g_return_val_if_fail (property_name, - CLUTTER_INTERPOLATION_LINEAR); - - key.object = object; - key.property_name = g_intern_string (property_name); - initial = g_list_find_custom (animator->priv->score, &key, - sort_actor_prop_func); - if (initial) - { - initial_key = initial->data; - - return initial_key->interpolation; - } - - return CLUTTER_INTERPOLATION_LINEAR; -} - -/** - * clutter_animator_property_set_interpolation: - * @animator: a #ClutterAnimatorKey - * @object: a #GObject - * @property_name: the name of a property on object - * @interpolation: the #ClutterInterpolation to use - * - * Set the interpolation method to use, %CLUTTER_INTERPOLATION_LINEAR causes - * the values to linearly change between the values, and - * %CLUTTER_INTERPOLATION_CUBIC causes the values to smoothly change between - * the values. - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition instead - */ -void -clutter_animator_property_set_interpolation (ClutterAnimator *animator, - GObject *object, - const gchar *property_name, - ClutterInterpolation interpolation) -{ - GList *initial; - ClutterAnimatorKey key, *initial_key; - - g_return_if_fail (CLUTTER_IS_ANIMATOR (animator)); - g_return_if_fail (G_IS_OBJECT (object)); - g_return_if_fail (property_name); - - key.object = object; - key.property_name = g_intern_string (property_name); - initial = g_list_find_custom (animator->priv->score, &key, - sort_actor_prop_func); - if (initial) - { - initial_key = initial->data; - initial_key->interpolation = interpolation; - } -} - -G_DEFINE_BOXED_TYPE (ClutterAnimatorKey, clutter_animator_key, - clutter_animator_key_copy, - clutter_animator_key_free); - -/** - * clutter_animator_key_get_object: - * @key: a #ClutterAnimatorKey - * - * Retrieves the object a key applies to. - * - * Return value: (transfer none): the object an animator_key exist for. - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition instead - */ -GObject * -clutter_animator_key_get_object (const ClutterAnimatorKey *key) -{ - g_return_val_if_fail (key != NULL, NULL); - - return key->object; -} - -/** - * clutter_animator_key_get_property_name: - * @key: a #ClutterAnimatorKey - * - * Retrieves the name of the property a key applies to. - * - * Return value: the name of the property an animator_key exist for. - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition instead - */ -const gchar * -clutter_animator_key_get_property_name (const ClutterAnimatorKey *key) -{ - g_return_val_if_fail (key != NULL, NULL); - - return key->property_name; -} - -/** - * clutter_animator_key_get_property_type: - * @key: a #ClutterAnimatorKey - * - * Retrieves the #GType of the property a key applies to - * - * You can use this type to initialize the #GValue to pass to - * clutter_animator_key_get_value() - * - * Return value: the #GType of the property - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition instead - */ -GType -clutter_animator_key_get_property_type (const ClutterAnimatorKey *key) -{ - g_return_val_if_fail (key != NULL, G_TYPE_INVALID); - - return G_VALUE_TYPE (&key->value); -} - -/** - * clutter_animator_key_get_mode: - * @key: a #ClutterAnimatorKey - * - * Retrieves the mode of a #ClutterAnimator key, for the first key of a - * property for an object this represents the whether the animation is - * open ended and or curved for the remainding keys for the property it - * represents the easing mode. - * - * Return value: the mode of a #ClutterAnimatorKey - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition instead - */ -gulong -clutter_animator_key_get_mode (const ClutterAnimatorKey *key) -{ - g_return_val_if_fail (key != NULL, 0); - - return key->mode; -} - -/** - * clutter_animator_key_get_progress: - * @key: a #ClutterAnimatorKey - * - * Retrieves the progress of an clutter_animator_key - * - * Return value: the progress defined for a #ClutterAnimator key. - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition instead - */ -gdouble -clutter_animator_key_get_progress (const ClutterAnimatorKey *key) -{ - g_return_val_if_fail (key != NULL, 0.0); - - return key->progress; -} - -/** - * clutter_animator_key_get_value: - * @key: a #ClutterAnimatorKey - * @value: a #GValue initialized with the correct type for the animator key - * - * Retrieves a copy of the value for a #ClutterAnimatorKey. - * - * The passed in #GValue needs to be already initialized for the value - * type of the key or to a type that allow transformation from the value - * type of the key. - * - * Use g_value_unset() when done. - * - * Return value: %TRUE if the passed #GValue was successfully set, and - * %FALSE otherwise - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition instead - */ -gboolean -clutter_animator_key_get_value (const ClutterAnimatorKey *key, - GValue *value) -{ - g_return_val_if_fail (key != NULL, FALSE); - g_return_val_if_fail (value != NULL, FALSE); - g_return_val_if_fail (G_VALUE_TYPE (value) != G_TYPE_INVALID, FALSE); - - if (!g_type_is_a (G_VALUE_TYPE (&key->value), G_VALUE_TYPE (value))) - { - if (g_value_type_compatible (G_VALUE_TYPE (&key->value), - G_VALUE_TYPE (value))) - { - g_value_copy (&key->value, value); - return TRUE; - } - - if (g_value_type_transformable (G_VALUE_TYPE (&key->value), - G_VALUE_TYPE (value))) - { - if (g_value_transform (&key->value, value)) - return TRUE; - } - - g_warning ("%s: Unable to convert from %s to %s for the " - "property '%s' of object %s in the animator key", - G_STRLOC, - g_type_name (G_VALUE_TYPE (&key->value)), - g_type_name (G_VALUE_TYPE (value)), - key->property_name, - G_OBJECT_TYPE_NAME (key->object)); - - return FALSE; - } - else - g_value_copy (&key->value, value); - - return TRUE; -} diff --git a/clutter/deprecated/clutter-animator.h b/clutter/deprecated/clutter-animator.h deleted file mode 100644 index 1e28a5d48..000000000 --- a/clutter/deprecated/clutter-animator.h +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Copyright (C) 2010 Intel Corporation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - * Author: - * Øyvind KolÃ¥s - */ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_ANIMATOR_H__ -#define __CLUTTER_ANIMATOR_H__ - -#include -#include - -G_BEGIN_DECLS - -#define CLUTTER_TYPE_ANIMATOR (clutter_animator_get_type ()) -#define CLUTTER_TYPE_ANIMATOR_KEY (clutter_animator_key_get_type ()) - -#define CLUTTER_ANIMATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_ANIMATOR, ClutterAnimator)) -#define CLUTTER_ANIMATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_ANIMATOR, ClutterAnimatorClass)) -#define CLUTTER_IS_ANIMATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_ANIMATOR)) -#define CLUTTER_IS_ANIMATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_ANIMATOR)) -#define CLUTTER_ANIMATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_ANIMATOR, ClutterAnimatorClass)) - -/* ClutterAnimator is typedef in clutter-types.h */ - -typedef struct _ClutterAnimatorClass ClutterAnimatorClass; -typedef struct _ClutterAnimatorPrivate ClutterAnimatorPrivate; - -/** - * ClutterAnimatorKey: - * - * A key frame inside a #ClutterAnimator - * - * - */ -typedef struct _ClutterAnimatorKey ClutterAnimatorKey; - -/** - * ClutterAnimator: - * - * The #ClutterAnimator structure contains only private data and - * should be accessed using the provided API - * - * - * - * Deprecated: 1.12 - */ -struct _ClutterAnimator -{ - /*< private >*/ - GObject parent_instance; - - ClutterAnimatorPrivate *priv; -}; - -/** - * ClutterAnimatorClass: - * - * The #ClutterAnimatorClass structure contains only private data - * - * - * - * Deprecated: 1.12 - */ -struct _ClutterAnimatorClass -{ - /*< private >*/ - GObjectClass parent_class; - - /* padding for future expansion */ - gpointer _padding_dummy[16]; -}; - -CLUTTER_DEPRECATED_IN_1_12 -GType clutter_animator_get_type (void) G_GNUC_CONST; - -CLUTTER_DEPRECATED_IN_1_12 -ClutterAnimator * clutter_animator_new (void); -CLUTTER_DEPRECATED_IN_1_12 -ClutterAnimator * clutter_animator_set_key (ClutterAnimator *animator, - GObject *object, - const gchar *property_name, - guint mode, - gdouble progress, - const GValue *value); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_animator_set (ClutterAnimator *animator, - gpointer first_object, - const gchar *first_property_name, - guint first_mode, - gdouble first_progress, - ...) G_GNUC_NULL_TERMINATED; -CLUTTER_DEPRECATED_IN_1_12 -GList * clutter_animator_get_keys (ClutterAnimator *animator, - GObject *object, - const gchar *property_name, - gdouble progress); - -CLUTTER_DEPRECATED_IN_1_12 -void clutter_animator_remove_key (ClutterAnimator *animator, - GObject *object, - const gchar *property_name, - gdouble progress); - -CLUTTER_DEPRECATED_IN_1_12 -ClutterTimeline * clutter_animator_start (ClutterAnimator *animator); - -CLUTTER_DEPRECATED_IN_1_12 -gboolean clutter_animator_compute_value (ClutterAnimator *animator, - GObject *object, - const gchar *property_name, - gdouble progress, - GValue *value); - -CLUTTER_DEPRECATED_IN_1_12 -ClutterTimeline * clutter_animator_get_timeline (ClutterAnimator *animator); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_animator_set_timeline (ClutterAnimator *animator, - ClutterTimeline *timeline); -CLUTTER_DEPRECATED_IN_1_12 -guint clutter_animator_get_duration (ClutterAnimator *animator); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_animator_set_duration (ClutterAnimator *animator, - guint duration); - -CLUTTER_DEPRECATED_IN_1_12 -gboolean clutter_animator_property_get_ease_in (ClutterAnimator *animator, - GObject *object, - const gchar *property_name); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_animator_property_set_ease_in (ClutterAnimator *animator, - GObject *object, - const gchar *property_name, - gboolean ease_in); - -CLUTTER_DEPRECATED_IN_1_12 -ClutterInterpolation clutter_animator_property_get_interpolation (ClutterAnimator *animator, - GObject *object, - const gchar *property_name); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_animator_property_set_interpolation (ClutterAnimator *animator, - GObject *object, - const gchar *property_name, - ClutterInterpolation interpolation); - -CLUTTER_DEPRECATED_IN_1_12 -GType clutter_animator_key_get_type (void) G_GNUC_CONST; -CLUTTER_DEPRECATED_IN_1_12 -GObject * clutter_animator_key_get_object (const ClutterAnimatorKey *key); -CLUTTER_DEPRECATED_IN_1_12 -const gchar * clutter_animator_key_get_property_name (const ClutterAnimatorKey *key); -CLUTTER_DEPRECATED_IN_1_12 -GType clutter_animator_key_get_property_type (const ClutterAnimatorKey *key); -CLUTTER_DEPRECATED_IN_1_12 -gulong clutter_animator_key_get_mode (const ClutterAnimatorKey *key); -CLUTTER_DEPRECATED_IN_1_12 -gdouble clutter_animator_key_get_progress (const ClutterAnimatorKey *key); -CLUTTER_DEPRECATED_IN_1_12 -gboolean clutter_animator_key_get_value (const ClutterAnimatorKey *key, - GValue *value); - -G_END_DECLS - -#endif /* __CLUTTER_ANIMATOR_H__ */ diff --git a/clutter/deprecated/clutter-backend.h b/clutter/deprecated/clutter-backend.h deleted file mode 100644 index 3fe027449..000000000 --- a/clutter/deprecated/clutter-backend.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * Copyright (C) 2006, 2007, 2008 OpenedHand Ltd - * Copyright (C) 2009, 2010 Intel Corp - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_BACKEND_DEPRECATED_H__ -#define __CLUTTER_BACKEND_DEPRECATED_H__ - -#include - -G_BEGIN_DECLS - -CLUTTER_DEPRECATED_IN_1_4_FOR(ClutterSettings:font_dpi) -void clutter_backend_set_resolution (ClutterBackend *backend, - gdouble dpi); - -CLUTTER_DEPRECATED_IN_1_4_FOR(ClutterSettings:double_click_time) -void clutter_backend_set_double_click_time (ClutterBackend *backend, - guint msec); - -CLUTTER_DEPRECATED_IN_1_4_FOR(ClutterSettings:double_click_time) -guint clutter_backend_get_double_click_time (ClutterBackend *backend); - -CLUTTER_DEPRECATED_IN_1_4_FOR(ClutterSettings:double_click_distance) -void clutter_backend_set_double_click_distance (ClutterBackend *backend, - guint distance); - -CLUTTER_DEPRECATED_IN_1_4_FOR(ClutterSettings:double_click_distance) -guint clutter_backend_get_double_click_distance (ClutterBackend *backend); - -CLUTTER_DEPRECATED_IN_1_4_FOR(ClutterSettings:font_name) -void clutter_backend_set_font_name (ClutterBackend *backend, - const gchar *font_name); - -CLUTTER_DEPRECATED_IN_1_4_FOR(ClutterSettings:font_name) -const gchar * clutter_backend_get_font_name (ClutterBackend *backend); - - -G_END_DECLS - -#endif /* __CLUTTER_BACKEND_DEPRECATED_H__ */ diff --git a/clutter/deprecated/clutter-behaviour-depth.c b/clutter/deprecated/clutter-behaviour-depth.c deleted file mode 100644 index 441fe78d5..000000000 --- a/clutter/deprecated/clutter-behaviour-depth.c +++ /dev/null @@ -1,309 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * Jorn Baayen - * Emmanuele Bassi - * - * Copyright (C) 2006 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#define CLUTTER_DISABLE_DEPRECATION_WARNINGS - -#include "deprecated/clutter-actor.h" -#include "clutter-alpha.h" -#include "clutter-behaviour.h" -#include "clutter-behaviour-depth.h" -#include "clutter-enum-types.h" -#include "clutter-main.h" -#include "clutter-debug.h" -#include "clutter-private.h" - -/** - * SECTION:clutter-behaviour-depth - * @Title: ClutterBehaviourDepth - * @short_description: A behaviour controlling the Z position - * @Deprecated: 1.6: Use clutter_actor_animate() instead - * - * #ClutterBehaviourDepth is a simple #ClutterBehaviour controlling the - * depth of a set of actors between a start and end depth. - * - * #ClutterBehaviourDepth is available since Clutter 0.4. - * - * Deprecated: 1.6: Use the #ClutterActor:depth property and - * clutter_actor_animate(), or #ClutterAnimator, or #ClutterState - * instead. - */ - -G_DEFINE_TYPE (ClutterBehaviourDepth, - clutter_behaviour_depth, - CLUTTER_TYPE_BEHAVIOUR); - -struct _ClutterBehaviourDepthPrivate -{ - gint depth_start; - gint depth_end; -}; - -enum -{ - PROP_0, - - PROP_DEPTH_START, - PROP_DEPTH_END -}; - -static void -alpha_notify_foreach (ClutterBehaviour *behaviour, - ClutterActor *actor, - gpointer user_data) -{ - clutter_actor_set_depth (actor, GPOINTER_TO_INT (user_data)); -} - -static void -clutter_behaviour_depth_alpha_notify (ClutterBehaviour *behaviour, - gdouble alpha_value) -{ - ClutterBehaviourDepthPrivate *priv; - gint depth; - - priv = CLUTTER_BEHAVIOUR_DEPTH (behaviour)->priv; - - /* Need to create factor as to avoid borking signedness */ - depth = (alpha_value * (priv->depth_end - priv->depth_start)) - + priv->depth_start; - - CLUTTER_NOTE (ANIMATION, "alpha: %.4f, depth: %d", alpha_value, depth); - - clutter_behaviour_actors_foreach (behaviour, - alpha_notify_foreach, - GINT_TO_POINTER (depth)); -} - -static void -clutter_behaviour_depth_applied (ClutterBehaviour *behaviour, - ClutterActor *actor) -{ - ClutterBehaviourDepth *depth = CLUTTER_BEHAVIOUR_DEPTH (behaviour); - - clutter_actor_set_depth (actor, depth->priv->depth_start); -} - -static void -clutter_behaviour_depth_set_property (GObject *gobject, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - ClutterBehaviourDepth *depth = CLUTTER_BEHAVIOUR_DEPTH (gobject); - - switch (prop_id) - { - case PROP_DEPTH_START: - depth->priv->depth_start = g_value_get_int (value); - break; - case PROP_DEPTH_END: - depth->priv->depth_end = g_value_get_int (value); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); - break; - } -} - -static void -clutter_behaviour_depth_get_property (GObject *gobject, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - ClutterBehaviourDepth *depth = CLUTTER_BEHAVIOUR_DEPTH (gobject); - - switch (prop_id) - { - case PROP_DEPTH_START: - g_value_set_int (value, depth->priv->depth_start); - break; - case PROP_DEPTH_END: - g_value_set_int (value, depth->priv->depth_end); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); - break; - } -} - -static void -clutter_behaviour_depth_class_init (ClutterBehaviourDepthClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - ClutterBehaviourClass *behaviour_class = CLUTTER_BEHAVIOUR_CLASS (klass); - - g_type_class_add_private (klass, sizeof (ClutterBehaviourDepthPrivate)); - - gobject_class->set_property = clutter_behaviour_depth_set_property; - gobject_class->get_property = clutter_behaviour_depth_get_property; - - behaviour_class->alpha_notify = clutter_behaviour_depth_alpha_notify; - behaviour_class->applied = clutter_behaviour_depth_applied; - - /** - * ClutterBehaviourDepth:depth-start: - * - * Start depth level to apply to the actors. - * - * - * - * Deprecated: 1.6 - */ - g_object_class_install_property (gobject_class, - PROP_DEPTH_START, - g_param_spec_int ("depth-start", - P_("Start Depth"), - P_("Initial depth to apply"), - G_MININT, G_MAXINT, 0, - CLUTTER_PARAM_READWRITE)); - /** - * ClutterBehaviourDepth:depth-end: - * - * End depth level to apply to the actors. - * - * - * - * Deprecated: 1.6 - */ - g_object_class_install_property (gobject_class, - PROP_DEPTH_END, - g_param_spec_int ("depth-end", - P_("End Depth"), - P_("Final depth to apply"), - G_MININT, G_MAXINT, 0, - CLUTTER_PARAM_READWRITE)); -} - -static void -clutter_behaviour_depth_init (ClutterBehaviourDepth *depth) -{ - depth->priv = G_TYPE_INSTANCE_GET_PRIVATE (depth, - CLUTTER_TYPE_BEHAVIOUR_DEPTH, - ClutterBehaviourDepthPrivate); -} - -/** - * clutter_behaviour_depth_new: - * @alpha: (allow-none): a #ClutterAlpha instance, or %NULL - * @depth_start: initial value of the depth - * @depth_end: final value of the depth - * - * Creates a new #ClutterBehaviourDepth which can be used to control - * the ClutterActor:depth property of a set of #ClutterActors. - * - * If @alpha is not %NULL, the #ClutterBehaviour will take ownership - * of the #ClutterAlpha instance. In the case when @alpha is %NULL, - * it can be set later with clutter_behaviour_set_alpha(). - * - * Return value: (transfer full): the newly created behaviour - * - * - * - * Deprecated: 1.6 - */ -ClutterBehaviour * -clutter_behaviour_depth_new (ClutterAlpha *alpha, - gint depth_start, - gint depth_end) -{ - g_return_val_if_fail (alpha == NULL || CLUTTER_IS_ALPHA (alpha), NULL); - - return g_object_new (CLUTTER_TYPE_BEHAVIOUR_DEPTH, - "alpha", alpha, - "depth-start", depth_start, - "depth-end", depth_end, - NULL); -} - -/** - * clutter_behaviour_depth_set_bounds: - * @behaviour: a #ClutterBehaviourDepth - * @depth_start: initial value of the depth - * @depth_end: final value of the depth - * - * Sets the boundaries of the @behaviour. - * - * - * - * Deprecated: 1.6 - */ -void -clutter_behaviour_depth_set_bounds (ClutterBehaviourDepth *behaviour, - gint depth_start, - gint depth_end) -{ - ClutterBehaviourDepthPrivate *priv; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_DEPTH (behaviour)); - - priv = behaviour->priv; - - g_object_freeze_notify (G_OBJECT (behaviour)); - - if (priv->depth_start != depth_start) - { - priv->depth_start = depth_start; - g_object_notify (G_OBJECT (behaviour), "depth-start"); - } - - if (priv->depth_end != depth_end) - { - priv->depth_end = depth_end; - g_object_notify (G_OBJECT (behaviour), "depth-end"); - } - - g_object_thaw_notify (G_OBJECT (behaviour)); -} - -/** - * clutter_behaviour_depth_get_bounds: - * @behaviour: a #ClutterBehaviourDepth - * @depth_start: (out): return location for the initial depth value, or %NULL - * @depth_end: (out): return location for the final depth value, or %NULL - * - * Gets the boundaries of the @behaviour - * - * - * - * Deprecated: 1.6 - */ -void -clutter_behaviour_depth_get_bounds (ClutterBehaviourDepth *behaviour, - gint *depth_start, - gint *depth_end) -{ - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_DEPTH (behaviour)); - - if (depth_start) - *depth_start = behaviour->priv->depth_start; - - if (depth_end) - *depth_end = behaviour->priv->depth_end; -} diff --git a/clutter/deprecated/clutter-behaviour-depth.h b/clutter/deprecated/clutter-behaviour-depth.h deleted file mode 100644 index 36db86f54..000000000 --- a/clutter/deprecated/clutter-behaviour-depth.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * Jorn Baayen - * Emmanuele Bassi - * - * Copyright (C) 2006 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_BEHAVIOUR_DEPTH__ -#define __CLUTTER_BEHAVIOUR_DEPTH__ - -#include - -G_BEGIN_DECLS - -#define CLUTTER_TYPE_BEHAVIOUR_DEPTH (clutter_behaviour_depth_get_type ()) -#define CLUTTER_BEHAVIOUR_DEPTH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_BEHAVIOUR_DEPTH, ClutterBehaviourDepth)) -#define CLUTTER_IS_BEHAVIOUR_DEPTH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_BEHAVIOUR_DEPTH)) -#define CLUTTER_BEHAVIOUR_DEPTH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_BEHAVIOUR_DEPTH, ClutterBehaviourDepthClass)) -#define CLUTTER_IS_BEHAVIOUR_DEPTH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_BEHAVIOUR_DEPTH)) -#define CLUTTER_BEHAVIOUR_DEPTH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_BEHAVIOUR_DEPTH, ClutterBehaviourDepthClass)) - -typedef struct _ClutterBehaviourDepth ClutterBehaviourDepth; -typedef struct _ClutterBehaviourDepthPrivate ClutterBehaviourDepthPrivate; -typedef struct _ClutterBehaviourDepthClass ClutterBehaviourDepthClass; - -/** - * ClutterBehaviourDepth: - * - * The #ClutterBehaviourDepth structure contains only private data - * and should be accessed using the provided API - * - * - * - * Deprecated: 1.6: Use clutter_actor_animate() with #ClutterActor:depth - * instead. - */ -struct _ClutterBehaviourDepth -{ - /*< private >*/ - ClutterBehaviour parent_instance; - - ClutterBehaviourDepthPrivate *priv; -}; - -/** - * ClutterBehaviourDepthClass: - * - * The #ClutterBehaviourDepthClass structure contains only private data - * - * - * - * Deprecated: 1.6 - */ -struct _ClutterBehaviourDepthClass -{ - /*< private >*/ - ClutterBehaviourClass parent_class; -}; - -CLUTTER_DEPRECATED_IN_1_6 -GType clutter_behaviour_depth_get_type (void) G_GNUC_CONST; - -CLUTTER_DEPRECATED_IN_1_6_FOR(clutter_actor_animate and ClutterActor:depth) -ClutterBehaviour *clutter_behaviour_depth_new (ClutterAlpha *alpha, - gint depth_start, - gint depth_end); - -CLUTTER_DEPRECATED_IN_1_6 -void clutter_behaviour_depth_set_bounds (ClutterBehaviourDepth *behaviour, - gint depth_start, - gint depth_end); -CLUTTER_DEPRECATED_IN_1_6 -void clutter_behaviour_depth_get_bounds (ClutterBehaviourDepth *behaviour, - gint *depth_start, - gint *depth_end); - -G_END_DECLS - -#endif /* __CLUTTER_BEHAVIOUR_DEPTH__ */ diff --git a/clutter/deprecated/clutter-behaviour-ellipse.c b/clutter/deprecated/clutter-behaviour-ellipse.c deleted file mode 100644 index 92e6f2f15..000000000 --- a/clutter/deprecated/clutter-behaviour-ellipse.c +++ /dev/null @@ -1,1068 +0,0 @@ - -/* -*- mode:C; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Tomas Frydrych - * - * Copyright (C) 2007 OpenedHand Ltd - * Copyright (C) 2009 Intel Corp. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -/** - * SECTION:clutter-behaviour-ellipse - * @Title: ClutterBehaviourEllipse - * @short_description: A behaviour interpolating position along an ellipse - * @Deprecated: 1.6: Use clutter_actor_animate() instead - * - * #ClutterBehaviourEllipse interpolates actors along a path defined by - * an ellipse. - * - * When applying an ellipse behaviour to an actor, the - * behaviour will update the actor's position and depth and set them - * to what is dictated by the ellipses initial position. - * - * Deprecated: 1.6: Use clutter_actor_animate(), #ClutterPath and a - * #ClutterPathConstraint instead. - * - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#define CLUTTER_DISABLE_DEPRECATION_WARNINGS -#include "deprecated/clutter-actor.h" - -#include "clutter-alpha.h" -#include "clutter-behaviour.h" -#include "clutter-behaviour-ellipse.h" -#include "clutter-debug.h" -#include "clutter-enum-types.h" -#include "clutter-private.h" - -G_DEFINE_TYPE (ClutterBehaviourEllipse, - clutter_behaviour_ellipse, - CLUTTER_TYPE_BEHAVIOUR); - -#define CLUTTER_BEHAVIOUR_ELLIPSE_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \ - CLUTTER_TYPE_BEHAVIOUR_ELLIPSE, \ - ClutterBehaviourEllipsePrivate)) - -enum -{ - PROP_0, - - PROP_CENTER, - PROP_WIDTH, - PROP_HEIGHT, - PROP_ANGLE_START, - PROP_ANGLE_END, - PROP_ANGLE_TILT_X, - PROP_ANGLE_TILT_Y, - PROP_ANGLE_TILT_Z, - PROP_DIRECTION, - - PROP_LAST -}; - -static GParamSpec *obj_props[PROP_LAST]; - -struct _ClutterBehaviourEllipsePrivate -{ - ClutterKnot center; - - /* a = width / 2 */ - gint a; - - /* b = height / 2 */ - gint b; - - gdouble angle_start; - gdouble angle_end; - - gdouble angle_tilt_x; - gdouble angle_tilt_y; - gdouble angle_tilt_z; - - ClutterRotateDirection direction; -}; - -typedef struct _knot3d -{ - gint x; - gint y; - gint z; -} knot3d; - -static void -clutter_behaviour_ellipse_advance (ClutterBehaviourEllipse *e, - float angle, - knot3d *knot) -{ - ClutterBehaviourEllipsePrivate *priv = e->priv; - gint x, y, z; - - x = priv->a * cosf (angle * (G_PI / 180.0)); - y = priv->b * sinf (angle * (G_PI / 180.0)); - z = 0; - - if (priv->angle_tilt_z) - { - /* - * x2 = r * cos (angle + tilt_z) - * y2 = r * sin (angle + tilt_z) - * - * These can be trasformed to the formulas below using properties of - * sin (a + b) and cos (a + b) - * - */ - gfloat x2, y2; - - x2 = x * cosf (priv->angle_tilt_z * (G_PI / 180.0)) - - y * sinf (priv->angle_tilt_z * (G_PI / 180.0)); - - y2 = y * cosf (priv->angle_tilt_z * (G_PI / 180.0)) - + x * sinf (priv->angle_tilt_z * (G_PI / 180.0)); - - x = (x2); - y = (y2); - } - - if (priv->angle_tilt_x) - { - gfloat z2, y2; - - z2 = - y * sinf (priv->angle_tilt_x * (G_PI / 180.0)); - y2 = y * cosf (priv->angle_tilt_x * (G_PI / 180.0)); - - z = z2; - y = y2; - } - - if (priv->angle_tilt_y) - { - gfloat x2, z2; - - x2 = x * cosf (priv->angle_tilt_y * (G_PI / 180.0)) - - z * sinf (priv->angle_tilt_y * (G_PI / 180.0)); - - z2 = z * cosf (priv->angle_tilt_y * (G_PI / 180.0)) - + x * sinf (priv->angle_tilt_y * (G_PI / 180.0)); - - x = x2; - z = z2; - } - - knot->x = x; - knot->y = y; - knot->z = z; - - CLUTTER_NOTE (ANIMATION, "advancing to angle %.2f [%d, %d] (a: %d, b: %d)", - angle, - knot->x, knot->y, - priv->a, priv->b); -} - - -static void -actor_apply_knot_foreach (ClutterBehaviour *behave, - ClutterActor *actor, - gpointer data) -{ - ClutterBehaviourEllipsePrivate *priv; - knot3d *knot = data; - - priv = ((ClutterBehaviourEllipse *) behave)->priv; - - clutter_actor_set_position (actor, knot->x, knot->y); - - if (priv->angle_tilt_x != 0 || priv->angle_tilt_y != 0) - clutter_actor_set_depth (actor, knot->z); -} - -static inline float -clamp_angle (float a) -{ - gint rounds; - - rounds = a / 360; - if (a < 0) - rounds--; - - return a - 360 * rounds; -} - -static void -clutter_behaviour_ellipse_alpha_notify (ClutterBehaviour *behave, - gdouble alpha) -{ - ClutterBehaviourEllipse *self = CLUTTER_BEHAVIOUR_ELLIPSE (behave); - ClutterBehaviourEllipsePrivate *priv = self->priv; - gfloat start, end; - gfloat angle = 0; - knot3d knot; - - /* we do everything in single precision because it's easier, even - * though all the parameters are stored in double precision for - * consistency with the equivalent ClutterActor API - */ - start = priv->angle_start; - end = priv->angle_end; - - if (priv->direction == CLUTTER_ROTATE_CW && start >= end) - end += 360; - else if (priv->direction == CLUTTER_ROTATE_CCW && start <= end) - end -= 360; - - angle = (end - start) * alpha + start; - - clutter_behaviour_ellipse_advance (self, angle, &knot); - - knot.x += priv->center.x; - knot.y += priv->center.y; - - clutter_behaviour_actors_foreach (behave, actor_apply_knot_foreach, &knot); -} - -static void -clutter_behaviour_ellipse_set_property (GObject *gobject, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - ClutterBehaviourEllipse *el = CLUTTER_BEHAVIOUR_ELLIPSE (gobject); - ClutterBehaviourEllipsePrivate *priv = el->priv; - - switch (prop_id) - { - case PROP_ANGLE_START: - priv->angle_start = g_value_get_double (value); - break; - - case PROP_ANGLE_END: - priv->angle_end = g_value_get_double (value); - break; - - case PROP_ANGLE_TILT_X: - priv->angle_tilt_x = g_value_get_double (value); - break; - - case PROP_ANGLE_TILT_Y: - priv->angle_tilt_y = g_value_get_double (value); - break; - - case PROP_ANGLE_TILT_Z: - priv->angle_tilt_z = g_value_get_double (value); - break; - - case PROP_WIDTH: - clutter_behaviour_ellipse_set_width (el, g_value_get_int (value)); - break; - - case PROP_HEIGHT: - clutter_behaviour_ellipse_set_height (el, g_value_get_int (value)); - break; - - case PROP_CENTER: - { - ClutterKnot *knot = g_value_get_boxed (value); - if (knot) - clutter_behaviour_ellipse_set_center (el, knot->x, knot->y); - } - break; - - case PROP_DIRECTION: - priv->direction = g_value_get_enum (value); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); - break; - } -} - -static void -clutter_behaviour_ellipse_get_property (GObject *gobject, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - ClutterBehaviourEllipsePrivate *priv; - - priv = CLUTTER_BEHAVIOUR_ELLIPSE (gobject)->priv; - - switch (prop_id) - { - case PROP_ANGLE_START: - g_value_set_double (value, priv->angle_start); - break; - - case PROP_ANGLE_END: - g_value_set_double (value, priv->angle_end); - break; - - case PROP_ANGLE_TILT_X: - g_value_set_double (value, priv->angle_tilt_x); - break; - - case PROP_ANGLE_TILT_Y: - g_value_set_double (value, priv->angle_tilt_y); - break; - - case PROP_ANGLE_TILT_Z: - g_value_set_double (value, priv->angle_tilt_z); - break; - - case PROP_WIDTH: - g_value_set_int (value, (priv->a * 2)); - break; - - case PROP_HEIGHT: - g_value_set_int (value, (priv->b * 2)); - break; - - case PROP_CENTER: - g_value_set_boxed (value, &priv->center); - break; - - case PROP_DIRECTION: - g_value_set_enum (value, priv->direction); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); - break; - } -} - -static void -clutter_behaviour_ellipse_applied (ClutterBehaviour *behave, - ClutterActor *actor) -{ - ClutterBehaviourEllipse *e = CLUTTER_BEHAVIOUR_ELLIPSE (behave); - ClutterBehaviourEllipsePrivate *priv = e->priv; - knot3d knot = { 0, }; - - clutter_behaviour_ellipse_advance (e, priv->angle_start, &knot); - - clutter_actor_set_position (actor, knot.x, knot.y); - - /* the depth should be changed only if there is a tilt on - * any of the X or the Y axis - */ - if (priv->angle_tilt_x != 0 || priv->angle_tilt_y != 0) - clutter_actor_set_depth (actor, knot.z); -} - -static void -clutter_behaviour_ellipse_class_init (ClutterBehaviourEllipseClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - ClutterBehaviourClass *behave_class = CLUTTER_BEHAVIOUR_CLASS (klass); - GParamSpec *pspec = NULL; - - g_type_class_add_private (klass, sizeof (ClutterBehaviourEllipsePrivate)); - - object_class->set_property = clutter_behaviour_ellipse_set_property; - object_class->get_property = clutter_behaviour_ellipse_get_property; - - behave_class->alpha_notify = clutter_behaviour_ellipse_alpha_notify; - behave_class->applied = clutter_behaviour_ellipse_applied; - - /** - * ClutterBehaviourEllipse:angle-start: - * - * The initial angle from where the rotation should start. - * - * - */ - pspec = g_param_spec_double ("angle-start", - P_("Start Angle"), - P_("Initial angle"), - 0.0, 360.0, - 0.0, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_ANGLE_START] = pspec; - g_object_class_install_property (object_class, PROP_ANGLE_START, pspec); - - /** - * ClutterBehaviourEllipse:angle-end: - * - * The final angle to where the rotation should end. - * - * - */ - pspec = g_param_spec_double ("angle-end", - P_("End Angle"), - P_("Final angle"), - 0.0, 360.0, - 0.0, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_ANGLE_END] = pspec; - g_object_class_install_property (object_class, PROP_ANGLE_END, pspec); - - /** - * ClutterBehaviourEllipse:angle-tilt-x: - * - * The tilt angle for the rotation around center in X axis - * - * - */ - pspec = g_param_spec_double ("angle-tilt-x", - P_("Angle x tilt"), - P_("Tilt of the ellipse around x axis"), - 0.0, 360.0, - 360.0, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_ANGLE_TILT_X] = pspec; - g_object_class_install_property (object_class, PROP_ANGLE_TILT_X, pspec); - - /** - * ClutterBehaviourEllipse:angle-tilt-y: - * - * The tilt angle for the rotation around center in Y axis - * - * - */ - pspec = g_param_spec_double ("angle-tilt-y", - P_("Angle y tilt"), - P_("Tilt of the ellipse around y axis"), - 0.0, 360.0, - 360.0, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_ANGLE_TILT_Y] = pspec; - g_object_class_install_property (object_class, PROP_ANGLE_TILT_Y, pspec); - - /** - * ClutterBehaviourEllipse:angle-tilt-z: - * - * The tilt angle for the rotation on the Z axis - * - * - */ - pspec = g_param_spec_double ("angle-tilt-z", - P_("Angle z tilt"), - P_("Tilt of the ellipse around z axis"), - 0.0, 360.0, - 360.0, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_ANGLE_TILT_Z] = pspec; - g_object_class_install_property (object_class, PROP_ANGLE_TILT_Z, pspec); - - /** - * ClutterBehaviourEllipse:width: - * - * Width of the ellipse, in pixels - * - * - */ - pspec = g_param_spec_int ("width", - P_("Width"), - P_("Width of the ellipse"), - 0, G_MAXINT, - 100, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_WIDTH] = pspec; - g_object_class_install_property (object_class, PROP_WIDTH, pspec); - - /** - * ClutterBehaviourEllipse:height: - * - * Height of the ellipse, in pixels - * - * - */ - pspec = g_param_spec_int ("height", - P_("Height"), - P_("Height of ellipse"), - 0, G_MAXINT, - 50, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_HEIGHT] = pspec; - g_object_class_install_property (object_class, PROP_HEIGHT, pspec); - - /** - * ClutterBehaviourEllipse:center: - * - * The center of the ellipse. - * - * - */ - pspec = g_param_spec_boxed ("center", - P_("Center"), - P_("Center of ellipse"), - CLUTTER_TYPE_KNOT, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_CENTER] = pspec; - g_object_class_install_property (object_class, PROP_CENTER, pspec); - - /** - * ClutterBehaviourEllipse:direction: - * - * The direction of the rotation. - * - * - */ - pspec = g_param_spec_enum ("direction", - P_("Direction"), - P_("Direction of rotation"), - CLUTTER_TYPE_ROTATE_DIRECTION, - CLUTTER_ROTATE_CW, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_DIRECTION] = pspec; - g_object_class_install_property (object_class, PROP_DIRECTION, pspec); -} - -static void -clutter_behaviour_ellipse_init (ClutterBehaviourEllipse * self) -{ - ClutterBehaviourEllipsePrivate *priv; - - self->priv = priv = CLUTTER_BEHAVIOUR_ELLIPSE_GET_PRIVATE (self); - - priv->direction = CLUTTER_ROTATE_CW; - - priv->angle_start = 0; - priv->angle_end = 0; - - priv->a = 50; - priv->b = 25; - - priv->angle_tilt_x = 360; - priv->angle_tilt_y = 360; - priv->angle_tilt_z = 360; -} - -/** - * clutter_behaviour_ellipse_new: - * @alpha: (allow-none): a #ClutterAlpha instance, or %NULL - * @x: x coordinace of the center - * @y: y coordiance of the center - * @width: width of the ellipse - * @height: height of the ellipse - * @direction: #ClutterRotateDirection of rotation - * @start: angle in degrees at which movement starts, between 0 and 360 - * @end: angle in degrees at which movement ends, between 0 and 360 - * - * Creates a behaviour that drives actors along an elliptical path with - * given center, width and height; the movement starts at @start - * degrees (with 0 corresponding to 12 o'clock) and ends at @end - * degrees. Angles greated than 360 degrees get clamped to the canonical - * interval <0, 360); if @start is equal to @end, the behaviour will - * rotate by exacly 360 degrees. - * - * If @alpha is not %NULL, the #ClutterBehaviour will take ownership - * of the #ClutterAlpha instance. In the case when @alpha is %NULL, - * it can be set later with clutter_behaviour_set_alpha(). - * - * Return value: the newly created #ClutterBehaviourEllipse - * - * - */ -ClutterBehaviour * -clutter_behaviour_ellipse_new (ClutterAlpha *alpha, - gint x, - gint y, - gint width, - gint height, - ClutterRotateDirection direction, - gdouble start, - gdouble end) -{ - ClutterKnot center; - - g_return_val_if_fail (alpha == NULL || CLUTTER_IS_ALPHA (alpha), NULL); - - center.x = x; - center.y = y; - - return g_object_new (CLUTTER_TYPE_BEHAVIOUR_ELLIPSE, - "alpha", alpha, - "center", ¢er, - "width", width, - "height", height, - "direction", direction, - "angle-start", start, - "angle-end", end, - NULL); -} - -/** - * clutter_behaviour_ellipse_set_center: - * @self: a #ClutterBehaviourEllipse - * @x: x coordinace of centre - * @y: y coordinace of centre - * - * Sets the center of the elliptical path to the point represented by knot. - * - * - */ -void -clutter_behaviour_ellipse_set_center (ClutterBehaviourEllipse *self, - gint x, - gint y) -{ - ClutterBehaviourEllipsePrivate *priv; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self)); - - priv = self->priv; - - if (priv->center.x != x || priv->center.y != y) - { - priv->center.x = x; - priv->center.y = y; - - g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_CENTER]); - } -} - -/** - * clutter_behaviour_ellipse_get_center: - * @self: a #ClutterBehaviourEllipse - * @x: (out): return location for the X coordinate of the center, or %NULL - * @y: (out): return location for the Y coordinate of the center, or %NULL - * - * Gets the center of the elliptical path path. - * - * - */ -void -clutter_behaviour_ellipse_get_center (ClutterBehaviourEllipse *self, - gint *x, - gint *y) -{ - ClutterBehaviourEllipsePrivate *priv; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self)); - - priv = self->priv; - - if (x) - *x = priv->center.x; - - if (y) - *y = priv->center.y; -} - - -/** - * clutter_behaviour_ellipse_set_width: - * @self: a #ClutterBehaviourEllipse - * @width: width of the ellipse - * - * Sets the width of the elliptical path. - * - * - */ -void -clutter_behaviour_ellipse_set_width (ClutterBehaviourEllipse *self, - gint width) -{ - ClutterBehaviourEllipsePrivate *priv; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self)); - - priv = self->priv; - - if (priv->a != width / 2) - { - priv->a = width / 2; - - g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_WIDTH]); - } -} - -/** - * clutter_behaviour_ellipse_get_width: - * @self: a #ClutterBehaviourEllipse - * - * Gets the width of the elliptical path. - * - * Return value: the width of the path - * - * - */ -gint -clutter_behaviour_ellipse_get_width (ClutterBehaviourEllipse *self) -{ - g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self), 0); - - return self->priv->a * 2; -} - -/** - * clutter_behaviour_ellipse_set_height: - * @self: a #ClutterBehaviourEllipse - * @height: height of the ellipse - * - * Sets the height of the elliptical path. - * - * - */ -void -clutter_behaviour_ellipse_set_height (ClutterBehaviourEllipse *self, - gint height) -{ - ClutterBehaviourEllipsePrivate *priv; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self)); - - priv = self->priv; - - if (priv->b != height / 2) - { - priv->b = height / 2; - - g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_HEIGHT]); - } -} - -/** - * clutter_behaviour_ellipse_get_height: - * @self: a #ClutterBehaviourEllipse - * - * Gets the height of the elliptical path. - * - * Return value: the height of the path - * - * - */ -gint -clutter_behaviour_ellipse_get_height (ClutterBehaviourEllipse *self) -{ - g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self), 0); - - return self->priv->b * 2; -} - -/** - * clutter_behaviour_ellipse_set_angle_start: - * @self: a #ClutterBehaviourEllipse - * @angle_start: angle at which movement starts in degrees, between 0 and 360. - * - * Sets the angle at which movement starts; angles >= 360 degress get clamped - * to the canonical interval <0, 360). - * - * - */ -void -clutter_behaviour_ellipse_set_angle_start (ClutterBehaviourEllipse *self, - gdouble angle_start) -{ - ClutterBehaviourEllipsePrivate *priv; - gdouble new_angle; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self)); - - new_angle = clamp_angle (angle_start); - - priv = self->priv; - - if (priv->angle_start != new_angle) - { - priv->angle_start = new_angle; - g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_ANGLE_START]); - } -} - -/** - * clutter_behaviour_ellipse_get_angle_start: - * @self: a #ClutterBehaviourEllipse - * - * Gets the angle at which movements starts. - * - * Return value: angle in degrees - * - * - */ -gdouble -clutter_behaviour_ellipse_get_angle_start (ClutterBehaviourEllipse *self) -{ - g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self), 0.0); - - return self->priv->angle_start; -} - -/** - * clutter_behaviour_ellipse_set_angle_end: - * @self: a #ClutterBehaviourEllipse - * @angle_end: angle at which movement ends in degrees, between 0 and 360. - * - * Sets the angle at which movement ends; angles >= 360 degress get clamped - * to the canonical interval <0, 360). - * - * - */ -void -clutter_behaviour_ellipse_set_angle_end (ClutterBehaviourEllipse *self, - gdouble angle_end) -{ - ClutterBehaviourEllipsePrivate *priv; - gdouble new_angle; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self)); - - new_angle = clamp_angle (angle_end); - - priv = self->priv; - - if (priv->angle_end != new_angle) - { - priv->angle_end = new_angle; - - g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_ANGLE_END]); - } -} - -/** - * clutter_behaviour_ellipse_get_angle_end: - * @self: a #ClutterBehaviourEllipse - * - * Gets the at which movements ends. - * - * Return value: angle in degrees - * - * - */ -gdouble -clutter_behaviour_ellipse_get_angle_end (ClutterBehaviourEllipse *self) -{ - g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self), 0.0); - - return self->priv->angle_end; -} - -/** - * clutter_behaviour_ellipse_set_angle_tilt: - * @self: a #ClutterBehaviourEllipse - * @axis: a #ClutterRotateAxis - * @angle_tilt: tilt of the elipse around the center in the given axis in - * degrees. - * - * Sets the angle at which the ellipse should be tilted around it's center. - * - * - */ -void -clutter_behaviour_ellipse_set_angle_tilt (ClutterBehaviourEllipse *self, - ClutterRotateAxis axis, - gdouble angle_tilt) -{ - ClutterBehaviourEllipsePrivate *priv; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self)); - - priv = self->priv; - - switch (axis) - { - case CLUTTER_X_AXIS: - if (priv->angle_tilt_x != angle_tilt) - { - priv->angle_tilt_x = angle_tilt; - - g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_ANGLE_TILT_X]); - } - break; - - case CLUTTER_Y_AXIS: - if (priv->angle_tilt_y != angle_tilt) - { - priv->angle_tilt_y = angle_tilt; - - g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_ANGLE_TILT_Y]); - } - break; - - case CLUTTER_Z_AXIS: - if (priv->angle_tilt_z != angle_tilt) - { - priv->angle_tilt_z = angle_tilt; - - g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_ANGLE_TILT_Z]); - } - break; - } -} - -/** - * clutter_behaviour_ellipse_get_angle_tilt: - * @self: a #ClutterBehaviourEllipse - * @axis: a #ClutterRotateAxis - * - * Gets the tilt of the ellipse around the center in the given axis. - * - * Return value: angle in degrees. - * - * - */ -gdouble -clutter_behaviour_ellipse_get_angle_tilt (ClutterBehaviourEllipse *self, - ClutterRotateAxis axis) -{ - g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self), 0.0); - - switch (axis) - { - case CLUTTER_X_AXIS: - return self->priv->angle_tilt_x; - - case CLUTTER_Y_AXIS: - return self->priv->angle_tilt_y; - - case CLUTTER_Z_AXIS: - return self->priv->angle_tilt_z; - } - - return 0.0; -} - -/** - * clutter_behaviour_ellipse_set_tilt: - * @self: a #ClutterBehaviourEllipse - * @angle_tilt_x: tilt of the elipse around the center in X axis in degrees. - * @angle_tilt_y: tilt of the elipse around the center in Y axis in degrees. - * @angle_tilt_z: tilt of the elipse around the center in Z axis in degrees. - * - * Sets the angles at which the ellipse should be tilted around it's center. - * - * - */ -void -clutter_behaviour_ellipse_set_tilt (ClutterBehaviourEllipse *self, - gdouble angle_tilt_x, - gdouble angle_tilt_y, - gdouble angle_tilt_z) -{ - ClutterBehaviourEllipsePrivate *priv; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self)); - - priv = self->priv; - - g_object_freeze_notify (G_OBJECT (self)); - - if (priv->angle_tilt_x != angle_tilt_x) - { - priv->angle_tilt_x = angle_tilt_x; - - g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_ANGLE_TILT_X]); - } - - if (priv->angle_tilt_y != angle_tilt_y) - { - priv->angle_tilt_y = angle_tilt_y; - - g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_ANGLE_TILT_Y]); - } - - if (priv->angle_tilt_z != angle_tilt_z) - { - priv->angle_tilt_z = angle_tilt_z; - - g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_ANGLE_TILT_Z]); - } - - g_object_thaw_notify (G_OBJECT (self)); -} - -/** - * clutter_behaviour_ellipse_get_tilt: - * @self: a #ClutterBehaviourEllipse - * @angle_tilt_x: (out): return location for tilt angle on the X axis, or %NULL. - * @angle_tilt_y: (out): return location for tilt angle on the Y axis, or %NULL. - * @angle_tilt_z: (out): return location for tilt angle on the Z axis, or %NULL. - * - * Gets the tilt of the ellipse around the center in Y axis. - * - * - */ -void -clutter_behaviour_ellipse_get_tilt (ClutterBehaviourEllipse *self, - gdouble *angle_tilt_x, - gdouble *angle_tilt_y, - gdouble *angle_tilt_z) -{ - ClutterBehaviourEllipsePrivate *priv; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self)); - - priv = self->priv; - - if (angle_tilt_x) - *angle_tilt_x = priv->angle_tilt_x; - - if (angle_tilt_y) - *angle_tilt_y = priv->angle_tilt_y; - - if (angle_tilt_z) - *angle_tilt_z = priv->angle_tilt_z; -} - -/** - * clutter_behaviour_ellipse_get_direction: - * @self: a #ClutterBehaviourEllipse - * - * Retrieves the #ClutterRotateDirection used by the ellipse behaviour. - * - * Return value: the rotation direction - * - * - */ -ClutterRotateDirection -clutter_behaviour_ellipse_get_direction (ClutterBehaviourEllipse *self) -{ - g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self), - CLUTTER_ROTATE_CW); - - return self->priv->direction; -} - -/** - * clutter_behaviour_ellipse_set_direction: - * @self: a #ClutterBehaviourEllipse - * @direction: the rotation direction - * - * Sets the rotation direction used by the ellipse behaviour. - * - * - */ -void -clutter_behaviour_ellipse_set_direction (ClutterBehaviourEllipse *self, - ClutterRotateDirection direction) -{ - ClutterBehaviourEllipsePrivate *priv; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self)); - - priv = self->priv; - - if (priv->direction != direction) - { - priv->direction = direction; - - g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_DIRECTION]); - } -} diff --git a/clutter/deprecated/clutter-behaviour-ellipse.h b/clutter/deprecated/clutter-behaviour-ellipse.h deleted file mode 100644 index e00915daf..000000000 --- a/clutter/deprecated/clutter-behaviour-ellipse.h +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Tomas Frydrych - * - * Copyright (C) 2007 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_BEHAVIOUR_ELLIPSE_H__ -#define __CLUTTER_BEHAVIOUR_ELLIPSE_H__ - -#include - -G_BEGIN_DECLS - -#define CLUTTER_TYPE_BEHAVIOUR_ELLIPSE (clutter_behaviour_ellipse_get_type ()) - -#define CLUTTER_BEHAVIOUR_ELLIPSE(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - CLUTTER_TYPE_BEHAVIOUR_ELLIPSE, ClutterBehaviourEllipse)) - -#define CLUTTER_BEHAVIOUR_ELLIPSE_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), \ - CLUTTER_TYPE_BEHAVIOUR_ELLIPSE, ClutterBehaviourEllipseClass)) - -#define CLUTTER_IS_BEHAVIOUR_ELLIPSE(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - CLUTTER_TYPE_BEHAVIOUR_ELLIPSE)) - -#define CLUTTER_IS_BEHAVIOUR_ELLIPSE_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - CLUTTER_TYPE_BEHAVIOUR_ELLIPSE)) - -#define CLUTTER_BEHAVIOUR_ELLIPSE_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), \ - CLUTTER_TYPE_BEHAVIOUR_ELLIPSE, ClutterBehaviourEllipseClass)) - -typedef struct _ClutterBehaviourEllipse ClutterBehaviourEllipse; -typedef struct _ClutterBehaviourEllipsePrivate ClutterBehaviourEllipsePrivate; -typedef struct _ClutterBehaviourEllipseClass ClutterBehaviourEllipseClass; - -/** - * ClutterBehaviourEllipse: - * - * The #ClutterBehaviourEllipse struct contains only private data - * and should be accessed using the provided API - * - * - * - * Deprecated: 1.6 - */ -struct _ClutterBehaviourEllipse -{ - /*< private >*/ - ClutterBehaviour parent_instance; - ClutterBehaviourEllipsePrivate *priv; -}; - -/** - * ClutterBehaviourEllipseClass: - * - * The #ClutterBehaviourEllipseClass struct contains only private data - * - * - * - * Deprecated: 1.6 - */ -struct _ClutterBehaviourEllipseClass -{ - /*< private >*/ - ClutterBehaviourClass parent_class; -}; - -CLUTTER_DEPRECATED_IN_1_8 -GType clutter_behaviour_ellipse_get_type (void) G_GNUC_CONST; - -CLUTTER_DEPRECATED_IN_1_8_FOR(clutter_actor_animate) -ClutterBehaviour * clutter_behaviour_ellipse_new (ClutterAlpha *alpha, - gint x, - gint y, - gint width, - gint height, - ClutterRotateDirection direction, - gdouble start, - gdouble end); - -CLUTTER_DEPRECATED_IN_1_8 -void clutter_behaviour_ellipse_set_center (ClutterBehaviourEllipse *self, - gint x, - gint y); -CLUTTER_DEPRECATED_IN_1_8 -void clutter_behaviour_ellipse_get_center (ClutterBehaviourEllipse *self, - gint *x, - gint *y); -CLUTTER_DEPRECATED_IN_1_6 -void clutter_behaviour_ellipse_set_width (ClutterBehaviourEllipse *self, - gint width); -CLUTTER_DEPRECATED_IN_1_6 -gint clutter_behaviour_ellipse_get_width (ClutterBehaviourEllipse *self); -CLUTTER_DEPRECATED_IN_1_6 -void clutter_behaviour_ellipse_set_height (ClutterBehaviourEllipse *self, - gint height); -CLUTTER_DEPRECATED_IN_1_6 -gint clutter_behaviour_ellipse_get_height (ClutterBehaviourEllipse *self); -CLUTTER_DEPRECATED_IN_1_6 -void clutter_behaviour_ellipse_set_angle_start (ClutterBehaviourEllipse *self, - gdouble angle_start); -CLUTTER_DEPRECATED_IN_1_6 -gdouble clutter_behaviour_ellipse_get_angle_start (ClutterBehaviourEllipse *self); -CLUTTER_DEPRECATED_IN_1_6 -void clutter_behaviour_ellipse_set_angle_end (ClutterBehaviourEllipse *self, - gdouble angle_end); -CLUTTER_DEPRECATED_IN_1_6 -gdouble clutter_behaviour_ellipse_get_angle_end (ClutterBehaviourEllipse *self); -CLUTTER_DEPRECATED_IN_1_6 -void clutter_behaviour_ellipse_set_angle_tilt (ClutterBehaviourEllipse *self, - ClutterRotateAxis axis, - gdouble angle_tilt); -CLUTTER_DEPRECATED_IN_1_6 -gdouble clutter_behaviour_ellipse_get_angle_tilt (ClutterBehaviourEllipse *self, - ClutterRotateAxis axis); -CLUTTER_DEPRECATED_IN_1_6 -void clutter_behaviour_ellipse_set_tilt (ClutterBehaviourEllipse *self, - gdouble angle_tilt_x, - gdouble angle_tilt_y, - gdouble angle_tilt_z); -CLUTTER_DEPRECATED_IN_1_6 -void clutter_behaviour_ellipse_get_tilt (ClutterBehaviourEllipse *self, - gdouble *angle_tilt_x, - gdouble *angle_tilt_y, - gdouble *angle_tilt_z); -CLUTTER_DEPRECATED_IN_1_6 -ClutterRotateDirection clutter_behaviour_ellipse_get_direction (ClutterBehaviourEllipse *self); -CLUTTER_DEPRECATED_IN_1_6 -void clutter_behaviour_ellipse_set_direction (ClutterBehaviourEllipse *self, - ClutterRotateDirection direction); - -G_END_DECLS - -#endif /* __CLUTTER_BEHAVIOUR_ELLIPSE_H__ */ diff --git a/clutter/deprecated/clutter-behaviour-opacity.c b/clutter/deprecated/clutter-behaviour-opacity.c deleted file mode 100644 index 7a687ffe1..000000000 --- a/clutter/deprecated/clutter-behaviour-opacity.c +++ /dev/null @@ -1,322 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * Copyright (C) 2006 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -/** - * SECTION:clutter-behaviour-opacity - * @Title: ClutterBehaviourOpacity - * @short_description: A behaviour controlling opacity - * @Deprecated: 1.6: Use clutter_actor_animate() instead. - * - * #ClutterBehaviourOpacity controls the opacity of a set of actors. - * - * - * - * Deprecated: 1.6: Use the #ClutterActor:opacity property and - * clutter_actor_animate(), or #ClutterAnimator, or #ClutterState - * instead. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#define CLUTTER_DISABLE_DEPRECATION_WARNINGS - -#include "clutter-alpha.h" -#include "clutter-behaviour.h" -#include "clutter-behaviour-opacity.h" -#include "clutter-private.h" -#include "clutter-debug.h" - -G_DEFINE_TYPE (ClutterBehaviourOpacity, - clutter_behaviour_opacity, - CLUTTER_TYPE_BEHAVIOUR); - -struct _ClutterBehaviourOpacityPrivate -{ - guint8 opacity_start; - guint8 opacity_end; -}; - -#define CLUTTER_BEHAVIOUR_OPACITY_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \ - CLUTTER_TYPE_BEHAVIOUR_OPACITY, \ - ClutterBehaviourOpacityPrivate)) - -enum -{ - PROP_0, - - PROP_OPACITY_START, - PROP_OPACITY_END, - - PROP_LAST -}; - -static GParamSpec *obj_props[PROP_LAST]; - -static void -alpha_notify_foreach (ClutterBehaviour *behaviour, - ClutterActor *actor, - gpointer data) -{ - clutter_actor_set_opacity (actor, GPOINTER_TO_UINT(data)); -} - -static void -clutter_behaviour_alpha_notify (ClutterBehaviour *behave, - gdouble alpha_value) -{ - ClutterBehaviourOpacityPrivate *priv; - guint8 opacity; - - priv = CLUTTER_BEHAVIOUR_OPACITY (behave)->priv; - - opacity = alpha_value - * (priv->opacity_end - priv->opacity_start) - + priv->opacity_start; - - CLUTTER_NOTE (ANIMATION, "alpha: %.4f, opacity: %u", - alpha_value, - opacity); - - clutter_behaviour_actors_foreach (behave, - alpha_notify_foreach, - GUINT_TO_POINTER ((guint) opacity)); -} - -static void -clutter_behaviour_opacity_set_property (GObject *gobject, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - ClutterBehaviourOpacity *self = CLUTTER_BEHAVIOUR_OPACITY (gobject); - - switch (prop_id) - { - case PROP_OPACITY_START: - clutter_behaviour_opacity_set_bounds (self, - g_value_get_uint (value), - self->priv->opacity_end); - break; - - case PROP_OPACITY_END: - clutter_behaviour_opacity_set_bounds (self, - self->priv->opacity_start, - g_value_get_uint (value)); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); - break; - } -} - -static void -clutter_behaviour_opacity_get_property (GObject *gobject, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - ClutterBehaviourOpacity *self = CLUTTER_BEHAVIOUR_OPACITY (gobject); - - switch (prop_id) - { - case PROP_OPACITY_START: - g_value_set_uint (value, self->priv->opacity_start); - break; - - case PROP_OPACITY_END: - g_value_set_uint (value, self->priv->opacity_end); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); - break; - } -} - -static void -clutter_behaviour_opacity_class_init (ClutterBehaviourOpacityClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - ClutterBehaviourClass *behave_class = CLUTTER_BEHAVIOUR_CLASS (klass); - GParamSpec *pspec; - - g_type_class_add_private (klass, sizeof (ClutterBehaviourOpacityPrivate)); - - gobject_class->set_property = clutter_behaviour_opacity_set_property; - gobject_class->get_property = clutter_behaviour_opacity_get_property; - - /** - * ClutterBehaviourOpacity:opacity-start: - * - * Initial opacity level of the behaviour. - * - * - * - * Deprecated: 1.6 - */ - pspec = g_param_spec_uint ("opacity-start", - P_("Opacity Start"), - P_("Initial opacity level"), - 0, 255, - 0, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_OPACITY_START] = pspec; - g_object_class_install_property (gobject_class, PROP_OPACITY_START, pspec); - - /** - * ClutterBehaviourOpacity:opacity-end: - * - * Final opacity level of the behaviour. - * - * - * - * Deprecated: 1.6 - */ - pspec = g_param_spec_uint ("opacity-end", - P_("Opacity End"), - P_("Final opacity level"), - 0, 255, - 0, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_OPACITY_END] = pspec; - g_object_class_install_property (gobject_class, PROP_OPACITY_END, pspec); - - behave_class->alpha_notify = clutter_behaviour_alpha_notify; -} - -static void -clutter_behaviour_opacity_init (ClutterBehaviourOpacity *self) -{ - self->priv = CLUTTER_BEHAVIOUR_OPACITY_GET_PRIVATE (self); - - self->priv->opacity_start = 0; - self->priv->opacity_end = 0; -} - -/** - * clutter_behaviour_opacity_new: - * @alpha: (allow-none): a #ClutterAlpha instance, or %NULL - * @opacity_start: minimum level of opacity - * @opacity_end: maximum level of opacity - * - * Creates a new #ClutterBehaviourOpacity object, driven by @alpha - * which controls the opacity property of every actor, making it - * change in the interval between @opacity_start and @opacity_end. - * - * If @alpha is not %NULL, the #ClutterBehaviour will take ownership - * of the #ClutterAlpha instance. In the case when @alpha is %NULL, - * it can be set later with clutter_behaviour_set_alpha(). - * - * Return value: the newly created #ClutterBehaviourOpacity - * - * - * - * Deprecated: 1.6 - */ -ClutterBehaviour * -clutter_behaviour_opacity_new (ClutterAlpha *alpha, - guint8 opacity_start, - guint8 opacity_end) -{ - return g_object_new (CLUTTER_TYPE_BEHAVIOUR_OPACITY, - "alpha", alpha, - "opacity-start", opacity_start, - "opacity-end", opacity_end, - NULL); -} - -/** - * clutter_behaviour_opacity_set_bounds: - * @behaviour: a #ClutterBehaviourOpacity - * @opacity_start: minimum level of opacity - * @opacity_end: maximum level of opacity - * - * Sets the initial and final levels of the opacity applied by @behaviour - * on each actor it controls. - * - * - * - * Deprecated: 1.6 - */ -void -clutter_behaviour_opacity_set_bounds (ClutterBehaviourOpacity *behaviour, - guint8 opacity_start, - guint8 opacity_end) -{ - ClutterBehaviourOpacityPrivate *priv; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_OPACITY (behaviour)); - - priv = behaviour->priv; - - g_object_freeze_notify (G_OBJECT (behaviour)); - - if (priv->opacity_start != opacity_start) - { - priv->opacity_start = opacity_start; - - g_object_notify_by_pspec (G_OBJECT (behaviour), obj_props[PROP_OPACITY_START]); - } - - if (priv->opacity_end != opacity_end) - { - priv->opacity_end = opacity_end; - - g_object_notify_by_pspec (G_OBJECT (behaviour), obj_props[PROP_OPACITY_END]); - } - - g_object_thaw_notify (G_OBJECT (behaviour)); -} - -/** - * clutter_behaviour_opacity_get_bounds: - * @behaviour: a #ClutterBehaviourOpacity - * @opacity_start: (out): return location for the minimum level of opacity, or %NULL - * @opacity_end: (out): return location for the maximum level of opacity, or %NULL - * - * Gets the initial and final levels of the opacity applied by @behaviour - * on each actor it controls. - * - * - * - * Deprecated: 1.6 - */ -void -clutter_behaviour_opacity_get_bounds (ClutterBehaviourOpacity *behaviour, - guint8 *opacity_start, - guint8 *opacity_end) -{ - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_OPACITY (behaviour)); - - if (opacity_start) - *opacity_start = behaviour->priv->opacity_start; - - if (opacity_end) - *opacity_end = behaviour->priv->opacity_end; -} diff --git a/clutter/deprecated/clutter-behaviour-opacity.h b/clutter/deprecated/clutter-behaviour-opacity.h deleted file mode 100644 index 396b3a5b5..000000000 --- a/clutter/deprecated/clutter-behaviour-opacity.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * Jorn Baayen - * Emmanuele Bassi - * - * Copyright (C) 2006 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_BEHAVIOUR_OPACITY_H__ -#define __CLUTTER_BEHAVIOUR_OPACITY_H__ - -#include - -G_BEGIN_DECLS - -#define CLUTTER_TYPE_BEHAVIOUR_OPACITY (clutter_behaviour_opacity_get_type ()) - -#define CLUTTER_BEHAVIOUR_OPACITY(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - CLUTTER_TYPE_BEHAVIOUR_OPACITY, ClutterBehaviourOpacity)) - -#define CLUTTER_BEHAVIOUR_OPACITY_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), \ - CLUTTER_TYPE_BEHAVIOUR_OPACITY, ClutterBehaviourOpacityClass)) - -#define CLUTTER_IS_BEHAVIOUR_OPACITY(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - CLUTTER_TYPE_BEHAVIOUR_OPACITY)) - -#define CLUTTER_IS_BEHAVIOUR_OPACITY_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - CLUTTER_TYPE_BEHAVIOUR_OPACITY)) - -#define CLUTTER_BEHAVIOUR_OPACITY_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), \ - CLUTTER_TYPE_BEHAVIOUR_OPACITY, ClutterBehaviourOpacityClass)) - -typedef struct _ClutterBehaviourOpacity ClutterBehaviourOpacity; -typedef struct _ClutterBehaviourOpacityPrivate ClutterBehaviourOpacityPrivate; -typedef struct _ClutterBehaviourOpacityClass ClutterBehaviourOpacityClass; - -/** - * ClutterBehaviourOpacity: - * - * The #ClutterBehaviourOpacity structure contains only private data and - * should be accessed using the provided API - * - * - * - * Deprecated: 1.6: Use clutter_actor_animate() and #ClutterActor:opacity - * instead. - */ -struct _ClutterBehaviourOpacity -{ - /*< private >*/ - ClutterBehaviour parent; - ClutterBehaviourOpacityPrivate *priv; -}; - -/** - * ClutterBehaviourOpacityClass: - * - * The #ClutterBehaviourOpacityClass structure contains only private data - * - * - * - * Deprecated: 1.6 - */ -struct _ClutterBehaviourOpacityClass -{ - /*< private >*/ - ClutterBehaviourClass parent_class; -}; - -CLUTTER_DEPRECATED_IN_1_6 -GType clutter_behaviour_opacity_get_type (void) G_GNUC_CONST; - -CLUTTER_DEPRECATED_IN_1_6_FOR(clutter_actor_animate and ClutterActor:opacity) -ClutterBehaviour *clutter_behaviour_opacity_new (ClutterAlpha *alpha, - guint8 opacity_start, - guint8 opacity_end); - -CLUTTER_DEPRECATED_IN_1_6 -void clutter_behaviour_opacity_set_bounds (ClutterBehaviourOpacity *behaviour, - guint8 opacity_start, - guint8 opacity_end); -CLUTTER_DEPRECATED_IN_1_6 -void clutter_behaviour_opacity_get_bounds (ClutterBehaviourOpacity *behaviour, - guint8 *opacity_start, - guint8 *opacity_end); - -G_END_DECLS - -#endif /* __CLUTTER_BEHAVIOUR_OPACITY_H__ */ diff --git a/clutter/deprecated/clutter-behaviour-path.c b/clutter/deprecated/clutter-behaviour-path.c deleted file mode 100644 index 8679c9585..000000000 --- a/clutter/deprecated/clutter-behaviour-path.c +++ /dev/null @@ -1,477 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By: - * Matthew Allum - * Neil Roberts - * - * Copyright (C) 2006, 2007, 2008 OpenedHand Ltd - * Copyright (C) 2009, 2010 Intel Corp - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -/** - * SECTION:clutter-behaviour-path - * @Title: ClutterBehaviourPath - * @short_description: A behaviour for moving actors along a #ClutterPath - * @Deprecated: 1.6: Use #ClutterPathConstraint and clutter_actor_animate() - * with the #ClutterPathConstraint:offset property instead. - * - * #ClutterBehaviourPath interpolates actors along a defined path. - * - * A path is described by a #ClutterPath object. The path can contain - * straight line parts and bezier curves. If the path contains - * %CLUTTER_PATH_MOVE_TO parts then the actors will jump to those - * coordinates. This can be used make disjoint paths. - * - * When creating a path behaviour in a #ClutterScript, you can specify - * the path property directly as a string. For example: - * - * |[ - * { - * "id" : "spline-path", - * "type" : "ClutterBehaviourPath", - * "path" : "M 50 50 L 100 100", - * "alpha" : { - * "timeline" : "main-timeline", - * "function" : "ramp - * } - * } - * ]| - * - * If the alpha function is a periodic function, i.e. it returns to - * 0.0 after reaching 1.0, then the actors will walk the path back to the - * starting #ClutterKnot. - * - * #ClutterBehaviourPath is available since Clutter 0.2 - * - * Deprecated: 1.6: Use #ClutterPath and #ClutterPathConstraint with - * clutter_actor_animate() instead. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#define CLUTTER_DISABLE_DEPRECATION_WARNINGS - -#include "clutter-alpha.h" -#include "clutter-behaviour.h" -#include "clutter-behaviour-path.h" -#include "clutter-bezier.h" -#include "clutter-debug.h" -#include "clutter-enum-types.h" -#include "clutter-main.h" -#include "clutter-marshal.h" -#include "clutter-private.h" -#include "clutter-script-private.h" -#include "clutter-scriptable.h" - -#include - -static void clutter_scriptable_iface_init (ClutterScriptableIface *iface); - -G_DEFINE_TYPE_WITH_CODE (ClutterBehaviourPath, - clutter_behaviour_path, - CLUTTER_TYPE_BEHAVIOUR, - G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_SCRIPTABLE, - clutter_scriptable_iface_init)); - -struct _ClutterBehaviourPathPrivate -{ - ClutterPath *path; - guint last_knot_passed; -}; - -#define CLUTTER_BEHAVIOUR_PATH_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \ - CLUTTER_TYPE_BEHAVIOUR_PATH, \ - ClutterBehaviourPathPrivate)) - -enum -{ - KNOT_REACHED, - - LAST_SIGNAL -}; - -static guint path_signals[LAST_SIGNAL] = { 0, }; - -enum -{ - PROP_0, - - PROP_PATH, - - PROP_LAST -}; - -static GParamSpec *obj_props[PROP_LAST]; - -static void -actor_apply_knot_foreach (ClutterBehaviour *behaviour, - ClutterActor *actor, - gpointer data) -{ - ClutterKnot *knot = data; - - CLUTTER_NOTE (ANIMATION, "Setting actor to %ix%i", knot->x, knot->y); - - clutter_actor_set_position (actor, knot->x, knot->y); -} - -static void -clutter_behaviour_path_alpha_notify (ClutterBehaviour *behave, - gdouble alpha_value) -{ - ClutterBehaviourPath *pathb = CLUTTER_BEHAVIOUR_PATH (behave); - ClutterBehaviourPathPrivate *priv = pathb->priv; - ClutterKnot position; - guint knot_num; - - if (priv->path) - knot_num = clutter_path_get_position (priv->path, alpha_value, &position); - else - { - memset (&position, 0, sizeof (position)); - knot_num = 0; - } - - clutter_behaviour_actors_foreach (behave, - actor_apply_knot_foreach, - &position); - - if (knot_num != priv->last_knot_passed) - { - g_signal_emit (behave, path_signals[KNOT_REACHED], 0, knot_num); - priv->last_knot_passed = knot_num; - } -} - -static void -clutter_behaviour_path_get_property (GObject *gobject, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - ClutterBehaviourPath *pathb = CLUTTER_BEHAVIOUR_PATH (gobject); - - switch (prop_id) - { - case PROP_PATH: - g_value_set_object (value, clutter_behaviour_path_get_path (pathb)); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); - break; - } -} - -static void -clutter_behaviour_path_set_property (GObject *gobject, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - ClutterBehaviourPath *pathb = CLUTTER_BEHAVIOUR_PATH (gobject); - - switch (prop_id) - { - case PROP_PATH: - clutter_behaviour_path_set_path (pathb, g_value_get_object (value)); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); - break; - } -} - -static void -clutter_behaviour_path_dispose (GObject *gobject) -{ - ClutterBehaviourPath *pathb = CLUTTER_BEHAVIOUR_PATH (gobject); - - clutter_behaviour_path_set_path (pathb, NULL); - - G_OBJECT_CLASS (clutter_behaviour_path_parent_class)->dispose (gobject); -} - -static void -clutter_behaviour_path_class_init (ClutterBehaviourPathClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - ClutterBehaviourClass *behave_class = CLUTTER_BEHAVIOUR_CLASS (klass); - GParamSpec *pspec; - - gobject_class->get_property = clutter_behaviour_path_get_property; - gobject_class->set_property = clutter_behaviour_path_set_property; - gobject_class->dispose = clutter_behaviour_path_dispose; - - pspec = g_param_spec_object ("path", - P_("Path"), - P_("The ClutterPath object representing the path " - "to animate along"), - CLUTTER_TYPE_PATH, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_PATH] = pspec; - g_object_class_install_property (gobject_class, PROP_PATH, pspec); - - /** - * ClutterBehaviourPath::knot-reached: - * @pathb: the object which received the signal - * @knot_num: the index of the #ClutterKnot reached - * - * This signal is emitted each time a node defined inside the path - * is reached. - * - * - * - * Deprecated: 1.6 - */ - path_signals[KNOT_REACHED] = - g_signal_new ("knot-reached", - G_TYPE_FROM_CLASS (gobject_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ClutterBehaviourPathClass, knot_reached), - NULL, NULL, - _clutter_marshal_VOID__UINT, - G_TYPE_NONE, 1, - G_TYPE_UINT); - - behave_class->alpha_notify = clutter_behaviour_path_alpha_notify; - - g_type_class_add_private (klass, sizeof (ClutterBehaviourPathPrivate)); -} - -static ClutterScriptableIface *parent_scriptable_iface = NULL; - -static gboolean -clutter_behaviour_path_parse_custom_node (ClutterScriptable *scriptable, - ClutterScript *script, - GValue *value, - const gchar *name, - JsonNode *node) -{ - if (strcmp ("path", name) == 0) - { - ClutterPath *path; - GValue node_value = { 0 }; - - path = g_object_ref_sink (clutter_path_new ()); - - json_node_get_value (node, &node_value); - - if (!G_VALUE_HOLDS (&node_value, G_TYPE_STRING) - || !clutter_path_set_description (path, - g_value_get_string (&node_value))) - g_warning ("Invalid path description"); - - g_value_unset (&node_value); - - g_value_init (value, G_TYPE_OBJECT); - g_value_take_object (value, path); - - return TRUE; - } - /* chain up */ - else if (parent_scriptable_iface->parse_custom_node) - return parent_scriptable_iface->parse_custom_node (scriptable, script, - value, name, node); - else - return FALSE; -} - -static void -clutter_scriptable_iface_init (ClutterScriptableIface *iface) -{ - parent_scriptable_iface = g_type_interface_peek_parent (iface); - - if (!parent_scriptable_iface) - parent_scriptable_iface - = g_type_default_interface_peek (CLUTTER_TYPE_SCRIPTABLE); - - iface->parse_custom_node = clutter_behaviour_path_parse_custom_node; -} - -static void -clutter_behaviour_path_init (ClutterBehaviourPath *self) -{ - ClutterBehaviourPathPrivate *priv; - - self->priv = priv = CLUTTER_BEHAVIOUR_PATH_GET_PRIVATE (self); - - priv->path = NULL; - priv->last_knot_passed = G_MAXUINT; -} - -/** - * clutter_behaviour_path_new: - * @alpha: (allow-none): a #ClutterAlpha instance, or %NULL - * @path: a #ClutterPath or %NULL for an empty path - * - * Creates a new path behaviour. You can use this behaviour to drive - * actors along the nodes of a path, described by @path. - * - * This will claim the floating reference on the #ClutterPath so you - * do not need to unref if it. - * - * If @alpha is not %NULL, the #ClutterBehaviour will take ownership - * of the #ClutterAlpha instance. In the case when @alpha is %NULL, - * it can be set later with clutter_behaviour_set_alpha(). - * - * Return value: (transfer full): a #ClutterBehaviour - * - * - * - * Deprecated: 1.6 - */ -ClutterBehaviour * -clutter_behaviour_path_new (ClutterAlpha *alpha, - ClutterPath *path) -{ - return g_object_new (CLUTTER_TYPE_BEHAVIOUR_PATH, - "alpha", alpha, - "path", path, - NULL); -} - -/** - * clutter_behaviour_path_new_with_description: - * @alpha: (allow-none): a #ClutterAlpha instance, or %NULL - * @desc: a string description of the path - * - * Creates a new path behaviour using the path described by @desc. See - * clutter_path_add_string() for a description of the format. - * - * If @alpha is not %NULL, the #ClutterBehaviour will take ownership - * of the #ClutterAlpha instance. In the case when @alpha is %NULL, - * it can be set later with clutter_behaviour_set_alpha(). - * - * Return value: (transfer full): a #ClutterBehaviour - * - * - * - * Deprecated: 1.6 - */ -ClutterBehaviour * -clutter_behaviour_path_new_with_description (ClutterAlpha *alpha, - const gchar *desc) -{ - return g_object_new (CLUTTER_TYPE_BEHAVIOUR_PATH, - "alpha", alpha, - "path", clutter_path_new_with_description (desc), - NULL); -} - -/** - * clutter_behaviour_path_new_with_knots: - * @alpha: (allow-none): a #ClutterAlpha instance, or %NULL - * @knots: (array length=n_knots): an array of #ClutterKnots - * @n_knots: number of entries in @knots - * - * Creates a new path behaviour that will make the actors visit all of - * the given knots in order with straight lines in between. - * - * A path will be created where the first knot is used in a - * %CLUTTER_PATH_MOVE_TO and the subsequent knots are used in - * %CLUTTER_PATH_LINE_TOs. - * - * If @alpha is not %NULL, the #ClutterBehaviour will take ownership - * of the #ClutterAlpha instance. In the case when @alpha is %NULL, - * it can be set later with clutter_behaviour_set_alpha(). - * - * Return value: (transfer full): a #ClutterBehaviour - * - * - * - * Deprecated: 1.6 - */ -ClutterBehaviour * -clutter_behaviour_path_new_with_knots (ClutterAlpha *alpha, - const ClutterKnot *knots, - guint n_knots) -{ - ClutterPath *path = clutter_path_new (); - guint i; - - if (n_knots > 0) - { - clutter_path_add_move_to (path, knots[0].x, knots[0].y); - - for (i = 1; i < n_knots; i++) - clutter_path_add_line_to (path, knots[i].x, knots[i].y); - } - - return g_object_new (CLUTTER_TYPE_BEHAVIOUR_PATH, - "alpha", alpha, - "path", path, - NULL); -} - -/** - * clutter_behaviour_path_set_path: - * @pathb: the path behaviour - * @path: the new path to follow - * - * Change the path that the actors will follow. This will take the - * floating reference on the #ClutterPath so you do not need to unref - * it. - * - * - * - * Deprecated: 1.6 - */ -void -clutter_behaviour_path_set_path (ClutterBehaviourPath *pathb, - ClutterPath *path) -{ - ClutterBehaviourPathPrivate *priv; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_PATH (pathb)); - - priv = pathb->priv; - - if (path) - g_object_ref_sink (path); - - if (priv->path) - g_object_unref (priv->path); - - priv->path = path; - - g_object_notify_by_pspec (G_OBJECT (pathb), obj_props[PROP_PATH]); -} - -/** - * clutter_behaviour_path_get_path: - * @pathb: a #ClutterBehaviourPath instance - * - * Get the current path of the behaviour - * - * Return value: (transfer none): the path - * - * - * - * Deprecated: 1.6 - */ -ClutterPath * -clutter_behaviour_path_get_path (ClutterBehaviourPath *pathb) -{ - g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR_PATH (pathb), NULL); - - return pathb->priv->path; -} diff --git a/clutter/deprecated/clutter-behaviour-path.h b/clutter/deprecated/clutter-behaviour-path.h deleted file mode 100644 index b83518def..000000000 --- a/clutter/deprecated/clutter-behaviour-path.h +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * Jorn Baayen - * Emmanuele Bassi - * - * Copyright (C) 2006 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_BEHAVIOUR_PATH_H__ -#define __CLUTTER_BEHAVIOUR_PATH_H__ - -#include -#include - -G_BEGIN_DECLS - -#define CLUTTER_TYPE_BEHAVIOUR_PATH (clutter_behaviour_path_get_type ()) - -#define CLUTTER_BEHAVIOUR_PATH(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - CLUTTER_TYPE_BEHAVIOUR_PATH, ClutterBehaviourPath)) - -#define CLUTTER_BEHAVIOUR_PATH_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), \ - CLUTTER_TYPE_BEHAVIOUR_PATH, ClutterBehaviourPathClass)) - -#define CLUTTER_IS_BEHAVIOUR_PATH(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - CLUTTER_TYPE_BEHAVIOUR_PATH)) - -#define CLUTTER_IS_BEHAVIOUR_PATH_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - CLUTTER_TYPE_BEHAVIOUR_PATH)) - -#define CLUTTER_BEHAVIOUR_PATH_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), \ - CLUTTER_TYPE_BEHAVIOUR_PATH, ClutterBehaviourPathClass)) - -typedef struct _ClutterBehaviourPath ClutterBehaviourPath; -typedef struct _ClutterBehaviourPathPrivate ClutterBehaviourPathPrivate; -typedef struct _ClutterBehaviourPathClass ClutterBehaviourPathClass; - -/** - * ClutterBehaviourPath: - * - * The #ClutterBehaviourPath structure contains only private data - * and should be accessed using the provided API - * - * - * - * Deprecated: 1.6: Use #ClutterPathConstraint and clutter_actor_animate() - * instead. - */ -struct _ClutterBehaviourPath -{ - /*< private >*/ - ClutterBehaviour parent; - ClutterBehaviourPathPrivate *priv; -}; - -/** - * ClutterBehaviourPathClass: - * @knot_reached: signal class handler for the - * ClutterBehaviourPath::knot_reached signal - * - * The #ClutterBehaviourPathClass struct contains only private data - * - * - * - * Deprecated: 1.6 - */ -struct _ClutterBehaviourPathClass -{ - /*< private >*/ - ClutterBehaviourClass parent_class; - - /*< public >*/ - void (*knot_reached) (ClutterBehaviourPath *pathb, - guint knot_num); - - /*< private >*/ - void (*_clutter_path_1) (void); - void (*_clutter_path_2) (void); - void (*_clutter_path_3) (void); - void (*_clutter_path_4) (void); -}; - -CLUTTER_DEPRECATED_IN_1_6 -GType clutter_behaviour_path_get_type (void) G_GNUC_CONST; - -CLUTTER_DEPRECATED_IN_1_6_FOR(clutter_actor_animate) -ClutterBehaviour *clutter_behaviour_path_new (ClutterAlpha *alpha, - ClutterPath *path); - -CLUTTER_DEPRECATED_IN_1_6_FOR(clutter_actor_animate) -ClutterBehaviour *clutter_behaviour_path_new_with_description - (ClutterAlpha *alpha, - const gchar *desc); - -CLUTTER_DEPRECATED_IN_1_6_FOR(clutter_actor_animate) -ClutterBehaviour *clutter_behaviour_path_new_with_knots - (ClutterAlpha *alpha, - const ClutterKnot *knots, - guint n_knots); - -CLUTTER_DEPRECATED_IN_1_6 -void clutter_behaviour_path_set_path (ClutterBehaviourPath *pathb, - ClutterPath *path); -CLUTTER_DEPRECATED_IN_1_6 -ClutterPath * clutter_behaviour_path_get_path (ClutterBehaviourPath *pathb); - -G_END_DECLS - -#endif /* __CLUTTER_BEHAVIOUR_PATH_H__ */ diff --git a/clutter/deprecated/clutter-behaviour-rotate.c b/clutter/deprecated/clutter-behaviour-rotate.c deleted file mode 100644 index 5e320a78e..000000000 --- a/clutter/deprecated/clutter-behaviour-rotate.c +++ /dev/null @@ -1,697 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * Copyright (C) 2007 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -/** - * SECTION:clutter-behaviour-rotate - * @short_description: A behaviour controlling rotation - * - * A #ClutterBehaviourRotate rotate actors between a starting and ending - * angle on a given axis. - * - * The #ClutterBehaviourRotate is available since version 0.4. - * - * Deprecated: 1.6: Use the #ClutterActor rotation properties and - * clutter_actor_animate(), or #ClutterAnimator, or #ClutterState - * instead. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#define CLUTTER_DISABLE_DEPRECATION_WARNINGS -#include "deprecated/clutter-actor.h" - -#include "clutter-alpha.h" -#include "clutter-behaviour.h" -#include "clutter-behaviour-rotate.h" -#include "clutter-debug.h" -#include "clutter-enum-types.h" -#include "clutter-main.h" -#include "clutter-private.h" - -G_DEFINE_TYPE (ClutterBehaviourRotate, - clutter_behaviour_rotate, - CLUTTER_TYPE_BEHAVIOUR); - -struct _ClutterBehaviourRotatePrivate -{ - gdouble angle_start; - gdouble angle_end; - - ClutterRotateAxis axis; - ClutterRotateDirection direction; - - gint center_x; - gint center_y; - gint center_z; -}; - -#define CLUTTER_BEHAVIOUR_ROTATE_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \ - CLUTTER_TYPE_BEHAVIOUR_ROTATE, \ - ClutterBehaviourRotatePrivate)) - -enum -{ - PROP_0, - - PROP_ANGLE_START, - PROP_ANGLE_END, - PROP_AXIS, - PROP_DIRECTION, - PROP_CENTER_X, - PROP_CENTER_Y, - PROP_CENTER_Z, - - PROP_LAST -}; - -static GParamSpec *obj_props[PROP_LAST]; - -typedef struct { - gdouble angle; -} RotateFrameClosure; - -static void -alpha_notify_foreach (ClutterBehaviour *behaviour, - ClutterActor *actor, - gpointer data) -{ - RotateFrameClosure *closure = data; - ClutterBehaviourRotate *rotate_behaviour; - ClutterBehaviourRotatePrivate *priv; - - rotate_behaviour = CLUTTER_BEHAVIOUR_ROTATE (behaviour); - priv = rotate_behaviour->priv; - - clutter_actor_set_rotation (actor, priv->axis, - closure->angle, - priv->center_x, - priv->center_y, - priv->center_z); -} - -static inline float -clamp_angle (float a) -{ - float a1, a2; - gint rounds; - - rounds = a / 360.0; - a1 = rounds * 360.0; - a2 = a - a1; - - return a2; -} - -static void -clutter_behaviour_rotate_alpha_notify (ClutterBehaviour *behaviour, - gdouble alpha_value) -{ - ClutterBehaviourRotate *rotate_behaviour; - ClutterBehaviourRotatePrivate *priv; - RotateFrameClosure closure; - gdouble start, end; - - rotate_behaviour = CLUTTER_BEHAVIOUR_ROTATE (behaviour); - priv = rotate_behaviour->priv; - - closure.angle = 0; - start = priv->angle_start; - end = priv->angle_end; - - if (priv->direction == CLUTTER_ROTATE_CW && start >= end) - end += 360.0; - else if (priv->direction == CLUTTER_ROTATE_CCW && start <= end) - end -= 360.0; - - closure.angle = (end - start) * alpha_value + start; - - clutter_behaviour_actors_foreach (behaviour, - alpha_notify_foreach, - &closure); -} - -static void -clutter_behaviour_rotate_set_property (GObject *gobject, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - ClutterBehaviourRotate *rotate; - ClutterBehaviourRotatePrivate *priv; - - rotate = CLUTTER_BEHAVIOUR_ROTATE (gobject); - priv = rotate->priv; - - switch (prop_id) - { - case PROP_ANGLE_START: - priv->angle_start = g_value_get_double (value); - break; - - case PROP_ANGLE_END: - priv->angle_end = g_value_get_double (value); - break; - - case PROP_AXIS: - priv->axis = g_value_get_enum (value); - break; - - case PROP_DIRECTION: - priv->direction = g_value_get_enum (value); - break; - - case PROP_CENTER_X: - clutter_behaviour_rotate_set_center (rotate, - g_value_get_int (value), - priv->center_y, - priv->center_z); - break; - - case PROP_CENTER_Y: - clutter_behaviour_rotate_set_center (rotate, - priv->center_x, - g_value_get_int (value), - priv->center_z); - break; - - case PROP_CENTER_Z: - clutter_behaviour_rotate_set_center (rotate, - priv->center_x, - priv->center_y, - g_value_get_int (value)); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); - break; - } -} - -static void -clutter_behaviour_rotate_get_property (GObject *gobject, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - ClutterBehaviourRotatePrivate *priv; - - priv = CLUTTER_BEHAVIOUR_ROTATE (gobject)->priv; - - switch (prop_id) - { - case PROP_ANGLE_START: - g_value_set_double (value, priv->angle_start); - break; - - case PROP_ANGLE_END: - g_value_set_double (value, priv->angle_end); - break; - - case PROP_AXIS: - g_value_set_enum (value, priv->axis); - break; - - case PROP_DIRECTION: - g_value_set_enum (value, priv->direction); - break; - - case PROP_CENTER_X: - g_value_set_int (value, priv->center_x); - break; - - case PROP_CENTER_Y: - g_value_set_int (value, priv->center_y); - break; - - case PROP_CENTER_Z: - g_value_set_int (value, priv->center_z); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); - break; - } -} - -static void -clutter_behaviour_rotate_class_init (ClutterBehaviourRotateClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - ClutterBehaviourClass *behaviour_class = CLUTTER_BEHAVIOUR_CLASS (klass); - GParamSpec *pspec = NULL; - - g_type_class_add_private (klass, sizeof (ClutterBehaviourRotatePrivate)); - - gobject_class->set_property = clutter_behaviour_rotate_set_property; - gobject_class->get_property = clutter_behaviour_rotate_get_property; - - behaviour_class->alpha_notify = clutter_behaviour_rotate_alpha_notify; - - /** - * ClutterBehaviourRotate:angle-start: - * - * The initial angle from whence the rotation should start. - * - * - */ - pspec = g_param_spec_double ("angle-start", - P_("Angle Begin"), - P_("Initial angle"), - 0.0, 360.0, - 0.0, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_ANGLE_START] = pspec; - g_object_class_install_property (gobject_class, - PROP_ANGLE_START, - pspec); - - /** - * ClutterBehaviourRotate:angle-end: - * - * The final angle to where the rotation should end. - * - * - */ - pspec = g_param_spec_double ("angle-end", - P_("Angle End"), - P_("Final angle"), - 0.0, 360.0, - 0.0, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_ANGLE_END] = pspec; - g_object_class_install_property (gobject_class, - PROP_ANGLE_END, - pspec); - - /** - * ClutterBehaviourRotate:axis: - * - * The axis of rotation. - * - * - */ - pspec = g_param_spec_enum ("axis", - P_("Axis"), - P_("Axis of rotation"), - CLUTTER_TYPE_ROTATE_AXIS, - CLUTTER_Z_AXIS, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_AXIS] = pspec; - g_object_class_install_property (gobject_class, - PROP_AXIS, - pspec); - - /** - * ClutterBehaviourRotate:direction: - * - * The direction of the rotation. - * - * - */ - pspec = g_param_spec_enum ("direction", - P_("Direction"), - P_("Direction of rotation"), - CLUTTER_TYPE_ROTATE_DIRECTION, - CLUTTER_ROTATE_CW, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_DIRECTION] = pspec; - g_object_class_install_property (gobject_class, - PROP_DIRECTION, - pspec); - - /** - * ClutterBehaviourRotate:center-x: - * - * The x center of rotation. - * - * - */ - pspec = g_param_spec_int ("center-x", - P_("Center X"), - P_("X coordinate of the center of rotation"), - -G_MAXINT, G_MAXINT, - 0, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_CENTER_X] = pspec; - g_object_class_install_property (gobject_class, - PROP_CENTER_X, - pspec); - - /** - * ClutterBehaviourRotate:center-y: - * - * The y center of rotation. - * - * - */ - pspec = g_param_spec_int ("center-y", - P_("Center Y"), - P_("Y coordinate of the center of rotation"), - -G_MAXINT, G_MAXINT, - 0, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_CENTER_Y] = pspec; - g_object_class_install_property (gobject_class, - PROP_CENTER_Y, - pspec); - - /** - * ClutterBehaviourRotate:center-z: - * - * The z center of rotation. - * - * - */ - pspec = g_param_spec_int ("center-z", - P_("Center Z"), - P_("Z coordinate of the center of rotation"), - -G_MAXINT, G_MAXINT, - 0, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_CENTER_Z] = pspec; - g_object_class_install_property (gobject_class, - PROP_CENTER_Z, - pspec); -} - -static void -clutter_behaviour_rotate_init (ClutterBehaviourRotate *rotate) -{ - ClutterBehaviourRotatePrivate *priv; - - rotate->priv = priv = CLUTTER_BEHAVIOUR_ROTATE_GET_PRIVATE (rotate); - - priv->angle_start = priv->angle_end = 0; - - priv->axis = CLUTTER_Z_AXIS; - - priv->direction = CLUTTER_ROTATE_CW; - - priv->center_x = priv->center_y = priv->center_z = 0; -} - -/** - * clutter_behaviour_rotate_new: - * @alpha: (allow-none): a #ClutterAlpha instance, or %NULL - * @axis: the rotation axis - * @direction: the rotation direction - * @angle_start: the starting angle in degrees, between 0 and 360. - * @angle_end: the final angle in degrees, between 0 and 360. - * - * Creates a new #ClutterBehaviourRotate. This behaviour will rotate actors - * bound to it on @axis, following @direction, between @angle_start and - * @angle_end. Angles >= 360 degrees will be clamped to the canonical interval - * <0, 360), if angle_start == angle_end, the behaviour will carry out a - * single rotation of 360 degrees. - * - * If @alpha is not %NULL, the #ClutterBehaviour will take ownership - * of the #ClutterAlpha instance. In the case when @alpha is %NULL, - * it can be set later with clutter_behaviour_set_alpha(). - * - * Return value: the newly created #ClutterBehaviourRotate. - * - * - */ -ClutterBehaviour * -clutter_behaviour_rotate_new (ClutterAlpha *alpha, - ClutterRotateAxis axis, - ClutterRotateDirection direction, - gdouble angle_start, - gdouble angle_end) -{ - g_return_val_if_fail (alpha == NULL || CLUTTER_IS_ALPHA (alpha), NULL); - - return g_object_new (CLUTTER_TYPE_BEHAVIOUR_ROTATE, - "alpha", alpha, - "axis", axis, - "direction", direction, - "angle-start", angle_start, - "angle-end", angle_end, - NULL); -} - -/** - * clutter_behaviour_rotate_get_axis: - * @rotate: a #ClutterBehaviourRotate - * - * Retrieves the #ClutterRotateAxis used by the rotate behaviour. - * - * Return value: the rotation axis - * - * - */ -ClutterRotateAxis -clutter_behaviour_rotate_get_axis (ClutterBehaviourRotate *rotate) -{ - g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR_ROTATE (rotate), CLUTTER_Z_AXIS); - - return rotate->priv->axis; -} - -/** - * clutter_behaviour_rotate_set_axis: - * @rotate: a #ClutterBehaviourRotate - * @axis: a #ClutterRotateAxis - * - * Sets the axis used by the rotate behaviour. - * - * - */ -void -clutter_behaviour_rotate_set_axis (ClutterBehaviourRotate *rotate, - ClutterRotateAxis axis) -{ - ClutterBehaviourRotatePrivate *priv; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ROTATE (rotate)); - - priv = rotate->priv; - - if (priv->axis != axis) - { - priv->axis = axis; - - g_object_notify_by_pspec (G_OBJECT (rotate), obj_props[PROP_AXIS]); - } -} - -/** - * clutter_behaviour_rotate_get_direction: - * @rotate: a #ClutterBehaviourRotate - * - * Retrieves the #ClutterRotateDirection used by the rotate behaviour. - * - * Return value: the rotation direction - * - * - */ -ClutterRotateDirection -clutter_behaviour_rotate_get_direction (ClutterBehaviourRotate *rotate) -{ - g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR_ROTATE (rotate), - CLUTTER_ROTATE_CW); - - return rotate->priv->direction; -} - -/** - * clutter_behaviour_rotate_set_direction: - * @rotate: a #ClutterBehaviourRotate - * @direction: the rotation direction - * - * Sets the rotation direction used by the rotate behaviour. - * - * - */ -void -clutter_behaviour_rotate_set_direction (ClutterBehaviourRotate *rotate, - ClutterRotateDirection direction) -{ - ClutterBehaviourRotatePrivate *priv; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ROTATE (rotate)); - - priv = rotate->priv; - - if (priv->direction != direction) - { - priv->direction = direction; - - g_object_notify_by_pspec (G_OBJECT (rotate), obj_props[PROP_DIRECTION]); - } -} - -/** - * clutter_behaviour_rotate_get_bounds: - * @rotate: a #ClutterBehaviourRotate - * @angle_start: (out): return value for the initial angle - * @angle_end: (out): return value for the final angle - * - * Retrieves the rotation boundaries of the rotate behaviour. - * - * - */ -void -clutter_behaviour_rotate_get_bounds (ClutterBehaviourRotate *rotate, - gdouble *angle_start, - gdouble *angle_end) -{ - ClutterBehaviourRotatePrivate *priv; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ROTATE (rotate)); - - priv = rotate->priv; - - if (angle_start) - *angle_start = priv->angle_start; - - if (angle_end) - *angle_end = priv->angle_end; -} - -/** - * clutter_behaviour_rotate_set_bounds: - * @rotate: a #ClutterBehaviourRotate - * @angle_start: initial angle in degrees, between 0 and 360. - * @angle_end: final angle in degrees, between 0 and 360. - * - * Sets the initial and final angles of a rotation behaviour; angles >= 360 - * degrees get clamped to the canonical interval <0, 360). - * - * - */ -void -clutter_behaviour_rotate_set_bounds (ClutterBehaviourRotate *rotate, - gdouble angle_start, - gdouble angle_end) -{ - ClutterBehaviourRotatePrivate *priv; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ROTATE (rotate)); - - priv = rotate->priv; - - g_object_freeze_notify (G_OBJECT (rotate)); - - if (priv->angle_start != angle_start) - { - priv->angle_start = clamp_angle (angle_start); - - g_object_notify_by_pspec (G_OBJECT (rotate), obj_props[PROP_ANGLE_START]); - } - - if (priv->angle_end != angle_end) - { - priv->angle_end = clamp_angle (angle_end); - - g_object_notify_by_pspec (G_OBJECT (rotate), obj_props[PROP_ANGLE_END]); - } - - g_object_thaw_notify (G_OBJECT (rotate)); -} - -/** - * clutter_behaviour_rotate_set_center: - * @rotate: a #ClutterBehaviourRotate - * @x: X axis center of rotation - * @y: Y axis center of rotation - * @z: Z axis center of rotation - * - * Sets the center of rotation. The coordinates are relative to the plane - * normal to the rotation axis set with clutter_behaviour_rotate_set_axis(). - * - * - */ -void -clutter_behaviour_rotate_set_center (ClutterBehaviourRotate *rotate, - gint x, - gint y, - gint z) -{ - ClutterBehaviourRotatePrivate *priv; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ROTATE (rotate)); - - priv = rotate->priv; - - g_object_freeze_notify (G_OBJECT (rotate)); - - if (priv->center_x != x) - { - priv->center_x = x; - g_object_notify_by_pspec (G_OBJECT (rotate), obj_props[PROP_CENTER_X]); - } - - if (priv->center_y != y) - { - priv->center_y = y; - g_object_notify_by_pspec (G_OBJECT (rotate), obj_props[PROP_CENTER_Y]); - } - - if (priv->center_z != z) - { - priv->center_z = z; - g_object_notify_by_pspec (G_OBJECT (rotate), obj_props[PROP_CENTER_Z]); - } - - g_object_thaw_notify (G_OBJECT (rotate)); -} - -/** - * clutter_behaviour_rotate_get_center: - * @rotate: a #ClutterBehaviourRotate - * @x: (out): return location for the X center of rotation - * @y: (out): return location for the Y center of rotation - * @z: (out): return location for the Z center of rotation - * - * Retrieves the center of rotation set using - * clutter_behaviour_rotate_set_center(). - * - * - */ -void -clutter_behaviour_rotate_get_center (ClutterBehaviourRotate *rotate, - gint *x, - gint *y, - gint *z) -{ - ClutterBehaviourRotatePrivate *priv; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ROTATE (rotate)); - - priv = rotate->priv; - - if (x) - *x = priv->center_x; - - if (y) - *y = priv->center_y; - - if (z) - *z = priv->center_z; -} diff --git a/clutter/deprecated/clutter-behaviour-rotate.h b/clutter/deprecated/clutter-behaviour-rotate.h deleted file mode 100644 index dc63abb71..000000000 --- a/clutter/deprecated/clutter-behaviour-rotate.h +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * Copyright (C) 2007 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_BEHAVIOUR_ROTATE_H__ -#define __CLUTTER_BEHAVIOUR_ROTATE_H__ - -#include - -G_BEGIN_DECLS - -#define CLUTTER_TYPE_BEHAVIOUR_ROTATE (clutter_behaviour_rotate_get_type ()) -#define CLUTTER_BEHAVIOUR_ROTATE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_BEHAVIOUR_ROTATE, ClutterBehaviourRotate)) -#define CLUTTER_IS_BEHAVIOUR_ROTATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_BEHAVIOUR_ROTATE)) -#define CLUTTER_BEHAVIOUR_ROTATE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_BEHAVIOUR_ROTATE, ClutterBehaviourRotateClass)) -#define CLUTTER_IS_BEHAVIOUR_ROTATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_BEHAVIOUR_ROTATE)) -#define CLUTTER_BEHAVIOUR_ROTATE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((klass), CLUTTER_TYPE_BEHAVIOUR_ROTATE, ClutterBehaviourRotateClass)) - -typedef struct _ClutterBehaviourRotate ClutterBehaviourRotate; -typedef struct _ClutterBehaviourRotatePrivate ClutterBehaviourRotatePrivate; -typedef struct _ClutterBehaviourRotateClass ClutterBehaviourRotateClass; - -/** - * ClutterBehaviourRotate: - * - * The #ClutterBehaviourRotate struct contains only private data and - * should be accessed using the provided API - * - * - * - * Deprecated: 1.6: Use clutter_actor_animate() instead. - */ -struct _ClutterBehaviourRotate -{ - /*< private >*/ - ClutterBehaviour parent_instance; - - ClutterBehaviourRotatePrivate *priv; -}; - -/** - * ClutterBehaviourRotateClass: - * - * The #ClutterBehaviourRotateClass struct contains only private data - * - * - * - * Deprecated: 1.6 - */ -struct _ClutterBehaviourRotateClass -{ - /*< private >*/ - ClutterBehaviourClass parent_class; -}; - -CLUTTER_DEPRECATED_IN_1_6 -GType clutter_behaviour_rotate_get_type (void) G_GNUC_CONST; - -CLUTTER_DEPRECATED_IN_1_6_FOR(clutter_actor_animate) -ClutterBehaviour * clutter_behaviour_rotate_new (ClutterAlpha *alpha, - ClutterRotateAxis axis, - ClutterRotateDirection direction, - gdouble angle_start, - gdouble angle_end); -CLUTTER_DEPRECATED_IN_1_6 -void clutter_behaviour_rotate_get_center (ClutterBehaviourRotate *rotate, - gint *x, - gint *y, - gint *z); -CLUTTER_DEPRECATED_IN_1_6 -void clutter_behaviour_rotate_set_center (ClutterBehaviourRotate *rotate, - gint x, - gint y, - gint z); -CLUTTER_DEPRECATED_IN_1_6 -ClutterRotateAxis clutter_behaviour_rotate_get_axis (ClutterBehaviourRotate *rotate); -CLUTTER_DEPRECATED_IN_1_6 -void clutter_behaviour_rotate_set_axis (ClutterBehaviourRotate *rotate, - ClutterRotateAxis axis); -CLUTTER_DEPRECATED_IN_1_6 -ClutterRotateDirection clutter_behaviour_rotate_get_direction (ClutterBehaviourRotate *rotate); -CLUTTER_DEPRECATED_IN_1_6 -void clutter_behaviour_rotate_set_direction (ClutterBehaviourRotate *rotate, - ClutterRotateDirection direction); -CLUTTER_DEPRECATED_IN_1_6 -void clutter_behaviour_rotate_get_bounds (ClutterBehaviourRotate *rotate, - gdouble *angle_start, - gdouble *angle_end); -CLUTTER_DEPRECATED_IN_1_6 -void clutter_behaviour_rotate_set_bounds (ClutterBehaviourRotate *rotate, - gdouble angle_start, - gdouble angle_end); - -G_END_DECLS - -#endif /* __CLUTTER_BEHAVIOUR_ROTATE_H__ */ diff --git a/clutter/deprecated/clutter-behaviour-scale.c b/clutter/deprecated/clutter-behaviour-scale.c deleted file mode 100644 index 3ae43d6a6..000000000 --- a/clutter/deprecated/clutter-behaviour-scale.c +++ /dev/null @@ -1,443 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * Copyright (C) 2006 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -/** - * SECTION:clutter-behaviour-scale - * @Title: ClutterBehaviourScale - * @short_description: A behaviour controlling scale - * @Deprecated: 1.6: Use clutter_actor_animate() with #ClutterActor:scale-x - * and #ClutterActor:scale-y instead. - * - * A #ClutterBehaviourScale interpolates actors size between two values. - * - * Deprecated: 1.6: Use the #ClutterActor:scale-x and #ClutterActor:scale-y - * properties, and clutter_actor_animate(), or #ClutterAnimator or - * #ClutterState instead. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#define CLUTTER_DISABLE_DEPRECATION_WARNINGS -#include "deprecated/clutter-actor.h" - -#include "clutter-alpha.h" -#include "clutter-behaviour.h" -#include "clutter-behaviour-scale.h" -#include "clutter-debug.h" -#include "clutter-main.h" -#include "clutter-private.h" - -G_DEFINE_TYPE (ClutterBehaviourScale, - clutter_behaviour_scale, - CLUTTER_TYPE_BEHAVIOUR); - -struct _ClutterBehaviourScalePrivate -{ - gdouble x_scale_start; - gdouble y_scale_start; - - gdouble x_scale_end; - gdouble y_scale_end; -}; - -#define CLUTTER_BEHAVIOUR_SCALE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_BEHAVIOUR_SCALE, ClutterBehaviourScalePrivate)) - -enum -{ - PROP_0, - - PROP_X_SCALE_START, - PROP_Y_SCALE_START, - PROP_X_SCALE_END, - PROP_Y_SCALE_END, - - PROP_LAST -}; - -static GParamSpec *obj_props[PROP_LAST]; - -typedef struct { - gdouble scale_x; - gdouble scale_y; -} ScaleFrameClosure; - -static void -scale_frame_foreach (ClutterBehaviour *behaviour, - ClutterActor *actor, - gpointer data) -{ - ScaleFrameClosure *closure = data; - - clutter_actor_set_scale (actor, closure->scale_x, closure->scale_y); -} - -static void -clutter_behaviour_scale_alpha_notify (ClutterBehaviour *behave, - gdouble alpha_value) -{ - ClutterBehaviourScalePrivate *priv; - ScaleFrameClosure closure = { 0, }; - - priv = CLUTTER_BEHAVIOUR_SCALE (behave)->priv; - - /* Fix the start/end values, avoids potential rounding errors on large - * values. - */ - if (alpha_value == 1.0) - { - closure.scale_x = priv->x_scale_end; - closure.scale_y = priv->y_scale_end; - } - else if (alpha_value == 0) - { - closure.scale_x = priv->x_scale_start; - closure.scale_y = priv->y_scale_start; - } - else - { - closure.scale_x = (priv->x_scale_end - priv->x_scale_start) - * alpha_value - + priv->x_scale_start; - - closure.scale_y = (priv->y_scale_end - priv->y_scale_start) - * alpha_value - + priv->y_scale_start; - } - - clutter_behaviour_actors_foreach (behave, - scale_frame_foreach, - &closure); -} - -static void -clutter_behaviour_scale_set_property (GObject *gobject, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - ClutterBehaviourScalePrivate *priv; - - priv = CLUTTER_BEHAVIOUR_SCALE (gobject)->priv; - - switch (prop_id) - { - case PROP_X_SCALE_START: - priv->x_scale_start = g_value_get_double (value); - break; - - case PROP_X_SCALE_END: - priv->x_scale_end = g_value_get_double (value); - break; - - case PROP_Y_SCALE_START: - priv->y_scale_start = g_value_get_double (value); - break; - - case PROP_Y_SCALE_END: - priv->y_scale_end = g_value_get_double (value); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); - break; - } -} - -static void -clutter_behaviour_scale_get_property (GObject *gobject, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - ClutterBehaviourScalePrivate *priv; - - priv = CLUTTER_BEHAVIOUR_SCALE (gobject)->priv; - - switch (prop_id) - { - case PROP_X_SCALE_START: - g_value_set_double (value, priv->x_scale_start); - break; - - case PROP_X_SCALE_END: - g_value_set_double (value, priv->x_scale_end); - break; - - case PROP_Y_SCALE_START: - g_value_set_double (value, priv->y_scale_start); - break; - - case PROP_Y_SCALE_END: - g_value_set_double (value, priv->y_scale_end); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); - break; - } -} - -static void -clutter_behaviour_scale_class_init (ClutterBehaviourScaleClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - ClutterBehaviourClass *behave_class = CLUTTER_BEHAVIOUR_CLASS (klass); - GParamSpec *pspec = NULL; - - g_type_class_add_private (klass, sizeof (ClutterBehaviourScalePrivate)); - - gobject_class->set_property = clutter_behaviour_scale_set_property; - gobject_class->get_property = clutter_behaviour_scale_get_property; - - /** - * ClutterBehaviourScale:x-scale-start: - * - * The initial scaling factor on the X axis for the actors. - * - * - * - * Deprecated: 1.6 - */ - pspec = g_param_spec_double ("x-scale-start", - P_("X Start Scale"), - P_("Initial scale on the X axis"), - 0.0, G_MAXDOUBLE, - 1.0, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_X_SCALE_START] = pspec; - g_object_class_install_property (gobject_class, - PROP_X_SCALE_START, - pspec); - /** - * ClutterBehaviourScale:x-scale-end: - * - * The final scaling factor on the X axis for the actors. - * - * - * - * Deprecated: 1.6 - */ - pspec = g_param_spec_double ("x-scale-end", - P_("X End Scale"), - P_("Final scale on the X axis"), - 0.0, G_MAXDOUBLE, - 1.0, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_X_SCALE_END] = pspec; - g_object_class_install_property (gobject_class, - PROP_X_SCALE_END, - pspec); - /** - * ClutterBehaviourScale:y-scale-start: - * - * The initial scaling factor on the Y axis for the actors. - * - * - * - * Deprecated: 1.6 - */ - pspec = g_param_spec_double ("y-scale-start", - P_("Y Start Scale"), - P_("Initial scale on the Y axis"), - 0.0, G_MAXDOUBLE, - 1.0, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_Y_SCALE_START] = pspec; - g_object_class_install_property (gobject_class, - PROP_Y_SCALE_START, - pspec); - /** - * ClutterBehaviourScale:y-scale-end: - * - * The final scaling factor on the Y axis for the actors. - * - * - * - * Deprecated: 1.6 - */ - pspec = g_param_spec_double ("y-scale-end", - P_("Y End Scale"), - P_("Final scale on the Y axis"), - 0.0, G_MAXDOUBLE, - 1.0, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_Y_SCALE_END] = pspec; - g_object_class_install_property (gobject_class, - PROP_Y_SCALE_END, - pspec); - - behave_class->alpha_notify = clutter_behaviour_scale_alpha_notify; -} - -static void -clutter_behaviour_scale_init (ClutterBehaviourScale *self) -{ - ClutterBehaviourScalePrivate *priv; - - self->priv = priv = CLUTTER_BEHAVIOUR_SCALE_GET_PRIVATE (self); - - priv->x_scale_start = priv->x_scale_end = 1.0; - priv->y_scale_start = priv->y_scale_end = 1.0; -} - -/** - * clutter_behaviour_scale_new: - * @alpha: (allow-none): a #ClutterAlpha instance, or %NULL - * @x_scale_start: initial scale factor on the X axis - * @y_scale_start: initial scale factor on the Y axis - * @x_scale_end: final scale factor on the X axis - * @y_scale_end: final scale factor on the Y axis - * - * Creates a new #ClutterBehaviourScale instance. - * - * If @alpha is not %NULL, the #ClutterBehaviour will take ownership - * of the #ClutterAlpha instance. In the case when @alpha is %NULL, - * it can be set later with clutter_behaviour_set_alpha(). - * - * Return value: (transfer full): the newly created #ClutterBehaviourScale - * - * - * - * Deprecated: 1.6 - */ -ClutterBehaviour * -clutter_behaviour_scale_new (ClutterAlpha *alpha, - gdouble x_scale_start, - gdouble y_scale_start, - gdouble x_scale_end, - gdouble y_scale_end) -{ - g_return_val_if_fail (alpha == NULL || CLUTTER_IS_ALPHA (alpha), NULL); - - return g_object_new (CLUTTER_TYPE_BEHAVIOUR_SCALE, - "alpha", alpha, - "x-scale-start", x_scale_start, - "y-scale-start", y_scale_start, - "x-scale-end", x_scale_end, - "y-scale-end", y_scale_end, - NULL); -} - -/** - * clutter_behaviour_scale_set_bounds: - * @scale: a #ClutterBehaviourScale - * @x_scale_start: initial scale factor on the X axis - * @y_scale_start: initial scale factor on the Y axis - * @x_scale_end: final scale factor on the X axis - * @y_scale_end: final scale factor on the Y axis - * - * Sets the bounds used by scale behaviour. - * - * - * - * Deprecated: 1.6 - */ -void -clutter_behaviour_scale_set_bounds (ClutterBehaviourScale *scale, - gdouble x_scale_start, - gdouble y_scale_start, - gdouble x_scale_end, - gdouble y_scale_end) -{ - ClutterBehaviourScalePrivate *priv; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_SCALE (scale)); - - priv = scale->priv; - - g_object_freeze_notify (G_OBJECT (scale)); - - if (priv->x_scale_start != x_scale_start) - { - priv->x_scale_start = x_scale_start; - g_object_notify_by_pspec (G_OBJECT (scale), obj_props[PROP_X_SCALE_START]); - } - - if (priv->y_scale_start != y_scale_start) - { - priv->y_scale_start = y_scale_start; - g_object_notify_by_pspec (G_OBJECT (scale), obj_props[PROP_Y_SCALE_START]); - } - - if (priv->x_scale_end != x_scale_end) - { - priv->x_scale_end = x_scale_end; - g_object_notify_by_pspec (G_OBJECT (scale), obj_props[PROP_X_SCALE_END]); - } - - if (priv->y_scale_end != y_scale_end) - { - priv->y_scale_end = y_scale_end; - g_object_notify_by_pspec (G_OBJECT (scale), obj_props[PROP_Y_SCALE_END]); - } - - g_object_thaw_notify (G_OBJECT (scale)); -} - -/** - * clutter_behaviour_scale_get_bounds: - * @scale: a #ClutterBehaviourScale - * @x_scale_start: (out): return location for the initial scale factor on the X - * axis, or %NULL - * @y_scale_start: (out): return location for the initial scale factor on the Y - * axis, or %NULL - * @x_scale_end: (out): return location for the final scale factor on the X axis, - * or %NULL - * @y_scale_end: (out): return location for the final scale factor on the Y axis, - * or %NULL - * - * Retrieves the bounds used by scale behaviour. - * - * - * - * Deprecated: 1.6 - */ -void -clutter_behaviour_scale_get_bounds (ClutterBehaviourScale *scale, - gdouble *x_scale_start, - gdouble *y_scale_start, - gdouble *x_scale_end, - gdouble *y_scale_end) -{ - ClutterBehaviourScalePrivate *priv; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_SCALE (scale)); - - priv = scale->priv; - - if (x_scale_start) - *x_scale_start = priv->x_scale_start; - - if (x_scale_end) - *x_scale_end = priv->x_scale_end; - - if (y_scale_start) - *y_scale_start = priv->y_scale_start; - - if (y_scale_end) - *y_scale_end = priv->y_scale_end; -} diff --git a/clutter/deprecated/clutter-behaviour-scale.h b/clutter/deprecated/clutter-behaviour-scale.h deleted file mode 100644 index f1083a2d1..000000000 --- a/clutter/deprecated/clutter-behaviour-scale.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * Jorn Baayen - * Emmanuele Bassi - * - * Copyright (C) 2006 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_BEHAVIOUR_SCALE_H__ -#define __CLUTTER_BEHAVIOUR_SCALE_H__ - -#include - -G_BEGIN_DECLS - -#define CLUTTER_TYPE_BEHAVIOUR_SCALE (clutter_behaviour_scale_get_type ()) -#define CLUTTER_BEHAVIOUR_SCALE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_BEHAVIOUR_SCALE, ClutterBehaviourScale)) -#define CLUTTER_BEHAVIOUR_SCALE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_BEHAVIOUR_SCALE, ClutterBehaviourScaleClass)) -#define CLUTTER_IS_BEHAVIOUR_SCALE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_BEHAVIOUR_SCALE)) -#define CLUTTER_IS_BEHAVIOUR_SCALE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_BEHAVIOUR_SCALE)) -#define CLUTTER_BEHAVIOUR_SCALE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_BEHAVIOUR_SCALE, ClutterBehaviourScaleClass)) - -typedef struct _ClutterBehaviourScale ClutterBehaviourScale; -typedef struct _ClutterBehaviourScalePrivate ClutterBehaviourScalePrivate; -typedef struct _ClutterBehaviourScaleClass ClutterBehaviourScaleClass; - -/** - * ClutterBehaviourScale: - * - * The #ClutterBehaviourScale struct contains only private data and - * should be accessed using the provided API - * - * - * - * Deprecated: 1.6: Use clutter_actor_animate() with #ClutterActor:scale-x - * and #ClutterActor:scale-y instead. - */ -struct _ClutterBehaviourScale -{ - /*< private >*/ - ClutterBehaviour parent_instance; - - ClutterBehaviourScalePrivate *priv; -}; - -/** - * ClutterBehaviourScaleClass: - * - * The #ClutterBehaviourScaleClass struct contains only private data - * - * - * - * Deprecated: 1.6 - */ -struct _ClutterBehaviourScaleClass -{ - /*< private >*/ - ClutterBehaviourClass parent_class; -}; - -CLUTTER_DEPRECATED_IN_1_6 -GType clutter_behaviour_scale_get_type (void) G_GNUC_CONST; - -CLUTTER_DEPRECATED_IN_1_6_FOR(clutter_actor_animate with ClutterActor:scale-x and ClutterActor:scale-y) -ClutterBehaviour *clutter_behaviour_scale_new (ClutterAlpha *alpha, - gdouble x_scale_start, - gdouble y_scale_start, - gdouble x_scale_end, - gdouble y_scale_end); - -CLUTTER_DEPRECATED_IN_1_6 -void clutter_behaviour_scale_set_bounds (ClutterBehaviourScale *scale, - gdouble x_scale_start, - gdouble y_scale_start, - gdouble x_scale_end, - gdouble y_scale_end); -CLUTTER_DEPRECATED_IN_1_6 -void clutter_behaviour_scale_get_bounds (ClutterBehaviourScale *scale, - gdouble *x_scale_start, - gdouble *y_scale_start, - gdouble *x_scale_end, - gdouble *y_scale_end); - -G_END_DECLS - -#endif /* __CLUTTER_BEHAVIOUR_SCALE_H__ */ diff --git a/clutter/deprecated/clutter-behaviour.c b/clutter/deprecated/clutter-behaviour.c deleted file mode 100644 index ae94cd817..000000000 --- a/clutter/deprecated/clutter-behaviour.c +++ /dev/null @@ -1,669 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * Copyright (C) 2006 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -/** - * SECTION:clutter-behaviour - * @Title: ClutterBehaviour - * @short_description: Class for providing behaviours to actors - * @Deprecated: 1.6: Use clutter_actor_animate(), #ClutterAnimator or - * #ClutterState instead - * - * #ClutterBehaviour is the base class for implementing behaviours. A - * behaviour is a controller object for #ClutterActors; you can - * use a behaviour to control one or more properties of an actor (such - * as its opacity, or its position). A #ClutterBehaviour is driven by - * an "alpha function" stored inside a #ClutterAlpha object; an alpha - * function is a function depending solely on time. The alpha function - * computes a value which is then applied to the properties of the - * actors driven by a behaviour. - * - * Clutter provides some pre-defined behaviours, like #ClutterBehaviourPath, - * which controls the position of a set of actors making them "walk" along - * a set of nodes; #ClutterBehaviourOpacity, which controls the opacity - * of a set of actors; #ClutterBehaviourScale, which controls the width - * and height of a set of actors. - * - * To visualize the effects of different alpha functions on a - * #ClutterBehaviour implementation it is possible to take the - * #ClutterBehaviourPath as an example: - * - *
- * Effects of alpha functions on a path - * - *
- * - * The actors position between the path's end points directly correlates - * to the #ClutterAlpha's current alpha value driving the behaviour. With - * the #ClutterAlpha's function set to a linear ramp the actor - * will follow the path at a constant velocity, but when changing to - * a sine wave the actor initially accelerates before quickly - * decelerating. - * - * In order to implement a new behaviour you should subclass #ClutterBehaviour - * and override the "alpha_notify" virtual function; inside the overridden - * function you should obtain the alpha value from the #ClutterAlpha - * instance bound to the behaviour and apply it to the desiderd property - * (or properties) of every actor controlled by the behaviour. - * - * #ClutterBehaviour is available since Clutter 0.2. - * - * #ClutterBehaviour and its sub-classes have been deprecated since Clutter - * 1.6. You should see the - * migration guide for more information on migrating code from using - * the #ClutterBehaviour API to the animation framework API. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#define CLUTTER_DISABLE_DEPRECATION_WARNINGS -#include "clutter-behaviour.h" -#include "clutter-alpha.h" - -#include "clutter-debug.h" -#include "clutter-main.h" -#include "clutter-marshal.h" -#include "clutter-private.h" -#include "clutter-scriptable.h" -#include "clutter-script-private.h" - -static void clutter_scriptable_iface_init (ClutterScriptableIface *iface); - -G_DEFINE_ABSTRACT_TYPE_WITH_CODE (ClutterBehaviour, - clutter_behaviour, - G_TYPE_OBJECT, - G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_SCRIPTABLE, - clutter_scriptable_iface_init)); - -struct _ClutterBehaviourPrivate -{ - ClutterAlpha *alpha; - - guint notify_id; - GSList *actors; -}; - -enum -{ - PROP_0, - PROP_ALPHA, - - PROP_LAST -}; - -static GParamSpec *obj_props[PROP_LAST]; - -enum { - APPLIED, - REMOVED, - LAST_SIGNAL -}; - -static guint behave_signals[LAST_SIGNAL] = { 0 }; - -#define CLUTTER_BEHAVIOUR_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \ - CLUTTER_TYPE_BEHAVIOUR, \ - ClutterBehaviourPrivate)) - -static gboolean -clutter_behaviour_parse_custom_node (ClutterScriptable *scriptable, - ClutterScript *script, - GValue *value, - const gchar *name, - JsonNode *node) -{ - if (strncmp (name, "alpha", 5) == 0) - { - GObject *alpha; - - alpha = _clutter_script_parse_alpha (script, node); - if (alpha != NULL) - { - g_value_init (value, CLUTTER_TYPE_ALPHA); - g_value_set_object (value, alpha); - - return TRUE; - } - } - - return FALSE; -} - -static void -clutter_scriptable_iface_init (ClutterScriptableIface *iface) -{ - iface->parse_custom_node = clutter_behaviour_parse_custom_node; -} - -static void -clutter_behaviour_dispose (GObject *gobject) -{ - ClutterBehaviour *self = CLUTTER_BEHAVIOUR (gobject); - - clutter_behaviour_set_alpha (self, NULL); - clutter_behaviour_remove_all (self); - - G_OBJECT_CLASS (clutter_behaviour_parent_class)->dispose (gobject); -} - -static void -clutter_behaviour_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - ClutterBehaviour *behaviour = CLUTTER_BEHAVIOUR (object); - - switch (prop_id) - { - case PROP_ALPHA: - clutter_behaviour_set_alpha (behaviour, g_value_get_object (value)); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -clutter_behaviour_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - ClutterBehaviour *behaviour = CLUTTER_BEHAVIOUR (object); - ClutterBehaviourPrivate *priv = behaviour->priv; - - switch (prop_id) - { - case PROP_ALPHA: - g_value_set_object (value, priv->alpha); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -clutter_behaviour_alpha_notify_unimplemented (ClutterBehaviour *behaviour, - gdouble alpha_value) -{ - g_warning ("ClutterBehaviourClass::alpha_notify not implemented for '%s'", - g_type_name (G_TYPE_FROM_INSTANCE (behaviour))); -} - -static void -clutter_behaviour_class_init (ClutterBehaviourClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - - object_class->dispose = clutter_behaviour_dispose; - object_class->set_property = clutter_behaviour_set_property; - object_class->get_property = clutter_behaviour_get_property; - - /** - * ClutterBehaviour:alpha: - * - * The #ClutterAlpha object used to drive this behaviour. A #ClutterAlpha - * object binds a #ClutterTimeline and a function which computes a value - * (the "alpha") depending on the time. Each time the alpha value changes - * the alpha-notify virtual function is called. - * - * - * - * Deprecated: 1.6 - */ - obj_props[PROP_ALPHA] = - g_param_spec_object ("alpha", - P_("Alpha"), - P_("Alpha Object to drive the behaviour"), - CLUTTER_TYPE_ALPHA, - CLUTTER_PARAM_READWRITE); - - g_object_class_install_properties (object_class, - PROP_LAST, - obj_props); - - klass->alpha_notify = clutter_behaviour_alpha_notify_unimplemented; - - /** - * ClutterBehaviour::applied: - * @behaviour: the #ClutterBehaviour that received the signal - * @actor: the actor the behaviour was applied to. - * - * The ::apply signal is emitted each time the behaviour is applied - * to an actor. - * - * - * - * Deprecated: 1.6 - */ - behave_signals[APPLIED] = - g_signal_new ("applied", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (ClutterBehaviourClass, applied), - NULL, NULL, - _clutter_marshal_VOID__OBJECT, - G_TYPE_NONE, 1, - CLUTTER_TYPE_ACTOR); - /** - * ClutterBehaviour::removed: - * @behaviour: the #ClutterBehaviour that received the signal - * @actor: the removed actor - * - * The ::removed signal is emitted each time a behaviour is not applied - * to an actor anymore. - * - * - * - * Deprecated: 1.6 - */ - behave_signals[REMOVED] = - g_signal_new ("removed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (ClutterBehaviourClass, removed), - NULL, NULL, - _clutter_marshal_VOID__OBJECT, - G_TYPE_NONE, 1, - CLUTTER_TYPE_ACTOR); - - g_type_class_add_private (klass, sizeof (ClutterBehaviourPrivate)); -} - -static void -clutter_behaviour_init (ClutterBehaviour *self) -{ - self->priv = CLUTTER_BEHAVIOUR_GET_PRIVATE (self); -} - -static void -remove_actor_on_destroy (ClutterActor *actor, - ClutterBehaviour *behaviour) -{ - clutter_behaviour_remove (behaviour, actor); -} - -/** - * clutter_behaviour_apply: - * @behave: a #ClutterBehaviour - * @actor: a #ClutterActor - * - * Applies @behave to @actor. This function adds a reference on - * the actor. - * - * - * - * Deprecated: 1.6 - */ -void -clutter_behaviour_apply (ClutterBehaviour *behave, - ClutterActor *actor) -{ - ClutterBehaviourPrivate *priv; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR (behave)); - g_return_if_fail (CLUTTER_IS_ACTOR (actor)); - - priv = behave->priv; - - if (g_slist_find (priv->actors, actor)) - { - g_warning ("The behaviour of type %s already applies " - "to the actor of type %s", - g_type_name (G_OBJECT_TYPE (behave)), - g_type_name (G_OBJECT_TYPE (actor))); - return; - } - - priv->actors = g_slist_append (priv->actors, g_object_ref (actor)); - g_signal_connect (actor, "destroy", - G_CALLBACK (remove_actor_on_destroy), - behave); - - g_signal_emit (behave, behave_signals[APPLIED], 0, actor); -} - -/** - * clutter_behaviour_is_applied: - * @behave: a #ClutterBehaviour - * @actor: a #ClutterActor - * - * Check if @behave applied to @actor. - * - * Return value: TRUE if actor has behaviour. FALSE otherwise. - * - * - * - * Deprecated: 1.6 - */ -gboolean -clutter_behaviour_is_applied (ClutterBehaviour *behave, - ClutterActor *actor) -{ - g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR (behave), FALSE); - g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), FALSE); - - return (g_slist_find (behave->priv->actors, actor) != NULL); -} - -/** - * clutter_behaviour_remove: - * @behave: a #ClutterBehaviour - * @actor: a #ClutterActor - * - * Removes @actor from the list of #ClutterActors to which - * @behave applies. This function removes a reference on the actor. - * - * - * - * Deprecated: 1.6 - */ -void -clutter_behaviour_remove (ClutterBehaviour *behave, - ClutterActor *actor) -{ - ClutterBehaviourPrivate *priv; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR (behave)); - g_return_if_fail (CLUTTER_IS_ACTOR (actor)); - - priv = behave->priv; - - if (!g_slist_find (priv->actors, actor)) - { - g_warning ("The behaviour of type %s is not applied " - "to the actor of type %s", - g_type_name (G_OBJECT_TYPE (behave)), - g_type_name (G_OBJECT_TYPE (actor))); - return; - } - - g_signal_handlers_disconnect_by_func (actor, - G_CALLBACK (remove_actor_on_destroy), - behave); - - priv->actors = g_slist_remove (priv->actors, actor); - - g_signal_emit (behave, behave_signals[REMOVED], 0, actor); - - g_object_unref (actor); -} - -/** - * clutter_behaviour_get_n_actors: - * @behave: a #ClutterBehaviour - * - * Gets the number of actors this behaviour is applied too. - * - * Return value: The number of applied actors - * - * - * - * Deprecated: 1.6 - */ -gint -clutter_behaviour_get_n_actors (ClutterBehaviour *behave) -{ - g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR (behave), 0); - - return g_slist_length (behave->priv->actors); -} - -/** - * clutter_behaviour_get_nth_actor: - * @behave: a #ClutterBehaviour - * @index_: the index of an actor this behaviour is applied too. - * - * Gets an actor the behaviour was applied to referenced by index num. - * - * Return value: (transfer none): A Clutter actor or NULL if @index_ is invalid. - * - * - * - * Deprecated: 1.6 - */ -ClutterActor * -clutter_behaviour_get_nth_actor (ClutterBehaviour *behave, - gint index_) -{ - g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR (behave), NULL); - - return g_slist_nth_data (behave->priv->actors, index_); -} - - -/** - * clutter_behaviour_actors_foreach: - * @behave: a #ClutterBehaviour - * @func: (scope call): a function called for each actor - * @data: optional data to be passed to the function, or %NULL - * - * Calls @func for every actor driven by @behave. - * - * - * - * Deprecated: 1.6 - */ -void -clutter_behaviour_actors_foreach (ClutterBehaviour *behave, - ClutterBehaviourForeachFunc func, - gpointer data) -{ - GSList *l; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR (behave)); - g_return_if_fail (func != NULL); - - for (l = behave->priv->actors; l != NULL; l = l->next) - { - ClutterActor *actor = l->data; - - g_assert (CLUTTER_IS_ACTOR (actor)); - - func (behave, actor, data); - } -} - -/** - * clutter_behaviour_get_alpha: - * @behave: a #ClutterBehaviour - * - * Retrieves the #ClutterAlpha object bound to @behave. - * - * Return value: (transfer none): a #ClutterAlpha object, or %NULL if no alpha - * object has been bound to this behaviour. - * - * - * - * Deprecated: 1.6 - */ -ClutterAlpha * -clutter_behaviour_get_alpha (ClutterBehaviour *behave) -{ - g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR (behave), NULL); - - return behave->priv->alpha; -} - -static void -notify_cb (GObject *object, - GParamSpec *param_spec, - ClutterBehaviour *behave) -{ - ClutterBehaviourClass *klass; - - klass = CLUTTER_BEHAVIOUR_GET_CLASS (behave); - - CLUTTER_NOTE (ANIMATION, "notify::alpha"); - - /* no actors, we can stop right here */ - if (behave->priv->actors == NULL) - return; - - if (klass->alpha_notify != NULL) - { - gdouble alpha_value = clutter_alpha_get_alpha (behave->priv->alpha); - - CLUTTER_NOTE (ANIMATION, "calling %s::alpha_notify (%p, %.4f)", - g_type_name (G_TYPE_FROM_CLASS (klass)), - behave, alpha_value); - - klass->alpha_notify (behave, alpha_value); - } -} - -/** - * clutter_behaviour_set_alpha: - * @behave: a #ClutterBehaviour - * @alpha: a #ClutterAlpha or %NULL to unset a previously set alpha - * - * Binds @alpha to a #ClutterBehaviour. The #ClutterAlpha object - * is what makes a behaviour work: for each tick of the timeline - * used by #ClutterAlpha a new value of the alpha parameter is - * computed by the alpha function; the value should be used by - * the #ClutterBehaviour to update one or more properties of the - * actors to which the behaviour applies. - * - * If @alpha is not %NULL, the #ClutterBehaviour will take ownership - * of the #ClutterAlpha instance. - * - * - * - * Deprecated: 1.6 - */ -void -clutter_behaviour_set_alpha (ClutterBehaviour *behave, - ClutterAlpha *alpha) -{ - ClutterBehaviourPrivate *priv; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR (behave)); - g_return_if_fail (alpha == NULL || CLUTTER_IS_ALPHA (alpha)); - - priv = behave->priv; - - if (priv->alpha == alpha) - return; - - if (priv->notify_id) - { - CLUTTER_NOTE (ANIMATION, "removing previous notify-id (%d)", - priv->notify_id); - - g_signal_handler_disconnect (priv->alpha, priv->notify_id); - priv->notify_id = 0; - } - - if (priv->alpha != NULL) - { - CLUTTER_NOTE (ANIMATION, "removing previous alpha object"); - - g_object_unref (priv->alpha); - priv->alpha = NULL; - } - - if (alpha != NULL) - { - priv->alpha = g_object_ref_sink (alpha); - - priv->notify_id = g_signal_connect (priv->alpha, "notify::alpha", - G_CALLBACK(notify_cb), - behave); - - CLUTTER_NOTE (ANIMATION, "setting new alpha object (%p, notify:%d)", - priv->alpha, priv->notify_id); - } - - g_object_notify_by_pspec (G_OBJECT (behave), obj_props[PROP_ALPHA]); -} - -/** - * clutter_behaviour_get_actors: - * @behave: a #ClutterBehaviour - * - * Retrieves all the actors to which @behave applies. It is not recommended - * for derived classes to use this in there alpha notify method but use - * #clutter_behaviour_actors_foreach as it avoids alot of needless allocations. - * - * Return value: (transfer container) (element-type Clutter.Actor): a list of - * actors. You should free the returned list with g_slist_free() when - * finished using it. - * - * - * - * Deprecated: 1.6 - */ -GSList * -clutter_behaviour_get_actors (ClutterBehaviour *behave) -{ - ClutterBehaviourPrivate *priv; - GSList *retval, *l; - - g_return_val_if_fail (CLUTTER_BEHAVIOUR (behave), NULL); - - priv = behave->priv; - retval = NULL; - for (l = priv->actors; l != NULL; l = l->next) - retval = g_slist_prepend (retval, l->data); - - return g_slist_reverse (retval); -} - -/** - * clutter_behaviour_remove_all: - * @behave: a #ClutterBehaviour - * - * Removes every actor from the list that @behave holds. - * - * - * - * Deprecated: 1.6 - */ -void -clutter_behaviour_remove_all (ClutterBehaviour *behave) -{ - ClutterBehaviourPrivate *priv; - GSList *l; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR (behave)); - - priv = behave->priv; - for (l = priv->actors; l != NULL; l = l->next) - { - ClutterActor *actor = l->data; - - g_signal_emit (behave, behave_signals[REMOVED], 0, actor); - g_signal_handlers_disconnect_by_func (actor, - G_CALLBACK (remove_actor_on_destroy), - behave); - g_object_unref (actor); - } - - g_slist_free (priv->actors); - priv->actors = NULL; -} diff --git a/clutter/deprecated/clutter-behaviour.h b/clutter/deprecated/clutter-behaviour.h deleted file mode 100644 index 9c3858b16..000000000 --- a/clutter/deprecated/clutter-behaviour.h +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * Jorn Baayen - * Emmanuele Bassi - * - * Copyright (C) 2006 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_BEHAVIOUR_H__ -#define __CLUTTER_BEHAVIOUR_H__ - -#include - -G_BEGIN_DECLS - -#define CLUTTER_TYPE_BEHAVIOUR clutter_behaviour_get_type() - -#define CLUTTER_BEHAVIOUR(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - CLUTTER_TYPE_BEHAVIOUR, ClutterBehaviour)) - -#define CLUTTER_BEHAVIOUR_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), \ - CLUTTER_TYPE_BEHAVIOUR, ClutterBehaviourClass)) - -#define CLUTTER_IS_BEHAVIOUR(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - CLUTTER_TYPE_BEHAVIOUR)) - -#define CLUTTER_IS_BEHAVIOUR_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - CLUTTER_TYPE_BEHAVIOUR)) - -#define CLUTTER_BEHAVIOUR_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), \ - CLUTTER_TYPE_BEHAVIOUR, ClutterBehaviourClass)) - -typedef struct _ClutterBehaviourPrivate ClutterBehaviourPrivate; -typedef struct _ClutterBehaviourClass ClutterBehaviourClass; - -/** - * ClutterBehaviourForeachFunc: - * @behaviour: the #ClutterBehaviour - * @actor: an actor driven by @behaviour - * @data: (closure): optional data passed to the function - * - * This function is passed to clutter_behaviour_actors_foreach() and - * will be called for each actor driven by @behaviour. - * - * - * - * Deprecated: 1.6 - */ -typedef void (*ClutterBehaviourForeachFunc) (ClutterBehaviour *behaviour, - ClutterActor *actor, - gpointer data); - -/** - * ClutterBehaviour: - * - * #ClutterBehaviour-struct contains only private data and should - * be accessed with the functions below. - * - * - * - * Deprecated: 1.6 - */ -struct _ClutterBehaviour -{ - /*< private >*/ - GObject parent; - ClutterBehaviourPrivate *priv; -}; - -/** - * ClutterBehaviourClass: - * @alpha_notify: virtual function, called each time the #ClutterAlpha - * computes a new alpha value; the actors to which the behaviour applies - * should be changed in this function. Every subclass of #ClutterBehaviour - * must implement this virtual function - * @applied: signal class handler for the ClutterBehaviour::applied signal - * @removed: signal class handler for the ClutterBehaviour::removed signal - * - * Base class for behaviours. - * - * - * - * Deprecated: 1.6 - */ -struct _ClutterBehaviourClass -{ - /*< private >*/ - GObjectClass parent_class; - - /*< public >*/ - /* vfunc, not signal */ - void (*alpha_notify) (ClutterBehaviour *behave, - gdouble alpha_value); - - /* signals */ - void (*applied) (ClutterBehaviour *behave, - ClutterActor *actor); - void (*removed) (ClutterBehaviour *behave, - ClutterActor *actor); - - /*< private >*/ - /* padding, for future expansion */ - void (*_clutter_behaviour1) (void); - void (*_clutter_behaviour2) (void); - void (*_clutter_behaviour3) (void); - void (*_clutter_behaviour4) (void); - void (*_clutter_behaviour5) (void); - void (*_clutter_behaviour6) (void); -}; - -CLUTTER_DEPRECATED_IN_1_6 -GType clutter_behaviour_get_type (void) G_GNUC_CONST; - -CLUTTER_DEPRECATED_IN_1_6 -void clutter_behaviour_apply (ClutterBehaviour *behave, - ClutterActor *actor); -CLUTTER_DEPRECATED_IN_1_6 -void clutter_behaviour_remove (ClutterBehaviour *behave, - ClutterActor *actor); -CLUTTER_DEPRECATED_IN_1_6 -void clutter_behaviour_remove_all (ClutterBehaviour *behave); -CLUTTER_DEPRECATED_IN_1_6 -void clutter_behaviour_actors_foreach (ClutterBehaviour *behave, - ClutterBehaviourForeachFunc func, - gpointer data); -CLUTTER_DEPRECATED_IN_1_6 -gint clutter_behaviour_get_n_actors (ClutterBehaviour *behave); -CLUTTER_DEPRECATED_IN_1_6 -ClutterActor *clutter_behaviour_get_nth_actor (ClutterBehaviour *behave, - gint index_); -CLUTTER_DEPRECATED_IN_1_6 -GSList * clutter_behaviour_get_actors (ClutterBehaviour *behave); -CLUTTER_DEPRECATED_IN_1_6 -ClutterAlpha *clutter_behaviour_get_alpha (ClutterBehaviour *behave); -CLUTTER_DEPRECATED_IN_1_6 -void clutter_behaviour_set_alpha (ClutterBehaviour *behave, - ClutterAlpha *alpha); -CLUTTER_DEPRECATED_IN_1_6 -gboolean clutter_behaviour_is_applied (ClutterBehaviour *behave, - ClutterActor *actor); - -G_END_DECLS - -#endif /* __CLUTTER_BEHAVIOUR_H__ */ diff --git a/clutter/deprecated/clutter-bin-layout.h b/clutter/deprecated/clutter-bin-layout.h deleted file mode 100644 index 2d56d1f8b..000000000 --- a/clutter/deprecated/clutter-bin-layout.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Copyright (C) 2009 Intel Corporation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - * Author: - * Emmanuele Bassi - */ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_BIN_LAYOUT_DEPRECATED_H__ -#define __CLUTTER_BIN_LAYOUT_DEPRECATED_H__ - -#include - -G_BEGIN_DECLS - -CLUTTER_DEPRECATED_IN_1_12 -void clutter_bin_layout_set_alignment (ClutterBinLayout *self, - ClutterActor *child, - ClutterBinAlignment x_align, - ClutterBinAlignment y_align); - -CLUTTER_DEPRECATED_IN_1_12 -void clutter_bin_layout_get_alignment (ClutterBinLayout *self, - ClutterActor *child, - ClutterBinAlignment *x_align, - ClutterBinAlignment *y_align); - -CLUTTER_DEPRECATED_IN_1_12 -void clutter_bin_layout_add (ClutterBinLayout *self, - ClutterActor *child, - ClutterBinAlignment x_align, - ClutterBinAlignment y_align); - -G_END_DECLS - -#endif /* __CLUTTER_BIN_LAYOUT_DEPRECATED_H__ */ diff --git a/clutter/deprecated/clutter-box.c b/clutter/deprecated/clutter-box.c deleted file mode 100644 index 6c400015b..000000000 --- a/clutter/deprecated/clutter-box.c +++ /dev/null @@ -1,737 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Copyright (C) 2009,2010 Intel Corporation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - * Author: - * Emmanuele Bassi - */ - -/** - * SECTION:clutter-box - * @short_description: A Generic layout container - * - * #ClutterBox is a #ClutterActor sub-class implementing the #ClutterContainer - * interface. A Box delegates the whole size requisition and size allocation to - * a #ClutterLayoutManager instance. - * - * - * Using ClutterBox - * The following code shows how to create a #ClutterBox with - * a #ClutterLayoutManager sub-class, and how to add children to - * it via clutter_box_pack(). - * - * ClutterActor *box; - * ClutterLayoutManager *layout; - * - * /* Create the layout manager first */ - * layout = clutter_box_layout_new (); - * clutter_box_layout_set_homogeneous (CLUTTER_BOX_LAYOUT (layout), TRUE); - * clutter_box_layout_set_spacing (CLUTTER_BOX_LAYOUT (layout), 12); - * - * /* Then create the ClutterBox actor. The Box will take - * * ownership of the ClutterLayoutManager instance by sinking - * * its floating reference - * */ - * box = clutter_box_new (layout); - * - * /* Now add children to the Box using the variadic arguments - * * function clutter_box_pack() to set layout properties - * */ - * clutter_box_pack (CLUTTER_BOX (box), actor, - * "x-align", CLUTTER_BOX_ALIGNMENT_CENTER, - * "y-align", CLUTTER_BOX_ALIGNMENT_END, - * "expand", TRUE, - * NULL); - * - * - * - * #ClutterBox's clutter_box_pack() wraps the generic - * clutter_container_add_actor() function, but it also allows setting - * layout properties while adding the new child to the box. - * - * #ClutterBox is available since Clutter 1.2 - * - * Deprecated: 1.10: Use #ClutterActor instead. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#define CLUTTER_DISABLE_DEPRECATION_WARNINGS -#include "deprecated/clutter-container.h" - -#include "clutter-box.h" - -#include "clutter-actor-private.h" -#include "clutter-color.h" -#include "clutter-debug.h" -#include "clutter-enum-types.h" -#include "clutter-marshal.h" -#include "clutter-private.h" - -#define CLUTTER_BOX_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_BOX, ClutterBoxPrivate)) - -struct _ClutterBoxPrivate -{ - ClutterLayoutManager *manager; - - guint changed_id; -}; - -enum -{ - PROP_0, - - PROP_COLOR, - PROP_COLOR_SET, - - PROP_LAST -}; - -static GParamSpec *obj_props[PROP_LAST] = { NULL, }; - -static const ClutterColor default_box_color = { 255, 255, 255, 255 }; - -G_DEFINE_TYPE (ClutterBox, clutter_box, CLUTTER_TYPE_ACTOR); - -static inline void -clutter_box_set_color_internal (ClutterBox *box, - const ClutterColor *color) -{ - clutter_actor_set_background_color (CLUTTER_ACTOR (box), color); - - g_object_notify_by_pspec (G_OBJECT (box), obj_props[PROP_COLOR_SET]); - g_object_notify_by_pspec (G_OBJECT (box), obj_props[PROP_COLOR]); -} - -static gboolean -clutter_box_real_get_paint_volume (ClutterActor *actor, - ClutterPaintVolume *volume) -{ - gboolean retval = FALSE; - ClutterActorIter iter; - ClutterActor *child; - - /* if we have a background color, and an allocation, then we need to - * set it as the base of our paint volume - */ - retval = clutter_paint_volume_set_from_allocation (volume, actor); - - /* bail out early if we don't have any child */ - if (clutter_actor_get_n_children (actor) == 0) - return retval; - - retval = TRUE; - - /* otherwise, union the paint volumes of our children, in case - * any one of them decides to paint outside the parent's allocation - */ - clutter_actor_iter_init (&iter, actor); - while (clutter_actor_iter_next (&iter, &child)) - { - const ClutterPaintVolume *child_volume; - - /* This gets the paint volume of the child transformed into the - * group's coordinate space... */ - child_volume = clutter_actor_get_transformed_paint_volume (child, actor); - if (!child_volume) - return FALSE; - - clutter_paint_volume_union (volume, child_volume); - } - - return retval; -} - -static void -clutter_box_set_property (GObject *gobject, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - ClutterBox *self = CLUTTER_BOX (gobject); - - switch (prop_id) - { - case PROP_COLOR: - clutter_box_set_color_internal (self, clutter_value_get_color (value)); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); - break; - } -} - -static void -clutter_box_get_property (GObject *gobject, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - switch (prop_id) - { - case PROP_COLOR: - { - ClutterColor color; - - clutter_actor_get_background_color (CLUTTER_ACTOR (gobject), - &color); - clutter_value_set_color (value, &color); - } - break; - - case PROP_COLOR_SET: - { - gboolean color_set; - - g_object_get (gobject, "background-color-set", &color_set, NULL); - g_value_set_boolean (value, color_set); - } - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); - break; - } -} - -static void -clutter_box_real_destroy (ClutterActor *actor) -{ - ClutterActor *iter; - - iter = clutter_actor_get_first_child (actor); - while (iter != NULL) - { - ClutterActor *next = clutter_actor_get_next_sibling (iter); - - clutter_actor_destroy (iter); - - iter = next; - } -} - -static void -clutter_box_class_init (ClutterBoxClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); - - g_type_class_add_private (klass, sizeof (ClutterBoxPrivate)); - - actor_class->destroy = clutter_box_real_destroy; - actor_class->get_paint_volume = clutter_box_real_get_paint_volume; - - gobject_class->set_property = clutter_box_set_property; - gobject_class->get_property = clutter_box_get_property; - - /** - * ClutterBox:color: - * - * The color to be used to paint the background of the - * #ClutterBox. Setting this property will set the - * #ClutterBox:color-set property as a side effect - * - * - */ - obj_props[PROP_COLOR] = - clutter_param_spec_color ("color", - P_("Color"), - P_("The background color of the box"), - &default_box_color, - CLUTTER_PARAM_READWRITE); - - /** - * ClutterBox:color-set: - * - * Whether the #ClutterBox:color property has been set - * - * - */ - obj_props[PROP_COLOR_SET] = - g_param_spec_boolean ("color-set", - P_("Color Set"), - P_("Whether the background color is set"), - FALSE, - CLUTTER_PARAM_READWRITE); - - g_object_class_install_properties (gobject_class, PROP_LAST, obj_props); -} - -static void -clutter_box_init (ClutterBox *self) -{ - self->priv = CLUTTER_BOX_GET_PRIVATE (self); -} - -/** - * clutter_box_new: - * @manager: a #ClutterLayoutManager - * - * Creates a new #ClutterBox. The children of the box will be layed - * out by the passed @manager - * - * Return value: the newly created #ClutterBox actor - * - * - * - * Deprecated: 1.10: Use clutter_actor_new() instead. - */ -ClutterActor * -clutter_box_new (ClutterLayoutManager *manager) -{ - g_return_val_if_fail (CLUTTER_IS_LAYOUT_MANAGER (manager), NULL); - - return g_object_new (CLUTTER_TYPE_BOX, - "layout-manager", manager, - NULL); -} - -/** - * clutter_box_set_layout_manager: - * @box: a #ClutterBox - * @manager: a #ClutterLayoutManager - * - * Sets the #ClutterLayoutManager for @box - * - * A #ClutterLayoutManager is a delegate object that controls the - * layout of the children of @box - * - * - * - * Deprecated: 1.10: Use clutter_actor_set_layout_manager() instead. - */ -void -clutter_box_set_layout_manager (ClutterBox *box, - ClutterLayoutManager *manager) -{ - clutter_actor_set_layout_manager (CLUTTER_ACTOR (box), manager); -} - -/** - * clutter_box_get_layout_manager: - * @box: a #ClutterBox - * - * Retrieves the #ClutterLayoutManager instance used by @box - * - * Return value: (transfer none): a #ClutterLayoutManager. The returned - * #ClutterLayoutManager is owned by the #ClutterBox and it should not - * be unreferenced - * - * - * - * Deprecated: 1.10: Use clutter_actor_get_layout_manager() instead. - */ -ClutterLayoutManager * -clutter_box_get_layout_manager (ClutterBox *box) -{ - return clutter_actor_get_layout_manager (CLUTTER_ACTOR (box)); -} - -/** - * clutter_box_packv: - * @box: a #ClutterBox - * @actor: a #ClutterActor - * @n_properties: the number of properties to set - * @properties: (array length=n_properties) (element-type utf8): a vector - * containing the property names to set - * @values: (array length=n_properties): a vector containing the property - * values to set - * - * Vector-based variant of clutter_box_pack(), intended for language - * bindings to use - * - * - * - * Deprecated: 1.10: Use clutter_actor_add_child() instead. - */ -void -clutter_box_packv (ClutterBox *box, - ClutterActor *actor, - guint n_properties, - const gchar * const properties[], - const GValue *values) -{ - ClutterLayoutManager *manager; - ClutterContainer *container; - ClutterLayoutMeta *meta; - GObjectClass *klass; - gint i; - - g_return_if_fail (CLUTTER_IS_BOX (box)); - g_return_if_fail (CLUTTER_IS_ACTOR (actor)); - - container = CLUTTER_CONTAINER (box); - clutter_container_add_actor (container, actor); - - manager = clutter_actor_get_layout_manager (CLUTTER_ACTOR (box)); - if (manager == NULL) - return; - - meta = clutter_layout_manager_get_child_meta (manager, - container, - actor); - - if (meta == NULL) - return; - - klass = G_OBJECT_GET_CLASS (meta); - - for (i = 0; i < n_properties; i++) - { - const gchar *pname = properties[i]; - GParamSpec *pspec; - - pspec = g_object_class_find_property (klass, pname); - if (pspec == NULL) - { - g_warning ("%s: the layout property '%s' for managers " - "of type '%s' (meta type '%s') does not exist", - G_STRLOC, - pname, - G_OBJECT_TYPE_NAME (manager), - G_OBJECT_TYPE_NAME (meta)); - break; - } - - if (!(pspec->flags & G_PARAM_WRITABLE)) - { - g_warning ("%s: the layout property '%s' for managers " - "of type '%s' (meta type '%s') is not writable", - G_STRLOC, - pspec->name, - G_OBJECT_TYPE_NAME (manager), - G_OBJECT_TYPE_NAME (meta)); - break; - } - - clutter_layout_manager_child_set_property (manager, - container, actor, - pname, &values[i]); - } -} - -static inline void -clutter_box_set_property_valist (ClutterBox *box, - ClutterActor *actor, - const gchar *first_property, - va_list var_args) -{ - ClutterContainer *container = CLUTTER_CONTAINER (box); - ClutterLayoutManager *manager; - ClutterLayoutMeta *meta; - GObjectClass *klass; - const gchar *pname; - - manager = clutter_actor_get_layout_manager (CLUTTER_ACTOR (box)); - if (manager == NULL) - return; - - meta = clutter_layout_manager_get_child_meta (manager, - container, - actor); - - if (meta == NULL) - return; - - klass = G_OBJECT_GET_CLASS (meta); - - pname = first_property; - while (pname) - { - GValue value = { 0, }; - GParamSpec *pspec; - gchar *error; - - pspec = g_object_class_find_property (klass, pname); - if (pspec == NULL) - { - g_warning ("%s: the layout property '%s' for managers " - "of type '%s' (meta type '%s') does not exist", - G_STRLOC, - pname, - G_OBJECT_TYPE_NAME (manager), - G_OBJECT_TYPE_NAME (meta)); - break; - } - - if (!(pspec->flags & G_PARAM_WRITABLE)) - { - g_warning ("%s: the layout property '%s' for managers " - "of type '%s' (meta type '%s') is not writable", - G_STRLOC, - pspec->name, - G_OBJECT_TYPE_NAME (manager), - G_OBJECT_TYPE_NAME (meta)); - break; - } - - G_VALUE_COLLECT_INIT (&value, G_PARAM_SPEC_VALUE_TYPE (pspec), - var_args, 0, - &error); - - if (error) - { - g_warning ("%s: %s", G_STRLOC, error); - g_free (error); - break; - } - - clutter_layout_manager_child_set_property (manager, - container, actor, - pspec->name, &value); - - g_value_unset (&value); - - pname = va_arg (var_args, gchar*); - } -} - -/** - * clutter_box_pack: - * @box: a #ClutterBox - * @actor: a #ClutterActor - * @first_property: the name of the first property to set, or %NULL - * @...: a list of property name and value pairs, terminated by %NULL - * - * Adds @actor to @box and sets layout properties at the same time, - * if the #ClutterLayoutManager used by @box has them - * - * This function is a wrapper around clutter_container_add_actor() - * and clutter_layout_manager_child_set() - * - * Language bindings should use the vector-based clutter_box_packv() - * variant instead - * - * - * - * Deprecated: 1.10: Use clutter_actor_add_child() instead. - */ -void -clutter_box_pack (ClutterBox *box, - ClutterActor *actor, - const gchar *first_property, - ...) -{ - va_list var_args; - - g_return_if_fail (CLUTTER_IS_BOX (box)); - g_return_if_fail (CLUTTER_IS_ACTOR (actor)); - - clutter_container_add_actor (CLUTTER_CONTAINER (box), actor); - - if (first_property == NULL || *first_property == '\0') - return; - - va_start (var_args, first_property); - clutter_box_set_property_valist (box, actor, first_property, var_args); - va_end (var_args); -} - -/** - * clutter_box_pack_after: - * @box: a #ClutterBox - * @actor: a #ClutterActor - * @sibling: (allow-none): a #ClutterActor or %NULL - * @first_property: the name of the first property to set, or %NULL - * @...: a list of property name and value pairs, terminated by %NULL - * - * Adds @actor to @box, placing it after @sibling, and sets layout - * properties at the same time, if the #ClutterLayoutManager used by - * @box supports them - * - * If @sibling is %NULL then @actor is placed at the end of the - * list of children, to be allocated and painted after every other child - * - * This function is a wrapper around clutter_container_add_actor(), - * clutter_container_raise_child() and clutter_layout_manager_child_set() - * - * - * - * Deprecated: 1.10: Use clutter_actor_insert_child_above() instead. - */ -void -clutter_box_pack_after (ClutterBox *box, - ClutterActor *actor, - ClutterActor *sibling, - const gchar *first_property, - ...) -{ - va_list var_args; - - g_return_if_fail (CLUTTER_IS_BOX (box)); - g_return_if_fail (CLUTTER_IS_ACTOR (actor)); - g_return_if_fail (sibling == NULL || CLUTTER_IS_ACTOR (sibling)); - - clutter_container_add_actor (CLUTTER_CONTAINER (box), actor); - clutter_container_raise_child (CLUTTER_CONTAINER (box), actor, sibling); - - if (first_property == NULL || *first_property == '\0') - return; - - va_start (var_args, first_property); - clutter_box_set_property_valist (box, actor, first_property, var_args); - va_end (var_args); -} - -/** - * clutter_box_pack_before: - * @box: a #ClutterBox - * @actor: a #ClutterActor - * @sibling: (allow-none): a #ClutterActor or %NULL - * @first_property: the name of the first property to set, or %NULL - * @...: a list of property name and value pairs, terminated by %NULL - * - * Adds @actor to @box, placing it before @sibling, and sets layout - * properties at the same time, if the #ClutterLayoutManager used by - * @box supports them - * - * If @sibling is %NULL then @actor is placed at the beginning of the - * list of children, to be allocated and painted below every other child - * - * This function is a wrapper around clutter_container_add_actor(), - * clutter_container_lower_child() and clutter_layout_manager_child_set() - * - * - * - * Deprecated: 1.10: Use clutter_actor_insert_child_below() instead. - */ -void -clutter_box_pack_before (ClutterBox *box, - ClutterActor *actor, - ClutterActor *sibling, - const gchar *first_property, - ...) -{ - va_list var_args; - - g_return_if_fail (CLUTTER_IS_BOX (box)); - g_return_if_fail (CLUTTER_IS_ACTOR (actor)); - g_return_if_fail (sibling == NULL || CLUTTER_IS_ACTOR (sibling)); - - clutter_container_add_actor (CLUTTER_CONTAINER (box), actor); - clutter_container_lower_child (CLUTTER_CONTAINER (box), actor, sibling); - - if (first_property == NULL || *first_property == '\0') - return; - - va_start (var_args, first_property); - clutter_box_set_property_valist (box, actor, first_property, var_args); - va_end (var_args); -} - -/** - * clutter_box_pack_at: - * @box: a #ClutterBox - * @actor: a #ClutterActor - * @position: the position to insert the @actor at - * @first_property: the name of the first property to set, or %NULL - * @...: a list of property name and value pairs, terminated by %NULL - * - * Adds @actor to @box, placing it at @position, and sets layout - * properties at the same time, if the #ClutterLayoutManager used by - * @box supports them - * - * If @position is a negative number, or is larger than the number of - * children of @box, the new child is added at the end of the list of - * children - * - * - * - * Deprecated: 1.10: Use clutter_actor_insert_child_at_index() instead. - */ -void -clutter_box_pack_at (ClutterBox *box, - ClutterActor *actor, - gint position, - const gchar *first_property, - ...) -{ - va_list var_args; - - g_return_if_fail (CLUTTER_IS_BOX (box)); - g_return_if_fail (CLUTTER_IS_ACTOR (actor)); - - clutter_actor_insert_child_at_index (CLUTTER_ACTOR (box), - actor, - position); - - /* we need to explicitly call this, because we're not going through - * the default code paths provided by clutter_container_add() - */ - clutter_container_create_child_meta (CLUTTER_CONTAINER (box), actor); - - g_signal_emit_by_name (box, "actor-added", actor); - - if (first_property == NULL || *first_property == '\0') - return; - - va_start (var_args, first_property); - clutter_box_set_property_valist (box, actor, first_property, var_args); - va_end (var_args); -} - -/** - * clutter_box_set_color: - * @box: a #ClutterBox - * @color: (allow-none): the background color, or %NULL to unset - * - * Sets (or unsets) the background color for @box - * - * - * - * Deprecated: 1.10: Use clutter_actor_set_background_color() instead. - */ -void -clutter_box_set_color (ClutterBox *box, - const ClutterColor *color) -{ - g_return_if_fail (CLUTTER_IS_BOX (box)); - - clutter_box_set_color_internal (box, color); -} - -/** - * clutter_box_get_color: - * @box: a #ClutterBox - * @color: (out caller-allocates): return location for a #ClutterColor - * - * Retrieves the background color of @box - * - * If the #ClutterBox:color-set property is set to %FALSE the - * returned #ClutterColor is undefined - * - * - * - * Deprecated: 1.10: Use clutter_actor_get_background_color() instead. - */ -void -clutter_box_get_color (ClutterBox *box, - ClutterColor *color) -{ - g_return_if_fail (CLUTTER_IS_BOX (box)); - g_return_if_fail (color != NULL); - - clutter_actor_get_background_color (CLUTTER_ACTOR (box), color); -} diff --git a/clutter/deprecated/clutter-box.h b/clutter/deprecated/clutter-box.h deleted file mode 100644 index bb120b8cc..000000000 --- a/clutter/deprecated/clutter-box.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Copyright (C) 2009,2010 Intel Corporation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - * Author: - * Emmanuele Bassi - */ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_BOX_H__ -#define __CLUTTER_BOX_H__ - -#include -#include -#include - -G_BEGIN_DECLS - -#define CLUTTER_TYPE_BOX (clutter_box_get_type ()) -#define CLUTTER_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_BOX, ClutterBox)) -#define CLUTTER_IS_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_BOX)) -#define CLUTTER_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_BOX, ClutterBoxClass)) -#define CLUTTER_IS_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_BOX)) -#define CLUTTER_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_BOX, ClutterBoxClass)) - -typedef struct _ClutterBox ClutterBox; -typedef struct _ClutterBoxPrivate ClutterBoxPrivate; -typedef struct _ClutterBoxClass ClutterBoxClass; - -/** - * ClutterBox: - * - * The #ClutterBox structure contains only private data and should - * be accessed using the provided API - * - * - */ -struct _ClutterBox -{ - /*< private >*/ - ClutterActor parent_instance; - - ClutterBoxPrivate *priv; -}; - -/** - * ClutterBoxClass: - * - * The #ClutterBoxClass structure contains only private data - * - * - */ -struct _ClutterBoxClass -{ - /*< private >*/ - ClutterActorClass parent_class; - - /* padding, for future expansion */ - void (*clutter_padding_1) (void); - void (*clutter_padding_2) (void); - void (*clutter_padding_3) (void); - void (*clutter_padding_4) (void); - void (*clutter_padding_5) (void); - void (*clutter_padding_6) (void); -}; - -CLUTTER_DEPRECATED_IN_1_10 -GType clutter_box_get_type (void) G_GNUC_CONST; - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_new) -ClutterActor * clutter_box_new (ClutterLayoutManager *manager); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_set_layout_manager) -void clutter_box_set_layout_manager (ClutterBox *box, - ClutterLayoutManager *manager); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_get_layout_manager) -ClutterLayoutManager *clutter_box_get_layout_manager (ClutterBox *box); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_set_background_color) -void clutter_box_set_color (ClutterBox *box, - const ClutterColor *color); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_get_background_color) -void clutter_box_get_color (ClutterBox *box, - ClutterColor *color); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_add_child) -void clutter_box_pack (ClutterBox *box, - ClutterActor *actor, - const gchar *first_property, - ...); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_add_child) -void clutter_box_packv (ClutterBox *box, - ClutterActor *actor, - guint n_properties, - const gchar * const properties[], - const GValue *values); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_insert_child_above) -void clutter_box_pack_after (ClutterBox *box, - ClutterActor *actor, - ClutterActor *sibling, - const gchar *first_property, - ...); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_insert_child_below) -void clutter_box_pack_before (ClutterBox *box, - ClutterActor *actor, - ClutterActor *sibling, - const gchar *first_property, - ...); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_insert_child_at_index) -void clutter_box_pack_at (ClutterBox *box, - ClutterActor *actor, - gint position, - const gchar *first_property, - ...); - -G_END_DECLS - -#endif /* __CLUTTER_BOX_H__ */ diff --git a/clutter/deprecated/clutter-cairo-texture.c b/clutter/deprecated/clutter-cairo-texture.c deleted file mode 100644 index e1b7e7d43..000000000 --- a/clutter/deprecated/clutter-cairo-texture.c +++ /dev/null @@ -1,1177 +0,0 @@ -/* - * Clutter - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By: Emmanuele Bassi - * Matthew Allum - * Chris Lord - * Iain Holmes - * Neil Roberts - * - * Copyright (C) 2008, 2009, 2010, 2011 Intel Corporation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -/** - * SECTION:clutter-cairo-texture - * @short_description: Texture with Cairo integration - * - * #ClutterCairoTexture is a #ClutterTexture that displays the contents - * of a Cairo context. The #ClutterCairoTexture actor will create a - * Cairo image surface which will then be uploaded to a GL texture when - * needed. - * - * Since #ClutterCairoTexture uses a Cairo image surface - * internally all the drawing operations will be performed in - * software and not using hardware acceleration. This can lead to - * performance degradation if the contents of the texture change - * frequently. - * - * In order to use a #ClutterCairoTexture you should connect to the - * #ClutterCairoTexture::draw signal; the signal is emitted each time - * the #ClutterCairoTexture has been told to invalidate its contents, - * by using clutter_cairo_texture_invalidate_rectangle() or its - * sister function, clutter_cairo_texture_invalidate(). - * - * Each callback to the #ClutterCairoTexture::draw signal will receive - * a #cairo_t context which can be used for drawing; the Cairo context - * is owned by the #ClutterCairoTexture and should not be destroyed - * explicitly. - * - * - * A simple ClutterCairoTexture canvas - * - * - * FIXME: MISSING XINCLUDE CONTENT - * - * - * - * - * #ClutterCairoTexture is available since Clutter 1.0. - * - * #ClutterCairoTexture is deprecated since Clutter 1.12. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include - -#define CLUTTER_DISABLE_DEPRECATION_WARNINGS -#include "deprecated/clutter-texture.h" -#include "deprecated/clutter-cairo-texture.h" - -#include "clutter-cairo-texture.h" - -#include "clutter-actor-private.h" -#include "clutter-cairo.h" -#include "clutter-color.h" -#include "clutter-debug.h" -#include "clutter-marshal.h" -#include "clutter-private.h" - -G_DEFINE_TYPE (ClutterCairoTexture, - clutter_cairo_texture, - CLUTTER_TYPE_TEXTURE); - -enum -{ - PROP_0, - - PROP_SURFACE_WIDTH, - PROP_SURFACE_HEIGHT, - PROP_AUTO_RESIZE, - - PROP_LAST -}; - -enum -{ - CREATE_SURFACE, - DRAW, - - LAST_SIGNAL -}; - -static GParamSpec *obj_props[PROP_LAST] = { NULL, }; - -static guint cairo_signals[LAST_SIGNAL] = { 0, }; - -#ifdef CLUTTER_ENABLE_DEBUG -#define clutter_warn_if_paint_fail(obj) G_STMT_START { \ - if (CLUTTER_ACTOR_IN_PAINT (obj)) { \ - g_warning ("%s should not be called during the paint sequence " \ - "of a ClutterCairoTexture as it will likely cause " \ - "performance issues.", G_STRFUNC); \ - } } G_STMT_END -#else -#define clutter_warn_if_paint_fail(obj) /* void */ -#endif /* CLUTTER_ENABLE_DEBUG */ - -#define CLUTTER_CAIRO_TEXTURE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_CAIRO_TEXTURE, ClutterCairoTexturePrivate)) - -struct _ClutterCairoTexturePrivate -{ - cairo_surface_t *cr_surface; - - guint surface_width; - guint surface_height; - - cairo_t *cr_context; - - guint auto_resize : 1; -}; - -typedef struct { - ClutterCairoTexture *texture; - - cairo_rectangle_int_t rect; - - guint is_clipped : 1; -} DrawContext; - -static const cairo_user_data_key_t clutter_cairo_texture_context_key; - -static DrawContext * -draw_context_create (ClutterCairoTexture *texture) -{ - DrawContext *context = g_slice_new0 (DrawContext); - - context->texture = g_object_ref (texture); - - return context; -} - -static void -draw_context_destroy (gpointer data) -{ - if (G_LIKELY (data != NULL)) - { - DrawContext *context = data; - - g_object_unref (context->texture); - - g_slice_free (DrawContext, data); - } -} - -static void -clutter_cairo_texture_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - ClutterCairoTexturePrivate *priv; - - priv = CLUTTER_CAIRO_TEXTURE (object)->priv; - - switch (prop_id) - { - case PROP_SURFACE_WIDTH: - /* we perform the resize on notify to coalesce separate - * surface-width/surface-height property set - */ - priv->surface_width = g_value_get_uint (value); - break; - - case PROP_SURFACE_HEIGHT: - priv->surface_height = g_value_get_uint (value); - break; - - case PROP_AUTO_RESIZE: - clutter_cairo_texture_set_auto_resize (CLUTTER_CAIRO_TEXTURE (object), - g_value_get_boolean (value)); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -clutter_cairo_texture_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - ClutterCairoTexturePrivate *priv; - - priv = CLUTTER_CAIRO_TEXTURE (object)->priv; - - switch (prop_id) - { - case PROP_SURFACE_WIDTH: - g_value_set_uint (value, priv->surface_width); - break; - - case PROP_SURFACE_HEIGHT: - g_value_set_uint (value, priv->surface_height); - break; - - case PROP_AUTO_RESIZE: - g_value_set_boolean (value, priv->auto_resize); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -clutter_cairo_texture_finalize (GObject *object) -{ - ClutterCairoTexturePrivate *priv = CLUTTER_CAIRO_TEXTURE (object)->priv; - - if (priv->cr_surface != NULL) - { - cairo_surface_t *surface = priv->cr_surface; - - priv->cr_surface = NULL; - - cairo_surface_finish (surface); - cairo_surface_destroy (surface); - } - - G_OBJECT_CLASS (clutter_cairo_texture_parent_class)->finalize (object); -} - -static cairo_surface_t * -get_surface (ClutterCairoTexture *self) -{ - ClutterCairoTexturePrivate *priv = self->priv; - - if (priv->cr_surface == NULL) - { - g_signal_emit (self, cairo_signals[CREATE_SURFACE], 0, - priv->surface_width, - priv->surface_height, - &priv->cr_surface); - } - - return priv->cr_surface; -} - -static void -clutter_cairo_texture_context_destroy (void *data) -{ - DrawContext *ctxt = data; - ClutterCairoTexture *cairo = ctxt->texture; - ClutterCairoTexturePrivate *priv = cairo->priv; - guint8 *cairo_data; - gint cairo_width, cairo_height, cairo_stride; - gint surface_width, surface_height; - CoglHandle cogl_texture; - - if (priv->cr_surface == NULL) - { - /* the surface went away before we could use it */ - draw_context_destroy (ctxt); - return; - } - - /* for any other surface type, we presume that there exists a native - * communication between Cairo and GL that is triggered by cairo_destroy(). - * - * for instance, cairo-drm will flush the outstanding modifications to the - * surface upon context destruction and so the texture is automatically - * updated. - */ - if (cairo_surface_get_type (priv->cr_surface) != CAIRO_SURFACE_TYPE_IMAGE) - goto out; - - surface_width = cairo_image_surface_get_width (priv->cr_surface); - surface_height = cairo_image_surface_get_height (priv->cr_surface); - - cairo_width = MIN (ctxt->rect.width, surface_width); - cairo_height = MIN (ctxt->rect.height, surface_height); - - cogl_texture = clutter_texture_get_cogl_texture (CLUTTER_TEXTURE (cairo)); - if (cairo_width == 0 || - cairo_height == 0 || - cogl_texture == COGL_INVALID_HANDLE) - { - draw_context_destroy (ctxt); - return; - } - - cairo_stride = cairo_image_surface_get_stride (priv->cr_surface); - cairo_data = cairo_image_surface_get_data (priv->cr_surface); - cairo_data += cairo_stride * ctxt->rect.y; - cairo_data += 4 * ctxt->rect.x; - - cogl_texture_set_region (cogl_texture, - 0, 0, - ctxt->rect.x, ctxt->rect.y, - cairo_width, cairo_height, - cairo_width, cairo_height, - CLUTTER_CAIRO_FORMAT_ARGB32, - cairo_stride, - cairo_data); - -out: - draw_context_destroy (ctxt); - clutter_actor_queue_redraw (CLUTTER_ACTOR (cairo)); -} - -static inline void -clutter_cairo_texture_emit_draw (ClutterCairoTexture *self, - DrawContext *ctxt) -{ - gboolean result; - cairo_t *cr; - - /* 0x0 surfaces don't need a ::draw */ - if (self->priv->surface_width == 0 || - self->priv->surface_height == 0) - return; - - /* if the size is !0 then we must have a surface */ - g_assert (self->priv->cr_surface != NULL); - - cr = cairo_create (self->priv->cr_surface); - - if (ctxt->is_clipped) - { - cairo_rectangle (cr, - ctxt->rect.x, - ctxt->rect.y, - ctxt->rect.width, - ctxt->rect.height); - cairo_clip (cr); - } - - /* store the cairo_t as a guard */ - self->priv->cr_context = cr; - - g_signal_emit (self, cairo_signals[DRAW], 0, cr, &result); - - self->priv->cr_context = NULL; - - clutter_cairo_texture_context_destroy (ctxt); - - cairo_destroy (cr); -} - -static inline void -clutter_cairo_texture_surface_resize_internal (ClutterCairoTexture *cairo) -{ - ClutterCairoTexturePrivate *priv = cairo->priv; - - if (priv->cr_surface != NULL) - { - cairo_surface_t *surface = priv->cr_surface; - - /* if the surface is an image one, and the size is already the - * same, then we don't need to do anything - */ - if (cairo_surface_get_type (surface) != CAIRO_SURFACE_TYPE_IMAGE) - { - gint surface_width = cairo_image_surface_get_width (surface); - gint surface_height = cairo_image_surface_get_height (surface); - - if (priv->surface_width == surface_width && - priv->surface_height == surface_height) - return; - } - - cairo_surface_finish (surface); - cairo_surface_destroy (surface); - priv->cr_surface = NULL; - } - - if (priv->surface_width == 0 || - priv->surface_height == 0) - return; - - g_signal_emit (cairo, cairo_signals[CREATE_SURFACE], 0, - priv->surface_width, - priv->surface_height, - &priv->cr_surface); -} - -static void -clutter_cairo_texture_notify (GObject *object, - GParamSpec *pspec) -{ - /* When the surface width or height changes then resize the cairo - surface. This is done here instead of directly in set_property so - that if both the width and height properties are set using a - single call to g_object_set then the surface will only be resized - once because the notifications will be frozen in between */ - - if (obj_props[PROP_SURFACE_WIDTH]->name == pspec->name || - obj_props[PROP_SURFACE_HEIGHT]->name == pspec->name) - { - ClutterCairoTexture *cairo = CLUTTER_CAIRO_TEXTURE (object); - - clutter_cairo_texture_surface_resize_internal (cairo); - } - - if (G_OBJECT_CLASS (clutter_cairo_texture_parent_class)->notify) - G_OBJECT_CLASS (clutter_cairo_texture_parent_class)->notify (object, pspec); -} - -static void -clutter_cairo_texture_get_preferred_width (ClutterActor *actor, - gfloat for_height, - gfloat *min_width, - gfloat *natural_width) -{ - ClutterCairoTexturePrivate *priv = CLUTTER_CAIRO_TEXTURE (actor)->priv; - - if (min_width) - *min_width = 0; - - if (natural_width) - *natural_width = (gfloat) priv->surface_width; -} - -static void -clutter_cairo_texture_get_preferred_height (ClutterActor *actor, - gfloat for_width, - gfloat *min_height, - gfloat *natural_height) -{ - ClutterCairoTexturePrivate *priv = CLUTTER_CAIRO_TEXTURE (actor)->priv; - - if (min_height) - *min_height = 0; - - if (natural_height) - *natural_height = (gfloat) priv->surface_height; -} - -static void -clutter_cairo_texture_allocate (ClutterActor *self, - const ClutterActorBox *allocation, - ClutterAllocationFlags flags) -{ - ClutterCairoTexturePrivate *priv = CLUTTER_CAIRO_TEXTURE (self)->priv; - ClutterActorClass *parent_class; - - parent_class = CLUTTER_ACTOR_CLASS (clutter_cairo_texture_parent_class); - parent_class->allocate (self, allocation, flags); - - if (priv->auto_resize) - { - ClutterCairoTexture *texture = CLUTTER_CAIRO_TEXTURE (self); - gfloat width, height; - - clutter_actor_box_get_size (allocation, &width, &height); - - priv->surface_width = ceilf (width); - priv->surface_height = ceilf (height); - - clutter_cairo_texture_surface_resize_internal (texture); - clutter_cairo_texture_invalidate (texture); - } -} - -static gboolean -clutter_cairo_texture_get_paint_volume (ClutterActor *self, - ClutterPaintVolume *volume) -{ - return _clutter_actor_set_default_paint_volume (self, - CLUTTER_TYPE_CAIRO_TEXTURE, - volume); -} - -static cairo_surface_t * -clutter_cairo_texture_create_surface (ClutterCairoTexture *self, - guint width, - guint height) -{ - cairo_surface_t *surface; - guint cairo_stride; - guint8 *cairo_data; - CoglHandle cogl_texture; - - surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, - width, - height); - - cairo_stride = cairo_image_surface_get_stride (surface); - cairo_data = cairo_image_surface_get_data (surface); - - /* create a backing Cogl texture */ - cogl_texture = cogl_texture_new_from_data (width, height, - COGL_TEXTURE_NONE, - CLUTTER_CAIRO_FORMAT_ARGB32, - COGL_PIXEL_FORMAT_ANY, - cairo_stride, - cairo_data); - clutter_texture_set_cogl_texture (CLUTTER_TEXTURE (self), cogl_texture); - cogl_handle_unref (cogl_texture); - - return surface; -} - -static gboolean -create_surface_accum (GSignalInvocationHint *ihint, - GValue *return_accu, - const GValue *handler_return, - gpointer data) -{ - g_value_copy (handler_return, return_accu); - - /* stop on the first non-NULL return value */ - return g_value_get_boxed (handler_return) == NULL; -} - -static void -clutter_cairo_texture_draw_marshaller (GClosure *closure, - GValue *return_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data) -{ - cairo_t *cr = g_value_get_boxed (¶m_values[1]); - - cairo_save (cr); - - _clutter_marshal_BOOLEAN__BOXED (closure, - return_value, - n_param_values, - param_values, - invocation_hint, - marshal_data); - - cairo_restore (cr); -} - -static void -clutter_cairo_texture_class_init (ClutterCairoTextureClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); - - gobject_class->finalize = clutter_cairo_texture_finalize; - gobject_class->set_property = clutter_cairo_texture_set_property; - gobject_class->get_property = clutter_cairo_texture_get_property; - gobject_class->notify = clutter_cairo_texture_notify; - - actor_class->get_paint_volume = - clutter_cairo_texture_get_paint_volume; - actor_class->get_preferred_width = - clutter_cairo_texture_get_preferred_width; - actor_class->get_preferred_height = - clutter_cairo_texture_get_preferred_height; - actor_class->allocate = - clutter_cairo_texture_allocate; - - klass->create_surface = clutter_cairo_texture_create_surface; - - g_type_class_add_private (gobject_class, sizeof (ClutterCairoTexturePrivate)); - - /** - * ClutterCairoTexture:surface-width: - * - * The width of the Cairo surface used by the #ClutterCairoTexture - * actor, in pixels. - * - * - * - * Deprecated: 1.12 - */ - obj_props[PROP_SURFACE_WIDTH] = - g_param_spec_uint ("surface-width", - P_("Surface Width"), - P_("The width of the Cairo surface"), - 0, G_MAXUINT, - 0, - CLUTTER_PARAM_READWRITE | - G_PARAM_DEPRECATED); - /** - * ClutterCairoTexture:surface-height: - * - * The height of the Cairo surface used by the #ClutterCairoTexture - * actor, in pixels. - * - * - * - * Deprecated: 1.12 - */ - obj_props[PROP_SURFACE_HEIGHT] = - g_param_spec_uint ("surface-height", - P_("Surface Height"), - P_("The height of the Cairo surface"), - 0, G_MAXUINT, - 0, - CLUTTER_PARAM_READWRITE | - G_PARAM_DEPRECATED); - - /** - * ClutterCairoTexture:auto-resize: - * - * Controls whether the #ClutterCairoTexture should automatically - * resize the Cairo surface whenever the actor's allocation changes. - * If :auto-resize is set to %TRUE the surface contents will also - * be invalidated automatically. - * - * - * - * Deprecated: 1.12 - */ - obj_props[PROP_AUTO_RESIZE] = - g_param_spec_boolean ("auto-resize", - P_("Auto Resize"), - P_("Whether the surface should match the allocation"), - FALSE, - CLUTTER_PARAM_READWRITE | - G_PARAM_DEPRECATED); - - g_object_class_install_properties (gobject_class, PROP_LAST, obj_props); - - /** - * ClutterCairoTexture::create-surface: - * @texture: the #ClutterCairoTexture that emitted the signal - * @width: the width of the surface to create - * @height: the height of the surface to create - * - * The ::create-surface signal is emitted when a #ClutterCairoTexture - * news its surface (re)created, which happens either when the Cairo - * context is created with clutter_cairo_texture_create() or - * clutter_cairo_texture_create_region(), or when the surface is resized - * through clutter_cairo_texture_set_surface_size(). - * - * The first signal handler that returns a non-%NULL, valid surface will - * stop any further signal emission, and the returned surface will be - * the one used. - * - * Return value: the newly created #cairo_surface_t for the texture - * - * - * - * Deprecated: 1.12 - */ - cairo_signals[CREATE_SURFACE] = - g_signal_new (I_("create-surface"), - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE, - G_STRUCT_OFFSET (ClutterCairoTextureClass, create_surface), - create_surface_accum, NULL, - _clutter_marshal_BOXED__UINT_UINT, - CAIRO_GOBJECT_TYPE_SURFACE, 2, - G_TYPE_UINT, - G_TYPE_UINT); - - /** - * ClutterCairoTexture::draw: - * @texture: the #ClutterCairoTexture that emitted the signal - * @cr: the Cairo context to use to draw - * - * The ::draw signal is emitted each time a #ClutterCairoTexture has - * been invalidated. - * - * The passed Cairo context passed will be clipped to the invalidated - * area. - * - * It is safe to connect multiple callbacks to this signals; the state - * of the Cairo context passed to each callback is automatically saved - * and restored, so it's not necessary to call cairo_save() and - * cairo_restore(). - * - * Return value: %TRUE if the signal emission should stop, and %FALSE - * to continue - * - * - * - * Deprecated: 1.12 - */ - cairo_signals[DRAW] = - g_signal_new (I_("draw"), - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE, - G_STRUCT_OFFSET (ClutterCairoTextureClass, draw), - _clutter_boolean_handled_accumulator, NULL, - clutter_cairo_texture_draw_marshaller, - G_TYPE_BOOLEAN, 1, - CAIRO_GOBJECT_TYPE_CONTEXT); -} - -static void -clutter_cairo_texture_init (ClutterCairoTexture *self) -{ - self->priv = CLUTTER_CAIRO_TEXTURE_GET_PRIVATE (self); - - /* FIXME - we are hardcoding the format; it would be good to have - * a :surface-format construct-only property for creating - * textures with a different format and have the cairo surface - * match that format - * - * priv->format = CAIRO_FORMAT_ARGB32; - */ - - /* the Cairo surface is responsible for driving the size of - * the texture; if we let sync_size to its default of TRUE, - * the Texture will try to queue a relayout every time we - * change the size of the Cairo surface - which is not what - * we want - */ - clutter_texture_set_sync_size (CLUTTER_TEXTURE (self), FALSE); -} - -/** - * clutter_cairo_texture_new: - * @width: the width of the surface - * @height: the height of the surface - * - * Creates a new #ClutterCairoTexture actor, with a surface of @width by - * @height pixels. - * - * Return value: the newly created #ClutterCairoTexture actor - * - * - * - * Deprecated: 1.12: Use #ClutterCanvas instead - */ -ClutterActor* -clutter_cairo_texture_new (guint width, - guint height) -{ - return g_object_new (CLUTTER_TYPE_CAIRO_TEXTURE, - "surface-width", width, - "surface-height", height, - NULL); -} - -static void -intersect_rectangles (cairo_rectangle_int_t *a, - cairo_rectangle_int_t *b, - cairo_rectangle_int_t *inter) -{ - gint dest_x, dest_y; - gint dest_width, dest_height; - - dest_x = MAX (a->x, b->x); - dest_y = MAX (a->y, b->y); - dest_width = MIN (a->x + a->width, b->x + b->width) - dest_x; - dest_height = MIN (a->y + a->height, b->y + b->height) - dest_y; - - if (dest_width > 0 && dest_height > 0) - { - inter->x = dest_x; - inter->y = dest_y; - inter->width = dest_width; - inter->height = dest_height; - } - else - { - inter->x = 0; - inter->y = 0; - inter->width = 0; - inter->height = 0; - } -} - -static cairo_t * -clutter_cairo_texture_create_region_internal (ClutterCairoTexture *self, - gint x_offset, - gint y_offset, - gint width, - gint height) -{ - ClutterCairoTexturePrivate *priv = self->priv; - cairo_rectangle_int_t region, area, inter; - cairo_surface_t *surface; - DrawContext *ctxt; - cairo_t *cr; - - if (width < 0) - width = priv->surface_width; - - if (height < 0) - height = priv->surface_height; - - if (width == 0 || height == 0) - { - g_warning ("Unable to create a context for an image surface of " - "width %d and height %d. Set the surface size to be " - "at least 1 pixel by 1 pixel.", - width, height); - return NULL; - } - - surface = get_surface (self); - - ctxt = draw_context_create (self); - - region.x = x_offset; - region.y = y_offset; - region.width = width; - region.height = height; - - area.x = 0; - area.y = 0; - area.width = priv->surface_width; - area.height = priv->surface_height; - - /* Limit the region to the visible rectangle */ - intersect_rectangles (&area, ®ion, &inter); - - ctxt->rect = inter; - - cr = cairo_create (surface); - cairo_set_user_data (cr, &clutter_cairo_texture_context_key, - ctxt, - clutter_cairo_texture_context_destroy); - - return cr; -} - -/** - * clutter_cairo_texture_create_region: - * @self: a #ClutterCairoTexture - * @x_offset: offset of the region on the X axis - * @y_offset: offset of the region on the Y axis - * @width: width of the region, or -1 for the full surface width - * @height: height of the region, or -1 for the full surface height - * - * Creates a new Cairo context that will updat the region defined - * by @x_offset, @y_offset, @width and @height. - * - * Do not call this function within the paint virtual - * function or from a callback to the #ClutterActor::paint - * signal. - * - * Return value: a newly created Cairo context. Use cairo_destroy() - * to upload the contents of the context when done drawing - * - * - * - * Deprecated: 1.8: Use the #ClutterCairoTexture::draw signal and - * clutter_cairo_texture_invalidate_rectangle() to obtain a - * clipped Cairo context for 2D drawing. - */ -cairo_t * -clutter_cairo_texture_create_region (ClutterCairoTexture *self, - gint x_offset, - gint y_offset, - gint width, - gint height) -{ - g_return_val_if_fail (CLUTTER_IS_CAIRO_TEXTURE (self), NULL); - - clutter_warn_if_paint_fail (self); - - return clutter_cairo_texture_create_region_internal (self, - x_offset, y_offset, - width, height); -} - -/** - * clutter_cairo_texture_invalidate_rectangle: - * @self: a #ClutterCairoTexture - * @rect: (allow-none): a rectangle with the area to invalida, - * or %NULL to perform an unbounded invalidation - * - * Invalidates a rectangular region of a #ClutterCairoTexture. - * - * The invalidation will cause the #ClutterCairoTexture::draw signal - * to be emitted. - * - * See also: clutter_cairo_texture_invalidate() - * - * - * Deprecated: 1.12: Use #ClutterCanvas instead - */ -void -clutter_cairo_texture_invalidate_rectangle (ClutterCairoTexture *self, - cairo_rectangle_int_t *rect) -{ - DrawContext *ctxt = NULL; - - g_return_if_fail (CLUTTER_IS_CAIRO_TEXTURE (self)); - - if (self->priv->cr_context != NULL) - { - g_warning ("It is not possible to invalidate a Cairo texture" - "while drawing into it."); - return; - } - - ctxt = draw_context_create (self); - - if (rect != NULL) - { - cairo_rectangle_int_t area, inter; - - area.x = 0; - area.y = 0; - area.width = self->priv->surface_width; - area.height = self->priv->surface_height; - - /* Limit the region to the visible rectangle */ - intersect_rectangles (&area, rect, &inter); - - ctxt->is_clipped = TRUE; - ctxt->rect = inter; - } - else - { - ctxt->is_clipped = FALSE; - ctxt->rect.x = ctxt->rect.y = 0; - ctxt->rect.width = self->priv->surface_width; - ctxt->rect.height = self->priv->surface_height; - } - - /* XXX - it might be good to move the emission inside the paint cycle - * using a repaint function, to avoid blocking inside this function - */ - clutter_cairo_texture_emit_draw (self, ctxt); -} - -/** - * clutter_cairo_texture_invalidate: - * @self: a #ClutterCairoTexture - * - * Invalidates the whole surface of a #ClutterCairoTexture. - * - * This function will cause the #ClutterCairoTexture::draw signal - * to be emitted. - * - * See also: clutter_cairo_texture_invalidate_rectangle() - * - * - * Deprecated: 1.12: Use #ClutterCanvas instead - */ -void -clutter_cairo_texture_invalidate (ClutterCairoTexture *self) -{ - g_return_if_fail (CLUTTER_IS_CAIRO_TEXTURE (self)); - - clutter_cairo_texture_invalidate_rectangle (self, NULL); -} - -/** - * clutter_cairo_texture_create: - * @self: a #ClutterCairoTexture - * - * Creates a new Cairo context for the @cairo texture. It is - * similar to using clutter_cairo_texture_create_region() with @x_offset - * and @y_offset of 0, @width equal to the @cairo texture surface width - * and @height equal to the @cairo texture surface height. - * - * Do not call this function within the paint virtual - * function or from a callback to the #ClutterActor::paint - * signal. - * - * Return value: a newly created Cairo context. Use cairo_destroy() - * to upload the contents of the context when done drawing - * - * - * - * Deprecated: 1.8: Use the #ClutterCairoTexture::draw signal and - * the clutter_cairo_texture_invalidate() function to obtain a - * Cairo context for 2D drawing. - */ -cairo_t * -clutter_cairo_texture_create (ClutterCairoTexture *self) -{ - g_return_val_if_fail (CLUTTER_IS_CAIRO_TEXTURE (self), NULL); - - clutter_warn_if_paint_fail (self); - - return clutter_cairo_texture_create_region_internal (self, 0, 0, -1, -1); -} - -/** - * clutter_cairo_texture_set_surface_size: - * @self: a #ClutterCairoTexture - * @width: the new width of the surface - * @height: the new height of the surface - * - * Resizes the Cairo surface used by @self to @width and @height. - * - * This function will not invalidate the contents of the Cairo - * texture: you will have to explicitly call either - * clutter_cairo_texture_invalidate_rectangle() or - * clutter_cairo_texture_invalidate(). - * - * - * Deprecated: 1.12: Use #ClutterCanvas instead - */ -void -clutter_cairo_texture_set_surface_size (ClutterCairoTexture *self, - guint width, - guint height) -{ - ClutterCairoTexturePrivate *priv; - - g_return_if_fail (CLUTTER_IS_CAIRO_TEXTURE (self)); - - priv = self->priv; - - if (width == priv->surface_width && - height == priv->surface_height) - return; - - g_object_freeze_notify (G_OBJECT (self)); - - if (priv->surface_width != width) - { - priv->surface_width = width; - g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_SURFACE_WIDTH]); - } - - if (priv->surface_height != height) - { - priv->surface_height = height; - g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_SURFACE_HEIGHT]); - } - - clutter_cairo_texture_surface_resize_internal (self); - - g_object_thaw_notify (G_OBJECT (self)); -} - -/** - * clutter_cairo_texture_get_surface_size: - * @self: a #ClutterCairoTexture - * @width: (out): return location for the surface width, or %NULL - * @height: (out): return location for the surface height, or %NULL - * - * Retrieves the surface width and height for @self. - * - * - * Deprecated: 1.12: Use #ClutterCanvas instead - */ -void -clutter_cairo_texture_get_surface_size (ClutterCairoTexture *self, - guint *width, - guint *height) -{ - g_return_if_fail (CLUTTER_IS_CAIRO_TEXTURE (self)); - - if (width) - *width = self->priv->surface_width; - - if (height) - *height = self->priv->surface_height; -} - -/** - * clutter_cairo_texture_clear: - * @self: a #ClutterCairoTexture - * - * Clears @self's internal drawing surface, so that the next upload - * will replace the previous contents of the #ClutterCairoTexture - * rather than adding to it. - * - * Calling this function from within a #ClutterCairoTexture::draw - * signal handler will clear the invalidated area. - * - * - * Deprecated: 1.12: Use #ClutterCanvas instead - */ -void -clutter_cairo_texture_clear (ClutterCairoTexture *self) -{ - ClutterCairoTexturePrivate *priv; - cairo_t *cr; - - g_return_if_fail (CLUTTER_IS_CAIRO_TEXTURE (self)); - - priv = self->priv; - - /* if we got called outside of a ::draw signal handler - * then we clear the whole surface by creating a temporary - * cairo_t; otherwise, we clear the current cairo_t, which - * will take into account the clip region. - */ - if (priv->cr_context == NULL) - { - cairo_surface_t *surface; - - surface = get_surface (self); - - cr = cairo_create (surface); - } - else - cr = priv->cr_context; - - cairo_save (cr); - - cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR); - cairo_paint (cr); - - cairo_restore (cr); - - if (priv->cr_context == NULL) - cairo_destroy (cr); -} - -/** - * clutter_cairo_texture_set_auto_resize: - * @self: a #ClutterCairoTexture - * @value: %TRUE if the #ClutterCairoTexture should bind the surface - * size to the allocation - * - * Sets whether the #ClutterCairoTexture should ensure that the - * backing Cairo surface used matches the allocation assigned to - * the actor. If the allocation changes, the contents of the - * #ClutterCairoTexture will also be invalidated automatically. - * - * - * Deprecated: 1.12: Use #ClutterCanvas instead - */ -void -clutter_cairo_texture_set_auto_resize (ClutterCairoTexture *self, - gboolean value) -{ - ClutterCairoTexturePrivate *priv; - - g_return_if_fail (CLUTTER_IS_CAIRO_TEXTURE (self)); - - value = !!value; - - priv = self->priv; - - if (priv->auto_resize == value) - return; - - priv->auto_resize = value; - - clutter_actor_queue_relayout (CLUTTER_ACTOR (self)); - - g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_AUTO_RESIZE]); -} - -/** - * clutter_cairo_texture_get_auto_resize: - * @self: a #ClutterCairoTexture - * - * Retrieves the value set using clutter_cairo_texture_set_auto_resize(). - * - * Return value: %TRUE if the #ClutterCairoTexture should track the - * allocation, and %FALSE otherwise - * - * - * Deprecated: 1.12: Use #ClutterCanvas instead - */ -gboolean -clutter_cairo_texture_get_auto_resize (ClutterCairoTexture *self) -{ - g_return_val_if_fail (CLUTTER_IS_CAIRO_TEXTURE (self), FALSE); - - return self->priv->auto_resize; -} diff --git a/clutter/deprecated/clutter-cairo-texture.h b/clutter/deprecated/clutter-cairo-texture.h deleted file mode 100644 index 2e31f8f7b..000000000 --- a/clutter/deprecated/clutter-cairo-texture.h +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Clutter - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By: Emmanuele Bassi - * Matthew Allum - * Chris Lord - * Iain Holmes - * Neil Roberts - * - * Copyright (C) 2008, 2009, 2010 Intel Corporation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_CAIRO_TEXTURE_H__ -#define __CLUTTER_CAIRO_TEXTURE_H__ - -#include - -G_BEGIN_DECLS - -#define CLUTTER_TYPE_CAIRO_TEXTURE (clutter_cairo_texture_get_type ()) -#define CLUTTER_CAIRO_TEXTURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_CAIRO_TEXTURE, ClutterCairoTexture)) -#define CLUTTER_CAIRO_TEXTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_CAIRO_TEXTURE, ClutterCairoTextureClass)) -#define CLUTTER_IS_CAIRO_TEXTURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_CAIRO_TEXTURE)) -#define CLUTTER_IS_CAIRO_TEXTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_CAIRO_TEXTURE)) -#define CLUTTER_CAIRO_TEXTURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_CAIRO_TEXTURE, ClutterCairoTextureClass)) - -typedef struct _ClutterCairoTexture ClutterCairoTexture; -typedef struct _ClutterCairoTextureClass ClutterCairoTextureClass; -typedef struct _ClutterCairoTexturePrivate ClutterCairoTexturePrivate; - -/** - * ClutterCairoTexture: - * - * The #ClutterCairoTexture struct contains only private data. - * - * - * - * Deprecated: 1.12: Use #ClutterCanvas instead - */ -struct _ClutterCairoTexture -{ - /*< private >*/ - ClutterTexture parent_instance; - - ClutterCairoTexturePrivate *priv; -}; - -/** - * ClutterCairoTextureClass: - * @create_surface: class handler for the #ClutterCairoTexture::create-surface - * signal - * @draw: class handler for the #ClutterCairoTexture::draw signal - * - * The #ClutterCairoTextureClass struct contains only private data. - * - * - * - * Deprecated: 1.12: Use #ClutterCanvas instead - */ -struct _ClutterCairoTextureClass -{ - /*< private >*/ - ClutterTextureClass parent_class; - - /*< public >*/ - cairo_surface_t *(* create_surface) (ClutterCairoTexture *texture, - guint width, - guint height); - - gboolean (* draw) (ClutterCairoTexture *texture, - cairo_t *cr); - - /*< private >*/ - void (*_clutter_cairo_3) (void); - void (*_clutter_cairo_4) (void); -}; - -CLUTTER_DEPRECATED_IN_1_12_FOR(clutter_canvas_get_type) -GType clutter_cairo_texture_get_type (void) G_GNUC_CONST; - -CLUTTER_DEPRECATED_IN_1_12_FOR(clutter_canvas_new) -ClutterActor * clutter_cairo_texture_new (guint width, - guint height); - -CLUTTER_DEPRECATED_IN_1_12_FOR(clutter_canvas_set_size) -void clutter_cairo_texture_set_surface_size (ClutterCairoTexture *self, - guint width, - guint height); -CLUTTER_DEPRECATED_IN_1_12_FOR(clutter_canvas_get_size) -void clutter_cairo_texture_get_surface_size (ClutterCairoTexture *self, - guint *width, - guint *height); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_cairo_texture_set_auto_resize (ClutterCairoTexture *self, - gboolean value); -CLUTTER_DEPRECATED_IN_1_12 -gboolean clutter_cairo_texture_get_auto_resize (ClutterCairoTexture *self); - -CLUTTER_DEPRECATED_IN_1_12 -void clutter_cairo_texture_clear (ClutterCairoTexture *self); - -CLUTTER_DEPRECATED_IN_1_12 -void clutter_cairo_texture_invalidate_rectangle (ClutterCairoTexture *self, - cairo_rectangle_int_t *rect); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_cairo_texture_invalidate (ClutterCairoTexture *self); - -CLUTTER_DEPRECATED_IN_1_8_FOR(clutter_cairo_texture_invalidate_rectangle) -cairo_t * clutter_cairo_texture_create_region (ClutterCairoTexture *self, - gint x_offset, - gint y_offset, - gint width, - gint height); - -CLUTTER_DEPRECATED_IN_1_8_FOR(clutter_cairo_texture_invalidate) -cairo_t * clutter_cairo_texture_create (ClutterCairoTexture *self); - -G_END_DECLS - -#endif /* __CLUTTER_CAIRO_TEXTURE_DEPRECATED_H__ */ diff --git a/clutter/deprecated/clutter-container.h b/clutter/deprecated/clutter-container.h deleted file mode 100644 index 38e78982f..000000000 --- a/clutter/deprecated/clutter-container.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Copyright (C) 2011 Intel Corporation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - * ClutterContainer: Generic actor container interface. - * - * Author: Emmanuele Bassi - */ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_CONTAINER_DEPRECATED_H__ -#define __CLUTTER_CONTAINER_DEPRECATED_H__ - -#include - -G_BEGIN_DECLS - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_add_child) -void clutter_container_add (ClutterContainer *container, - ClutterActor *first_actor, - ...) G_GNUC_NULL_TERMINATED; - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_add_child) -void clutter_container_add_actor (ClutterContainer *container, - ClutterActor *actor); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_add_child) -void clutter_container_add_valist (ClutterContainer *container, - ClutterActor *first_actor, - va_list var_args); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_remove_child) -void clutter_container_remove (ClutterContainer *container, - ClutterActor *first_actor, - ...) G_GNUC_NULL_TERMINATED; - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_remove_child) -void clutter_container_remove_actor (ClutterContainer *container, - ClutterActor *actor); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_remove_child) -void clutter_container_remove_valist (ClutterContainer *container, - ClutterActor *first_actor, - va_list var_args); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_get_children) -GList * clutter_container_get_children (ClutterContainer *container); - -CLUTTER_DEPRECATED_IN_1_10 -void clutter_container_foreach (ClutterContainer *container, - ClutterCallback callback, - gpointer user_data); - -CLUTTER_DEPRECATED_IN_1_10 -void clutter_container_foreach_with_internals (ClutterContainer *container, - ClutterCallback callback, - gpointer user_data); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_set_child_above_sibling) -void clutter_container_raise_child (ClutterContainer *container, - ClutterActor *actor, - ClutterActor *sibling); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_set_child_below_sibling) -void clutter_container_lower_child (ClutterContainer *container, - ClutterActor *actor, - ClutterActor *sibling); - -CLUTTER_DEPRECATED_IN_1_10 -void clutter_container_sort_depth_order (ClutterContainer *container); - -G_END_DECLS - -#endif /* __CLUTTER_CONTAINER_DEPRECATED_H__ */ diff --git a/clutter/deprecated/clutter-fixed.c b/clutter/deprecated/clutter-fixed.c deleted file mode 100644 index e942cc9f5..000000000 --- a/clutter/deprecated/clutter-fixed.c +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Tomas Frydrych - * - * Copyright (C) 2006, 2007 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - * - */ - -#define G_IMPLEMENT_INLINES - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#define CLUTTER_DISABLE_DEPRECATION_WARNINGS - -/* This file depends on the cogl-fixed api which isn't exposed when - * COGL_ENABLE_EXPERIMENTAL_2_0_API is defined... - */ -#undef COGL_ENABLE_EXPERIMENTAL_2_0_API -#include - -#include - -#include "clutter-fixed.h" -#include "clutter-private.h" - -/** - * clutter_value_set_fixed: (skip) - * @value: a #GValue initialized to %COGL_TYPE_FIXED - * @fixed_: the fixed point value to set - * - * Sets @value to @fixed_. - * - * - * - * Deprecated: 1.10: Use g_value_set_int() instead. - */ -void -clutter_value_set_fixed (GValue *value, - CoglFixed fixed_) -{ - g_return_if_fail (CLUTTER_VALUE_HOLDS_FIXED (value)); - - value->data[0].v_int = fixed_; -} - -/** - * clutter_value_get_fixed: (skip) - * @value: a #GValue initialized to %COGL_TYPE_FIXED - * - * Gets the fixed point value stored inside @value. - * - * Return value: the value inside the passed #GValue - * - * - * - * Deprecated: 1.10: Use g_value_get_int() instead. - */ -CoglFixed -clutter_value_get_fixed (const GValue *value) -{ - g_return_val_if_fail (CLUTTER_VALUE_HOLDS_FIXED (value), 0); - - return value->data[0].v_int; -} - -static void -param_fixed_init (GParamSpec *pspec) -{ - ClutterParamSpecFixed *fspec = CLUTTER_PARAM_SPEC_FIXED (pspec); - - fspec->minimum = COGL_FIXED_MIN; - fspec->maximum = COGL_FIXED_MAX; - fspec->default_value = 0; -} - -static void -param_fixed_set_default (GParamSpec *pspec, - GValue *value) -{ - value->data[0].v_int = CLUTTER_PARAM_SPEC_FIXED (pspec)->default_value; -} - -static gboolean -param_fixed_validate (GParamSpec *pspec, - GValue *value) -{ - ClutterParamSpecFixed *fspec = CLUTTER_PARAM_SPEC_FIXED (pspec); - gint oval = value->data[0].v_int; - gint min, max, val; - - g_assert (CLUTTER_IS_PARAM_SPEC_FIXED (pspec)); - - /* we compare the integer part of the value because the minimum - * and maximum values cover just that part of the representation - */ - min = fspec->minimum; - max = fspec->maximum; - val = (value->data[0].v_int); - - val = CLAMP (val, min, max); - if (val != oval) - { - value->data[0].v_int = val; - return TRUE; - } - - return FALSE; -} - -static gint -param_fixed_values_cmp (GParamSpec *pspec, - const GValue *value1, - const GValue *value2) -{ - if (value1->data[0].v_int < value2->data[0].v_int) - return -1; - else - return value1->data[0].v_int > value2->data[0].v_int; -} - -GType -clutter_param_fixed_get_type (void) -{ - static GType pspec_type = 0; - - if (G_UNLIKELY (pspec_type == 0)) - { - const GParamSpecTypeInfo pspec_info = { - sizeof (ClutterParamSpecFixed), - 16, - param_fixed_init, - COGL_TYPE_FIXED, - NULL, - param_fixed_set_default, - param_fixed_validate, - param_fixed_values_cmp, - }; - - pspec_type = g_param_type_register_static (I_("ClutterParamSpecFixed"), - &pspec_info); - } - - return pspec_type; -} - -/** - * clutter_param_spec_fixed: (skip) - * @name: name of the property - * @nick: short name - * @blurb: description (can be translatable) - * @minimum: lower boundary - * @maximum: higher boundary - * @default_value: default value - * @flags: flags for the param spec - * - * Creates a #GParamSpec for properties using #CoglFixed values - * - * Return value: (transfer full): the newly created #GParamSpec - * - * - * - * Deprecated: 1.10: Use #GParamSpecInt instead. - */ -GParamSpec * -clutter_param_spec_fixed (const gchar *name, - const gchar *nick, - const gchar *blurb, - CoglFixed minimum, - CoglFixed maximum, - CoglFixed default_value, - GParamFlags flags) -{ - ClutterParamSpecFixed *fspec; - - g_return_val_if_fail (default_value >= minimum && default_value <= maximum, - NULL); - - fspec = g_param_spec_internal (CLUTTER_TYPE_PARAM_FIXED, - name, nick, blurb, - flags); - fspec->minimum = minimum; - fspec->maximum = maximum; - fspec->default_value = default_value; - - return G_PARAM_SPEC (fspec); -} diff --git a/clutter/deprecated/clutter-fixed.h b/clutter/deprecated/clutter-fixed.h deleted file mode 100644 index 7f123d943..000000000 --- a/clutter/deprecated/clutter-fixed.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * Tomas Frydrych - * - * Copyright (C) 2006 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_FIXED_H__ -#define __CLUTTER_FIXED_H__ - -#include -#include - -G_BEGIN_DECLS - -#define CLUTTER_TYPE_PARAM_FIXED (clutter_param_fixed_get_type ()) -#define CLUTTER_PARAM_SPEC_FIXED(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), CLUTTER_TYPE_PARAM_FIXED, ClutterParamSpecFixed)) -#define CLUTTER_IS_PARAM_SPEC_FIXED(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), CLUTTER_TYPE_PARAM_FIXED)) - -/** - * CLUTTER_VALUE_HOLDS_FIXED: - * @x: a #GValue - * - * Evaluates to %TRUE if @x holds a #CoglFixed . - * - * - * - * Deprecated: 1.10: Use %G_VALUE_HOLDS_INT instead - */ -#define CLUTTER_VALUE_HOLDS_FIXED(x) (G_VALUE_HOLDS ((x), COGL_TYPE_FIXED)) - -typedef struct _ClutterParamSpecFixed ClutterParamSpecFixed; - -/** - * ClutterParamSpecFixed: (skip) - * @minimum: lower boundary - * @maximum: higher boundary - * @default_value: default value - * - * #GParamSpec subclass for fixed point based properties - * - * - * - * Deprecated: Use #GParamSpecInt instead - */ -struct _ClutterParamSpecFixed -{ - /*< private >*/ - GParamSpec parent_instance; - - /*< public >*/ - CoglFixed minimum; - CoglFixed maximum; - CoglFixed default_value; -}; - -GType clutter_param_fixed_get_type (void) G_GNUC_CONST; - -CLUTTER_DEPRECATED_IN_1_10_FOR(g_value_set_int) -void clutter_value_set_fixed (GValue *value, - CoglFixed fixed_); -CLUTTER_DEPRECATED_IN_1_10_FOR(g_value_get_int) -CoglFixed clutter_value_get_fixed (const GValue *value); - -CLUTTER_DEPRECATED_IN_1_10_FOR(g_param_spec_int) -GParamSpec * clutter_param_spec_fixed (const gchar *name, - const gchar *nick, - const gchar *blurb, - CoglFixed minimum, - CoglFixed maximum, - CoglFixed default_value, - GParamFlags flags); - -G_END_DECLS - -#endif /* __CLUTTER_FIXED_H__ */ diff --git a/clutter/deprecated/clutter-frame-source.c b/clutter/deprecated/clutter-frame-source.c deleted file mode 100644 index 1d24c065f..000000000 --- a/clutter/deprecated/clutter-frame-source.c +++ /dev/null @@ -1,267 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Neil Roberts - * - * Copyright (C) 2008 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#define CLUTTER_DISABLE_DEPRECATION_WARNINGS - -#include "clutter-main.h" -#include "clutter-private.h" - -#include "deprecated/clutter-frame-source.h" -#include "deprecated/clutter-timeout-interval.h" - -typedef struct _ClutterFrameSource ClutterFrameSource; - -struct _ClutterFrameSource -{ - GSource source; - - ClutterTimeoutInterval timeout; -}; - -static gboolean clutter_frame_source_prepare (GSource *source, - gint *timeout); -static gboolean clutter_frame_source_check (GSource *source); -static gboolean clutter_frame_source_dispatch (GSource *source, - GSourceFunc callback, - gpointer user_data); - -static GSourceFuncs clutter_frame_source_funcs = -{ - clutter_frame_source_prepare, - clutter_frame_source_check, - clutter_frame_source_dispatch, - NULL -}; - -/** - * clutter_frame_source_add_full: - * @priority: the priority of the frame source. Typically this will be in the - * range between %G_PRIORITY_DEFAULT and %G_PRIORITY_HIGH. - * @fps: the number of times per second to call the function - * @func: function to call - * @data: data to pass to the function - * @notify: function to call when the timeout source is removed - * - * Sets a function to be called at regular intervals with the given - * priority. The function is called repeatedly until it returns - * %FALSE, at which point the timeout is automatically destroyed and - * the function will not be called again. The @notify function is - * called when the timeout is destroyed. The first call to the - * function will be at the end of the first @interval. - * - * This function is similar to g_timeout_add_full() except that it - * will try to compensate for delays. For example, if @func takes half - * the interval time to execute then the function will be called again - * half the interval time after it finished. In contrast - * g_timeout_add_full() would not fire until a full interval after the - * function completes so the delay between calls would be 1.0 / @fps * - * 1.5. This function does not however try to invoke the function - * multiple times to catch up missing frames if @func takes more than - * @interval ms to execute. - * - * Rename to: clutter_frame_source_add - * - * Return value: the ID (greater than 0) of the event source. - * - * - * - * Deprecated: 1.6 - */ -guint -clutter_frame_source_add_full (gint priority, - guint fps, - GSourceFunc func, - gpointer data, - GDestroyNotify notify) -{ - guint ret; - GSource *source = g_source_new (&clutter_frame_source_funcs, - sizeof (ClutterFrameSource)); - ClutterFrameSource *frame_source = (ClutterFrameSource *) source; - - _clutter_timeout_interval_init (&frame_source->timeout, fps); - - if (priority != G_PRIORITY_DEFAULT) - g_source_set_priority (source, priority); - - g_source_set_name (source, "Clutter frame timeout"); - g_source_set_callback (source, func, data, notify); - - ret = g_source_attach (source, NULL); - - g_source_unref (source); - - return ret; -} - -/** - * clutter_frame_source_add: (skip) - * @fps: the number of times per second to call the function - * @func: function to call - * @data: data to pass to the function - * - * Simple wrapper around clutter_frame_source_add_full(). - * - * Return value: the ID (greater than 0) of the event source. - * - * - * - * Deprecated: 1.6 - */ -guint -clutter_frame_source_add (guint fps, - GSourceFunc func, - gpointer data) -{ - return clutter_frame_source_add_full (G_PRIORITY_DEFAULT, - fps, func, data, NULL); -} - -static gboolean -clutter_frame_source_prepare (GSource *source, - gint *delay) -{ - ClutterFrameSource *frame_source = (ClutterFrameSource *) source; - gint64 current_time; - -#if GLIB_CHECK_VERSION (2, 27, 3) - current_time = g_source_get_time (source) / 1000; -#else - { - GTimeVal source_time; - g_source_get_current_time (source, &source_time); - current_time = source_time.tv_sec * 1000 + source_time.tv_usec / 1000; - } -#endif - - return _clutter_timeout_interval_prepare (current_time, - &frame_source->timeout, - delay); -} - -static gboolean -clutter_frame_source_check (GSource *source) -{ - return clutter_frame_source_prepare (source, NULL); -} - -static gboolean -clutter_frame_source_dispatch (GSource *source, - GSourceFunc callback, - gpointer user_data) -{ - ClutterFrameSource *frame_source = (ClutterFrameSource *) source; - - return _clutter_timeout_interval_dispatch (&frame_source->timeout, - callback, user_data); -} - -/** - * clutter_threads_add_frame_source_full: - * @priority: the priority of the frame source. Typically this will be in the - * range between %G_PRIORITY_DEFAULT and %G_PRIORITY_HIGH. - * @fps: the number of times per second to call the function - * @func: function to call - * @data: data to pass to the function - * @notify: function to call when the timeout source is removed - * - * Sets a function to be called at regular intervals holding the Clutter - * threads lock, with the given priority. The function is called repeatedly - * until it returns %FALSE, at which point the timeout is automatically - * removed and the function will not be called again. The @notify function - * is called when the timeout is removed. - * - * This function is similar to clutter_threads_add_timeout_full() - * except that it will try to compensate for delays. For example, if - * @func takes half the interval time to execute then the function - * will be called again half the interval time after it finished. In - * contrast clutter_threads_add_timeout_full() would not fire until a - * full interval after the function completes so the delay between - * calls would be @interval * 1.5. This function does not however try - * to invoke the function multiple times to catch up missing frames if - * @func takes more than @interval ms to execute. - * - * See also clutter_threads_add_idle_full(). - * - * Rename to: clutter_threads_add_frame_source - * - * Return value: the ID (greater than 0) of the event source. - * - * - * - * Deprecated: 1.6 - */ -guint -clutter_threads_add_frame_source_full (gint priority, - guint fps, - GSourceFunc func, - gpointer data, - GDestroyNotify notify) -{ - ClutterThreadsDispatch *dispatch; - - g_return_val_if_fail (func != NULL, 0); - - dispatch = g_slice_new (ClutterThreadsDispatch); - dispatch->func = func; - dispatch->data = data; - dispatch->notify = notify; - - return clutter_frame_source_add_full (priority, - fps, - _clutter_threads_dispatch, dispatch, - _clutter_threads_dispatch_free); -} - -/** - * clutter_threads_add_frame_source: (skip) - * @fps: the number of times per second to call the function - * @func: function to call - * @data: data to pass to the function - * - * Simple wrapper around clutter_threads_add_frame_source_full(). - * - * Return value: the ID (greater than 0) of the event source. - * - * - * - * Deprecated: 1.6 - */ -guint -clutter_threads_add_frame_source (guint fps, - GSourceFunc func, - gpointer data) -{ - g_return_val_if_fail (func != NULL, 0); - - return clutter_threads_add_frame_source_full (G_PRIORITY_DEFAULT, - fps, - func, data, - NULL); -} diff --git a/clutter/deprecated/clutter-frame-source.h b/clutter/deprecated/clutter-frame-source.h deleted file mode 100644 index f45134140..000000000 --- a/clutter/deprecated/clutter-frame-source.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * Copyright (C) 2008 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_FRAME_SOURCE_H__ -#define __CLUTTER_FRAME_SOURCE_H__ - -#include - -G_BEGIN_DECLS - -CLUTTER_DEPRECATED_IN_1_6 -guint clutter_frame_source_add (guint fps, - GSourceFunc func, - gpointer data); - -CLUTTER_DEPRECATED_IN_1_6 -guint clutter_frame_source_add_full (gint priority, - guint fps, - GSourceFunc func, - gpointer data, - GDestroyNotify notify); - -G_END_DECLS - -#endif /* __CLUTTER_FRAME_SOURCE_H__ */ diff --git a/clutter/deprecated/clutter-group.c b/clutter/deprecated/clutter-group.c deleted file mode 100644 index c9465a2d5..000000000 --- a/clutter/deprecated/clutter-group.c +++ /dev/null @@ -1,564 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * Copyright (C) 2006 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -/** - * SECTION:clutter-group - * @short_description: A fixed layout container - * - * A #ClutterGroup is an Actor which contains multiple child actors positioned - * relative to the #ClutterGroup position. Other operations such as scaling, - * rotating and clipping of the group will apply to the child actors. - * - * A #ClutterGroup's size is defined by the size and position of its children; - * it will be the smallest non-negative size that covers the right and bottom - * edges of all of its children. - * - * Setting the size on a Group using #ClutterActor methods like - * clutter_actor_set_size() will override the natural size of the Group, - * however this will not affect the size of the children and they may still - * be painted outside of the allocation of the group. One way to constrain - * the visible area of a #ClutterGroup to a specified allocation is to - * explicitly set the size of the #ClutterGroup and then use the - * #ClutterActor:clip-to-allocation property. - * - * Deprecated: 1.10: Use #ClutterActor instead. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#define CLUTTER_DISABLE_DEPRECATION_WARNINGS -#include "clutter-group.h" - -#include "clutter-actor.h" -#include "clutter-actor-private.h" -#include "clutter-container.h" -#include "clutter-fixed-layout.h" -#include "clutter-main.h" -#include "clutter-debug.h" -#include "clutter-enum-types.h" -#include "clutter-marshal.h" -#include "clutter-private.h" - -#include "cogl/cogl.h" - -#define CLUTTER_GROUP_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_GROUP, ClutterGroupPrivate)) - -struct _ClutterGroupPrivate -{ - GList *children; - - ClutterLayoutManager *layout; -}; - -static void clutter_container_iface_init (ClutterContainerIface *iface); - -G_DEFINE_TYPE_WITH_CODE (ClutterGroup, clutter_group, CLUTTER_TYPE_ACTOR, - G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_CONTAINER, - clutter_container_iface_init)); - -static gint -sort_by_depth (gconstpointer a, - gconstpointer b) -{ - gfloat depth_a = clutter_actor_get_depth (CLUTTER_ACTOR(a)); - gfloat depth_b = clutter_actor_get_depth (CLUTTER_ACTOR(b)); - - if (depth_a < depth_b) - return -1; - - if (depth_a > depth_b) - return 1; - - return 0; -} - -static void -clutter_group_real_add (ClutterContainer *container, - ClutterActor *actor) -{ - ClutterGroupPrivate *priv = CLUTTER_GROUP (container)->priv; - - g_object_ref (actor); - - priv->children = g_list_append (priv->children, actor); - clutter_actor_set_parent (actor, CLUTTER_ACTOR (container)); - - clutter_actor_queue_relayout (CLUTTER_ACTOR (container)); - - g_signal_emit_by_name (container, "actor-added", actor); - - clutter_container_sort_depth_order (container); - - g_object_unref (actor); -} - -static void -clutter_group_real_actor_added (ClutterContainer *container, - ClutterActor *actor) -{ - ClutterGroupPrivate *priv = CLUTTER_GROUP (container)->priv; - - /* XXX - children added using clutter_actor_add_child() will - * cause actor-added to be emitted without going through the - * add() virtual function. - * - * if we get an actor-added for a child that is not in our - * list of children already, then we go in compatibility - * mode. - */ - if (g_list_find (priv->children, actor) != NULL) - return; - - priv->children = g_list_append (priv->children, actor); - clutter_container_sort_depth_order (container); -} - -static void -clutter_group_real_remove (ClutterContainer *container, - ClutterActor *actor) -{ - ClutterGroupPrivate *priv = CLUTTER_GROUP (container)->priv; - - g_object_ref (actor); - - priv->children = g_list_remove (priv->children, actor); - clutter_actor_unparent (actor); - - clutter_actor_queue_relayout (CLUTTER_ACTOR (container)); - - g_signal_emit_by_name (container, "actor-removed", actor); - - clutter_actor_queue_redraw (CLUTTER_ACTOR (container)); - - g_object_unref (actor); -} - -static void -clutter_group_real_actor_removed (ClutterContainer *container, - ClutterActor *actor) -{ - ClutterGroupPrivate *priv = CLUTTER_GROUP (container)->priv; - - /* XXX - same compatibility mode of the ::actor-added implementation */ - if (g_list_find (priv->children, actor) == NULL) - return; - - priv->children = g_list_remove (priv->children, actor); -} - -static void -clutter_group_real_foreach (ClutterContainer *container, - ClutterCallback callback, - gpointer user_data) -{ - ClutterGroupPrivate *priv = CLUTTER_GROUP (container)->priv; - - /* Using g_list_foreach instead of iterating the list manually - because it has better protection against the current node being - removed. This will happen for example if someone calls - clutter_container_foreach(container, clutter_actor_destroy) */ - g_list_foreach (priv->children, (GFunc) callback, user_data); -} - -static void -clutter_group_real_raise (ClutterContainer *container, - ClutterActor *actor, - ClutterActor *sibling) -{ - ClutterGroupPrivate *priv = CLUTTER_GROUP (container)->priv; - - priv->children = g_list_remove (priv->children, actor); - - /* Raise at the top */ - if (!sibling) - { - GList *last_item; - - last_item = g_list_last (priv->children); - - if (last_item) - sibling = last_item->data; - - priv->children = g_list_append (priv->children, actor); - } - else - { - gint index_ = g_list_index (priv->children, sibling) + 1; - - priv->children = g_list_insert (priv->children, actor, index_); - } - - /* set Z ordering a value below, this will then call sort - * as values are equal ordering shouldn't change but Z - * values will be correct. - * - * FIXME: get rid of this crap; this is so utterly broken and wrong on - * so many levels it's not even funny. sadly, we get to keep this until - * we can break API and remove Group for good. - */ - if (sibling && - clutter_actor_get_depth (sibling) != clutter_actor_get_depth (actor)) - { - clutter_actor_set_depth (actor, clutter_actor_get_depth (sibling)); - } - - clutter_actor_queue_redraw (CLUTTER_ACTOR (container)); -} - -static void -clutter_group_real_lower (ClutterContainer *container, - ClutterActor *actor, - ClutterActor *sibling) -{ - ClutterGroup *self = CLUTTER_GROUP (container); - ClutterGroupPrivate *priv = self->priv; - - priv->children = g_list_remove (priv->children, actor); - - /* Push to bottom */ - if (!sibling) - { - GList *last_item; - - last_item = g_list_first (priv->children); - - if (last_item) - sibling = last_item->data; - - priv->children = g_list_prepend (priv->children, actor); - } - else - { - gint index_ = g_list_index (priv->children, sibling); - - priv->children = g_list_insert (priv->children, actor, index_); - } - - /* See comment in group_raise for this */ - if (sibling && - clutter_actor_get_depth (sibling) != clutter_actor_get_depth (actor)) - { - clutter_actor_set_depth (actor, clutter_actor_get_depth (sibling)); - } - - clutter_actor_queue_redraw (CLUTTER_ACTOR (container)); -} - -static void -clutter_group_real_sort_depth_order (ClutterContainer *container) -{ - ClutterGroupPrivate *priv = CLUTTER_GROUP (container)->priv; - - priv->children = g_list_sort (priv->children, sort_by_depth); - - clutter_actor_queue_redraw (CLUTTER_ACTOR (container)); -} - -static void -clutter_container_iface_init (ClutterContainerIface *iface) -{ - iface->add = clutter_group_real_add; - iface->actor_added = clutter_group_real_actor_added; - iface->remove = clutter_group_real_remove; - iface->actor_removed = clutter_group_real_actor_removed; - iface->foreach = clutter_group_real_foreach; - iface->raise = clutter_group_real_raise; - iface->lower = clutter_group_real_lower; - iface->sort_depth_order = clutter_group_real_sort_depth_order; -} - -static void -clutter_group_real_paint (ClutterActor *actor) -{ - ClutterGroupPrivate *priv = CLUTTER_GROUP (actor)->priv; - - CLUTTER_NOTE (PAINT, "ClutterGroup paint enter '%s'", - _clutter_actor_get_debug_name (actor)); - - g_list_foreach (priv->children, (GFunc) clutter_actor_paint, NULL); - - CLUTTER_NOTE (PAINT, "ClutterGroup paint leave '%s'", - _clutter_actor_get_debug_name (actor)); -} - -static void -clutter_group_real_pick (ClutterActor *actor, - const ClutterColor *pick) -{ - ClutterGroupPrivate *priv = CLUTTER_GROUP (actor)->priv; - - /* Chain up so we get a bounding box pained (if we are reactive) */ - CLUTTER_ACTOR_CLASS (clutter_group_parent_class)->pick (actor, pick); - - g_list_foreach (priv->children, (GFunc) clutter_actor_paint, NULL); -} - -static void -clutter_group_real_get_preferred_width (ClutterActor *actor, - gfloat for_height, - gfloat *min_width, - gfloat *natural_width) -{ - ClutterGroupPrivate *priv = CLUTTER_GROUP (actor)->priv; - - clutter_layout_manager_get_preferred_width (priv->layout, - CLUTTER_CONTAINER (actor), - for_height, - min_width, natural_width); -} - -static void -clutter_group_real_get_preferred_height (ClutterActor *actor, - gfloat for_width, - gfloat *min_height, - gfloat *natural_height) -{ - ClutterGroupPrivate *priv = CLUTTER_GROUP (actor)->priv; - - clutter_layout_manager_get_preferred_height (priv->layout, - CLUTTER_CONTAINER (actor), - for_width, - min_height, natural_height); -} - -static void -clutter_group_real_allocate (ClutterActor *actor, - const ClutterActorBox *allocation, - ClutterAllocationFlags flags) -{ - ClutterGroupPrivate *priv = CLUTTER_GROUP (actor)->priv; - ClutterActorClass *klass; - - klass = CLUTTER_ACTOR_CLASS (clutter_group_parent_class); - klass->allocate (actor, allocation, flags); - - if (priv->children == NULL) - return; - - clutter_layout_manager_allocate (priv->layout, - CLUTTER_CONTAINER (actor), - allocation, flags); -} - -static void -clutter_group_dispose (GObject *object) -{ - ClutterGroup *self = CLUTTER_GROUP (object); - ClutterGroupPrivate *priv = self->priv; - - /* Note: we are careful to consider that destroying children could - * have the side-effect of destroying other children so - * priv->children may be modified during clutter_actor_destroy. */ - while (priv->children != NULL) - { - ClutterActor *child = priv->children->data; - priv->children = g_list_delete_link (priv->children, priv->children); - clutter_actor_destroy (child); - } - - if (priv->layout) - { - clutter_layout_manager_set_container (priv->layout, NULL); - g_object_unref (priv->layout); - priv->layout = NULL; - } - - G_OBJECT_CLASS (clutter_group_parent_class)->dispose (object); -} - -static void -clutter_group_real_show_all (ClutterActor *actor) -{ - clutter_container_foreach (CLUTTER_CONTAINER (actor), - CLUTTER_CALLBACK (clutter_actor_show), - NULL); - clutter_actor_show (actor); -} - -static void -clutter_group_real_hide_all (ClutterActor *actor) -{ - clutter_actor_hide (actor); - clutter_container_foreach (CLUTTER_CONTAINER (actor), - CLUTTER_CALLBACK (clutter_actor_hide), - NULL); -} - -static gboolean -clutter_group_real_get_paint_volume (ClutterActor *actor, - ClutterPaintVolume *volume) -{ - ClutterGroupPrivate *priv = CLUTTER_GROUP (actor)->priv; - GList *l; - - if (priv->children == NULL) - return TRUE; - - for (l = priv->children; l != NULL; l = l->next) - { - ClutterActor *child = l->data; - const ClutterPaintVolume *child_volume; - - /* This gets the paint volume of the child transformed into the - * group's coordinate space... */ - child_volume = clutter_actor_get_transformed_paint_volume (child, actor); - if (!child_volume) - return FALSE; - - clutter_paint_volume_union (volume, child_volume); - } - - return TRUE; -} - -static void -clutter_group_class_init (ClutterGroupClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); - - g_type_class_add_private (klass, sizeof (ClutterGroupPrivate)); - - actor_class->get_preferred_width = clutter_group_real_get_preferred_width; - actor_class->get_preferred_height = clutter_group_real_get_preferred_height; - actor_class->allocate = clutter_group_real_allocate; - actor_class->paint = clutter_group_real_paint; - actor_class->pick = clutter_group_real_pick; - actor_class->show_all = clutter_group_real_show_all; - actor_class->hide_all = clutter_group_real_hide_all; - actor_class->get_paint_volume = clutter_group_real_get_paint_volume; - - gobject_class->dispose = clutter_group_dispose; -} - -static void -clutter_group_init (ClutterGroup *self) -{ - ClutterActor *actor = CLUTTER_ACTOR (self); - - self->priv = CLUTTER_GROUP_GET_PRIVATE (self); - - /* turn on some optimization - * - * XXX - these so-called "optimizations" are insane and should have never - * been used. they introduce some weird behaviour that breaks invariants - * and has to be explicitly worked around. - * - * this flag was set by the ClutterFixedLayout, but since that layout - * manager is now the default for ClutterActor, we set the flag explicitly - * here, to avoid breaking perfectly working actors overriding the - * allocate() virtual function. - * - * also, we keep this flag here so that it can die once we get rid of - * ClutterGroup. - */ - clutter_actor_set_flags (actor, CLUTTER_ACTOR_NO_LAYOUT); - - self->priv->layout = clutter_fixed_layout_new (); - g_object_ref_sink (self->priv->layout); - - clutter_actor_set_layout_manager (actor, self->priv->layout); -} - -/** - * clutter_group_new: - * - * Create a new #ClutterGroup. - * - * Return value: the newly created #ClutterGroup actor - * - * Deprecated: 1.10: Use clutter_actor_new() instead. - */ -ClutterActor * -clutter_group_new (void) -{ - return g_object_new (CLUTTER_TYPE_GROUP, NULL); -} - -/** - * clutter_group_remove_all: - * @self: A #ClutterGroup - * - * Removes all children actors from the #ClutterGroup. - * - * Deprecated: 1.10: Use clutter_actor_remove_all_children() instead. - */ -void -clutter_group_remove_all (ClutterGroup *self) -{ - g_return_if_fail (CLUTTER_IS_GROUP (self)); - - clutter_actor_remove_all_children (CLUTTER_ACTOR (self)); -} - -/** - * clutter_group_get_n_children: - * @self: A #ClutterGroup - * - * Gets the number of actors held in the group. - * - * Return value: The number of child actors held in the group. - * - * - * - * Deprecated: 1.10: Use clutter_actor_get_n_children() instead. - */ -gint -clutter_group_get_n_children (ClutterGroup *self) -{ - g_return_val_if_fail (CLUTTER_IS_GROUP (self), 0); - - return clutter_actor_get_n_children (CLUTTER_ACTOR (self)); -} - -/** - * clutter_group_get_nth_child: - * @self: A #ClutterGroup - * @index_: the position of the requested actor. - * - * Gets a groups child held at @index_ in stack. - * - * Return value: (transfer none): A Clutter actor, or %NULL if - * @index_ is invalid. - * - * - * - * Deprecated: 1.10: Use clutter_actor_get_child_at_index() instead. - */ -ClutterActor * -clutter_group_get_nth_child (ClutterGroup *self, - gint index_) -{ - ClutterActor *actor; - - g_return_val_if_fail (CLUTTER_IS_GROUP (self), NULL); - - actor = CLUTTER_ACTOR (self); - g_return_val_if_fail (index_ <= clutter_actor_get_n_children (actor), NULL); - - return clutter_actor_get_child_at_index (actor, index_); -} diff --git a/clutter/deprecated/clutter-group.h b/clutter/deprecated/clutter-group.h deleted file mode 100644 index 5bc378f74..000000000 --- a/clutter/deprecated/clutter-group.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Copyright (C) 2011 Intel Corp - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_GROUP_DEPRECATED_H__ -#define __CLUTTER_GROUP_DEPRECATED_H__ - -#include -#include - -G_BEGIN_DECLS - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_new) -ClutterActor * clutter_group_new (void); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_get_child_at_index) -ClutterActor * clutter_group_get_nth_child (ClutterGroup *self, - gint index_); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_get_n_children) -gint clutter_group_get_n_children (ClutterGroup *self); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_remove_all_children) -void clutter_group_remove_all (ClutterGroup *self); - -#ifndef CLUTTER_DISABLE_DEPRECATED - -/* for Mr. Mallum only */ -#define clutter_group_add(group,actor) G_STMT_START { \ - ClutterActor *_actor = (ClutterActor *) (actor); \ - if (CLUTTER_IS_GROUP ((group)) && CLUTTER_IS_ACTOR ((_actor))) \ - { \ - ClutterContainer *_container = (ClutterContainer *) (group); \ - clutter_container_add_actor (_container, _actor); \ - } } G_STMT_END - -#endif /* CLUTTER_DISABLE_DEPRECATED */ - -G_END_DECLS - -#endif /* __CLUTTER_GROUP_DEPRECATED_H__ */ diff --git a/clutter/deprecated/clutter-input-device-deprecated.c b/clutter/deprecated/clutter-input-device-deprecated.c deleted file mode 100644 index 6fd53fe91..000000000 --- a/clutter/deprecated/clutter-input-device-deprecated.c +++ /dev/null @@ -1,38 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#define CLUTTER_DISABLE_DEPRECATION_WARNINGS - -#include "clutter-device-manager-private.h" -#include "deprecated/clutter-input-device.h" - -/** - * clutter_input_device_get_device_coords: - * @device: a #ClutterInputDevice of type %CLUTTER_POINTER_DEVICE - * @x: (out): return location for the X coordinate - * @y: (out): return location for the Y coordinate - * - * Retrieves the latest coordinates of the pointer of @device - * - * - * - * Deprecated: 1.12: Use clutter_input_device_get_coords() instead. - */ -void -clutter_input_device_get_device_coords (ClutterInputDevice *device, - gint *x, - gint *y) -{ - ClutterPoint point; - - clutter_input_device_get_coords (device, NULL, &point); - - if (x) - *x = point.x; - - if (y) - *y = point.y; -} diff --git a/clutter/deprecated/clutter-input-device.h b/clutter/deprecated/clutter-input-device.h deleted file mode 100644 index 692459d20..000000000 --- a/clutter/deprecated/clutter-input-device.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Copyright © 2009, 2010, 2011 Intel Corp. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - * Author: Emmanuele Bassi - */ -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_INPUT_DEVICE_DEPRECATED_H__ -#define __CLUTTER_INPUT_DEVICE_DEPRECATED_H__ - -#include - -G_BEGIN_DECLS - -CLUTTER_DEPRECATED_IN_1_12_FOR(clutter_input_device_get_coords) -void clutter_input_device_get_device_coords (ClutterInputDevice *device, - gint *x, - gint *y); - -G_END_DECLS - -#endif /* __CLUTTER_INPUT_DEVICE_DEPRECATED_H__ */ diff --git a/clutter/deprecated/clutter-keysyms.h b/clutter/deprecated/clutter-keysyms.h deleted file mode 100644 index ad99ee2ff..000000000 --- a/clutter/deprecated/clutter-keysyms.h +++ /dev/null @@ -1,2306 +0,0 @@ -/* Clutter - * - * Copyright (C) 2006, 2007, 2008 OpenedHand Ltd - * Copyright (C) 2009, 2010 Intel Corp - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -/* - * Compatibility version of clutter-keysyms.h. - * - * Since Clutter 1.4, the key symbol defines have been changed to have - * a KEY_ prefix. This is a compatibility header that is included when - * deprecated symbols are enabled. Consider porting to the new names - * instead. - */ - -#ifndef __CLUTTER_KEYSYMS_DEPRECATED_H__ -#define __CLUTTER_KEYSYMS_DEPRECATED_H__ - -#ifndef CLUTTER_DISABLE_DEPRECATED - -#define CLUTTER_VoidSymbol 0xffffff -#define CLUTTER_BackSpace 0xff08 -#define CLUTTER_Tab 0xff09 -#define CLUTTER_Linefeed 0xff0a -#define CLUTTER_Clear 0xff0b -#define CLUTTER_Return 0xff0d -#define CLUTTER_Pause 0xff13 -#define CLUTTER_Scroll_Lock 0xff14 -#define CLUTTER_Sys_Req 0xff15 -#define CLUTTER_Escape 0xff1b -#define CLUTTER_Delete 0xffff -#define CLUTTER_Multi_key 0xff20 -#define CLUTTER_Codeinput 0xff37 -#define CLUTTER_SingleCandidate 0xff3c -#define CLUTTER_MultipleCandidate 0xff3d -#define CLUTTER_PreviousCandidate 0xff3e -#define CLUTTER_Kanji 0xff21 -#define CLUTTER_Muhenkan 0xff22 -#define CLUTTER_Henkan_Mode 0xff23 -#define CLUTTER_Henkan 0xff23 -#define CLUTTER_Romaji 0xff24 -#define CLUTTER_Hiragana 0xff25 -#define CLUTTER_Katakana 0xff26 -#define CLUTTER_Hiragana_Katakana 0xff27 -#define CLUTTER_Zenkaku 0xff28 -#define CLUTTER_Hankaku 0xff29 -#define CLUTTER_Zenkaku_Hankaku 0xff2a -#define CLUTTER_Touroku 0xff2b -#define CLUTTER_Massyo 0xff2c -#define CLUTTER_Kana_Lock 0xff2d -#define CLUTTER_Kana_Shift 0xff2e -#define CLUTTER_Eisu_Shift 0xff2f -#define CLUTTER_Eisu_toggle 0xff30 -#define CLUTTER_Kanji_Bangou 0xff37 -#define CLUTTER_Zen_Koho 0xff3d -#define CLUTTER_Mae_Koho 0xff3e -#define CLUTTER_Home 0xff50 -#define CLUTTER_Left 0xff51 -#define CLUTTER_Up 0xff52 -#define CLUTTER_Right 0xff53 -#define CLUTTER_Down 0xff54 -#define CLUTTER_Prior 0xff55 -#define CLUTTER_Page_Up 0xff55 -#define CLUTTER_Next 0xff56 -#define CLUTTER_Page_Down 0xff56 -#define CLUTTER_End 0xff57 -#define CLUTTER_Begin 0xff58 -#define CLUTTER_Select 0xff60 -#define CLUTTER_Print 0xff61 -#define CLUTTER_Execute 0xff62 -#define CLUTTER_Insert 0xff63 -#define CLUTTER_Undo 0xff65 -#define CLUTTER_Redo 0xff66 -#define CLUTTER_Menu 0xff67 -#define CLUTTER_Find 0xff68 -#define CLUTTER_Cancel 0xff69 -#define CLUTTER_Help 0xff6a -#define CLUTTER_Break 0xff6b -#define CLUTTER_Mode_switch 0xff7e -#define CLUTTER_script_switch 0xff7e -#define CLUTTER_Num_Lock 0xff7f -#define CLUTTER_KP_Space 0xff80 -#define CLUTTER_KP_Tab 0xff89 -#define CLUTTER_KP_Enter 0xff8d -#define CLUTTER_KP_F1 0xff91 -#define CLUTTER_KP_F2 0xff92 -#define CLUTTER_KP_F3 0xff93 -#define CLUTTER_KP_F4 0xff94 -#define CLUTTER_KP_Home 0xff95 -#define CLUTTER_KP_Left 0xff96 -#define CLUTTER_KP_Up 0xff97 -#define CLUTTER_KP_Right 0xff98 -#define CLUTTER_KP_Down 0xff99 -#define CLUTTER_KP_Prior 0xff9a -#define CLUTTER_KP_Page_Up 0xff9a -#define CLUTTER_KP_Next 0xff9b -#define CLUTTER_KP_Page_Down 0xff9b -#define CLUTTER_KP_End 0xff9c -#define CLUTTER_KP_Begin 0xff9d -#define CLUTTER_KP_Insert 0xff9e -#define CLUTTER_KP_Delete 0xff9f -#define CLUTTER_KP_Equal 0xffbd -#define CLUTTER_KP_Multiply 0xffaa -#define CLUTTER_KP_Add 0xffab -#define CLUTTER_KP_Separator 0xffac -#define CLUTTER_KP_Subtract 0xffad -#define CLUTTER_KP_Decimal 0xffae -#define CLUTTER_KP_Divide 0xffaf -#define CLUTTER_KP_0 0xffb0 -#define CLUTTER_KP_1 0xffb1 -#define CLUTTER_KP_2 0xffb2 -#define CLUTTER_KP_3 0xffb3 -#define CLUTTER_KP_4 0xffb4 -#define CLUTTER_KP_5 0xffb5 -#define CLUTTER_KP_6 0xffb6 -#define CLUTTER_KP_7 0xffb7 -#define CLUTTER_KP_8 0xffb8 -#define CLUTTER_KP_9 0xffb9 -#define CLUTTER_F1 0xffbe -#define CLUTTER_F2 0xffbf -#define CLUTTER_F3 0xffc0 -#define CLUTTER_F4 0xffc1 -#define CLUTTER_F5 0xffc2 -#define CLUTTER_F6 0xffc3 -#define CLUTTER_F7 0xffc4 -#define CLUTTER_F8 0xffc5 -#define CLUTTER_F9 0xffc6 -#define CLUTTER_F10 0xffc7 -#define CLUTTER_F11 0xffc8 -#define CLUTTER_L1 0xffc8 -#define CLUTTER_F12 0xffc9 -#define CLUTTER_L2 0xffc9 -#define CLUTTER_F13 0xffca -#define CLUTTER_L3 0xffca -#define CLUTTER_F14 0xffcb -#define CLUTTER_L4 0xffcb -#define CLUTTER_F15 0xffcc -#define CLUTTER_L5 0xffcc -#define CLUTTER_F16 0xffcd -#define CLUTTER_L6 0xffcd -#define CLUTTER_F17 0xffce -#define CLUTTER_L7 0xffce -#define CLUTTER_F18 0xffcf -#define CLUTTER_L8 0xffcf -#define CLUTTER_F19 0xffd0 -#define CLUTTER_L9 0xffd0 -#define CLUTTER_F20 0xffd1 -#define CLUTTER_L10 0xffd1 -#define CLUTTER_F21 0xffd2 -#define CLUTTER_R1 0xffd2 -#define CLUTTER_F22 0xffd3 -#define CLUTTER_R2 0xffd3 -#define CLUTTER_F23 0xffd4 -#define CLUTTER_R3 0xffd4 -#define CLUTTER_F24 0xffd5 -#define CLUTTER_R4 0xffd5 -#define CLUTTER_F25 0xffd6 -#define CLUTTER_R5 0xffd6 -#define CLUTTER_F26 0xffd7 -#define CLUTTER_R6 0xffd7 -#define CLUTTER_F27 0xffd8 -#define CLUTTER_R7 0xffd8 -#define CLUTTER_F28 0xffd9 -#define CLUTTER_R8 0xffd9 -#define CLUTTER_F29 0xffda -#define CLUTTER_R9 0xffda -#define CLUTTER_F30 0xffdb -#define CLUTTER_R10 0xffdb -#define CLUTTER_F31 0xffdc -#define CLUTTER_R11 0xffdc -#define CLUTTER_F32 0xffdd -#define CLUTTER_R12 0xffdd -#define CLUTTER_F33 0xffde -#define CLUTTER_R13 0xffde -#define CLUTTER_F34 0xffdf -#define CLUTTER_R14 0xffdf -#define CLUTTER_F35 0xffe0 -#define CLUTTER_R15 0xffe0 -#define CLUTTER_Shift_L 0xffe1 -#define CLUTTER_Shift_R 0xffe2 -#define CLUTTER_Control_L 0xffe3 -#define CLUTTER_Control_R 0xffe4 -#define CLUTTER_Caps_Lock 0xffe5 -#define CLUTTER_Shift_Lock 0xffe6 -#define CLUTTER_Meta_L 0xffe7 -#define CLUTTER_Meta_R 0xffe8 -#define CLUTTER_Alt_L 0xffe9 -#define CLUTTER_Alt_R 0xffea -#define CLUTTER_Super_L 0xffeb -#define CLUTTER_Super_R 0xffec -#define CLUTTER_Hyper_L 0xffed -#define CLUTTER_Hyper_R 0xffee -#define CLUTTER_ISO_Lock 0xfe01 -#define CLUTTER_ISO_Level2_Latch 0xfe02 -#define CLUTTER_ISO_Level3_Shift 0xfe03 -#define CLUTTER_ISO_Level3_Latch 0xfe04 -#define CLUTTER_ISO_Level3_Lock 0xfe05 -#define CLUTTER_ISO_Level5_Shift 0xfe11 -#define CLUTTER_ISO_Level5_Latch 0xfe12 -#define CLUTTER_ISO_Level5_Lock 0xfe13 -#define CLUTTER_ISO_Group_Shift 0xff7e -#define CLUTTER_ISO_Group_Latch 0xfe06 -#define CLUTTER_ISO_Group_Lock 0xfe07 -#define CLUTTER_ISO_Next_Group 0xfe08 -#define CLUTTER_ISO_Next_Group_Lock 0xfe09 -#define CLUTTER_ISO_Prev_Group 0xfe0a -#define CLUTTER_ISO_Prev_Group_Lock 0xfe0b -#define CLUTTER_ISO_First_Group 0xfe0c -#define CLUTTER_ISO_First_Group_Lock 0xfe0d -#define CLUTTER_ISO_Last_Group 0xfe0e -#define CLUTTER_ISO_Last_Group_Lock 0xfe0f -#define CLUTTER_ISO_Left_Tab 0xfe20 -#define CLUTTER_ISO_Move_Line_Up 0xfe21 -#define CLUTTER_ISO_Move_Line_Down 0xfe22 -#define CLUTTER_ISO_Partial_Line_Up 0xfe23 -#define CLUTTER_ISO_Partial_Line_Down 0xfe24 -#define CLUTTER_ISO_Partial_Space_Left 0xfe25 -#define CLUTTER_ISO_Partial_Space_Right 0xfe26 -#define CLUTTER_ISO_Set_Margin_Left 0xfe27 -#define CLUTTER_ISO_Set_Margin_Right 0xfe28 -#define CLUTTER_ISO_Release_Margin_Left 0xfe29 -#define CLUTTER_ISO_Release_Margin_Right 0xfe2a -#define CLUTTER_ISO_Release_Both_Margins 0xfe2b -#define CLUTTER_ISO_Fast_Cursor_Left 0xfe2c -#define CLUTTER_ISO_Fast_Cursor_Right 0xfe2d -#define CLUTTER_ISO_Fast_Cursor_Up 0xfe2e -#define CLUTTER_ISO_Fast_Cursor_Down 0xfe2f -#define CLUTTER_ISO_Continuous_Underline 0xfe30 -#define CLUTTER_ISO_Discontinuous_Underline 0xfe31 -#define CLUTTER_ISO_Emphasize 0xfe32 -#define CLUTTER_ISO_Center_Object 0xfe33 -#define CLUTTER_ISO_Enter 0xfe34 -#define CLUTTER_dead_grave 0xfe50 -#define CLUTTER_dead_acute 0xfe51 -#define CLUTTER_dead_circumflex 0xfe52 -#define CLUTTER_dead_tilde 0xfe53 -#define CLUTTER_dead_perispomeni 0xfe53 -#define CLUTTER_dead_macron 0xfe54 -#define CLUTTER_dead_breve 0xfe55 -#define CLUTTER_dead_abovedot 0xfe56 -#define CLUTTER_dead_diaeresis 0xfe57 -#define CLUTTER_dead_abovering 0xfe58 -#define CLUTTER_dead_doubleacute 0xfe59 -#define CLUTTER_dead_caron 0xfe5a -#define CLUTTER_dead_cedilla 0xfe5b -#define CLUTTER_dead_ogonek 0xfe5c -#define CLUTTER_dead_iota 0xfe5d -#define CLUTTER_dead_voiced_sound 0xfe5e -#define CLUTTER_dead_semivoiced_sound 0xfe5f -#define CLUTTER_dead_belowdot 0xfe60 -#define CLUTTER_dead_hook 0xfe61 -#define CLUTTER_dead_horn 0xfe62 -#define CLUTTER_dead_stroke 0xfe63 -#define CLUTTER_dead_abovecomma 0xfe64 -#define CLUTTER_dead_psili 0xfe64 -#define CLUTTER_dead_abovereversedcomma 0xfe65 -#define CLUTTER_dead_dasia 0xfe65 -#define CLUTTER_dead_doublegrave 0xfe66 -#define CLUTTER_dead_belowring 0xfe67 -#define CLUTTER_dead_belowmacron 0xfe68 -#define CLUTTER_dead_belowcircumflex 0xfe69 -#define CLUTTER_dead_belowtilde 0xfe6a -#define CLUTTER_dead_belowbreve 0xfe6b -#define CLUTTER_dead_belowdiaeresis 0xfe6c -#define CLUTTER_dead_invertedbreve 0xfe6d -#define CLUTTER_dead_belowcomma 0xfe6e -#define CLUTTER_dead_currency 0xfe6f -#define CLUTTER_dead_a 0xfe80 -#define CLUTTER_dead_A 0xfe81 -#define CLUTTER_dead_e 0xfe82 -#define CLUTTER_dead_E 0xfe83 -#define CLUTTER_dead_i 0xfe84 -#define CLUTTER_dead_I 0xfe85 -#define CLUTTER_dead_o 0xfe86 -#define CLUTTER_dead_O 0xfe87 -#define CLUTTER_dead_u 0xfe88 -#define CLUTTER_dead_U 0xfe89 -#define CLUTTER_dead_small_schwa 0xfe8a -#define CLUTTER_dead_capital_schwa 0xfe8b -#define CLUTTER_dead_greek 0xfe8c -#define CLUTTER_First_Virtual_Screen 0xfed0 -#define CLUTTER_Prev_Virtual_Screen 0xfed1 -#define CLUTTER_Next_Virtual_Screen 0xfed2 -#define CLUTTER_Last_Virtual_Screen 0xfed4 -#define CLUTTER_Terminate_Server 0xfed5 -#define CLUTTER_AccessX_Enable 0xfe70 -#define CLUTTER_AccessX_Feedback_Enable 0xfe71 -#define CLUTTER_RepeatKeys_Enable 0xfe72 -#define CLUTTER_SlowKeys_Enable 0xfe73 -#define CLUTTER_BounceKeys_Enable 0xfe74 -#define CLUTTER_StickyKeys_Enable 0xfe75 -#define CLUTTER_MouseKeys_Enable 0xfe76 -#define CLUTTER_MouseKeys_Accel_Enable 0xfe77 -#define CLUTTER_Overlay1_Enable 0xfe78 -#define CLUTTER_Overlay2_Enable 0xfe79 -#define CLUTTER_AudibleBell_Enable 0xfe7a -#define CLUTTER_Pointer_Left 0xfee0 -#define CLUTTER_Pointer_Right 0xfee1 -#define CLUTTER_Pointer_Up 0xfee2 -#define CLUTTER_Pointer_Down 0xfee3 -#define CLUTTER_Pointer_UpLeft 0xfee4 -#define CLUTTER_Pointer_UpRight 0xfee5 -#define CLUTTER_Pointer_DownLeft 0xfee6 -#define CLUTTER_Pointer_DownRight 0xfee7 -#define CLUTTER_Pointer_Button_Dflt 0xfee8 -#define CLUTTER_Pointer_Button1 0xfee9 -#define CLUTTER_Pointer_Button2 0xfeea -#define CLUTTER_Pointer_Button3 0xfeeb -#define CLUTTER_Pointer_Button4 0xfeec -#define CLUTTER_Pointer_Button5 0xfeed -#define CLUTTER_Pointer_DblClick_Dflt 0xfeee -#define CLUTTER_Pointer_DblClick1 0xfeef -#define CLUTTER_Pointer_DblClick2 0xfef0 -#define CLUTTER_Pointer_DblClick3 0xfef1 -#define CLUTTER_Pointer_DblClick4 0xfef2 -#define CLUTTER_Pointer_DblClick5 0xfef3 -#define CLUTTER_Pointer_Drag_Dflt 0xfef4 -#define CLUTTER_Pointer_Drag1 0xfef5 -#define CLUTTER_Pointer_Drag2 0xfef6 -#define CLUTTER_Pointer_Drag3 0xfef7 -#define CLUTTER_Pointer_Drag4 0xfef8 -#define CLUTTER_Pointer_Drag5 0xfefd -#define CLUTTER_Pointer_EnableKeys 0xfef9 -#define CLUTTER_Pointer_Accelerate 0xfefa -#define CLUTTER_Pointer_DfltBtnNext 0xfefb -#define CLUTTER_Pointer_DfltBtnPrev 0xfefc -#define CLUTTER_ch 0xfea0 -#define CLUTTER_Ch 0xfea1 -#define CLUTTER_CH 0xfea2 -#define CLUTTER_c_h 0xfea3 -#define CLUTTER_C_h 0xfea4 -#define CLUTTER_C_H 0xfea5 -#define CLUTTER_3270_Duplicate 0xfd01 -#define CLUTTER_3270_FieldMark 0xfd02 -#define CLUTTER_3270_Right2 0xfd03 -#define CLUTTER_3270_Left2 0xfd04 -#define CLUTTER_3270_BackTab 0xfd05 -#define CLUTTER_3270_EraseEOF 0xfd06 -#define CLUTTER_3270_EraseInput 0xfd07 -#define CLUTTER_3270_Reset 0xfd08 -#define CLUTTER_3270_Quit 0xfd09 -#define CLUTTER_3270_PA1 0xfd0a -#define CLUTTER_3270_PA2 0xfd0b -#define CLUTTER_3270_PA3 0xfd0c -#define CLUTTER_3270_Test 0xfd0d -#define CLUTTER_3270_Attn 0xfd0e -#define CLUTTER_3270_CursorBlink 0xfd0f -#define CLUTTER_3270_AltCursor 0xfd10 -#define CLUTTER_3270_KeyClick 0xfd11 -#define CLUTTER_3270_Jump 0xfd12 -#define CLUTTER_3270_Ident 0xfd13 -#define CLUTTER_3270_Rule 0xfd14 -#define CLUTTER_3270_Copy 0xfd15 -#define CLUTTER_3270_Play 0xfd16 -#define CLUTTER_3270_Setup 0xfd17 -#define CLUTTER_3270_Record 0xfd18 -#define CLUTTER_3270_ChangeScreen 0xfd19 -#define CLUTTER_3270_DeleteWord 0xfd1a -#define CLUTTER_3270_ExSelect 0xfd1b -#define CLUTTER_3270_CursorSelect 0xfd1c -#define CLUTTER_3270_PrintScreen 0xfd1d -#define CLUTTER_3270_Enter 0xfd1e -#define CLUTTER_space 0x020 -#define CLUTTER_exclam 0x021 -#define CLUTTER_quotedbl 0x022 -#define CLUTTER_numbersign 0x023 -#define CLUTTER_dollar 0x024 -#define CLUTTER_percent 0x025 -#define CLUTTER_ampersand 0x026 -#define CLUTTER_apostrophe 0x027 -#define CLUTTER_quoteright 0x027 -#define CLUTTER_parenleft 0x028 -#define CLUTTER_parenright 0x029 -#define CLUTTER_asterisk 0x02a -#define CLUTTER_plus 0x02b -#define CLUTTER_comma 0x02c -#define CLUTTER_minus 0x02d -#define CLUTTER_period 0x02e -#define CLUTTER_slash 0x02f -#define CLUTTER_0 0x030 -#define CLUTTER_1 0x031 -#define CLUTTER_2 0x032 -#define CLUTTER_3 0x033 -#define CLUTTER_4 0x034 -#define CLUTTER_5 0x035 -#define CLUTTER_6 0x036 -#define CLUTTER_7 0x037 -#define CLUTTER_8 0x038 -#define CLUTTER_9 0x039 -#define CLUTTER_colon 0x03a -#define CLUTTER_semicolon 0x03b -#define CLUTTER_less 0x03c -#define CLUTTER_equal 0x03d -#define CLUTTER_greater 0x03e -#define CLUTTER_question 0x03f -#define CLUTTER_at 0x040 -#define CLUTTER_A 0x041 -#define CLUTTER_B 0x042 -#define CLUTTER_C 0x043 -#define CLUTTER_D 0x044 -#define CLUTTER_E 0x045 -#define CLUTTER_F 0x046 -#define CLUTTER_G 0x047 -#define CLUTTER_H 0x048 -#define CLUTTER_I 0x049 -#define CLUTTER_J 0x04a -#define CLUTTER_K 0x04b -#define CLUTTER_L 0x04c -#define CLUTTER_M 0x04d -#define CLUTTER_N 0x04e -#define CLUTTER_O 0x04f -#define CLUTTER_P 0x050 -#define CLUTTER_Q 0x051 -#define CLUTTER_R 0x052 -#define CLUTTER_S 0x053 -#define CLUTTER_T 0x054 -#define CLUTTER_U 0x055 -#define CLUTTER_V 0x056 -#define CLUTTER_W 0x057 -#define CLUTTER_X 0x058 -#define CLUTTER_Y 0x059 -#define CLUTTER_Z 0x05a -#define CLUTTER_bracketleft 0x05b -#define CLUTTER_backslash 0x05c -#define CLUTTER_bracketright 0x05d -#define CLUTTER_asciicircum 0x05e -#define CLUTTER_underscore 0x05f -#define CLUTTER_grave 0x060 -#define CLUTTER_quoteleft 0x060 -#define CLUTTER_a 0x061 -#define CLUTTER_b 0x062 -#define CLUTTER_c 0x063 -#define CLUTTER_d 0x064 -#define CLUTTER_e 0x065 -#define CLUTTER_f 0x066 -#define CLUTTER_g 0x067 -#define CLUTTER_h 0x068 -#define CLUTTER_i 0x069 -#define CLUTTER_j 0x06a -#define CLUTTER_k 0x06b -#define CLUTTER_l 0x06c -#define CLUTTER_m 0x06d -#define CLUTTER_n 0x06e -#define CLUTTER_o 0x06f -#define CLUTTER_p 0x070 -#define CLUTTER_q 0x071 -#define CLUTTER_r 0x072 -#define CLUTTER_s 0x073 -#define CLUTTER_t 0x074 -#define CLUTTER_u 0x075 -#define CLUTTER_v 0x076 -#define CLUTTER_w 0x077 -#define CLUTTER_x 0x078 -#define CLUTTER_y 0x079 -#define CLUTTER_z 0x07a -#define CLUTTER_braceleft 0x07b -#define CLUTTER_bar 0x07c -#define CLUTTER_braceright 0x07d -#define CLUTTER_asciitilde 0x07e -#define CLUTTER_nobreakspace 0x0a0 -#define CLUTTER_exclamdown 0x0a1 -#define CLUTTER_cent 0x0a2 -#define CLUTTER_sterling 0x0a3 -#define CLUTTER_currency 0x0a4 -#define CLUTTER_yen 0x0a5 -#define CLUTTER_brokenbar 0x0a6 -#define CLUTTER_section 0x0a7 -#define CLUTTER_diaeresis 0x0a8 -#define CLUTTER_copyright 0x0a9 -#define CLUTTER_ordfeminine 0x0aa -#define CLUTTER_guillemotleft 0x0ab -#define CLUTTER_notsign 0x0ac -#define CLUTTER_hyphen 0x0ad -#define CLUTTER_registered 0x0ae -#define CLUTTER_macron 0x0af -#define CLUTTER_degree 0x0b0 -#define CLUTTER_plusminus 0x0b1 -#define CLUTTER_twosuperior 0x0b2 -#define CLUTTER_threesuperior 0x0b3 -#define CLUTTER_acute 0x0b4 -#define CLUTTER_mu 0x0b5 -#define CLUTTER_paragraph 0x0b6 -#define CLUTTER_periodcentered 0x0b7 -#define CLUTTER_cedilla 0x0b8 -#define CLUTTER_onesuperior 0x0b9 -#define CLUTTER_masculine 0x0ba -#define CLUTTER_guillemotright 0x0bb -#define CLUTTER_onequarter 0x0bc -#define CLUTTER_onehalf 0x0bd -#define CLUTTER_threequarters 0x0be -#define CLUTTER_questiondown 0x0bf -#define CLUTTER_Agrave 0x0c0 -#define CLUTTER_Aacute 0x0c1 -#define CLUTTER_Acircumflex 0x0c2 -#define CLUTTER_Atilde 0x0c3 -#define CLUTTER_Adiaeresis 0x0c4 -#define CLUTTER_Aring 0x0c5 -#define CLUTTER_AE 0x0c6 -#define CLUTTER_Ccedilla 0x0c7 -#define CLUTTER_Egrave 0x0c8 -#define CLUTTER_Eacute 0x0c9 -#define CLUTTER_Ecircumflex 0x0ca -#define CLUTTER_Ediaeresis 0x0cb -#define CLUTTER_Igrave 0x0cc -#define CLUTTER_Iacute 0x0cd -#define CLUTTER_Icircumflex 0x0ce -#define CLUTTER_Idiaeresis 0x0cf -#define CLUTTER_ETH 0x0d0 -#define CLUTTER_Eth 0x0d0 -#define CLUTTER_Ntilde 0x0d1 -#define CLUTTER_Ograve 0x0d2 -#define CLUTTER_Oacute 0x0d3 -#define CLUTTER_Ocircumflex 0x0d4 -#define CLUTTER_Otilde 0x0d5 -#define CLUTTER_Odiaeresis 0x0d6 -#define CLUTTER_multiply 0x0d7 -#define CLUTTER_Oslash 0x0d8 -#define CLUTTER_Ooblique 0x0d8 -#define CLUTTER_Ugrave 0x0d9 -#define CLUTTER_Uacute 0x0da -#define CLUTTER_Ucircumflex 0x0db -#define CLUTTER_Udiaeresis 0x0dc -#define CLUTTER_Yacute 0x0dd -#define CLUTTER_THORN 0x0de -#define CLUTTER_Thorn 0x0de -#define CLUTTER_ssharp 0x0df -#define CLUTTER_agrave 0x0e0 -#define CLUTTER_aacute 0x0e1 -#define CLUTTER_acircumflex 0x0e2 -#define CLUTTER_atilde 0x0e3 -#define CLUTTER_adiaeresis 0x0e4 -#define CLUTTER_aring 0x0e5 -#define CLUTTER_ae 0x0e6 -#define CLUTTER_ccedilla 0x0e7 -#define CLUTTER_egrave 0x0e8 -#define CLUTTER_eacute 0x0e9 -#define CLUTTER_ecircumflex 0x0ea -#define CLUTTER_ediaeresis 0x0eb -#define CLUTTER_igrave 0x0ec -#define CLUTTER_iacute 0x0ed -#define CLUTTER_icircumflex 0x0ee -#define CLUTTER_idiaeresis 0x0ef -#define CLUTTER_eth 0x0f0 -#define CLUTTER_ntilde 0x0f1 -#define CLUTTER_ograve 0x0f2 -#define CLUTTER_oacute 0x0f3 -#define CLUTTER_ocircumflex 0x0f4 -#define CLUTTER_otilde 0x0f5 -#define CLUTTER_odiaeresis 0x0f6 -#define CLUTTER_division 0x0f7 -#define CLUTTER_oslash 0x0f8 -#define CLUTTER_ooblique 0x0f8 -#define CLUTTER_ugrave 0x0f9 -#define CLUTTER_uacute 0x0fa -#define CLUTTER_ucircumflex 0x0fb -#define CLUTTER_udiaeresis 0x0fc -#define CLUTTER_yacute 0x0fd -#define CLUTTER_thorn 0x0fe -#define CLUTTER_ydiaeresis 0x0ff -#define CLUTTER_Aogonek 0x1a1 -#define CLUTTER_breve 0x1a2 -#define CLUTTER_Lstroke 0x1a3 -#define CLUTTER_Lcaron 0x1a5 -#define CLUTTER_Sacute 0x1a6 -#define CLUTTER_Scaron 0x1a9 -#define CLUTTER_Scedilla 0x1aa -#define CLUTTER_Tcaron 0x1ab -#define CLUTTER_Zacute 0x1ac -#define CLUTTER_Zcaron 0x1ae -#define CLUTTER_Zabovedot 0x1af -#define CLUTTER_aogonek 0x1b1 -#define CLUTTER_ogonek 0x1b2 -#define CLUTTER_lstroke 0x1b3 -#define CLUTTER_lcaron 0x1b5 -#define CLUTTER_sacute 0x1b6 -#define CLUTTER_caron 0x1b7 -#define CLUTTER_scaron 0x1b9 -#define CLUTTER_scedilla 0x1ba -#define CLUTTER_tcaron 0x1bb -#define CLUTTER_zacute 0x1bc -#define CLUTTER_doubleacute 0x1bd -#define CLUTTER_zcaron 0x1be -#define CLUTTER_zabovedot 0x1bf -#define CLUTTER_Racute 0x1c0 -#define CLUTTER_Abreve 0x1c3 -#define CLUTTER_Lacute 0x1c5 -#define CLUTTER_Cacute 0x1c6 -#define CLUTTER_Ccaron 0x1c8 -#define CLUTTER_Eogonek 0x1ca -#define CLUTTER_Ecaron 0x1cc -#define CLUTTER_Dcaron 0x1cf -#define CLUTTER_Dstroke 0x1d0 -#define CLUTTER_Nacute 0x1d1 -#define CLUTTER_Ncaron 0x1d2 -#define CLUTTER_Odoubleacute 0x1d5 -#define CLUTTER_Rcaron 0x1d8 -#define CLUTTER_Uring 0x1d9 -#define CLUTTER_Udoubleacute 0x1db -#define CLUTTER_Tcedilla 0x1de -#define CLUTTER_racute 0x1e0 -#define CLUTTER_abreve 0x1e3 -#define CLUTTER_lacute 0x1e5 -#define CLUTTER_cacute 0x1e6 -#define CLUTTER_ccaron 0x1e8 -#define CLUTTER_eogonek 0x1ea -#define CLUTTER_ecaron 0x1ec -#define CLUTTER_dcaron 0x1ef -#define CLUTTER_dstroke 0x1f0 -#define CLUTTER_nacute 0x1f1 -#define CLUTTER_ncaron 0x1f2 -#define CLUTTER_odoubleacute 0x1f5 -#define CLUTTER_rcaron 0x1f8 -#define CLUTTER_uring 0x1f9 -#define CLUTTER_udoubleacute 0x1fb -#define CLUTTER_tcedilla 0x1fe -#define CLUTTER_abovedot 0x1ff -#define CLUTTER_Hstroke 0x2a1 -#define CLUTTER_Hcircumflex 0x2a6 -#define CLUTTER_Iabovedot 0x2a9 -#define CLUTTER_Gbreve 0x2ab -#define CLUTTER_Jcircumflex 0x2ac -#define CLUTTER_hstroke 0x2b1 -#define CLUTTER_hcircumflex 0x2b6 -#define CLUTTER_idotless 0x2b9 -#define CLUTTER_gbreve 0x2bb -#define CLUTTER_jcircumflex 0x2bc -#define CLUTTER_Cabovedot 0x2c5 -#define CLUTTER_Ccircumflex 0x2c6 -#define CLUTTER_Gabovedot 0x2d5 -#define CLUTTER_Gcircumflex 0x2d8 -#define CLUTTER_Ubreve 0x2dd -#define CLUTTER_Scircumflex 0x2de -#define CLUTTER_cabovedot 0x2e5 -#define CLUTTER_ccircumflex 0x2e6 -#define CLUTTER_gabovedot 0x2f5 -#define CLUTTER_gcircumflex 0x2f8 -#define CLUTTER_ubreve 0x2fd -#define CLUTTER_scircumflex 0x2fe -#define CLUTTER_kra 0x3a2 -#define CLUTTER_kappa 0x3a2 -#define CLUTTER_Rcedilla 0x3a3 -#define CLUTTER_Itilde 0x3a5 -#define CLUTTER_Lcedilla 0x3a6 -#define CLUTTER_Emacron 0x3aa -#define CLUTTER_Gcedilla 0x3ab -#define CLUTTER_Tslash 0x3ac -#define CLUTTER_rcedilla 0x3b3 -#define CLUTTER_itilde 0x3b5 -#define CLUTTER_lcedilla 0x3b6 -#define CLUTTER_emacron 0x3ba -#define CLUTTER_gcedilla 0x3bb -#define CLUTTER_tslash 0x3bc -#define CLUTTER_ENG 0x3bd -#define CLUTTER_eng 0x3bf -#define CLUTTER_Amacron 0x3c0 -#define CLUTTER_Iogonek 0x3c7 -#define CLUTTER_Eabovedot 0x3cc -#define CLUTTER_Imacron 0x3cf -#define CLUTTER_Ncedilla 0x3d1 -#define CLUTTER_Omacron 0x3d2 -#define CLUTTER_Kcedilla 0x3d3 -#define CLUTTER_Uogonek 0x3d9 -#define CLUTTER_Utilde 0x3dd -#define CLUTTER_Umacron 0x3de -#define CLUTTER_amacron 0x3e0 -#define CLUTTER_iogonek 0x3e7 -#define CLUTTER_eabovedot 0x3ec -#define CLUTTER_imacron 0x3ef -#define CLUTTER_ncedilla 0x3f1 -#define CLUTTER_omacron 0x3f2 -#define CLUTTER_kcedilla 0x3f3 -#define CLUTTER_uogonek 0x3f9 -#define CLUTTER_utilde 0x3fd -#define CLUTTER_umacron 0x3fe -#define CLUTTER_Wcircumflex 0x1000174 -#define CLUTTER_wcircumflex 0x1000175 -#define CLUTTER_Ycircumflex 0x1000176 -#define CLUTTER_ycircumflex 0x1000177 -#define CLUTTER_Babovedot 0x1001e02 -#define CLUTTER_babovedot 0x1001e03 -#define CLUTTER_Dabovedot 0x1001e0a -#define CLUTTER_dabovedot 0x1001e0b -#define CLUTTER_Fabovedot 0x1001e1e -#define CLUTTER_fabovedot 0x1001e1f -#define CLUTTER_Mabovedot 0x1001e40 -#define CLUTTER_mabovedot 0x1001e41 -#define CLUTTER_Pabovedot 0x1001e56 -#define CLUTTER_pabovedot 0x1001e57 -#define CLUTTER_Sabovedot 0x1001e60 -#define CLUTTER_sabovedot 0x1001e61 -#define CLUTTER_Tabovedot 0x1001e6a -#define CLUTTER_tabovedot 0x1001e6b -#define CLUTTER_Wgrave 0x1001e80 -#define CLUTTER_wgrave 0x1001e81 -#define CLUTTER_Wacute 0x1001e82 -#define CLUTTER_wacute 0x1001e83 -#define CLUTTER_Wdiaeresis 0x1001e84 -#define CLUTTER_wdiaeresis 0x1001e85 -#define CLUTTER_Ygrave 0x1001ef2 -#define CLUTTER_ygrave 0x1001ef3 -#define CLUTTER_OE 0x13bc -#define CLUTTER_oe 0x13bd -#define CLUTTER_Ydiaeresis 0x13be -#define CLUTTER_overline 0x47e -#define CLUTTER_kana_fullstop 0x4a1 -#define CLUTTER_kana_openingbracket 0x4a2 -#define CLUTTER_kana_closingbracket 0x4a3 -#define CLUTTER_kana_comma 0x4a4 -#define CLUTTER_kana_conjunctive 0x4a5 -#define CLUTTER_kana_middledot 0x4a5 -#define CLUTTER_kana_WO 0x4a6 -#define CLUTTER_kana_a 0x4a7 -#define CLUTTER_kana_i 0x4a8 -#define CLUTTER_kana_u 0x4a9 -#define CLUTTER_kana_e 0x4aa -#define CLUTTER_kana_o 0x4ab -#define CLUTTER_kana_ya 0x4ac -#define CLUTTER_kana_yu 0x4ad -#define CLUTTER_kana_yo 0x4ae -#define CLUTTER_kana_tsu 0x4af -#define CLUTTER_kana_tu 0x4af -#define CLUTTER_prolongedsound 0x4b0 -#define CLUTTER_kana_A 0x4b1 -#define CLUTTER_kana_I 0x4b2 -#define CLUTTER_kana_U 0x4b3 -#define CLUTTER_kana_E 0x4b4 -#define CLUTTER_kana_O 0x4b5 -#define CLUTTER_kana_KA 0x4b6 -#define CLUTTER_kana_KI 0x4b7 -#define CLUTTER_kana_KU 0x4b8 -#define CLUTTER_kana_KE 0x4b9 -#define CLUTTER_kana_KO 0x4ba -#define CLUTTER_kana_SA 0x4bb -#define CLUTTER_kana_SHI 0x4bc -#define CLUTTER_kana_SU 0x4bd -#define CLUTTER_kana_SE 0x4be -#define CLUTTER_kana_SO 0x4bf -#define CLUTTER_kana_TA 0x4c0 -#define CLUTTER_kana_CHI 0x4c1 -#define CLUTTER_kana_TI 0x4c1 -#define CLUTTER_kana_TSU 0x4c2 -#define CLUTTER_kana_TU 0x4c2 -#define CLUTTER_kana_TE 0x4c3 -#define CLUTTER_kana_TO 0x4c4 -#define CLUTTER_kana_NA 0x4c5 -#define CLUTTER_kana_NI 0x4c6 -#define CLUTTER_kana_NU 0x4c7 -#define CLUTTER_kana_NE 0x4c8 -#define CLUTTER_kana_NO 0x4c9 -#define CLUTTER_kana_HA 0x4ca -#define CLUTTER_kana_HI 0x4cb -#define CLUTTER_kana_FU 0x4cc -#define CLUTTER_kana_HU 0x4cc -#define CLUTTER_kana_HE 0x4cd -#define CLUTTER_kana_HO 0x4ce -#define CLUTTER_kana_MA 0x4cf -#define CLUTTER_kana_MI 0x4d0 -#define CLUTTER_kana_MU 0x4d1 -#define CLUTTER_kana_ME 0x4d2 -#define CLUTTER_kana_MO 0x4d3 -#define CLUTTER_kana_YA 0x4d4 -#define CLUTTER_kana_YU 0x4d5 -#define CLUTTER_kana_YO 0x4d6 -#define CLUTTER_kana_RA 0x4d7 -#define CLUTTER_kana_RI 0x4d8 -#define CLUTTER_kana_RU 0x4d9 -#define CLUTTER_kana_RE 0x4da -#define CLUTTER_kana_RO 0x4db -#define CLUTTER_kana_WA 0x4dc -#define CLUTTER_kana_N 0x4dd -#define CLUTTER_voicedsound 0x4de -#define CLUTTER_semivoicedsound 0x4df -#define CLUTTER_kana_switch 0xff7e -#define CLUTTER_Farsi_0 0x10006f0 -#define CLUTTER_Farsi_1 0x10006f1 -#define CLUTTER_Farsi_2 0x10006f2 -#define CLUTTER_Farsi_3 0x10006f3 -#define CLUTTER_Farsi_4 0x10006f4 -#define CLUTTER_Farsi_5 0x10006f5 -#define CLUTTER_Farsi_6 0x10006f6 -#define CLUTTER_Farsi_7 0x10006f7 -#define CLUTTER_Farsi_8 0x10006f8 -#define CLUTTER_Farsi_9 0x10006f9 -#define CLUTTER_Arabic_percent 0x100066a -#define CLUTTER_Arabic_superscript_alef 0x1000670 -#define CLUTTER_Arabic_tteh 0x1000679 -#define CLUTTER_Arabic_peh 0x100067e -#define CLUTTER_Arabic_tcheh 0x1000686 -#define CLUTTER_Arabic_ddal 0x1000688 -#define CLUTTER_Arabic_rreh 0x1000691 -#define CLUTTER_Arabic_comma 0x5ac -#define CLUTTER_Arabic_fullstop 0x10006d4 -#define CLUTTER_Arabic_0 0x1000660 -#define CLUTTER_Arabic_1 0x1000661 -#define CLUTTER_Arabic_2 0x1000662 -#define CLUTTER_Arabic_3 0x1000663 -#define CLUTTER_Arabic_4 0x1000664 -#define CLUTTER_Arabic_5 0x1000665 -#define CLUTTER_Arabic_6 0x1000666 -#define CLUTTER_Arabic_7 0x1000667 -#define CLUTTER_Arabic_8 0x1000668 -#define CLUTTER_Arabic_9 0x1000669 -#define CLUTTER_Arabic_semicolon 0x5bb -#define CLUTTER_Arabic_question_mark 0x5bf -#define CLUTTER_Arabic_hamza 0x5c1 -#define CLUTTER_Arabic_maddaonalef 0x5c2 -#define CLUTTER_Arabic_hamzaonalef 0x5c3 -#define CLUTTER_Arabic_hamzaonwaw 0x5c4 -#define CLUTTER_Arabic_hamzaunderalef 0x5c5 -#define CLUTTER_Arabic_hamzaonyeh 0x5c6 -#define CLUTTER_Arabic_alef 0x5c7 -#define CLUTTER_Arabic_beh 0x5c8 -#define CLUTTER_Arabic_tehmarbuta 0x5c9 -#define CLUTTER_Arabic_teh 0x5ca -#define CLUTTER_Arabic_theh 0x5cb -#define CLUTTER_Arabic_jeem 0x5cc -#define CLUTTER_Arabic_hah 0x5cd -#define CLUTTER_Arabic_khah 0x5ce -#define CLUTTER_Arabic_dal 0x5cf -#define CLUTTER_Arabic_thal 0x5d0 -#define CLUTTER_Arabic_ra 0x5d1 -#define CLUTTER_Arabic_zain 0x5d2 -#define CLUTTER_Arabic_seen 0x5d3 -#define CLUTTER_Arabic_sheen 0x5d4 -#define CLUTTER_Arabic_sad 0x5d5 -#define CLUTTER_Arabic_dad 0x5d6 -#define CLUTTER_Arabic_tah 0x5d7 -#define CLUTTER_Arabic_zah 0x5d8 -#define CLUTTER_Arabic_ain 0x5d9 -#define CLUTTER_Arabic_ghain 0x5da -#define CLUTTER_Arabic_tatweel 0x5e0 -#define CLUTTER_Arabic_feh 0x5e1 -#define CLUTTER_Arabic_qaf 0x5e2 -#define CLUTTER_Arabic_kaf 0x5e3 -#define CLUTTER_Arabic_lam 0x5e4 -#define CLUTTER_Arabic_meem 0x5e5 -#define CLUTTER_Arabic_noon 0x5e6 -#define CLUTTER_Arabic_ha 0x5e7 -#define CLUTTER_Arabic_heh 0x5e7 -#define CLUTTER_Arabic_waw 0x5e8 -#define CLUTTER_Arabic_alefmaksura 0x5e9 -#define CLUTTER_Arabic_yeh 0x5ea -#define CLUTTER_Arabic_fathatan 0x5eb -#define CLUTTER_Arabic_dammatan 0x5ec -#define CLUTTER_Arabic_kasratan 0x5ed -#define CLUTTER_Arabic_fatha 0x5ee -#define CLUTTER_Arabic_damma 0x5ef -#define CLUTTER_Arabic_kasra 0x5f0 -#define CLUTTER_Arabic_shadda 0x5f1 -#define CLUTTER_Arabic_sukun 0x5f2 -#define CLUTTER_Arabic_madda_above 0x1000653 -#define CLUTTER_Arabic_hamza_above 0x1000654 -#define CLUTTER_Arabic_hamza_below 0x1000655 -#define CLUTTER_Arabic_jeh 0x1000698 -#define CLUTTER_Arabic_veh 0x10006a4 -#define CLUTTER_Arabic_keheh 0x10006a9 -#define CLUTTER_Arabic_gaf 0x10006af -#define CLUTTER_Arabic_noon_ghunna 0x10006ba -#define CLUTTER_Arabic_heh_doachashmee 0x10006be -#define CLUTTER_Farsi_yeh 0x10006cc -#define CLUTTER_Arabic_farsi_yeh 0x10006cc -#define CLUTTER_Arabic_yeh_baree 0x10006d2 -#define CLUTTER_Arabic_heh_goal 0x10006c1 -#define CLUTTER_Arabic_switch 0xff7e -#define CLUTTER_Cyrillic_GHE_bar 0x1000492 -#define CLUTTER_Cyrillic_ghe_bar 0x1000493 -#define CLUTTER_Cyrillic_ZHE_descender 0x1000496 -#define CLUTTER_Cyrillic_zhe_descender 0x1000497 -#define CLUTTER_Cyrillic_KA_descender 0x100049a -#define CLUTTER_Cyrillic_ka_descender 0x100049b -#define CLUTTER_Cyrillic_KA_vertstroke 0x100049c -#define CLUTTER_Cyrillic_ka_vertstroke 0x100049d -#define CLUTTER_Cyrillic_EN_descender 0x10004a2 -#define CLUTTER_Cyrillic_en_descender 0x10004a3 -#define CLUTTER_Cyrillic_U_straight 0x10004ae -#define CLUTTER_Cyrillic_u_straight 0x10004af -#define CLUTTER_Cyrillic_U_straight_bar 0x10004b0 -#define CLUTTER_Cyrillic_u_straight_bar 0x10004b1 -#define CLUTTER_Cyrillic_HA_descender 0x10004b2 -#define CLUTTER_Cyrillic_ha_descender 0x10004b3 -#define CLUTTER_Cyrillic_CHE_descender 0x10004b6 -#define CLUTTER_Cyrillic_che_descender 0x10004b7 -#define CLUTTER_Cyrillic_CHE_vertstroke 0x10004b8 -#define CLUTTER_Cyrillic_che_vertstroke 0x10004b9 -#define CLUTTER_Cyrillic_SHHA 0x10004ba -#define CLUTTER_Cyrillic_shha 0x10004bb -#define CLUTTER_Cyrillic_SCHWA 0x10004d8 -#define CLUTTER_Cyrillic_schwa 0x10004d9 -#define CLUTTER_Cyrillic_I_macron 0x10004e2 -#define CLUTTER_Cyrillic_i_macron 0x10004e3 -#define CLUTTER_Cyrillic_O_bar 0x10004e8 -#define CLUTTER_Cyrillic_o_bar 0x10004e9 -#define CLUTTER_Cyrillic_U_macron 0x10004ee -#define CLUTTER_Cyrillic_u_macron 0x10004ef -#define CLUTTER_Serbian_dje 0x6a1 -#define CLUTTER_Macedonia_gje 0x6a2 -#define CLUTTER_Cyrillic_io 0x6a3 -#define CLUTTER_Ukrainian_ie 0x6a4 -#define CLUTTER_Ukranian_je 0x6a4 -#define CLUTTER_Macedonia_dse 0x6a5 -#define CLUTTER_Ukrainian_i 0x6a6 -#define CLUTTER_Ukranian_i 0x6a6 -#define CLUTTER_Ukrainian_yi 0x6a7 -#define CLUTTER_Ukranian_yi 0x6a7 -#define CLUTTER_Cyrillic_je 0x6a8 -#define CLUTTER_Serbian_je 0x6a8 -#define CLUTTER_Cyrillic_lje 0x6a9 -#define CLUTTER_Serbian_lje 0x6a9 -#define CLUTTER_Cyrillic_nje 0x6aa -#define CLUTTER_Serbian_nje 0x6aa -#define CLUTTER_Serbian_tshe 0x6ab -#define CLUTTER_Macedonia_kje 0x6ac -#define CLUTTER_Ukrainian_ghe_with_upturn 0x6ad -#define CLUTTER_Byelorussian_shortu 0x6ae -#define CLUTTER_Cyrillic_dzhe 0x6af -#define CLUTTER_Serbian_dze 0x6af -#define CLUTTER_numerosign 0x6b0 -#define CLUTTER_Serbian_DJE 0x6b1 -#define CLUTTER_Macedonia_GJE 0x6b2 -#define CLUTTER_Cyrillic_IO 0x6b3 -#define CLUTTER_Ukrainian_IE 0x6b4 -#define CLUTTER_Ukranian_JE 0x6b4 -#define CLUTTER_Macedonia_DSE 0x6b5 -#define CLUTTER_Ukrainian_I 0x6b6 -#define CLUTTER_Ukranian_I 0x6b6 -#define CLUTTER_Ukrainian_YI 0x6b7 -#define CLUTTER_Ukranian_YI 0x6b7 -#define CLUTTER_Cyrillic_JE 0x6b8 -#define CLUTTER_Serbian_JE 0x6b8 -#define CLUTTER_Cyrillic_LJE 0x6b9 -#define CLUTTER_Serbian_LJE 0x6b9 -#define CLUTTER_Cyrillic_NJE 0x6ba -#define CLUTTER_Serbian_NJE 0x6ba -#define CLUTTER_Serbian_TSHE 0x6bb -#define CLUTTER_Macedonia_KJE 0x6bc -#define CLUTTER_Ukrainian_GHE_WITH_UPTURN 0x6bd -#define CLUTTER_Byelorussian_SHORTU 0x6be -#define CLUTTER_Cyrillic_DZHE 0x6bf -#define CLUTTER_Serbian_DZE 0x6bf -#define CLUTTER_Cyrillic_yu 0x6c0 -#define CLUTTER_Cyrillic_a 0x6c1 -#define CLUTTER_Cyrillic_be 0x6c2 -#define CLUTTER_Cyrillic_tse 0x6c3 -#define CLUTTER_Cyrillic_de 0x6c4 -#define CLUTTER_Cyrillic_ie 0x6c5 -#define CLUTTER_Cyrillic_ef 0x6c6 -#define CLUTTER_Cyrillic_ghe 0x6c7 -#define CLUTTER_Cyrillic_ha 0x6c8 -#define CLUTTER_Cyrillic_i 0x6c9 -#define CLUTTER_Cyrillic_shorti 0x6ca -#define CLUTTER_Cyrillic_ka 0x6cb -#define CLUTTER_Cyrillic_el 0x6cc -#define CLUTTER_Cyrillic_em 0x6cd -#define CLUTTER_Cyrillic_en 0x6ce -#define CLUTTER_Cyrillic_o 0x6cf -#define CLUTTER_Cyrillic_pe 0x6d0 -#define CLUTTER_Cyrillic_ya 0x6d1 -#define CLUTTER_Cyrillic_er 0x6d2 -#define CLUTTER_Cyrillic_es 0x6d3 -#define CLUTTER_Cyrillic_te 0x6d4 -#define CLUTTER_Cyrillic_u 0x6d5 -#define CLUTTER_Cyrillic_zhe 0x6d6 -#define CLUTTER_Cyrillic_ve 0x6d7 -#define CLUTTER_Cyrillic_softsign 0x6d8 -#define CLUTTER_Cyrillic_yeru 0x6d9 -#define CLUTTER_Cyrillic_ze 0x6da -#define CLUTTER_Cyrillic_sha 0x6db -#define CLUTTER_Cyrillic_e 0x6dc -#define CLUTTER_Cyrillic_shcha 0x6dd -#define CLUTTER_Cyrillic_che 0x6de -#define CLUTTER_Cyrillic_hardsign 0x6df -#define CLUTTER_Cyrillic_YU 0x6e0 -#define CLUTTER_Cyrillic_A 0x6e1 -#define CLUTTER_Cyrillic_BE 0x6e2 -#define CLUTTER_Cyrillic_TSE 0x6e3 -#define CLUTTER_Cyrillic_DE 0x6e4 -#define CLUTTER_Cyrillic_IE 0x6e5 -#define CLUTTER_Cyrillic_EF 0x6e6 -#define CLUTTER_Cyrillic_GHE 0x6e7 -#define CLUTTER_Cyrillic_HA 0x6e8 -#define CLUTTER_Cyrillic_I 0x6e9 -#define CLUTTER_Cyrillic_SHORTI 0x6ea -#define CLUTTER_Cyrillic_KA 0x6eb -#define CLUTTER_Cyrillic_EL 0x6ec -#define CLUTTER_Cyrillic_EM 0x6ed -#define CLUTTER_Cyrillic_EN 0x6ee -#define CLUTTER_Cyrillic_O 0x6ef -#define CLUTTER_Cyrillic_PE 0x6f0 -#define CLUTTER_Cyrillic_YA 0x6f1 -#define CLUTTER_Cyrillic_ER 0x6f2 -#define CLUTTER_Cyrillic_ES 0x6f3 -#define CLUTTER_Cyrillic_TE 0x6f4 -#define CLUTTER_Cyrillic_U 0x6f5 -#define CLUTTER_Cyrillic_ZHE 0x6f6 -#define CLUTTER_Cyrillic_VE 0x6f7 -#define CLUTTER_Cyrillic_SOFTSIGN 0x6f8 -#define CLUTTER_Cyrillic_YERU 0x6f9 -#define CLUTTER_Cyrillic_ZE 0x6fa -#define CLUTTER_Cyrillic_SHA 0x6fb -#define CLUTTER_Cyrillic_E 0x6fc -#define CLUTTER_Cyrillic_SHCHA 0x6fd -#define CLUTTER_Cyrillic_CHE 0x6fe -#define CLUTTER_Cyrillic_HARDSIGN 0x6ff -#define CLUTTER_Greek_ALPHAaccent 0x7a1 -#define CLUTTER_Greek_EPSILONaccent 0x7a2 -#define CLUTTER_Greek_ETAaccent 0x7a3 -#define CLUTTER_Greek_IOTAaccent 0x7a4 -#define CLUTTER_Greek_IOTAdieresis 0x7a5 -#define CLUTTER_Greek_IOTAdiaeresis 0x7a5 -#define CLUTTER_Greek_OMICRONaccent 0x7a7 -#define CLUTTER_Greek_UPSILONaccent 0x7a8 -#define CLUTTER_Greek_UPSILONdieresis 0x7a9 -#define CLUTTER_Greek_OMEGAaccent 0x7ab -#define CLUTTER_Greek_accentdieresis 0x7ae -#define CLUTTER_Greek_horizbar 0x7af -#define CLUTTER_Greek_alphaaccent 0x7b1 -#define CLUTTER_Greek_epsilonaccent 0x7b2 -#define CLUTTER_Greek_etaaccent 0x7b3 -#define CLUTTER_Greek_iotaaccent 0x7b4 -#define CLUTTER_Greek_iotadieresis 0x7b5 -#define CLUTTER_Greek_iotaaccentdieresis 0x7b6 -#define CLUTTER_Greek_omicronaccent 0x7b7 -#define CLUTTER_Greek_upsilonaccent 0x7b8 -#define CLUTTER_Greek_upsilondieresis 0x7b9 -#define CLUTTER_Greek_upsilonaccentdieresis 0x7ba -#define CLUTTER_Greek_omegaaccent 0x7bb -#define CLUTTER_Greek_ALPHA 0x7c1 -#define CLUTTER_Greek_BETA 0x7c2 -#define CLUTTER_Greek_GAMMA 0x7c3 -#define CLUTTER_Greek_DELTA 0x7c4 -#define CLUTTER_Greek_EPSILON 0x7c5 -#define CLUTTER_Greek_ZETA 0x7c6 -#define CLUTTER_Greek_ETA 0x7c7 -#define CLUTTER_Greek_THETA 0x7c8 -#define CLUTTER_Greek_IOTA 0x7c9 -#define CLUTTER_Greek_KAPPA 0x7ca -#define CLUTTER_Greek_LAMDA 0x7cb -#define CLUTTER_Greek_LAMBDA 0x7cb -#define CLUTTER_Greek_MU 0x7cc -#define CLUTTER_Greek_NU 0x7cd -#define CLUTTER_Greek_XI 0x7ce -#define CLUTTER_Greek_OMICRON 0x7cf -#define CLUTTER_Greek_PI 0x7d0 -#define CLUTTER_Greek_RHO 0x7d1 -#define CLUTTER_Greek_SIGMA 0x7d2 -#define CLUTTER_Greek_TAU 0x7d4 -#define CLUTTER_Greek_UPSILON 0x7d5 -#define CLUTTER_Greek_PHI 0x7d6 -#define CLUTTER_Greek_CHI 0x7d7 -#define CLUTTER_Greek_PSI 0x7d8 -#define CLUTTER_Greek_OMEGA 0x7d9 -#define CLUTTER_Greek_alpha 0x7e1 -#define CLUTTER_Greek_beta 0x7e2 -#define CLUTTER_Greek_gamma 0x7e3 -#define CLUTTER_Greek_delta 0x7e4 -#define CLUTTER_Greek_epsilon 0x7e5 -#define CLUTTER_Greek_zeta 0x7e6 -#define CLUTTER_Greek_eta 0x7e7 -#define CLUTTER_Greek_theta 0x7e8 -#define CLUTTER_Greek_iota 0x7e9 -#define CLUTTER_Greek_kappa 0x7ea -#define CLUTTER_Greek_lamda 0x7eb -#define CLUTTER_Greek_lambda 0x7eb -#define CLUTTER_Greek_mu 0x7ec -#define CLUTTER_Greek_nu 0x7ed -#define CLUTTER_Greek_xi 0x7ee -#define CLUTTER_Greek_omicron 0x7ef -#define CLUTTER_Greek_pi 0x7f0 -#define CLUTTER_Greek_rho 0x7f1 -#define CLUTTER_Greek_sigma 0x7f2 -#define CLUTTER_Greek_finalsmallsigma 0x7f3 -#define CLUTTER_Greek_tau 0x7f4 -#define CLUTTER_Greek_upsilon 0x7f5 -#define CLUTTER_Greek_phi 0x7f6 -#define CLUTTER_Greek_chi 0x7f7 -#define CLUTTER_Greek_psi 0x7f8 -#define CLUTTER_Greek_omega 0x7f9 -#define CLUTTER_Greek_switch 0xff7e -#define CLUTTER_leftradical 0x8a1 -#define CLUTTER_topleftradical 0x8a2 -#define CLUTTER_horizconnector 0x8a3 -#define CLUTTER_topintegral 0x8a4 -#define CLUTTER_botintegral 0x8a5 -#define CLUTTER_vertconnector 0x8a6 -#define CLUTTER_topleftsqbracket 0x8a7 -#define CLUTTER_botleftsqbracket 0x8a8 -#define CLUTTER_toprightsqbracket 0x8a9 -#define CLUTTER_botrightsqbracket 0x8aa -#define CLUTTER_topleftparens 0x8ab -#define CLUTTER_botleftparens 0x8ac -#define CLUTTER_toprightparens 0x8ad -#define CLUTTER_botrightparens 0x8ae -#define CLUTTER_leftmiddlecurlybrace 0x8af -#define CLUTTER_rightmiddlecurlybrace 0x8b0 -#define CLUTTER_topleftsummation 0x8b1 -#define CLUTTER_botleftsummation 0x8b2 -#define CLUTTER_topvertsummationconnector 0x8b3 -#define CLUTTER_botvertsummationconnector 0x8b4 -#define CLUTTER_toprightsummation 0x8b5 -#define CLUTTER_botrightsummation 0x8b6 -#define CLUTTER_rightmiddlesummation 0x8b7 -#define CLUTTER_lessthanequal 0x8bc -#define CLUTTER_notequal 0x8bd -#define CLUTTER_greaterthanequal 0x8be -#define CLUTTER_integral 0x8bf -#define CLUTTER_therefore 0x8c0 -#define CLUTTER_variation 0x8c1 -#define CLUTTER_infinity 0x8c2 -#define CLUTTER_nabla 0x8c5 -#define CLUTTER_approximate 0x8c8 -#define CLUTTER_similarequal 0x8c9 -#define CLUTTER_ifonlyif 0x8cd -#define CLUTTER_implies 0x8ce -#define CLUTTER_identical 0x8cf -#define CLUTTER_radical 0x8d6 -#define CLUTTER_includedin 0x8da -#define CLUTTER_includes 0x8db -#define CLUTTER_intersection 0x8dc -#define CLUTTER_union 0x8dd -#define CLUTTER_logicaland 0x8de -#define CLUTTER_logicalor 0x8df -#define CLUTTER_partialderivative 0x8ef -#define CLUTTER_function 0x8f6 -#define CLUTTER_leftarrow 0x8fb -#define CLUTTER_uparrow 0x8fc -#define CLUTTER_rightarrow 0x8fd -#define CLUTTER_downarrow 0x8fe -#define CLUTTER_blank 0x9df -#define CLUTTER_soliddiamond 0x9e0 -#define CLUTTER_checkerboard 0x9e1 -#define CLUTTER_ht 0x9e2 -#define CLUTTER_ff 0x9e3 -#define CLUTTER_cr 0x9e4 -#define CLUTTER_lf 0x9e5 -#define CLUTTER_nl 0x9e8 -#define CLUTTER_vt 0x9e9 -#define CLUTTER_lowrightcorner 0x9ea -#define CLUTTER_uprightcorner 0x9eb -#define CLUTTER_upleftcorner 0x9ec -#define CLUTTER_lowleftcorner 0x9ed -#define CLUTTER_crossinglines 0x9ee -#define CLUTTER_horizlinescan1 0x9ef -#define CLUTTER_horizlinescan3 0x9f0 -#define CLUTTER_horizlinescan5 0x9f1 -#define CLUTTER_horizlinescan7 0x9f2 -#define CLUTTER_horizlinescan9 0x9f3 -#define CLUTTER_leftt 0x9f4 -#define CLUTTER_rightt 0x9f5 -#define CLUTTER_bott 0x9f6 -#define CLUTTER_topt 0x9f7 -#define CLUTTER_vertbar 0x9f8 -#define CLUTTER_emspace 0xaa1 -#define CLUTTER_enspace 0xaa2 -#define CLUTTER_em3space 0xaa3 -#define CLUTTER_em4space 0xaa4 -#define CLUTTER_digitspace 0xaa5 -#define CLUTTER_punctspace 0xaa6 -#define CLUTTER_thinspace 0xaa7 -#define CLUTTER_hairspace 0xaa8 -#define CLUTTER_emdash 0xaa9 -#define CLUTTER_endash 0xaaa -#define CLUTTER_signifblank 0xaac -#define CLUTTER_ellipsis 0xaae -#define CLUTTER_doubbaselinedot 0xaaf -#define CLUTTER_onethird 0xab0 -#define CLUTTER_twothirds 0xab1 -#define CLUTTER_onefifth 0xab2 -#define CLUTTER_twofifths 0xab3 -#define CLUTTER_threefifths 0xab4 -#define CLUTTER_fourfifths 0xab5 -#define CLUTTER_onesixth 0xab6 -#define CLUTTER_fivesixths 0xab7 -#define CLUTTER_careof 0xab8 -#define CLUTTER_figdash 0xabb -#define CLUTTER_leftanglebracket 0xabc -#define CLUTTER_decimalpoint 0xabd -#define CLUTTER_rightanglebracket 0xabe -#define CLUTTER_marker 0xabf -#define CLUTTER_oneeighth 0xac3 -#define CLUTTER_threeeighths 0xac4 -#define CLUTTER_fiveeighths 0xac5 -#define CLUTTER_seveneighths 0xac6 -#define CLUTTER_trademark 0xac9 -#define CLUTTER_signaturemark 0xaca -#define CLUTTER_trademarkincircle 0xacb -#define CLUTTER_leftopentriangle 0xacc -#define CLUTTER_rightopentriangle 0xacd -#define CLUTTER_emopencircle 0xace -#define CLUTTER_emopenrectangle 0xacf -#define CLUTTER_leftsinglequotemark 0xad0 -#define CLUTTER_rightsinglequotemark 0xad1 -#define CLUTTER_leftdoublequotemark 0xad2 -#define CLUTTER_rightdoublequotemark 0xad3 -#define CLUTTER_prescription 0xad4 -#define CLUTTER_permille 0xad5 -#define CLUTTER_minutes 0xad6 -#define CLUTTER_seconds 0xad7 -#define CLUTTER_latincross 0xad9 -#define CLUTTER_hexagram 0xada -#define CLUTTER_filledrectbullet 0xadb -#define CLUTTER_filledlefttribullet 0xadc -#define CLUTTER_filledrighttribullet 0xadd -#define CLUTTER_emfilledcircle 0xade -#define CLUTTER_emfilledrect 0xadf -#define CLUTTER_enopencircbullet 0xae0 -#define CLUTTER_enopensquarebullet 0xae1 -#define CLUTTER_openrectbullet 0xae2 -#define CLUTTER_opentribulletup 0xae3 -#define CLUTTER_opentribulletdown 0xae4 -#define CLUTTER_openstar 0xae5 -#define CLUTTER_enfilledcircbullet 0xae6 -#define CLUTTER_enfilledsqbullet 0xae7 -#define CLUTTER_filledtribulletup 0xae8 -#define CLUTTER_filledtribulletdown 0xae9 -#define CLUTTER_leftpointer 0xaea -#define CLUTTER_rightpointer 0xaeb -#define CLUTTER_club 0xaec -#define CLUTTER_diamond 0xaed -#define CLUTTER_heart 0xaee -#define CLUTTER_maltesecross 0xaf0 -#define CLUTTER_dagger 0xaf1 -#define CLUTTER_doubledagger 0xaf2 -#define CLUTTER_checkmark 0xaf3 -#define CLUTTER_ballotcross 0xaf4 -#define CLUTTER_musicalsharp 0xaf5 -#define CLUTTER_musicalflat 0xaf6 -#define CLUTTER_malesymbol 0xaf7 -#define CLUTTER_femalesymbol 0xaf8 -#define CLUTTER_telephone 0xaf9 -#define CLUTTER_telephonerecorder 0xafa -#define CLUTTER_phonographcopyright 0xafb -#define CLUTTER_caret 0xafc -#define CLUTTER_singlelowquotemark 0xafd -#define CLUTTER_doublelowquotemark 0xafe -#define CLUTTER_cursor 0xaff -#define CLUTTER_leftcaret 0xba3 -#define CLUTTER_rightcaret 0xba6 -#define CLUTTER_downcaret 0xba8 -#define CLUTTER_upcaret 0xba9 -#define CLUTTER_overbar 0xbc0 -#define CLUTTER_downtack 0xbc2 -#define CLUTTER_upshoe 0xbc3 -#define CLUTTER_downstile 0xbc4 -#define CLUTTER_underbar 0xbc6 -#define CLUTTER_jot 0xbca -#define CLUTTER_quad 0xbcc -#define CLUTTER_uptack 0xbce -#define CLUTTER_circle 0xbcf -#define CLUTTER_upstile 0xbd3 -#define CLUTTER_downshoe 0xbd6 -#define CLUTTER_rightshoe 0xbd8 -#define CLUTTER_leftshoe 0xbda -#define CLUTTER_lefttack 0xbdc -#define CLUTTER_righttack 0xbfc -#define CLUTTER_hebrew_doublelowline 0xcdf -#define CLUTTER_hebrew_aleph 0xce0 -#define CLUTTER_hebrew_bet 0xce1 -#define CLUTTER_hebrew_beth 0xce1 -#define CLUTTER_hebrew_gimel 0xce2 -#define CLUTTER_hebrew_gimmel 0xce2 -#define CLUTTER_hebrew_dalet 0xce3 -#define CLUTTER_hebrew_daleth 0xce3 -#define CLUTTER_hebrew_he 0xce4 -#define CLUTTER_hebrew_waw 0xce5 -#define CLUTTER_hebrew_zain 0xce6 -#define CLUTTER_hebrew_zayin 0xce6 -#define CLUTTER_hebrew_chet 0xce7 -#define CLUTTER_hebrew_het 0xce7 -#define CLUTTER_hebrew_tet 0xce8 -#define CLUTTER_hebrew_teth 0xce8 -#define CLUTTER_hebrew_yod 0xce9 -#define CLUTTER_hebrew_finalkaph 0xcea -#define CLUTTER_hebrew_kaph 0xceb -#define CLUTTER_hebrew_lamed 0xcec -#define CLUTTER_hebrew_finalmem 0xced -#define CLUTTER_hebrew_mem 0xcee -#define CLUTTER_hebrew_finalnun 0xcef -#define CLUTTER_hebrew_nun 0xcf0 -#define CLUTTER_hebrew_samech 0xcf1 -#define CLUTTER_hebrew_samekh 0xcf1 -#define CLUTTER_hebrew_ayin 0xcf2 -#define CLUTTER_hebrew_finalpe 0xcf3 -#define CLUTTER_hebrew_pe 0xcf4 -#define CLUTTER_hebrew_finalzade 0xcf5 -#define CLUTTER_hebrew_finalzadi 0xcf5 -#define CLUTTER_hebrew_zade 0xcf6 -#define CLUTTER_hebrew_zadi 0xcf6 -#define CLUTTER_hebrew_qoph 0xcf7 -#define CLUTTER_hebrew_kuf 0xcf7 -#define CLUTTER_hebrew_resh 0xcf8 -#define CLUTTER_hebrew_shin 0xcf9 -#define CLUTTER_hebrew_taw 0xcfa -#define CLUTTER_hebrew_taf 0xcfa -#define CLUTTER_Hebrew_switch 0xff7e -#define CLUTTER_Thai_kokai 0xda1 -#define CLUTTER_Thai_khokhai 0xda2 -#define CLUTTER_Thai_khokhuat 0xda3 -#define CLUTTER_Thai_khokhwai 0xda4 -#define CLUTTER_Thai_khokhon 0xda5 -#define CLUTTER_Thai_khorakhang 0xda6 -#define CLUTTER_Thai_ngongu 0xda7 -#define CLUTTER_Thai_chochan 0xda8 -#define CLUTTER_Thai_choching 0xda9 -#define CLUTTER_Thai_chochang 0xdaa -#define CLUTTER_Thai_soso 0xdab -#define CLUTTER_Thai_chochoe 0xdac -#define CLUTTER_Thai_yoying 0xdad -#define CLUTTER_Thai_dochada 0xdae -#define CLUTTER_Thai_topatak 0xdaf -#define CLUTTER_Thai_thothan 0xdb0 -#define CLUTTER_Thai_thonangmontho 0xdb1 -#define CLUTTER_Thai_thophuthao 0xdb2 -#define CLUTTER_Thai_nonen 0xdb3 -#define CLUTTER_Thai_dodek 0xdb4 -#define CLUTTER_Thai_totao 0xdb5 -#define CLUTTER_Thai_thothung 0xdb6 -#define CLUTTER_Thai_thothahan 0xdb7 -#define CLUTTER_Thai_thothong 0xdb8 -#define CLUTTER_Thai_nonu 0xdb9 -#define CLUTTER_Thai_bobaimai 0xdba -#define CLUTTER_Thai_popla 0xdbb -#define CLUTTER_Thai_phophung 0xdbc -#define CLUTTER_Thai_fofa 0xdbd -#define CLUTTER_Thai_phophan 0xdbe -#define CLUTTER_Thai_fofan 0xdbf -#define CLUTTER_Thai_phosamphao 0xdc0 -#define CLUTTER_Thai_moma 0xdc1 -#define CLUTTER_Thai_yoyak 0xdc2 -#define CLUTTER_Thai_rorua 0xdc3 -#define CLUTTER_Thai_ru 0xdc4 -#define CLUTTER_Thai_loling 0xdc5 -#define CLUTTER_Thai_lu 0xdc6 -#define CLUTTER_Thai_wowaen 0xdc7 -#define CLUTTER_Thai_sosala 0xdc8 -#define CLUTTER_Thai_sorusi 0xdc9 -#define CLUTTER_Thai_sosua 0xdca -#define CLUTTER_Thai_hohip 0xdcb -#define CLUTTER_Thai_lochula 0xdcc -#define CLUTTER_Thai_oang 0xdcd -#define CLUTTER_Thai_honokhuk 0xdce -#define CLUTTER_Thai_paiyannoi 0xdcf -#define CLUTTER_Thai_saraa 0xdd0 -#define CLUTTER_Thai_maihanakat 0xdd1 -#define CLUTTER_Thai_saraaa 0xdd2 -#define CLUTTER_Thai_saraam 0xdd3 -#define CLUTTER_Thai_sarai 0xdd4 -#define CLUTTER_Thai_saraii 0xdd5 -#define CLUTTER_Thai_saraue 0xdd6 -#define CLUTTER_Thai_sarauee 0xdd7 -#define CLUTTER_Thai_sarau 0xdd8 -#define CLUTTER_Thai_sarauu 0xdd9 -#define CLUTTER_Thai_phinthu 0xdda -#define CLUTTER_Thai_maihanakat_maitho 0xdde -#define CLUTTER_Thai_baht 0xddf -#define CLUTTER_Thai_sarae 0xde0 -#define CLUTTER_Thai_saraae 0xde1 -#define CLUTTER_Thai_sarao 0xde2 -#define CLUTTER_Thai_saraaimaimuan 0xde3 -#define CLUTTER_Thai_saraaimaimalai 0xde4 -#define CLUTTER_Thai_lakkhangyao 0xde5 -#define CLUTTER_Thai_maiyamok 0xde6 -#define CLUTTER_Thai_maitaikhu 0xde7 -#define CLUTTER_Thai_maiek 0xde8 -#define CLUTTER_Thai_maitho 0xde9 -#define CLUTTER_Thai_maitri 0xdea -#define CLUTTER_Thai_maichattawa 0xdeb -#define CLUTTER_Thai_thanthakhat 0xdec -#define CLUTTER_Thai_nikhahit 0xded -#define CLUTTER_Thai_leksun 0xdf0 -#define CLUTTER_Thai_leknung 0xdf1 -#define CLUTTER_Thai_leksong 0xdf2 -#define CLUTTER_Thai_leksam 0xdf3 -#define CLUTTER_Thai_leksi 0xdf4 -#define CLUTTER_Thai_lekha 0xdf5 -#define CLUTTER_Thai_lekhok 0xdf6 -#define CLUTTER_Thai_lekchet 0xdf7 -#define CLUTTER_Thai_lekpaet 0xdf8 -#define CLUTTER_Thai_lekkao 0xdf9 -#define CLUTTER_Hangul 0xff31 -#define CLUTTER_Hangul_Start 0xff32 -#define CLUTTER_Hangul_End 0xff33 -#define CLUTTER_Hangul_Hanja 0xff34 -#define CLUTTER_Hangul_Jamo 0xff35 -#define CLUTTER_Hangul_Romaja 0xff36 -#define CLUTTER_Hangul_Codeinput 0xff37 -#define CLUTTER_Hangul_Jeonja 0xff38 -#define CLUTTER_Hangul_Banja 0xff39 -#define CLUTTER_Hangul_PreHanja 0xff3a -#define CLUTTER_Hangul_PostHanja 0xff3b -#define CLUTTER_Hangul_SingleCandidate 0xff3c -#define CLUTTER_Hangul_MultipleCandidate 0xff3d -#define CLUTTER_Hangul_PreviousCandidate 0xff3e -#define CLUTTER_Hangul_Special 0xff3f -#define CLUTTER_Hangul_switch 0xff7e -#define CLUTTER_Hangul_Kiyeog 0xea1 -#define CLUTTER_Hangul_SsangKiyeog 0xea2 -#define CLUTTER_Hangul_KiyeogSios 0xea3 -#define CLUTTER_Hangul_Nieun 0xea4 -#define CLUTTER_Hangul_NieunJieuj 0xea5 -#define CLUTTER_Hangul_NieunHieuh 0xea6 -#define CLUTTER_Hangul_Dikeud 0xea7 -#define CLUTTER_Hangul_SsangDikeud 0xea8 -#define CLUTTER_Hangul_Rieul 0xea9 -#define CLUTTER_Hangul_RieulKiyeog 0xeaa -#define CLUTTER_Hangul_RieulMieum 0xeab -#define CLUTTER_Hangul_RieulPieub 0xeac -#define CLUTTER_Hangul_RieulSios 0xead -#define CLUTTER_Hangul_RieulTieut 0xeae -#define CLUTTER_Hangul_RieulPhieuf 0xeaf -#define CLUTTER_Hangul_RieulHieuh 0xeb0 -#define CLUTTER_Hangul_Mieum 0xeb1 -#define CLUTTER_Hangul_Pieub 0xeb2 -#define CLUTTER_Hangul_SsangPieub 0xeb3 -#define CLUTTER_Hangul_PieubSios 0xeb4 -#define CLUTTER_Hangul_Sios 0xeb5 -#define CLUTTER_Hangul_SsangSios 0xeb6 -#define CLUTTER_Hangul_Ieung 0xeb7 -#define CLUTTER_Hangul_Jieuj 0xeb8 -#define CLUTTER_Hangul_SsangJieuj 0xeb9 -#define CLUTTER_Hangul_Cieuc 0xeba -#define CLUTTER_Hangul_Khieuq 0xebb -#define CLUTTER_Hangul_Tieut 0xebc -#define CLUTTER_Hangul_Phieuf 0xebd -#define CLUTTER_Hangul_Hieuh 0xebe -#define CLUTTER_Hangul_A 0xebf -#define CLUTTER_Hangul_AE 0xec0 -#define CLUTTER_Hangul_YA 0xec1 -#define CLUTTER_Hangul_YAE 0xec2 -#define CLUTTER_Hangul_EO 0xec3 -#define CLUTTER_Hangul_E 0xec4 -#define CLUTTER_Hangul_YEO 0xec5 -#define CLUTTER_Hangul_YE 0xec6 -#define CLUTTER_Hangul_O 0xec7 -#define CLUTTER_Hangul_WA 0xec8 -#define CLUTTER_Hangul_WAE 0xec9 -#define CLUTTER_Hangul_OE 0xeca -#define CLUTTER_Hangul_YO 0xecb -#define CLUTTER_Hangul_U 0xecc -#define CLUTTER_Hangul_WEO 0xecd -#define CLUTTER_Hangul_WE 0xece -#define CLUTTER_Hangul_WI 0xecf -#define CLUTTER_Hangul_YU 0xed0 -#define CLUTTER_Hangul_EU 0xed1 -#define CLUTTER_Hangul_YI 0xed2 -#define CLUTTER_Hangul_I 0xed3 -#define CLUTTER_Hangul_J_Kiyeog 0xed4 -#define CLUTTER_Hangul_J_SsangKiyeog 0xed5 -#define CLUTTER_Hangul_J_KiyeogSios 0xed6 -#define CLUTTER_Hangul_J_Nieun 0xed7 -#define CLUTTER_Hangul_J_NieunJieuj 0xed8 -#define CLUTTER_Hangul_J_NieunHieuh 0xed9 -#define CLUTTER_Hangul_J_Dikeud 0xeda -#define CLUTTER_Hangul_J_Rieul 0xedb -#define CLUTTER_Hangul_J_RieulKiyeog 0xedc -#define CLUTTER_Hangul_J_RieulMieum 0xedd -#define CLUTTER_Hangul_J_RieulPieub 0xede -#define CLUTTER_Hangul_J_RieulSios 0xedf -#define CLUTTER_Hangul_J_RieulTieut 0xee0 -#define CLUTTER_Hangul_J_RieulPhieuf 0xee1 -#define CLUTTER_Hangul_J_RieulHieuh 0xee2 -#define CLUTTER_Hangul_J_Mieum 0xee3 -#define CLUTTER_Hangul_J_Pieub 0xee4 -#define CLUTTER_Hangul_J_PieubSios 0xee5 -#define CLUTTER_Hangul_J_Sios 0xee6 -#define CLUTTER_Hangul_J_SsangSios 0xee7 -#define CLUTTER_Hangul_J_Ieung 0xee8 -#define CLUTTER_Hangul_J_Jieuj 0xee9 -#define CLUTTER_Hangul_J_Cieuc 0xeea -#define CLUTTER_Hangul_J_Khieuq 0xeeb -#define CLUTTER_Hangul_J_Tieut 0xeec -#define CLUTTER_Hangul_J_Phieuf 0xeed -#define CLUTTER_Hangul_J_Hieuh 0xeee -#define CLUTTER_Hangul_RieulYeorinHieuh 0xeef -#define CLUTTER_Hangul_SunkyeongeumMieum 0xef0 -#define CLUTTER_Hangul_SunkyeongeumPieub 0xef1 -#define CLUTTER_Hangul_PanSios 0xef2 -#define CLUTTER_Hangul_KkogjiDalrinIeung 0xef3 -#define CLUTTER_Hangul_SunkyeongeumPhieuf 0xef4 -#define CLUTTER_Hangul_YeorinHieuh 0xef5 -#define CLUTTER_Hangul_AraeA 0xef6 -#define CLUTTER_Hangul_AraeAE 0xef7 -#define CLUTTER_Hangul_J_PanSios 0xef8 -#define CLUTTER_Hangul_J_KkogjiDalrinIeung 0xef9 -#define CLUTTER_Hangul_J_YeorinHieuh 0xefa -#define CLUTTER_Korean_Won 0xeff -#define CLUTTER_Armenian_ligature_ew 0x1000587 -#define CLUTTER_Armenian_full_stop 0x1000589 -#define CLUTTER_Armenian_verjaket 0x1000589 -#define CLUTTER_Armenian_separation_mark 0x100055d -#define CLUTTER_Armenian_but 0x100055d -#define CLUTTER_Armenian_hyphen 0x100058a -#define CLUTTER_Armenian_yentamna 0x100058a -#define CLUTTER_Armenian_exclam 0x100055c -#define CLUTTER_Armenian_amanak 0x100055c -#define CLUTTER_Armenian_accent 0x100055b -#define CLUTTER_Armenian_shesht 0x100055b -#define CLUTTER_Armenian_question 0x100055e -#define CLUTTER_Armenian_paruyk 0x100055e -#define CLUTTER_Armenian_AYB 0x1000531 -#define CLUTTER_Armenian_ayb 0x1000561 -#define CLUTTER_Armenian_BEN 0x1000532 -#define CLUTTER_Armenian_ben 0x1000562 -#define CLUTTER_Armenian_GIM 0x1000533 -#define CLUTTER_Armenian_gim 0x1000563 -#define CLUTTER_Armenian_DA 0x1000534 -#define CLUTTER_Armenian_da 0x1000564 -#define CLUTTER_Armenian_YECH 0x1000535 -#define CLUTTER_Armenian_yech 0x1000565 -#define CLUTTER_Armenian_ZA 0x1000536 -#define CLUTTER_Armenian_za 0x1000566 -#define CLUTTER_Armenian_E 0x1000537 -#define CLUTTER_Armenian_e 0x1000567 -#define CLUTTER_Armenian_AT 0x1000538 -#define CLUTTER_Armenian_at 0x1000568 -#define CLUTTER_Armenian_TO 0x1000539 -#define CLUTTER_Armenian_to 0x1000569 -#define CLUTTER_Armenian_ZHE 0x100053a -#define CLUTTER_Armenian_zhe 0x100056a -#define CLUTTER_Armenian_INI 0x100053b -#define CLUTTER_Armenian_ini 0x100056b -#define CLUTTER_Armenian_LYUN 0x100053c -#define CLUTTER_Armenian_lyun 0x100056c -#define CLUTTER_Armenian_KHE 0x100053d -#define CLUTTER_Armenian_khe 0x100056d -#define CLUTTER_Armenian_TSA 0x100053e -#define CLUTTER_Armenian_tsa 0x100056e -#define CLUTTER_Armenian_KEN 0x100053f -#define CLUTTER_Armenian_ken 0x100056f -#define CLUTTER_Armenian_HO 0x1000540 -#define CLUTTER_Armenian_ho 0x1000570 -#define CLUTTER_Armenian_DZA 0x1000541 -#define CLUTTER_Armenian_dza 0x1000571 -#define CLUTTER_Armenian_GHAT 0x1000542 -#define CLUTTER_Armenian_ghat 0x1000572 -#define CLUTTER_Armenian_TCHE 0x1000543 -#define CLUTTER_Armenian_tche 0x1000573 -#define CLUTTER_Armenian_MEN 0x1000544 -#define CLUTTER_Armenian_men 0x1000574 -#define CLUTTER_Armenian_HI 0x1000545 -#define CLUTTER_Armenian_hi 0x1000575 -#define CLUTTER_Armenian_NU 0x1000546 -#define CLUTTER_Armenian_nu 0x1000576 -#define CLUTTER_Armenian_SHA 0x1000547 -#define CLUTTER_Armenian_sha 0x1000577 -#define CLUTTER_Armenian_VO 0x1000548 -#define CLUTTER_Armenian_vo 0x1000578 -#define CLUTTER_Armenian_CHA 0x1000549 -#define CLUTTER_Armenian_cha 0x1000579 -#define CLUTTER_Armenian_PE 0x100054a -#define CLUTTER_Armenian_pe 0x100057a -#define CLUTTER_Armenian_JE 0x100054b -#define CLUTTER_Armenian_je 0x100057b -#define CLUTTER_Armenian_RA 0x100054c -#define CLUTTER_Armenian_ra 0x100057c -#define CLUTTER_Armenian_SE 0x100054d -#define CLUTTER_Armenian_se 0x100057d -#define CLUTTER_Armenian_VEV 0x100054e -#define CLUTTER_Armenian_vev 0x100057e -#define CLUTTER_Armenian_TYUN 0x100054f -#define CLUTTER_Armenian_tyun 0x100057f -#define CLUTTER_Armenian_RE 0x1000550 -#define CLUTTER_Armenian_re 0x1000580 -#define CLUTTER_Armenian_TSO 0x1000551 -#define CLUTTER_Armenian_tso 0x1000581 -#define CLUTTER_Armenian_VYUN 0x1000552 -#define CLUTTER_Armenian_vyun 0x1000582 -#define CLUTTER_Armenian_PYUR 0x1000553 -#define CLUTTER_Armenian_pyur 0x1000583 -#define CLUTTER_Armenian_KE 0x1000554 -#define CLUTTER_Armenian_ke 0x1000584 -#define CLUTTER_Armenian_O 0x1000555 -#define CLUTTER_Armenian_o 0x1000585 -#define CLUTTER_Armenian_FE 0x1000556 -#define CLUTTER_Armenian_fe 0x1000586 -#define CLUTTER_Armenian_apostrophe 0x100055a -#define CLUTTER_Georgian_an 0x10010d0 -#define CLUTTER_Georgian_ban 0x10010d1 -#define CLUTTER_Georgian_gan 0x10010d2 -#define CLUTTER_Georgian_don 0x10010d3 -#define CLUTTER_Georgian_en 0x10010d4 -#define CLUTTER_Georgian_vin 0x10010d5 -#define CLUTTER_Georgian_zen 0x10010d6 -#define CLUTTER_Georgian_tan 0x10010d7 -#define CLUTTER_Georgian_in 0x10010d8 -#define CLUTTER_Georgian_kan 0x10010d9 -#define CLUTTER_Georgian_las 0x10010da -#define CLUTTER_Georgian_man 0x10010db -#define CLUTTER_Georgian_nar 0x10010dc -#define CLUTTER_Georgian_on 0x10010dd -#define CLUTTER_Georgian_par 0x10010de -#define CLUTTER_Georgian_zhar 0x10010df -#define CLUTTER_Georgian_rae 0x10010e0 -#define CLUTTER_Georgian_san 0x10010e1 -#define CLUTTER_Georgian_tar 0x10010e2 -#define CLUTTER_Georgian_un 0x10010e3 -#define CLUTTER_Georgian_phar 0x10010e4 -#define CLUTTER_Georgian_khar 0x10010e5 -#define CLUTTER_Georgian_ghan 0x10010e6 -#define CLUTTER_Georgian_qar 0x10010e7 -#define CLUTTER_Georgian_shin 0x10010e8 -#define CLUTTER_Georgian_chin 0x10010e9 -#define CLUTTER_Georgian_can 0x10010ea -#define CLUTTER_Georgian_jil 0x10010eb -#define CLUTTER_Georgian_cil 0x10010ec -#define CLUTTER_Georgian_char 0x10010ed -#define CLUTTER_Georgian_xan 0x10010ee -#define CLUTTER_Georgian_jhan 0x10010ef -#define CLUTTER_Georgian_hae 0x10010f0 -#define CLUTTER_Georgian_he 0x10010f1 -#define CLUTTER_Georgian_hie 0x10010f2 -#define CLUTTER_Georgian_we 0x10010f3 -#define CLUTTER_Georgian_har 0x10010f4 -#define CLUTTER_Georgian_hoe 0x10010f5 -#define CLUTTER_Georgian_fi 0x10010f6 -#define CLUTTER_Xabovedot 0x1001e8a -#define CLUTTER_Ibreve 0x100012c -#define CLUTTER_Zstroke 0x10001b5 -#define CLUTTER_Gcaron 0x10001e6 -#define CLUTTER_Ocaron 0x10001d1 -#define CLUTTER_Obarred 0x100019f -#define CLUTTER_xabovedot 0x1001e8b -#define CLUTTER_ibreve 0x100012d -#define CLUTTER_zstroke 0x10001b6 -#define CLUTTER_gcaron 0x10001e7 -#define CLUTTER_ocaron 0x10001d2 -#define CLUTTER_obarred 0x1000275 -#define CLUTTER_SCHWA 0x100018f -#define CLUTTER_schwa 0x1000259 -#define CLUTTER_EZH 0x10001b7 -#define CLUTTER_ezh 0x1000292 -#define CLUTTER_Lbelowdot 0x1001e36 -#define CLUTTER_lbelowdot 0x1001e37 -#define CLUTTER_Abelowdot 0x1001ea0 -#define CLUTTER_abelowdot 0x1001ea1 -#define CLUTTER_Ahook 0x1001ea2 -#define CLUTTER_ahook 0x1001ea3 -#define CLUTTER_Acircumflexacute 0x1001ea4 -#define CLUTTER_acircumflexacute 0x1001ea5 -#define CLUTTER_Acircumflexgrave 0x1001ea6 -#define CLUTTER_acircumflexgrave 0x1001ea7 -#define CLUTTER_Acircumflexhook 0x1001ea8 -#define CLUTTER_acircumflexhook 0x1001ea9 -#define CLUTTER_Acircumflextilde 0x1001eaa -#define CLUTTER_acircumflextilde 0x1001eab -#define CLUTTER_Acircumflexbelowdot 0x1001eac -#define CLUTTER_acircumflexbelowdot 0x1001ead -#define CLUTTER_Abreveacute 0x1001eae -#define CLUTTER_abreveacute 0x1001eaf -#define CLUTTER_Abrevegrave 0x1001eb0 -#define CLUTTER_abrevegrave 0x1001eb1 -#define CLUTTER_Abrevehook 0x1001eb2 -#define CLUTTER_abrevehook 0x1001eb3 -#define CLUTTER_Abrevetilde 0x1001eb4 -#define CLUTTER_abrevetilde 0x1001eb5 -#define CLUTTER_Abrevebelowdot 0x1001eb6 -#define CLUTTER_abrevebelowdot 0x1001eb7 -#define CLUTTER_Ebelowdot 0x1001eb8 -#define CLUTTER_ebelowdot 0x1001eb9 -#define CLUTTER_Ehook 0x1001eba -#define CLUTTER_ehook 0x1001ebb -#define CLUTTER_Etilde 0x1001ebc -#define CLUTTER_etilde 0x1001ebd -#define CLUTTER_Ecircumflexacute 0x1001ebe -#define CLUTTER_ecircumflexacute 0x1001ebf -#define CLUTTER_Ecircumflexgrave 0x1001ec0 -#define CLUTTER_ecircumflexgrave 0x1001ec1 -#define CLUTTER_Ecircumflexhook 0x1001ec2 -#define CLUTTER_ecircumflexhook 0x1001ec3 -#define CLUTTER_Ecircumflextilde 0x1001ec4 -#define CLUTTER_ecircumflextilde 0x1001ec5 -#define CLUTTER_Ecircumflexbelowdot 0x1001ec6 -#define CLUTTER_ecircumflexbelowdot 0x1001ec7 -#define CLUTTER_Ihook 0x1001ec8 -#define CLUTTER_ihook 0x1001ec9 -#define CLUTTER_Ibelowdot 0x1001eca -#define CLUTTER_ibelowdot 0x1001ecb -#define CLUTTER_Obelowdot 0x1001ecc -#define CLUTTER_obelowdot 0x1001ecd -#define CLUTTER_Ohook 0x1001ece -#define CLUTTER_ohook 0x1001ecf -#define CLUTTER_Ocircumflexacute 0x1001ed0 -#define CLUTTER_ocircumflexacute 0x1001ed1 -#define CLUTTER_Ocircumflexgrave 0x1001ed2 -#define CLUTTER_ocircumflexgrave 0x1001ed3 -#define CLUTTER_Ocircumflexhook 0x1001ed4 -#define CLUTTER_ocircumflexhook 0x1001ed5 -#define CLUTTER_Ocircumflextilde 0x1001ed6 -#define CLUTTER_ocircumflextilde 0x1001ed7 -#define CLUTTER_Ocircumflexbelowdot 0x1001ed8 -#define CLUTTER_ocircumflexbelowdot 0x1001ed9 -#define CLUTTER_Ohornacute 0x1001eda -#define CLUTTER_ohornacute 0x1001edb -#define CLUTTER_Ohorngrave 0x1001edc -#define CLUTTER_ohorngrave 0x1001edd -#define CLUTTER_Ohornhook 0x1001ede -#define CLUTTER_ohornhook 0x1001edf -#define CLUTTER_Ohorntilde 0x1001ee0 -#define CLUTTER_ohorntilde 0x1001ee1 -#define CLUTTER_Ohornbelowdot 0x1001ee2 -#define CLUTTER_ohornbelowdot 0x1001ee3 -#define CLUTTER_Ubelowdot 0x1001ee4 -#define CLUTTER_ubelowdot 0x1001ee5 -#define CLUTTER_Uhook 0x1001ee6 -#define CLUTTER_uhook 0x1001ee7 -#define CLUTTER_Uhornacute 0x1001ee8 -#define CLUTTER_uhornacute 0x1001ee9 -#define CLUTTER_Uhorngrave 0x1001eea -#define CLUTTER_uhorngrave 0x1001eeb -#define CLUTTER_Uhornhook 0x1001eec -#define CLUTTER_uhornhook 0x1001eed -#define CLUTTER_Uhorntilde 0x1001eee -#define CLUTTER_uhorntilde 0x1001eef -#define CLUTTER_Uhornbelowdot 0x1001ef0 -#define CLUTTER_uhornbelowdot 0x1001ef1 -#define CLUTTER_Ybelowdot 0x1001ef4 -#define CLUTTER_ybelowdot 0x1001ef5 -#define CLUTTER_Yhook 0x1001ef6 -#define CLUTTER_yhook 0x1001ef7 -#define CLUTTER_Ytilde 0x1001ef8 -#define CLUTTER_ytilde 0x1001ef9 -#define CLUTTER_Ohorn 0x10001a0 -#define CLUTTER_ohorn 0x10001a1 -#define CLUTTER_Uhorn 0x10001af -#define CLUTTER_uhorn 0x10001b0 -#define CLUTTER_EcuSign 0x10020a0 -#define CLUTTER_ColonSign 0x10020a1 -#define CLUTTER_CruzeiroSign 0x10020a2 -#define CLUTTER_FFrancSign 0x10020a3 -#define CLUTTER_LiraSign 0x10020a4 -#define CLUTTER_MillSign 0x10020a5 -#define CLUTTER_NairaSign 0x10020a6 -#define CLUTTER_PesetaSign 0x10020a7 -#define CLUTTER_RupeeSign 0x10020a8 -#define CLUTTER_WonSign 0x10020a9 -#define CLUTTER_NewSheqelSign 0x10020aa -#define CLUTTER_DongSign 0x10020ab -#define CLUTTER_EuroSign 0x20ac -#define CLUTTER_zerosuperior 0x1002070 -#define CLUTTER_foursuperior 0x1002074 -#define CLUTTER_fivesuperior 0x1002075 -#define CLUTTER_sixsuperior 0x1002076 -#define CLUTTER_sevensuperior 0x1002077 -#define CLUTTER_eightsuperior 0x1002078 -#define CLUTTER_ninesuperior 0x1002079 -#define CLUTTER_zerosubscript 0x1002080 -#define CLUTTER_onesubscript 0x1002081 -#define CLUTTER_twosubscript 0x1002082 -#define CLUTTER_threesubscript 0x1002083 -#define CLUTTER_foursubscript 0x1002084 -#define CLUTTER_fivesubscript 0x1002085 -#define CLUTTER_sixsubscript 0x1002086 -#define CLUTTER_sevensubscript 0x1002087 -#define CLUTTER_eightsubscript 0x1002088 -#define CLUTTER_ninesubscript 0x1002089 -#define CLUTTER_partdifferential 0x1002202 -#define CLUTTER_emptyset 0x1002205 -#define CLUTTER_elementof 0x1002208 -#define CLUTTER_notelementof 0x1002209 -#define CLUTTER_containsas 0x100220b -#define CLUTTER_squareroot 0x100221a -#define CLUTTER_cuberoot 0x100221b -#define CLUTTER_fourthroot 0x100221c -#define CLUTTER_dintegral 0x100222c -#define CLUTTER_tintegral 0x100222d -#define CLUTTER_because 0x1002235 -#define CLUTTER_approxeq 0x1002248 -#define CLUTTER_notapproxeq 0x1002247 -#define CLUTTER_notidentical 0x1002262 -#define CLUTTER_stricteq 0x1002263 -#define CLUTTER_braille_dot_1 0xfff1 -#define CLUTTER_braille_dot_2 0xfff2 -#define CLUTTER_braille_dot_3 0xfff3 -#define CLUTTER_braille_dot_4 0xfff4 -#define CLUTTER_braille_dot_5 0xfff5 -#define CLUTTER_braille_dot_6 0xfff6 -#define CLUTTER_braille_dot_7 0xfff7 -#define CLUTTER_braille_dot_8 0xfff8 -#define CLUTTER_braille_dot_9 0xfff9 -#define CLUTTER_braille_dot_10 0xfffa -#define CLUTTER_braille_blank 0x1002800 -#define CLUTTER_braille_dots_1 0x1002801 -#define CLUTTER_braille_dots_2 0x1002802 -#define CLUTTER_braille_dots_12 0x1002803 -#define CLUTTER_braille_dots_3 0x1002804 -#define CLUTTER_braille_dots_13 0x1002805 -#define CLUTTER_braille_dots_23 0x1002806 -#define CLUTTER_braille_dots_123 0x1002807 -#define CLUTTER_braille_dots_4 0x1002808 -#define CLUTTER_braille_dots_14 0x1002809 -#define CLUTTER_braille_dots_24 0x100280a -#define CLUTTER_braille_dots_124 0x100280b -#define CLUTTER_braille_dots_34 0x100280c -#define CLUTTER_braille_dots_134 0x100280d -#define CLUTTER_braille_dots_234 0x100280e -#define CLUTTER_braille_dots_1234 0x100280f -#define CLUTTER_braille_dots_5 0x1002810 -#define CLUTTER_braille_dots_15 0x1002811 -#define CLUTTER_braille_dots_25 0x1002812 -#define CLUTTER_braille_dots_125 0x1002813 -#define CLUTTER_braille_dots_35 0x1002814 -#define CLUTTER_braille_dots_135 0x1002815 -#define CLUTTER_braille_dots_235 0x1002816 -#define CLUTTER_braille_dots_1235 0x1002817 -#define CLUTTER_braille_dots_45 0x1002818 -#define CLUTTER_braille_dots_145 0x1002819 -#define CLUTTER_braille_dots_245 0x100281a -#define CLUTTER_braille_dots_1245 0x100281b -#define CLUTTER_braille_dots_345 0x100281c -#define CLUTTER_braille_dots_1345 0x100281d -#define CLUTTER_braille_dots_2345 0x100281e -#define CLUTTER_braille_dots_12345 0x100281f -#define CLUTTER_braille_dots_6 0x1002820 -#define CLUTTER_braille_dots_16 0x1002821 -#define CLUTTER_braille_dots_26 0x1002822 -#define CLUTTER_braille_dots_126 0x1002823 -#define CLUTTER_braille_dots_36 0x1002824 -#define CLUTTER_braille_dots_136 0x1002825 -#define CLUTTER_braille_dots_236 0x1002826 -#define CLUTTER_braille_dots_1236 0x1002827 -#define CLUTTER_braille_dots_46 0x1002828 -#define CLUTTER_braille_dots_146 0x1002829 -#define CLUTTER_braille_dots_246 0x100282a -#define CLUTTER_braille_dots_1246 0x100282b -#define CLUTTER_braille_dots_346 0x100282c -#define CLUTTER_braille_dots_1346 0x100282d -#define CLUTTER_braille_dots_2346 0x100282e -#define CLUTTER_braille_dots_12346 0x100282f -#define CLUTTER_braille_dots_56 0x1002830 -#define CLUTTER_braille_dots_156 0x1002831 -#define CLUTTER_braille_dots_256 0x1002832 -#define CLUTTER_braille_dots_1256 0x1002833 -#define CLUTTER_braille_dots_356 0x1002834 -#define CLUTTER_braille_dots_1356 0x1002835 -#define CLUTTER_braille_dots_2356 0x1002836 -#define CLUTTER_braille_dots_12356 0x1002837 -#define CLUTTER_braille_dots_456 0x1002838 -#define CLUTTER_braille_dots_1456 0x1002839 -#define CLUTTER_braille_dots_2456 0x100283a -#define CLUTTER_braille_dots_12456 0x100283b -#define CLUTTER_braille_dots_3456 0x100283c -#define CLUTTER_braille_dots_13456 0x100283d -#define CLUTTER_braille_dots_23456 0x100283e -#define CLUTTER_braille_dots_123456 0x100283f -#define CLUTTER_braille_dots_7 0x1002840 -#define CLUTTER_braille_dots_17 0x1002841 -#define CLUTTER_braille_dots_27 0x1002842 -#define CLUTTER_braille_dots_127 0x1002843 -#define CLUTTER_braille_dots_37 0x1002844 -#define CLUTTER_braille_dots_137 0x1002845 -#define CLUTTER_braille_dots_237 0x1002846 -#define CLUTTER_braille_dots_1237 0x1002847 -#define CLUTTER_braille_dots_47 0x1002848 -#define CLUTTER_braille_dots_147 0x1002849 -#define CLUTTER_braille_dots_247 0x100284a -#define CLUTTER_braille_dots_1247 0x100284b -#define CLUTTER_braille_dots_347 0x100284c -#define CLUTTER_braille_dots_1347 0x100284d -#define CLUTTER_braille_dots_2347 0x100284e -#define CLUTTER_braille_dots_12347 0x100284f -#define CLUTTER_braille_dots_57 0x1002850 -#define CLUTTER_braille_dots_157 0x1002851 -#define CLUTTER_braille_dots_257 0x1002852 -#define CLUTTER_braille_dots_1257 0x1002853 -#define CLUTTER_braille_dots_357 0x1002854 -#define CLUTTER_braille_dots_1357 0x1002855 -#define CLUTTER_braille_dots_2357 0x1002856 -#define CLUTTER_braille_dots_12357 0x1002857 -#define CLUTTER_braille_dots_457 0x1002858 -#define CLUTTER_braille_dots_1457 0x1002859 -#define CLUTTER_braille_dots_2457 0x100285a -#define CLUTTER_braille_dots_12457 0x100285b -#define CLUTTER_braille_dots_3457 0x100285c -#define CLUTTER_braille_dots_13457 0x100285d -#define CLUTTER_braille_dots_23457 0x100285e -#define CLUTTER_braille_dots_123457 0x100285f -#define CLUTTER_braille_dots_67 0x1002860 -#define CLUTTER_braille_dots_167 0x1002861 -#define CLUTTER_braille_dots_267 0x1002862 -#define CLUTTER_braille_dots_1267 0x1002863 -#define CLUTTER_braille_dots_367 0x1002864 -#define CLUTTER_braille_dots_1367 0x1002865 -#define CLUTTER_braille_dots_2367 0x1002866 -#define CLUTTER_braille_dots_12367 0x1002867 -#define CLUTTER_braille_dots_467 0x1002868 -#define CLUTTER_braille_dots_1467 0x1002869 -#define CLUTTER_braille_dots_2467 0x100286a -#define CLUTTER_braille_dots_12467 0x100286b -#define CLUTTER_braille_dots_3467 0x100286c -#define CLUTTER_braille_dots_13467 0x100286d -#define CLUTTER_braille_dots_23467 0x100286e -#define CLUTTER_braille_dots_123467 0x100286f -#define CLUTTER_braille_dots_567 0x1002870 -#define CLUTTER_braille_dots_1567 0x1002871 -#define CLUTTER_braille_dots_2567 0x1002872 -#define CLUTTER_braille_dots_12567 0x1002873 -#define CLUTTER_braille_dots_3567 0x1002874 -#define CLUTTER_braille_dots_13567 0x1002875 -#define CLUTTER_braille_dots_23567 0x1002876 -#define CLUTTER_braille_dots_123567 0x1002877 -#define CLUTTER_braille_dots_4567 0x1002878 -#define CLUTTER_braille_dots_14567 0x1002879 -#define CLUTTER_braille_dots_24567 0x100287a -#define CLUTTER_braille_dots_124567 0x100287b -#define CLUTTER_braille_dots_34567 0x100287c -#define CLUTTER_braille_dots_134567 0x100287d -#define CLUTTER_braille_dots_234567 0x100287e -#define CLUTTER_braille_dots_1234567 0x100287f -#define CLUTTER_braille_dots_8 0x1002880 -#define CLUTTER_braille_dots_18 0x1002881 -#define CLUTTER_braille_dots_28 0x1002882 -#define CLUTTER_braille_dots_128 0x1002883 -#define CLUTTER_braille_dots_38 0x1002884 -#define CLUTTER_braille_dots_138 0x1002885 -#define CLUTTER_braille_dots_238 0x1002886 -#define CLUTTER_braille_dots_1238 0x1002887 -#define CLUTTER_braille_dots_48 0x1002888 -#define CLUTTER_braille_dots_148 0x1002889 -#define CLUTTER_braille_dots_248 0x100288a -#define CLUTTER_braille_dots_1248 0x100288b -#define CLUTTER_braille_dots_348 0x100288c -#define CLUTTER_braille_dots_1348 0x100288d -#define CLUTTER_braille_dots_2348 0x100288e -#define CLUTTER_braille_dots_12348 0x100288f -#define CLUTTER_braille_dots_58 0x1002890 -#define CLUTTER_braille_dots_158 0x1002891 -#define CLUTTER_braille_dots_258 0x1002892 -#define CLUTTER_braille_dots_1258 0x1002893 -#define CLUTTER_braille_dots_358 0x1002894 -#define CLUTTER_braille_dots_1358 0x1002895 -#define CLUTTER_braille_dots_2358 0x1002896 -#define CLUTTER_braille_dots_12358 0x1002897 -#define CLUTTER_braille_dots_458 0x1002898 -#define CLUTTER_braille_dots_1458 0x1002899 -#define CLUTTER_braille_dots_2458 0x100289a -#define CLUTTER_braille_dots_12458 0x100289b -#define CLUTTER_braille_dots_3458 0x100289c -#define CLUTTER_braille_dots_13458 0x100289d -#define CLUTTER_braille_dots_23458 0x100289e -#define CLUTTER_braille_dots_123458 0x100289f -#define CLUTTER_braille_dots_68 0x10028a0 -#define CLUTTER_braille_dots_168 0x10028a1 -#define CLUTTER_braille_dots_268 0x10028a2 -#define CLUTTER_braille_dots_1268 0x10028a3 -#define CLUTTER_braille_dots_368 0x10028a4 -#define CLUTTER_braille_dots_1368 0x10028a5 -#define CLUTTER_braille_dots_2368 0x10028a6 -#define CLUTTER_braille_dots_12368 0x10028a7 -#define CLUTTER_braille_dots_468 0x10028a8 -#define CLUTTER_braille_dots_1468 0x10028a9 -#define CLUTTER_braille_dots_2468 0x10028aa -#define CLUTTER_braille_dots_12468 0x10028ab -#define CLUTTER_braille_dots_3468 0x10028ac -#define CLUTTER_braille_dots_13468 0x10028ad -#define CLUTTER_braille_dots_23468 0x10028ae -#define CLUTTER_braille_dots_123468 0x10028af -#define CLUTTER_braille_dots_568 0x10028b0 -#define CLUTTER_braille_dots_1568 0x10028b1 -#define CLUTTER_braille_dots_2568 0x10028b2 -#define CLUTTER_braille_dots_12568 0x10028b3 -#define CLUTTER_braille_dots_3568 0x10028b4 -#define CLUTTER_braille_dots_13568 0x10028b5 -#define CLUTTER_braille_dots_23568 0x10028b6 -#define CLUTTER_braille_dots_123568 0x10028b7 -#define CLUTTER_braille_dots_4568 0x10028b8 -#define CLUTTER_braille_dots_14568 0x10028b9 -#define CLUTTER_braille_dots_24568 0x10028ba -#define CLUTTER_braille_dots_124568 0x10028bb -#define CLUTTER_braille_dots_34568 0x10028bc -#define CLUTTER_braille_dots_134568 0x10028bd -#define CLUTTER_braille_dots_234568 0x10028be -#define CLUTTER_braille_dots_1234568 0x10028bf -#define CLUTTER_braille_dots_78 0x10028c0 -#define CLUTTER_braille_dots_178 0x10028c1 -#define CLUTTER_braille_dots_278 0x10028c2 -#define CLUTTER_braille_dots_1278 0x10028c3 -#define CLUTTER_braille_dots_378 0x10028c4 -#define CLUTTER_braille_dots_1378 0x10028c5 -#define CLUTTER_braille_dots_2378 0x10028c6 -#define CLUTTER_braille_dots_12378 0x10028c7 -#define CLUTTER_braille_dots_478 0x10028c8 -#define CLUTTER_braille_dots_1478 0x10028c9 -#define CLUTTER_braille_dots_2478 0x10028ca -#define CLUTTER_braille_dots_12478 0x10028cb -#define CLUTTER_braille_dots_3478 0x10028cc -#define CLUTTER_braille_dots_13478 0x10028cd -#define CLUTTER_braille_dots_23478 0x10028ce -#define CLUTTER_braille_dots_123478 0x10028cf -#define CLUTTER_braille_dots_578 0x10028d0 -#define CLUTTER_braille_dots_1578 0x10028d1 -#define CLUTTER_braille_dots_2578 0x10028d2 -#define CLUTTER_braille_dots_12578 0x10028d3 -#define CLUTTER_braille_dots_3578 0x10028d4 -#define CLUTTER_braille_dots_13578 0x10028d5 -#define CLUTTER_braille_dots_23578 0x10028d6 -#define CLUTTER_braille_dots_123578 0x10028d7 -#define CLUTTER_braille_dots_4578 0x10028d8 -#define CLUTTER_braille_dots_14578 0x10028d9 -#define CLUTTER_braille_dots_24578 0x10028da -#define CLUTTER_braille_dots_124578 0x10028db -#define CLUTTER_braille_dots_34578 0x10028dc -#define CLUTTER_braille_dots_134578 0x10028dd -#define CLUTTER_braille_dots_234578 0x10028de -#define CLUTTER_braille_dots_1234578 0x10028df -#define CLUTTER_braille_dots_678 0x10028e0 -#define CLUTTER_braille_dots_1678 0x10028e1 -#define CLUTTER_braille_dots_2678 0x10028e2 -#define CLUTTER_braille_dots_12678 0x10028e3 -#define CLUTTER_braille_dots_3678 0x10028e4 -#define CLUTTER_braille_dots_13678 0x10028e5 -#define CLUTTER_braille_dots_23678 0x10028e6 -#define CLUTTER_braille_dots_123678 0x10028e7 -#define CLUTTER_braille_dots_4678 0x10028e8 -#define CLUTTER_braille_dots_14678 0x10028e9 -#define CLUTTER_braille_dots_24678 0x10028ea -#define CLUTTER_braille_dots_124678 0x10028eb -#define CLUTTER_braille_dots_34678 0x10028ec -#define CLUTTER_braille_dots_134678 0x10028ed -#define CLUTTER_braille_dots_234678 0x10028ee -#define CLUTTER_braille_dots_1234678 0x10028ef -#define CLUTTER_braille_dots_5678 0x10028f0 -#define CLUTTER_braille_dots_15678 0x10028f1 -#define CLUTTER_braille_dots_25678 0x10028f2 -#define CLUTTER_braille_dots_125678 0x10028f3 -#define CLUTTER_braille_dots_35678 0x10028f4 -#define CLUTTER_braille_dots_135678 0x10028f5 -#define CLUTTER_braille_dots_235678 0x10028f6 -#define CLUTTER_braille_dots_1235678 0x10028f7 -#define CLUTTER_braille_dots_45678 0x10028f8 -#define CLUTTER_braille_dots_145678 0x10028f9 -#define CLUTTER_braille_dots_245678 0x10028fa -#define CLUTTER_braille_dots_1245678 0x10028fb -#define CLUTTER_braille_dots_345678 0x10028fc -#define CLUTTER_braille_dots_1345678 0x10028fd -#define CLUTTER_braille_dots_2345678 0x10028fe -#define CLUTTER_braille_dots_12345678 0x10028ff -#define CLUTTER_Sinh_ng 0x1000d82 -#define CLUTTER_Sinh_h2 0x1000d83 -#define CLUTTER_Sinh_a 0x1000d85 -#define CLUTTER_Sinh_aa 0x1000d86 -#define CLUTTER_Sinh_ae 0x1000d87 -#define CLUTTER_Sinh_aee 0x1000d88 -#define CLUTTER_Sinh_i 0x1000d89 -#define CLUTTER_Sinh_ii 0x1000d8a -#define CLUTTER_Sinh_u 0x1000d8b -#define CLUTTER_Sinh_uu 0x1000d8c -#define CLUTTER_Sinh_ri 0x1000d8d -#define CLUTTER_Sinh_rii 0x1000d8e -#define CLUTTER_Sinh_lu 0x1000d8f -#define CLUTTER_Sinh_luu 0x1000d90 -#define CLUTTER_Sinh_e 0x1000d91 -#define CLUTTER_Sinh_ee 0x1000d92 -#define CLUTTER_Sinh_ai 0x1000d93 -#define CLUTTER_Sinh_o 0x1000d94 -#define CLUTTER_Sinh_oo 0x1000d95 -#define CLUTTER_Sinh_au 0x1000d96 -#define CLUTTER_Sinh_ka 0x1000d9a -#define CLUTTER_Sinh_kha 0x1000d9b -#define CLUTTER_Sinh_ga 0x1000d9c -#define CLUTTER_Sinh_gha 0x1000d9d -#define CLUTTER_Sinh_ng2 0x1000d9e -#define CLUTTER_Sinh_nga 0x1000d9f -#define CLUTTER_Sinh_ca 0x1000da0 -#define CLUTTER_Sinh_cha 0x1000da1 -#define CLUTTER_Sinh_ja 0x1000da2 -#define CLUTTER_Sinh_jha 0x1000da3 -#define CLUTTER_Sinh_nya 0x1000da4 -#define CLUTTER_Sinh_jnya 0x1000da5 -#define CLUTTER_Sinh_nja 0x1000da6 -#define CLUTTER_Sinh_tta 0x1000da7 -#define CLUTTER_Sinh_ttha 0x1000da8 -#define CLUTTER_Sinh_dda 0x1000da9 -#define CLUTTER_Sinh_ddha 0x1000daa -#define CLUTTER_Sinh_nna 0x1000dab -#define CLUTTER_Sinh_ndda 0x1000dac -#define CLUTTER_Sinh_tha 0x1000dad -#define CLUTTER_Sinh_thha 0x1000dae -#define CLUTTER_Sinh_dha 0x1000daf -#define CLUTTER_Sinh_dhha 0x1000db0 -#define CLUTTER_Sinh_na 0x1000db1 -#define CLUTTER_Sinh_ndha 0x1000db3 -#define CLUTTER_Sinh_pa 0x1000db4 -#define CLUTTER_Sinh_pha 0x1000db5 -#define CLUTTER_Sinh_ba 0x1000db6 -#define CLUTTER_Sinh_bha 0x1000db7 -#define CLUTTER_Sinh_ma 0x1000db8 -#define CLUTTER_Sinh_mba 0x1000db9 -#define CLUTTER_Sinh_ya 0x1000dba -#define CLUTTER_Sinh_ra 0x1000dbb -#define CLUTTER_Sinh_la 0x1000dbd -#define CLUTTER_Sinh_va 0x1000dc0 -#define CLUTTER_Sinh_sha 0x1000dc1 -#define CLUTTER_Sinh_ssha 0x1000dc2 -#define CLUTTER_Sinh_sa 0x1000dc3 -#define CLUTTER_Sinh_ha 0x1000dc4 -#define CLUTTER_Sinh_lla 0x1000dc5 -#define CLUTTER_Sinh_fa 0x1000dc6 -#define CLUTTER_Sinh_al 0x1000dca -#define CLUTTER_Sinh_aa2 0x1000dcf -#define CLUTTER_Sinh_ae2 0x1000dd0 -#define CLUTTER_Sinh_aee2 0x1000dd1 -#define CLUTTER_Sinh_i2 0x1000dd2 -#define CLUTTER_Sinh_ii2 0x1000dd3 -#define CLUTTER_Sinh_u2 0x1000dd4 -#define CLUTTER_Sinh_uu2 0x1000dd6 -#define CLUTTER_Sinh_ru2 0x1000dd8 -#define CLUTTER_Sinh_e2 0x1000dd9 -#define CLUTTER_Sinh_ee2 0x1000dda -#define CLUTTER_Sinh_ai2 0x1000ddb -#define CLUTTER_Sinh_o2 0x1000ddc -#define CLUTTER_Sinh_oo2 0x1000ddd -#define CLUTTER_Sinh_au2 0x1000dde -#define CLUTTER_Sinh_lu2 0x1000ddf -#define CLUTTER_Sinh_ruu2 0x1000df2 -#define CLUTTER_Sinh_luu2 0x1000df3 -#define CLUTTER_Sinh_kunddaliya 0x1000df4 -#define CLUTTER_ModeLock 0x1008ff01 -#define CLUTTER_MonBrightnessUp 0x1008ff02 -#define CLUTTER_MonBrightnessDown 0x1008ff03 -#define CLUTTER_KbdLightOnOff 0x1008ff04 -#define CLUTTER_KbdBrightnessUp 0x1008ff05 -#define CLUTTER_KbdBrightnessDown 0x1008ff06 -#define CLUTTER_Standby 0x1008ff10 -#define CLUTTER_AudioLowerVolume 0x1008ff11 -#define CLUTTER_AudioMute 0x1008ff12 -#define CLUTTER_AudioRaiseVolume 0x1008ff13 -#define CLUTTER_AudioPlay 0x1008ff14 -#define CLUTTER_AudioStop 0x1008ff15 -#define CLUTTER_AudioPrev 0x1008ff16 -#define CLUTTER_AudioNext 0x1008ff17 -#define CLUTTER_HomePage 0x1008ff18 -#define CLUTTER_Mail 0x1008ff19 -#define CLUTTER_Start 0x1008ff1a -#define CLUTTER_Search 0x1008ff1b -#define CLUTTER_AudioRecord 0x1008ff1c -#define CLUTTER_Calculator 0x1008ff1d -#define CLUTTER_Memo 0x1008ff1e -#define CLUTTER_ToDoList 0x1008ff1f -#define CLUTTER_Calendar 0x1008ff20 -#define CLUTTER_PowerDown 0x1008ff21 -#define CLUTTER_ContrastAdjust 0x1008ff22 -#define CLUTTER_RockerUp 0x1008ff23 -#define CLUTTER_RockerDown 0x1008ff24 -#define CLUTTER_RockerEnter 0x1008ff25 -#define CLUTTER_Back 0x1008ff26 -#define CLUTTER_Forward 0x1008ff27 -#define CLUTTER_Stop 0x1008ff28 -#define CLUTTER_Refresh 0x1008ff29 -#define CLUTTER_PowerOff 0x1008ff2a -#define CLUTTER_WakeUp 0x1008ff2b -#define CLUTTER_Eject 0x1008ff2c -#define CLUTTER_ScreenSaver 0x1008ff2d -#define CLUTTER_WWW 0x1008ff2e -#define CLUTTER_Sleep 0x1008ff2f -#define CLUTTER_Favorites 0x1008ff30 -#define CLUTTER_AudioPause 0x1008ff31 -#define CLUTTER_AudioMedia 0x1008ff32 -#define CLUTTER_MyComputer 0x1008ff33 -#define CLUTTER_VendorHome 0x1008ff34 -#define CLUTTER_LightBulb 0x1008ff35 -#define CLUTTER_Shop 0x1008ff36 -#define CLUTTER_History 0x1008ff37 -#define CLUTTER_OpenURL 0x1008ff38 -#define CLUTTER_AddFavorite 0x1008ff39 -#define CLUTTER_HotLinks 0x1008ff3a -#define CLUTTER_BrightnessAdjust 0x1008ff3b -#define CLUTTER_Finance 0x1008ff3c -#define CLUTTER_Community 0x1008ff3d -#define CLUTTER_AudioRewind 0x1008ff3e -#define CLUTTER_BackForward 0x1008ff3f -#define CLUTTER_Launch0 0x1008ff40 -#define CLUTTER_Launch1 0x1008ff41 -#define CLUTTER_Launch2 0x1008ff42 -#define CLUTTER_Launch3 0x1008ff43 -#define CLUTTER_Launch4 0x1008ff44 -#define CLUTTER_Launch5 0x1008ff45 -#define CLUTTER_Launch6 0x1008ff46 -#define CLUTTER_Launch7 0x1008ff47 -#define CLUTTER_Launch8 0x1008ff48 -#define CLUTTER_Launch9 0x1008ff49 -#define CLUTTER_LaunchA 0x1008ff4a -#define CLUTTER_LaunchB 0x1008ff4b -#define CLUTTER_LaunchC 0x1008ff4c -#define CLUTTER_LaunchD 0x1008ff4d -#define CLUTTER_LaunchE 0x1008ff4e -#define CLUTTER_LaunchF 0x1008ff4f -#define CLUTTER_ApplicationLeft 0x1008ff50 -#define CLUTTER_ApplicationRight 0x1008ff51 -#define CLUTTER_Book 0x1008ff52 -#define CLUTTER_CD 0x1008ff53 -#define CLUTTER_WindowClear 0x1008ff55 -#define CLUTTER_Close 0x1008ff56 -#define CLUTTER_Copy 0x1008ff57 -#define CLUTTER_Cut 0x1008ff58 -#define CLUTTER_Display 0x1008ff59 -#define CLUTTER_DOS 0x1008ff5a -#define CLUTTER_Documents 0x1008ff5b -#define CLUTTER_Excel 0x1008ff5c -#define CLUTTER_Explorer 0x1008ff5d -#define CLUTTER_Game 0x1008ff5e -#define CLUTTER_Go 0x1008ff5f -#define CLUTTER_iTouch 0x1008ff60 -#define CLUTTER_LogOff 0x1008ff61 -#define CLUTTER_Market 0x1008ff62 -#define CLUTTER_Meeting 0x1008ff63 -#define CLUTTER_MenuKB 0x1008ff65 -#define CLUTTER_MenuPB 0x1008ff66 -#define CLUTTER_MySites 0x1008ff67 -#define CLUTTER_New 0x1008ff68 -#define CLUTTER_News 0x1008ff69 -#define CLUTTER_OfficeHome 0x1008ff6a -#define CLUTTER_Open 0x1008ff6b -#define CLUTTER_Option 0x1008ff6c -#define CLUTTER_Paste 0x1008ff6d -#define CLUTTER_Phone 0x1008ff6e -#define CLUTTER_Reply 0x1008ff72 -#define CLUTTER_Reload 0x1008ff73 -#define CLUTTER_RotateWindows 0x1008ff74 -#define CLUTTER_RotationPB 0x1008ff75 -#define CLUTTER_RotationKB 0x1008ff76 -#define CLUTTER_Save 0x1008ff77 -#define CLUTTER_ScrollUp 0x1008ff78 -#define CLUTTER_ScrollDown 0x1008ff79 -#define CLUTTER_ScrollClick 0x1008ff7a -#define CLUTTER_Send 0x1008ff7b -#define CLUTTER_Spell 0x1008ff7c -#define CLUTTER_SplitScreen 0x1008ff7d -#define CLUTTER_Support 0x1008ff7e -#define CLUTTER_TaskPane 0x1008ff7f -#define CLUTTER_Terminal 0x1008ff80 -#define CLUTTER_Tools 0x1008ff81 -#define CLUTTER_Travel 0x1008ff82 -#define CLUTTER_UserPB 0x1008ff84 -#define CLUTTER_User1KB 0x1008ff85 -#define CLUTTER_User2KB 0x1008ff86 -#define CLUTTER_Video 0x1008ff87 -#define CLUTTER_WheelButton 0x1008ff88 -#define CLUTTER_Word 0x1008ff89 -#define CLUTTER_Xfer 0x1008ff8a -#define CLUTTER_ZoomIn 0x1008ff8b -#define CLUTTER_ZoomOut 0x1008ff8c -#define CLUTTER_Away 0x1008ff8d -#define CLUTTER_Messenger 0x1008ff8e -#define CLUTTER_WebCam 0x1008ff8f -#define CLUTTER_MailForward 0x1008ff90 -#define CLUTTER_Pictures 0x1008ff91 -#define CLUTTER_Music 0x1008ff92 -#define CLUTTER_Battery 0x1008ff93 -#define CLUTTER_Bluetooth 0x1008ff94 -#define CLUTTER_WLAN 0x1008ff95 -#define CLUTTER_UWB 0x1008ff96 -#define CLUTTER_AudioForward 0x1008ff97 -#define CLUTTER_AudioRepeat 0x1008ff98 -#define CLUTTER_AudioRandomPlay 0x1008ff99 -#define CLUTTER_Subtitle 0x1008ff9a -#define CLUTTER_AudioCycleTrack 0x1008ff9b -#define CLUTTER_CycleAngle 0x1008ff9c -#define CLUTTER_FrameBack 0x1008ff9d -#define CLUTTER_FrameForward 0x1008ff9e -#define CLUTTER_Time 0x1008ff9f -#define CLUTTER_SelectButton 0x1008ffa0 -#define CLUTTER_View 0x1008ffa1 -#define CLUTTER_TopMenu 0x1008ffa2 -#define CLUTTER_Red 0x1008ffa3 -#define CLUTTER_Green 0x1008ffa4 -#define CLUTTER_Yellow 0x1008ffa5 -#define CLUTTER_Blue 0x1008ffa6 -#define CLUTTER_Suspend 0x1008ffa7 -#define CLUTTER_Hibernate 0x1008ffa8 -#define CLUTTER_TouchpadToggle 0x1008ffa9 -#define CLUTTER_TouchpadOn 0x1008ffb0 -#define CLUTTER_TouchpadOff 0x1008ffb1 -#define CLUTTER_Switch_VT_1 0x1008fe01 -#define CLUTTER_Switch_VT_2 0x1008fe02 -#define CLUTTER_Switch_VT_3 0x1008fe03 -#define CLUTTER_Switch_VT_4 0x1008fe04 -#define CLUTTER_Switch_VT_5 0x1008fe05 -#define CLUTTER_Switch_VT_6 0x1008fe06 -#define CLUTTER_Switch_VT_7 0x1008fe07 -#define CLUTTER_Switch_VT_8 0x1008fe08 -#define CLUTTER_Switch_VT_9 0x1008fe09 -#define CLUTTER_Switch_VT_10 0x1008fe0a -#define CLUTTER_Switch_VT_11 0x1008fe0b -#define CLUTTER_Switch_VT_12 0x1008fe0c -#define CLUTTER_Ungrab 0x1008fe20 -#define CLUTTER_ClearGrab 0x1008fe21 -#define CLUTTER_Next_VMode 0x1008fe22 -#define CLUTTER_Prev_VMode 0x1008fe23 -#define CLUTTER_LogWindowTree 0x1008fe24 -#define CLUTTER_LogGrabInfo 0x1008fe25 - -#endif /* CLUTTER_DISABLE_DEPRECATED */ - -#endif /* __CLUTTER_KEYSYMS_DEPRECATED_H__ */ diff --git a/clutter/deprecated/clutter-layout-manager-deprecated.c b/clutter/deprecated/clutter-layout-manager-deprecated.c deleted file mode 100644 index e8a43d8da..000000000 --- a/clutter/deprecated/clutter-layout-manager-deprecated.c +++ /dev/null @@ -1,89 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "clutter-layout-manager.h" - -/** - * clutter_layout_manager_begin_animation: - * @manager: a #ClutterLayoutManager - * @duration: the duration of the animation, in milliseconds - * @mode: the easing mode of the animation - * - * Begins an animation of @duration milliseconds, using the provided - * easing @mode - * - * The easing mode can be specified either as a #ClutterAnimationMode - * or as a logical id returned by clutter_alpha_register_func() - * - * The result of this function depends on the @manager implementation - * - * Return value: (transfer none): The #ClutterAlpha created by the - * layout manager; the returned instance is owned by the layout - * manager and should not be unreferenced - * - * - * - * Deprecated: 1.12 - */ -ClutterAlpha * -clutter_layout_manager_begin_animation (ClutterLayoutManager *manager, - guint duration, - gulong mode) -{ - ClutterLayoutManagerClass *klass; - - g_return_val_if_fail (CLUTTER_IS_LAYOUT_MANAGER (manager), NULL); - - klass = CLUTTER_LAYOUT_MANAGER_GET_CLASS (manager); - - return klass->begin_animation (manager, duration, mode); -} - -/** - * clutter_layout_manager_end_animation: - * @manager: a #ClutterLayoutManager - * - * Ends an animation started by clutter_layout_manager_begin_animation() - * - * The result of this call depends on the @manager implementation - * - * - * - * Deprecated: 1.12 - */ -void -clutter_layout_manager_end_animation (ClutterLayoutManager *manager) -{ - g_return_if_fail (CLUTTER_IS_LAYOUT_MANAGER (manager)); - - CLUTTER_LAYOUT_MANAGER_GET_CLASS (manager)->end_animation (manager); -} - -/** - * clutter_layout_manager_get_animation_progress: - * @manager: a #ClutterLayoutManager - * - * Retrieves the progress of the animation, if one has been started by - * clutter_layout_manager_begin_animation() - * - * The returned value has the same semantics of the #ClutterAlpha:alpha - * value - * - * Return value: the progress of the animation - * - * - * - * Deprecated: 1.12 - */ -gdouble -clutter_layout_manager_get_animation_progress (ClutterLayoutManager *manager) -{ - ClutterLayoutManagerClass *klass; - - g_return_val_if_fail (CLUTTER_IS_LAYOUT_MANAGER (manager), 1.0); - - klass = CLUTTER_LAYOUT_MANAGER_GET_CLASS (manager); - - return klass->get_animation_progress (manager); -} diff --git a/clutter/deprecated/clutter-main.h b/clutter/deprecated/clutter-main.h deleted file mode 100644 index 257ac5a70..000000000 --- a/clutter/deprecated/clutter-main.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Copyright (C) 2011 Intel Corp - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_MAIN_DEPRECATED_H__ -#define __CLUTTER_MAIN_DEPRECATED_H__ - -#include -#include - -G_BEGIN_DECLS - -CLUTTER_DEPRECATED_IN_1_10 -void clutter_threads_init (void); - -CLUTTER_DEPRECATED_IN_1_12 -void clutter_threads_enter (void); - -CLUTTER_DEPRECATED_IN_1_12 -void clutter_threads_leave (void); - -CLUTTER_DEPRECATED_IN_1_6 -guint clutter_threads_add_frame_source (guint fps, - GSourceFunc func, - gpointer data); -CLUTTER_DEPRECATED_IN_1_6 -guint clutter_threads_add_frame_source_full (gint priority, - guint fps, - GSourceFunc func, - gpointer data, - GDestroyNotify notify); - -CLUTTER_DEPRECATED_IN_1_8_FOR(clutter_stage_set_motion_events_enabled) -void clutter_set_motion_events_enabled (gboolean enable); - -CLUTTER_DEPRECATED_IN_1_8_FOR(clutter_stage_get_motion_events_enabled) -gboolean clutter_get_motion_events_enabled (void); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_stage_ensure_redraw) -void clutter_redraw (ClutterStage *stage); - -CLUTTER_DEPRECATED_IN_1_10_FOR(cogl_pango_font_map_clear_glyph_cache) -void clutter_clear_glyph_cache (void); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_backend_set_font_options) -void clutter_set_font_flags (ClutterFontFlags flags); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_backend_get_font_options) -ClutterFontFlags clutter_get_font_flags (void); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_device_manager_get_device) -ClutterInputDevice * clutter_get_input_device_for_id (gint id_); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_input_device_grab) -void clutter_grab_pointer_for_device (ClutterActor *actor, - gint id_); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_input_device_ungrab) -void clutter_ungrab_pointer_for_device (gint id_); - -CLUTTER_DEPRECATED_IN_1_10 -void clutter_set_default_frame_rate (guint frames_per_sec); - -CLUTTER_DEPRECATED_IN_1_10 -gulong clutter_get_timestamp (void); - -CLUTTER_DEPRECATED_IN_1_10 -gboolean clutter_get_debug_enabled (void); - -CLUTTER_DEPRECATED_IN_1_10 -gboolean clutter_get_show_fps (void); - -G_END_DECLS - -#endif /* __CLUTTER_MAIN_DEPRECATED_H__ */ diff --git a/clutter/deprecated/clutter-media.c b/clutter/deprecated/clutter-media.c deleted file mode 100644 index 4ff223780..000000000 --- a/clutter/deprecated/clutter-media.c +++ /dev/null @@ -1,665 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By: Matthew Allum - * Emmanuele Bassi - * - * Copyright (C) 2006 OpenedHand - * Copyright (C) 2009 Intel Corp. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -/** - * SECTION:clutter-media - * @short_description: An interface for controlling playback of media data - * - * #ClutterMedia is an interface for controlling playback of media sources. - * - * Clutter core does not provide an implementation of this interface, but - * other integration libraries like Clutter-GStreamer implement it to offer - * a uniform API for applications. - * - * #ClutterMedia is available since Clutter 0.2 - * - * #ClutterMedia is deprecated since Clutter 1.12 - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#define CLUTTER_DISABLE_DEPRECATION_WARNINGS - -#include "clutter-debug.h" -#include "clutter-enum-types.h" -#include "clutter-marshal.h" -#include "clutter-media.h" -#include "clutter-main.h" -#include "clutter-private.h" /* for DBG */ - -enum -{ - EOS_SIGNAL, - ERROR_SIGNAL, /* can't be called 'ERROR' otherwise it clashes with wingdi.h */ - - LAST_SIGNAL -}; - -static guint media_signals[LAST_SIGNAL] = { 0, }; - -typedef ClutterMediaIface ClutterMediaInterface; - -G_DEFINE_INTERFACE (ClutterMedia, clutter_media, G_TYPE_OBJECT); - -static void -clutter_media_default_init (ClutterMediaInterface *iface) -{ - GParamSpec *pspec = NULL; - - /** - * ClutterMedia:uri: - * - * The location of a media file, expressed as a valid URI. - * - * - * - * Deprecated: 1.12 - */ - pspec = g_param_spec_string ("uri", - P_("URI"), - P_("URI of a media file"), - NULL, - CLUTTER_PARAM_READWRITE | - G_PARAM_DEPRECATED); - g_object_interface_install_property (iface, pspec); - - /** - * ClutterMedia:playing: - * - * Whether the #ClutterMedia actor is playing. - * - * - * - * Deprecated: 1.12 - */ - pspec = g_param_spec_boolean ("playing", - P_("Playing"), - P_("Whether the actor is playing"), - FALSE, - CLUTTER_PARAM_READWRITE | - G_PARAM_DEPRECATED); - g_object_interface_install_property (iface, pspec); - - /** - * ClutterMedia:progress: - * - * The current progress of the playback, as a normalized - * value between 0.0 and 1.0. - * - * - * - * Deprecated: 1.12 - */ - pspec = g_param_spec_double ("progress", - P_("Progress"), - P_("Current progress of the playback"), - 0.0, 1.0, 0.0, - CLUTTER_PARAM_READWRITE | - G_PARAM_DEPRECATED); - g_object_interface_install_property (iface, pspec); - - /** - * ClutterMedia:subtitle-uri: - * - * The location of a subtitle file, expressed as a valid URI. - * - * - * - * Deprecated: 1.12 - */ - pspec = g_param_spec_string ("subtitle-uri", - P_("Subtitle URI"), - P_("URI of a subtitle file"), - NULL, - CLUTTER_PARAM_READWRITE | - G_PARAM_DEPRECATED); - g_object_interface_install_property (iface, pspec); - - /** - * ClutterMedia:subtitle-font-name: - * - * The font used to display subtitles. The font description has to - * follow the same grammar as the one recognized by - * pango_font_description_from_string(). - * - * - * - * Deprecated: 1.12 - */ - pspec = g_param_spec_string ("subtitle-font-name", - P_("Subtitle Font Name"), - P_("The font used to display subtitles"), - NULL, - CLUTTER_PARAM_READWRITE | - G_PARAM_DEPRECATED); - g_object_interface_install_property (iface, pspec); - - /** - * ClutterMedia:audio-volume: - * - * The volume of the audio, as a normalized value between - * 0.0 and 1.0. - * - * - * - * Deprecated: 1.12 - */ - pspec = g_param_spec_double ("audio-volume", - P_("Audio Volume"), - P_("The volume of the audio"), - 0.0, 1.0, 0.5, - CLUTTER_PARAM_READWRITE | - G_PARAM_DEPRECATED); - g_object_interface_install_property (iface, pspec); - - /** - * ClutterMedia:can-seek: - * - * Whether the current stream is seekable. - * - * - * - * Deprecated: 1.12 - */ - pspec = g_param_spec_boolean ("can-seek", - P_("Can Seek"), - P_("Whether the current stream is seekable"), - FALSE, - CLUTTER_PARAM_READABLE | - G_PARAM_DEPRECATED); - g_object_interface_install_property (iface, pspec); - - /** - * ClutterMedia:buffer-fill: - * - * The fill level of the buffer for the current stream, - * as a value between 0.0 and 1.0. - * - * - * - * Deprecated: 1.12 - */ - pspec = g_param_spec_double ("buffer-fill", - P_("Buffer Fill"), - P_("The fill level of the buffer"), - 0.0, 1.0, 0.0, - CLUTTER_PARAM_READABLE | - G_PARAM_DEPRECATED); - g_object_interface_install_property (iface, pspec); - - /** - * ClutterMedia:duration: - * - * The duration of the current stream, in seconds - * - * - * - * Deprecated: 1.12 - */ - pspec = g_param_spec_double ("duration", - P_("Duration"), - P_("The duration of the stream, in seconds"), - 0, G_MAXDOUBLE, 0, - CLUTTER_PARAM_READABLE); - g_object_interface_install_property (iface, pspec); - - /** - * ClutterMedia::eos: - * @media: the #ClutterMedia instance that received the signal - * - * The ::eos signal is emitted each time the media stream ends. - * - * - * - * Deprecated: 1.12 - */ - media_signals[EOS_SIGNAL] = - g_signal_new (I_("eos"), - CLUTTER_TYPE_MEDIA, - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ClutterMediaIface, eos), - NULL, NULL, - _clutter_marshal_VOID__VOID, - G_TYPE_NONE, 0); - /** - * ClutterMedia::error: - * @media: the #ClutterMedia instance that received the signal - * @error: the #GError - * - * The ::error signal is emitted each time an error occurred. - * - * - * - * Deprecated: 1.12 - */ - media_signals[ERROR_SIGNAL] = - g_signal_new (I_("error"), - CLUTTER_TYPE_MEDIA, - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ClutterMediaIface, error), - NULL, NULL, - _clutter_marshal_VOID__BOXED, - G_TYPE_NONE, 1, - G_TYPE_ERROR); -} - - -/** - * clutter_media_set_uri: - * @media: a #ClutterMedia - * @uri: the URI of the media stream - * - * Sets the URI of @media to @uri. - * - * - * - * Deprecated: 1.12 - */ -void -clutter_media_set_uri (ClutterMedia *media, - const gchar *uri) -{ - g_return_if_fail (CLUTTER_IS_MEDIA(media)); - - g_object_set (G_OBJECT (media), "uri", uri, NULL); -} - -/** - * clutter_media_get_uri: - * @media: a #ClutterMedia - * - * Retrieves the URI from @media. - * - * Return value: the URI of the media stream. Use g_free() - * to free the returned string - * - * - * - * Deprecated: 1.12 - */ -gchar * -clutter_media_get_uri (ClutterMedia *media) -{ - gchar *retval = NULL; - - g_return_val_if_fail (CLUTTER_IS_MEDIA(media), NULL); - - g_object_get (G_OBJECT (media), "uri", &retval, NULL); - - return retval; -} - -/** - * clutter_media_set_playing: - * @media: a #ClutterMedia - * @playing: %TRUE to start playing - * - * Starts or stops playing of @media. - - * The implementation might be asynchronous, so the way to know whether - * the actual playing state of the @media is to use the #GObject::notify - * signal on the #ClutterMedia:playing property and then retrieve the - * current state with clutter_media_get_playing(). ClutterGstVideoTexture - * in clutter-gst is an example of such an asynchronous implementation. - * - * - * - * Deprecated: 1.12 - */ -void -clutter_media_set_playing (ClutterMedia *media, - gboolean playing) -{ - g_return_if_fail (CLUTTER_IS_MEDIA(media)); - - g_object_set (G_OBJECT (media), "playing", playing, NULL); -} - -/** - * clutter_media_get_playing: - * @media: A #ClutterMedia object - * - * Retrieves the playing status of @media. - * - * Return value: %TRUE if playing, %FALSE if stopped. - * - * - * - * Deprecated: 1.12 - */ -gboolean -clutter_media_get_playing (ClutterMedia *media) -{ - gboolean is_playing = FALSE; - - g_return_val_if_fail (CLUTTER_IS_MEDIA (media), FALSE); - - g_object_get (G_OBJECT (media), "playing", &is_playing, NULL); - - return is_playing; -} - -/** - * clutter_media_set_progress: - * @media: a #ClutterMedia - * @progress: the progress of the playback, between 0.0 and 1.0 - * - * Sets the playback progress of @media. The @progress is - * a normalized value between 0.0 (begin) and 1.0 (end). - * - * - * - * Deprecated: 1.12 - */ -void -clutter_media_set_progress (ClutterMedia *media, - gdouble progress) -{ - g_return_if_fail (CLUTTER_IS_MEDIA (media)); - - g_object_set (G_OBJECT (media), "progress", progress, NULL); -} - -/** - * clutter_media_get_progress: - * @media: a #ClutterMedia - * - * Retrieves the playback progress of @media. - * - * Return value: the playback progress, between 0.0 and 1.0 - * - * - * - * Deprecated: 1.12 - */ -gdouble -clutter_media_get_progress (ClutterMedia *media) -{ - gdouble retval = 0.0; - - g_return_val_if_fail (CLUTTER_IS_MEDIA (media), 0); - - g_object_get (G_OBJECT (media), "progress", &retval, NULL); - - return retval; -} - -/** - * clutter_media_set_subtitle_uri: - * @media: a #ClutterMedia - * @uri: the URI of a subtitle file - * - * Sets the location of a subtitle file to display while playing @media. - * - * - * - * Deprecated: 1.12 - */ -void -clutter_media_set_subtitle_uri (ClutterMedia *media, - const char *uri) -{ - g_return_if_fail (CLUTTER_IS_MEDIA (media)); - - g_object_set (G_OBJECT (media), "subtitle-uri", uri, NULL); -} - -/** - * clutter_media_get_subtitle_uri: - * @media: a #ClutterMedia - * - * Retrieves the URI of the subtitle file in use. - * - * Return value: the URI of the subtitle file. Use g_free() - * to free the returned string - * - * - * - * Deprecated: 1.12 - */ -gchar * -clutter_media_get_subtitle_uri (ClutterMedia *media) -{ - gchar *retval = NULL; - - g_return_val_if_fail (CLUTTER_IS_MEDIA(media), NULL); - - g_object_get (G_OBJECT (media), "subtitle-uri", &retval, NULL); - - return retval; -} - -/** - * clutter_media_set_subtitle_font_name: - * @media: a #ClutterMedia - * @font_name: a font name, or %NULL to set the default font name - * - * Sets the font used by the subtitle renderer. The @font_name string must be - * either %NULL, which means that the default font name of the underlying - * implementation will be used; or must follow the grammar recognized by - * pango_font_description_from_string() like: - * - * |[ - * clutter_media_set_subtitle_font_name (media, "Sans 24pt"); - * ]| - * - * - * - * Deprecated: 1.12 - */ -void -clutter_media_set_subtitle_font_name (ClutterMedia *media, - const char *font_name) -{ - g_return_if_fail (CLUTTER_IS_MEDIA (media)); - - g_object_set (G_OBJECT (media), "subtitle-font-name", font_name, NULL); -} - -/** - * clutter_media_get_subtitle_font_name: - * @media: a #ClutterMedia - * - * Retrieves the font name currently used. - * - * Return value: a string containing the font name. Use g_free() - * to free the returned string - * - * - * - * Deprecated: 1.12 - */ -gchar * -clutter_media_get_subtitle_font_name (ClutterMedia *media) -{ - gchar *retval = NULL; - - g_return_val_if_fail (CLUTTER_IS_MEDIA(media), NULL); - - g_object_get (G_OBJECT (media), "subtitle-font-name", &retval, NULL); - - return retval; -} - -/** - * clutter_media_set_audio_volume: - * @media: a #ClutterMedia - * @volume: the volume as a double between 0.0 and 1.0 - * - * Sets the playback volume of @media to @volume. - * - * - * - * Deprecated: 1.12 - */ -void -clutter_media_set_audio_volume (ClutterMedia *media, - gdouble volume) -{ - g_return_if_fail (CLUTTER_IS_MEDIA(media)); - - g_object_set (G_OBJECT (media), "audio-volume", volume, NULL); -} - -/** - * clutter_media_get_audio_volume: - * @media: a #ClutterMedia - * - * Retrieves the playback volume of @media. - * - * Return value: The playback volume between 0.0 and 1.0 - * - * - * - * Deprecated: 1.12 - */ -gdouble -clutter_media_get_audio_volume (ClutterMedia *media) -{ - gdouble retval = 0.0; - - g_return_val_if_fail (CLUTTER_IS_MEDIA (media), 0.0); - - g_object_get (G_OBJECT (media), "audio-volume", &retval, NULL); - - return retval; -} - -/** - * clutter_media_get_can_seek: - * @media: a #ClutterMedia - * - * Retrieves whether @media is seekable or not. - * - * Return value: %TRUE if @media can seek, %FALSE otherwise. - * - * - * - * Deprecated: 1.12 - */ -gboolean -clutter_media_get_can_seek (ClutterMedia *media) -{ - gboolean retval = FALSE; - - g_return_val_if_fail (CLUTTER_IS_MEDIA (media), FALSE); - - g_object_get (G_OBJECT (media), "can-seek", &retval, NULL); - - return retval; -} - -/** - * clutter_media_get_buffer_fill: - * @media: a #ClutterMedia - * - * Retrieves the amount of the stream that is buffered. - * - * Return value: the fill level, between 0.0 and 1.0 - * - * - * - * Deprecated: 1.12 - */ -gdouble -clutter_media_get_buffer_fill (ClutterMedia *media) -{ - gdouble retval = 0.0; - - g_return_val_if_fail (CLUTTER_IS_MEDIA (media), 0); - - g_object_get (G_OBJECT (media), "buffer-fill", &retval, NULL); - - return retval; -} - -/** - * clutter_media_get_duration: - * @media: a #ClutterMedia - * - * Retrieves the duration of the media stream that @media represents. - * - * Return value: the duration of the media stream, in seconds - * - * - * - * Deprecated: 1.12 - */ -gdouble -clutter_media_get_duration (ClutterMedia *media) -{ - gdouble retval = 0; - - g_return_val_if_fail (CLUTTER_IS_MEDIA(media), 0); - - g_object_get (G_OBJECT (media), "duration", &retval, NULL); - - return retval; -} - -/* helper funcs */ - -/** - * clutter_media_set_filename: - * @media: a #ClutterMedia - * @filename: A filename - * - * Sets the source of @media using a file path. - * - * - * - * Deprecated: 1.12 - */ -void -clutter_media_set_filename (ClutterMedia *media, - const gchar *filename) -{ - gchar *uri; - GError *uri_error = NULL; - - if (!g_path_is_absolute (filename)) - { - gchar *abs_path; - - abs_path = g_build_filename (g_get_current_dir (), filename, NULL); - uri = g_filename_to_uri (abs_path, NULL, &uri_error); - g_free (abs_path); - } - else - uri = g_filename_to_uri (filename, NULL, &uri_error); - - if (uri_error) - { - g_signal_emit (media, media_signals[ERROR_SIGNAL], 0, uri_error); - g_error_free (uri_error); - return; - } - - clutter_media_set_uri (media, uri); - - g_free (uri); -} diff --git a/clutter/deprecated/clutter-media.h b/clutter/deprecated/clutter-media.h deleted file mode 100644 index 0d294099c..000000000 --- a/clutter/deprecated/clutter-media.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By: Matthew Allum - * Emmanuele Bassi - * - * Copyright (C) 2006 OpenedHand - * Copyright (C) 2009 Intel Corp. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_MEDIA_H__ -#define __CLUTTER_MEDIA_H__ - -#include - -G_BEGIN_DECLS - -#define CLUTTER_TYPE_MEDIA (clutter_media_get_type ()) -#define CLUTTER_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_MEDIA, ClutterMedia)) -#define CLUTTER_IS_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_MEDIA)) -#define CLUTTER_MEDIA_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CLUTTER_TYPE_MEDIA, ClutterMediaIface)) - -typedef struct _ClutterMedia ClutterMedia; /* dummy typedef */ -typedef struct _ClutterMediaIface ClutterMediaIface; - -/** - * ClutterMedia: - * - * #ClutterMedia is an opaque structure whose members cannot be directly - * accessed - * - * - */ - -/** - * ClutterMediaIface: - * @eos: handler for the #ClutterMedia::eos signal - * @error: handler for the #ClutterMedia::error signal - * - * Interface vtable for #ClutterMedia implementations - * - * - */ -struct _ClutterMediaIface -{ - /*< private >*/ - GTypeInterface base_iface; - - /*< public >*/ - /* signals */ - void (* eos) (ClutterMedia *media); - void (* error) (ClutterMedia *media, - const GError *error); -}; - -CLUTTER_DEPRECATED_IN_1_12 -GType clutter_media_get_type (void) G_GNUC_CONST; - -CLUTTER_DEPRECATED_IN_1_12 -void clutter_media_set_uri (ClutterMedia *media, - const gchar *uri); -CLUTTER_DEPRECATED_IN_1_12 -gchar * clutter_media_get_uri (ClutterMedia *media); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_media_set_filename (ClutterMedia *media, - const gchar *filename); - -CLUTTER_DEPRECATED_IN_1_12 -void clutter_media_set_playing (ClutterMedia *media, - gboolean playing); -CLUTTER_DEPRECATED_IN_1_12 -gboolean clutter_media_get_playing (ClutterMedia *media); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_media_set_progress (ClutterMedia *media, - gdouble progress); -CLUTTER_DEPRECATED_IN_1_12 -gdouble clutter_media_get_progress (ClutterMedia *media); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_media_set_subtitle_uri (ClutterMedia *media, - const gchar *uri); -CLUTTER_DEPRECATED_IN_1_12 -gchar * clutter_media_get_subtitle_uri (ClutterMedia *media); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_media_set_subtitle_font_name (ClutterMedia *media, - const char *font_name); -CLUTTER_DEPRECATED_IN_1_12 -gchar * clutter_media_get_subtitle_font_name (ClutterMedia *media); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_media_set_audio_volume (ClutterMedia *media, - gdouble volume); -CLUTTER_DEPRECATED_IN_1_12 -gdouble clutter_media_get_audio_volume (ClutterMedia *media); -CLUTTER_DEPRECATED_IN_1_12 -gboolean clutter_media_get_can_seek (ClutterMedia *media); -CLUTTER_DEPRECATED_IN_1_12 -gdouble clutter_media_get_buffer_fill (ClutterMedia *media); -CLUTTER_DEPRECATED_IN_1_12 -gdouble clutter_media_get_duration (ClutterMedia *media); - -G_END_DECLS - -#endif /* __CLUTTER_MEDIA_H__ */ diff --git a/clutter/deprecated/clutter-rectangle.c b/clutter/deprecated/clutter-rectangle.c deleted file mode 100644 index dc5d9e544..000000000 --- a/clutter/deprecated/clutter-rectangle.c +++ /dev/null @@ -1,559 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * Copyright (C) 2006 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - * - */ - -/** - * SECTION:clutter-rectangle - * @short_description: An actor that displays a simple rectangle. - * - * #ClutterRectangle is a #ClutterActor which draws a simple filled rectangle. - * - * Deprecated: 1.10: Use #ClutterActor instead. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#define CLUTTER_DISABLE_DEPRECATION_WARNINGS -#include "deprecated/clutter-rectangle.h" -#include "deprecated/clutter-actor.h" - -#include "clutter-actor-private.h" -#include "clutter-color.h" -#include "clutter-debug.h" -#include "clutter-main.h" -#include "clutter-private.h" - -#include "cogl/cogl.h" - -G_DEFINE_TYPE (ClutterRectangle, clutter_rectangle, CLUTTER_TYPE_ACTOR); - -enum -{ - PROP_0, - - PROP_COLOR, - PROP_BORDER_COLOR, - PROP_BORDER_WIDTH, - PROP_HAS_BORDER - - /* FIXME: Add gradient, rounded corner props etc */ -}; - -#define CLUTTER_RECTANGLE_GET_PRIVATE(obj) \ -(G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_RECTANGLE, ClutterRectanglePrivate)) - -struct _ClutterRectanglePrivate -{ - ClutterColor color; - ClutterColor border_color; - - guint border_width; - - guint has_border : 1; -}; - -static const ClutterColor default_color = { 255, 255, 255, 255 }; -static const ClutterColor default_border_color = { 0, 0, 0, 255 }; - -static void -clutter_rectangle_paint (ClutterActor *self) -{ - ClutterRectanglePrivate *priv = CLUTTER_RECTANGLE (self)->priv; - ClutterGeometry geom; - guint8 tmp_alpha; - - CLUTTER_NOTE (PAINT, - "painting rect '%s'", - clutter_actor_get_name (self) ? clutter_actor_get_name (self) - : "unknown"); - clutter_actor_get_allocation_geometry (self, &geom); - - /* parent paint call will have translated us into position so - * paint from 0, 0 - */ - if (priv->has_border) - { - /* compute the composited opacity of the actor taking into - * account the opacity of the color set by the user - */ - tmp_alpha = clutter_actor_get_paint_opacity (self) - * priv->border_color.alpha - / 255; - - /* paint the border */ - cogl_set_source_color4ub (priv->border_color.red, - priv->border_color.green, - priv->border_color.blue, - tmp_alpha); - - /* this sucks, but it's the only way to make a border */ - cogl_rectangle (priv->border_width, 0, - geom.width, - priv->border_width); - - cogl_rectangle (geom.width - priv->border_width, - priv->border_width, - geom.width, - geom.height); - - cogl_rectangle (0, geom.height - priv->border_width, - geom.width - priv->border_width, - geom.height); - - cogl_rectangle (0, 0, - priv->border_width, - geom.height - priv->border_width); - - tmp_alpha = clutter_actor_get_paint_opacity (self) - * priv->color.alpha - / 255; - - /* now paint the rectangle */ - cogl_set_source_color4ub (priv->color.red, - priv->color.green, - priv->color.blue, - tmp_alpha); - - cogl_rectangle (priv->border_width, priv->border_width, - geom.width - priv->border_width, - geom.height - priv->border_width); - } - else - { - /* compute the composited opacity of the actor taking into - * account the opacity of the color set by the user - */ - tmp_alpha = clutter_actor_get_paint_opacity (self) - * priv->color.alpha - / 255; - - cogl_set_source_color4ub (priv->color.red, - priv->color.green, - priv->color.blue, - tmp_alpha); - - cogl_rectangle (0, 0, geom.width, geom.height); - } -} - -static gboolean -clutter_rectangle_get_paint_volume (ClutterActor *self, - ClutterPaintVolume *volume) -{ - return _clutter_actor_set_default_paint_volume (self, - CLUTTER_TYPE_RECTANGLE, - volume); -} - -static gboolean -clutter_rectangle_has_overlaps (ClutterActor *self) -{ - /* Rectangles never need an offscreen redirect because there are - never any overlapping primitives */ - return FALSE; -} - -static void -clutter_rectangle_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - ClutterRectangle *rectangle = CLUTTER_RECTANGLE(object); - - switch (prop_id) - { - case PROP_COLOR: - clutter_rectangle_set_color (rectangle, clutter_value_get_color (value)); - break; - case PROP_BORDER_COLOR: - clutter_rectangle_set_border_color (rectangle, - clutter_value_get_color (value)); - break; - case PROP_BORDER_WIDTH: - clutter_rectangle_set_border_width (rectangle, - g_value_get_uint (value)); - break; - case PROP_HAS_BORDER: - rectangle->priv->has_border = g_value_get_boolean (value); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -clutter_rectangle_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - ClutterRectanglePrivate *priv = CLUTTER_RECTANGLE(object)->priv; - - switch (prop_id) - { - case PROP_COLOR: - clutter_value_set_color (value, &priv->color); - break; - case PROP_BORDER_COLOR: - clutter_value_set_color (value, &priv->border_color); - break; - case PROP_BORDER_WIDTH: - g_value_set_uint (value, priv->border_width); - break; - case PROP_HAS_BORDER: - g_value_set_boolean (value, priv->has_border); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - - -static void -clutter_rectangle_finalize (GObject *object) -{ - G_OBJECT_CLASS (clutter_rectangle_parent_class)->finalize (object); -} - -static void -clutter_rectangle_dispose (GObject *object) -{ - G_OBJECT_CLASS (clutter_rectangle_parent_class)->dispose (object); -} - - -static void -clutter_rectangle_class_init (ClutterRectangleClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); - GParamSpec *pspec; - - actor_class->paint = clutter_rectangle_paint; - actor_class->get_paint_volume = clutter_rectangle_get_paint_volume; - actor_class->has_overlaps = clutter_rectangle_has_overlaps; - - gobject_class->finalize = clutter_rectangle_finalize; - gobject_class->dispose = clutter_rectangle_dispose; - gobject_class->set_property = clutter_rectangle_set_property; - gobject_class->get_property = clutter_rectangle_get_property; - - /** - * ClutterRectangle:color: - * - * The color of the rectangle. - */ - pspec = clutter_param_spec_color ("color", - P_("Color"), - P_("The color of the rectangle"), - &default_color, - CLUTTER_PARAM_READWRITE); - g_object_class_install_property (gobject_class, PROP_COLOR, pspec); - - /** - * ClutterRectangle:border-color: - * - * The color of the border of the rectangle. - * - * - */ - pspec = clutter_param_spec_color ("border-color", - P_("Border Color"), - P_("The color of the border of the rectangle"), - &default_border_color, - CLUTTER_PARAM_READWRITE); - g_object_class_install_property (gobject_class, PROP_BORDER_COLOR, pspec); - - /** - * ClutterRectangle:border-width: - * - * The width of the border of the rectangle, in pixels. - * - * - */ - g_object_class_install_property (gobject_class, - PROP_BORDER_WIDTH, - g_param_spec_uint ("border-width", - P_("Border Width"), - P_("The width of the border of the rectangle"), - 0, G_MAXUINT, - 0, - CLUTTER_PARAM_READWRITE)); - /** - * ClutterRectangle:has-border: - * - * Whether the #ClutterRectangle should be displayed with a border. - * - * - */ - g_object_class_install_property (gobject_class, - PROP_HAS_BORDER, - g_param_spec_boolean ("has-border", - P_("Has Border"), - P_("Whether the rectangle should have a border"), - FALSE, - CLUTTER_PARAM_READWRITE)); - - g_type_class_add_private (gobject_class, sizeof (ClutterRectanglePrivate)); -} - -static void -clutter_rectangle_init (ClutterRectangle *self) -{ - ClutterRectanglePrivate *priv; - - self->priv = priv = CLUTTER_RECTANGLE_GET_PRIVATE (self); - - priv->color = default_color; - priv->border_color = default_border_color; - - priv->border_width = 0; - - priv->has_border = FALSE; -} - -/** - * clutter_rectangle_new: - * - * Creates a new #ClutterActor with a rectangular shape. - * - * Return value: a new #ClutterActor - */ -ClutterActor* -clutter_rectangle_new (void) -{ - return g_object_new (CLUTTER_TYPE_RECTANGLE, NULL); -} - -/** - * clutter_rectangle_new_with_color: - * @color: a #ClutterColor - * - * Creates a new #ClutterActor with a rectangular shape - * and of the given @color. - * - * Return value: a new #ClutterActor - */ -ClutterActor * -clutter_rectangle_new_with_color (const ClutterColor *color) -{ - return g_object_new (CLUTTER_TYPE_RECTANGLE, - "color", color, - NULL); -} - -/** - * clutter_rectangle_get_color: - * @rectangle: a #ClutterRectangle - * @color: (out caller-allocates): return location for a #ClutterColor - * - * Retrieves the color of @rectangle. - */ -void -clutter_rectangle_get_color (ClutterRectangle *rectangle, - ClutterColor *color) -{ - ClutterRectanglePrivate *priv; - - g_return_if_fail (CLUTTER_IS_RECTANGLE (rectangle)); - g_return_if_fail (color != NULL); - - priv = rectangle->priv; - - color->red = priv->color.red; - color->green = priv->color.green; - color->blue = priv->color.blue; - color->alpha = priv->color.alpha; -} - -/** - * clutter_rectangle_set_color: - * @rectangle: a #ClutterRectangle - * @color: a #ClutterColor - * - * Sets the color of @rectangle. - */ -void -clutter_rectangle_set_color (ClutterRectangle *rectangle, - const ClutterColor *color) -{ - ClutterRectanglePrivate *priv; - - g_return_if_fail (CLUTTER_IS_RECTANGLE (rectangle)); - g_return_if_fail (color != NULL); - - g_object_ref (rectangle); - - priv = rectangle->priv; - - priv->color.red = color->red; - priv->color.green = color->green; - priv->color.blue = color->blue; - priv->color.alpha = color->alpha; - -#if 0 - /* FIXME - appears to be causing border to always get drawn */ - if (clutter_color_equal (&priv->color, &priv->border_color)) - priv->has_border = FALSE; - else - priv->has_border = TRUE; -#endif - - clutter_actor_queue_redraw (CLUTTER_ACTOR (rectangle)); - - g_object_notify (G_OBJECT (rectangle), "color"); - g_object_notify (G_OBJECT (rectangle), "has-border"); - g_object_unref (rectangle); -} - -/** - * clutter_rectangle_get_border_width: - * @rectangle: a #ClutterRectangle - * - * Gets the width (in pixels) of the border used by @rectangle - * - * Return value: the border's width - * - * - */ -guint -clutter_rectangle_get_border_width (ClutterRectangle *rectangle) -{ - g_return_val_if_fail (CLUTTER_IS_RECTANGLE (rectangle), 0); - - return rectangle->priv->border_width; -} - -/** - * clutter_rectangle_set_border_width: - * @rectangle: a #ClutterRectangle - * @width: the width of the border - * - * Sets the width (in pixel) of the border used by @rectangle. - * A @width of 0 will unset the border. - * - * - */ -void -clutter_rectangle_set_border_width (ClutterRectangle *rectangle, - guint width) -{ - ClutterRectanglePrivate *priv; - - g_return_if_fail (CLUTTER_IS_RECTANGLE (rectangle)); - priv = rectangle->priv; - - if (priv->border_width != width) - { - g_object_ref (rectangle); - - priv->border_width = width; - - if (priv->border_width != 0) - priv->has_border = TRUE; - else - priv->has_border = FALSE; - - clutter_actor_queue_redraw (CLUTTER_ACTOR (rectangle)); - - g_object_notify (G_OBJECT (rectangle), "border-width"); - g_object_notify (G_OBJECT (rectangle), "has-border"); - g_object_unref (rectangle); - } -} - -/** - * clutter_rectangle_get_border_color: - * @rectangle: a #ClutterRectangle - * @color: (out caller-allocates): return location for a #ClutterColor - * - * Gets the color of the border used by @rectangle and places - * it into @color. - * - * - */ -void -clutter_rectangle_get_border_color (ClutterRectangle *rectangle, - ClutterColor *color) -{ - ClutterRectanglePrivate *priv; - - g_return_if_fail (CLUTTER_IS_RECTANGLE (rectangle)); - g_return_if_fail (color != NULL); - - priv = rectangle->priv; - - color->red = priv->border_color.red; - color->green = priv->border_color.green; - color->blue = priv->border_color.blue; - color->alpha = priv->border_color.alpha; -} - -/** - * clutter_rectangle_set_border_color: - * @rectangle: a #ClutterRectangle - * @color: the color of the border - * - * Sets the color of the border used by @rectangle using @color - */ -void -clutter_rectangle_set_border_color (ClutterRectangle *rectangle, - const ClutterColor *color) -{ - ClutterRectanglePrivate *priv; - - g_return_if_fail (CLUTTER_IS_RECTANGLE (rectangle)); - g_return_if_fail (color != NULL); - - priv = rectangle->priv; - - if (priv->border_color.red != color->red || - priv->border_color.green != color->green || - priv->border_color.blue != color->blue || - priv->border_color.alpha != color->alpha) - { - g_object_ref (rectangle); - - priv->border_color.red = color->red; - priv->border_color.green = color->green; - priv->border_color.blue = color->blue; - priv->border_color.alpha = color->alpha; - - if (clutter_color_equal (&priv->color, &priv->border_color)) - priv->has_border = FALSE; - else - priv->has_border = TRUE; - - clutter_actor_queue_redraw (CLUTTER_ACTOR (rectangle)); - - g_object_notify (G_OBJECT (rectangle), "border-color"); - g_object_notify (G_OBJECT (rectangle), "has-border"); - g_object_unref (rectangle); - } -} diff --git a/clutter/deprecated/clutter-rectangle.h b/clutter/deprecated/clutter-rectangle.h deleted file mode 100644 index 9e603eed8..000000000 --- a/clutter/deprecated/clutter-rectangle.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * Copyright (C) 2006 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_RECTANGLE_H__ -#define __CLUTTER_RECTANGLE_H__ - -#include -#include -#include - -G_BEGIN_DECLS - -#define CLUTTER_TYPE_RECTANGLE (clutter_rectangle_get_type()) -#define CLUTTER_RECTANGLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_RECTANGLE, ClutterRectangle)) -#define CLUTTER_RECTANGLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_RECTANGLE, ClutterRectangleClass)) -#define CLUTTER_IS_RECTANGLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_RECTANGLE)) -#define CLUTTER_IS_RECTANGLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_RECTANGLE)) -#define CLUTTER_RECTANGLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_RECTANGLE, ClutterRectangleClass)) - -typedef struct _ClutterRectangle ClutterRectangle; -typedef struct _ClutterRectangleClass ClutterRectangleClass; -typedef struct _ClutterRectanglePrivate ClutterRectanglePrivate; - -/** - * ClutterRectangle: - * - * The #ClutterRectangle structure contains only private data - * and should be accessed using the provided API - * - * - */ -struct _ClutterRectangle -{ - /*< private >*/ - ClutterActor parent; - - ClutterRectanglePrivate *priv; -}; - -/** - * ClutterRectangleClass: - * - * The #ClutterRectangleClass structure contains only private data - * - * - */ -struct _ClutterRectangleClass -{ - /*< private >*/ - ClutterActorClass parent_class; - - /* padding for future expansion */ - void (*_clutter_rectangle1) (void); - void (*_clutter_rectangle2) (void); - void (*_clutter_rectangle3) (void); - void (*_clutter_rectangle4) (void); -}; - -CLUTTER_DEPRECATED_IN_1_10 -GType clutter_rectangle_get_type (void) G_GNUC_CONST; - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_new) -ClutterActor *clutter_rectangle_new (void); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_new) -ClutterActor *clutter_rectangle_new_with_color (const ClutterColor *color); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_get_background_color) -void clutter_rectangle_get_color (ClutterRectangle *rectangle, - ClutterColor *color); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_set_background_color) -void clutter_rectangle_set_color (ClutterRectangle *rectangle, - const ClutterColor *color); - -CLUTTER_DEPRECATED_IN_1_10 -guint clutter_rectangle_get_border_width (ClutterRectangle *rectangle); - -CLUTTER_DEPRECATED_IN_1_10 -void clutter_rectangle_set_border_width (ClutterRectangle *rectangle, - guint width); - -CLUTTER_DEPRECATED_IN_1_10 -void clutter_rectangle_get_border_color (ClutterRectangle *rectangle, - ClutterColor *color); - -CLUTTER_DEPRECATED_IN_1_10 -void clutter_rectangle_set_border_color (ClutterRectangle *rectangle, - const ClutterColor *color); - -G_END_DECLS - -#endif /* __CLUTTER_RECTANGLE_H__ */ diff --git a/clutter/deprecated/clutter-score.c b/clutter/deprecated/clutter-score.c deleted file mode 100644 index be794c1a1..000000000 --- a/clutter/deprecated/clutter-score.c +++ /dev/null @@ -1,1168 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * Copyright (C) 2007 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - * - */ - -/** - * SECTION:clutter-score - * @short_description: Controller for multiple timelines - * - * #ClutterScore is a base class for sequencing multiple timelines in order. - * Using #ClutterScore it is possible to start multiple timelines at the - * same time or launch multiple timelines when a particular timeline has - * emitted the ClutterTimeline::completed signal. - * - * Each time a #ClutterTimeline is started and completed, a signal will be - * emitted. - * - * For example, this code will start two #ClutterTimelines after - * a third timeline terminates: - * - * |[ - * ClutterTimeline *timeline_1, *timeline_2, *timeline_3; - * ClutterScore *score; - * - * timeline_1 = clutter_timeline_new_for_duration (1000); - * timeline_2 = clutter_timeline_new_for_duration (500); - * timeline_3 = clutter_timeline_new_for_duration (500); - * - * score = clutter_score_new (); - * - * clutter_score_append (score, NULL, timeline_1); - * clutter_score_append (score, timeline_1, timeline_2); - * clutter_score_append (score, timeline_1, timeline_3); - * - * clutter_score_start (score); - * ]| - * - * A #ClutterScore takes a reference on the timelines it manages, - * so timelines can be safely unreferenced after being appended. - * - * New timelines can be appended to the #ClutterScore using - * clutter_score_append() and removed using clutter_score_remove(). - * - * Timelines can also be appended to a specific marker on the - * parent timeline, using clutter_score_append_at_marker(). - * - * The score can be cleared using clutter_score_remove_all(). - * - * The list of timelines can be retrieved using - * clutter_score_list_timelines(). - * - * The score state is controlled using clutter_score_start(), - * clutter_score_pause(), clutter_score_stop() and clutter_score_rewind(). - * The state can be queried using clutter_score_is_playing(). - * - * #ClutterScore is available since Clutter 0.6 - * - * Deprecated: 1.8: Use #ClutterAnimator or #ClutterState to create - * complex animations involving multiple timelines. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#define CLUTTER_DISABLE_DEPRECATION_WARNINGS - -#include "clutter-score.h" -#include "clutter-main.h" -#include "clutter-marshal.h" -#include "clutter-private.h" -#include "clutter-debug.h" - -typedef struct _ClutterScoreEntry ClutterScoreEntry; - -struct _ClutterScoreEntry -{ - /* the entry unique id */ - gulong id; - - ClutterTimeline *timeline; - ClutterTimeline *parent; - - /* the optional marker on the parent */ - gchar *marker; - - /* signal handlers id */ - gulong complete_id; - gulong marker_id; - - ClutterScore *score; - - /* pointer back to the tree structure */ - GNode *node; -}; - -#define CLUTTER_SCORE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_SCORE, ClutterScorePrivate)) - -struct _ClutterScorePrivate -{ - GNode *root; - - GHashTable *running_timelines; - - gulong last_id; - - guint is_paused : 1; - guint loop : 1; -}; - -enum -{ - PROP_0, - - PROP_LOOP -}; - -enum -{ - TIMELINE_STARTED, - TIMELINE_COMPLETED, - - STARTED, - PAUSED, - COMPLETED, - - LAST_SIGNAL -}; - -static inline void clutter_score_clear (ClutterScore *score); - -G_DEFINE_TYPE (ClutterScore, clutter_score, G_TYPE_OBJECT); - -static int score_signals[LAST_SIGNAL] = { 0 }; - -/* Object */ - -static void -clutter_score_set_property (GObject *gobject, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - ClutterScorePrivate *priv = CLUTTER_SCORE_GET_PRIVATE (gobject); - - switch (prop_id) - { - case PROP_LOOP: - priv->loop = g_value_get_boolean (value); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); - break; - } -} - -static void -clutter_score_get_property (GObject *gobject, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - ClutterScorePrivate *priv = CLUTTER_SCORE_GET_PRIVATE (gobject); - - switch (prop_id) - { - case PROP_LOOP: - g_value_set_boolean (value, priv->loop); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); - break; - } -} - -static void -clutter_score_finalize (GObject *object) -{ - ClutterScore *score = CLUTTER_SCORE (object); - - clutter_score_stop (score); - clutter_score_clear (score); - - G_OBJECT_CLASS (clutter_score_parent_class)->finalize (object); -} - -static void -clutter_score_class_init (ClutterScoreClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - - gobject_class->set_property = clutter_score_set_property; - gobject_class->get_property = clutter_score_get_property; - gobject_class->finalize = clutter_score_finalize; - - g_type_class_add_private (klass, sizeof (ClutterScorePrivate)); - - /** - * ClutterScore:loop: - * - * Whether the #ClutterScore should restart once finished. - * - * - * Deprecated: 1.8 - */ - g_object_class_install_property (gobject_class, - PROP_LOOP, - g_param_spec_boolean ("loop", - "Loop", - "Whether the score should restart once finished", - FALSE, - CLUTTER_PARAM_READWRITE)); - - /** - * ClutterScore::timeline-started: - * @score: the score which received the signal - * @timeline: the current timeline - * - * The ::timeline-started signal is emitted each time a new timeline - * inside a #ClutterScore starts playing. - * - * - * Deprecated: 1.8 - */ - score_signals[TIMELINE_STARTED] = - g_signal_new ("timeline-started", - G_TYPE_FROM_CLASS (gobject_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ClutterScoreClass, timeline_started), - NULL, NULL, - _clutter_marshal_VOID__OBJECT, - G_TYPE_NONE, - 1, CLUTTER_TYPE_TIMELINE); - /** - * ClutterScore::timeline-completed: - * @score: the score which received the signal - * @timeline: the completed timeline - * - * The ::timeline-completed signal is emitted each time a timeline - * inside a #ClutterScore terminates. - * - * - * Deprecated: 1.8 - */ - score_signals[TIMELINE_COMPLETED] = - g_signal_new ("timeline-completed", - G_TYPE_FROM_CLASS (gobject_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ClutterScoreClass, timeline_completed), - NULL, NULL, - _clutter_marshal_VOID__OBJECT, - G_TYPE_NONE, 1, - CLUTTER_TYPE_TIMELINE); - /** - * ClutterScore::completed: - * @score: the score which received the signal - * - * The ::completed signal is emitted each time a #ClutterScore terminates. - * - * - * Deprecated: 1.8 - */ - score_signals[COMPLETED] = - g_signal_new ("completed", - G_TYPE_FROM_CLASS (gobject_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ClutterScoreClass, completed), - NULL, NULL, - _clutter_marshal_VOID__VOID, - G_TYPE_NONE, 0); - /** - * ClutterScore::started: - * @score: the score which received the signal - * - * The ::started signal is emitted each time a #ClutterScore starts playing. - * - * - * Deprecated: 1.8 - */ - score_signals[STARTED] = - g_signal_new ("started", - G_TYPE_FROM_CLASS (gobject_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ClutterScoreClass, started), - NULL, NULL, - _clutter_marshal_VOID__VOID, - G_TYPE_NONE, 0); - /** - * ClutterScore::paused: - * @score: the score which received the signal - * - * The ::paused signal is emitted each time a #ClutterScore - * is paused. - * - * - * Deprecated: 1.8 - */ - score_signals[PAUSED] = - g_signal_new ("paused", - G_TYPE_FROM_CLASS (gobject_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ClutterScoreClass, paused), - NULL, NULL, - _clutter_marshal_VOID__VOID, - G_TYPE_NONE, 0); -} - -static void -clutter_score_init (ClutterScore *self) -{ - ClutterScorePrivate *priv; - - self->priv = priv = CLUTTER_SCORE_GET_PRIVATE (self); - - /* sentinel */ - priv->root = g_node_new (NULL); - - priv->running_timelines = NULL; - - priv->is_paused = FALSE; - priv->loop = FALSE; - - priv->last_id = 1; -} - -/** - * clutter_score_new: - * - * Creates a new #ClutterScore. A #ClutterScore is an object that can - * hold multiple #ClutterTimelines in a sequential order. - * - * Return value: the newly created #ClutterScore. Use g_object_unref() - * when done. - * - * - * Deprecated: 1.8 - */ -ClutterScore * -clutter_score_new (void) -{ - return g_object_new (CLUTTER_TYPE_SCORE, NULL); -} - -/** - * clutter_score_set_loop: - * @score: a #ClutterScore - * @loop: %TRUE for enable looping - * - * Sets whether @score should loop. A looping #ClutterScore will start - * from its initial state after the ::complete signal has been fired. - * - * - * Deprecated: 1.8 - */ -void -clutter_score_set_loop (ClutterScore *score, - gboolean loop) -{ - g_return_if_fail (CLUTTER_IS_SCORE (score)); - - if (score->priv->loop != loop) - { - score->priv->loop = loop; - - g_object_notify (G_OBJECT (score), "loop"); - } -} - -/** - * clutter_score_get_loop: - * @score: a #ClutterScore - * - * Gets whether @score is looping - * - * Return value: %TRUE if the score is looping - * - * - * Deprecated: 1.8 - */ -gboolean -clutter_score_get_loop (ClutterScore *score) -{ - g_return_val_if_fail (CLUTTER_IS_SCORE (score), FALSE); - - return score->priv->loop; -} - -/** - * clutter_score_is_playing: - * @score: A #ClutterScore - * - * Query state of a #ClutterScore instance. - * - * Return Value: %TRUE if score is currently playing - * - * - * Deprecated: 1.8 - */ -gboolean -clutter_score_is_playing (ClutterScore *score) -{ - g_return_val_if_fail (CLUTTER_IS_SCORE (score), FALSE); - - if (score->priv->is_paused) - return FALSE; - - return score->priv->running_timelines - && g_hash_table_size (score->priv->running_timelines) != 0; -} - -/* destroy_entry: - * @node: a #GNode - * - * Frees the #ClutterScoreEntry attached to @node. - */ -static gboolean -destroy_entry (GNode *node, - G_GNUC_UNUSED gpointer data) -{ - ClutterScoreEntry *entry = node->data; - - if (G_LIKELY (entry != NULL)) - { - if (entry->marker_id) - { - g_signal_handler_disconnect (entry->parent, entry->marker_id); - entry->marker_id = 0; - } - - if (entry->complete_id) - { - g_signal_handler_disconnect (entry->timeline, entry->complete_id); - entry->complete_id = 0; - } - - g_object_unref (entry->timeline); - g_free (entry->marker); - g_slice_free (ClutterScoreEntry, entry); - - node->data = NULL; - } - - /* continue */ - return FALSE; -} - -typedef enum { - FIND_BY_TIMELINE, - FIND_BY_ID, - REMOVE_BY_ID, - LIST_TIMELINES -} TraverseAction; - -typedef struct { - TraverseAction action; - - ClutterScore *score; - - /* parameters */ - union { - ClutterTimeline *timeline; - gulong id; - ClutterScoreEntry *entry; - } d; - - gpointer result; -} TraverseClosure; - -/* multi-purpose traversal function for the N-ary tree used by the score */ -static gboolean -traverse_children (GNode *node, - gpointer data) -{ - TraverseClosure *closure = data; - ClutterScoreEntry *entry = node->data; - gboolean retval = FALSE; - - /* root */ - if (!entry) - return TRUE; - - switch (closure->action) - { - case FIND_BY_TIMELINE: - if (closure->d.timeline == entry->timeline) - { - closure->result = node; - retval = TRUE; - } - break; - - case FIND_BY_ID: - if (closure->d.id == entry->id) - { - closure->result = node; - retval = TRUE; - } - break; - - case REMOVE_BY_ID: - if (closure->d.id == entry->id) - { - /* Destroy all the child entries of this node */ - g_node_traverse (node, - G_POST_ORDER, - G_TRAVERSE_ALL, - -1, - destroy_entry, NULL); - - /* Keep track of this node so that it will be destroyed - further up */ - closure->result = node; - - retval = TRUE; - } - break; - - case LIST_TIMELINES: - closure->result = g_slist_prepend (closure->result, entry->timeline); - retval = FALSE; - break; - } - - return retval; -} - -static GNode * -find_entry_by_timeline (ClutterScore *score, - ClutterTimeline *timeline) -{ - ClutterScorePrivate *priv = score->priv; - TraverseClosure closure; - - closure.action = FIND_BY_TIMELINE; - closure.score = score; - closure.d.timeline = timeline; - closure.result = NULL; - - g_node_traverse (priv->root, - G_POST_ORDER, - G_TRAVERSE_ALL, - -1, - traverse_children, &closure); - - if (closure.result) - return closure.result; - - return NULL; -} - -static GNode * -find_entry_by_id (ClutterScore *score, - gulong id_) -{ - ClutterScorePrivate *priv = score->priv; - TraverseClosure closure; - - closure.action = FIND_BY_ID; - closure.score = score; - closure.d.id = id_; - closure.result = NULL; - - g_node_traverse (priv->root, - G_POST_ORDER, - G_TRAVERSE_ALL, - -1, - traverse_children, &closure); - - if (closure.result) - return closure.result; - - return NULL; -} - -/* forward declaration */ -static void start_entry (ClutterScoreEntry *entry); - -static void -start_children_entries (GNode *node, - gpointer data) -{ - ClutterScoreEntry *entry = node->data; - - /* If data is NULL, start all entries that have no marker, otherwise - only start entries that have the same marker */ - if (data == NULL - ? entry->marker == NULL - : (entry->marker && !strcmp (data, entry->marker))) - start_entry (entry); -} - -static void -on_timeline_marker (ClutterTimeline *timeline, - const gchar *marker_name, - gint frame_num, - ClutterScoreEntry *entry) -{ - GNode *parent; - CLUTTER_NOTE (SCHEDULER, "timeline [%p] marker ('%s') reached", - entry->timeline, - entry->marker); - - parent = find_entry_by_timeline (entry->score, timeline); - if (!parent) - return; - - /* start every child */ - if (parent->children) - { - g_node_children_foreach (parent, - G_TRAVERSE_ALL, - start_children_entries, - (gpointer) marker_name); - } -} - -static void -on_timeline_completed (ClutterTimeline *timeline, - ClutterScoreEntry *entry) -{ - ClutterScorePrivate *priv = entry->score->priv; - - g_hash_table_remove (priv->running_timelines, - GUINT_TO_POINTER (entry->id)); - - g_signal_handler_disconnect (timeline, entry->complete_id); - entry->complete_id = 0; - - CLUTTER_NOTE (SCHEDULER, "timeline [%p] ('%lu') completed", - entry->timeline, - entry->id); - - g_signal_emit (entry->score, score_signals[TIMELINE_COMPLETED], 0, - entry->timeline); - - /* start every child */ - if (entry->node->children) - { - g_node_children_foreach (entry->node, - G_TRAVERSE_ALL, - start_children_entries, - NULL); - } - - /* score has finished - fire 'completed' signal */ - if (g_hash_table_size (priv->running_timelines) == 0) - { - CLUTTER_NOTE (SCHEDULER, "looks like we finished"); - - g_signal_emit (entry->score, score_signals[COMPLETED], 0); - - clutter_score_stop (entry->score); - - if (priv->loop) - clutter_score_start (entry->score); - } -} - -static void -start_entry (ClutterScoreEntry *entry) -{ - ClutterScorePrivate *priv = entry->score->priv; - - /* timelines attached to a marker might already be playing when we - * end up here from the ::completed handler, so we need to perform - * this check to avoid restarting those timelines - */ - if (clutter_timeline_is_playing (entry->timeline)) - return; - - entry->complete_id = g_signal_connect (entry->timeline, - "completed", - G_CALLBACK (on_timeline_completed), - entry); - - CLUTTER_NOTE (SCHEDULER, "timeline [%p] ('%lu') started", - entry->timeline, - entry->id); - - if (G_UNLIKELY (priv->running_timelines == NULL)) - priv->running_timelines = g_hash_table_new (NULL, NULL); - - g_hash_table_insert (priv->running_timelines, - GUINT_TO_POINTER (entry->id), - entry); - - clutter_timeline_start (entry->timeline); - - g_signal_emit (entry->score, score_signals[TIMELINE_STARTED], 0, - entry->timeline); -} - -enum -{ - ACTION_START, - ACTION_PAUSE, - ACTION_STOP -}; - -static void -foreach_running_timeline (gpointer key, - gpointer value, - gpointer user_data) -{ - ClutterScoreEntry *entry = value; - gint action = GPOINTER_TO_INT (user_data); - - switch (action) - { - case ACTION_START: - clutter_timeline_start (entry->timeline); - break; - - case ACTION_PAUSE: - clutter_timeline_pause (entry->timeline); - break; - - case ACTION_STOP: - if (entry->complete_id) - { - g_signal_handler_disconnect (entry->timeline, entry->complete_id); - entry->complete_id = 0; - } - clutter_timeline_stop (entry->timeline); - break; - } -} - -/** - * clutter_score_start: - * @score: A #ClutterScore - * - * Starts the score. - * - * - * Deprecated: 1.8 - */ -void -clutter_score_start (ClutterScore *score) -{ - ClutterScorePrivate *priv; - - g_return_if_fail (CLUTTER_IS_SCORE (score)); - - priv = score->priv; - - if (priv->is_paused) - { - g_hash_table_foreach (priv->running_timelines, - foreach_running_timeline, - GINT_TO_POINTER (ACTION_START)); - priv->is_paused = FALSE; - } - else - { - g_signal_emit (score, score_signals[STARTED], 0); - g_node_children_foreach (priv->root, - G_TRAVERSE_ALL, - start_children_entries, - NULL); - } -} - -/** - * clutter_score_stop: - * @score: A #ClutterScore - * - * Stops and rewinds a playing #ClutterScore instance. - * - * - * Deprecated: 1.8 - */ -void -clutter_score_stop (ClutterScore *score) -{ - ClutterScorePrivate *priv; - - g_return_if_fail (CLUTTER_IS_SCORE (score)); - - priv = score->priv; - - if (priv->running_timelines) - { - g_hash_table_foreach (priv->running_timelines, - foreach_running_timeline, - GINT_TO_POINTER (ACTION_STOP)); - g_hash_table_destroy (priv->running_timelines); - priv->running_timelines = NULL; - } -} - -/** - * clutter_score_pause: - * @score: a #ClutterScore - * - * Pauses a playing score @score. - * - * - * Deprecated: 1.8 - */ -void -clutter_score_pause (ClutterScore *score) -{ - ClutterScorePrivate *priv; - - g_return_if_fail (CLUTTER_IS_SCORE (score)); - - priv = score->priv; - - if (!clutter_score_is_playing (score)) - return; - - g_hash_table_foreach (priv->running_timelines, - foreach_running_timeline, - GINT_TO_POINTER (ACTION_PAUSE)); - - priv->is_paused = TRUE; - - g_signal_emit (score, score_signals[PAUSED], 0); -} - -/** - * clutter_score_rewind: - * @score: A #ClutterScore - * - * Rewinds a #ClutterScore to its initial state. - * - * - * Deprecated: 1.8 - */ -void -clutter_score_rewind (ClutterScore *score) -{ - gboolean was_playing; - - g_return_if_fail (CLUTTER_IS_SCORE (score)); - - was_playing = clutter_score_is_playing (score); - - clutter_score_stop (score); - - if (was_playing) - clutter_score_start (score); -} - -static inline void -clutter_score_clear (ClutterScore *score) -{ - ClutterScorePrivate *priv = score->priv; - - g_node_traverse (priv->root, - G_POST_ORDER, - G_TRAVERSE_ALL, - -1, - destroy_entry, NULL); - g_node_destroy (priv->root); -} - -/** - * clutter_score_append: - * @score: a #ClutterScore - * @parent: (allow-none): a #ClutterTimeline in the score, or %NULL - * @timeline: a #ClutterTimeline - * - * Appends a timeline to another one existing in the score; the newly - * appended timeline will be started when @parent is complete. - * - * If @parent is %NULL, the new #ClutterTimeline will be started when - * clutter_score_start() is called. - * - * #ClutterScore will take a reference on @timeline. - * - * Return value: the id of the #ClutterTimeline inside the score, or - * 0 on failure. The returned id can be used with clutter_score_remove() - * or clutter_score_get_timeline(). - * - * - * Deprecated: 1.8 - */ -gulong -clutter_score_append (ClutterScore *score, - ClutterTimeline *parent, - ClutterTimeline *timeline) -{ - ClutterScorePrivate *priv; - ClutterScoreEntry *entry; - - g_return_val_if_fail (CLUTTER_IS_SCORE (score), 0); - g_return_val_if_fail (parent == NULL || CLUTTER_IS_TIMELINE (parent), 0); - g_return_val_if_fail (CLUTTER_IS_TIMELINE (timeline), 0); - - priv = score->priv; - - if (!parent) - { - entry = g_slice_new (ClutterScoreEntry); - entry->timeline = g_object_ref (timeline); - entry->parent = NULL; - entry->id = priv->last_id; - entry->marker = NULL; - entry->marker_id = 0; - entry->complete_id = 0; - entry->score = score; - - entry->node = g_node_append_data (priv->root, entry); - } - else - { - GNode *node; - - node = find_entry_by_timeline (score, parent); - if (G_UNLIKELY (!node)) - { - g_warning ("Unable to find the parent timeline inside the score."); - return 0; - } - - entry = g_slice_new (ClutterScoreEntry); - entry->timeline = g_object_ref (timeline); - entry->parent = parent; - entry->id = priv->last_id; - entry->marker = NULL; - entry->marker_id = 0; - entry->complete_id = 0; - entry->score = score; - - entry->node = g_node_append_data (node, entry); - } - - priv->last_id += 1; - - return entry->id; -} - -/** - * clutter_score_append_at_marker: - * @score: a #ClutterScore - * @parent: the parent #ClutterTimeline - * @marker_name: the name of the marker to use - * @timeline: the #ClutterTimeline to append - * - * Appends @timeline at the given @marker_name on the @parent - * #ClutterTimeline. - * - * If you want to append @timeline at the end of @parent, use - * clutter_score_append(). - * - * The #ClutterScore will take a reference on @timeline. - * - * Return value: the id of the #ClutterTimeline inside the score, or - * 0 on failure. The returned id can be used with clutter_score_remove() - * or clutter_score_get_timeline(). - * - * - * Deprecated: 1.8 - */ -gulong -clutter_score_append_at_marker (ClutterScore *score, - ClutterTimeline *parent, - const gchar *marker_name, - ClutterTimeline *timeline) -{ - ClutterScorePrivate *priv; - GNode *node; - ClutterScoreEntry *entry; - gchar *marker_reached_signal; - - g_return_val_if_fail (CLUTTER_IS_SCORE (score), 0); - g_return_val_if_fail (CLUTTER_IS_TIMELINE (parent), 0); - g_return_val_if_fail (marker_name != NULL, 0); - g_return_val_if_fail (CLUTTER_IS_TIMELINE (timeline), 0); - - if (!clutter_timeline_has_marker (parent, marker_name)) - { - g_warning ("The parent timeline has no marker '%s'", marker_name); - return 0; - } - - priv = score->priv; - - node = find_entry_by_timeline (score, parent); - if (G_UNLIKELY (!node)) - { - g_warning ("Unable to find the parent timeline inside the score."); - return 0; - } - - entry = g_slice_new (ClutterScoreEntry); - entry->timeline = g_object_ref (timeline); - entry->parent = parent; - entry->marker = g_strdup (marker_name); - entry->id = priv->last_id; - entry->score = score; - entry->complete_id = 0; - - marker_reached_signal = g_strdup_printf ("marker-reached::%s", marker_name); - entry->marker_id = g_signal_connect (entry->parent, - marker_reached_signal, - G_CALLBACK (on_timeline_marker), - entry); - - entry->node = g_node_append_data (node, entry); - - g_free (marker_reached_signal); - - priv->last_id += 1; - - return entry->id; -} - -/** - * clutter_score_remove: - * @score: a #ClutterScore - * @id_: the id of the timeline to remove - * - * Removes the #ClutterTimeline with the given id inside @score. If - * the timeline has other timelines attached to it, those are removed - * as well. - * - * - * Deprecated: 1.8 - */ -void -clutter_score_remove (ClutterScore *score, - gulong id_) -{ - ClutterScorePrivate *priv; - TraverseClosure closure; - - g_return_if_fail (CLUTTER_IS_SCORE (score)); - g_return_if_fail (id_ > 0); - - priv = score->priv; - - closure.action = REMOVE_BY_ID; - closure.score = score; - closure.d.id = id_; - closure.result = NULL; - - g_node_traverse (priv->root, - G_POST_ORDER, - G_TRAVERSE_ALL, - -1, - traverse_children, &closure); - - if (closure.result) - g_node_destroy (closure.result); -} - -/** - * clutter_score_remove_all: - * @score: a #ClutterScore - * - * Removes all the timelines inside @score. - * - * - * Deprecated: 1.8 - */ -void -clutter_score_remove_all (ClutterScore *score) -{ - ClutterScorePrivate *priv; - - g_return_if_fail (CLUTTER_IS_SCORE (score)); - - priv = score->priv; - - /* this will take care of the running timelines */ - clutter_score_stop (score); - - /* destroy all the contents of the tree */ - clutter_score_clear (score); - - /* recreate the sentinel */ - priv->root = g_node_new (NULL); -} - -/** - * clutter_score_get_timeline: - * @score: a #ClutterScore - * @id_: the id of the timeline - * - * Retrieves the #ClutterTimeline for @id_ inside @score. - * - * Return value: (transfer none): the requested timeline, or %NULL. This - * function does not increase the reference count on the returned - * #ClutterTimeline - * - * - * Deprecated: 1.8 - */ -ClutterTimeline * -clutter_score_get_timeline (ClutterScore *score, - gulong id_) -{ - GNode *node; - ClutterScoreEntry *entry; - - g_return_val_if_fail (CLUTTER_IS_SCORE (score), NULL); - g_return_val_if_fail (id_ > 0, NULL); - - node = find_entry_by_id (score, id_); - if (G_UNLIKELY (!node)) - return NULL; - - entry = node->data; - - return entry->timeline; -} - -/** - * clutter_score_list_timelines: - * @score: a #ClutterScore - * - * Retrieves a list of all the #ClutterTimelines managed by @score. - * - * Return value: (transfer container) (element-type Clutter.Timeline): a - * #GSList containing all the timelines in the score. This function does - * not increase the reference count of the returned timelines. Use - * g_slist_free() on the returned list to deallocate its resources. - * - * - * Deprecated: 1.8 - */ -GSList * -clutter_score_list_timelines (ClutterScore *score) -{ - ClutterScorePrivate *priv; - TraverseClosure closure; - GSList *retval; - - g_return_val_if_fail (CLUTTER_IS_SCORE (score), NULL); - - priv = score->priv; - - closure.action = LIST_TIMELINES; - closure.result = NULL; - - g_node_traverse (priv->root, - G_POST_ORDER, - G_TRAVERSE_ALL, - -1, - traverse_children, &closure); - - retval = closure.result; - - return retval; -} diff --git a/clutter/deprecated/clutter-score.h b/clutter/deprecated/clutter-score.h deleted file mode 100644 index 2b4ec8b3a..000000000 --- a/clutter/deprecated/clutter-score.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * Copyright (C) 2006 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_SCORE_H__ -#define __CLUTTER_SCORE_H__ - -#include - -G_BEGIN_DECLS - -#define CLUTTER_TYPE_SCORE (clutter_score_get_type ()) - -#define CLUTTER_SCORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_SCORE, ClutterScore)) -#define CLUTTER_SCORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_SCORE, ClutterScoreClass)) -#define CLUTTER_IS_SCORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_SCORE)) -#define CLUTTER_IS_SCORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_SCORE)) -#define CLUTTER_SCORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_SCORE, ClutterScoreClass)) - -typedef struct _ClutterScore ClutterScore; -typedef struct _ClutterScorePrivate ClutterScorePrivate; -typedef struct _ClutterScoreClass ClutterScoreClass; - -/** - * ClutterScore: - * - * The #ClutterScore structure contains only private data - * and should be accessed using the provided API - * - * - */ -struct _ClutterScore -{ - /*< private >*/ - GObject parent; - ClutterScorePrivate *priv; -}; - -/** - * ClutterScoreClass: - * @timeline_started: handler for the #ClutterScore::timeline-started signal - * @timeline_completed: handler for the #ClutterScore::timeline-completed - * signal - * @started: handler for the #ClutterScore::started signal - * @completed: handler for the #ClutterScore::completed signal - * @paused: handler for the #ClutterScore::paused signal - * - * The #ClutterScoreClass structure contains only private data - * - * - */ -struct _ClutterScoreClass -{ - /*< private >*/ - GObjectClass parent_class; - - /*< public >*/ - void (* timeline_started) (ClutterScore *score, - ClutterTimeline *timeline); - void (* timeline_completed) (ClutterScore *score, - ClutterTimeline *timeline); - - void (* started) (ClutterScore *score); - void (* completed) (ClutterScore *score); - void (* paused) (ClutterScore *score); - - /*< private >*/ - /* padding for future expansion */ - void (*_clutter_score_1) (void); - void (*_clutter_score_2) (void); - void (*_clutter_score_3) (void); - void (*_clutter_score_4) (void); - void (*_clutter_score_5) (void); -}; - -CLUTTER_DEPRECATED_IN_1_8 -GType clutter_score_get_type (void) G_GNUC_CONST; - -CLUTTER_DEPRECATED_IN_1_8 -ClutterScore * clutter_score_new (void); - -CLUTTER_DEPRECATED_IN_1_8 -void clutter_score_set_loop (ClutterScore *score, - gboolean loop); -CLUTTER_DEPRECATED_IN_1_8 -gboolean clutter_score_get_loop (ClutterScore *score); - -CLUTTER_DEPRECATED_IN_1_8 -gulong clutter_score_append (ClutterScore *score, - ClutterTimeline *parent, - ClutterTimeline *timeline); -CLUTTER_DEPRECATED_IN_1_8 -gulong clutter_score_append_at_marker (ClutterScore *score, - ClutterTimeline *parent, - const gchar *marker_name, - ClutterTimeline *timeline); -CLUTTER_DEPRECATED_IN_1_8 -void clutter_score_remove (ClutterScore *score, - gulong id_); -CLUTTER_DEPRECATED_IN_1_8 -void clutter_score_remove_all (ClutterScore *score); -CLUTTER_DEPRECATED_IN_1_8 -ClutterTimeline *clutter_score_get_timeline (ClutterScore *score, - gulong id_); -CLUTTER_DEPRECATED_IN_1_8 -GSList * clutter_score_list_timelines (ClutterScore *score); - -CLUTTER_DEPRECATED_IN_1_8 -void clutter_score_start (ClutterScore *score); -CLUTTER_DEPRECATED_IN_1_8 -void clutter_score_stop (ClutterScore *score); -CLUTTER_DEPRECATED_IN_1_8 -void clutter_score_pause (ClutterScore *score); -CLUTTER_DEPRECATED_IN_1_8 -void clutter_score_rewind (ClutterScore *score); -CLUTTER_DEPRECATED_IN_1_8 -gboolean clutter_score_is_playing (ClutterScore *score); - -G_END_DECLS - -#endif /* __CLUTTER_SCORE_H__ */ diff --git a/clutter/deprecated/clutter-shader.c b/clutter/deprecated/clutter-shader.c deleted file mode 100644 index 5282733f4..000000000 --- a/clutter/deprecated/clutter-shader.c +++ /dev/null @@ -1,942 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By: Matthew Allum - * Øyvind KolÃ¥s - * Emmanuele Bassi - * - * Copyright (C) 2007, 2008 OpenedHand - * Copyright (C) 2009 Intel Corp - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - * - */ - -/** - * SECTION:clutter-shader - * @short_description: Programmable pipeline abstraction - * - * #ClutterShader is an object providing an abstraction over the - * OpenGL programmable pipeline. By using #ClutterShaders is - * possible to override the drawing pipeline by using small programs - * also known as "shaders". - * - * #ClutterShader is available since Clutter 0.6. - * - * #ClutterShader is deprecated since Clutter 1.8; use #ClutterShaderEffect - * in newly written code. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#ifdef HAVE_UNISTD_H -#include -#endif - -#define CLUTTER_DISABLE_DEPRECATION_WARNINGS - -#include -#include - -/* This file depends on the cogl 1.x api which isn't exposed when - * COGL_ENABLE_EXPERIMENTAL_2_0_API is defined... - */ -#undef COGL_ENABLE_EXPERIMENTAL_2_0_API -#include - -#include "clutter-shader.h" - -#include "clutter-debug.h" -#include "clutter-private.h" - -/* global list of shaders */ -static GList *clutter_shaders_list = NULL; - -#define CLUTTER_SHADER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_SHADER, ClutterShaderPrivate)) - -struct _ClutterShaderPrivate -{ - guint compiled : 1; /* Shader is bound to the GL context */ - guint is_enabled : 1; - guint vertex_is_glsl : 1; - guint fragment_is_glsl : 1; - - gchar *vertex_source; /* GLSL source for vertex shader */ - gchar *fragment_source; /* GLSL source for fragment shader */ - - CoglHandle program; - - CoglHandle vertex_shader; - CoglHandle fragment_shader; -}; - -enum -{ - PROP_0, - - PROP_VERTEX_SOURCE, - PROP_FRAGMENT_SOURCE, - PROP_COMPILED, - PROP_ENABLED, - - PROP_LAST -}; - -static GParamSpec *obj_props[PROP_LAST]; - -G_DEFINE_TYPE (ClutterShader, clutter_shader, G_TYPE_OBJECT); - -static inline void -clutter_shader_release_internal (ClutterShader *shader) -{ - ClutterShaderPrivate *priv = shader->priv; - - if (!priv->compiled) - return; - - g_assert (priv->program != COGL_INVALID_HANDLE); - - if (priv->vertex_is_glsl && priv->vertex_shader != COGL_INVALID_HANDLE) - cogl_handle_unref (priv->vertex_shader); - - if (priv->fragment_is_glsl && priv->fragment_shader != COGL_INVALID_HANDLE) - cogl_handle_unref (priv->fragment_shader); - - if (priv->program != COGL_INVALID_HANDLE) - cogl_handle_unref (priv->program); - - priv->vertex_shader = COGL_INVALID_HANDLE; - priv->fragment_shader = COGL_INVALID_HANDLE; - priv->program = COGL_INVALID_HANDLE; - priv->compiled = FALSE; -} - -static void -clutter_shader_finalize (GObject *object) -{ - ClutterShader *shader; - ClutterShaderPrivate *priv; - - shader = CLUTTER_SHADER (object); - priv = shader->priv; - - clutter_shaders_list = g_list_remove (clutter_shaders_list, object); - - g_free (priv->fragment_source); - g_free (priv->vertex_source); - - G_OBJECT_CLASS (clutter_shader_parent_class)->finalize (object); -} - -static void -clutter_shader_dispose (GObject *object) -{ - ClutterShader *shader = CLUTTER_SHADER (object); - - clutter_shader_release_internal (shader); - - G_OBJECT_CLASS (clutter_shader_parent_class)->finalize (object); -} - -static void -clutter_shader_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - ClutterShader *shader = CLUTTER_SHADER(object); - - switch (prop_id) - { - case PROP_VERTEX_SOURCE: - clutter_shader_set_vertex_source (shader, - g_value_get_string (value), -1); - break; - case PROP_FRAGMENT_SOURCE: - clutter_shader_set_fragment_source (shader, - g_value_get_string (value), -1); - break; - case PROP_ENABLED: - clutter_shader_set_is_enabled (shader, g_value_get_boolean (value)); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -clutter_shader_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - ClutterShader *shader; - ClutterShaderPrivate *priv; - - shader = CLUTTER_SHADER(object); - priv = shader->priv; - - switch (prop_id) - { - case PROP_VERTEX_SOURCE: - g_value_set_string (value, priv->vertex_source); - break; - case PROP_FRAGMENT_SOURCE: - g_value_set_string (value, priv->fragment_source); - break; - case PROP_COMPILED: - g_value_set_boolean (value, priv->compiled); - break; - case PROP_ENABLED: - g_value_set_boolean (value, priv->is_enabled); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static GObject * -clutter_shader_constructor (GType type, - guint n_params, - GObjectConstructParam *params) -{ - GObjectClass *parent_class; - GObject *object; - - parent_class = G_OBJECT_CLASS (clutter_shader_parent_class); - object = parent_class->constructor (type, n_params, params); - - /* add this instance to the global list of shaders */ - clutter_shaders_list = g_list_prepend (clutter_shaders_list, object); - - return object; -} - -static void -clutter_shader_class_init (ClutterShaderClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - GParamSpec *pspec = NULL; - - object_class->finalize = clutter_shader_finalize; - object_class->dispose = clutter_shader_dispose; - object_class->set_property = clutter_shader_set_property; - object_class->get_property = clutter_shader_get_property; - object_class->constructor = clutter_shader_constructor; - - g_type_class_add_private (klass, sizeof (ClutterShaderPrivate)); - - /** - * ClutterShader:vertex-source: - * - * GLSL source code for the vertex shader part of the shader - * program, if any - * - * - * - * Deprecated: 1.8: Use #ClutterShaderEffect instead. - */ - pspec = g_param_spec_string ("vertex-source", - P_("Vertex Source"), - P_("Source of vertex shader"), - NULL, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_VERTEX_SOURCE] = pspec; - g_object_class_install_property (object_class, PROP_VERTEX_SOURCE, pspec); - - /** - * ClutterShader:fragment-source: - * - * GLSL source code for the fragment shader part of the shader program. - * - * - * - * Deprecated: 1.8: Use #ClutterShaderEffect instead. - */ - pspec = g_param_spec_string ("fragment-source", - P_("Fragment Source"), - P_("Source of fragment shader"), - NULL, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_FRAGMENT_SOURCE] = pspec; - g_object_class_install_property (object_class, PROP_FRAGMENT_SOURCE, pspec); - - /** - * ClutterShader:compiled: - * - * Whether the shader is compiled and linked, ready for use - * in the GL context. - * - * - * - * Deprecated: 1.8: Use #ClutterShaderEffect instead. - */ - pspec = g_param_spec_boolean ("compiled", - P_("Compiled"), - P_("Whether the shader is compiled and linked"), - FALSE, - CLUTTER_PARAM_READABLE); - obj_props[PROP_COMPILED] = pspec; - g_object_class_install_property (object_class, PROP_COMPILED, pspec); - - /** - * ClutterShader:enabled: - * - * Whether the shader is currently used in the GL rendering pipeline. - * - * - * - * Deprecated: 1.8: Use #ClutterShaderEffect instead. - */ - pspec = g_param_spec_boolean ("enabled", - P_("Enabled"), - P_("Whether the shader is enabled"), - FALSE, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_ENABLED] = pspec; - g_object_class_install_property (object_class, PROP_ENABLED, pspec); -} - -static void -clutter_shader_init (ClutterShader *self) -{ - ClutterShaderPrivate *priv; - - priv = self->priv = CLUTTER_SHADER_GET_PRIVATE (self); - - priv->compiled = FALSE; - - priv->vertex_source = NULL; - priv->fragment_source = NULL; - - priv->program = COGL_INVALID_HANDLE; - priv->vertex_shader = COGL_INVALID_HANDLE; - priv->fragment_shader = COGL_INVALID_HANDLE; -} - -/** - * clutter_shader_new: - * - * Create a new #ClutterShader instance. - * - * Return value: a new #ClutterShader. - * - * - * - * Deprecated: 1.8: Use #ClutterShaderEffect instead. - */ -ClutterShader * -clutter_shader_new (void) -{ - return g_object_new (CLUTTER_TYPE_SHADER, NULL); -} - -static inline void -clutter_shader_set_source (ClutterShader *shader, - ClutterShaderType shader_type, - const gchar *data, - gssize length) -{ - ClutterShaderPrivate *priv = shader->priv; - gboolean is_glsl = FALSE; - - if (length < 0) - length = strlen (data); - - g_object_freeze_notify (G_OBJECT (shader)); - - /* release shader if bound when changing the source, the shader will - * automatically be rebound on the next use. - */ - if (clutter_shader_is_compiled (shader)) - clutter_shader_release (shader); - - is_glsl = !g_str_has_prefix (data, "!!ARBfp"); - - CLUTTER_NOTE (SHADER, - "setting %s shader (GLSL:%s, len:%" G_GSSIZE_FORMAT ")", - shader_type == CLUTTER_VERTEX_SHADER ? "vertex" : "fragment", - is_glsl ? "yes" : "no", - length); - - switch (shader_type) - { - case CLUTTER_FRAGMENT_SHADER: - g_free (priv->fragment_source); - - priv->fragment_source = g_strndup (data, length); - priv->fragment_is_glsl = is_glsl; - g_object_notify_by_pspec (G_OBJECT (shader), obj_props[PROP_FRAGMENT_SOURCE]); - break; - - case CLUTTER_VERTEX_SHADER: - g_free (priv->vertex_source); - - priv->vertex_source = g_strndup (data, length); - priv->vertex_is_glsl = is_glsl; - g_object_notify_by_pspec (G_OBJECT (shader), obj_props[PROP_VERTEX_SOURCE]); - break; - } - - g_object_thaw_notify (G_OBJECT (shader)); -} - -/** - * clutter_shader_set_fragment_source: - * @shader: a #ClutterShader - * @data: GLSL source code. - * @length: length of source buffer (currently ignored) - * - * Sets the GLSL source code to be used by a #ClutterShader for the fragment - * program. - * - * - * - * Deprecated: 1.8: Use #ClutterShaderEffect instead. - */ -void -clutter_shader_set_fragment_source (ClutterShader *shader, - const gchar *data, - gssize length) -{ - g_return_if_fail (CLUTTER_IS_SHADER (shader)); - g_return_if_fail (data != NULL); - - clutter_shader_set_source (shader, CLUTTER_FRAGMENT_SHADER, data, length); -} - -/** - * clutter_shader_set_vertex_source: - * @shader: a #ClutterShader - * @data: GLSL source code. - * @length: length of source buffer (currently ignored) - * - * Sets the GLSL source code to be used by a #ClutterShader for the vertex - * program. - * - * - * - * Deprecated: 1.8: Use #ClutterShaderEffect instead. - */ -void -clutter_shader_set_vertex_source (ClutterShader *shader, - const gchar *data, - gssize length) -{ - g_return_if_fail (CLUTTER_IS_SHADER (shader)); - g_return_if_fail (data != NULL); - - clutter_shader_set_source (shader, CLUTTER_VERTEX_SHADER, data, length); -} - -static const gchar * -clutter_shader_get_source (ClutterShader *shader, - ClutterShaderType shader_type) -{ - switch (shader_type) - { - case CLUTTER_FRAGMENT_SHADER: - return shader->priv->fragment_source; - - case CLUTTER_VERTEX_SHADER: - return shader->priv->vertex_source; - } - - return NULL; -} - -static CoglHandle -clutter_shader_get_cogl_shader (ClutterShader *shader, - ClutterShaderType shader_type) -{ - switch (shader_type) - { - case CLUTTER_FRAGMENT_SHADER: - return shader->priv->fragment_shader; - - case CLUTTER_VERTEX_SHADER: - return shader->priv->vertex_shader; - } - - return COGL_INVALID_HANDLE; -} - -static gboolean -clutter_shader_glsl_bind (ClutterShader *self, - ClutterShaderType shader_type, - GError **error) -{ - ClutterShaderPrivate *priv = self->priv; - CoglHandle shader = COGL_INVALID_HANDLE; - - switch (shader_type) - { - case CLUTTER_VERTEX_SHADER: - shader = cogl_create_shader (COGL_SHADER_TYPE_VERTEX); - cogl_shader_source (shader, priv->vertex_source); - - priv->vertex_shader = shader; - break; - - case CLUTTER_FRAGMENT_SHADER: - shader = cogl_create_shader (COGL_SHADER_TYPE_FRAGMENT); - cogl_shader_source (shader, priv->fragment_source); - - priv->fragment_shader = shader; - break; - } - - g_assert (shader != COGL_INVALID_HANDLE); - - cogl_shader_compile (shader); - if (!cogl_shader_is_compiled (shader)) - { - gchar *log_buf; - - log_buf = cogl_shader_get_info_log (shader); - - /* translators: the first %s is the type of the shader, either - * Vertex shader or Fragment shader; the second %s is the actual - * error as reported by COGL - */ - g_set_error (error, CLUTTER_SHADER_ERROR, - CLUTTER_SHADER_ERROR_COMPILE, - _("%s compilation failed: %s"), - shader_type == CLUTTER_VERTEX_SHADER ? _("Vertex shader") - : _("Fragment shader"), - log_buf); - - g_free (log_buf); - - return FALSE; - } - - cogl_program_attach_shader (priv->program, shader); - - return TRUE; -} - -static gboolean -bind_glsl_shader (ClutterShader *self, - GError **error) -{ - ClutterShaderPrivate *priv = self->priv; - GError *bind_error = NULL; - gboolean res; - - priv->program = cogl_create_program (); - - if (priv->vertex_is_glsl && priv->vertex_source != COGL_INVALID_HANDLE) - { - res = clutter_shader_glsl_bind (self, - CLUTTER_VERTEX_SHADER, - &bind_error); - - if (!res) - { - g_propagate_error (error, bind_error); - return FALSE; - } - } - - if (priv->fragment_is_glsl && priv->fragment_source != COGL_INVALID_HANDLE) - { - res = clutter_shader_glsl_bind (self, - CLUTTER_FRAGMENT_SHADER, - &bind_error); - - if (!res) - { - g_propagate_error (error, bind_error); - return FALSE; - } - } - - cogl_program_link (priv->program); - - return TRUE; -} - -/** - * clutter_shader_compile: - * @shader: a #ClutterShader - * @error: return location for a #GError, or %NULL - * - * Compiles and links GLSL sources set for vertex and fragment shaders for - * a #ClutterShader. If the compilation fails and a #GError return location is - * provided the error will contain the errors from the compiler, if any. - * - * Return value: returns TRUE if the shader was succesfully compiled. - * - * - * - * Deprecated: 1.8: Use #ClutterShaderEffect instead. - */ -gboolean -clutter_shader_compile (ClutterShader *shader, - GError **error) -{ - ClutterShaderPrivate *priv; - - g_return_val_if_fail (CLUTTER_IS_SHADER (shader), FALSE); - - priv = shader->priv; - - if (priv->compiled) - return priv->compiled; - - if ((priv->vertex_source != COGL_INVALID_HANDLE && !priv->vertex_is_glsl) || - (priv->fragment_source != COGL_INVALID_HANDLE && !priv->fragment_is_glsl)) - { - /* XXX: Could remove this check, since we only advertise support for GLSL - * shaders anyways. */ - g_set_error (error, CLUTTER_SHADER_ERROR, - CLUTTER_SHADER_ERROR_NO_ASM, - "ASM shaders not supported"); - priv->compiled = FALSE; - return priv->compiled; - } - - if (!clutter_feature_available (CLUTTER_FEATURE_SHADERS_GLSL)) - { - g_set_error (error, CLUTTER_SHADER_ERROR, - CLUTTER_SHADER_ERROR_NO_GLSL, - "GLSL shaders not supported"); - priv->compiled = FALSE; - return priv->compiled; - } - - priv->compiled = bind_glsl_shader (shader, error); - g_object_notify_by_pspec (G_OBJECT (shader), obj_props[PROP_COMPILED]); - - return priv->compiled; -} - -/** - * clutter_shader_release: - * @shader: a #ClutterShader - * - * Frees up any GL context resources held by the shader. - * - * - * - * Deprecated: 1.8: Use #ClutterShaderEffect instead. - */ -void -clutter_shader_release (ClutterShader *shader) -{ - g_return_if_fail (CLUTTER_IS_SHADER (shader)); - - clutter_shader_release_internal (shader); - - g_object_notify_by_pspec (G_OBJECT (shader), obj_props[PROP_COMPILED]); -} - -/** - * clutter_shader_is_compiled: - * @shader: a #ClutterShader - * - * Checks whether @shader is is currently compiled, linked and bound - * to the GL context. - * - * Return value: %TRUE if the shader is compiled, linked and ready for use. - * - * - * - * Deprecated: 1.8: Use #ClutterShaderEffect instead. - */ -gboolean -clutter_shader_is_compiled (ClutterShader *shader) -{ - g_return_val_if_fail (CLUTTER_IS_SHADER (shader), FALSE); - - return shader->priv->compiled; -} - -/** - * clutter_shader_set_is_enabled: - * @shader: a #ClutterShader - * @enabled: The new state of the shader. - * - * Enables a shader. This function will attempt to compile and link - * the shader, if it isn't already. - * - * When @enabled is %FALSE the default state of the GL pipeline will be - * used instead. - * - * - * - * Deprecated: 1.8: Use #ClutterShaderEffect instead. - */ -void -clutter_shader_set_is_enabled (ClutterShader *shader, - gboolean enabled) -{ - ClutterShaderPrivate *priv; - - g_return_if_fail (CLUTTER_IS_SHADER (shader)); - - priv = shader->priv; - - if (priv->is_enabled != enabled) - { - GError *error = NULL; - gboolean res; - - res = clutter_shader_compile (shader, &error); - if (!res) - { - g_warning ("Unable to bind the shader: %s", - error ? error->message : "unknown error"); - if (error) - g_error_free (error); - - return; - } - - priv->is_enabled = enabled; - - if (priv->is_enabled) - cogl_program_use (priv->program); - else - cogl_program_use (COGL_INVALID_HANDLE); - - g_object_notify_by_pspec (G_OBJECT (shader), obj_props[PROP_ENABLED]); - } -} - -/** - * clutter_shader_get_is_enabled: - * @shader: a #ClutterShader - * - * Checks whether @shader is enabled. - * - * Return value: %TRUE if the shader is enabled. - * - * - * - * Deprecated: 1.8: Use #ClutterShaderEffect instead. - */ -gboolean -clutter_shader_get_is_enabled (ClutterShader *shader) -{ - g_return_val_if_fail (CLUTTER_IS_SHADER (shader), FALSE); - - return shader->priv->is_enabled; -} - -/** - * clutter_shader_set_uniform: - * @shader: a #ClutterShader. - * @name: name of uniform in GLSL shader program to set. - * @value: a #ClutterShaderFloat, #ClutterShaderInt or #ClutterShaderMatrix - * #GValue. - * - * Sets a user configurable variable in the GLSL shader programs attached to - * a #ClutterShader. - * - * - * - * Deprecated: 1.8: Use #ClutterShaderEffect instead. - */ -void -clutter_shader_set_uniform (ClutterShader *shader, - const gchar *name, - const GValue *value) -{ - ClutterShaderPrivate *priv; - int location = 0; - gsize size; - - g_return_if_fail (CLUTTER_IS_SHADER (shader)); - g_return_if_fail (name != NULL); - g_return_if_fail (value != NULL); - g_return_if_fail (CLUTTER_VALUE_HOLDS_SHADER_FLOAT (value) || - CLUTTER_VALUE_HOLDS_SHADER_INT (value) || - CLUTTER_VALUE_HOLDS_SHADER_MATRIX (value) || - G_VALUE_HOLDS_FLOAT (value) || - G_VALUE_HOLDS_INT (value)); - - priv = shader->priv; - g_return_if_fail (priv->program != COGL_INVALID_HANDLE); - - location = cogl_program_get_uniform_location (priv->program, name); - - if (CLUTTER_VALUE_HOLDS_SHADER_FLOAT (value)) - { - const float *floats; - - floats = clutter_value_get_shader_float (value, &size); - cogl_program_set_uniform_float (priv->program, - location, size, 1, floats); - } - else if (CLUTTER_VALUE_HOLDS_SHADER_INT (value)) - { - const int *ints; - - ints = clutter_value_get_shader_int (value, &size); - cogl_program_set_uniform_int (priv->program, - location, size, 1, ints); - } - else if (CLUTTER_VALUE_HOLDS_SHADER_MATRIX (value)) - { - const float *matrix; - - matrix = clutter_value_get_shader_matrix (value, &size); - cogl_program_set_uniform_matrix (priv->program, - location, size, 1, FALSE, matrix); - } - else if (G_VALUE_HOLDS_FLOAT (value)) - { - float float_val = g_value_get_float (value); - - cogl_program_set_uniform_float (priv->program, - location, 1, 1, &float_val); - } - else if (G_VALUE_HOLDS_INT (value)) - { - int int_val = g_value_get_int (value); - - cogl_program_set_uniform_int (priv->program, - location, 1, 1, &int_val); - } - else - g_assert_not_reached (); -} - -/** - * clutter_shader_get_fragment_source: - * @shader: a #ClutterShader - * - * Query the current GLSL fragment source set on @shader. - * - * Return value: the source of the fragment shader for this - * ClutterShader object or %NULL. The returned string is owned by the - * shader object and should never be modified or freed - * - * - * - * Deprecated: 1.8: Use #ClutterShaderEffect instead. - */ -const gchar * -clutter_shader_get_fragment_source (ClutterShader *shader) -{ - g_return_val_if_fail (CLUTTER_IS_SHADER (shader), NULL); - - return clutter_shader_get_source (shader, CLUTTER_FRAGMENT_SHADER); -} - -/** - * clutter_shader_get_vertex_source: - * @shader: a #ClutterShader - * - * Query the current GLSL vertex source set on @shader. - * - * Return value: the source of the vertex shader for this - * ClutterShader object or %NULL. The returned string is owned by the - * shader object and should never be modified or freed - * - * - * - * Deprecated: 1.8: Use #ClutterShaderEffect instead. - */ -const gchar * -clutter_shader_get_vertex_source (ClutterShader *shader) -{ - g_return_val_if_fail (CLUTTER_IS_SHADER (shader), NULL); - - return clutter_shader_get_source (shader, CLUTTER_VERTEX_SHADER); -} - -/** - * clutter_shader_get_cogl_program: - * @shader: a #ClutterShader - * - * Retrieves the underlying #CoglHandle for the shader program. - * - * Return value: (transfer none): A #CoglHandle for the shader program, - * or %NULL. The handle is owned by the #ClutterShader and it should - * not be unreferenced - * - * - * - * Deprecated: 1.8: Use #ClutterShaderEffect instead. - */ -CoglHandle -clutter_shader_get_cogl_program (ClutterShader *shader) -{ - g_return_val_if_fail (CLUTTER_IS_SHADER (shader), NULL); - - return shader->priv->program; -} - -/** - * clutter_shader_get_cogl_fragment_shader: - * @shader: a #ClutterShader - * - * Retrieves the underlying #CoglHandle for the fragment shader. - * - * Return value: (transfer none): A #CoglHandle for the fragment - * shader, or %NULL. The handle is owned by the #ClutterShader - * and it should not be unreferenced - * - * - * - * Deprecated: 1.8: Use #ClutterShaderEffect instead. - */ -CoglHandle -clutter_shader_get_cogl_fragment_shader (ClutterShader *shader) -{ - g_return_val_if_fail (CLUTTER_IS_SHADER (shader), NULL); - - return clutter_shader_get_cogl_shader (shader, CLUTTER_FRAGMENT_SHADER); -} - -/** - * clutter_shader_get_cogl_vertex_shader: - * @shader: a #ClutterShader - * - * Retrieves the underlying #CoglHandle for the vertex shader. - * - * Return value: (transfer none): A #CoglHandle for the vertex - * shader, or %NULL. The handle is owned by the #ClutterShader - * and it should not be unreferenced - * - * - * - * Deprecated: 1.8: Use #ClutterShaderEffect instead. - */ -CoglHandle -clutter_shader_get_cogl_vertex_shader (ClutterShader *shader) -{ - g_return_val_if_fail (CLUTTER_IS_SHADER (shader), NULL); - - return clutter_shader_get_cogl_shader (shader, CLUTTER_VERTEX_SHADER); -} - -GQuark -clutter_shader_error_quark (void) -{ - return g_quark_from_static_string ("clutter-shader-error"); -} diff --git a/clutter/deprecated/clutter-shader.h b/clutter/deprecated/clutter-shader.h deleted file mode 100644 index 95cf465ea..000000000 --- a/clutter/deprecated/clutter-shader.h +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * Øyvind KolÃ¥s - * - * Copyright (C) 2007 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_SHADER_H__ -#define __CLUTTER_SHADER_H__ - -#include -#include - -G_BEGIN_DECLS - -#define CLUTTER_TYPE_SHADER (clutter_shader_get_type ()) -#define CLUTTER_SHADER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CLUTTER_TYPE_SHADER, ClutterShader)) -#define CLUTTER_SHADER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), CLUTTER_TYPE_SHADER, ClutterShaderClass)) -#define CLUTTER_IS_SHADER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CLUTTER_TYPE_SHADER)) -#define CLUTTER_IS_SHADER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), CLUTTER_TYPE_SHADER)) -#define CLUTTER_SHADER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), CLUTTER_TYPE_SHADER, ClutterShaderClass)) - -/** - * CLUTTER_SHADER_ERROR: - * - * Error domain for #ClutterShader errors - * - * - * - * Deprecated: 1.8 - */ -#define CLUTTER_SHADER_ERROR (clutter_shader_error_quark ()) - -/** - * ClutterShaderError: - * @CLUTTER_SHADER_ERROR_NO_ASM: No ASM shaders support - * @CLUTTER_SHADER_ERROR_NO_GLSL: No GLSL shaders support - * @CLUTTER_SHADER_ERROR_COMPILE: Compilation error - * - * #ClutterShader error enumeration - * - * - * - * Deprecated: 1.8 - */ -typedef enum { - CLUTTER_SHADER_ERROR_NO_ASM, - CLUTTER_SHADER_ERROR_NO_GLSL, - CLUTTER_SHADER_ERROR_COMPILE -} ClutterShaderError; - -typedef struct _ClutterShaderPrivate ClutterShaderPrivate; -typedef struct _ClutterShaderClass ClutterShaderClass; - -/** - * ClutterShader: - * - * The #ClutterShader structure contains only private data - * and should be accessed using the provided API - * - * - * - * Deprecated: 1.8: Use #ClutterShaderEffect instead - */ -struct _ClutterShader -{ - /*< private >*/ - GObject parent; - ClutterShaderPrivate *priv; -}; - -/** - * ClutterShaderClass: - * - * The #ClutterShaderClass structure contains only private data - * - * - * - * Deprecated: 1.8: Use #ClutterShaderEffectClass instead - */ -struct _ClutterShaderClass -{ - /*< private >*/ - GObjectClass parent_class; -}; - -CLUTTER_DEPRECATED_IN_1_8 -GQuark clutter_shader_error_quark (void); - -CLUTTER_DEPRECATED_IN_1_8 -GType clutter_shader_get_type (void) G_GNUC_CONST; - -CLUTTER_DEPRECATED_IN_1_8_FOR(ClutterShaderEffect) -ClutterShader * clutter_shader_new (void); - -CLUTTER_DEPRECATED_IN_1_8_FOR(ClutterShaderEffect) -void clutter_shader_set_is_enabled (ClutterShader *shader, - gboolean enabled); -CLUTTER_DEPRECATED_IN_1_8_FOR(ClutterShaderEffect) -gboolean clutter_shader_get_is_enabled (ClutterShader *shader); - -CLUTTER_DEPRECATED_IN_1_8_FOR(ClutterShaderEffect) -gboolean clutter_shader_compile (ClutterShader *shader, - GError **error); -CLUTTER_DEPRECATED_IN_1_8_FOR(ClutterShaderEffect) -void clutter_shader_release (ClutterShader *shader); -CLUTTER_DEPRECATED_IN_1_8_FOR(ClutterShaderEffect) -gboolean clutter_shader_is_compiled (ClutterShader *shader); - -CLUTTER_DEPRECATED_IN_1_8_FOR(ClutterShaderEffect) -void clutter_shader_set_vertex_source (ClutterShader *shader, - const gchar *data, - gssize length); -CLUTTER_DEPRECATED_IN_1_8_FOR(ClutterShaderEffect) -void clutter_shader_set_fragment_source (ClutterShader *shader, - const gchar *data, - gssize length); -CLUTTER_DEPRECATED_IN_1_8_FOR(ClutterShaderEffect) -const gchar * clutter_shader_get_vertex_source (ClutterShader *shader); -CLUTTER_DEPRECATED_IN_1_8_FOR(ClutterShaderEffect) -const gchar * clutter_shader_get_fragment_source (ClutterShader *shader); - -CLUTTER_DEPRECATED_IN_1_8_FOR(ClutterShaderEffect) -void clutter_shader_set_uniform (ClutterShader *shader, - const gchar *name, - const GValue *value); - -CLUTTER_DEPRECATED_IN_1_8_FOR(ClutterShaderEffect) -CoglHandle clutter_shader_get_cogl_program (ClutterShader *shader); -CLUTTER_DEPRECATED_IN_1_8_FOR(ClutterShaderEffect) -CoglHandle clutter_shader_get_cogl_fragment_shader (ClutterShader *shader); -CLUTTER_DEPRECATED_IN_1_8_FOR(ClutterShaderEffect) -CoglHandle clutter_shader_get_cogl_vertex_shader (ClutterShader *shader); - -/* ClutterActor methods */ - -CLUTTER_DEPRECATED_IN_1_8_FOR(clutter_actor_add_effect) -gboolean clutter_actor_set_shader (ClutterActor *self, - ClutterShader *shader); - -CLUTTER_DEPRECATED_IN_1_8_FOR(clutter_actor_get_effect) -ClutterShader * clutter_actor_get_shader (ClutterActor *self); - -CLUTTER_DEPRECATED_IN_1_8_FOR(clutter_shader_effect_set_uniform_value) -void clutter_actor_set_shader_param (ClutterActor *self, - const gchar *param, - const GValue *value); - -CLUTTER_DEPRECATED_IN_1_8_FOR(clutter_shader_effect_set_uniform) -void clutter_actor_set_shader_param_int (ClutterActor *self, - const gchar *param, - gint value); - -CLUTTER_DEPRECATED_IN_1_8_FOR(clutter_shader_effect_set_uniform) -void clutter_actor_set_shader_param_float (ClutterActor *self, - const gchar *param, - gfloat value); - -G_END_DECLS - -#endif /* __CLUTTER_SHADER_H__ */ diff --git a/clutter/deprecated/clutter-stage-manager.h b/clutter/deprecated/clutter-stage-manager.h deleted file mode 100644 index df19298dd..000000000 --- a/clutter/deprecated/clutter-stage-manager.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Copyright (C) 2008 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - * Author: Emmanuele Bassi - */ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_STAGE_MANAGER_DEPRECATED_H__ -#define __CLUTTER_STAGE_MANAGER_DEPRECATED_H__ - -#include - -G_BEGIN_DECLS - -CLUTTER_DEPRECATED_IN_1_2 -void clutter_stage_manager_set_default_stage (ClutterStageManager *stage_manager, - ClutterStage *stage); - -G_END_DECLS - -#endif /*__CLUTTER_STAGE_MANAGER_DEPRECATED_H__ */ - diff --git a/clutter/deprecated/clutter-stage.h b/clutter/deprecated/clutter-stage.h deleted file mode 100644 index 91987838c..000000000 --- a/clutter/deprecated/clutter-stage.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Copyright (C) 2011 Intel Corp - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_STAGE_DEPRECATED_H__ -#define __CLUTTER_STAGE_DEPRECATED_H__ - -#include - -G_BEGIN_DECLS - -#ifndef CLUTTER_DISABLE_DEPRECATED - -/** - * CLUTTER_STAGE_WIDTH: - * - * Macro that evaluates to the width of the default stage - * - * - * - * Deprecated: 1.2: Use clutter_actor_get_width() instead - */ -#define CLUTTER_STAGE_WIDTH() (clutter_actor_get_width (clutter_stage_get_default ())) - -/** - * CLUTTER_STAGE_HEIGHT: - * - * Macro that evaluates to the height of the default stage - * - * - * - * Deprecated: 1.2: use clutter_actor_get_height() instead - */ -#define CLUTTER_STAGE_HEIGHT() (clutter_actor_get_height (clutter_stage_get_default ())) - -/* Commodity macro, for mallum only */ -#define clutter_stage_add(stage,actor) G_STMT_START { \ - if (CLUTTER_IS_STAGE ((stage)) && CLUTTER_IS_ACTOR ((actor))) \ - { \ - ClutterContainer *_container = (ClutterContainer *) (stage); \ - ClutterActor *_actor = (ClutterActor *) (actor); \ - clutter_container_add_actor (_container, _actor); \ - } } G_STMT_END - -#endif /* CLUTTER_DISABLE_DEPRECATED */ - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_stage_new) -ClutterActor * clutter_stage_get_default (void); - -CLUTTER_DEPRECATED_IN_1_10 -gboolean clutter_stage_is_default (ClutterStage *stage); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_queue_redraw) -void clutter_stage_queue_redraw (ClutterStage *stage); - -CLUTTER_DEPRECATED_IN_1_10 -void clutter_stage_set_use_fog (ClutterStage *stage, - gboolean fog); - -CLUTTER_DEPRECATED_IN_1_10 -gboolean clutter_stage_get_use_fog (ClutterStage *stage); - -CLUTTER_DEPRECATED_IN_1_10 -void clutter_stage_set_fog (ClutterStage *stage, - ClutterFog *fog); - -CLUTTER_DEPRECATED_IN_1_10 -void clutter_stage_get_fog (ClutterStage *stage, - ClutterFog *fog); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_set_background_color) -void clutter_stage_set_color (ClutterStage *stage, - const ClutterColor *color); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_actor_get_background_color) -void clutter_stage_get_color (ClutterStage *stage, - ClutterColor *color); - -G_END_DECLS - -#endif /* __CLUTTER_STAGE_DEPRECATED_H__ */ diff --git a/clutter/deprecated/clutter-state.c b/clutter/deprecated/clutter-state.c deleted file mode 100644 index 5355e93b7..000000000 --- a/clutter/deprecated/clutter-state.c +++ /dev/null @@ -1,2315 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Øyvind KolÃ¥s - * - * Copyright (C) 2009 Intel Corporation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -/** - * SECTION:clutter-state - * @short_description: State machine with animated transitions - * - * #ClutterState is an object controlling the tweening of properties on - * multiple actors between a set of named states. #ClutterStateKeys - * define how the properties are animated. If the source_state_name for a key - * is NULL it is used for transition to the target state unless a specific key - * exists for transitioning from the current state to the requested state. - * - * - * A ClutterState example - * The following example defines a "base" and a "hover" state in a - * #ClutterState instance. - * - * ClutterState *state = clutter_state_new (); - * ClutterColor color = { 0, }; - * - * /* transition from any state to the "base" state */ - * clutter_color_from_string (&color, "rgb(255, 0, 0)"); - * clutter_state_set (state, NULL, "base", - * actor, "color", CLUTTER_LINEAR, &color, - * actor, "scale-x", CLUTTER_EASE_IN_BOUNCE, 1.0, - * actor, "scale-y", CLUTTER_EASE_IN_BOUNCE, 1.0, - * NULL); - * - * /* transition from the "base" state to the "hover" state */ - * clutter_color_from_string (&color, "rgb(0, 0, 255)"); - * clutter_state_set (state, "base", "hover", - * actor, "color", CLUTTER_LINEAR, &color, - * actor, "scale-x", CLUTTER_EASE_OUT_BOUNCE, 1.7, - * actor, "scale-y", CLUTTER_EASE_OUT_BOUNCE, 1.7, - * NULL); - * - * /* the default duration of any transition */ - * clutter_state_set_duration (state, NULL, NULL, 500); - * - * /* set "base" as the initial state */ - * clutter_state_warp_to_state (state, "base"); - * - * The actor then uses the #ClutterState to animate through the - * two states using callbacks for the #ClutterActor::enter-event and - * #ClutterActor::leave-event signals. - * - * static gboolean - * on_enter (ClutterActor *actor, - * ClutterEvent *event, - * ClutterState *state) - * { - * clutter_state_set_state (state, "hover"); - * - * return TRUE; - * } - * - * static gboolean - * on_leave (ClutterActor *actor, - * ClutterEvent *event, - * ClutterState *state) - * { - * clutter_state_set_state (state, "base"); - * - * return TRUE; - * } - * - * - * - * - * ClutterState description for #ClutterScript - * #ClutterState defines a custom transitions - * property which allows describing the states. - * The transitions property has the following - * syntax: - * - * - * { - * "transitions" : [ - * { - * "source" : "<source-state>", - * "target" : "<target-state>", - * "duration" : <milliseconds>, - * "keys" : [ - * [ - * "<object-id>", - * "<property-name>", - * "<easing-mode>", - * "<final-value>", - * ], - * [ - * "<object-id>", - * "<property-name>", - * "<easing-mode>", - * "<final-value>", - * <pre-delay>, - * <post-delay> - * ], - * ... - * ] - * }, - * { - * "source" : "<source-state>", - * "target" : "<target-state>", - * "duration" : <milliseconds>, - * "animator" : "<animator-definition>" - * }, - * ... - * ] - * } - * - * - * Each element of the transitions array follows - * the same rules as clutter_state_set_key(). - * The source and target - * values control the source and target state of the transition. The - * key and animator are mutually - * exclusive. The pre-delay and - * post-delay values are optional. - * - * ClutterState definition - * The example below is a translation into a #ClutterScript - * definition of the code in the example - * above. - * - * { - * "id" : "button-state", - * "type" : "ClutterState", - * "duration" : 500, - * "transitions" : [ - * { - * "source" : "*", - * "target" : "base", - * "keys" : [ - * [ "button", "color", "linear", "rgb(255, 0, 0)" ], - * [ "button", "scale-x", "easeInBounce", 1.0 ], - * [ "button", "scale-y", "easeInBounce", 1.0 ] - * ] - * }, - * { - * "source" : "base", - * "target" : "hover", - * "keys" : [ - * [ "button", "color", "linear", "rgb(0, 0, 255)" ], - * [ "button", "scale-x", "easeOutBounce", 1.7 ], - * [ "button", "scale-y", "easeOutBounce", 1.7 ] - * ] - * } - * ] - * } - * - * - * - * - * #ClutterState is available since Clutter 1.4. - * - * #ClutterState has been deprecated in Clutter 1.12. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#define CLUTTER_DISABLE_DEPRECATION_WARNINGS - -#include "clutter-state.h" - -#include "clutter-alpha.h" -#include "clutter-animatable.h" -#include "clutter-animator.h" -#include "clutter-enum-types.h" -#include "clutter-interval.h" -#include "clutter-marshal.h" -#include "clutter-private.h" -#include "clutter-scriptable.h" -#include "clutter-script-private.h" - -typedef struct StateAnimator { - const gchar *source_state_name; /* interned string identifying entry */ - ClutterAnimator *animator; /* pointer to animator itself */ -} StateAnimator; - -typedef struct State -{ - const gchar *name; /* interned string for this state name */ - GHashTable *durations; /* durations for transitions from various state - names */ - GList *keys; /* list of all keys pertaining to transitions - from other states to this one */ - GArray *animators; /* list of animators for transitioning from - * specific source states */ - ClutterState *clutter_state; /* the ClutterState object this state belongs to - */ -} State; - -struct _ClutterStatePrivate -{ - GHashTable *states; /* contains state objects */ - guint duration; /* global fallback duration */ - ClutterTimeline *timeline; /* The timeline used for doing the - progress */ - ClutterTimeline *slave_timeline; /* a slave timeline used to compute - alphas */ - const gchar *source_state_name; /* current source state */ - State *source_state; /* current source_state */ - const gchar *target_state_name; /* current target state */ - State *target_state; /* target state name */ - ClutterAnimator *current_animator; /* !NULL if the current transition is - overriden by an animator */ -}; - -#define SLAVE_TIMELINE_LENGTH 10000 - -/* - * ClutterStateKey: - * - * An opaque data structure with accessor functions. - * - */ -typedef struct _ClutterStateKey -{ - GObject *object; /* an Gobject */ - const gchar *property_name;/* the name of a property */ - gulong mode; /* alpha to use */ - GValue value; /* target value */ - gdouble pre_delay; /* fraction of duration to delay before - starting */ - gdouble pre_pre_delay;/* fraction of duration to add to - pre_delay. This is used to set keys - during transitions. */ - gdouble post_delay; /* fraction of duration to be done in */ - - State *source_state; /* source state */ - State *target_state; /* target state */ - - ClutterAlpha *alpha; /* The alpha this key uses for interpolation */ - ClutterInterval *interval; /* The interval this key uses for - interpolation */ - - guint is_animatable : 1; - guint is_inert : 1; /* set if the key is being destroyed due to - weak reference */ - gint ref_count; /* reference count for boxed life time */ -} _ClutterStateKey; - -enum -{ - PROP_0, - PROP_DURATION, - PROP_STATE, - - PROP_LAST -}; - -static GParamSpec *obj_props[PROP_LAST]; - -enum -{ - COMPLETED, - LAST_SIGNAL -}; - -static void clutter_scriptable_iface_init (ClutterScriptableIface *iface); - -static guint state_signals[LAST_SIGNAL] = {0, }; - -#define CLUTTER_STATE_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \ - CLUTTER_TYPE_STATE, \ - ClutterStatePrivate)) - -G_DEFINE_TYPE_WITH_CODE (ClutterState, clutter_state, G_TYPE_OBJECT, - G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_SCRIPTABLE, - clutter_scriptable_iface_init)); - -/** - * clutter_state_new: - * - * Creates a new #ClutterState - * - * Return value: the newly create #ClutterState instance - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition and - * #ClutterTransitionGroup instead - */ -ClutterState * -clutter_state_new (void) -{ - return g_object_new (CLUTTER_TYPE_STATE, NULL); -} - -static gint -sort_props_func (gconstpointer a, - gconstpointer b) -{ - const ClutterStateKey *pa = a; - const ClutterStateKey *pb = b; - - if (pa->object == pb->object) - { - gint propnamediff = pa->property_name-pb->property_name; - if (propnamediff == 0) - return pb->source_state - pa->source_state; - - return propnamediff; - } - - return pa->object - pb->object; -} - -static State * clutter_state_fetch_state (ClutterState *state, - const gchar *state_name, - gboolean force_creation); -static void object_disappeared (gpointer data, - GObject *where_the_object_was); - -static ClutterStateKey * -clutter_state_key_new (State *state, - GObject *object, - const gchar *property_name, - GParamSpec *pspec, - guint mode) -{ - ClutterStatePrivate *priv = state->clutter_state->priv; - ClutterStateKey *state_key; - GValue value = G_VALUE_INIT; - - state_key = g_slice_new0 (ClutterStateKey); - - state_key->target_state = state; - state_key->object = object; - state_key->property_name = g_intern_string (property_name); - state_key->mode = mode; - state_key->is_animatable = CLUTTER_IS_ANIMATABLE (object); - - state_key->alpha = clutter_alpha_new (); - g_object_ref_sink (state_key->alpha); - clutter_alpha_set_mode (state_key->alpha, mode); - clutter_alpha_set_timeline (state_key->alpha, priv->slave_timeline); - - state_key->interval = - g_object_new (CLUTTER_TYPE_INTERVAL, - "value-type", G_PARAM_SPEC_VALUE_TYPE (pspec), - NULL); - g_object_ref_sink (state_key->interval); - - g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec)); - clutter_interval_set_initial_value (state_key->interval, &value); - clutter_interval_set_final_value (state_key->interval, &value); - g_value_unset (&value); - - g_object_weak_ref (object, object_disappeared, - state_key->target_state->clutter_state); - - return state_key; -} - -static void -clutter_state_key_free (gpointer clutter_state_key) -{ - ClutterStateKey *key = clutter_state_key; - - if (key == NULL) - return; - - key->ref_count -= 1; - - if (key->ref_count > 0) - return; - - if (!key->is_inert) - { - g_object_weak_unref (key->object, - object_disappeared, - key->target_state->clutter_state); - } - - g_value_unset (&key->value); - - g_object_unref (key->alpha); - g_object_unref (key->interval); - - g_slice_free (ClutterStateKey, key); -} - - -static inline void -clutter_state_remove_key_internal (ClutterState *this, - const gchar *source_state_name, - const gchar *target_state_name, - GObject *object, - const gchar *property_name, - gboolean is_inert) -{ - GList *s, *state_list; - State *source_state = NULL; - - source_state_name = g_intern_string (source_state_name); - target_state_name = g_intern_string (target_state_name); - property_name = g_intern_string (property_name); - - if (source_state_name) - source_state = clutter_state_fetch_state (this, source_state_name, FALSE); - -again_from_start: - - if (target_state_name != NULL) - state_list = g_list_append (NULL, (gpointer) target_state_name); - else - state_list = clutter_state_get_states (this); - - for (s = state_list; s != NULL; s = s->next) - { - State *target_state; - target_state = clutter_state_fetch_state (this, s->data, FALSE); - /* Go through each TargetState */ - if (target_state) - { - GList *k = target_state->keys; - - /* Note the safe while() loop, because we modify the list inline */ - while (k != NULL) - { - ClutterStateKey *key = k->data; - - k = k->next; - - /* Check if each key matches query */ - if ( (object == NULL || (object == key->object)) - && (source_state == NULL || (source_state == key->source_state)) - && (property_name == NULL || ((property_name == key->property_name)))) - { - /* Remove matching key */ - target_state->keys = g_list_remove (target_state->keys, key); - key->is_inert = is_inert; - clutter_state_key_free (key); - - /* no more keys with transitions to this target_state*/ - if (target_state->keys == NULL) - { - /* If this state is the current state, unset the state */ - if (target_state == this->priv->target_state) - clutter_state_set_state (this, NULL); - - /* remove any keys that exist that uses this state as a source */ - clutter_state_remove_key_internal (this, s->data, NULL, NULL, NULL, is_inert); - - g_hash_table_remove (this->priv->states, s->data); - goto again_from_start; /* we have just freed State *target_state, so - need to restart removal */ - } - } - } - } - } - - g_list_free (state_list); -} - -static void -object_disappeared (gpointer data, - GObject *where_the_object_was) -{ - clutter_state_remove_key_internal (data, NULL, NULL, - (gpointer) where_the_object_was, - NULL, - TRUE); -} - - -static void -state_free (gpointer data) -{ - State *state = data; - - for (; state->keys; - state->keys = g_list_remove (state->keys, state->keys->data)) - clutter_state_key_free (state->keys->data); - - g_array_free (state->animators, TRUE); - g_hash_table_destroy (state->durations); - g_free (state); -} - -static State * -state_new (ClutterState *clutter_state, - const gchar *name) -{ - State *state; - - state = g_new0 (State, 1); - state->clutter_state = clutter_state; - state->name = name; - state->animators = g_array_new (TRUE, TRUE, sizeof (StateAnimator)); - state->durations = g_hash_table_new (g_direct_hash, g_direct_equal); - - return state; -} - -static void -clutter_state_finalize (GObject *object) -{ - ClutterStatePrivate *priv = CLUTTER_STATE (object)->priv; - - g_hash_table_destroy (priv->states); - - g_object_unref (priv->timeline); - g_object_unref (priv->slave_timeline); - - G_OBJECT_CLASS (clutter_state_parent_class)->finalize (object); -} - -static void -clutter_state_completed (ClutterTimeline *timeline, - ClutterState *state) -{ - ClutterStatePrivate *priv = state->priv; - - if (priv->current_animator) - { - clutter_animator_set_timeline (priv->current_animator, NULL); - priv->current_animator = NULL; - } - - g_signal_emit (state, state_signals[COMPLETED], 0); -} - -static void -clutter_state_new_frame (ClutterTimeline *timeline, - gint msecs, - ClutterState *state) -{ - ClutterStatePrivate *priv = state->priv; - GList *k; - gdouble progress; - const gchar *curprop = NULL; - GObject *curobj = NULL; - gboolean found_specific = FALSE; - - if (priv->current_animator) - return; - - progress = clutter_timeline_get_progress (timeline); - - for (k = priv->target_state->keys; k; k = k->next) - { - ClutterStateKey *key = k->data; - gdouble sub_progress; - - if ((curprop && !(curprop == key->property_name)) || - key->object != curobj) - { - curprop = key->property_name; - curobj = key->object; - found_specific = FALSE; - } - - if (!found_specific) - { - if (key->source_state != NULL && - key->source_state->name != NULL && - priv->source_state_name != NULL && - g_str_equal (priv->source_state_name, key->source_state->name)) - { - found_specific = TRUE; - } - - if (found_specific || key->source_state == NULL) - { - gdouble pre_delay = key->pre_delay + key->pre_pre_delay; - - sub_progress = (progress - pre_delay) - / (1.0 - (pre_delay + key->post_delay)); - - if (sub_progress >= 0.0) - { - if (sub_progress >= 1.0) - sub_progress = 1.0; - - clutter_timeline_advance (priv->slave_timeline, - sub_progress * SLAVE_TIMELINE_LENGTH); - sub_progress = clutter_alpha_get_alpha (key->alpha); - - if (key->is_animatable) - { - ClutterAnimatable *animatable; - GValue value = G_VALUE_INIT; - gboolean res; - - animatable = CLUTTER_ANIMATABLE (key->object); - - g_value_init (&value, clutter_state_key_get_property_type (key)); - - res = - clutter_animatable_interpolate_value (animatable, - key->property_name, - key->interval, - sub_progress, - &value); - - if (res) - clutter_animatable_set_final_state (animatable, - key->property_name, - &value); - - g_value_unset (&value); - } - else - { - const GValue *value; - - value = clutter_interval_compute (key->interval, sub_progress); - if (value != NULL) - g_object_set_property (key->object, key->property_name, value); - } - } - - /* XXX: should the target value of the default destination be - * used even when found a specific source_state key? - */ - } - } - } -} - - -static ClutterTimeline * -clutter_state_change (ClutterState *state, - const gchar *target_state_name, - gboolean animate) -{ - ClutterStatePrivate *priv; - ClutterAnimator *animator; - State *new_state; - guint duration; - GList *k; - - g_return_val_if_fail (CLUTTER_IS_STATE (state), NULL); - - priv = state->priv; - - /* If we've been asked to change state to NULL, reset the - * ClutterState to its initial state, but leave the keys - * alone. - */ - if (!target_state_name) - { - if (!priv->target_state) - return NULL; - - priv->source_state_name = priv->target_state_name = NULL; - priv->source_state = priv->target_state = NULL; - - clutter_timeline_stop (priv->timeline); - clutter_timeline_rewind (priv->timeline); - - if (priv->current_animator) - { - clutter_animator_set_timeline (priv->current_animator, NULL); - priv->current_animator = NULL; - } - - return NULL; - } - - target_state_name = g_intern_string (target_state_name); - - if (target_state_name == priv->target_state_name) - { - /* Avoid transitioning if the desired state is already current, - * unless we're warping to it and the state transition is in - * progress (in that case, immediately warp to the state). - */ - if (!clutter_timeline_is_playing (priv->timeline) || animate) - return priv->timeline; - } - - if (priv->current_animator != NULL) - { - clutter_animator_set_timeline (priv->current_animator, NULL); - priv->current_animator = NULL; - } - - priv->source_state_name = priv->target_state_name; - priv->target_state_name = target_state_name; - - g_object_notify_by_pspec (G_OBJECT (state), obj_props[PROP_STATE]); - - duration = clutter_state_get_duration (state, - priv->source_state_name, - priv->target_state_name); - clutter_timeline_set_duration (priv->timeline, duration); - - new_state = clutter_state_fetch_state (state, target_state_name, FALSE); - if (new_state == NULL) - { - g_warning ("State '%s' not found", target_state_name); - - return NULL; - } - - animator = clutter_state_get_animator (state, - priv->source_state_name, - priv->target_state_name); - priv->target_state = new_state; - - if (animator == NULL && new_state->keys == NULL) - animator = clutter_state_get_animator (state, NULL, - priv->target_state_name); - - if (animator != NULL) - { - /* we've got an animator overriding the tweened animation */ - priv->current_animator = animator; - clutter_animator_set_timeline (animator, priv->timeline); - } - else - { - for (k = new_state->keys; k != NULL; k = k->next) - { - ClutterStateKey *key = k->data; - GValue initial = G_VALUE_INIT; - - /* Reset the pre-pre-delay - this is only used for setting keys - * during transitions. - */ - key->pre_pre_delay = 0; - - g_value_init (&initial, clutter_interval_get_value_type (key->interval)); - - if (key->is_animatable) - { - ClutterAnimatable *animatable; - - animatable = CLUTTER_ANIMATABLE (key->object); - clutter_animatable_get_initial_state (animatable, - key->property_name, - &initial); - } - else - g_object_get_property (key->object, key->property_name, &initial); - - if (clutter_alpha_get_mode (key->alpha) != key->mode) - clutter_alpha_set_mode (key->alpha, key->mode); - - clutter_interval_set_initial_value (key->interval, &initial); - clutter_interval_set_final_value (key->interval, &key->value); - - g_value_unset (&initial); - } - } - - if (!animate) - { - clutter_timeline_stop (priv->timeline); - clutter_timeline_advance (priv->timeline, duration); - - /* emit signals, to change properties, and indicate that the - * state change is complete */ - g_signal_emit_by_name (priv->timeline, "new-frame", - GINT_TO_POINTER (duration), - NULL); - g_signal_emit_by_name (priv->timeline, "completed", NULL); - } - else - { - clutter_timeline_stop (priv->timeline); - clutter_timeline_rewind (priv->timeline); - clutter_timeline_start (priv->timeline); - } - - return priv->timeline; -} - -/** - * clutter_state_set_state: - * @state: a #ClutterState - * @target_state_name: the state to transition to - * - * Change the current state of #ClutterState to @target_state_name. - * - * The state will animate during its transition, see - * #clutter_state_warp_to_state for animation-free state switching. - * - * Setting a %NULL state will stop the current animation and unset - * the current state, but keys will be left intact. - * - * Return value: (transfer none): the #ClutterTimeline that drives the - * state transition. The returned timeline is owned by the #ClutterState - * and it should not be unreferenced - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition and - * #ClutterTransitionGroup instead - */ -ClutterTimeline * -clutter_state_set_state (ClutterState *state, - const gchar *target_state_name) -{ - return clutter_state_change (state, target_state_name, TRUE); -} - -/** - * clutter_state_warp_to_state: - * @state: a #ClutterState - * @target_state_name: the state to transition to - * - * Change to the specified target state immediately with no animation. - * - * See clutter_state_set_state(). - * - * Return value: (transfer none): the #ClutterTimeline that drives the - * state transition. The returned timeline is owned by the #ClutterState - * and it should not be unreferenced - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition and - * #ClutterTransitionGroup instead - */ -ClutterTimeline * -clutter_state_warp_to_state (ClutterState *state, - const gchar *target_state_name) -{ - return clutter_state_change (state, target_state_name, FALSE); -} - -static GParamSpec * -get_property_from_object (GObject *gobject, - const gchar *property_name) -{ - GParamSpec *pspec; - - if (CLUTTER_IS_ANIMATABLE (gobject)) - { - ClutterAnimatable *animatable = CLUTTER_ANIMATABLE (gobject); - - pspec = clutter_animatable_find_property (animatable, property_name); - } - else - { - GObjectClass *klass = G_OBJECT_GET_CLASS (gobject); - - pspec = g_object_class_find_property (klass, property_name); - } - - if (pspec == NULL) - { - g_warning ("Cannot bind property '%s': objects of type '%s' " - "do not have this property", - property_name, - G_OBJECT_TYPE_NAME (gobject)); - return NULL; - } - - if (!(pspec->flags & G_PARAM_WRITABLE)) - { - g_warning ("Cannot bind property '%s' of object of type '%s': " - "the property is not writable", - property_name, - G_OBJECT_TYPE_NAME (gobject)); - return NULL; - } - - if (!(pspec->flags & G_PARAM_READABLE)) - { - g_warning ("Cannot bind property '%s' of object of type '%s': " - "the property is not readable", - property_name, - G_OBJECT_TYPE_NAME (gobject)); - return NULL; - } - - if (pspec->flags & G_PARAM_CONSTRUCT_ONLY) - { - g_warning ("Cannot bind property '%s' of object of type '%s': " - "the property is set as constructor-only", - property_name, - G_OBJECT_TYPE_NAME (gobject)); - return NULL; - } - - return pspec; -} - -/** - * clutter_state_set: - * @state: a #ClutterState instance. - * @source_state_name: (allow-none): the name of the source state keys are being added for - * @target_state_name: the name of the target state keys are being added for - * @first_object: a #GObject - * @first_property_name: a property of @first_object to specify a key for - * @first_mode: the id of the alpha function to use - * @...: the value @first_property_name should have in @target_state_name, - * followed by object, property name, mode, value tuples, terminated - * by %NULL - * - * Adds multiple keys to a named state of a #ClutterState instance, specifying - * the easing mode and value a given property of an object should have at a - * given progress of the animation. - * - * The mode specified is the easing mode used when going to from the previous - * key to the specified key. - * - * For instance, the code below: - * - * |[ - * clutter_state_set (state, NULL, "hover", - * button, "opacity", CLUTTER_LINEAR, 255, - * button, "scale-x", CLUTTER_EASE_OUT_CUBIC, 1.2, - * button, "scale-y", CLUTTER_EASE_OUT_CUBIC, 1.2, - * NULL); - * ]| - * - * will create a transition from any state (a @source_state_name or NULL is - * treated as a wildcard) and a state named "hover"; the - * button object will have the #ClutterActor:opacity - * property animated to a value of 255 using %CLUTTER_LINEAR as the animation - * mode, and the #ClutterActor:scale-x and #ClutterActor:scale-y properties - * animated to a value of 1.2 using %CLUTTER_EASE_OUT_CUBIC as the animation - * mode. To change the state (and start the transition) you can use the - * clutter_state_set_state() function: - * - * |[ - * clutter_state_set_state (state, "hover"); - * ]| - * - * If a given object, state_name, property tuple already exist in the - * #ClutterState instance, then the mode and value will be replaced with - * the new specified values. - * - * If a property name is prefixed with "delayed::" two additional - * arguments per key are expected: a value relative to the full state time - * to pause before transitioning and a similar value to pause after - * transitioning, e.g.: - * - * |[ - * clutter_state_set (state, "hover", "toggled", - * button, "delayed::scale-x", CLUTTER_LINEAR, 1.0, 0.2, 0.2, - * button, "delayed::scale-y", CLUTTER_LINEAR, 1.0, 0.2, 0.2, - * NULL); - * ]| - * - * will pause for 20% of the duration of the transition before animating, - * and 20% of the duration after animating. - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition and - * #ClutterTransitionGroup instead - */ -void -clutter_state_set (ClutterState *state, - const gchar *source_state_name, - const gchar *target_state_name, - gpointer first_object, - const gchar *first_property_name, - gulong first_mode, - ...) -{ - gpointer object; - const gchar *property_name; - gulong mode; - va_list args; - - g_return_if_fail (CLUTTER_IS_STATE (state)); - - object = first_object; - - property_name = first_property_name; - mode = first_mode; - - g_return_if_fail (G_IS_OBJECT (first_object)); - g_return_if_fail (first_property_name); - - va_start (args, first_mode); - - while (object != NULL) - { - GParamSpec *pspec; - GValue value = G_VALUE_INIT; - gchar *error = NULL; - gboolean is_delayed = FALSE; - - if (g_str_has_prefix (property_name, "delayed::")) - { - property_name = strstr (property_name, "::") + 2; - is_delayed = TRUE; - } - - pspec = get_property_from_object (object, property_name); - if (pspec == NULL) - break; - - G_VALUE_COLLECT_INIT (&value, G_PARAM_SPEC_VALUE_TYPE (pspec), - args, 0, - &error); - - if (error != NULL) - { - g_warning ("%s: %s", G_STRLOC, error); - g_free (error); - break; - } - - if (is_delayed) - { - gdouble pre_delay = va_arg (args, gdouble); - gdouble post_delay = va_arg (args, gdouble); - - clutter_state_set_key (state, - source_state_name, - target_state_name, - object, - property_name, - mode, - &value, - pre_delay, - post_delay); - } - else - { - clutter_state_set_key (state, - source_state_name, - target_state_name, - object, - property_name, - mode, - &value, - 0.0, - 0.0); - } - - g_value_unset (&value); - - object = va_arg (args, gpointer); - if (object != NULL) - { - property_name = va_arg (args, gchar*); - mode = va_arg (args, gulong); - } - } - - va_end (args); -} - -static void -clutter_state_set_key_internal (ClutterState *state, - ClutterStateKey *key) -{ - ClutterStatePrivate *priv = state->priv; - State *target_state = key->target_state; - GList *old_item = NULL; - - if ((old_item = g_list_find_custom (target_state->keys, - key, - sort_props_func))) - { - ClutterStateKey *old_key = old_item->data; - - target_state->keys = g_list_remove (target_state->keys, old_key); - clutter_state_key_free (old_key); - } - - target_state->keys = g_list_insert_sorted (target_state->keys, - key, - sort_props_func); - - /* If the current target state is modified, we have some work to do. - * - * If the animation is running, we add a key to the current animation - * with a delay of the current duration so that the new animation will - * animate into place. - * - * If the animation isn't running, but the state is set, we immediately - * warp to that state. - */ - if (key->target_state == priv->target_state) - { - if (!clutter_timeline_is_playing (priv->timeline)) - { - /* We can warp to the state by setting a NULL state, then setting - * the target state again. - */ - clutter_state_change (state, NULL, FALSE); - clutter_state_change (state, target_state->name, FALSE); - } - else - { - /* Set the ClutterInterval associated with the state */ - GValue initial = G_VALUE_INIT; - gdouble progress = clutter_timeline_get_progress (priv->timeline); - - g_value_init (&initial, - clutter_interval_get_value_type (key->interval)); - - if (key->is_animatable) - { - ClutterAnimatable *animatable; - - animatable = CLUTTER_ANIMATABLE (key->object); - clutter_animatable_get_initial_state (animatable, - key->property_name, - &initial); - } - else - g_object_get_property (key->object, key->property_name, &initial); - - if (clutter_alpha_get_mode (key->alpha) != key->mode) - clutter_alpha_set_mode (key->alpha, key->mode); - - clutter_interval_set_initial_value (key->interval, &initial); - clutter_interval_set_final_value (key->interval, &key->value); - - g_value_unset (&initial); - - /* Set the delay as if the interval had just begun */ - if (progress > key->pre_delay) - key->pre_pre_delay = MIN (progress - key->pre_delay, - 1.0 - key->post_delay); - } - } -} - -/* - * clutter_state_fetch_state: - * @state: a #ClutterState - * @state_name: the name of the state to be retrieved - * @create: %TRUE if the state should be instantiated if not found - * - * Retrieves the #State structure for @state_name inside the given - * #ClutterState instance - * - * If @state_name is %NULL and @create is %TRUE then NULL will - * be returned. - * - * Return value: a #State structure for the given name, or %NULL - */ -static State * -clutter_state_fetch_state (ClutterState *state, - const gchar *state_name, - gboolean create) -{ - ClutterStatePrivate *priv = state->priv; - State *retval; - - if (state_name == NULL) - { - return NULL; - } - else - state_name = g_intern_string (state_name); - - retval = g_hash_table_lookup (priv->states, state_name); - if (retval == NULL && create) - { - retval = state_new (state, state_name); - g_hash_table_insert (priv->states, (gpointer) state_name, retval); - } - - return retval; -} - -/** - * clutter_state_set_key: - * @state: a #ClutterState instance. - * @source_state_name: (allow-none): the source transition to specify - * transition for, or %NULL to specify the default fallback when a - * more specific source state doesn't exist. - * @target_state_name: the name of the transition to set a key value for. - * @object: the #GObject to set a key for - * @property_name: the property to set a key for - * @mode: the id of the alpha function to use - * @value: the value for property_name of object in state_name - * @pre_delay: relative time of the transition to be idle in the beginning - * of the transition - * @post_delay: relative time of the transition to be idle in the end of - * the transition - * - * Sets one specific end key for a state name, @object, @property_name - * combination. - * - * Return value: (transfer none): the #ClutterState instance, allowing - * chaining of multiple calls - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition and - * #ClutterTransitionGroup instead - */ -ClutterState * -clutter_state_set_key (ClutterState *state, - const gchar *source_state_name, - const gchar *target_state_name, - GObject *object, - const gchar *property_name, - guint mode, - const GValue *value, - gdouble pre_delay, - gdouble post_delay) -{ - GParamSpec *pspec; - ClutterStateKey *state_key; - State *source_state = NULL; - State *target_state; - - g_return_val_if_fail (CLUTTER_IS_STATE (state), NULL); - g_return_val_if_fail (G_IS_OBJECT (object), NULL); - g_return_val_if_fail (property_name, NULL); - g_return_val_if_fail (value, NULL); - - pspec = get_property_from_object (object, property_name); - if (pspec == NULL) - return state; - - source_state = clutter_state_fetch_state (state, source_state_name, TRUE); - target_state = clutter_state_fetch_state (state, target_state_name, TRUE); - - property_name = g_intern_string (property_name); - state_key = clutter_state_key_new (target_state, - object, property_name, pspec, - mode); - - state_key->source_state = source_state; - state_key->pre_delay = pre_delay; - state_key->post_delay = post_delay; - - g_value_init (&state_key->value, G_VALUE_TYPE (value)); - g_value_copy (value, &state_key->value); - - clutter_state_set_key_internal (state, state_key); - - return state; -} - -/** - * clutter_state_get_states: - * @state: a #ClutterState instance. - * - * Gets a list of all the state names managed by this #ClutterState. - * - * Return value: (transfer container) (element-type utf8): a newly allocated - * #GList of state names. The contents of the returned #GList are owned - * by the #ClutterState and should not be modified or freed. Use - * g_list_free() to free the resources allocated by the returned list when - * done using it - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition and - * #ClutterTransitionGroup instead - */ -GList * -clutter_state_get_states (ClutterState *state) -{ - g_return_val_if_fail (CLUTTER_IS_STATE (state), NULL); - return g_hash_table_get_keys (state->priv->states); -} - -/** - * clutter_state_get_keys: - * @state: a #ClutterState instance. - * @source_state_name: (allow-none): the source transition name to query, - * or %NULL for all source states - * @target_state_name: (allow-none): the target transition name to query, - * or %NULL for all target states - * @object: (allow-none): the specific object instance to list keys for, - * or %NULL for all managed objects - * @property_name: (allow-none): the property name to search for, or %NULL - * for all properties. - * - * Returns a list of pointers to opaque structures with accessor functions - * that describe the keys added to an animator. - * - * Return value: (transfer container) (element-type Clutter.StateKey): a - * newly allocated #GList of #ClutterStateKeys. The contents of - * the returned list are owned by the #ClutterState and should not be - * modified or freed. Use g_list_free() to free the resources allocated - * by the returned list when done using it - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition and - * #ClutterTransitionGroup instead - */ -GList * -clutter_state_get_keys (ClutterState *state, - const gchar *source_state_name, - const gchar *target_state_name, - GObject *object, - const gchar *property_name) -{ - GList *s, *state_list; - GList *targets = NULL; - State *source_state = NULL; - - g_return_val_if_fail (CLUTTER_IS_STATE (state), NULL); - - source_state_name = g_intern_string (source_state_name); - target_state_name = g_intern_string (target_state_name); - property_name = g_intern_string (property_name); - - if (target_state_name != NULL) - state_list = g_list_append (NULL, (gpointer) target_state_name); - else - state_list = clutter_state_get_states (state); - - if (source_state_name) - source_state = clutter_state_fetch_state (state, source_state_name, FALSE); - - for (s = state_list; s != NULL; s = s->next) - { - State *target_state; - - target_state = clutter_state_fetch_state (state, s->data, FALSE); - if (target_state != NULL) - { - GList *k; - - for (k = target_state->keys; k; k = k->next) - { - ClutterStateKey *key = k->data; - - if ((object == NULL || (object == key->object)) && - (source_state_name == NULL || - source_state == key->source_state) && - (property_name == NULL || - (property_name == key->property_name))) - { - targets = g_list_prepend (targets, key); - } - } - } - } - - g_list_free (state_list); - - return g_list_reverse (targets); -} - - -/** - * clutter_state_remove_key: - * @state: a #ClutterState instance. - * @source_state_name: (allow-none): the source state name to query, - * or %NULL for all source states - * @target_state_name: (allow-none): the target state name to query, - * or %NULL for all target states - * @object: (allow-none): the specific object instance to list keys for, - * or %NULL for all managed objects - * @property_name: (allow-none): the property name to search for, - * or %NULL for all properties. - * - * Removes all keys matching the search criteria passed in arguments. - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition and - * #ClutterTransitionGroup instead - */ -void -clutter_state_remove_key (ClutterState *state, - const gchar *source_state_name, - const gchar *target_state_name, - GObject *object, - const gchar *property_name) -{ - g_return_if_fail (CLUTTER_IS_STATE (state)); - - clutter_state_remove_key_internal (state, - source_state_name, target_state_name, - object, property_name, - FALSE); -} - -/** - * clutter_state_get_timeline: - * @state: a #ClutterState - * - * Gets the timeline driving the #ClutterState - * - * Return value: (transfer none): the #ClutterTimeline that drives - * the state change animations. The returned timeline is owned - * by the #ClutterState and it should not be unreferenced directly - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition and - * #ClutterTransitionGroup instead - */ -ClutterTimeline * -clutter_state_get_timeline (ClutterState *state) -{ - g_return_val_if_fail (CLUTTER_IS_STATE (state), NULL); - - return state->priv->timeline; -} - - -static void -clutter_state_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - ClutterState *state = CLUTTER_STATE (object); - - switch (prop_id) - { - case PROP_STATE: - clutter_state_set_state (state, g_value_get_string (value)); - break; - case PROP_DURATION: - state->priv->duration = g_value_get_uint (value); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - } -} - -static void -clutter_state_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - ClutterState *state = CLUTTER_STATE (object); - switch (prop_id) - { - case PROP_STATE: - g_value_set_string (value, - clutter_state_get_state (state)); - break; - case PROP_DURATION: - g_value_set_uint (value, state->priv->duration); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - } -} - -static void -clutter_state_class_init (ClutterStateClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - GParamSpec *pspec; - - g_type_class_add_private (klass, sizeof (ClutterStatePrivate)); - - gobject_class->finalize = clutter_state_finalize; - gobject_class->set_property = clutter_state_set_property; - gobject_class->get_property = clutter_state_get_property; - - /** - * ClutterState::completed: - * @state: the #ClutterState that emitted the signal - * - * The ::completed signal is emitted when a #ClutterState reaches - * the target state specified by clutter_state_set_state() or - * clutter_state_warp_to_state(). - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition and - * #ClutterTransitionGroup instead - */ - state_signals[COMPLETED] = - g_signal_new (I_("completed"), - G_TYPE_FROM_CLASS (gobject_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ClutterStateClass, completed), - NULL, NULL, - _clutter_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - /** - * ClutterState:state: - * - * The currently set target state, setting it causes the - * state machine to transition to the new state, use - * clutter_state_warp_to_state() to change state without - * a transition. - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition and - * #ClutterTransitionGroup instead - */ - pspec = g_param_spec_string ("state", - P_("State"), - P_("Currently set state, (transition to this state might not be complete)"), - NULL, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_STATE] = pspec; - g_object_class_install_property (gobject_class, PROP_STATE, pspec); - - /** - * ClutterState:duration: - * - * Default duration used if an duration has not been specified for a specific - * source/target state pair. The values is in milliseconds. - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition and - * #ClutterTransitionGroup instead - */ - pspec = g_param_spec_uint ("duration", - P_("Duration"), - P_("Default transition duration"), - 0, 86400000, 1000, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_DURATION] = pspec; - g_object_class_install_property (gobject_class, PROP_DURATION, pspec); -} - -static void -clutter_state_init (ClutterState *self) -{ - ClutterStatePrivate *priv; - - priv = self->priv = CLUTTER_STATE_GET_PRIVATE (self); - - priv->states = g_hash_table_new_full (g_direct_hash, g_direct_equal, - NULL, - state_free); - - self->priv->source_state_name = NULL; - self->priv->target_state_name = NULL; - - self->priv->duration = 1000; - - priv->timeline = clutter_timeline_new (1000); - g_signal_connect (priv->timeline, "new-frame", - G_CALLBACK (clutter_state_new_frame), - self); - g_signal_connect (priv->timeline, "completed", - G_CALLBACK (clutter_state_completed), - self); - - priv->slave_timeline = clutter_timeline_new (SLAVE_TIMELINE_LENGTH); -} - - -/** - * clutter_state_get_animator: - * @state: a #ClutterState instance. - * @source_state_name: the name of a source state - * @target_state_name: the name of a target state - * - * Retrieves the #ClutterAnimator that is being used for transitioning - * between the two states, if any has been set - * - * Return value: (transfer none): a #ClutterAnimator instance, or %NULL - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition and - * #ClutterTransitionGroup instead - */ -ClutterAnimator * -clutter_state_get_animator (ClutterState *state, - const gchar *source_state_name, - const gchar *target_state_name) -{ - State *target_state; - guint i; - - g_return_val_if_fail (CLUTTER_IS_STATE (state), NULL); - - source_state_name = g_intern_string (source_state_name); - if (source_state_name == g_intern_static_string ("")) - source_state_name = NULL; - - target_state_name = g_intern_string (target_state_name); - - target_state = clutter_state_fetch_state (state, target_state_name, FALSE); - if (target_state == NULL) - return NULL; - - for (i = 0; i < target_state->animators->len; i++) - { - const StateAnimator *animator; - - animator = &g_array_index (target_state->animators, StateAnimator, i); - if (animator->source_state_name == source_state_name) - return animator->animator; - } - - return NULL; -} - -/** - * clutter_state_set_animator: - * @state: a #ClutterState instance. - * @source_state_name: the name of a source state - * @target_state_name: the name of a target state - * @animator: (allow-none): a #ClutterAnimator instance, or %NULL to - * unset an existing #ClutterAnimator - * - * Specifies a #ClutterAnimator to be used when transitioning between - * the two named states. - * - * The @animator allows specifying a transition between the state that is - * more elaborate than the basic transitions allowed by the tweening of - * properties defined in the #ClutterState keys. - * - * If @animator is %NULL it will unset an existing animator. - * - * #ClutterState will take a reference on the passed @animator, if any - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition and - * #ClutterTransitionGroup instead - */ -void -clutter_state_set_animator (ClutterState *state, - const gchar *source_state_name, - const gchar *target_state_name, - ClutterAnimator *animator) -{ - State *target_state; - guint i; - - g_return_if_fail (CLUTTER_IS_STATE (state)); - - source_state_name = g_intern_string (source_state_name); - target_state_name = g_intern_string (target_state_name); - - target_state = clutter_state_fetch_state (state, target_state_name, TRUE); - if (target_state == NULL) - return; - - for (i = 0; target_state->animators->len; i++) - { - StateAnimator *a; - - a = &g_array_index (target_state->animators, StateAnimator, i); - if (a->source_state_name == source_state_name) - { - g_object_unref (a->animator); - - if (animator != NULL) - a->animator = g_object_ref (animator); - else - { - /* remove the matched animator if passed NULL */ - g_array_remove_index (target_state->animators, i); - } - - return; - } - } - - if (animator != NULL) - { - StateAnimator state_animator = { - source_state_name, - g_object_ref (animator) - }; - - g_array_append_val (target_state->animators, state_animator); - } -} - -static gpointer -clutter_state_key_copy (gpointer boxed) -{ - if (boxed != NULL) - { - ClutterStateKey *key = boxed; - - key->ref_count += 1; - } - - return boxed; -} - -G_DEFINE_BOXED_TYPE (ClutterStateKey, clutter_state_key, - clutter_state_key_copy, - clutter_state_key_free); - -/** - * clutter_state_key_get_pre_delay: - * @state_key: a #ClutterStateKey - * - * Retrieves the pause before transitioning starts as a fraction of - * the total transition time. - * - * Return value: the pre delay used before starting the transition. - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition and - * #ClutterTransitionGroup instead - */ -gdouble -clutter_state_key_get_pre_delay (const ClutterStateKey *state_key) -{ - g_return_val_if_fail (state_key != NULL, 0.0); - - return state_key->pre_delay; -} - -/** - * clutter_state_key_get_post_delay: - * @state_key: a #ClutterStateKey - * - * Retrieves the duration of the pause after transitioning is complete - * as a fraction of the total transition time. - * - * Return value: the post delay, used after doing the transition. - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition and - * #ClutterTransitionGroup instead - */ -gdouble -clutter_state_key_get_post_delay (const ClutterStateKey *state_key) -{ - g_return_val_if_fail (state_key != NULL, 0.0); - - return state_key->post_delay; -} - -/** - * clutter_state_key_get_mode: - * @state_key: a #ClutterStateKey - * - * Retrieves the easing mode used for @state_key. - * - * Return value: the mode of a #ClutterStateKey - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition and - * #ClutterTransitionGroup instead - */ -gulong -clutter_state_key_get_mode (const ClutterStateKey *state_key) -{ - g_return_val_if_fail (state_key != NULL, 0); - - return state_key->mode; -} - -/** - * clutter_state_key_get_value: - * @state_key: a #ClutterStateKey - * @value: a #GValue initialized with the correct type for the @state_key - * - * Retrieves a copy of the value for a #ClutterStateKey. - * - * The #GValue needs to be already initialized for the value type - * of the property or to a type that allow transformation from the value - * type of the key. - * - * Use g_value_unset() when done. - * - * Return value: %TRUE if the value was successfully retrieved, - * and %FALSE otherwise - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition and - * #ClutterTransitionGroup instead - */ -gboolean -clutter_state_key_get_value (const ClutterStateKey *state_key, - GValue *value) -{ - g_return_val_if_fail (state_key != NULL, FALSE); - g_return_val_if_fail (value != NULL, FALSE); - g_return_val_if_fail (G_VALUE_TYPE (value) != G_TYPE_INVALID, FALSE); - - if (!g_type_is_a (G_VALUE_TYPE (&state_key->value), G_VALUE_TYPE (value))) - { - if (g_value_type_compatible (G_VALUE_TYPE (&state_key->value), - G_VALUE_TYPE (value))) - { - g_value_copy (&state_key->value, value); - return TRUE; - } - - if (g_value_type_transformable (G_VALUE_TYPE (&state_key->value), - G_VALUE_TYPE (value))) - { - if (g_value_transform (&state_key->value, value)) - return TRUE; - } - - g_warning ("%s: Unable to convert from %s to %s for the " - "property '%s' of object %s in the state key", - G_STRLOC, - g_type_name (G_VALUE_TYPE (&state_key->value)), - g_type_name (G_VALUE_TYPE (value)), - state_key->property_name, - G_OBJECT_TYPE_NAME (state_key->object)); - - return FALSE; - } - else - g_value_copy (&state_key->value, value); - - return TRUE; -} - -/** - * clutter_state_key_get_object: - * @state_key: a #ClutterStateKey - * - * Retrieves the object instance this #ClutterStateKey applies to. - * - * Return value: (transfer none): the object this state key applies to. - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition and - * #ClutterTransitionGroup instead - */ -GObject * -clutter_state_key_get_object (const ClutterStateKey *state_key) -{ - g_return_val_if_fail (state_key, NULL); - - return state_key->object; -} - -/** - * clutter_state_key_get_property_name: - * @state_key: a #ClutterStateKey - * - * Retrieves the name of the property this #ClutterStateKey applies to - * - * Return value: the name of the property. The returned string is owned - * by the #ClutterStateKey and should never be modified or freed - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition and - * #ClutterTransitionGroup instead - */ -const gchar * -clutter_state_key_get_property_name (const ClutterStateKey *state_key) -{ - g_return_val_if_fail (state_key, NULL); - - return state_key->property_name; -} - -/** - * clutter_state_key_get_source_state_name: - * @state_key: a #ClutterStateKey - * - * Retrieves the name of the source state of the @state_key - * - * Return value: the name of the source state for this key, or %NULL - * if this is the generic state key for the given property when - * transitioning to the target state. The returned string is owned - * by the #ClutterStateKey and should never be modified or freed - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition and - * #ClutterTransitionGroup instead - */ -const gchar * -clutter_state_key_get_source_state_name (const ClutterStateKey *state_key) -{ - g_return_val_if_fail (state_key, NULL); - - if (state_key->source_state != NULL) - return state_key->source_state->name; - - return NULL; -} - -/** - * clutter_state_key_get_target_state_name: - * @state_key: a #ClutterStateKey - * - * Get the name of the source state this #ClutterStateKey contains, - * or NULL if this is the generic state key for the given property - * when transitioning to the target state. - * - * Return value: the name of the source state for this key, or NULL if - * the key is generic - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition and - * #ClutterTransitionGroup instead - */ -const gchar * -clutter_state_key_get_target_state_name (const ClutterStateKey *state_key) -{ - g_return_val_if_fail (state_key, NULL); - - return state_key->target_state->name; -} - -/** - * clutter_state_key_get_property_type: - * @key: a #ClutterStateKey - * - * Retrieves the #GType of the property a key applies to - * - * You can use this type to initialize the #GValue to pass to - * clutter_state_key_get_value() - * - * Return value: the #GType of the property - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition and - * #ClutterTransitionGroup instead - */ -GType -clutter_state_key_get_property_type (const ClutterStateKey *key) -{ - g_return_val_if_fail (key != NULL, G_TYPE_INVALID); - - return G_VALUE_TYPE (&key->value); -} - - -/** - * clutter_state_set_duration: - * @state: a #ClutterState - * @source_state_name: (allow-none): the name of the source state, or %NULL - * @target_state_name: (allow-none): the name of the target state, or %NULL - * @duration: the duration of the transition, in milliseconds - * - * Sets the duration of a transition. - * - * If both state names are %NULL the default duration for @state is set. - * - * If only @target_state_name is specified, the passed @duration becomes - * the default duration for transitions to the target state. - * - * If both states names are specified, the passed @duration only applies - * to the specified transition. - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition and - * #ClutterTransitionGroup instead - */ -void -clutter_state_set_duration (ClutterState *state, - const gchar *source_state_name, - const gchar *target_state_name, - guint duration) -{ - State *target_state; - - g_return_if_fail (CLUTTER_IS_STATE (state)); - - source_state_name = g_intern_string (source_state_name); - if (source_state_name == g_intern_static_string ("")) - source_state_name = NULL; - - target_state_name = g_intern_string (target_state_name); - if (target_state_name == g_intern_static_string ("")) - target_state_name = NULL; - - if (target_state_name == NULL) - { - state->priv->duration = duration; - return; - } - - target_state = clutter_state_fetch_state (state, target_state_name, FALSE); - if (target_state != NULL) - { - if (source_state_name != NULL) - g_hash_table_insert (target_state->durations, - (gpointer) source_state_name, - GINT_TO_POINTER (duration)); - else - g_hash_table_insert (target_state->durations, - NULL, - GINT_TO_POINTER (duration)); - } -} - -/** - * clutter_state_get_duration: - * @state: a #ClutterState - * @source_state_name: (allow-none): the name of the source state to - * get the duration of, or %NULL - * @target_state_name: (allow-none): the name of the source state to - * get the duration of, or %NULL - * - * Queries the duration used for transitions between a source and - * target state pair - * - * The semantics for the query are the same as the semantics used for - * setting the duration with clutter_state_set_duration() - * - * Return value: the duration, in milliseconds - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition and - * #ClutterTransitionGroup instead - */ -guint -clutter_state_get_duration (ClutterState *state, - const gchar *source_state_name, - const gchar *target_state_name) -{ - State *target_state; - guint ret = 0; - - g_return_val_if_fail (CLUTTER_IS_STATE (state), 0); - - source_state_name = g_intern_string (source_state_name); - if (source_state_name == g_intern_static_string ("")) - source_state_name = NULL; - - target_state_name = g_intern_string (target_state_name); - if (target_state_name == g_intern_static_string ("")) - target_state_name = NULL; - - if (target_state_name == NULL) - return state->priv->duration; - - target_state = clutter_state_fetch_state (state, target_state_name, FALSE); - if (target_state != NULL) - { - if (source_state_name) - { - ret = GPOINTER_TO_INT (g_hash_table_lookup (target_state->durations, - source_state_name)); - if(!ret) - ret = GPOINTER_TO_INT (g_hash_table_lookup (target_state->durations, - NULL)); - } - else - ret = GPOINTER_TO_INT (g_hash_table_lookup (target_state->durations, - NULL)); - } - - if (!ret) - ret = state->priv->duration; - - return ret; -} - -/** - * clutter_state_get_state: - * @state: a #ClutterState - * - * Queries the currently set target state. - * - * During a transition this function will return the target of the transition. - * - * This function is useful when called from handlers of the - * #ClutterState::completed signal. - * - * Return value: a string containing the target state. The returned string - * is owned by the #ClutterState and should not be modified or freed - * - * - * Deprecated: 1.12: Use #ClutterKeyframeTransition and - * #ClutterTransitionGroup instead - */ -const gchar * -clutter_state_get_state (ClutterState *state) -{ - g_return_val_if_fail (CLUTTER_IS_STATE (state), NULL); - - return state->priv->target_state_name; -} - -typedef struct _ParseClosure { - ClutterState *state; - ClutterScript *script; - - GValue *value; - - gboolean result; -} ParseClosure; - -static void -parse_state_transition (JsonArray *array, - guint index_, - JsonNode *element, - gpointer data) -{ - ParseClosure *clos = data; - JsonObject *object; - const gchar *source_name, *target_name; - State *source_state, *target_state; - JsonArray *keys; - GSList *valid_keys = NULL; - GList *array_keys, *k; - - if (JSON_NODE_TYPE (element) != JSON_NODE_OBJECT) - { - g_warning ("The 'transitions' member of a ClutterState description " - "should be an array of objects, but the element %d of the " - "array is of type '%s'. The element will be ignored.", - index_, - json_node_type_name (element)); - return; - } - - object = json_node_get_object (element); - - if (!json_object_has_member (object, "source") || - !json_object_has_member (object, "target") || - !(json_object_has_member (object, "keys") || - json_object_has_member (object, "animator"))) - { - g_warning ("The transition description at index %d is missing one " - "of the mandatory members: source, target and keys or " - "animator", index_); - return; - } - - source_name = json_object_get_string_member (object, "source"); - source_state = clutter_state_fetch_state (clos->state, source_name, TRUE); - - target_name = json_object_get_string_member (object, "target"); - target_state = clutter_state_fetch_state (clos->state, target_name, TRUE); - - if (json_object_has_member (object, "duration")) - { - guint duration = json_object_get_int_member (object, "duration"); - - clutter_state_set_duration (clos->state, - source_name, target_name, - duration); - } - - if (json_object_has_member (object, "animator")) - { - const gchar *id_ = json_object_get_string_member (object, "animator"); - GObject *animator; - - animator = clutter_script_get_object (clos->script, id_); - if (animator == NULL) - { - g_warning ("No object with id '%s' has been defined.", id_); - return; - } - - clutter_state_set_animator (clos->state, - source_name, - target_name, - CLUTTER_ANIMATOR (animator)); - } - - if (!json_object_has_member (object, "keys")) - return; - - keys = json_object_get_array_member (object, "keys"); - if (keys == NULL && !json_object_has_member (object, "animator")) - { - g_warning ("The transition description at index %d has an invalid " - "key member of type '%s' when an array was expected.", - index_, - json_node_type_name (json_object_get_member (object, "keys"))); - return; - } - - if (G_IS_VALUE (clos->value)) - valid_keys = g_slist_reverse (g_value_get_pointer (clos->value)); - else - g_value_init (clos->value, G_TYPE_POINTER); - - array_keys = json_array_get_elements (keys); - for (k = array_keys; k != NULL; k = k->next) - { - JsonNode *node = k->data; - JsonArray *key = json_node_get_array (node); - ClutterStateKey *state_key; - GObject *gobject; - GParamSpec *pspec; - const gchar *id_; - const gchar *property; - gulong mode; - gboolean res; - - id_ = json_array_get_string_element (key, 0); - gobject = clutter_script_get_object (clos->script, id_); - if (gobject == NULL) - { - g_warning ("No object with id '%s' has been defined.", id_); - continue; - } - - property = json_array_get_string_element (key, 1); - pspec = get_property_from_object (gobject, property); - if (pspec == NULL) - { - g_warning ("The object of type '%s' and name '%s' has no " - "property named '%s'.", - G_OBJECT_TYPE_NAME (gobject), - id_, - property); - continue; - } - - mode = _clutter_script_resolve_animation_mode (json_array_get_element (key, 2)); - - state_key = clutter_state_key_new (target_state, - gobject, property, pspec, - mode); - - res = _clutter_script_parse_node (clos->script, - &(state_key->value), - property, - json_array_get_element (key, 3), - pspec); - if (!res) - { - g_warning ("Unable to parse the key value for the " - "property '%s' of object '%s' at index %d", - property, - id_, - index_); - clutter_state_key_free (state_key); - continue; - } - - switch (json_array_get_length (key)) - { - case 5: - state_key->pre_delay = json_array_get_double_element (key, 4); - state_key->post_delay = 0.0; - break; - - case 6: - state_key->pre_delay = json_array_get_double_element (key, 4); - state_key->post_delay = json_array_get_double_element (key, 5); - break; - - default: - state_key->pre_delay = 0.0; - state_key->post_delay = 0.0; - break; - } - - state_key->source_state = source_state; - - valid_keys = g_slist_prepend (valid_keys, state_key); - } - - g_list_free (array_keys); - - g_value_set_pointer (clos->value, g_slist_reverse (valid_keys)); - - clos->result = TRUE; -} - -static gboolean -clutter_state_parse_custom_node (ClutterScriptable *scriptable, - ClutterScript *script, - GValue *value, - const gchar *name, - JsonNode *node) -{ - ParseClosure clos; - - if (strcmp (name, "transitions") != 0) - return FALSE; - - if (JSON_NODE_TYPE (node) != JSON_NODE_ARRAY) - return FALSE; - - clos.state = CLUTTER_STATE (scriptable); - clos.script = script; - clos.value = value; - clos.result = FALSE; - - json_array_foreach_element (json_node_get_array (node), - parse_state_transition, - &clos); - - return clos.result; -} - -static void -clutter_state_set_custom_property (ClutterScriptable *scriptable, - ClutterScript *script, - const gchar *name, - const GValue *value) -{ - if (strcmp (name, "transitions") == 0) - { - ClutterState *state = CLUTTER_STATE (scriptable); - GSList *keys = g_value_get_pointer (value); - GSList *k; - - for (k = keys; k != NULL; k = k->next) - clutter_state_set_key_internal (state, k->data); - - g_slist_free (keys); - } - else - g_object_set_property (G_OBJECT (scriptable), name, value); -} - -static void -clutter_scriptable_iface_init (ClutterScriptableIface *iface) -{ - iface->parse_custom_node = clutter_state_parse_custom_node; - iface->set_custom_property = clutter_state_set_custom_property; -} diff --git a/clutter/deprecated/clutter-state.h b/clutter/deprecated/clutter-state.h deleted file mode 100644 index 6e7b361f8..000000000 --- a/clutter/deprecated/clutter-state.h +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Øyvind KolÃ¥s - * - * Copyright (C) 2009 Intel Corporation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#ifndef __CLUTTER_STATE_H__ -#define __CLUTTER_STATE_H__ - -#include - -G_BEGIN_DECLS - -#define CLUTTER_TYPE_STATE_KEY (clutter_state_key_get_type ()) -#define CLUTTER_TYPE_STATE (clutter_state_get_type ()) -#define CLUTTER_STATE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_STATE, ClutterState)) -#define CLUTTER_STATE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_STATE, ClutterStateClass)) -#define CLUTTER_IS_STATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_STATE)) -#define CLUTTER_IS_STATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_STATE)) -#define CLUTTER_STATE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_STATE, ClutterStateClass)) - -typedef struct _ClutterStatePrivate ClutterStatePrivate; -typedef struct _ClutterStateClass ClutterStateClass; - -/** - * ClutterStateKey: - * - * ClutterStateKey is an opaque structure whose - * members cannot be accessed directly - * - * - */ -typedef struct _ClutterStateKey ClutterStateKey; - -/** - * ClutterState: - * - * The ClutterState structure contains only - * private data and should be accessed using the provided API - * - * - */ -struct _ClutterState -{ - /*< private >*/ - GObject parent; - ClutterStatePrivate *priv; -}; - -/** - * ClutterStateClass: - * @completed: class handler for the #ClutterState::completed signal - * - * The ClutterStateClass structure contains - * only private data - * - * - * - * Deprecated: 1.12 - */ -struct _ClutterStateClass -{ - /*< private >*/ - GObjectClass parent_class; - - /*< public >*/ - void (* completed) (ClutterState *state); - - /*< private >*/ - /* padding for future expansion */ - gpointer _padding_dummy[8]; -}; - -CLUTTER_DEPRECATED_IN_1_12 -GType clutter_state_get_type (void) G_GNUC_CONST; - -CLUTTER_DEPRECATED_IN_1_12 -ClutterState *clutter_state_new (void); - - -CLUTTER_DEPRECATED_IN_1_12 -ClutterTimeline * clutter_state_set_state (ClutterState *state, - const gchar *target_state_name); -CLUTTER_DEPRECATED_IN_1_12 -ClutterTimeline * clutter_state_warp_to_state (ClutterState *state, - const gchar *target_state_name); -CLUTTER_DEPRECATED_IN_1_12 -ClutterState * clutter_state_set_key (ClutterState *state, - const gchar *source_state_name, - const gchar *target_state_name, - GObject *object, - const gchar *property_name, - guint mode, - const GValue *value, - gdouble pre_delay, - gdouble post_delay); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_state_set_duration (ClutterState *state, - const gchar *source_state_name, - const gchar *target_state_name, - guint duration); -CLUTTER_DEPRECATED_IN_1_12 -guint clutter_state_get_duration (ClutterState *state, - const gchar *source_state_name, - const gchar *target_state_name); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_state_set (ClutterState *state, - const gchar *source_state_name, - const gchar *target_state_name, - gpointer first_object, - const gchar *first_property_name, - gulong first_mode, - ...) G_GNUC_NULL_TERMINATED; -CLUTTER_DEPRECATED_IN_1_12 -GList * clutter_state_get_states (ClutterState *state); -CLUTTER_DEPRECATED_IN_1_12 -GList * clutter_state_get_keys (ClutterState *state, - const gchar *source_state_name, - const gchar *target_state_name, - GObject *object, - const gchar *property_name); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_state_remove_key (ClutterState *state, - const gchar *source_state_name, - const gchar *target_state_name, - GObject *object, - const gchar *property_name); -CLUTTER_DEPRECATED_IN_1_12 -ClutterTimeline * clutter_state_get_timeline (ClutterState *state); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_state_set_animator (ClutterState *state, - const gchar *source_state_name, - const gchar *target_state_name, - ClutterAnimator *animator); -CLUTTER_DEPRECATED_IN_1_12 -ClutterAnimator * clutter_state_get_animator (ClutterState *state, - const gchar *source_state_name, - const gchar *target_state_name); -CLUTTER_DEPRECATED_IN_1_12 -const gchar * clutter_state_get_state (ClutterState *state); - -/* - * ClutterStateKey - */ - -CLUTTER_DEPRECATED_IN_1_12 -GType clutter_state_key_get_type (void) G_GNUC_CONST; -CLUTTER_DEPRECATED_IN_1_12 -gdouble clutter_state_key_get_pre_delay (const ClutterStateKey *state_key); -CLUTTER_DEPRECATED_IN_1_12 -gdouble clutter_state_key_get_post_delay (const ClutterStateKey *state_key); -CLUTTER_DEPRECATED_IN_1_12 -gulong clutter_state_key_get_mode (const ClutterStateKey *state_key); -CLUTTER_DEPRECATED_IN_1_12 -gboolean clutter_state_key_get_value (const ClutterStateKey *state_key, - GValue *value); -CLUTTER_DEPRECATED_IN_1_12 -GType clutter_state_key_get_property_type (const ClutterStateKey *key); -CLUTTER_DEPRECATED_IN_1_12 -GObject * clutter_state_key_get_object (const ClutterStateKey *state_key); -CLUTTER_DEPRECATED_IN_1_12 -const gchar * clutter_state_key_get_property_name (const ClutterStateKey *state_key); -CLUTTER_DEPRECATED_IN_1_12 -const gchar * clutter_state_key_get_source_state_name (const ClutterStateKey *state_key); -CLUTTER_DEPRECATED_IN_1_12 -const gchar * clutter_state_key_get_target_state_name (const ClutterStateKey *state_key); - -G_END_DECLS - -#endif /* __CLUTTER_STATE_H__ */ diff --git a/clutter/deprecated/clutter-texture.c b/clutter/deprecated/clutter-texture.c deleted file mode 100644 index bf60ac4b6..000000000 --- a/clutter/deprecated/clutter-texture.c +++ /dev/null @@ -1,3156 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * Copyright (C) 2006 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - * - */ - -/** - * SECTION:clutter-texture - * @short_description: An actor for displaying and manipulating images. - * - * #ClutterTexture is a base class for displaying and manipulating pixel - * buffer type data. - * - * The clutter_texture_set_from_rgb_data() and - * clutter_texture_set_from_file() functions are used to copy image - * data into texture memory and subsequently realize the texture. - * - * Note: a ClutterTexture will scale its contents to fit the bounding - * box requested using clutter_actor_set_size(). To display an area of - * a texture without scaling, you should set the clip area using - * clutter_actor_set_clip(). - * - * The #ClutterTexture API is deprecated since Clutter 1.12. It is strongly - * recommended to use #ClutterImage instead. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -/* This file depends on the glib enum types which aren't exposed - * by cogl.h when COGL_ENABLE_EXPERIMENTAL_2_0_API is defined. - * - * Undefining COGL_ENABLE_EXPERIMENTAL_2_0_API will still expose - * us experimental api but will also expose Cogl 1.x api too... - */ -#undef COGL_ENABLE_EXPERIMENTAL_2_0_API -#include - -#define CLUTTER_ENABLE_EXPERIMENTAL_API - -/* sadly, we are still using ClutterShader internally */ -#define CLUTTER_DISABLE_DEPRECATION_WARNINGS - -#include "clutter-texture.h" - -#include "clutter-actor-private.h" -#include "clutter-color.h" -#include "clutter-debug.h" -#include "clutter-enum-types.h" -#include "clutter-feature.h" -#include "clutter-main.h" -#include "clutter-marshal.h" -#include "clutter-private.h" -#include "clutter-scriptable.h" -#include "clutter-stage-private.h" - -#include "deprecated/clutter-shader.h" -#include "deprecated/clutter-texture.h" -#include "deprecated/clutter-util.h" - -static void clutter_scriptable_iface_init (ClutterScriptableIface *iface); - -G_DEFINE_TYPE_WITH_CODE (ClutterTexture, - clutter_texture, - CLUTTER_TYPE_ACTOR, - G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_SCRIPTABLE, - clutter_scriptable_iface_init)); - -#define CLUTTER_TEXTURE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_TEXTURE, ClutterTexturePrivate)) - -typedef struct _ClutterTextureAsyncData ClutterTextureAsyncData; - -struct _ClutterTexturePrivate -{ - gint image_width; - gint image_height; - - CoglPipeline *pipeline; - - ClutterActor *fbo_source; - CoglHandle fbo_handle; - - CoglPipeline *pick_pipeline; - - gchar *filename; - - ClutterTextureAsyncData *async_data; - - guint no_slice : 1; - guint sync_actor_size : 1; - guint repeat_x : 1; - guint repeat_y : 1; - guint keep_aspect_ratio : 1; - guint load_size_async : 1; - guint load_data_async : 1; - guint load_async_set : 1; /* used to make load_async possible */ - guint pick_with_alpha : 1; - guint pick_with_alpha_supported : 1; - guint seen_create_pick_pipeline_warning : 1; -}; - -#define ASYNC_STATE_LOCKED 1 -#define ASYNC_STATE_CANCELLED 2 -#define ASYNC_STATE_QUEUED 3 - -struct _ClutterTextureAsyncData -{ - /* The texture for which the data is being loaded */ - ClutterTexture *texture; - - gchar *load_filename; - CoglHandle load_bitmap; - - guint load_idle; - - GError *load_error; - - gint state; -}; - -static inline void -clutter_texture_async_data_lock (ClutterTextureAsyncData *data) -{ - g_bit_lock (&data->state, 0); -} - -static inline void -clutter_texture_async_data_unlock (ClutterTextureAsyncData *data) -{ - g_bit_unlock (&data->state, 0); -} - -enum -{ - PROP_0, - PROP_NO_SLICE, - PROP_MAX_TILE_WASTE, - PROP_PIXEL_FORMAT, - PROP_SYNC_SIZE, - PROP_REPEAT_Y, - PROP_REPEAT_X, - PROP_FILTER_QUALITY, - PROP_COGL_TEXTURE, - PROP_COGL_MATERIAL, - PROP_FILENAME, - PROP_KEEP_ASPECT_RATIO, - PROP_LOAD_ASYNC, - PROP_LOAD_DATA_ASYNC, - PROP_PICK_WITH_ALPHA, - - PROP_LAST -}; - -static GParamSpec *obj_props[PROP_LAST]; - -enum -{ - SIZE_CHANGE, - PIXBUF_CHANGE, - LOAD_SUCCESS, - LOAD_FINISHED, - LAST_SIGNAL -}; - -static int texture_signals[LAST_SIGNAL] = { 0 }; - -static GThreadPool *async_thread_pool = NULL; -static guint repaint_upload_func = 0; -static GList *upload_list = NULL; -static GMutex upload_list_mutex; - -static CoglPipeline *texture_template_pipeline = NULL; - -static void -texture_fbo_free_resources (ClutterTexture *texture); - -GQuark -clutter_texture_error_quark (void) -{ - return g_quark_from_static_string ("clutter-texture-error-quark"); -} - -static const struct -{ - gint min_filter; - gint mag_filter; -} -clutter_texture_quality_filters[] = - { - /* CLUTTER_TEXTURE_QUALITY_LOW */ - { COGL_PIPELINE_FILTER_NEAREST, COGL_PIPELINE_FILTER_NEAREST }, - - /* CLUTTER_TEXTURE_QUALITY_MEDIUM */ - { COGL_PIPELINE_FILTER_LINEAR, COGL_PIPELINE_FILTER_LINEAR }, - - /* CLUTTER_TEXTURE_QUALITY_HIGH */ - { COGL_PIPELINE_FILTER_LINEAR_MIPMAP_LINEAR, COGL_PIPELINE_FILTER_LINEAR } - }; - -static inline void -clutter_texture_quality_to_filters (ClutterTextureQuality quality, - gint *min_filter_p, - gint *mag_filter_p) -{ - g_return_if_fail (quality < G_N_ELEMENTS (clutter_texture_quality_filters)); - - if (min_filter_p) - *min_filter_p = clutter_texture_quality_filters[quality].min_filter; - - if (mag_filter_p) - *mag_filter_p = clutter_texture_quality_filters[quality].mag_filter; -} - -static void -texture_free_gl_resources (ClutterTexture *texture) -{ - ClutterTexturePrivate *priv = texture->priv; - - if (priv->pipeline != NULL) - { - /* We want to keep the layer so that the filter settings will - remain but we want to free its resources so we clear the - texture handle */ - cogl_pipeline_set_layer_texture (priv->pipeline, 0, NULL); - } -} - -static void -clutter_texture_unrealize (ClutterActor *actor) -{ - ClutterTexture *texture; - ClutterTexturePrivate *priv; - - texture = CLUTTER_TEXTURE(actor); - priv = texture->priv; - - if (priv->pipeline == NULL) - return; - - if (priv->fbo_source != NULL) - { - /* Free up our fbo handle and texture resources, realize will recreate */ - cogl_object_unref (priv->fbo_handle); - priv->fbo_handle = NULL; - texture_free_gl_resources (texture); - return; - } - - CLUTTER_NOTE (TEXTURE, "Texture unrealized"); -} - -static void -clutter_texture_realize (ClutterActor *actor) -{ - ClutterTexture *texture; - ClutterTexturePrivate *priv; - - texture = CLUTTER_TEXTURE(actor); - priv = texture->priv; - - if (priv->fbo_source) - { - CoglTextureFlags flags = COGL_TEXTURE_NONE; - CoglHandle tex; - - /* Handle FBO's */ - - if (priv->no_slice) - flags |= COGL_TEXTURE_NO_SLICING; - - tex = cogl_texture_new_with_size (priv->image_width, - priv->image_height, - flags, - COGL_PIXEL_FORMAT_RGBA_8888_PRE); - - cogl_pipeline_set_layer_texture (priv->pipeline, 0, tex); - - priv->fbo_handle = cogl_offscreen_new_to_texture (tex); - - /* The pipeline now has a reference to the texture so it will - stick around */ - cogl_object_unref (tex); - - if (priv->fbo_handle == NULL) - { - g_warning ("%s: Offscreen texture creation failed", G_STRLOC); - CLUTTER_ACTOR_UNSET_FLAGS (actor, CLUTTER_ACTOR_REALIZED); - return; - } - - clutter_actor_set_size (actor, priv->image_width, priv->image_height); - - return; - } - - /* If the texture is not a FBO, then realization is a no-op but we - * still want to be in REALIZED state to maintain invariants. - * ClutterTexture doesn't need to be realized to have a Cogl texture - * because Clutter assumes that a GL context is always current so - * there is no need to wait to realization time to create the - * texture. Although this is slightly odd it would be wasteful to - * redundantly store a copy of the texture data in local memory just - * so that we can make a texture during realize. - */ - - CLUTTER_NOTE (TEXTURE, "Texture realized"); -} - -static void -clutter_texture_get_preferred_width (ClutterActor *self, - gfloat for_height, - gfloat *min_width_p, - gfloat *natural_width_p) -{ - ClutterTexture *texture = CLUTTER_TEXTURE (self); - ClutterTexturePrivate *priv = texture->priv; - - /* Min request is always 0 since we can scale down or clip */ - if (min_width_p) - *min_width_p = 0; - - if (priv->sync_actor_size) - { - if (natural_width_p) - { - if (!priv->keep_aspect_ratio || - for_height < 0 || - priv->image_height <= 0) - { - *natural_width_p = priv->image_width; - } - else - { - /* Set the natural width so as to preserve the aspect ratio */ - gfloat ratio = (gfloat) priv->image_width - / (gfloat) priv->image_height; - - *natural_width_p = ratio * for_height; - } - } - } - else - { - if (natural_width_p) - *natural_width_p = 0; - } -} - -static void -clutter_texture_get_preferred_height (ClutterActor *self, - gfloat for_width, - gfloat *min_height_p, - gfloat *natural_height_p) -{ - ClutterTexture *texture = CLUTTER_TEXTURE (self); - ClutterTexturePrivate *priv = texture->priv; - - /* Min request is always 0 since we can scale down or clip */ - if (min_height_p) - *min_height_p = 0; - - if (priv->sync_actor_size) - { - if (natural_height_p) - { - if (!priv->keep_aspect_ratio || - for_width < 0 || - priv->image_width <= 0) - { - *natural_height_p = priv->image_height; - } - else - { - /* Set the natural height so as to preserve the aspect ratio */ - gfloat ratio = (gfloat) priv->image_height - / (gfloat) priv->image_width; - - *natural_height_p = ratio * for_width; - } - } - } - else - { - if (natural_height_p) - *natural_height_p = 0; - } -} - -static void -clutter_texture_allocate (ClutterActor *self, - const ClutterActorBox *box, - ClutterAllocationFlags flags) -{ - ClutterTexturePrivate *priv = CLUTTER_TEXTURE (self)->priv; - - /* chain up to set actor->allocation */ - CLUTTER_ACTOR_CLASS (clutter_texture_parent_class)->allocate (self, - box, - flags); - - /* If we adopted the source fbo then allocate that at its preferred - size */ - if (priv->fbo_source && clutter_actor_get_parent (priv->fbo_source) == self) - clutter_actor_allocate_preferred_size (priv->fbo_source, flags); -} - -static gboolean -clutter_texture_has_overlaps (ClutterActor *self) -{ - /* Textures never need an offscreen redirect because there are never - any overlapping primitives */ - return FALSE; -} - -static void -set_viewport_with_buffer_under_fbo_source (ClutterActor *fbo_source, - int viewport_width, - int viewport_height) -{ - ClutterActorBox box = { 0, }; - float x_offset, y_offset; - - if (clutter_actor_get_paint_box (fbo_source, &box)) - clutter_actor_box_get_origin (&box, &x_offset, &y_offset); - else - { - /* As a fallback when the paint box can't be determined we use - * the transformed allocation to come up with an offset instead. - * - * FIXME: when we don't have a paint box we should instead be - * falling back to a stage sized fbo with an offset of (0,0) - */ - - ClutterVertex verts[4]; - float x_min = G_MAXFLOAT, y_min = G_MAXFLOAT; - int i; - - /* Get the actors allocation transformed into screen coordinates. - * - * XXX: Note: this may not be a bounding box for the actor, since an - * actor with depth may escape the box due to its perspective - * projection. */ - clutter_actor_get_abs_allocation_vertices (fbo_source, verts); - - for (i = 0; i < G_N_ELEMENTS (verts); ++i) - { - if (verts[i].x < x_min) - x_min = verts[i].x; - if (verts[i].y < y_min) - y_min = verts[i].y; - } - - /* XXX: It's not good enough to round by simply truncating the fraction here - * via a cast, as it results in offscreen rendering being offset by 1 pixel - * in many cases... */ -#define ROUND(x) ((x) >= 0 ? (long)((x) + 0.5) : (long)((x) - 0.5)) - - x_offset = ROUND (x_min); - y_offset = ROUND (y_min); - -#undef ROUND - } - - /* translate the viewport so that the source actor lands on the - * sub-region backed by the offscreen framebuffer... */ - cogl_set_viewport (-x_offset, -y_offset, viewport_width, viewport_height); -} - -static void -update_fbo (ClutterActor *self) -{ - ClutterTexture *texture = CLUTTER_TEXTURE (self); - ClutterTexturePrivate *priv = texture->priv; - ClutterActor *head; - ClutterShader *shader = NULL; - ClutterActor *stage = NULL; - CoglMatrix projection; - CoglColor transparent_col; - - head = _clutter_context_peek_shader_stack (); - if (head != NULL) - shader = clutter_actor_get_shader (head); - - /* Temporarily turn off the shader on the top of the context's - * shader stack, to restore the GL pipeline to it's natural state. - */ - if (shader != NULL) - clutter_shader_set_is_enabled (shader, FALSE); - - /* Redirect drawing to the fbo */ - cogl_push_framebuffer (priv->fbo_handle); - - if ((stage = clutter_actor_get_stage (self)) != NULL) - { - gfloat stage_width, stage_height; - ClutterActor *source_parent; - - /* We copy the projection and modelview matrices from the stage to - * the offscreen framebuffer and create a viewport larger than the - * offscreen framebuffer - the same size as the stage. - * - * The fbo source actor gets rendered into this stage size viewport at the - * same position it normally would after applying all it's usual parent - * transforms and it's own scale and rotate transforms etc. - * - * The viewport is offset such that the offscreen buffer will be positioned - * under the actor. - */ - - _clutter_stage_get_projection_matrix (CLUTTER_STAGE (stage), &projection); - - /* Set the projection matrix modelview matrix as it is for the - * stage... */ - cogl_set_projection_matrix (&projection); - - clutter_actor_get_size (stage, &stage_width, &stage_height); - - /* Set a negatively offset the viewport so that the offscreen - * framebuffer is position underneath the fbo_source actor... */ - set_viewport_with_buffer_under_fbo_source (priv->fbo_source, - stage_width, - stage_height); - - /* Apply the source's parent transformations to the modelview */ - if ((source_parent = clutter_actor_get_parent (priv->fbo_source))) - { - CoglMatrix modelview; - cogl_matrix_init_identity (&modelview); - _clutter_actor_apply_relative_transformation_matrix (source_parent, - NULL, - &modelview); - cogl_set_modelview_matrix (&modelview); - } - } - - - /* cogl_clear is called to clear the buffers */ - cogl_color_init_from_4ub (&transparent_col, 0, 0, 0, 0); - cogl_clear (&transparent_col, - COGL_BUFFER_BIT_COLOR | - COGL_BUFFER_BIT_DEPTH); - - /* Render the actor to the fbo */ - clutter_actor_paint (priv->fbo_source); - - /* Restore drawing to the previous framebuffer */ - cogl_pop_framebuffer (); - - /* If there is a shader on top of the shader stack, turn it back on. */ - if (shader != NULL) - clutter_shader_set_is_enabled (shader, TRUE); -} - -static void -gen_texcoords_and_draw_cogl_rectangle (ClutterActor *self) -{ - ClutterTexture *texture = CLUTTER_TEXTURE (self); - ClutterTexturePrivate *priv = texture->priv; - ClutterActorBox box; - float t_w, t_h; - - clutter_actor_get_allocation_box (self, &box); - - if (priv->repeat_x && priv->image_width > 0) - t_w = (box.x2 - box.x1) / (float) priv->image_width; - else - t_w = 1.0; - - if (priv->repeat_y && priv->image_height > 0) - t_h = (box.y2 - box.y1) / (float) priv->image_height; - else - t_h = 1.0; - - cogl_rectangle_with_texture_coords (0, 0, - box.x2 - box.x1, - box.y2 - box.y1, - 0, 0, t_w, t_h); -} - -static CoglPipeline * -create_pick_pipeline (ClutterActor *self) -{ - ClutterTexture *texture = CLUTTER_TEXTURE (self); - ClutterTexturePrivate *priv = texture->priv; - CoglPipeline *pick_pipeline = cogl_pipeline_copy (texture_template_pipeline); - GError *error = NULL; - - if (!cogl_pipeline_set_layer_combine (pick_pipeline, 0, - "RGBA = " - " MODULATE (CONSTANT, TEXTURE[A])", - &error)) - { - if (!priv->seen_create_pick_pipeline_warning) - g_warning ("Error setting up texture combine for shaped " - "texture picking: %s", error->message); - priv->seen_create_pick_pipeline_warning = TRUE; - g_error_free (error); - cogl_object_unref (pick_pipeline); - return NULL; - } - - cogl_pipeline_set_blend (pick_pipeline, - "RGBA = ADD (SRC_COLOR[RGBA], 0)", - NULL); - - cogl_pipeline_set_alpha_test_function (pick_pipeline, - COGL_PIPELINE_ALPHA_FUNC_EQUAL, - 1.0); - - return pick_pipeline; -} - -static void -clutter_texture_pick (ClutterActor *self, - const ClutterColor *color) -{ - ClutterTexture *texture = CLUTTER_TEXTURE (self); - ClutterTexturePrivate *priv = texture->priv; - - if (!clutter_actor_should_pick_paint (self)) - return; - - if (G_LIKELY (priv->pick_with_alpha_supported) && priv->pick_with_alpha) - { - CoglColor pick_color; - - if (priv->pick_pipeline == NULL) - priv->pick_pipeline = create_pick_pipeline (self); - - if (priv->pick_pipeline == NULL) - { - priv->pick_with_alpha_supported = FALSE; - CLUTTER_ACTOR_CLASS (clutter_texture_parent_class)->pick (self, - color); - return; - } - - if (priv->fbo_handle != NULL) - update_fbo (self); - - cogl_color_init_from_4ub (&pick_color, - color->red, - color->green, - color->blue, - 0xff); - cogl_pipeline_set_layer_combine_constant (priv->pick_pipeline, - 0, &pick_color); - cogl_pipeline_set_layer_texture (priv->pick_pipeline, 0, - clutter_texture_get_cogl_texture (texture)); - cogl_set_source (priv->pick_pipeline); - gen_texcoords_and_draw_cogl_rectangle (self); - } - else - CLUTTER_ACTOR_CLASS (clutter_texture_parent_class)->pick (self, color); -} - -static void -clutter_texture_paint (ClutterActor *self) -{ - ClutterTexture *texture = CLUTTER_TEXTURE (self); - ClutterTexturePrivate *priv = texture->priv; - guint8 paint_opacity = clutter_actor_get_paint_opacity (self); - - CLUTTER_NOTE (PAINT, - "painting texture '%s'", - clutter_actor_get_name (self) ? clutter_actor_get_name (self) - : "unknown"); - - if (priv->fbo_handle != NULL) - update_fbo (self); - - cogl_pipeline_set_color4ub (priv->pipeline, - paint_opacity, - paint_opacity, - paint_opacity, - paint_opacity); - cogl_set_source (priv->pipeline); - - gen_texcoords_and_draw_cogl_rectangle (self); -} - -static gboolean -clutter_texture_get_paint_volume (ClutterActor *self, - ClutterPaintVolume *volume) -{ - ClutterTexturePrivate *priv; - - priv = CLUTTER_TEXTURE (self)->priv; - - if (priv->pipeline == NULL) - return FALSE; - - if (priv->image_width == 0 || priv->image_height == 0) - return FALSE; - - return _clutter_actor_set_default_paint_volume (self, - CLUTTER_TYPE_TEXTURE, - volume); -} - -static void -clutter_texture_async_data_free (ClutterTextureAsyncData *data) -{ - /* This function should only be called either from the main thread - once it is known that the load thread has completed or from the - load thread/upload function itself if the abort flag is true (in - which case the main thread has disowned the data) */ - g_free (data->load_filename); - - if (data->load_bitmap != NULL) - cogl_object_unref (data->load_bitmap); - - if (data->load_error != NULL) - g_error_free (data->load_error); - - g_slice_free (ClutterTextureAsyncData, data); -} - -/* - * clutter_texture_async_load_cancel: - * @texture: a #ClutterTexture - * - * Cancels an asynchronous loading operation, whether done - * with threads enabled or just using the main loop - */ -static void -clutter_texture_async_load_cancel (ClutterTexture *texture) -{ - ClutterTexturePrivate *priv = texture->priv; - - if (priv->async_data != NULL) - { - ClutterTextureAsyncData *async_data = priv->async_data; - - priv->async_data = NULL; - - if (async_data->load_idle != 0) - { - g_source_remove (async_data->load_idle); - async_data->load_idle = 0; - - clutter_texture_async_data_free (async_data); - } - else - { - clutter_texture_async_data_lock (async_data); - - CLUTTER_NOTE (TEXTURE, "[async] cancelling operation for '%s'", - async_data->load_filename); - - async_data->state |= ASYNC_STATE_CANCELLED; - - clutter_texture_async_data_unlock (async_data); - } - } -} - -static void -clutter_texture_dispose (GObject *object) -{ - ClutterTexture *texture = CLUTTER_TEXTURE (object); - ClutterTexturePrivate *priv = texture->priv; - - texture_free_gl_resources (texture); - texture_fbo_free_resources (texture); - - clutter_texture_async_load_cancel (texture); - - if (priv->pipeline != NULL) - { - cogl_object_unref (priv->pipeline); - priv->pipeline = NULL; - } - - if (priv->pick_pipeline != NULL) - { - cogl_object_unref (priv->pick_pipeline); - priv->pick_pipeline = NULL; - } - - G_OBJECT_CLASS (clutter_texture_parent_class)->dispose (object); -} - -static void -clutter_texture_finalize (GObject *object) -{ - ClutterTexturePrivate *priv = CLUTTER_TEXTURE (object)->priv; - - g_free (priv->filename); - - G_OBJECT_CLASS (clutter_texture_parent_class)->finalize (object); -} - -static void -clutter_texture_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - ClutterTexture *texture; - ClutterTexturePrivate *priv; - - texture = CLUTTER_TEXTURE (object); - priv = texture->priv; - - switch (prop_id) - { - case PROP_SYNC_SIZE: - clutter_texture_set_sync_size (texture, g_value_get_boolean (value)); - break; - - case PROP_REPEAT_X: - clutter_texture_set_repeat (texture, - g_value_get_boolean (value), - priv->repeat_y); - break; - - case PROP_REPEAT_Y: - clutter_texture_set_repeat (texture, - priv->repeat_x, - g_value_get_boolean (value)); - break; - - case PROP_FILTER_QUALITY: - clutter_texture_set_filter_quality (texture, - g_value_get_enum (value)); - break; - - case PROP_COGL_TEXTURE: - { - CoglHandle hnd = g_value_get_boxed (value); - - clutter_texture_set_cogl_texture (texture, hnd); - } - break; - - case PROP_COGL_MATERIAL: - { - CoglHandle hnd = g_value_get_boxed (value); - - clutter_texture_set_cogl_material (texture, hnd); - } - break; - - case PROP_FILENAME: - clutter_texture_set_from_file (texture, - g_value_get_string (value), - NULL); - break; - - case PROP_NO_SLICE: - priv->no_slice = g_value_get_boolean (value); - break; - - case PROP_KEEP_ASPECT_RATIO: - clutter_texture_set_keep_aspect_ratio (texture, - g_value_get_boolean (value)); - break; - - case PROP_LOAD_DATA_ASYNC: - clutter_texture_set_load_data_async (texture, - g_value_get_boolean (value)); - break; - - case PROP_LOAD_ASYNC: - clutter_texture_set_load_async (texture, g_value_get_boolean (value)); - break; - - case PROP_PICK_WITH_ALPHA: - clutter_texture_set_pick_with_alpha (texture, - g_value_get_boolean (value)); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -clutter_texture_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - ClutterTexture *texture; - ClutterTexturePrivate *priv; - - texture = CLUTTER_TEXTURE(object); - priv = texture->priv; - - switch (prop_id) - { - case PROP_PIXEL_FORMAT: - g_value_set_enum (value, clutter_texture_get_pixel_format (texture)); - break; - - case PROP_MAX_TILE_WASTE: - g_value_set_int (value, clutter_texture_get_max_tile_waste (texture)); - break; - - case PROP_SYNC_SIZE: - g_value_set_boolean (value, priv->sync_actor_size); - break; - - case PROP_REPEAT_X: - g_value_set_boolean (value, priv->repeat_x); - break; - - case PROP_REPEAT_Y: - g_value_set_boolean (value, priv->repeat_y); - break; - - case PROP_FILTER_QUALITY: - g_value_set_enum (value, clutter_texture_get_filter_quality (texture)); - break; - - case PROP_COGL_TEXTURE: - g_value_set_boxed (value, clutter_texture_get_cogl_texture (texture)); - break; - - case PROP_COGL_MATERIAL: - g_value_set_boxed (value, clutter_texture_get_cogl_material (texture)); - break; - - case PROP_NO_SLICE: - g_value_set_boolean (value, priv->no_slice); - break; - - case PROP_KEEP_ASPECT_RATIO: - g_value_set_boolean (value, priv->keep_aspect_ratio); - break; - - case PROP_PICK_WITH_ALPHA: - g_value_set_boolean (value, priv->pick_with_alpha); - break; - - case PROP_FILENAME: - g_value_set_string (value, priv->filename); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -clutter_texture_class_init (ClutterTextureClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); - GParamSpec *pspec; - - g_type_class_add_private (klass, sizeof (ClutterTexturePrivate)); - - actor_class->paint = clutter_texture_paint; - actor_class->pick = clutter_texture_pick; - actor_class->get_paint_volume = clutter_texture_get_paint_volume; - actor_class->realize = clutter_texture_realize; - actor_class->unrealize = clutter_texture_unrealize; - actor_class->has_overlaps = clutter_texture_has_overlaps; - - actor_class->get_preferred_width = clutter_texture_get_preferred_width; - actor_class->get_preferred_height = clutter_texture_get_preferred_height; - actor_class->allocate = clutter_texture_allocate; - - gobject_class->dispose = clutter_texture_dispose; - gobject_class->finalize = clutter_texture_finalize; - gobject_class->set_property = clutter_texture_set_property; - gobject_class->get_property = clutter_texture_get_property; - - pspec = g_param_spec_boolean ("sync-size", - P_("Sync size of actor"), - P_("Auto sync size of actor to underlying pixbuf dimensions"), - TRUE, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_SYNC_SIZE] = pspec; - g_object_class_install_property (gobject_class, PROP_SYNC_SIZE, pspec); - - pspec = g_param_spec_boolean ("disable-slicing", - P_("Disable Slicing"), - P_("Forces the underlying texture to be singular and not made of smaller space saving " - "individual textures"), - FALSE, - G_PARAM_CONSTRUCT_ONLY | - CLUTTER_PARAM_READWRITE); - obj_props[PROP_NO_SLICE] = pspec; - g_object_class_install_property (gobject_class, PROP_NO_SLICE, pspec); - - pspec = g_param_spec_int ("tile-waste", - P_("Tile Waste"), - P_("Maximum waste area of a sliced texture"), - -1, G_MAXINT, - COGL_TEXTURE_MAX_WASTE, - CLUTTER_PARAM_READABLE); - obj_props[PROP_MAX_TILE_WASTE] = pspec; - g_object_class_install_property (gobject_class, PROP_MAX_TILE_WASTE, pspec); - - pspec = g_param_spec_boolean ("repeat-x", - P_("Horizontal repeat"), - P_("Repeat the contents rather than scaling them horizontally"), - FALSE, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_REPEAT_X] = pspec; - g_object_class_install_property (gobject_class, PROP_REPEAT_X, pspec); - - pspec = g_param_spec_boolean ("repeat-y", - P_("Vertical repeat"), - P_("Repeat the contents rather than scaling them vertically"), - FALSE, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_REPEAT_Y] = pspec; - g_object_class_install_property (gobject_class, PROP_REPEAT_Y, pspec); - - pspec = g_param_spec_enum ("filter-quality", - P_("Filter Quality"), - P_("Rendering quality used when drawing the texture"), - CLUTTER_TYPE_TEXTURE_QUALITY, - CLUTTER_TEXTURE_QUALITY_MEDIUM, - G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE); - obj_props[PROP_FILTER_QUALITY] = pspec; - g_object_class_install_property (gobject_class, PROP_FILTER_QUALITY, pspec); - - pspec = g_param_spec_enum ("pixel-format", - P_("Pixel Format"), - P_("The Cogl pixel format to use"), - COGL_TYPE_PIXEL_FORMAT, - COGL_PIXEL_FORMAT_RGBA_8888, - CLUTTER_PARAM_READABLE); - obj_props[PROP_PIXEL_FORMAT] = pspec; - g_object_class_install_property (gobject_class, PROP_PIXEL_FORMAT, pspec); - - pspec = g_param_spec_boxed ("cogl-texture", - P_("Cogl Texture"), - P_("The underlying Cogl texture handle used to draw this actor"), - COGL_TYPE_HANDLE, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_COGL_TEXTURE] = pspec; - g_object_class_install_property (gobject_class, PROP_COGL_TEXTURE, pspec); - - pspec = g_param_spec_boxed ("cogl-material", - P_("Cogl Material"), - P_("The underlying Cogl material handle used to draw this actor"), - COGL_TYPE_HANDLE, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_COGL_MATERIAL] = pspec; - g_object_class_install_property (gobject_class, PROP_COGL_MATERIAL, pspec); - - /** - * ClutterTexture:filename: - * - * The path of the file containing the image data to be displayed by - * the texture. - * - * This property is unset when using the clutter_texture_set_from_*_data() - * family of functions. - * - * Deprecated: 1.12 - */ - pspec = g_param_spec_string ("filename", - P_("Filename"), - P_("The path of the file containing the image data"), - NULL, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_FILENAME] = pspec; - g_object_class_install_property (gobject_class, PROP_FILENAME, pspec); - - pspec = g_param_spec_boolean ("keep-aspect-ratio", - P_("Keep Aspect Ratio"), - P_("Keep the aspect ratio of the texture when requesting the preferred width or height"), - FALSE, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_KEEP_ASPECT_RATIO] = pspec; - g_object_class_install_property (gobject_class, PROP_KEEP_ASPECT_RATIO, pspec); - - /** - * ClutterTexture:load-async: - * - * Tries to load a texture from a filename by using a local thread to perform - * the read operations. The initially created texture has dimensions 0x0 when - * the true size becomes available the #ClutterTexture::size-change signal is - * emitted and when the image has completed loading the - * #ClutterTexture::load-finished signal is emitted. - * - * Threading is only enabled if g_thread_init() has been called prior to - * clutter_init(), otherwise #ClutterTexture will use the main loop to load - * the image. - * - * The upload of the texture data on the GL pipeline is not asynchronous, as - * it must be performed from within the same thread that called - * clutter_main(). - * - * - * - * Deprecated: 1.12 - */ - pspec = g_param_spec_boolean ("load-async", - P_("Load asynchronously"), - P_("Load files inside a thread to avoid blocking when loading images from disk"), - FALSE, - CLUTTER_PARAM_WRITABLE); - obj_props[PROP_LOAD_ASYNC] = pspec; - g_object_class_install_property (gobject_class, PROP_LOAD_ASYNC, pspec); - - - /** - * ClutterTexture:load-data-async: - * - * Like #ClutterTexture:load-async but loads the width and height - * synchronously causing some blocking. - * - * - * - * Deprecated: 1.12 - */ - pspec = g_param_spec_boolean ("load-data-async", - P_("Load data asynchronously"), - P_("Decode image data files inside a thread to reduce blocking when loading images from disk"), - FALSE, - CLUTTER_PARAM_WRITABLE); - obj_props[PROP_LOAD_DATA_ASYNC] = pspec; - g_object_class_install_property (gobject_class, PROP_LOAD_DATA_ASYNC, pspec); - - /** - * ClutterTexture::pick-with-alpha: - * - * Determines whether a #ClutterTexture should have it's shape defined - * by its alpha channel when picking. - * - * Be aware that this is a bit more costly than the default picking - * due to the texture lookup, extra test against the alpha value and - * the fact that it will also interrupt the batching of geometry - * done internally. - * - * Also there is currently no control over the threshold used to - * determine what value of alpha is considered pickable, and so - * only fully opaque parts of the texture will react to picking. - * - * - * - * Deprecated: 1.12 - */ - pspec = g_param_spec_boolean ("pick-with-alpha", - P_("Pick With Alpha"), - P_("Shape actor with alpha channel when picking"), - FALSE, - CLUTTER_PARAM_READWRITE); - obj_props[PROP_PICK_WITH_ALPHA] = pspec; - g_object_class_install_property (gobject_class, PROP_PICK_WITH_ALPHA, pspec); - - /** - * ClutterTexture::size-change: - * @texture: the texture which received the signal - * @width: the width of the new texture - * @height: the height of the new texture - * - * The ::size-change signal is emitted each time the size of the - * pixbuf used by @texture changes. The new size is given as - * argument to the callback. - * - * Deprecated: 1.12 - */ - texture_signals[SIZE_CHANGE] = - g_signal_new ("size-change", - G_TYPE_FROM_CLASS (gobject_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ClutterTextureClass, size_change), - NULL, NULL, - _clutter_marshal_VOID__INT_INT, - G_TYPE_NONE, 2, - G_TYPE_INT, - G_TYPE_INT); - /** - * ClutterTexture::pixbuf-change: - * @texture: the texture which received the signal - * - * The ::pixbuf-change signal is emitted each time the pixbuf - * used by @texture changes. - * - * Deprecated: 1.12 - */ - texture_signals[PIXBUF_CHANGE] = - g_signal_new ("pixbuf-change", - G_TYPE_FROM_CLASS (gobject_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ClutterTextureClass, pixbuf_change), - NULL, NULL, - _clutter_marshal_VOID__VOID, - G_TYPE_NONE, - 0); - /** - * ClutterTexture::load-finished: - * @texture: the texture which received the signal - * @error: A set error, or %NULL - * - * The ::load-finished signal is emitted when a texture load has - * completed. If there was an error during loading, @error will - * be set, otherwise it will be %NULL - * - * - * - * Deprecated: 1.12 - */ - texture_signals[LOAD_FINISHED] = - g_signal_new (I_("load-finished"), - G_TYPE_FROM_CLASS (gobject_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ClutterTextureClass, load_finished), - NULL, NULL, - _clutter_marshal_VOID__BOXED, - G_TYPE_NONE, - 1, - G_TYPE_ERROR); -} - -static ClutterScriptableIface *parent_scriptable_iface = NULL; - -static void -clutter_texture_set_custom_property (ClutterScriptable *scriptable, - ClutterScript *script, - const gchar *name, - const GValue *value) -{ - ClutterTexture *texture = CLUTTER_TEXTURE (scriptable); - - if (strcmp ("filename", name) == 0) - { - const gchar *str = g_value_get_string (value); - gchar *path; - GError *error; - - path = clutter_script_lookup_filename (script, str); - if (G_UNLIKELY (!path)) - { - g_warning ("Unable to find image %s", str); - return; - } - - error = NULL; - clutter_texture_set_from_file (texture, path, &error); - if (error) - { - g_warning ("Unable to open image path at '%s': %s", - path, - error->message); - g_error_free (error); - } - - g_free (path); - } - else - { - /* chain up */ - if (parent_scriptable_iface->set_custom_property) - parent_scriptable_iface->set_custom_property (scriptable, script, - name, - value); - } -} - -static void -clutter_scriptable_iface_init (ClutterScriptableIface *iface) -{ - parent_scriptable_iface = g_type_interface_peek_parent (iface); - - if (!parent_scriptable_iface) - parent_scriptable_iface = g_type_default_interface_peek - (CLUTTER_TYPE_SCRIPTABLE); - - iface->set_custom_property = clutter_texture_set_custom_property; -} - -static void -clutter_texture_init (ClutterTexture *self) -{ - ClutterTexturePrivate *priv; - - self->priv = priv = CLUTTER_TEXTURE_GET_PRIVATE (self); - - priv->repeat_x = FALSE; - priv->repeat_y = FALSE; - priv->sync_actor_size = TRUE; - priv->fbo_handle = NULL; - priv->pick_pipeline = NULL; - priv->keep_aspect_ratio = FALSE; - priv->pick_with_alpha = FALSE; - priv->pick_with_alpha_supported = TRUE; - priv->seen_create_pick_pipeline_warning = FALSE; - - if (G_UNLIKELY (texture_template_pipeline == NULL)) - { - CoglPipeline *pipeline; - CoglContext *ctx = - clutter_backend_get_cogl_context (clutter_get_default_backend ()); - - texture_template_pipeline = cogl_pipeline_new (ctx); - pipeline = COGL_PIPELINE (texture_template_pipeline); - cogl_pipeline_set_layer_null_texture (pipeline, - 0, /* layer_index */ - COGL_TEXTURE_TYPE_2D); - } - - g_assert (texture_template_pipeline != NULL); - priv->pipeline = cogl_pipeline_copy (texture_template_pipeline); -} - -/** - * clutter_texture_get_cogl_material: - * @texture: A #ClutterTexture - * - * Returns a handle to the underlying COGL material used for drawing - * the actor. - * - * Return value: (transfer none): a handle for a #CoglMaterial. The - * material is owned by the #ClutterTexture and it should not be - * unreferenced - * - * - * - * Deprecated: 1.12 - */ -CoglHandle -clutter_texture_get_cogl_material (ClutterTexture *texture) -{ - g_return_val_if_fail (CLUTTER_IS_TEXTURE (texture), NULL); - - return texture->priv->pipeline; -} - -/** - * clutter_texture_set_cogl_material: - * @texture: A #ClutterTexture - * @cogl_material: A CoglHandle for a material - * - * Replaces the underlying Cogl material drawn by this actor with - * @cogl_material. A reference to the material is taken so if the - * handle is no longer needed it should be deref'd with - * cogl_handle_unref. Texture data is attached to the material so - * calling this function also replaces the Cogl - * texture. #ClutterTexture requires that the material have a texture - * layer so you should set one on the material before calling this - * function. - * - * - * - * Deprecated: 1.12 - */ -void -clutter_texture_set_cogl_material (ClutterTexture *texture, - CoglHandle cogl_material) -{ - CoglPipeline *cogl_pipeline = cogl_material; - CoglHandle cogl_texture; - - g_return_if_fail (CLUTTER_IS_TEXTURE (texture)); - - cogl_object_ref (cogl_pipeline); - - if (texture->priv->pipeline) - cogl_object_unref (texture->priv->pipeline); - - texture->priv->pipeline = cogl_pipeline; - - /* XXX: We are re-asserting the first layer of the new pipeline to ensure the - * priv state is in sync with the contents of the pipeline. */ - cogl_texture = clutter_texture_get_cogl_texture (texture); - clutter_texture_set_cogl_texture (texture, cogl_texture); - /* XXX: If we add support for more pipeline layers, this will need - * extending */ -} - -typedef struct _GetLayerState -{ - gboolean has_layer; - int first_layer; -} GetLayerState; - -static gboolean -layer_cb (CoglPipeline *pipeline, int layer, void *user_data) -{ - GetLayerState *state = user_data; - - state->has_layer = TRUE; - state->first_layer = layer; - - /* We only care about the first layer. */ - return FALSE; -} - -static gboolean -get_first_layer_index (CoglPipeline *pipeline, int *layer_index) -{ - GetLayerState state = { FALSE }; - cogl_pipeline_foreach_layer (pipeline, - layer_cb, - &state); - if (state.has_layer) - *layer_index = state.first_layer; - - return state.has_layer; -} - -/** - * clutter_texture_get_cogl_texture: - * @texture: A #ClutterTexture - * - * Retrieves the handle to the underlying COGL texture used for drawing - * the actor. No extra reference is taken so if you need to keep the - * handle then you should call cogl_handle_ref() on it. - * - * The texture handle returned is the first layer of the material - * handle used by the #ClutterTexture. If you need to access the other - * layers you should use clutter_texture_get_cogl_material() instead - * and use the #CoglMaterial API. - * - * Return value: (transfer none): a #CoglHandle for the texture. The returned - * handle is owned by the #ClutterTexture and it should not be unreferenced - * - * - * - * Deprecated: 1.12 - */ -CoglHandle -clutter_texture_get_cogl_texture (ClutterTexture *texture) -{ - ClutterTexturePrivate *priv; - int layer_index; - - g_return_val_if_fail (CLUTTER_IS_TEXTURE (texture), NULL); - - priv = texture->priv; - - if (get_first_layer_index (priv->pipeline, &layer_index)) - return cogl_pipeline_get_layer_texture (priv->pipeline, layer_index); - else - return NULL; -} - -/** - * clutter_texture_set_cogl_texture: - * @texture: A #ClutterTexture - * @cogl_tex: A CoglHandle for a texture - * - * Replaces the underlying COGL texture drawn by this actor with - * @cogl_tex. A reference to the texture is taken so if the handle is - * no longer needed it should be deref'd with cogl_handle_unref. - * - * - * - * Deprecated: 1.12 - */ -void -clutter_texture_set_cogl_texture (ClutterTexture *texture, - CoglHandle cogl_tex) -{ - ClutterTexturePrivate *priv; - gboolean size_changed; - guint width, height; - - g_return_if_fail (CLUTTER_IS_TEXTURE (texture)); - g_return_if_fail (cogl_is_texture (cogl_tex)); - - /* This function can set the texture without the actor being - realized. This is ok because Clutter requires that the GL context - always be current so there is no point in waiting to realization - to set the texture. */ - - priv = texture->priv; - - width = cogl_texture_get_width (cogl_tex); - height = cogl_texture_get_height (cogl_tex); - - /* Reference the new texture now in case it is the same one we are - already using */ - cogl_object_ref (cogl_tex); - - /* Remove FBO if exisiting */ - if (priv->fbo_source) - texture_fbo_free_resources (texture); - - /* Remove old texture */ - texture_free_gl_resources (texture); - - /* Use the new texture */ - if (priv->pipeline == NULL) - priv->pipeline = cogl_pipeline_copy (texture_template_pipeline); - - g_assert (priv->pipeline != NULL); - cogl_pipeline_set_layer_texture (priv->pipeline, 0, cogl_tex); - - /* The pipeline now holds a reference to the texture so we can - safely release the reference we claimed above */ - cogl_object_unref (cogl_tex); - - size_changed = (width != priv->image_width || height != priv->image_height); - priv->image_width = width; - priv->image_height = height; - - CLUTTER_NOTE (TEXTURE, "set size (w:%d, h:%d)", - priv->image_width, - priv->image_height); - - if (size_changed) - { - g_signal_emit (texture, texture_signals[SIZE_CHANGE], 0, - priv->image_width, - priv->image_height); - - if (priv->sync_actor_size) - { - ClutterActor *actor = CLUTTER_ACTOR (texture); - - /* we have been requested to keep the actor size in - * sync with the texture data; if we also want to - * maintain the aspect ratio we want to change the - * requisition mode depending on the orientation of - * the texture, so that the parent container can do - * the right thing - */ - if (priv->keep_aspect_ratio) - { - ClutterRequestMode request; - - if (priv->image_width >= priv->image_height) - request = CLUTTER_REQUEST_HEIGHT_FOR_WIDTH; - else - request = CLUTTER_REQUEST_WIDTH_FOR_HEIGHT; - - clutter_actor_set_request_mode (actor, request); - } - - clutter_actor_queue_relayout (CLUTTER_ACTOR (texture)); - } - } - - /* rename signal */ - g_signal_emit (texture, texture_signals[PIXBUF_CHANGE], 0); - - /* If resized actor may need resizing but paint() will do this */ - clutter_actor_queue_redraw (CLUTTER_ACTOR (texture)); - - g_object_notify_by_pspec (G_OBJECT (texture), obj_props[PROP_COGL_TEXTURE]); -} - -static gboolean -clutter_texture_set_from_data (ClutterTexture *texture, - const guchar *data, - CoglPixelFormat source_format, - gint width, - gint height, - gint rowstride, - gint bpp, - GError **error) -{ - ClutterTexturePrivate *priv = texture->priv; - CoglHandle new_texture = NULL; - CoglTextureFlags flags = COGL_TEXTURE_NONE; - - if (priv->no_slice) - flags |= COGL_TEXTURE_NO_SLICING; - - /* FIXME if we are not realized, we should store the data - * for future use, instead of creating the texture. - */ - new_texture = cogl_texture_new_from_data (width, height, - flags, - source_format, - COGL_PIXEL_FORMAT_ANY, - rowstride, - data); - - if (G_UNLIKELY (new_texture == NULL)) - { - GError *inner_error = NULL; - - g_set_error (&inner_error, CLUTTER_TEXTURE_ERROR, - CLUTTER_TEXTURE_ERROR_BAD_FORMAT, - _("Failed to load the image data")); - - g_signal_emit (texture, texture_signals[LOAD_FINISHED], 0, inner_error); - - if (error != NULL) - g_propagate_error (error, inner_error); - else - g_error_free (inner_error); - - return FALSE; - } - - g_free (priv->filename); - priv->filename = NULL; - - clutter_texture_set_cogl_texture (texture, new_texture); - - cogl_object_unref (new_texture); - - g_signal_emit (texture, texture_signals[LOAD_FINISHED], 0, NULL); - - return TRUE; -} - -static inline gboolean -get_pixel_format_from_texture_flags (gint bpp, - gboolean has_alpha, - ClutterTextureFlags flags, - CoglPixelFormat *source_format) -{ - /* Convert the flags to a CoglPixelFormat */ - if (has_alpha) - { - if (G_UNLIKELY (bpp != 4)) - { - g_warning ("Unsupported bytes per pixel value '%d': " - "Clutter supports only a value of 4 " - "for RGBA data", - bpp); - return FALSE; - } - - *source_format = COGL_PIXEL_FORMAT_RGBA_8888; - } - else - { - if (G_UNLIKELY (bpp != 3)) - { - g_warning ("Unsupported bytes per pixel value '%d': " - "Clutter supports only a BPP value of 3 " - "for RGB data", - bpp); - return FALSE; - } - - *source_format = COGL_PIXEL_FORMAT_RGB_888; - } - - if ((flags & CLUTTER_TEXTURE_RGB_FLAG_BGR)) - *source_format |= COGL_BGR_BIT; - - if ((flags & CLUTTER_TEXTURE_RGB_FLAG_PREMULT)) - *source_format |= COGL_PREMULT_BIT; - - return TRUE; -} - -/** - * clutter_texture_set_from_rgb_data: - * @texture: a #ClutterTexture - * @data: (array): image data in RGBA type colorspace. - * @has_alpha: set to %TRUE if image data has an alpha channel. - * @width: width in pixels of image data. - * @height: height in pixels of image data - * @rowstride: distance in bytes between row starts. - * @bpp: bytes per pixel (currently only 3 and 4 supported, depending - * on the value of @has_alpha) - * @flags: #ClutterTextureFlags - * @error: return location for a #GError, or %NULL. - * - * Sets #ClutterTexture image data. - * - * Return value: %TRUE on success, %FALSE on failure. - * - * - * - * Deprecated: 1.12 - */ -gboolean -clutter_texture_set_from_rgb_data (ClutterTexture *texture, - const guchar *data, - gboolean has_alpha, - gint width, - gint height, - gint rowstride, - gint bpp, - ClutterTextureFlags flags, - GError **error) -{ - CoglPixelFormat source_format; - - g_return_val_if_fail (CLUTTER_IS_TEXTURE (texture), FALSE); - - if (!get_pixel_format_from_texture_flags (bpp, - has_alpha, - flags, - &source_format)) - { - return FALSE; - } - - return clutter_texture_set_from_data (texture, data, - source_format, - width, height, - rowstride, bpp, - error); -} - -/** - * clutter_texture_set_from_yuv_data: - * @texture: A #ClutterTexture - * @data: (array): Image data in YUV type colorspace. - * @width: Width in pixels of image data. - * @height: Height in pixels of image data - * @flags: #ClutterTextureFlags - * @error: Return location for a #GError, or %NULL. - * - * Sets a #ClutterTexture from YUV image data. If an error occurred, - * %FALSE is returned and @error is set. - * - * The YUV support depends on the driver; the format supported by the - * few drivers exposing this capability are not really useful. - * - * The proper way to convert image data in any YUV colorspace to any - * RGB colorspace is to use a fragment shader associated with the - * #ClutterTexture material. - * - * Return value: %TRUE if the texture was successfully updated - * - * - * - * Deprecated: 1.10: Use clutter_texture_get_cogl_material() and - * the Cogl API to install a fragment shader for decoding YUV - * formats on the GPU - */ -gboolean -clutter_texture_set_from_yuv_data (ClutterTexture *texture, - const guchar *data, - gint width, - gint height, - ClutterTextureFlags flags, - GError **error) -{ - g_return_val_if_fail (CLUTTER_IS_TEXTURE (texture), FALSE); - - if (!clutter_feature_available (CLUTTER_FEATURE_TEXTURE_YUV)) - { - g_set_error (error, CLUTTER_TEXTURE_ERROR, - CLUTTER_TEXTURE_ERROR_NO_YUV, - _("YUV textures are not supported")); - return FALSE; - } - - /* Convert the flags to a CoglPixelFormat */ - if ((flags & CLUTTER_TEXTURE_YUV_FLAG_YUV2)) - { - g_set_error (error, CLUTTER_TEXTURE_ERROR, - CLUTTER_TEXTURE_ERROR_BAD_FORMAT, - _("YUV2 textues are not supported")); - return FALSE; - } - - return clutter_texture_set_from_data (texture, data, - COGL_PIXEL_FORMAT_YUV, - width, height, - width * 3, 3, - error); -} - -/* - * clutter_texture_async_load_complete: - * @self: a #ClutterTexture - * @bitmap: a handle to a CoglBitmap - * @error: load error - * - * If @error is %NULL, loads @bitmap into a #CoglTexture. - * - * This function emits the ::load-finished signal on @self. - */ -static void -clutter_texture_async_load_complete (ClutterTexture *self, - CoglHandle bitmap, - const GError *error) -{ - ClutterTexturePrivate *priv = self->priv; - CoglTextureFlags flags = COGL_TEXTURE_NONE; - CoglHandle handle; - - priv->async_data = NULL; - - if (error == NULL) - { - if (priv->no_slice) - flags |= COGL_TEXTURE_NO_SLICING; - - handle = cogl_texture_new_from_bitmap (bitmap, - flags, - COGL_PIXEL_FORMAT_ANY); - clutter_texture_set_cogl_texture (self, handle); - - if (priv->load_size_async) - { - g_signal_emit (self, texture_signals[SIZE_CHANGE], 0, - cogl_texture_get_width (handle), - cogl_texture_get_height (handle)); - } - - cogl_object_unref (handle); - } - - g_signal_emit (self, texture_signals[LOAD_FINISHED], 0, error); - - clutter_actor_queue_relayout (CLUTTER_ACTOR (self)); -} - -static gboolean -texture_repaint_upload_func (gpointer user_data) -{ - g_mutex_lock (&upload_list_mutex); - - if (upload_list != NULL) - { - gint64 start_time = g_get_monotonic_time (); - - /* continue uploading textures as long as we havent spent more - * then 5ms doing so this stage redraw cycle. - */ - do - { - ClutterTextureAsyncData *async_data = upload_list->data; - - clutter_texture_async_data_lock (async_data); - - if (async_data->state & ASYNC_STATE_QUEUED) - { - CLUTTER_NOTE (TEXTURE, "[async] operation complete for '%s'", - async_data->load_filename); - - clutter_texture_async_load_complete (async_data->texture, - async_data->load_bitmap, - async_data->load_error); - } - else - CLUTTER_NOTE (TEXTURE, "[async] operation cancelled for '%s'", - async_data->load_filename); - - clutter_texture_async_data_unlock (async_data); - - upload_list = g_list_remove (upload_list, async_data); - clutter_texture_async_data_free (async_data); - } - while (upload_list != NULL && - g_get_monotonic_time () < start_time + 5 * 1000L); - } - - if (upload_list != NULL) - { - ClutterMasterClock *master_clock; - - master_clock = _clutter_master_clock_get_default (); - _clutter_master_clock_ensure_next_iteration (master_clock); - } - - g_mutex_unlock (&upload_list_mutex); - - return TRUE; -} - -static void -clutter_texture_thread_load (gpointer user_data, - gpointer pool_data) -{ - ClutterTextureAsyncData *async_data = user_data; - ClutterMasterClock *master_clock = _clutter_master_clock_get_default (); - - clutter_texture_async_data_lock (async_data); - - if (~async_data->state & ASYNC_STATE_CANCELLED) - { - CLUTTER_NOTE (TEXTURE, "[async] loading bitmap from file '%s'", - async_data->load_filename); - - async_data->load_bitmap = - cogl_bitmap_new_from_file (async_data->load_filename, - &async_data->load_error); - - g_mutex_lock (&upload_list_mutex); - - if (repaint_upload_func == 0) - { - repaint_upload_func = - clutter_threads_add_repaint_func (texture_repaint_upload_func, - NULL, NULL); - } - - upload_list = g_list_append (upload_list, async_data); - async_data->state |= ASYNC_STATE_QUEUED; - - CLUTTER_NOTE (TEXTURE, "[async] operation queued"); - - g_mutex_unlock (&upload_list_mutex); - } - else - { - clutter_texture_async_data_unlock (async_data); - clutter_texture_async_data_free (async_data); - - return; - } - - clutter_texture_async_data_unlock (async_data); - - _clutter_master_clock_ensure_next_iteration (master_clock); -} - -static gboolean -clutter_texture_idle_load (gpointer data) -{ - ClutterTextureAsyncData *async_data = data; - - async_data->load_bitmap = - cogl_bitmap_new_from_file (async_data->load_filename, - &async_data->load_error); - - clutter_texture_async_load_complete (async_data->texture, - async_data->load_bitmap, - async_data->load_error); - - clutter_texture_async_data_free (async_data); - - return FALSE; -} - -/* - * clutter_texture_async_load: - * @self: a #ClutterTExture - * @filename: name of the file to load - * @error: return location for a #GError - * - * Starts an asynchronous load of the file name stored inside - * the load_filename member of @data. - * - * If threading is enabled we use a GThread to perform the actual - * I/O; if threading is not enabled, we use an idle GSource. - * - * The I/O is the only bit done in a thread -- uploading the - * texture data to the GL pipeline must be done from within the - * same thread that called clutter_main(). Threaded upload should - * be part of the GL implementation. - * - * This function will block until we get a size from the file - * so that we can effectively get the size the texture actor after - * clutter_texture_set_from_file(). - * - * Return value: %TRUE if the asynchronous loading was successfully - * initiated, %FALSE otherwise - */ -static gboolean -clutter_texture_async_load (ClutterTexture *self, - const gchar *filename, - GError **error) -{ - ClutterTexturePrivate *priv = self->priv; - ClutterTextureAsyncData *data; - gint width, height; - gboolean res; - - /* ask the file for a size; if we cannot get the size then - * there's no point in even continuing the asynchronous - * loading, so we just stop there - */ - - if (priv->load_size_async) - { - res = TRUE; - width = 0; - height = 0; - } - else - res = cogl_bitmap_get_size_from_file (filename, &width, &height); - - if (!res) - { - g_set_error (error, CLUTTER_TEXTURE_ERROR, - CLUTTER_TEXTURE_ERROR_BAD_FORMAT, - _("Failed to load the image data")); - return FALSE; - } - else - { - priv->image_width = width; - priv->image_height = height; - } - - clutter_texture_async_load_cancel (self); - - data = g_slice_new0 (ClutterTextureAsyncData); - - data->texture = self; - data->load_filename = g_strdup (filename); - - priv->async_data = data; - - if (1) - { - if (G_UNLIKELY (async_thread_pool == NULL)) - { - /* This apparently can't fail if exclusive == FALSE */ - async_thread_pool = - g_thread_pool_new (clutter_texture_thread_load, NULL, - 1, - FALSE, - NULL); - } - - g_thread_pool_push (async_thread_pool, data, NULL); - } - else - { - data->load_idle = - clutter_threads_add_idle_full (G_PRIORITY_DEFAULT_IDLE, - clutter_texture_idle_load, - data, - NULL); - } - - return TRUE; -} - -/** - * clutter_texture_set_from_file: - * @texture: A #ClutterTexture - * @filename: The filename of the image in GLib file name encoding - * @error: Return location for a #GError, or %NULL - * - * Sets the #ClutterTexture image data from an image file. In case of - * failure, %FALSE is returned and @error is set. - * - * If #ClutterTexture:load-async is set to %TRUE, this function - * will return as soon as possible, and the actual image loading - * from disk will be performed asynchronously. #ClutterTexture::size-change - * will be emitten when the size of the texture is available and - * #ClutterTexture::load-finished will be emitted when the image has been - * loaded or if an error occurred. - * - * Return value: %TRUE if the image was successfully loaded and set - * - * - * - * Deprecated: 1.12 - */ -gboolean -clutter_texture_set_from_file (ClutterTexture *texture, - const gchar *filename, - GError **error) -{ - ClutterTexturePrivate *priv; - CoglHandle new_texture = NULL; - GError *internal_error = NULL; - CoglTextureFlags flags = COGL_TEXTURE_NONE; - - priv = texture->priv; - - g_return_val_if_fail (error == NULL || *error == NULL, FALSE); - - if (priv->load_data_async) - return clutter_texture_async_load (texture, filename, error); - - if (priv->no_slice) - flags |= COGL_TEXTURE_NO_SLICING; - - new_texture = cogl_texture_new_from_file (filename, - flags, - COGL_PIXEL_FORMAT_ANY, - &internal_error); - - /* If COGL didn't give an error then make one up */ - if (internal_error == NULL && new_texture == NULL) - { - g_set_error (&internal_error, CLUTTER_TEXTURE_ERROR, - CLUTTER_TEXTURE_ERROR_BAD_FORMAT, - _("Failed to load the image data")); - } - - if (internal_error != NULL) - { - g_signal_emit (texture, texture_signals[LOAD_FINISHED], 0, - internal_error); - - g_propagate_error (error, internal_error); - - return FALSE; - } - - g_free (priv->filename); - priv->filename = g_strdup (filename); - - clutter_texture_set_cogl_texture (texture, new_texture); - - cogl_object_unref (new_texture); - - g_signal_emit (texture, texture_signals[LOAD_FINISHED], 0, NULL); - - g_object_notify_by_pspec (G_OBJECT (texture), obj_props[PROP_FILENAME]); - - return TRUE; -} - -/** - * clutter_texture_set_filter_quality: - * @texture: a #ClutterTexture - * @filter_quality: new filter quality value - * - * Sets the filter quality when scaling a texture. The quality is an - * enumeration currently the following values are supported: - * %CLUTTER_TEXTURE_QUALITY_LOW which is fast but only uses nearest neighbour - * interpolation. %CLUTTER_TEXTURE_QUALITY_MEDIUM which is computationally a - * bit more expensive (bilinear interpolation), and - * %CLUTTER_TEXTURE_QUALITY_HIGH which uses extra texture memory resources to - * improve scaled down rendering as well (by using mipmaps). The default value - * is %CLUTTER_TEXTURE_QUALITY_MEDIUM. - * - * - * - * Deprecated: 1.12 - */ -void -clutter_texture_set_filter_quality (ClutterTexture *texture, - ClutterTextureQuality filter_quality) -{ - ClutterTexturePrivate *priv; - ClutterTextureQuality old_quality; - - g_return_if_fail (CLUTTER_IS_TEXTURE (texture)); - - priv = texture->priv; - - old_quality = clutter_texture_get_filter_quality (texture); - - if (filter_quality != old_quality) - { - gint min_filter, mag_filter; - - min_filter = mag_filter = COGL_PIPELINE_FILTER_LINEAR; - clutter_texture_quality_to_filters (filter_quality, - &min_filter, - &mag_filter); - - cogl_pipeline_set_layer_filters (priv->pipeline, 0, - min_filter, mag_filter); - - clutter_actor_queue_redraw (CLUTTER_ACTOR (texture)); - - g_object_notify_by_pspec (G_OBJECT (texture), obj_props[PROP_FILTER_QUALITY]); - } -} - -/** - * clutter_texture_get_filter_quality: - * @texture: A #ClutterTexture - * - * Gets the filter quality used when scaling a texture. - * - * Return value: The filter quality value. - * - * - * - * Deprecated: 1.12 - */ -ClutterTextureQuality -clutter_texture_get_filter_quality (ClutterTexture *texture) -{ - ClutterTexturePrivate *priv; - int layer_index; - CoglPipelineFilter min_filter, mag_filter; - int i; - - g_return_val_if_fail (CLUTTER_IS_TEXTURE (texture), 0); - - priv = texture->priv; - - if (get_first_layer_index (priv->pipeline, &layer_index)) - { - min_filter = cogl_pipeline_get_layer_min_filter (priv->pipeline, - layer_index); - mag_filter = cogl_pipeline_get_layer_mag_filter (priv->pipeline, - layer_index); - } - else - return CLUTTER_TEXTURE_QUALITY_MEDIUM; - - for (i = 0; i < G_N_ELEMENTS (clutter_texture_quality_filters); i++) - if (clutter_texture_quality_filters[i].min_filter == min_filter - && clutter_texture_quality_filters[i].mag_filter == mag_filter) - return i; - - /* Unknown filter combination */ - return CLUTTER_TEXTURE_QUALITY_LOW; -} - -/** - * clutter_texture_get_max_tile_waste: - * @texture: A #ClutterTexture - * - * Gets the maximum waste that will be used when creating a texture or - * -1 if slicing is disabled. - * - * Return value: The maximum waste or -1 if the texture waste is - * unlimited. - * - * - * - * Deprecated: 1.12 - */ -gint -clutter_texture_get_max_tile_waste (ClutterTexture *texture) -{ - ClutterTexturePrivate *priv; - CoglHandle cogl_texture; - - g_return_val_if_fail (CLUTTER_IS_TEXTURE (texture), 0); - - priv = texture->priv; - - cogl_texture = clutter_texture_get_cogl_texture (texture); - - if (cogl_texture == NULL) - return priv->no_slice ? -1 : COGL_TEXTURE_MAX_WASTE; - else - return cogl_texture_get_max_waste (cogl_texture); -} - -/** - * clutter_texture_new_from_file: - * @filename: The name of an image file to load. - * @error: Return locatoin for an error. - * - * Creates a new ClutterTexture actor to display the image contained a - * file. If the image failed to load then NULL is returned and @error - * is set. - * - * Return value: A newly created #ClutterTexture object or NULL on - * error. - * - * - * - * Deprecated: 1.12 - */ -ClutterActor* -clutter_texture_new_from_file (const gchar *filename, - GError **error) -{ - ClutterActor *texture = clutter_texture_new (); - - if (!clutter_texture_set_from_file (CLUTTER_TEXTURE (texture), - filename, error)) - { - g_object_ref_sink (texture); - g_object_unref (texture); - - return NULL; - } - else - return texture; -} - -/** - * clutter_texture_new: - * - * Creates a new empty #ClutterTexture object. - * - * Return value: A newly created #ClutterTexture object. - * - * Deprecated: 1.12 - */ -ClutterActor * -clutter_texture_new (void) -{ - return g_object_new (CLUTTER_TYPE_TEXTURE, NULL); -} - -/** - * clutter_texture_get_base_size: - * @texture: a #ClutterTexture - * @width: (out): return location for the width, or %NULL - * @height: (out): return location for the height, or %NULL - * - * Gets the size in pixels of the untransformed underlying image - * - * Deprecated: 1.12 - */ -void -clutter_texture_get_base_size (ClutterTexture *texture, - gint *width, - gint *height) -{ - g_return_if_fail (CLUTTER_IS_TEXTURE (texture)); - - if (width) - *width = texture->priv->image_width; - - if (height) - *height = texture->priv->image_height; -} - -/** - * clutter_texture_set_area_from_rgb_data: - * @texture: A #ClutterTexture - * @data: (array): Image data in RGB type colorspace. - * @has_alpha: Set to TRUE if image data has an alpha channel. - * @x: X coordinate of upper left corner of region to update. - * @y: Y coordinate of upper left corner of region to update. - * @width: Width in pixels of region to update. - * @height: Height in pixels of region to update. - * @rowstride: Distance in bytes between row starts on source buffer. - * @bpp: bytes per pixel (Currently only 3 and 4 supported, - * depending on @has_alpha) - * @flags: #ClutterTextureFlags - * @error: return location for a #GError, or %NULL - * - * Updates a sub-region of the pixel data in a #ClutterTexture. - * - * Return value: %TRUE on success, %FALSE on failure. - * - * - * - * Deprecated: 1.12 - */ -gboolean -clutter_texture_set_area_from_rgb_data (ClutterTexture *texture, - const guchar *data, - gboolean has_alpha, - gint x, - gint y, - gint width, - gint height, - gint rowstride, - gint bpp, - ClutterTextureFlags flags, - GError **error) -{ - CoglPixelFormat source_format; - CoglHandle cogl_texture; - - if (!get_pixel_format_from_texture_flags (bpp, has_alpha, flags, - &source_format)) - { - return FALSE; - } - - /* attempt to realize ... */ - if (!CLUTTER_ACTOR_IS_REALIZED (texture) && - clutter_actor_get_stage (CLUTTER_ACTOR (texture)) != NULL) - { - clutter_actor_realize (CLUTTER_ACTOR (texture)); - } - - /* due to the fudging of clutter_texture_set_cogl_texture() - * which allows setting a texture pre-realize, we may end - * up having a texture even if we couldn't realize yet. - */ - cogl_texture = clutter_texture_get_cogl_texture (texture); - if (cogl_texture == NULL) - { - g_warning ("Failed to realize actor '%s'", - _clutter_actor_get_debug_name (CLUTTER_ACTOR (texture))); - return FALSE; - } - - if (!cogl_texture_set_region (cogl_texture, - 0, 0, - x, y, width, height, - width, height, - source_format, - rowstride, - data)) - { - g_set_error (error, CLUTTER_TEXTURE_ERROR, - CLUTTER_TEXTURE_ERROR_BAD_FORMAT, - _("Failed to load the image data")); - return FALSE; - } - - g_free (texture->priv->filename); - texture->priv->filename = NULL; - - /* rename signal */ - g_signal_emit (texture, texture_signals[PIXBUF_CHANGE], 0); - - clutter_actor_queue_redraw (CLUTTER_ACTOR (texture)); - - return TRUE; -} - -static void -on_fbo_source_size_change (GObject *object, - GParamSpec *param_spec, - ClutterTexture *texture) -{ - ClutterTexturePrivate *priv = texture->priv; - gfloat w, h; - ClutterActorBox box; - gboolean status; - - status = clutter_actor_get_paint_box (priv->fbo_source, &box); - if (status) - clutter_actor_box_get_size (&box, &w, &h); - - /* In the end we will size the framebuffer according to the paint - * box, but for code that does: - * tex = clutter_texture_new_from_actor (src); - * clutter_actor_get_size (tex, &width, &height); - * it seems more helpfull to return the src actor size if it has a - * degenerate paint box. The most likely reason it will have a - * degenerate paint box is simply that the src currently has no - * parent. */ - if (status == FALSE || w == 0 || h == 0) - clutter_actor_get_size (priv->fbo_source, &w, &h); - - /* We can't create a texture with a width or height of 0... */ - w = MAX (1, w); - h = MAX (1, h); - - if (w != priv->image_width || h != priv->image_height) - { - CoglTextureFlags flags = COGL_TEXTURE_NONE; - CoglHandle tex; - - /* tear down the FBO */ - if (priv->fbo_handle != NULL) - cogl_object_unref (priv->fbo_handle); - - texture_free_gl_resources (texture); - - priv->image_width = w; - priv->image_height = h; - - flags |= COGL_TEXTURE_NO_SLICING; - - tex = cogl_texture_new_with_size (MAX (priv->image_width, 1), - MAX (priv->image_height, 1), - flags, - COGL_PIXEL_FORMAT_RGBA_8888_PRE); - - cogl_pipeline_set_layer_texture (priv->pipeline, 0, tex); - - priv->fbo_handle = cogl_offscreen_new_to_texture (tex); - - /* The pipeline now has a reference to the texture so it will - stick around */ - cogl_object_unref (tex); - - if (priv->fbo_handle == NULL) - { - g_warning ("%s: Offscreen texture creation failed", G_STRLOC); - return; - } - - clutter_actor_set_size (CLUTTER_ACTOR (texture), w, h); - } -} - -static void -on_fbo_parent_change (ClutterActor *actor, - ClutterActor *old_parent, - ClutterTexture *texture) -{ - ClutterActor *parent = CLUTTER_ACTOR(texture); - - while ((parent = clutter_actor_get_parent (parent)) != NULL) - { - if (parent == actor) - { - g_warning ("Offscreen texture is ancestor of source!"); - /* Desperate but will avoid infinite loops */ - clutter_actor_remove_child (parent, actor); - } - } -} - -static void -fbo_source_queue_redraw_cb (ClutterActor *source, - ClutterActor *origin, - ClutterTexture *texture) -{ - clutter_actor_queue_redraw (CLUTTER_ACTOR (texture)); -} - -static void -fbo_source_queue_relayout_cb (ClutterActor *source, - ClutterTexture *texture) -{ - clutter_actor_queue_relayout (CLUTTER_ACTOR (texture)); -} - -/** - * clutter_texture_new_from_actor: - * @actor: A source #ClutterActor - * - * Creates a new #ClutterTexture object with its source a prexisting - * actor (and associated children). The textures content will contain - * 'live' redirected output of the actors scene. - * - * Note this function is intented as a utility call for uniformly applying - * shaders to groups and other potential visual effects. It requires that - * the %CLUTTER_FEATURE_OFFSCREEN feature is supported by the current backend - * and the target system. - * - * Some tips on usage: - * - * - * - * The source actor must be made visible (i.e by calling - * #clutter_actor_show). - * - * - * The source actor must have a parent in order for it to be - * allocated a size from the layouting mechanism. If the source - * actor does not have a parent when this function is called then - * the ClutterTexture will adopt it and allocate it at its - * preferred size. Using this you can clone an actor that is - * otherwise not displayed. Because of this feature if you do - * intend to display the source actor then you must make sure that - * the actor is parented before calling - * clutter_texture_new_from_actor() or that you unparent it before - * adding it to a container. - * - * - * When getting the image for the clone texture, Clutter - * will attempt to render the source actor exactly as it would - * appear if it was rendered on screen. The source actor's parent - * transformations are taken into account. Therefore if your - * source actor is rotated along the X or Y axes so that it has - * some depth, the texture will appear differently depending on - * the on-screen location of the source actor. While painting the - * source actor, Clutter will set up a temporary asymmetric - * perspective matrix as the projection matrix so that the source - * actor will be projected as if a small section of the screen was - * being viewed. Before version 0.8.2, an orthogonal identity - * projection was used which meant that the source actor would be - * clipped if any part of it was not on the zero Z-plane. - * - * - * Avoid reparenting the source with the created texture. - * - * - * A group can be padded with a transparent rectangle as to - * provide a border to contents for shader output (blurring text - * for example). - * - * - * The texture will automatically resize to contain a further - * transformed source. However, this involves overhead and can be - * avoided by placing the source actor in a bounding group - * sized large enough to contain any child tranformations. - * - * - * Uploading pixel data to the texture (e.g by using - * clutter_texture_set_from_file()) will destroy the offscreen texture - * data and end redirection. - * - * - * cogl_texture_get_data() with the handle returned by - * clutter_texture_get_cogl_texture() can be used to read the - * offscreen texture pixels into a pixbuf. - * - * - * - * Return value: A newly created #ClutterTexture object, or %NULL on failure. - * - * - * - * Deprecated: 1.8: Use the #ClutterOffscreenEffect and #ClutterShaderEffect - * directly on the intended #ClutterActor to replace the functionality of - * this function. - */ -ClutterActor * -clutter_texture_new_from_actor (ClutterActor *actor) -{ - ClutterTexture *texture; - ClutterTexturePrivate *priv; - gfloat w, h; - ClutterActorBox box; - gboolean status; - - g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), NULL); - - if (clutter_feature_available (CLUTTER_FEATURE_OFFSCREEN) == FALSE) - return NULL; - - if (!CLUTTER_ACTOR_IS_REALIZED (actor)) - { - clutter_actor_realize (actor); - - if (!CLUTTER_ACTOR_IS_REALIZED (actor)) - return NULL; - } - - status = clutter_actor_get_paint_box (actor, &box); - if (status) - clutter_actor_box_get_size (&box, &w, &h); - - /* In the end we will size the framebuffer according to the paint - * box, but for code that does: - * tex = clutter_texture_new_from_actor (src); - * clutter_actor_get_size (tex, &width, &height); - * it seems more helpfull to return the src actor size if it has a - * degenerate paint box. The most likely reason it will have a - * degenerate paint box is simply that the src currently has no - * parent. */ - if (status == FALSE || w == 0 || h == 0) - clutter_actor_get_size (actor, &w, &h); - - /* We can't create a 0x0 fbo so always bump the size up to at least - * 1 */ - w = MAX (1, w); - h = MAX (1, h); - - /* Hopefully now were good.. */ - texture = g_object_new (CLUTTER_TYPE_TEXTURE, - "disable-slicing", TRUE, - NULL); - - priv = texture->priv; - - priv->fbo_source = g_object_ref_sink (actor); - - /* If the actor doesn't have a parent then claim it so that it will - get a size allocation during layout */ - if (clutter_actor_get_parent (actor) == NULL) - clutter_actor_add_child (CLUTTER_ACTOR (texture), actor); - - /* Connect up any signals which could change our underlying size */ - g_signal_connect (actor, - "notify::width", - G_CALLBACK(on_fbo_source_size_change), - texture); - g_signal_connect (actor, - "notify::height", - G_CALLBACK(on_fbo_source_size_change), - texture); - g_signal_connect (actor, - "notify::scale-x", - G_CALLBACK(on_fbo_source_size_change), - texture); - g_signal_connect (actor, - "notify::scale-y", - G_CALLBACK(on_fbo_source_size_change), - texture); - g_signal_connect (actor, - "notify::rotation-angle-x", - G_CALLBACK(on_fbo_source_size_change), - texture); - g_signal_connect (actor, - "notify::rotation-angle-y", - G_CALLBACK(on_fbo_source_size_change), - texture); - g_signal_connect (actor, - "notify::rotation-angle-z", - G_CALLBACK(on_fbo_source_size_change), - texture); - - g_signal_connect (actor, "queue-relayout", - G_CALLBACK (fbo_source_queue_relayout_cb), texture); - g_signal_connect (actor, "queue-redraw", - G_CALLBACK (fbo_source_queue_redraw_cb), texture); - - /* And a warning if the source becomes a child of the texture */ - g_signal_connect (actor, - "parent-set", - G_CALLBACK(on_fbo_parent_change), - texture); - - priv->image_width = w; - priv->image_height = h; - - clutter_actor_set_size (CLUTTER_ACTOR (texture), - priv->image_width, - priv->image_height); - - return CLUTTER_ACTOR (texture); -} - -static void -texture_fbo_free_resources (ClutterTexture *texture) -{ - ClutterTexturePrivate *priv; - - priv = texture->priv; - - if (priv->fbo_source != NULL) - { - ClutterActor *parent; - - parent = clutter_actor_get_parent (priv->fbo_source); - - /* If we parented the texture then unparent it again so that it - will lose the reference */ - if (parent == CLUTTER_ACTOR (texture)) - clutter_actor_remove_child (parent, priv->fbo_source); - - g_signal_handlers_disconnect_by_func - (priv->fbo_source, - G_CALLBACK(on_fbo_parent_change), - texture); - - g_signal_handlers_disconnect_by_func - (priv->fbo_source, - G_CALLBACK(on_fbo_source_size_change), - texture); - - g_signal_handlers_disconnect_by_func - (priv->fbo_source, - G_CALLBACK(fbo_source_queue_relayout_cb), - texture); - - g_signal_handlers_disconnect_by_func - (priv->fbo_source, - G_CALLBACK(fbo_source_queue_redraw_cb), - texture); - - g_object_unref (priv->fbo_source); - - priv->fbo_source = NULL; - } - - if (priv->fbo_handle != NULL) - { - cogl_object_unref (priv->fbo_handle); - priv->fbo_handle = NULL; - } -} - -/** - * clutter_texture_set_sync_size: - * @texture: a #ClutterTexture - * @sync_size: %TRUE if the texture should have the same size of the - * underlying image data - * - * Sets whether @texture should have the same preferred size as the - * underlying image data. - * - * - * - * Deprecated: 1.12 - */ -void -clutter_texture_set_sync_size (ClutterTexture *texture, - gboolean sync_size) -{ - ClutterTexturePrivate *priv; - - g_return_if_fail (CLUTTER_IS_TEXTURE (texture)); - - priv = texture->priv; - - if (priv->sync_actor_size != sync_size) - { - priv->sync_actor_size = sync_size; - - clutter_actor_queue_relayout (CLUTTER_ACTOR (texture)); - - g_object_notify_by_pspec (G_OBJECT (texture), obj_props[PROP_SYNC_SIZE]); - } -} - -/** - * clutter_texture_get_sync_size: - * @texture: a #ClutterTexture - * - * Retrieves the value set with clutter_texture_set_sync_size() - * - * Return value: %TRUE if the #ClutterTexture should have the same - * preferred size of the underlying image data - * - * - * - * Deprecated: 1.12 - */ -gboolean -clutter_texture_get_sync_size (ClutterTexture *texture) -{ - g_return_val_if_fail (CLUTTER_IS_TEXTURE (texture), FALSE); - - return texture->priv->sync_actor_size; -} - -/** - * clutter_texture_set_repeat: - * @texture: a #ClutterTexture - * @repeat_x: %TRUE if the texture should repeat horizontally - * @repeat_y: %TRUE if the texture should repeat vertically - * - * Sets whether the @texture should repeat horizontally or - * vertically when the actor size is bigger than the image size - * - * - * - * Deprecated: 1.12 - */ -void -clutter_texture_set_repeat (ClutterTexture *texture, - gboolean repeat_x, - gboolean repeat_y) -{ - ClutterTexturePrivate *priv; - gboolean changed = FALSE; - - g_return_if_fail (CLUTTER_IS_TEXTURE (texture)); - - priv = texture->priv; - - g_object_freeze_notify (G_OBJECT (texture)); - - if (priv->repeat_x != repeat_x) - { - priv->repeat_x = repeat_x; - - g_object_notify_by_pspec (G_OBJECT (texture), obj_props[PROP_REPEAT_X]); - - changed = TRUE; - } - - if (priv->repeat_y != repeat_y) - { - priv->repeat_y = repeat_y; - - g_object_notify_by_pspec (G_OBJECT (texture), obj_props[PROP_REPEAT_Y]); - - changed = TRUE; - } - - if (changed) - clutter_actor_queue_redraw (CLUTTER_ACTOR (texture)); - - g_object_thaw_notify (G_OBJECT (texture)); -} - -/** - * clutter_texture_get_repeat: - * @texture: a #ClutterTexture - * @repeat_x: (out): return location for the horizontal repeat - * @repeat_y: (out): return location for the vertical repeat - * - * Retrieves the horizontal and vertical repeat values set - * using clutter_texture_set_repeat() - * - * - * - * Deprecated: 1.12 - */ -void -clutter_texture_get_repeat (ClutterTexture *texture, - gboolean *repeat_x, - gboolean *repeat_y) -{ - g_return_if_fail (CLUTTER_IS_TEXTURE (texture)); - - if (repeat_x != NULL) - *repeat_x = texture->priv->repeat_x; - - if (repeat_y != NULL) - *repeat_y = texture->priv->repeat_y; -} - -/** - * clutter_texture_get_pixel_format: - * @texture: a #ClutterTexture - * - * Retrieves the pixel format used by @texture. This is - * equivalent to: - * - * |[ - * handle = clutter_texture_get_pixel_format (texture); - * - * if (handle != COGL_INVALID_HANDLE) - * format = cogl_texture_get_format (handle); - * ]| - * - * Return value: a #CoglPixelFormat value - * - * - * - * Deprecated: 1.12 - */ -CoglPixelFormat -clutter_texture_get_pixel_format (ClutterTexture *texture) -{ - CoglHandle cogl_texture; - - g_return_val_if_fail (CLUTTER_IS_TEXTURE (texture), COGL_PIXEL_FORMAT_ANY); - - cogl_texture = clutter_texture_get_cogl_texture (texture); - if (cogl_texture == NULL) - return COGL_PIXEL_FORMAT_ANY; - - return cogl_texture_get_format (cogl_texture); -} - -/** - * clutter_texture_set_keep_aspect_ratio: - * @texture: a #ClutterTexture - * @keep_aspect: %TRUE to maintain aspect ratio - * - * Sets whether @texture should have a preferred size maintaining - * the aspect ratio of the underlying image - * - * - * - * Deprecated: 1.12 - */ -void -clutter_texture_set_keep_aspect_ratio (ClutterTexture *texture, - gboolean keep_aspect) -{ - ClutterTexturePrivate *priv; - - g_return_if_fail (CLUTTER_IS_TEXTURE (texture)); - - priv = texture->priv; - - if (priv->keep_aspect_ratio != keep_aspect) - { - priv->keep_aspect_ratio = keep_aspect; - - clutter_actor_queue_relayout (CLUTTER_ACTOR (texture)); - - g_object_notify_by_pspec (G_OBJECT (texture), obj_props[PROP_KEEP_ASPECT_RATIO]); - } -} - -/** - * clutter_texture_get_keep_aspect_ratio: - * @texture: a #ClutterTexture - * - * Retrieves the value set using clutter_texture_set_keep_aspect_ratio() - * - * Return value: %TRUE if the #ClutterTexture should maintain the - * aspect ratio of the underlying image - * - * - * - * Deprecated: 1.12 - */ -gboolean -clutter_texture_get_keep_aspect_ratio (ClutterTexture *texture) -{ - g_return_val_if_fail (CLUTTER_IS_TEXTURE (texture), FALSE); - - return texture->priv->keep_aspect_ratio; -} - -/** - * clutter_texture_set_load_async: - * @texture: a #ClutterTexture - * @load_async: %TRUE if the texture should asynchronously load data - * from a filename - * - * Sets whether @texture should use a worker thread to load the data - * from disk asynchronously. Setting @load_async to %TRUE will make - * clutter_texture_set_from_file() return immediately. - * - * See the #ClutterTexture:load-async property documentation, and - * clutter_texture_set_load_data_async(). - * - * - * - * Deprecated: 1.12 - */ -void -clutter_texture_set_load_async (ClutterTexture *texture, - gboolean load_async) -{ - ClutterTexturePrivate *priv; - - g_return_if_fail (CLUTTER_IS_TEXTURE (texture)); - - priv = texture->priv; - - load_async = !!load_async; - - if (priv->load_async_set != load_async) - { - priv->load_data_async = load_async; - priv->load_size_async = load_async; - - priv->load_async_set = load_async; - - g_object_notify_by_pspec (G_OBJECT (texture), obj_props[PROP_LOAD_ASYNC]); - g_object_notify_by_pspec (G_OBJECT (texture), obj_props[PROP_LOAD_DATA_ASYNC]); - } -} - -/** - * clutter_texture_get_load_async: - * @texture: a #ClutterTexture - * - * Retrieves the value set using clutter_texture_set_load_async() - * - * Return value: %TRUE if the #ClutterTexture should load the data from - * disk asynchronously - * - * - * - * Deprecated: 1.12 - */ -gboolean -clutter_texture_get_load_async (ClutterTexture *texture) -{ - g_return_val_if_fail (CLUTTER_IS_TEXTURE (texture), FALSE); - - return texture->priv->load_async_set; -} - -/** - * clutter_texture_set_load_data_async: - * @texture: a #ClutterTexture - * @load_async: %TRUE if the texture should asynchronously load data - * from a filename - * - * Sets whether @texture should use a worker thread to load the data - * from disk asynchronously. Setting @load_async to %TRUE will make - * clutter_texture_set_from_file() block until the #ClutterTexture has - * determined the width and height of the image data. - * - * See the #ClutterTexture:load-async property documentation, and - * clutter_texture_set_load_async(). - * - * - * - * Deprecated: 1.12 - */ -void -clutter_texture_set_load_data_async (ClutterTexture *texture, - gboolean load_async) -{ - ClutterTexturePrivate *priv; - - g_return_if_fail (CLUTTER_IS_TEXTURE (texture)); - - priv = texture->priv; - - if (priv->load_data_async != load_async) - { - /* load-data-async always unsets load-size-async */ - priv->load_data_async = load_async; - priv->load_size_async = FALSE; - - priv->load_async_set = load_async; - - g_object_notify_by_pspec (G_OBJECT (texture), obj_props[PROP_LOAD_ASYNC]); - g_object_notify_by_pspec (G_OBJECT (texture), obj_props[PROP_LOAD_DATA_ASYNC]); - } -} - -/** - * clutter_texture_get_load_data_async: - * @texture: a #ClutterTexture - * - * Retrieves the value set by clutter_texture_set_load_data_async() - * - * Return value: %TRUE if the #ClutterTexture should load the image - * data from a file asynchronously - * - * - * - * Deprecated: 1.12 - */ -gboolean -clutter_texture_get_load_data_async (ClutterTexture *texture) -{ - g_return_val_if_fail (CLUTTER_IS_TEXTURE (texture), FALSE); - - return texture->priv->load_async_set && - texture->priv->load_data_async; -} - -/** - * clutter_texture_set_pick_with_alpha: - * @texture: a #ClutterTexture - * @pick_with_alpha: %TRUE if the alpha channel should affect the - * picking shape - * - * Sets whether @texture should have it's shape defined by the alpha - * channel when picking. - * - * Be aware that this is a bit more costly than the default picking - * due to the texture lookup, extra test against the alpha value and - * the fact that it will also interrupt the batching of geometry done - * internally. - * - * Also there is currently no control over the threshold used to - * determine what value of alpha is considered pickable, and so only - * fully opaque parts of the texture will react to picking. - * - * - * - * Deprecated: 1.12 - */ -void -clutter_texture_set_pick_with_alpha (ClutterTexture *texture, - gboolean pick_with_alpha) -{ - ClutterTexturePrivate *priv; - - g_return_if_fail (CLUTTER_IS_TEXTURE (texture)); - - priv = texture->priv; - - if (priv->pick_with_alpha == pick_with_alpha) - return; - - if (!pick_with_alpha && priv->pick_pipeline != NULL) - { - cogl_object_unref (priv->pick_pipeline); - priv->pick_pipeline = NULL; - } - - /* NB: the pick pipeline is created lazily when we first pick */ - priv->pick_with_alpha = pick_with_alpha; - - /* NB: actors are expected to call clutter_actor_queue_redraw when - * ever some state changes that will affect painting *or picking... - */ - clutter_actor_queue_redraw (CLUTTER_ACTOR (texture)); -} - -/** - * clutter_texture_get_pick_with_alpha: - * @texture: a #ClutterTexture - * - * Retrieves the value set by clutter_texture_set_load_data_async() - * - * Return value: %TRUE if the #ClutterTexture should define its shape - * using the alpha channel when picking. - * - * - * - * Deprecated: 1.12 - */ -gboolean -clutter_texture_get_pick_with_alpha (ClutterTexture *texture) -{ - g_return_val_if_fail (CLUTTER_IS_TEXTURE (texture), FALSE); - - return texture->priv->pick_with_alpha ? TRUE : FALSE; -} - diff --git a/clutter/deprecated/clutter-texture.h b/clutter/deprecated/clutter-texture.h deleted file mode 100644 index f1bd01c01..000000000 --- a/clutter/deprecated/clutter-texture.h +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * Copyright (C) 2006 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_TEXTURE_DEPRECATED_H__ -#define __CLUTTER_TEXTURE_DEPRECATED_H__ - -#include - -G_BEGIN_DECLS - -CLUTTER_DEPRECATED_IN_1_12_FOR(clutter_image_new) -ClutterActor * clutter_texture_new (void); - -CLUTTER_DEPRECATED_IN_1_12 -ClutterActor * clutter_texture_new_from_file (const gchar *filename, - GError **error); - -CLUTTER_DEPRECATED_IN_1_12 -gboolean clutter_texture_set_from_file (ClutterTexture *texture, - const gchar *filename, - GError **error); -CLUTTER_DEPRECATED_IN_1_12_FOR(clutter_image_set_data) -gboolean clutter_texture_set_from_rgb_data (ClutterTexture *texture, - const guchar *data, - gboolean has_alpha, - gint width, - gint height, - gint rowstride, - gint bpp, - ClutterTextureFlags flags, - GError **error); -CLUTTER_DEPRECATED_IN_1_12_FOR(clutter_image_set_area) -gboolean clutter_texture_set_area_from_rgb_data (ClutterTexture *texture, - const guchar *data, - gboolean has_alpha, - gint x, - gint y, - gint width, - gint height, - gint rowstride, - gint bpp, - ClutterTextureFlags flags, - GError **error); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_texture_get_base_size (ClutterTexture *texture, - gint *width, - gint *height); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_texture_set_filter_quality (ClutterTexture *texture, - ClutterTextureQuality filter_quality); -CLUTTER_DEPRECATED_IN_1_12 -ClutterTextureQuality clutter_texture_get_filter_quality (ClutterTexture *texture); -CLUTTER_DEPRECATED_IN_1_12 -CoglHandle clutter_texture_get_cogl_texture (ClutterTexture *texture); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_texture_set_cogl_texture (ClutterTexture *texture, - CoglHandle cogl_tex); -CLUTTER_DEPRECATED_IN_1_12 -CoglHandle clutter_texture_get_cogl_material (ClutterTexture *texture); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_texture_set_cogl_material (ClutterTexture *texture, - CoglHandle cogl_material); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_texture_set_sync_size (ClutterTexture *texture, - gboolean sync_size); -CLUTTER_DEPRECATED_IN_1_12 -gboolean clutter_texture_get_sync_size (ClutterTexture *texture); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_texture_set_repeat (ClutterTexture *texture, - gboolean repeat_x, - gboolean repeat_y); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_texture_get_repeat (ClutterTexture *texture, - gboolean *repeat_x, - gboolean *repeat_y); -CLUTTER_DEPRECATED_IN_1_12 -CoglPixelFormat clutter_texture_get_pixel_format (ClutterTexture *texture); -CLUTTER_DEPRECATED_IN_1_12 -gint clutter_texture_get_max_tile_waste (ClutterTexture *texture); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_texture_set_keep_aspect_ratio (ClutterTexture *texture, - gboolean keep_aspect); -CLUTTER_DEPRECATED_IN_1_12 -gboolean clutter_texture_get_keep_aspect_ratio (ClutterTexture *texture); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_texture_set_load_async (ClutterTexture *texture, - gboolean load_async); -CLUTTER_DEPRECATED_IN_1_12 -gboolean clutter_texture_get_load_async (ClutterTexture *texture); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_texture_set_load_data_async (ClutterTexture *texture, - gboolean load_async); -CLUTTER_DEPRECATED_IN_1_12 -gboolean clutter_texture_get_load_data_async (ClutterTexture *texture); -CLUTTER_DEPRECATED_IN_1_12 -void clutter_texture_set_pick_with_alpha (ClutterTexture *texture, - gboolean pick_with_alpha); -CLUTTER_DEPRECATED_IN_1_12 -gboolean clutter_texture_get_pick_with_alpha (ClutterTexture *texture); - -CLUTTER_DEPRECATED_IN_1_8_FOR(ClutterOffscreenEffect) -ClutterActor * clutter_texture_new_from_actor (ClutterActor *actor); - -CLUTTER_DEPRECATED_IN_1_10 -gboolean clutter_texture_set_from_yuv_data (ClutterTexture *texture, - const guchar *data, - gint width, - gint height, - ClutterTextureFlags flags, - GError **error); - -G_END_DECLS - -#endif /* __CLUTTER_TEXTURE_DEPRECATED_H__ */ diff --git a/clutter/deprecated/clutter-timeline.h b/clutter/deprecated/clutter-timeline.h deleted file mode 100644 index e99c7df39..000000000 --- a/clutter/deprecated/clutter-timeline.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Copyright (C) 2012 Intel Corp - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#ifndef __CLUTTER_TIMELINE_PRIVATE_H__ -#define __CLUTTER_TIMELINE_PRIVATE_H__ - -#include - -G_BEGIN_DECLS - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_timeline_new) -ClutterTimeline * clutter_timeline_clone (ClutterTimeline *timeline); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_timeline_set_repeat_count) -void clutter_timeline_set_loop (ClutterTimeline *timeline, - gboolean loop); - -CLUTTER_DEPRECATED_IN_1_10_FOR(clutter_timeline_get_repeat_count) -gboolean clutter_timeline_get_loop (ClutterTimeline *timeline); - -G_END_DECLS - -#endif /* __CLUTTER_TIMELINE_PRIVATE_H__ */ diff --git a/clutter/deprecated/clutter-timeout-interval.c b/clutter/deprecated/clutter-timeout-interval.c deleted file mode 100644 index 52ee18029..000000000 --- a/clutter/deprecated/clutter-timeout-interval.c +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Neil Roberts - * - * Copyright (C) 2009 Intel Corporation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#define CLUTTER_DISABLE_DEPRECATION_WARNINGS - -/* This file contains the common code to check whether an interval has - expired used in clutter-frame-source and clutter-timeout-pool. */ - -#include "clutter-timeout-interval.h" - -void -_clutter_timeout_interval_init (ClutterTimeoutInterval *interval, - guint fps) -{ -#if GLIB_CHECK_VERSION (2, 27, 3) - interval->start_time = g_get_monotonic_time () / 1000; -#else - { - GTimeVal start_time; - g_get_current_time (&start_time); - interval->start_time = start_time.tv_sec * 1000 - + start_time.tv_usec / 1000; - } -#endif - - interval->fps = fps; - interval->frame_count = 0; -} - -static gint64 -_clutter_timeout_interval_get_ticks (gint64 current_time, - ClutterTimeoutInterval *interval) -{ - return MAX (current_time - interval->start_time, 0); -} - -gboolean -_clutter_timeout_interval_prepare (gint64 current_time, - ClutterTimeoutInterval *interval, - gint *delay) -{ - gint elapsed_time, new_frame_num; - - elapsed_time = _clutter_timeout_interval_get_ticks (current_time, interval); - new_frame_num = elapsed_time * interval->fps / 1000; - - /* If time has gone backwards or the time since the last frame is - greater than the two frames worth then reset the time and do a - frame now */ - if (new_frame_num < interval->frame_count || - new_frame_num - interval->frame_count > 2) - { - /* Get the frame time rounded up to the nearest ms */ - guint frame_time = (1000 + interval->fps - 1) / interval->fps; - - /* Reset the start time */ - interval->start_time = current_time; - - /* Move the start time as if one whole frame has elapsed */ - interval->start_time -= frame_time; - - interval->frame_count = 0; - - if (delay) - *delay = 0; - - return TRUE; - } - else if (new_frame_num > interval->frame_count) - { - if (delay) - *delay = 0; - - return TRUE; - } - else - { - if (delay) - *delay = ((interval->frame_count + 1) * 1000 / interval->fps - - elapsed_time); - - return FALSE; - } -} - -gboolean -_clutter_timeout_interval_dispatch (ClutterTimeoutInterval *interval, - GSourceFunc callback, - gpointer user_data) -{ - if ((* callback) (user_data)) - { - interval->frame_count++; - - return TRUE; - } - - return FALSE; -} - -gint -_clutter_timeout_interval_compare_expiration (const ClutterTimeoutInterval *a, - const ClutterTimeoutInterval *b) -{ - guint a_delay = 1000 / a->fps; - guint b_delay = 1000 / b->fps; - gint64 b_difference; - gint comparison; - - b_difference = a->start_time - b->start_time; - - comparison = ((gint) ((a->frame_count + 1) * a_delay) - - (gint) ((b->frame_count + 1) * b_delay + b_difference)); - - return (comparison < 0 ? -1 - : comparison > 0 ? 1 - : 0); -} diff --git a/clutter/deprecated/clutter-timeout-interval.h b/clutter/deprecated/clutter-timeout-interval.h deleted file mode 100644 index 57df959a8..000000000 --- a/clutter/deprecated/clutter-timeout-interval.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Neil Roberts - * - * Copyright (C) 2009 Intel Corporation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#ifndef __CLUTTER_TIMEOUT_INTERVAL_H__ -#define __CLUTTER_TIMEOUT_INTERVAL_H__ - -#include - -G_BEGIN_DECLS - -typedef struct _ClutterTimeoutInterval ClutterTimeoutInterval; - -struct _ClutterTimeoutInterval -{ - /* milliseconds */ - gint64 start_time; - - guint frame_count; - guint fps; -}; - -void _clutter_timeout_interval_init (ClutterTimeoutInterval *interval, - guint fps); - -gboolean _clutter_timeout_interval_prepare (gint64 current_time, - ClutterTimeoutInterval *interval, - gint *delay); - -gboolean _clutter_timeout_interval_dispatch (ClutterTimeoutInterval *interval, - GSourceFunc callback, - gpointer user_data); - -gint _clutter_timeout_interval_compare_expiration (const ClutterTimeoutInterval *a, - const ClutterTimeoutInterval *b); - -G_END_DECLS - -#endif /* __CLUTTER_TIMEOUT_INTERVAL_H__ */ diff --git a/clutter/deprecated/clutter-timeout-pool.c b/clutter/deprecated/clutter-timeout-pool.c deleted file mode 100644 index 21c5f33cd..000000000 --- a/clutter/deprecated/clutter-timeout-pool.c +++ /dev/null @@ -1,500 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * Copyright (C) 2006 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - * - * - * ClutterTimeoutPool: pool of timeout functions using the same slice of - * the GLib main loop - * - * Author: Emmanuele Bassi - * - * Based on similar code by Tristan van Berkom - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#define CLUTTER_DISABLE_DEPRECATION_WARNINGS -#include "deprecated/clutter-main.h" - -#include "clutter-timeout-pool.h" - -#include "clutter-debug.h" -#include "clutter-timeout-interval.h" - -typedef struct _ClutterTimeout ClutterTimeout; -typedef enum { - CLUTTER_TIMEOUT_NONE = 0, - CLUTTER_TIMEOUT_READY = 1 << 1 -} ClutterTimeoutFlags; - -struct _ClutterTimeout -{ - guint id; - ClutterTimeoutFlags flags; - gint refcount; - - ClutterTimeoutInterval interval; - - GSourceFunc func; - gpointer data; - GDestroyNotify notify; -}; - -struct _ClutterTimeoutPool -{ - GSource source; - - guint next_id; - - GList *timeouts; - GList *dispatched_timeouts; - - gint ready; - - guint id; -}; - -#define TIMEOUT_READY(timeout) (timeout->flags & CLUTTER_TIMEOUT_READY) - -static gboolean clutter_timeout_pool_prepare (GSource *source, - gint *next_timeout); -static gboolean clutter_timeout_pool_check (GSource *source); -static gboolean clutter_timeout_pool_dispatch (GSource *source, - GSourceFunc callback, - gpointer data); -static void clutter_timeout_pool_finalize (GSource *source); - -static GSourceFuncs clutter_timeout_pool_funcs = -{ - clutter_timeout_pool_prepare, - clutter_timeout_pool_check, - clutter_timeout_pool_dispatch, - clutter_timeout_pool_finalize -}; - -static gint -clutter_timeout_sort (gconstpointer a, - gconstpointer b) -{ - const ClutterTimeout *t_a = a; - const ClutterTimeout *t_b = b; - - /* Keep 'ready' timeouts at the front */ - if (TIMEOUT_READY (t_a)) - return -1; - - if (TIMEOUT_READY (t_b)) - return 1; - - return _clutter_timeout_interval_compare_expiration (&t_a->interval, - &t_b->interval); -} - -static gint -clutter_timeout_find_by_id (gconstpointer a, - gconstpointer b) -{ - const ClutterTimeout *t_a = a; - - return t_a->id == GPOINTER_TO_UINT (b) ? 0 : 1; -} - -static ClutterTimeout * -clutter_timeout_new (guint fps) -{ - ClutterTimeout *timeout; - - timeout = g_slice_new0 (ClutterTimeout); - _clutter_timeout_interval_init (&timeout->interval, fps); - timeout->flags = CLUTTER_TIMEOUT_NONE; - timeout->refcount = 1; - - return timeout; -} - -static gboolean -clutter_timeout_prepare (ClutterTimeoutPool *pool, - ClutterTimeout *timeout, - gint *next_timeout) -{ - GSource *source = (GSource *) pool; - gint64 now; - -#if GLIB_CHECK_VERSION (2, 27, 3) - now = g_source_get_time (source) / 1000; -#else - { - GTimeVal source_time; - g_source_get_current_time (source, &source_time); - now = source_time.tv_sec * 1000 + source_time.tv_usec / 1000; - } -#endif - - return _clutter_timeout_interval_prepare (now, - &timeout->interval, - next_timeout); -} - -/* ref and unref are always called under the main Clutter lock, so there - * is not need for us to use g_atomic_int_* API. - */ - -static ClutterTimeout * -clutter_timeout_ref (ClutterTimeout *timeout) -{ - g_return_val_if_fail (timeout != NULL, timeout); - g_return_val_if_fail (timeout->refcount > 0, timeout); - - timeout->refcount += 1; - - return timeout; -} - -static void -clutter_timeout_unref (ClutterTimeout *timeout) -{ - g_return_if_fail (timeout != NULL); - g_return_if_fail (timeout->refcount > 0); - - timeout->refcount -= 1; - - if (timeout->refcount == 0) - { - if (timeout->notify) - timeout->notify (timeout->data); - - g_slice_free (ClutterTimeout, timeout); - } -} - -static void -clutter_timeout_free (ClutterTimeout *timeout) -{ - if (G_LIKELY (timeout)) - { - if (timeout->notify) - timeout->notify (timeout->data); - - g_slice_free (ClutterTimeout, timeout); - } -} - -static gboolean -clutter_timeout_pool_prepare (GSource *source, - gint *next_timeout) -{ - ClutterTimeoutPool *pool = (ClutterTimeoutPool *) source; - GList *l = pool->timeouts; - - /* the pool is ready if the first timeout is ready */ - if (l && l->data) - { - ClutterTimeout *timeout = l->data; - return clutter_timeout_prepare (pool, timeout, next_timeout); - } - else - { - *next_timeout = -1; - return FALSE; - } -} - -static gboolean -clutter_timeout_pool_check (GSource *source) -{ - ClutterTimeoutPool *pool = (ClutterTimeoutPool *) source; - GList *l; - - clutter_threads_enter (); - - for (l = pool->timeouts; l; l = l->next) - { - ClutterTimeout *timeout = l->data; - - /* since the timeouts are sorted by expiration, as soon - * as we get a check returning FALSE we know that the - * following timeouts are not expiring, so we break as - * soon as possible - */ - if (clutter_timeout_prepare (pool, timeout, NULL)) - { - timeout->flags |= CLUTTER_TIMEOUT_READY; - pool->ready += 1; - } - else - break; - } - - clutter_threads_leave (); - - return (pool->ready > 0); -} - -static gboolean -clutter_timeout_pool_dispatch (GSource *source, - GSourceFunc func, - gpointer data) -{ - ClutterTimeoutPool *pool = (ClutterTimeoutPool *) source; - GList *dispatched_timeouts; - - /* the main loop might have predicted this, so we repeat the - * check for ready timeouts. - */ - if (!pool->ready) - clutter_timeout_pool_check (source); - - clutter_threads_enter (); - - /* Iterate by moving the actual start of the list along so that it - * can cope with adds and removes while a timeout is being dispatched - */ - while (pool->timeouts && pool->timeouts->data && pool->ready-- > 0) - { - ClutterTimeout *timeout = pool->timeouts->data; - GList *l; - - /* One of the ready timeouts may have been removed during dispatch, - * in which case pool->ready will be wrong, but the ready timeouts - * are always kept at the start of the list so we can stop once - * we've reached the first non-ready timeout - */ - if (!(TIMEOUT_READY (timeout))) - break; - - /* Add a reference to the timeout so it can't disappear - * while it's being dispatched - */ - clutter_timeout_ref (timeout); - - timeout->flags &= ~CLUTTER_TIMEOUT_READY; - - /* Move the list node to a list of dispatched timeouts */ - l = pool->timeouts; - if (l->next) - l->next->prev = NULL; - - pool->timeouts = l->next; - - if (pool->dispatched_timeouts) - pool->dispatched_timeouts->prev = l; - - l->prev = NULL; - l->next = pool->dispatched_timeouts; - pool->dispatched_timeouts = l; - - if (!_clutter_timeout_interval_dispatch (&timeout->interval, - timeout->func, timeout->data)) - { - /* The timeout may have already been removed, but nothing - * can be added to the dispatched_timeout list except in this - * function so it will always either be at the head of the - * dispatched list or have been removed - */ - if (pool->dispatched_timeouts && - pool->dispatched_timeouts->data == timeout) - { - pool->dispatched_timeouts = - g_list_delete_link (pool->dispatched_timeouts, - pool->dispatched_timeouts); - - /* Remove the reference that was held by it being in the list */ - clutter_timeout_unref (timeout); - } - } - - clutter_timeout_unref (timeout); - } - - /* Re-insert the dispatched timeouts in sorted order */ - dispatched_timeouts = pool->dispatched_timeouts; - while (dispatched_timeouts) - { - ClutterTimeout *timeout = dispatched_timeouts->data; - GList *next = dispatched_timeouts->next; - - if (timeout) - pool->timeouts = g_list_insert_sorted (pool->timeouts, timeout, - clutter_timeout_sort); - - dispatched_timeouts = next; - } - - g_list_free (pool->dispatched_timeouts); - pool->dispatched_timeouts = NULL; - - pool->ready = 0; - - clutter_threads_leave (); - - return TRUE; -} - -static void -clutter_timeout_pool_finalize (GSource *source) -{ - ClutterTimeoutPool *pool = (ClutterTimeoutPool *) source; - - /* force destruction */ - g_list_foreach (pool->timeouts, (GFunc) clutter_timeout_free, NULL); - g_list_free (pool->timeouts); -} - -/** - * clutter_timeout_pool_new: - * @priority: the priority of the timeout pool. Typically this will - * be #G_PRIORITY_DEFAULT - * - * Creates a new timeout pool source. A timeout pool should be used when - * multiple timeout functions, running at the same priority, are needed and - * the g_timeout_add() API might lead to starvation of the time slice of - * the main loop. A timeout pool allocates a single time slice of the main - * loop and runs every timeout function inside it. The timeout pool is - * always sorted, so that the extraction of the next timeout function is - * a constant time operation. - * - * Return value: the newly created #ClutterTimeoutPool. The created pool - * is owned by the GLib default context and will be automatically - * destroyed when the context is destroyed. It is possible to force - * the destruction of the timeout pool using g_source_destroy() - * - * - * - * Deprecated: 1.6 - */ -ClutterTimeoutPool * -clutter_timeout_pool_new (gint priority) -{ - ClutterTimeoutPool *pool; - GSource *source; - - source = g_source_new (&clutter_timeout_pool_funcs, - sizeof (ClutterTimeoutPool)); - if (!source) - return NULL; - - g_source_set_name (source, "Clutter timeout pool"); - - if (priority != G_PRIORITY_DEFAULT) - g_source_set_priority (source, priority); - - pool = (ClutterTimeoutPool *) source; - pool->next_id = 1; - pool->id = g_source_attach (source, NULL); - - /* let the default GLib context manage the pool */ - g_source_unref (source); - - return pool; -} - -/** - * clutter_timeout_pool_add: - * @pool: a #ClutterTimeoutPool - * @fps: the time between calls to the function, in frames per second - * @func: function to call - * @data: (closure): data to pass to the function, or %NULL - * @notify: function to call when the timeout is removed, or %NULL - * - * Sets a function to be called at regular intervals, and puts it inside - * the @pool. The function is repeatedly called until it returns %FALSE, - * at which point the timeout is automatically destroyed and the function - * won't be called again. If @notify is not %NULL, the @notify function - * will be called. The first call to @func will be at the end of @interval. - * - * Since Clutter 0.8 this will try to compensate for delays. For - * example, if @func takes half the interval time to execute then the - * function will be called again half the interval time after it - * finished. Before version 0.8 it would not fire until a full - * interval after the function completes so the delay between calls - * would be @interval * 1.5. This function does not however try to - * invoke the function multiple times to catch up missing frames if - * @func takes more than @interval ms to execute. - * - * Return value: the ID (greater than 0) of the timeout inside the pool. - * Use clutter_timeout_pool_remove() to stop the timeout. - * - * - * - * Deprecated: 1.6 - */ -guint -clutter_timeout_pool_add (ClutterTimeoutPool *pool, - guint fps, - GSourceFunc func, - gpointer data, - GDestroyNotify notify) -{ - ClutterTimeout *timeout; - guint retval = 0; - - timeout = clutter_timeout_new (fps); - - retval = timeout->id = pool->next_id++; - - timeout->func = func; - timeout->data = data; - timeout->notify = notify; - - pool->timeouts = g_list_insert_sorted (pool->timeouts, timeout, - clutter_timeout_sort); - - return retval; -} - -/** - * clutter_timeout_pool_remove: - * @pool: a #ClutterTimeoutPool - * @id_: the id of the timeout to remove - * - * Removes a timeout function with @id_ from the timeout pool. The id - * is the same returned when adding a function to the timeout pool with - * clutter_timeout_pool_add(). - * - * - * - * Deprecated: 1.6 - */ -void -clutter_timeout_pool_remove (ClutterTimeoutPool *pool, - guint id_) -{ - GList *l; - - if ((l = g_list_find_custom (pool->timeouts, GUINT_TO_POINTER (id_), - clutter_timeout_find_by_id))) - { - clutter_timeout_unref (l->data); - pool->timeouts = g_list_delete_link (pool->timeouts, l); - } - else if ((l = g_list_find_custom (pool->dispatched_timeouts, - GUINT_TO_POINTER (id_), - clutter_timeout_find_by_id))) - { - clutter_timeout_unref (l->data); - - pool->dispatched_timeouts = - g_list_delete_link (pool->dispatched_timeouts, l); - } -} diff --git a/clutter/deprecated/clutter-timeout-pool.h b/clutter/deprecated/clutter-timeout-pool.h deleted file mode 100644 index e134266f1..000000000 --- a/clutter/deprecated/clutter-timeout-pool.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * Copyright (C) 2006 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - * ClutterTimeoutPool: pool of timeout functions using the same slice of - * the GLib main loop - * - * Author: Emmanuele Bassi - * - * Based on similar code by Tristan van Berkom - */ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_TIMEOUT_POOL_H__ -#define __CLUTTER_TIMEOUT_POOL_H__ - -#include - -G_BEGIN_DECLS - -/** - * ClutterTimeoutPool: (skip) - * - * ClutterTimeoutPool is an opaque structure - * whose members cannot be directly accessed. - * - * - * - * Deprecated: 1.6 - */ -typedef struct _ClutterTimeoutPool ClutterTimeoutPool; - -CLUTTER_DEPRECATED_IN_1_6 -ClutterTimeoutPool *clutter_timeout_pool_new (gint priority); - -CLUTTER_DEPRECATED_IN_1_6 -guint clutter_timeout_pool_add (ClutterTimeoutPool *pool, - guint fps, - GSourceFunc func, - gpointer data, - GDestroyNotify notify); -CLUTTER_DEPRECATED_IN_1_6 -void clutter_timeout_pool_remove (ClutterTimeoutPool *pool, - guint id_); - -G_END_DECLS - -#endif /* __CLUTTER_TIMEOUT_POOL_H__ */ diff --git a/clutter/deprecated/clutter-util.h b/clutter/deprecated/clutter-util.h deleted file mode 100644 index ff9b325df..000000000 --- a/clutter/deprecated/clutter-util.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * Copyright (C) 2006 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_UTIL_H__ -#define __CLUTTER_UTIL_H__ - -#include - -G_BEGIN_DECLS - -CLUTTER_DEPRECATED_IN_1_2 -gint clutter_util_next_p2 (gint a); - -G_END_DECLS - -#endif /* __CLUTTER_UTIL_H__ */ diff --git a/clutter/gdk/clutter-stage-gdk.h b/clutter/gdk/clutter-stage-gdk.h index 40049552d..6f1809712 100644 --- a/clutter/gdk/clutter-stage-gdk.h +++ b/clutter/gdk/clutter-stage-gdk.h @@ -23,7 +23,6 @@ #ifndef __CLUTTER_STAGE_GDK_H__ #define __CLUTTER_STAGE_GDK_H__ -#include #include #include diff --git a/clutter/x11/clutter-backend-x11.c b/clutter/x11/clutter-backend-x11.c index c111fd9fe..feb45f9aa 100644 --- a/clutter/x11/clutter-backend-x11.c +++ b/clutter/x11/clutter-backend-x11.c @@ -62,6 +62,7 @@ #include #include "clutter-backend.h" +#include "clutter-color.h" #include "clutter-debug.h" #include "clutter-device-manager-private.h" #include "clutter-event-private.h" @@ -1146,31 +1147,6 @@ clutter_x11_remove_filter (ClutterX11FilterFunc func, } } -/** - * clutter_x11_get_input_devices: - * - * Retrieves a pointer to the list of input devices - * - * Deprecated: 1.2: Use clutter_device_manager_peek_devices() instead - * - * - * - * Return value: (transfer none) (element-type Clutter.InputDevice): a - * pointer to the internal list of input devices; the returned list is - * owned by Clutter and should not be modified or freed - */ -const GSList * -clutter_x11_get_input_devices (void) -{ - ClutterDeviceManager *manager; - - manager = clutter_device_manager_get_default (); - if (manager == NULL) - return NULL; - - return clutter_device_manager_peek_devices (manager); -} - /** * clutter_x11_has_xinput: * @@ -1178,8 +1154,6 @@ clutter_x11_get_input_devices (void) * * Return value: %TRUE if Clutter was compiled with XInput support * and XInput support is available at run time. - * - * */ gboolean clutter_x11_has_xinput (void) diff --git a/clutter/x11/clutter-device-manager-xi2.c b/clutter/x11/clutter-device-manager-xi2.c index 6a06cec0d..43c8f4225 100644 --- a/clutter/x11/clutter-device-manager-xi2.c +++ b/clutter/x11/clutter-device-manager-xi2.c @@ -36,6 +36,7 @@ #include "clutter-device-manager-private.h" #include "clutter-event-private.h" #include "clutter-event-translator.h" +#include "clutter-keysyms.h" #include "clutter-stage-private.h" #include "clutter-private.h" diff --git a/clutter/x11/clutter-stage-x11.c b/clutter/x11/clutter-stage-x11.c index d085041fa..2c2b6f41d 100644 --- a/clutter/x11/clutter-stage-x11.c +++ b/clutter/x11/clutter-stage-x11.c @@ -1307,37 +1307,6 @@ clutter_x11_get_stage_from_window (Window win) return NULL; } -/** - * clutter_x11_get_stage_visual: (skip) - * @stage: a #ClutterStage - * - * Returns an XVisualInfo suitable for creating a foreign window for the given - * stage. NOTE: It doesn't do as the name may suggest, which is return the - * XVisualInfo that was used to create an existing window for the given stage. - * - * XXX: It might be best to deprecate this function and replace with something - * along the lines of clutter_backend_x11_get_foreign_visual () or perhaps - * clutter_stage_x11_get_foreign_visual () - * - * Return value: (transfer full): An XVisualInfo suitable for creating a - * foreign stage. Use XFree() to free the returned value instead - * - * Deprecated: 1.2: Use clutter_x11_get_visual_info() instead - * - * - */ -XVisualInfo * -clutter_x11_get_stage_visual (ClutterStage *stage) -{ - ClutterBackend *backend = clutter_get_default_backend (); - ClutterBackendX11 *backend_x11; - - g_return_val_if_fail (CLUTTER_IS_BACKEND_X11 (backend), NULL); - backend_x11 = CLUTTER_BACKEND_X11 (backend); - - return _clutter_backend_x11_get_visual_info (backend_x11); -} - typedef struct { ClutterStageX11 *stage_x11; cairo_rectangle_int_t geom; diff --git a/clutter/x11/clutter-stage-x11.h b/clutter/x11/clutter-stage-x11.h index c7a7a1b3c..0450d955c 100644 --- a/clutter/x11/clutter-stage-x11.h +++ b/clutter/x11/clutter-stage-x11.h @@ -22,10 +22,7 @@ #ifndef __CLUTTER_STAGE_X11_H__ #define __CLUTTER_STAGE_X11_H__ -#include #include -#include -#include #include "clutter-backend-x11.h" #include "cogl/clutter-stage-cogl.h" diff --git a/clutter/x11/clutter-x11.h b/clutter/x11/clutter-x11.h index af5ed7924..f57e62231 100644 --- a/clutter/x11/clutter-x11.h +++ b/clutter/x11/clutter-x11.h @@ -38,11 +38,12 @@ #define __CLUTTER_X11_H__ #include + +#include + #include #include #include -#include -#include G_BEGIN_DECLS @@ -106,9 +107,6 @@ Window clutter_x11_get_root_window (void); XVisualInfo *clutter_x11_get_visual_info (void); void clutter_x11_set_display (Display * xdpy); -CLUTTER_DEPRECATED_FOR(clutter_x11_get_visual_info) -XVisualInfo *clutter_x11_get_stage_visual (ClutterStage *stage); - Window clutter_x11_get_stage_window (ClutterStage *stage); gboolean clutter_x11_set_stage_foreign (ClutterStage *stage, Window xwindow); @@ -125,10 +123,6 @@ gboolean clutter_x11_has_event_retrieval (void); ClutterStage *clutter_x11_get_stage_from_window (Window win); -CLUTTER_DEPRECATED_FOR(clutter_device_manager_peek_devices) -const GSList* clutter_x11_get_input_devices (void); - -CLUTTER_DEPRECATED_IN_1_14 void clutter_x11_enable_xinput (void); gboolean clutter_x11_has_xinput (void);