Clutter.DragAction¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w |
Constrains the dragging to a rectangle |
||
r |
Whether the drag area is set |
||
r/w |
Constraints the dragging to an axis |
||
r/w |
The actor that is being dragged |
||
r/w |
The horizontal amount of pixels required to start dragging |
||
r/w |
The vertical amount of pixels required to start dragging |
Signals¶
- Inherited:
Name |
Short Description |
|---|---|
The |
|
The |
|
The |
|
The |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent_instance |
r |
Class Details¶
- class Clutter.DragAction(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
The
Clutter.DragActionstructure contains only private data and should be accessed using the provided APINew in version 1.4.
- classmethod new()¶
- Returns:
the newly created
Clutter.DragAction- Return type:
Creates a new
Clutter.DragActioninstanceNew in version 1.4.
- get_drag_area()¶
- Returns:
Trueif the actor is actually constrained (and thus drag_area is valid),Falseotherwise- drag_area:
a
Clutter.Rectto be filled
- Return type:
(
bool, drag_area:Clutter.Rect)
Retrieves the “drag area” associated with self, that is a
Clutter.Rectthat constrains the actor movements, in parents coordinates.
- get_drag_axis()¶
- Returns:
the axis constraint
- Return type:
Retrieves the axis constraint set by
Clutter.DragAction.set_drag_axis()New in version 1.4.
- get_drag_handle()¶
- Returns:
a
Clutter.Actor, used as the drag handle, orNoneif none was set- Return type:
Retrieves the drag handle set by
Clutter.DragAction.set_drag_handle()New in version 1.4.
- get_drag_threshold()¶
- Returns:
- x_threshold:
return location for the horizontal drag threshold value, in pixels
- y_threshold:
return location for the vertical drag threshold value, in pixels
- Return type:
Retrieves the values set by
Clutter.DragAction.set_drag_threshold().If the
Clutter.DragAction:x-drag-thresholdproperty or theClutter.DragAction:y-drag-thresholdproperty have been set to -1 then this function will return the default drag threshold value as stored by theClutter.Settings:dnd-drag-thresholdproperty ofClutter.Settings.New in version 1.4.
- get_motion_coords()¶
- Returns:
- motion_x:
return location for the latest motion event’s X coordinate
- motion_y:
return location for the latest motion event’s Y coordinate
- Return type:
Retrieves the coordinates, in stage space, of the latest motion event during the dragging
New in version 1.4.
- get_press_coords()¶
- Returns:
- press_x:
return location for the press event’s X coordinate
- press_y:
return location for the press event’s Y coordinate
- Return type:
Retrieves the coordinates, in stage space, of the press event that started the dragging
New in version 1.4.
- set_drag_area(drag_area)¶
- Parameters:
drag_area (
Clutter.RectorNone) – aClutter.Rect
Sets drag_area to constrain the dragging of the actor associated with self, so that it position is always within drag_area, expressed in parent’s coordinates. If drag_area is
None, the actor is not constrained.
- set_drag_axis(axis)¶
- Parameters:
axis (
Clutter.DragAxis) – the axis to constraint the dragging to
Restricts the dragging action to a specific axis
New in version 1.4.
- set_drag_handle(handle)¶
- Parameters:
handle (
Clutter.ActororNone) – aClutter.Actor, orNoneto unset
Sets the actor to be used as the drag handle.
New in version 1.4.
- set_drag_threshold(x_threshold, y_threshold)¶
- Parameters:
x_threshold (
int) – a distance on the horizontal axis, in pixels, or -1 to use the default drag threshold fromClutter.Settingsy_threshold (
int) – a distance on the vertical axis, in pixels, or -1 to use the default drag threshold fromClutter.Settings
Sets the horizontal and vertical drag thresholds that must be cleared by the pointer before self can begin the dragging.
If x_threshold or y_threshold are set to -1 then the default drag threshold stored in the
Clutter.Settings:dnd-drag-thresholdproperty ofClutter.Settingswill be used.New in version 1.4.
- do_drag_begin(actor, event_x, event_y, modifiers) virtual¶
- Parameters:
actor (
Clutter.Actor) –event_x (
float) –event_y (
float) –modifiers (
Clutter.ModifierType) –
class handler of the
Clutter.DragAction::drag-beginsignal
- do_drag_end(actor, event_x, event_y, modifiers) virtual¶
- Parameters:
actor (
Clutter.Actor) –event_x (
float) –event_y (
float) –modifiers (
Clutter.ModifierType) –
class handler of the
Clutter.DragAction::drag-endsignal
- do_drag_motion(actor, delta_x, delta_y) virtual¶
- Parameters:
actor (
Clutter.Actor) –delta_x (
float) –delta_y (
float) –
class handler of the
Clutter.DragAction::drag-motionsignal
- do_drag_progress(actor, delta_x, delta_y) virtual¶
- Parameters:
actor (
Clutter.Actor) –delta_x (
float) –delta_y (
float) –
- Return type:
class handler of the
Clutter.DragAction::drag-progresssignal
Signal Details¶
- Clutter.DragAction.signals.drag_begin(drag_action, actor, event_x, event_y, modifiers)¶
- Signal Name:
drag-begin- Flags:
- Parameters:
drag_action (
Clutter.DragAction) – The object which received the signalactor (
Clutter.Actor) – theClutter.Actorattached to the actionevent_x (
float) – the X coordinate (in stage space) of the press eventevent_y (
float) – the Y coordinate (in stage space) of the press eventmodifiers (
Clutter.ModifierType) – the modifiers of the press event
The
::drag-beginsignal is emitted when theClutter.DragActionstarts the draggingThe emission of this signal can be delayed by using the
Clutter.DragAction:x-drag-thresholdandClutter.DragAction:y-drag-thresholdpropertiesNew in version 1.4.
- Clutter.DragAction.signals.drag_end(drag_action, actor, event_x, event_y, modifiers)¶
- Signal Name:
drag-end- Flags:
- Parameters:
drag_action (
Clutter.DragAction) – The object which received the signalactor (
Clutter.Actor) – theClutter.Actorattached to the actionevent_x (
float) – the X coordinate (in stage space) of the release eventevent_y (
float) – the Y coordinate (in stage space) of the release eventmodifiers (
Clutter.ModifierType) – the modifiers of the release event
The
::drag-endsignal is emitted at the end of the dragging, when the pointer button’s is releasedThis signal is emitted if and only if the
Clutter.DragAction::drag-beginsignal has been emitted firstNew in version 1.4.
- Clutter.DragAction.signals.drag_motion(drag_action, actor, delta_x, delta_y)¶
- Signal Name:
drag-motion- Flags:
- Parameters:
drag_action (
Clutter.DragAction) – The object which received the signalactor (
Clutter.Actor) – theClutter.Actorattached to the actiondelta_x (
float) – the X component of the distance between the press event that began the dragging and the current position of the pointer, as of the latest motion eventdelta_y (
float) – the Y component of the distance between the press event that began the dragging and the current position of the pointer, as of the latest motion event
The
::drag-motionsignal is emitted for each motion event after theClutter.DragAction::drag-beginsignal has been emitted.The components of the distance between the press event and the latest motion event are computed in the actor’s coordinate space, to take into account eventual transformations. If you want the stage coordinates of the latest motion event you can use
Clutter.DragAction.get_motion_coords().The default handler of the signal will call
Clutter.Actor.move_by() either on actor or, if set, ofClutter.DragAction:drag-handleusing the delta_x and delta_y components of the dragging motion. If you want to override the default behaviour, you can connect to theClutter.DragAction::drag-progresssignal and returnFalsefrom the handler.New in version 1.4.
- Clutter.DragAction.signals.drag_progress(drag_action, actor, delta_x, delta_y)¶
- Signal Name:
drag-progress- Flags:
- Parameters:
drag_action (
Clutter.DragAction) – The object which received the signalactor (
Clutter.Actor) – theClutter.Actorattached to the actiondelta_x (
float) – the X component of the distance between the press event that began the dragging and the current position of the pointer, as of the latest motion eventdelta_y (
float) – the Y component of the distance between the press event that began the dragging and the current position of the pointer, as of the latest motion event
- Returns:
Trueif the drag should continue, andFalseif it should be stopped.- Return type:
The
::drag-progresssignal is emitted for each motion event after theClutter.DragAction::drag-beginsignal has been emitted.The components of the distance between the press event and the latest motion event are computed in the actor’s coordinate space, to take into account eventual transformations. If you want the stage coordinates of the latest motion event you can use
Clutter.DragAction.get_motion_coords().The default handler will emit
Clutter.DragAction::drag-motion, ifClutter.DragAction::drag-progressemission returnsTrue.New in version 1.12.
Property Details¶
- Clutter.DragAction.props.drag_area¶
- Name:
drag-area- Type:
- Default Value:
- Flags:
Constains the dragging action (or in particular, the resulting actor position) to the specified
Clutter.Rect, in parent’s coordinates.New in version 1.12.
- Clutter.DragAction.props.drag_area_set¶
-
Whether the
Clutter.DragAction:drag-areaproperty has been set.New in version 1.12.
- Clutter.DragAction.props.drag_axis¶
- Name:
drag-axis- Type:
- Default Value:
- Flags:
Constraints the dragging action to the specified axis
New in version 1.4.
- Clutter.DragAction.props.drag_handle¶
- Name:
drag-handle- Type:
- Default Value:
- Flags:
The
Clutter.Actorthat is effectively being draggedA
Clutter.DragActionwill, be default, use theClutter.Actorthat has been attached to the action; it is possible to create a separateClutter.Actorand use it instead.Setting this property has no effect on the
Clutter.Actorargument passed to theClutter.DragActionsignalsNew in version 1.4.
- Clutter.DragAction.props.x_drag_threshold¶
-
The horizontal threshold, in pixels, that the cursor must travel in order to begin a drag action.
When set to a positive value,
Clutter.DragActionwill only emitClutter.DragAction::drag-beginif the pointer has moved horizontally at least of the given amount of pixels since the button press event.When set to -1,
Clutter.DragActionwill use the default threshold stored in theClutter.Settings:dnd-drag-thresholdproperty ofClutter.Settings.When read, this property will always return a valid drag threshold, either as set or the default one.
New in version 1.4.
- Clutter.DragAction.props.y_drag_threshold¶
-
The vertical threshold, in pixels, that the cursor must travel in order to begin a drag action.
When set to a positive value,
Clutter.DragActionwill only emitClutter.DragAction::drag-beginif the pointer has moved vertically at least of the given amount of pixels since the button press event.When set to -1,
Clutter.DragActionwill use the value stored in theClutter.Settings:dnd-drag-thresholdproperty ofClutter.Settings.When read, this property will always return a valid drag threshold, either as set or the default one.
New in version 1.4.