Gesture Events

Gesture Events

Functions

Types and Values

Object Hierarchy

    GBoxed
    ╰── GripGestureEvent
    GEnum
    ├── GripGestureType
    ╰── GripTimeType

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.

Functions

GRIP_DEVICE_ALL

#define GRIP_DEVICE_ALL (GRIP_DEVICE_TOUCHSCREEN | GRIP_DEVICE_TOUCHPAD | GRIP_DEVICE_INDEPENDENT)


grip_gesture_event_new ()

GripGestureEvent *
grip_gesture_event_new (GripGestureType gesture_type);

Creates a new Grip gesture event.

Parameters

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.

Parameters

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.

Parameters

event

an existing GripGestureEvent

 

Returns

a new GripGestureEvent

Types and Values

enum GripGestureType

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

Members

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

Describes certain properties of a gesture input device.

Members

GRIP_DEVICE_TOUCHSCREEN

device is a touchscreen.

 

GRIP_DEVICE_TOUCHPAD

device is a touchpad

 

GRIP_DEVICE_INDEPENDENT

device is a Magic Mouse

 

enum GripTimeType

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

Members

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

This is a boxed type.

Members

GripGestureType type;

the GripGestureType, selects the variant record

 

GripEventGestureAny any;

   

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.

Members

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.

Members

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.

Members

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.

Members

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