docs: Fix DragAction documentation

The ::drag-motion signal does not have a ModifierType argument; also,
there's no need to connect to the ::drag-motion signal any more.
This commit is contained in:
Emmanuele Bassi 2010-05-25 13:10:38 +01:00
parent 5a531bd1c9
commit cfb05bfb09
2 changed files with 12 additions and 25 deletions

View File

@ -31,33 +31,22 @@
* all the necessary logic for dragging actors. * all the necessary logic for dragging actors.
* *
* The simplest usage of #ClutterDragAction consists in adding it to * The simplest usage of #ClutterDragAction consists in adding it to
* a #ClutterActor and connecting to the #ClutterDragAction::drag-motion * a #ClutterActor and setting it as reactive; for instance, the following
* signal handler to move the actor; for instance: * code:
* *
* |[ * |[
* ClutterAction *action = clutter_drag_action_new (); * clutter_actor_add_action (actor, clutter_drag_action_new ());
* * clutter_actor_set_reactive (actor, TRUE);
* g_signal_connect (action, "drag-motion",
* G_CALLBACK (on_drag_motion),
* NULL);
*
* clutter_actor_add_action (actor, action);
* ]| * ]|
* *
* Where the on_drag_motion() signal handler calls clutter_actor_move_by() * will automatically result in the actor moving to follow the pointer
* using the delta between motion events passed to the handler: * whenever the pointer's button is pressed over the actor and moved
* across the stage.
* *
* |[ * The #ClutterDragAction will signal the begin and the end of a dragging
* static void * through the #ClutterDragAction::drag-begin and #ClutterDragAction::drag-end
* on_drag_motion (ClutterDragAction *action, * signals, respectively. Each pointer motion during a drag will also result
* ClutterActor *actor, * in the #ClutterDragAction::drag-motion signal to be emitted.
* gfloat delta_x,
* gfloat delta_y,
* ClutterModifierType modifiers)
* {
* clutter_actor_move_by (actor, delta_x, delta_y);
* }
* ]|
* *
* It is also possible to set another #ClutterActor as the dragged actor * It is also possible to set another #ClutterActor as the dragged actor
* by calling clutter_drag_action_set_drag_handle() from within a handle * by calling clutter_drag_action_set_drag_handle() from within a handle
@ -558,7 +547,6 @@ clutter_drag_action_class_init (ClutterDragActionClass *klass)
* @delta_y: the Y component of the distance between the press event * @delta_y: the Y component of the distance between the press event
* that began the dragging and the current position of the pointer, * that began the dragging and the current position of the pointer,
* as of the latest motion event * as of the latest motion event
* @modifiers: the modifiers of the latest motion event
* *
* The ::drag-motion signal is emitted for each motion event after * The ::drag-motion signal is emitted for each motion event after
* the #ClutterDragAction::drag-begin signal has been emitted. * the #ClutterDragAction::drag-begin signal has been emitted.

View File

@ -105,8 +105,7 @@ struct _ClutterDragActionClass
void (* drag_motion) (ClutterDragAction *action, void (* drag_motion) (ClutterDragAction *action,
ClutterActor *actor, ClutterActor *actor,
gfloat delta_x, gfloat delta_x,
gfloat delta_y, gfloat delta_y);
ClutterModifierType modifiers);
void (* drag_end) (ClutterDragAction *action, void (* drag_end) (ClutterDragAction *action,
ClutterActor *actor, ClutterActor *actor,
gfloat event_x, gfloat event_x,