diff --git a/clutter/clutter-pan-action.c b/clutter/clutter-pan-action.c index 63c311874..a1f61240d 100644 --- a/clutter/clutter-pan-action.c +++ b/clutter/clutter-pan-action.c @@ -386,6 +386,15 @@ clutter_pan_action_get_property (GObject *gobject, } } +static void +clutter_pan_action_constructed (GObject *gobject) +{ + ClutterGestureAction *gesture; + + gesture = CLUTTER_GESTURE_ACTION (gobject); + clutter_gesture_action_set_threshold_trigger_edge (gesture, CLUTTER_GESTURE_TRIGGER_EDGE_AFTER); +} + static void clutter_pan_action_dispose (GObject *gobject) { @@ -498,6 +507,7 @@ clutter_pan_action_class_init (ClutterPanActionClass *klass) 1.0, G_MAXDOUBLE, default_acceleration_factor, CLUTTER_PARAM_READWRITE); + gobject_class->constructed = clutter_pan_action_constructed; gobject_class->set_property = clutter_pan_action_set_property; gobject_class->get_property = clutter_pan_action_get_property; gobject_class->dispose = clutter_pan_action_dispose; @@ -557,15 +567,10 @@ clutter_pan_action_class_init (ClutterPanActionClass *klass) static void clutter_pan_action_init (ClutterPanAction *self) { - ClutterGestureAction *gesture; - self->priv = clutter_pan_action_get_instance_private (self); self->priv->deceleration_rate = default_deceleration_rate; self->priv->acceleration_factor = default_acceleration_factor; self->priv->state = PAN_STATE_INACTIVE; - - gesture = CLUTTER_GESTURE_ACTION (self); - clutter_gesture_action_set_threshold_trigger_edge (gesture, CLUTTER_GESTURE_TRIGGER_EDGE_AFTER); } /** diff --git a/clutter/clutter-rotate-action.c b/clutter/clutter-rotate-action.c index d46d4ffef..7286c2b08 100644 --- a/clutter/clutter-rotate-action.c +++ b/clutter/clutter-rotate-action.c @@ -172,14 +172,27 @@ clutter_rotate_action_gesture_cancel (ClutterGestureAction *action, &retval); } +static void +clutter_rotate_action_constructed (GObject *gobject) +{ + ClutterGestureAction *gesture; + + gesture = CLUTTER_GESTURE_ACTION (gobject); + clutter_gesture_action_set_threshold_trigger_edge (gesture, CLUTTER_GESTURE_TRIGGER_EDGE_NONE); +} + static void clutter_rotate_action_class_init (ClutterRotateActionClass *klass) { ClutterGestureActionClass *gesture_class = CLUTTER_GESTURE_ACTION_CLASS (klass); + GObjectClass *object_class = + G_OBJECT_CLASS (klass); klass->rotate = clutter_rotate_action_real_rotate; + object_class->constructed = clutter_rotate_action_constructed; + gesture_class->gesture_begin = clutter_rotate_action_gesture_begin; gesture_class->gesture_progress = clutter_rotate_action_gesture_progress; gesture_class->gesture_cancel = clutter_rotate_action_gesture_cancel; @@ -221,7 +234,6 @@ clutter_rotate_action_init (ClutterRotateAction *self) gesture = CLUTTER_GESTURE_ACTION (self); clutter_gesture_action_set_n_touch_points (gesture, 2); - clutter_gesture_action_set_threshold_trigger_edge (gesture, CLUTTER_GESTURE_TRIGGER_EDGE_NONE); } /** diff --git a/clutter/clutter-swipe-action.c b/clutter/clutter-swipe-action.c index da1aab3d6..cac619929 100644 --- a/clutter/clutter-swipe-action.c +++ b/clutter/clutter-swipe-action.c @@ -178,11 +178,22 @@ clutter_swipe_action_real_swipe (ClutterSwipeAction *action, return TRUE; } +static void +clutter_swipe_action_constructed (GObject *object) +{ + clutter_gesture_action_set_threshold_trigger_edge (CLUTTER_GESTURE_ACTION (object), + CLUTTER_GESTURE_TRIGGER_EDGE_AFTER); +} + static void clutter_swipe_action_class_init (ClutterSwipeActionClass *klass) { ClutterGestureActionClass *gesture_class = CLUTTER_GESTURE_ACTION_CLASS (klass); + GObjectClass *object_class = + G_OBJECT_CLASS (klass); + + object_class->constructed = clutter_swipe_action_constructed; gesture_class->gesture_begin = gesture_begin; gesture_class->gesture_progress = gesture_progress; @@ -246,9 +257,6 @@ static void clutter_swipe_action_init (ClutterSwipeAction *self) { self->priv = clutter_swipe_action_get_instance_private (self); - - clutter_gesture_action_set_threshold_trigger_edge (CLUTTER_GESTURE_ACTION (self), - CLUTTER_GESTURE_TRIGGER_EDGE_AFTER); } /** diff --git a/clutter/clutter-tap-action.c b/clutter/clutter-tap-action.c index d67698096..4d30eb129 100644 --- a/clutter/clutter-tap-action.c +++ b/clutter/clutter-tap-action.c @@ -91,11 +91,22 @@ gesture_end (ClutterGestureAction *gesture, emit_tap (CLUTTER_TAP_ACTION (gesture), actor); } +static void +clutter_tap_action_constructed (GObject *object) +{ + clutter_gesture_action_set_threshold_trigger_edge (CLUTTER_GESTURE_ACTION (object), + CLUTTER_GESTURE_TRIGGER_EDGE_BEFORE); +} + static void clutter_tap_action_class_init (ClutterTapActionClass *klass) { ClutterGestureActionClass *gesture_class = CLUTTER_GESTURE_ACTION_CLASS (klass); + GObjectClass *object_class = + G_OBJECT_CLASS (klass); + + object_class->constructed = clutter_tap_action_constructed; gesture_class->gesture_end = gesture_end; @@ -122,8 +133,6 @@ clutter_tap_action_class_init (ClutterTapActionClass *klass) static void clutter_tap_action_init (ClutterTapAction *self) { - clutter_gesture_action_set_threshold_trigger_edge (CLUTTER_GESTURE_ACTION (self), - CLUTTER_GESTURE_TRIGGER_EDGE_BEFORE); } /** diff --git a/clutter/clutter-zoom-action.c b/clutter/clutter-zoom-action.c index 36d2de0b1..4e844a95a 100644 --- a/clutter/clutter-zoom-action.c +++ b/clutter/clutter-zoom-action.c @@ -326,6 +326,15 @@ clutter_zoom_action_dispose (GObject *gobject) G_OBJECT_CLASS (clutter_zoom_action_parent_class)->dispose (gobject); } +static void +clutter_zoom_action_constructed (GObject *gobject) +{ + ClutterGestureAction *gesture; + + gesture = CLUTTER_GESTURE_ACTION (gobject); + clutter_gesture_action_set_threshold_trigger_edge (gesture, CLUTTER_GESTURE_TRIGGER_EDGE_NONE); +} + static void clutter_zoom_action_class_init (ClutterZoomActionClass *klass) { @@ -333,6 +342,7 @@ clutter_zoom_action_class_init (ClutterZoomActionClass *klass) CLUTTER_GESTURE_ACTION_CLASS (klass); GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + gobject_class->constructed = clutter_zoom_action_constructed; gobject_class->set_property = clutter_zoom_action_set_property; gobject_class->get_property = clutter_zoom_action_get_property; gobject_class->dispose = clutter_zoom_action_dispose; @@ -406,7 +416,6 @@ clutter_zoom_action_init (ClutterZoomAction *self) gesture = CLUTTER_GESTURE_ACTION (self); clutter_gesture_action_set_n_touch_points (gesture, 2); - clutter_gesture_action_set_threshold_trigger_edge (gesture, CLUTTER_GESTURE_TRIGGER_EDGE_NONE); } /**