Gesture Events

Gesture Events

Synopsis

enum                GripGestureType;

enum                GripDeviceType;
#define             GRIP_DEVICE_ALL

enum                GripTimeType;

union               GripGestureEvent;
struct              GripEventGestureAny;
struct              GripEventGestureDrag;
struct              GripEventGesturePinch;
struct              GripEventGestureRotate;
struct              GripEventGestureTap;
GripGestureEvent *  grip_gesture_event_new              (GripGestureType gesture_type);
void                grip_gesture_event_free             (GripGestureEvent *event);
GripGestureEvent *  grip_gesture_event_copy             (const GripGestureEvent *event);

Object Hierarchy

  GEnum
   +----GripGestureType
  GEnum
   +----GripTimeType
  GBoxed
   +----GripGestureEvent

Description

A series of one or more events are passed to the gesture callback. Each event conveys information specific to the type of gesture occurring.

Details

enum GripGestureType

typedef enum {
  GRIP_GESTURE_DRAG    = 0,
  GRIP_GESTURE_PINCH   = 1,
  GRIP_GESTURE_ROTATE  = 2,
  GRIP_GESTURE_TAP     = 15
} GripGestureType;

Indicates the type of gesture for which a gesture event is being received.

GRIP_GESTURE_DRAG

a drag gesture

GRIP_GESTURE_PINCH

a pinch/expand gesture

GRIP_GESTURE_ROTATE

a rotate gesture

GRIP_GESTURE_TAP

a tap gesture

enum GripDeviceType

typedef enum {
  GRIP_DEVICE_TOUCHSCREEN = 1,
  GRIP_DEVICE_TOUCHPAD    = 2,
  GRIP_DEVICE_INDEPENDENT = 4,
} GripDeviceType;

Describes certain properties of a gesture input device.

GRIP_DEVICE_TOUCHSCREEN

device is a touchscreen.

GRIP_DEVICE_TOUCHPAD

device is a touchpad

GRIP_DEVICE_INDEPENDENT

device is a Magic Mouse

GRIP_DEVICE_ALL

#define GRIP_DEVICE_ALL (GRIP_DEVICE_TOUCHSCREEN | GRIP_DEVICE_TOUCHPAD | GRIP_DEVICE_INDEPENDENT)


enum GripTimeType

typedef enum {
  GRIP_TIME_START,
  GRIP_TIME_UPDATE,
  GRIP_TIME_END
} GripTimeType;

Indicates the part of the gesture stream ocuuring during the gesture event.

GRIP_TIME_START

a new gesture is starting

GRIP_TIME_UPDATE

an existing gesture is updating

GRIP_TIME_END

a gesture is ending

union GripGestureEvent

union _GripGestureEvent
{
  GripGestureType        type;
  GripEventGestureAny    any;
  GripEventGestureDrag   drag;
  GripEventGesturePinch  pinch;
  GripEventGestureRotate rotate;
  GripEventGestureTap    tap;
};

This is a boxed type.

GripGestureType type;

the GripGestureType, selects the variant record

GripEventGestureAny any;

(not used)

GripEventGestureDrag drag;

the event contains a drag gesture record

GripEventGesturePinch pinch;

the event contains a pinch gesture record

GripEventGestureRotate rotate;

the event contains a rotate gesture record

GripEventGestureTap tap;

the event contains a tap gesture record

struct GripEventGestureAny

struct GripEventGestureAny {
  GdkEventType  type;
  GdkWindow    *window;
};

This struct is not used.


struct GripEventGestureDrag

struct GripEventGestureDrag {
  GripGestureType   type;
  guint             id;
  GdkWindow        *window;
  GdkWindow        *root;
  GdkWindow        *child;
  guint32           timestamp;
  gint              fingers;
  gdouble           focus_x;
  gdouble           focus_y;
  gint              delta_x;
  gint              delta_y;
  gdouble           velocity_x;
  gdouble           velocity_y;
  gdouble           position_x;
  gdouble           position_y;
  GripInputDevice  *input_device;
};

Data associated with a drag event. A drag is a lateral motion.

GripGestureType type;

the GripGestureType of the gesture

guint id;

identifies the gesture

GdkWindow *window;

the GdkWindow in which the gesture occurred

GdkWindow *root;

the root GdkWindow

GdkWindow *child;

the child GdkWindow

guint32 timestamp;

the time the gesture event occurred

gint fingers;

the number of touches making up the gesture

gdouble focus_x;

the X coordinate of the focus point of the gesture start

gdouble focus_y;

the Y coordinate of the focus point of the gesture start

gint delta_x;

the change in the X coordinate since the last gesture event

gint delta_y;

the change in the Y coordinate since the last gesture event

gdouble velocity_x;

the rate of change of the X coordinate

gdouble velocity_y;

the rate of change of the Y coordinate

gdouble position_x;

the current X coordinate of the centroid poistion of the touches

gdouble position_y;

