NbtkDraggable

NbtkDraggable

Synopsis

                    NbtkDraggable;
                    NbtkDraggableIface;
enum                NbtkDragAxis;
enum                NbtkDragContainment;
void                nbtk_draggable_set_axis             (NbtkDraggable *draggable,
                                                         NbtkDragAxis axis);
NbtkDragAxis        nbtk_draggable_get_axis             (NbtkDraggable *draggable);
void                nbtk_draggable_set_drag_threshold   (NbtkDraggable *draggable,
                                                         guint threshold);
guint               nbtk_draggable_get_drag_threshold   (NbtkDraggable *draggable);
void                nbtk_draggable_set_containment_type (NbtkDraggable *draggable,
                                                         NbtkDragContainment containment);
NbtkDragContainment  nbtk_draggable_get_containment_type
                                                        (NbtkDraggable *draggable);
void                nbtk_draggable_set_containment_area (NbtkDraggable *draggable,
                                                         gfloat x_1,
                                                         gfloat y_1,
                                                         gfloat x_2,
                                                         gfloat y_2);
void                nbtk_draggable_get_containment_area (NbtkDraggable *draggable,
                                                         gfloat *x_1,
                                                         gfloat *y_1,
                                                         gfloat *x_2,
                                                         gfloat *y_2);
void                nbtk_draggable_disable              (NbtkDraggable *draggable);
void                nbtk_draggable_enable               (NbtkDraggable *draggable);
gboolean            nbtk_draggable_is_enabled           (NbtkDraggable *draggable);

Object Hierarchy

  GInterface
   +----NbtkDraggable

Prerequisites

NbtkDraggable requires ClutterActor.

Properties

  "axis"                     NbtkDragAxis          : Read / Write
  "containment-area"         ClutterActorBox*      : Read / Write
  "containment-type"         NbtkDragContainment   : Read / Write
  "drag-actor"               ClutterActor*         : Read / Write
  "drag-threshold"           guint                 : Read / Write
  "enabled"                  gboolean              : Read / Write

Signals

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

Description

Details

NbtkDraggable

typedef struct _NbtkDraggable NbtkDraggable;


NbtkDraggableIface

typedef struct {
  /* vfuncs, not signals */
  void (* enable)  (NbtkDraggable *draggable);
  void (* disable) (NbtkDraggable *draggable);

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

Interface for draggable ClutterActors.

enable ()

virtual function called when enabling a NbtkDraggable; NBTK already provides a default implementation

disable ()

virtual function called when disabling a NbtkDraggable; NBTK 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 NbtkDragAxis

typedef enum {
  NBTK_NO_AXIS,
  NBTK_X_AXIS,
  NBTK_Y_AXIS
} NbtkDragAxis;


enum NbtkDragContainment

typedef enum {
  NBTK_DISABLE_CONTAINMENT,
  NBTK_CONTAIN_IN_STAGE,
  NBTK_CONTAIN_IN_PARENT,
  NBTK_CONTAIN_IN_AREA
} NbtkDragContainment;


nbtk_draggable_set_axis ()

void                nbtk_draggable_set_axis             (NbtkDraggable *draggable,
                                                         NbtkDragAxis axis);

draggable :

axis :


nbtk_draggable_get_axis ()

NbtkDragAxis        nbtk_draggable_get_axis             (NbtkDraggable *draggable);

draggable :

Returns :


nbtk_draggable_set_drag_threshold ()

void                nbtk_draggable_set_drag_threshold   (NbtkDraggable *draggable,
                                                         guint threshold);

draggable :

threshold :


nbtk_draggable_get_drag_threshold ()

guint               nbtk_draggable_get_drag_threshold   (NbtkDraggable *draggable);

draggable :

Returns :


nbtk_draggable_set_containment_type ()

void                nbtk_draggable_set_containment_type (NbtkDraggable *draggable,
                                                         NbtkDragContainment containment);

draggable :

containment :


nbtk_draggable_get_containment_type ()

NbtkDragContainment  nbtk_draggable_get_containment_type
                                                        (NbtkDraggable *draggable);

draggable :

Returns :


nbtk_draggable_set_containment_area ()

void                nbtk_draggable_set_containment_area (NbtkDraggable *draggable,
                                                         gfloat x_1,
                                                         gfloat y_1,
                                                         gfloat x_2,
                                                         gfloat y_2);

draggable :

x_1 :

y_1 :

x_2 :

y_2 :


nbtk_draggable_get_containment_area ()

void                nbtk_draggable_get_containment_area (NbtkDraggable *draggable,
                                                         gfloat *x_1,
                                                         gfloat *y_1,
                                                         gfloat *x_2,
                                                         gfloat *y_2);

draggable :

x_1 :

y_1 :

x_2 :

y_2 :


nbtk_draggable_disable ()

void                nbtk_draggable_disable              (NbtkDraggable *draggable);

draggable :


nbtk_draggable_enable ()

void                nbtk_draggable_enable               (NbtkDraggable *draggable);

draggable :


nbtk_draggable_is_enabled ()

gboolean            nbtk_draggable_is_enabled           (NbtkDraggable *draggable);

draggable :

Returns :

Property Details

The "axis" property

  "axis"                     NbtkDragAxis          : Read / Write

The axis along which the dragging should be performed.

Default value: NBTK_NO_AXIS


The "containment-area" property

  "containment-area"         ClutterActorBox*      : Read / Write

The area to which the draggable is contained.


The "containment-type" property

  "containment-type"         NbtkDragContainment   : Read / Write

The type of containment to be used.

Default value: NBTK_DISABLE_CONTAINMENT


The "drag-actor" property

  "drag-actor"               ClutterActor*         : Read / Write

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


The "drag-threshold" property

  "drag-threshold"           guint                 : Read / Write

The amount of pixels required to start dragging.

Default value: 0


The "enabled" property

  "enabled"                  gboolean              : Read / Write

Whether the Draggable is enabled.

Default value: TRUE

Signal Details

The "drag-begin" signal

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

nbtkdraggable :

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                      (NbtkDraggable *nbtkdraggable,
                                                        gfloat         arg1,
                                                        gfloat         arg2,
                                                        gpointer       user_data)          : Run First

nbtkdraggable :

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                      (NbtkDraggable *nbtkdraggable,
                                                        gfloat         arg1,
                                                        gfloat         arg2,
                                                        gpointer       user_data)          : Run First

nbtkdraggable :

the object which received the signal.

arg1 :

arg2 :

user_data :

user data set when the signal handler was connected.