This file is indexed.

/usr/include/libgrip/gripgesturemanager.h is in libgrip-dev 0.3.7+14.04.20140303-0ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
/*
 * Copyright 2010, 2011 Canonical, Ltd.
 *
 * This program is free software: you can redistribute it and/or modify it
 * under the terms of either or both of the following licenses:
 *
 * 1) the GNU Lesser General Public License version 3, as published by the
 * Free Software Foundation; and/or
 * 2) the GNU Lesser General Public License version 2.1, as published by
 * the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranties of
 * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
 * PURPOSE.  See the applicable version of the GNU Lesser General Public
 * License for more details.
 *
 * You should have received a copy of both the GNU Lesser General Public
 * License version 3 and version 2.1 along with this program.  If not, see
 * <http://www.gnu.org/licenses/>
 *
 * Authors:
 *    Cody Russell <crussell@canonical.com>
 */

#ifndef GRIP_GESTURE_MANAGER_H
#define GRIP_GESTURE_MANAGER_H

#include <gtk/gtk.h>
#include "gripinputdevice.h"

G_BEGIN_DECLS

/**
 * SECTION:GripGestureManager
 *
 * The Grip gesture managre is a singleton object that connections to the
 * gesture recognition engine and manages gesture subscriptions for GTK widgets.
 */

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

/**
 * GRIP_TYPE_GESTURE_MANAGER:
 *
 * Gets the #GType for the #GripGestureManager.
 */
#define GRIP_TYPE_GESTURE_MANAGER            (grip_gesture_manager_get_type ())

/**
 * GRIP_GESTURE_MANAGER:
 * @obj: The #GObject to convert.
 *
 * Performs a checked conversion of a #GObject to a #GripGestureManager.
 */
#define GRIP_GESTURE_MANAGER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GRIP_TYPE_GESTURE_MANAGER, GripGestureManager))

/**
 * GRIP_GESTURE_MANAGER_CLASS:
 * @klass: The #GObjectClass to convert.
 *
 * Performes a checked conversion of a #GObjectClass to a
 * #GripGestureManagerClass.
 */
#define GRIP_GESTURE_MANAGER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GRIP_TYPE_GESTURE_MANAGER, GripGestureManagerClass))

/**
 * GRIP_IS_GESTURE_MANAGER:
 * @obj: The #GObject to check.
 *
 * Checks to see if #GripGestureManagerClass is in the #GObjectClass heirarchy
 * of @obj.
 */
#define GRIP_IS_GESTURE_MANAGER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GRIP_TYPE_GESTURE_MANAGER))

/**
 * GRIP_IS_GESTURE_MANAGER_CLASS:
 * @klass: The #GObjectClass to check.
 *
 * Checks to see if a #GripGestureManagerClass object is in the object heirarchy
 * of @klass.
 */
#define GRIP_IS_GESTURE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GRIP_TYPE_GESTURE_MANAGER))

/**
 * GRIP_GESTURE_MANAGER_GET_CLASS:
 * @obj: A #GObject.
 *
 * Gets the @GripGestureManagerClass object for @obj if that object is a member
 * of its #GObjectClass heirarchy.
 */
#define GRIP_GESTURE_MANAGER_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GRIP_TYPE_GESTURE_MANAGER, GripGestureManagerClass))

typedef struct _GripGestureManager        GripGestureManager;
typedef struct _GripGestureManagerClass   GripGestureManagerClass;
typedef struct _GripGestureManagerPrivate GripGestureManagerPrivate;

typedef union  _GripGestureEvent       GripGestureEvent;
typedef struct _GripEventGestureAny    GripEventGestureAny;
typedef struct _GripEventGestureDrag   GripEventGestureDrag;
typedef struct _GripEventGesturePinch  GripEventGesturePinch;
typedef struct _GripEventGestureRotate GripEventGestureRotate;
typedef struct _GripEventGestureTap    GripEventGestureTap;

/**
 * GripGestureType:
 * @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
 *
 * Indicates the type of gesture for which a gesture event is being received.
 */