the current Y coordinate of the centroid poistion of the touches

GripInputDevice *input_device;

the GripInputDevice used to make the gesture

struct GripEventGesturePinch

struct GripEventGesturePinch {
  GripGestureType   type;
  guint             id;
  GdkWindow        *window;
  GdkWindow        *root;
  GdkWindow        *child;
  guint32           timestamp;
  guint             fingers;
  gdouble           focus_x;
  gdouble           focus_y;
  gdouble           radius_delta;
  gdouble           radial_velocity;
  gdouble           radius;
  gfloat            position_x;
  gfloat            position_y;
  GripInputDevice  *input_device;
};

Data associated with a pinch event. A pinch is an expand or contract motion.

GripGestureType type;

the GripGestureType of the gesture

guint id;

identifies the gesture

GdkWindow *window;

the GdkWindow in which the gesture occurred

GdkWindow *root;

the root GdkWindow

GdkWindow *child;

the child GdkWindow

guint32 timestamp;

the time the gesture event occurred

guint fingers;

the number of touches making up the gesture

gdouble focus_x;

the X coordinate of the focus point of the gesture start

gdouble focus_y;

the Y coordinate of the focus point of the gesture start

gdouble radius_delta;

the change in the radius (in screen coordinates)

gdouble radial_velocity;

the rate of change of the radius

gdouble radius;

the current radius (in screen coordinates)

gfloat position_x;

the current X coordinate of the centroid poistion of the touches

gfloat position_y;

the current Y coordinate of the centroid poistion of the touches

GripInputDevice *input_device;

the GripInputDevice used to make the gesture

struct GripEventGestureRotate

struct GripEventGestureRotate {
  GripGestureType  type;
  guint             id;
  GdkWindow        *window;
  GdkWindow        *root;
  GdkWindow        *child;
  guint32           timestamp;
  guint             fingers;
  gdouble           focus_x;
  gdouble           focus_y;
  gdouble           angle_delta;
  gdouble           angular_velocity;
  gdouble           angle;
  gfloat            position_x;
  gfloat            position_y;
  GripInputDevice  *input_device;
};

Data associated with a rotate gesture event.

GripGestureType type;

the GripGestureType of the gesture

guint id;

identifies the gesture

GdkWindow *window;

the GdkWindow in which the gesture occurred

GdkWindow *root;

the root GdkWindow

GdkWindow *child;

the child GdkWindow

guint32 timestamp;

the time the gesture event occurred

guint fingers;

the number of touches making up the gesture

gdouble focus_x;

the X coordinate of the focus point of the gesture start

gdouble focus_y;

the Y coordinate of the focus point of the gesture start

gdouble angle_delta;

the change in the rotation angle (in radians)

gdouble angular_velocity;

the rate of change in the rotation angle

gdouble angle;

the current rotation angle

gfloat position_x;

the current X coordinate of the centroid poistion of the touches

gfloat position_y;

the current Y coordinate of the centroid poistion of the touches

GripInputDevice *input_device;

the GripInputDevice used to make the gesture

struct GripEventGestureTap

struct GripEventGestureTap {
  GripGestureType  type;
  guint             id;
  GdkWindow        *window;
  GdkWindow        *root;
  GdkWindow        *child;
  guint32           timestamp;
  guint             fingers;
  guint32           tap_time;
  gfloat            focus_x;
  gfloat            focus_y;
  gfloat            position_x;
  gfloat            position_y;
  GripInputDevice  *input_device;
};

Data associated with a tap gesture.

GripGestureType type;

the GripGestureType of the gesture

guint id;

identifies the gesture

GdkWindow *window;

the GdkWindow in which the gesture occurred

GdkWindow *root;

the root GdkWindow

GdkWindow *child;

the child GdkWindow

guint32 timestamp;

the time the gesture event occurred

guint fingers;

the number of touches making up the gesture

guint32 tap_time;

the duration of the tap

gfloat focus_x;

the X coordinate of the focus point of the gesture start

gfloat focus_y;

the Y coordinate of the focus point of the gesture start

gfloat position_x;

the current X coordinate of the centroid poistion of the touches

gfloat position_y;

the current Y coordinate of the centroid poistion of the touches

GripInputDevice *input_device;

the GripInputDevice used to make the gesture

grip_gesture_event_new ()

GripGestureEvent *  grip_gesture_event_new              (GripGestureType gesture_type);

Creates a new Grip gesture event.

gesture_type :

the type of the gesture

Returns :

a new GripGestureEvent

grip_gesture_event_free ()

void                grip_gesture_event_free             (GripGestureEvent *event);

Frees the resources allocated for a GripGestureEvent.

event :

a GripGestureEvent

grip_gesture_event_copy ()

GripGestureEvent *  grip_gesture_event_copy             (const GripGestureEvent *event);

Creates a new GripGestureEvent instance using a deep copy of and existing event.

event :

an existing GripGestureEvent

Returns :

a new GripGestureEvent