2
* Copyright 2010 Canonical, Ltd.
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of either or both of the following licenses:
7
* 1) the GNU Lesser General Public License version 3, as published by the
8
* Free Software Foundation; and/or
9
* 2) the GNU Lesser General Public License version 2.1, as published by
10
* the Free Software Foundation.
12
* This program is distributed in the hope that it will be useful, but
13
* WITHOUT ANY WARRANTY; without even the implied warranties of
14
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
15
* PURPOSE. See the applicable version of the GNU Lesser General Public
16
* License for more details.
18
* You should have received a copy of both the GNU Lesser General Public
19
* License version 3 and version 2.1 along with this program. If not, see
20
* <http://www.gnu.org/licenses/>
23
* Cody Russell <crussell@canonical.com>
26
#ifndef __GRIP_GESTURE_MANAGER_H__
27
#define __GRIP_GESTURE_MANAGER_H__
33
#define GRIP_TYPE_GESTURE_MANAGER (grip_gesture_manager_get_type ())
34
#define GRIP_GESTURE_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GRIP_TYPE_GESTURE_MANAGER, GripGestureManager))
35
#define GRIP_GESTURE_MANAGER_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GRIP_TYPE_GESTURE_MANAGER, GripGestureManagerClass))
36
#define GRIP_IS_GESTURE_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GRIP_TYPE_GESTURE_MANAGER))
37
#define GRIP_IS_GESTURE_MANAGER_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GRIP_TYPE_GESTURE_MANAGER))
38
#define GRIP_GESTURE_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GRIP_TYPE_GESTURE_MANAGER, GripGestureManagerClass))
40
typedef struct _GripGestureManager GripGestureManager;
41
typedef struct _GripGestureManagerClass GripGestureManagerClass;
42
typedef struct _GripGestureManagerPrivate GripGestureManagerPrivate;
44
typedef union _GripGestureEvent GripGestureEvent;
45
typedef struct _GripEventGestureAny GripEventGestureAny;
46
typedef struct _GripEventGestureDrag GripEventGestureDrag;
47
typedef struct _GripEventGesturePinch GripEventGesturePinch;
48
typedef struct _GripEventGestureRotate GripEventGestureRotate;
49
typedef struct _GripEventGestureTap GripEventGestureTap;
52
GRIP_GESTURE_DRAG = 0,
53
GRIP_GESTURE_PINCH = 1,
54
GRIP_GESTURE_ROTATE = 2,
64
struct _GripEventGestureAny
70
struct _GripEventGestureDrag
89
struct _GripEventGesturePinch
100
gdouble radius_delta;
101
gdouble radial_velocity;
105
struct _GripEventGestureRotate
107
GripGestureType type;
117
gdouble angular_velocity;
121
struct _GripEventGestureTap
123
GripGestureType type;
138
union _GripGestureEvent
140
GripGestureType type;
141
GripEventGestureAny any;
142
GripEventGestureDrag drag;
143
GripEventGesturePinch pinch;
144
GripEventGestureRotate rotate;
145
GripEventGestureTap tap;
152
A singleton manager into which a window may be registered to receive
153
multitouch gesture events.
155
struct _GripGestureManager
157
GObject parent_instance;
160
GripGestureManagerPrivate *priv;
164
GripGestureManagerClass
165
@parent_class: #GObjectClass
167
struct _GripGestureManagerClass
169
GObjectClass parent_class;
173
* GripGestureCallback:
174
* @widget: (in): A #GtkWidget pointer
175
* @time: A #GripTimeType
176
* @gesture: (in): A #GripGestureEvent pointer
177
* @user_data: (transfer none): user data
179
typedef void (* GripGestureCallback) (GtkWidget *widget,
181
GripGestureEvent *gesture,
184
GType grip_gesture_manager_get_type (void) G_GNUC_CONST;
187
* grip_gesture_manager_get:
189
* Retrieves a #GripGestureManager pointer.
191
* Return value: (transfer none): A #GripGestureManager
193
GripGestureManager *grip_gesture_manager_get (void);
196
* grip_gesture_manager_register_window:
198
* @widget: A #GtkWidget on which to register the gesture
199
* @gesture_type: Gesture type
200
* @touch_points: Number of touch points
201
* @callback: Callback
202
* @user_data: (transfer none): User data
203
* @destroy: (transfer none) (scope async): Destroy
205
void grip_gesture_manager_register_window (GripGestureManager *manager,
207
GripGestureType gesture_type,
209
GripGestureCallback callback,
211
GDestroyNotify destroy);
213
GType grip_gesture_event_get_type (void) G_GNUC_CONST;
214
GripGestureEvent *grip_gesture_event_new (GripGestureType gesture_type);
215
void grip_gesture_event_free (GripGestureEvent *event);
216
GripGestureEvent *grip_gesture_event_copy (const GripGestureEvent *event);
221
#endif /* __GRIP_GESTURE_MANAGER_H__ */