typedef enum {
  GRIP_GESTURE_DRAG    = 0,
  GRIP_GESTURE_PINCH   = 1,
  GRIP_GESTURE_ROTATE  = 2,
  GRIP_GESTURE_TAP     = 15
} GripGestureType;


#define GRIP_DEVICE_ALL (GRIP_DEVICE_TOUCHSCREEN | GRIP_DEVICE_TOUCHPAD | GRIP_DEVICE_INDEPENDENT)

/**
 * GripTimeType:
 * @GRIP_TIME_START: a new gesture is starting
 * @GRIP_TIME_UPDATE: an existing gesture is updating
 * @GRIP_TIME_END: a gesture is ending
 *
 * Indicates the part of the gesture stream ocuuring during the gesture event.
 */
typedef enum {
  GRIP_TIME_START,
  GRIP_TIME_UPDATE,
  GRIP_TIME_END
} GripTimeType;

/**
 * GripEventGestureAny:
 * 
 * This struct is not used.
 */
struct _GripEventGestureAny
{
  GdkEventType  type;
  GdkWindow    *window;
};

/**
 * GripEventGestureDrag:
 * @type: the #GripGestureType of the gesture
 * @id: identifies the gesture
 * @window: the #GdkWindow in which the gesture occurred
 * @root: the root #GdkWindow
 * @child: the child #GdkWindow
 * @timestamp: the time the gesture event occurred
 * @fingers: the number of touches making up the gesture
 * @focus_x: the X coordinate of the focus point of the gesture start
 * @focus_y: the Y coordinate of the focus point of the gesture start
 * @delta_x: the change in the X coordinate since the last gesture event
 * @delta_y: the change in the Y coordinate since the last gesture event
 * @velocity_x: the rate of change of the X coordinate
 * @velocity_y: the rate of change of the Y coordinate
 * @position_x: the current X coordinate of the centroid poistion of the touches
 * @position_y: the current Y coordinate of the centroid poistion of the touches
 * @input_device: the #GripInputDevice used to make the gesture
 *
 * Data associated with a drag event.  A drag is a lateral motion.
 */
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;
};

/**
 * GripEventGesturePinch:
 * @type: the #GripGestureType of the gesture
 * @id: identifies the gesture
 * @window: the #GdkWindow in which the gesture occurred
 * @root: the root #GdkWindow
 * @child: the child #GdkWindow
 * @timestamp: the time the gesture event occurred
 * @fingers: the number of touches making up the gesture
 * @focus_x: the X coordinate of the focus point of the gesture start
 * @focus_y: the Y coordinate of the focus point of the gesture start
 * @radius_delta: the change in the radius (in screen coordinates)
 * @radial_velocity: the rate of change of the radius
 * @radius: the current radius (in screen coordinates)
 * @position_x: the current X coordinate of the centroid poistion of the touches
 * @position_y: the current Y coordinate of the centroid poistion of the touches
 * @input_device: the #GripInputDevice used to make the gesture
 *
 * Data associated with a pinch event.  A pinch is an expand or contract motion.
 */
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;
};

/**
 * GripEventGestureRotate:
 * @type: the #GripGestureType of the gesture
 * @id: identifies the gesture
 * @window: the #GdkWindow in which the gesture occurred
 * @root: the root #GdkWindow
 * @child: the child #GdkWindow
 * @timestamp: the time the gesture event occurred
 * @fingers: the number of touches making up the gesture
 * @focus_x: the X coordinate of the focus point of the gesture start
 * @focus_y: the Y coordinate of the focus point of the gesture start
 * @angle_delta: the change in the rotation angle (in radians) 
 * @angular_velocity: the rate of change in the rotation angle
 * @angle: the current rotation angle
 * @position_x: the current X coordinate of the centroid poistion of the touches
 * @position_y: the current Y coordinate of the centroid poistion of the touches
 * @input_device: the #GripInputDevice used to make the gesture
 *
 * Data associated with a rotate gesture event.
 */
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;
};

