mx-draggable

## mx-draggable mx-draggable |

## Synopsis

                        MxDraggable;
    struct              MxDraggableIface;
    enum                MxDragAxis;
    void                mx_draggable_set_axis               (MxDraggable *draggable,
                                                             MxDragAxis axis);
    MxDragAxis          mx_draggable_get_axis               (MxDraggable *draggable);
    void                mx_draggable_set_drag_threshold     (MxDraggable *draggable,
                                                             guint threshold);
    guint               mx_draggable_get_drag_threshold     (MxDraggable *draggable);
    void                mx_draggable_set_drag_actor         (MxDraggable *draggable,
                                                             ClutterActor *actor);
    ClutterActor *      mx_draggable_get_drag_actor         (MxDraggable *draggable);
    void                mx_draggable_disable                (MxDraggable *draggable);
    void                mx_draggable_enable                 (MxDraggable *draggable);
    gboolean            mx_draggable_is_enabled             (MxDraggable *draggable);

## Object Hierarchy

      GInterface
       +----MxDraggable

## Prerequisites

MxDraggable requires ClutterActor.

## Properties

      "axis"                     MxDragAxis            : Read / Write
      "drag-actor"               ClutterActor*         : Read / Write
      "drag-enabled"             gboolean              : Read / Write
      "drag-threshold"           guint                 : Read / Write

## Signals

      "drag-begin"                                     : Run First
      "drag-end"                                       : Run First
      "drag-motion"                                    : Run First

## Description

## Details

### MxDraggable

    typedef struct _MxDraggable MxDraggable;

This is an opaque structure whose members cannot be directly accessed.

### struct MxDraggableIface

    struct MxDraggableIface {
      /* vfuncs, not signals */
      void (* enable)  (MxDraggable *draggable);
      void (* disable) (MxDraggable *draggable);

      /* signals */
      void (* drag_begin)  (MxDraggable         *draggable,
                            gfloat               event_x,
                            gfloat               event_y,
                            gint                 event_button,
                            ClutterModifierType  modifiers);
      void (* drag_motion) (MxDraggable         *draggable,
                            gfloat               delta_x,
                            gfloat               delta_y);
      void (* drag_end)    (MxDraggable         *draggable,
                            gfloat               event_x,
                            gfloat               event_y);
    };

Interface for draggable ClutterActors.

`enable` () | virtual function called when enabling a MxDraggable; MX already provides a default implementation
`disable` () | virtual function called when disabling a MxDraggable; MX already provides a default implementation
`drag_begin` () | class handler for the "drag-begin" signal
`drag_motion` () | class handler for the "drag-motion" signal
`drag_end` () | class handler for the "drag-end" signal

### enum MxDragAxis

    typedef enum {
      MX_DRAG_AXIS_NONE,
      MX_DRAG_AXIS_X,
      MX_DRAG_AXIS_Y
    } MxDragAxis;

### mx_draggable_set_axis ()

    void                mx_draggable_set_axis               (MxDraggable *draggable,
                                                             MxDragAxis axis);

`draggable` : |
`axis` : |

### mx_draggable_get_axis ()

    MxDragAxis          mx_draggable_get_axis               (MxDraggable *draggable);

`draggable` : |
Returns : |

### mx_draggable_set_drag_threshold ()

    void                mx_draggable_set_drag_threshold     (MxDraggable *draggable,
                                                             guint threshold);

`draggable` : |
`threshold` : |

### mx_draggable_get_drag_threshold ()

    guint               mx_draggable_get_drag_threshold     (MxDraggable *draggable);

`draggable` : |
Returns : |

### mx_draggable_set_drag_actor ()

    void                mx_draggable_set_drag_actor         (MxDraggable *draggable,
                                                             ClutterActor *actor);

`draggable` : |
`actor` : |

### mx_draggable_get_drag_actor ()

    ClutterActor *      mx_draggable_get_drag_actor         (MxDraggable *draggable);

`draggable` : |
Returns : |

### mx_draggable_disable ()

    void                mx_draggable_disable                (MxDraggable *draggable);

`draggable` : |

### mx_draggable_enable ()

    void                mx_draggable_enable                 (MxDraggable *draggable);

`draggable` : |

### mx_draggable_is_enabled ()

    gboolean            mx_draggable_is_enabled             (MxDraggable *draggable);

`draggable` : |
Returns : |

## Property Details

### The `"axis"` property

      "axis"                     MxDragAxis            : Read / Write

The axis along which the dragging should be performed.

Default value: MX_DRAG_AXIS_NONE

### The `"drag-actor"` property

      "drag-actor"               ClutterActor*         : Read / Write

An actor to use in place of the draggable while dragging.

### The `"drag-enabled"` property

      "drag-enabled"             gboolean              : Read / Write

Whether the Draggable is enabled.

Default value: TRUE

### The `"drag-threshold"` property

      "drag-threshold"           guint                 : Read / Write

The amount of pixels required to start dragging.

Default value: 0

## Signal Details

### The `"drag-begin"` signal

    void                user_function                      (MxDraggable        *mxdraggable,
                                                            gfloat              arg1,
                                                            gfloat              arg2,
                                                            gint                arg3,
                                                            ClutterModifierType arg4,
                                                            gpointer            user_data)        : Run First

`mxdraggable` : | the object which received the signal.
`arg1` : |
`arg2` : |
`arg3` : |
`arg4` : |
`user_data` : | user data set when the signal handler was connected.

### The `"drag-end"` signal

    void                user_function                      (MxDraggable *mxdraggable,
                                                            gfloat       arg1,
                                                            gfloat       arg2,
                                                            gpointer     user_data)        : Run First

`mxdraggable` : | the object which received the signal.
`arg1` : |
`arg2` : |
`user_data` : | user data set when the signal handler was connected.

### The `"drag-motion"` signal

    void                user_function                      (MxDraggable *mxdraggable,
                                                            gfloat       arg1,
                                                            gfloat       arg2,
                                                            gpointer     user_data)        : Run First

`mxdraggable` : | the object which received the signal.
`arg1` : |
`arg2` : |
`user_data` : | user data set when the signal handler was connected.