diff --git a/clutter/clutter/clutter-autocleanups.h b/clutter/clutter/clutter-autocleanups.h index fd4876dfd..6f3013b60 100644 --- a/clutter/clutter/clutter-autocleanups.h +++ b/clutter/clutter/clutter-autocleanups.h @@ -50,7 +50,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPropertyTransition, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterScrollActor, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterShaderEffect, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterStage, g_object_unref) -G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterSwipeAction, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterText, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterActorBox, clutter_actor_box_free) diff --git a/clutter/clutter/clutter-swipe-action.c b/clutter/clutter/clutter-swipe-action.c index 2d864a582..29bf89855 100644 --- a/clutter/clutter/clutter-swipe-action.c +++ b/clutter/clutter/clutter-swipe-action.c @@ -44,13 +44,13 @@ #include "clutter/clutter-marshal.h" #include "clutter/clutter-private.h" -struct _ClutterSwipeActionPrivate +typedef struct _ClutterSwipeActionPrivate { ClutterSwipeDirection h_direction; ClutterSwipeDirection v_direction; float distance_x, distance_y; -}; +} ClutterSwipeActionPrivate; enum { @@ -67,7 +67,8 @@ static gboolean gesture_begin (ClutterGestureAction *action, ClutterActor *actor) { - ClutterSwipeActionPrivate *priv = CLUTTER_SWIPE_ACTION (action)->priv; + ClutterSwipeActionPrivate *priv = + clutter_swipe_action_get_instance_private (CLUTTER_SWIPE_ACTION (action)); /* reset the state at the beginning of a new gesture */ priv->h_direction = 0; @@ -85,7 +86,8 @@ static gboolean gesture_progress (ClutterGestureAction *action, ClutterActor *actor) { - ClutterSwipeActionPrivate *priv = CLUTTER_SWIPE_ACTION (action)->priv; + ClutterSwipeActionPrivate *priv = + clutter_swipe_action_get_instance_private (CLUTTER_SWIPE_ACTION (action)); gfloat press_x, press_y; gfloat motion_x, motion_y; gfloat delta_x, delta_y; @@ -134,7 +136,8 @@ static void gesture_end (ClutterGestureAction *action, ClutterActor *actor) { - ClutterSwipeActionPrivate *priv = CLUTTER_SWIPE_ACTION (action)->priv; + ClutterSwipeActionPrivate *priv = + clutter_swipe_action_get_instance_private (CLUTTER_SWIPE_ACTION (action)); gfloat press_x, press_y; gfloat release_x, release_y; ClutterSwipeDirection direction = 0; @@ -210,7 +213,6 @@ clutter_swipe_action_class_init (ClutterSwipeActionClass *klass) static void clutter_swipe_action_init (ClutterSwipeAction *self) { - self->priv = clutter_swipe_action_get_instance_private (self); } /** diff --git a/clutter/clutter/clutter-swipe-action.h b/clutter/clutter/clutter-swipe-action.h index a9bd2dd6f..f4f20c283 100644 --- a/clutter/clutter/clutter-swipe-action.h +++ b/clutter/clutter/clutter-swipe-action.h @@ -37,23 +37,13 @@ G_BEGIN_DECLS #define CLUTTER_TYPE_SWIPE_ACTION (clutter_swipe_action_get_type ()) -#define CLUTTER_SWIPE_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_SWIPE_ACTION, ClutterSwipeAction)) -#define CLUTTER_IS_SWIPE_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_SWIPE_ACTION)) -#define CLUTTER_SWIPE_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_SWIPE_ACTION, ClutterSwipeActionClass)) -#define CLUTTER_IS_SWIPE_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_SWIPE_ACTION)) -#define CLUTTER_SWIPE_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_SWIPE_ACTION, ClutterSwipeActionClass)) -typedef struct _ClutterSwipeAction ClutterSwipeAction; -typedef struct _ClutterSwipeActionPrivate ClutterSwipeActionPrivate; -typedef struct _ClutterSwipeActionClass ClutterSwipeActionClass; - -struct _ClutterSwipeAction -{ - /*< private >*/ - ClutterGestureAction parent_instance; - - ClutterSwipeActionPrivate *priv; -}; +CLUTTER_EXPORT +G_DECLARE_DERIVABLE_TYPE (ClutterSwipeAction, + clutter_swipe_action, + CLUTTER, + SWIPE_ACTION, + ClutterGestureAction) /** * ClutterSwipeActionClass: @@ -73,9 +63,6 @@ struct _ClutterSwipeActionClass ClutterSwipeDirection direction); }; -CLUTTER_EXPORT -GType clutter_swipe_action_get_type (void) G_GNUC_CONST; - CLUTTER_EXPORT ClutterAction * clutter_swipe_action_new (void);