}
static void
+clutter_drag_action_real_drag_motion (ClutterDragAction *action,
+ ClutterActor *actor,
+ gfloat delta_x,
+ gfloat delta_y)
+{
+ ClutterActor *drag_handle;
+
+ if (action->priv->drag_handle != NULL)
+ drag_handle = action->priv->drag_handle;
+ else
+ drag_handle = actor;
+
+ clutter_actor_move_by (drag_handle, delta_x, delta_y);
+}
+
+static void
clutter_drag_action_set_property (GObject *gobject,
guint prop_id,
const GValue *value,
meta_class->set_actor = clutter_drag_action_set_actor;
+ klass->drag_motion = clutter_drag_action_real_drag_motion;
+
/**
* ClutterDragAction:drag-threshold:
*
* stage coordinates of the latest motion event you can use
* clutter_drag_action_get_motion_coords().
*
+ * The default handler of the signal will call clutter_actor_move_by()
+ * either on @actor or, if set, of #ClutterDragAction:drag-handle using
+ * the @delta_x and @delta_y components of the dragging motion. If you
+ * want to override the default behaviour, you can connect to this
+ * signal and call g_signal_stop_emission_by_name() from within your
+ * callback.
+ *
* Since: 1.4
*/
drag_signals[DRAG_MOTION] =
}
static void
-on_drag_motion (ClutterDragAction *action,
- ClutterActor *actor,
- gfloat delta_x,
- gfloat delta_y,
- ClutterModifierType modifiers)
-{
- ClutterActor *drag_handle;
-
- drag_handle = clutter_drag_action_get_drag_handle (action);
- g_assert (drag_handle != NULL);
-
- clutter_actor_move_by (drag_handle, delta_x, delta_y);
-}
-
-static void
on_drag_end (ClutterDragAction *action,
ClutterActor *actor,
gfloat event_x,
get_drag_axis (drag_axis));
g_signal_connect (action, "drag-begin", G_CALLBACK (on_drag_begin), NULL);
- g_signal_connect (action, "drag-motion", G_CALLBACK (on_drag_motion), NULL);
g_signal_connect (action, "drag-end", G_CALLBACK (on_drag_end), NULL);
clutter_actor_add_action (handle, action);