/**
 * GripEventGestureTap:
 * @type: the #GripGestureType of the gesture
 * @id: identifies the gesture
 * @window: the #GdkWindow in which the gesture occurred
 * @root: the root #GdkWindow
 * @child: the child #GdkWindow
 * @timestamp: the time the gesture event occurred
 * @fingers: the number of touches making up the gesture
 * @tap_time: the duration of the tap
 * @focus_x: the X coordinate of the focus point of the gesture start
 * @focus_y: the Y coordinate of the focus point of the gesture start
 * @position_x: the current X coordinate of the centroid poistion of the touches
 * @position_y: the current Y coordinate of the centroid poistion of the touches
 * @input_device: the #GripInputDevice used to make the gesture
 *
 * Data associated with a tap gesture.
 */
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;
};

/**
 * GripGestureEvent:
 * @type: the #GripGestureType, selects the variant record
 * @drag: the event contains a drag gesture record
 * @pinch: the event contains a pinch gesture record
 * @rotate: the event contains a rotate gesture record
 * @tap: the event contains a tap gesture record
 *
 * This is a boxed type.
 */
union _GripGestureEvent
{
  GripGestureType        type;
  GripEventGestureAny    any;
  GripEventGestureDrag   drag;
  GripEventGesturePinch  pinch;
  GripEventGestureRotate rotate;
  GripEventGestureTap    tap;
};

/**
 * GripGestureManager:
 * @parent_instance: the parent #GObject instance.
 *
 * A singleton manager into which a window may be registered to receive
 * multitouch gesture events.
 */
struct _GripGestureManager
{
  /*< Public >*/
  GObject parent_instance;

  /*< Private >*/
  GripGestureManagerPrivate *priv;
};

/**
 * GripGestureManagerClass:
 * @parent_class: the base #GObjectClass
 *
 * The class object for a #GripGestureManager.
 */
struct _GripGestureManagerClass
{
  GObjectClass parent_class;
};

/**
 * GripGestureCallback:
 * @widget: (in): A #GtkWidget pointer
 * @time: A #GripTimeType
 * @gesture: (in): A #GripGestureEvent pointer
 * @user_data: (transfer none): user data
 *
 * The gesture callback function is registered by the
 * grip_gesture_manager_register_window() function and gets called whenever a
 * new gesture event has been received.  The same function may be registered for
 * more than one gesture type.
 *
 * The <type>GripGestureCallback</type> function is the main customization point
 * for application response to gestural input.
 **/
typedef void (* GripGestureCallback) (GtkWidget         *widget,
                                      GripTimeType       time,
                                      GripGestureEvent  *gesture,
                                      gpointer           user_data);

GType                grip_gesture_manager_get_type        (void) G_GNUC_CONST;

/**
 * grip_gesture_manager_get:
 *
 * Retrieves a #GripGestureManager pointer.
 *
 * Return value: (transfer none): A #GripGestureManager
 **/
GripGestureManager *grip_gesture_manager_get              (void);

/**
 * grip_gesture_manager_register_window:
 * @manager: self
 * @widget: A #GtkWidget on which to register the gesture
 * @gesture_type: Gesture type
 * @device_type: Type of the device producing the gesture.
 * @touch_points: Number of touch points
 * @callback: Callback
 * @user_data: (transfer none): User data
 * @destroy: (transfer none) (scope async): Destroy
 */
void                 grip_gesture_manager_register_window (GripGestureManager *manager,
                                                           GtkWidget          *widget,
                                                           GripGestureType     gesture_type,
                                                           GripDeviceType      device_type,
                                                           gint                touch_points,
                                                           GripGestureCallback callback,
                                                           gpointer            user_data,
                                                           GDestroyNotify      destroy);

void grip_gesture_manager_unregister_window (GripGestureManager  *manager,
                                             GtkWidget           *widget);

GType             grip_gesture_event_get_type (void) G_GNUC_CONST;
GripGestureEvent *grip_gesture_event_new      (GripGestureType   gesture_type);
void              grip_gesture_event_free     (GripGestureEvent *event);
GripGestureEvent *grip_gesture_event_copy     (const GripGestureEvent *event);


G_END_DECLS

#endif /* GRIP_GESTURE_MANAGER_H */