~oif-team/geis/2.1.2

« back to all changes in this revision

Viewing changes to include/geis/geis.h

  • Committer: Stephen M. Webb
  • Date: 2011-03-17 04:06:04 UTC
  • mto: This revision was merged to the branch mainline in revision 117.
  • Revision ID: stephen.webb@canonical.com-20110317040604-ro1xq4wm6elg903c
Refined the API documentation and added an examples directory.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
extern "C" {
26
26
#endif
27
27
 
 
28
/**
 
29
 * @defgroup geis_common Common Types and Definitions
 
30
 *
 
31
 * These types and values are common to both the simplified and advanced GEIS
 
32
 * interfaces.
 
33
 */
 
34
 
 
35
/**
 
36
  * @defgroup geis_v1 The Simplified GEIS Interface
 
37
  *
 
38
  * The simplified GEIS interface is the original (GEIS v1) API.  It provides a
 
39
  * way to specify a list of gesture names and input devices for which gestures
 
40
  * will be recognized on a given window.
 
41
  *
 
42
  * See @ref using_geis_v1.
 
43
  */
 
44
 
 
45
/**
 
46
 * @defgroup geis_v2 The Advanced GEIS Interface
 
47
 *
 
48
 * The advanced GEIS interface (GEIS v2) was developed to give a more nuanced
 
49
 * control over the types of gestures and input devices for which gestures will
 
50
 * be recognized.
 
51
  *
 
52
  * See @ref using_geis_v2.
 
53
 */
 
54
 
 
55
/**
 
56
  * GEIS version macros
 
57
  *
 
58
  * These macros can be tested at compile time to query for support of various
 
59
  * features.
 
60
  */
28
61
#define GEIS_VERSION_1_0  1
29
62
#define GEIS_VERSION_2_0  20101122
30
63
 
31
64
#include <geis/geisimpl.h>
32
65
 
 
66
/**
 
67
 * Errors returned from calls.
 
68
 * @ingroup geis_common
 
69
 *
 
70
 * Most GEIS API calls return a status code indicating success or, in the event
 
71
 * of a lack of success, the reson for failure.
 
72
 */
 
73
typedef enum GeisStatus
 
74
{
 
75
  GEIS_STATUS_SUCCESS       = 0,    /**< normal successful completion */
 
76
  GEIS_STATUS_CONTINUE      = 20,   /**< normal successful completion
 
77
                                         with data still remaining */
 
78
  GEIS_STATUS_EMPTY         = 21,   /**< normal successful completion
 
79
                                         with no data retrieved */
 
80
  GEIS_STATUS_NOT_SUPPORTED = 10,   /**< a requested feature is not supported */
 
81
  GEIS_BAD_ARGUMENT         = 1000, /**< a bad argument value was passed */
 
82
  GEIS_UNKNOWN_ERROR        = 9999, /**< any other error condition */
 
83
  GEIS_STATUS_BAD_ARGUMENT  = -100, /**< a bad argument value was passed */
 
84
  GEIS_STATUS_UNKNOWN_ERROR = -999  /**< any other error condition */
 
85
} GeisStatus;
 
86
 
 
87
/**
 
88
 * Attribute data types.
 
89
 * @ingroup geis_common
 
90
 */
 
91
typedef enum GeisAttrType
 
92
{
 
93
  GEIS_ATTR_TYPE_UNKNOWN,    /**< Attr is an unknown type. */
 
94
  GEIS_ATTR_TYPE_BOOLEAN,    /**< Attr is truth-valued . */
 
95
  GEIS_ATTR_TYPE_FLOAT,      /**< Attr is real-valued. */
 
96
  GEIS_ATTR_TYPE_INTEGER,    /**< Attr is a counting number. */
 
97
  GEIS_ATTR_TYPE_POINTER,    /**< Attr is a pointer to a data structure. */
 
98
  GEIS_ATTR_TYPE_STRING      /**< Attr is a null-terminated UTF-8 string. */
 
99
 
 
100
} GeisAttrType;
 
101
 
 
102
#define GEIS_FALSE 0
 
103
#define GEIS_TRUE  1
 
104
 
33
105
/* Standard fundamental gestures */
34
106
#define GEIS_GESTURE_DRAG    "Drag"
35
107
#define GEIS_GESTURE_PINCH   "Pinch"
37
109
#define GEIS_GESTURE_TAP     "Tap"
38
110
 
39
111
/**
40
 
 * @defgroup geis_v1_gesture_types Standard Gesture Types (GEIS v1)
41
 
 * The names of standard gesture types.  These names can be passed to 
 
112
 * @defgroup geis_v1_gesture_types Gesture Types
 
113
 * @ingroup geis_v1
 
114
 *
 
115
 * The names of gesture types.  These names can be passed to 
42
116
 * geis_subscribe() in a NULL-terminated list to specify only a subset of
43
117
 * available gestures.
 
118
 */
 
119
 
 
120
/**
 
121
 * @defgroup geis_v1_standar_gesture_types Standard Gesture Types
 
122
 * @ingroup geis_v1_gesture_types
 
123
 *
 
124
 * These gesture types should be available on all GEIS implementations.
 
125
 *
44
126
 * @{
45
127
 */
46
128
 
69
151
/* @} */
70
152
 
71
153
/**
72
 
 * @defgroup geis_v1_vendor_extensions Vendor Extensions (GEIS v1)
 
154
 * @defgroup geis_v1_vendor_extensions Vendor Extension Gesture Types
 
155
 * @ingroup geis_v1_gesture_types
 
156
 *
73
157
 * Vendor-specific extensions to the GEIS v1 API.
 
158
 *
74
159
 * @{
75
160
 */
76
161
 
124
209
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_4_X        "touch 4 x"
125
210
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_4_Y        "touch 4 y"
126
211
 
127
 
#define GEIS_TOUCH_ATTRIBUTE_ID                 "touch id"
128
 
#define GEIS_TOUCH_ATTRIBUTE_X                  "touch x"
129
 
#define GEIS_TOUCH_ATTRIBUTE_Y                  "touch y"
130
 
 
131
 
#define GEIS_REGION_ATTRIBUTE_WINDOWID          "windowid"
132
 
 
133
 
#define GEIS_FALSE 0
134
 
#define GEIS_TRUE  1
135
 
 
136
 
 
137
 
/**
138
 
 * @defgroup geis_status Status and Errors
139
 
 *
140
 
 * Most GEIS API calls return a status code indicating success or, in the event
141
 
 * of a lack of success, the reson for failure.
142
 
 *
143
 
 * @{
144
 
 */
145
 
 
146
 
/**
147
 
 * Errors returned from calls.
148
 
 */
149
 
typedef enum GeisStatus
150
 
{
151
 
  GEIS_STATUS_SUCCESS       = 0,    /**< normal successful completion */
152
 
  GEIS_STATUS_CONTINUE      = 20,   /**< normal successful completion
153
 
                                         with data still remaining */
154
 
  GEIS_STATUS_EMPTY         = 21,   /**< normal successful completion
155
 
                                         with no data retrieved */
156
 
  GEIS_STATUS_NOT_SUPPORTED = 10,   /**< a requested feature is not supported */
157
 
  GEIS_BAD_ARGUMENT         = 1000, /**< a bad argument value was passed */
158
 
  GEIS_UNKNOWN_ERROR        = 9999, /**< any other error condition */
159
 
  GEIS_STATUS_BAD_ARGUMENT  = -100, /**< a bad argument value was passed */
160
 
  GEIS_STATUS_UNKNOWN_ERROR = -999  /**< any other error condition */
161
 
} GeisStatus;
162
 
 
163
 
/* @} */
164
212
 
165
213
/**
166
214
 * @defgroup geis_meta Initialization and Cleanup
 
215
 * @ingroup geis_v1
167
216
 *
168
217
 * Each instance of a gesture subscription must be created using the geis_init()
169
218
 * call and destroyed using the geis_finish() call.
182
231
 */
183
232
 
184
233
/**
185
 
 * An opaque type representing a geis gesture subscription instance.
 
234
 * @class GeisInstance
 
235
 * A geis gesture subscription instance.
186
236
 */
 
237
/** @cond typedef */
187
238
typedef struct _GeisInstance *GeisInstance;
 
239
/** @endcond */
188
240
 
189
241
/**
190
 
 * @struct GeisWinInfo
 
242
 * @class GeisWinInfo
191
243
 * Generic display region description block
192
244
 */
193
245
typedef struct GeisWinInfo
194
246
{
195
 
  uint32_t win_type;
196
 
  void    *win_info;
 
247
  uint32_t win_type;    /**< Selects the implementation-specific window type. */
 
248
  void    *win_info;    /**< Additional info dependent on the window type. */
197
249
} GeisWinInfo;
198
250
 
199
251
/**
200
252
 * Initializes a geis subscription instance for a display region.
 
253
 * @memberof GeisInstance
201
254
 *
202
255
 * @param[in]  win_info         a display region description block
203
256
 *                              -- see geis implementtaion documentation
210
263
GEIS_API GeisStatus geis_init(GeisWinInfo *win_info, GeisInstance *geis_instance);
211
264
 
212
265
/**
213
 
 * Cleans up a geis subscriotion instance for a display region.
 
266
 * Cleans up a geis subscription instance for a display region.
 
267
 * @memberof GeisInstance
214
268
 *
215
269
 * @param[in] geis_instance     an opaque pointer to a geis gesture subscription
216
270
 *                              instance
223
277
/* @} */
224
278
 
225
279
/**
226
 
 * @defgroup geis_2_geis The Geis API Object (GEIS v2.0)
227
 
 *
228
 
 * @{
229
 
 */
230
 
 
231
 
/**
232
 
 * @defgroup geis_2_geis_init_args Specified Initialization Arguments
233
 
 *
234
 
 * These initialization arguments are defined by the GEIS specification.
235
 
 *
236
 
 * @{
237
 
 */
238
 
 
239
 
/**
 
280
 * @defgroup geis_v1_config Configuration and Control
 
281
 * @ingroup geis_v1
 
282
 * @{
 
283
 */
 
284
 
 
285
/**
 
286
 * Gets the Unix file descriptor for GEIS events.
 
287
 *
 
288
 * Applications or toolkits can use this file descriptor to intgerate geis event
 
289
 * handling into their main event dispatch loop.  When a GEIS event is available
 
290
 * for processing, the fd will have a read-available state indicated in
 
291
 * select(), poll(), epoll(), etc.
 
292
 */
 
293
#define GEIS_CONFIG_UNIX_FD 10001
 
294
 
 
295
/**
 
296
 * Indicates if a particular feaure is supported.
 
297
 *
 
298
 * @param[in] geis_instance      An opaque pointer to a geis gesture subscription
 
299
 *                               instance.
 
300
 * @param[in] configuration_item Indicates which configuration item will be
 
301
 *                               checked for support.
 
302
 *
 
303
 * @retval GEIS_BAD_ARGUMENT    an invalid argument value was passed
 
304
 * @retval GEIS_STATUS_SUCCESS  normal successful completion
 
305
 */
 
306
GEIS_API GeisStatus geis_configuration_supported(GeisInstance geis_instance,
 
307
                                                 int          configuration_item);
 
308
 
 
309
/**
 
310
 * Gets a feature configuration value.
 
311
 *
 
312
 * @param[in] geis_instance      An opaque pointer to a geis gesture subscription
 
313
 *                               instance.
 
314
 * @param[in] configuration_item Indicates which configuration item will be
 
315
 *                               get.
 
316
 * @param[in] value              A pointer to where the retrieved value will be
 
317
 *                               stored.
 
318
 *
 
319
 * @retval GEIS_BAD_ARGUMENT    an invalid argument value was passed
 
320
 * @retval GEIS_STATUS_SUCCESS  normal successful completion
 
321
 */
 
322
GEIS_API GeisStatus geis_configuration_get_value(GeisInstance geis_instance, 
 
323
                                                 int          configuration_item,
 
324
                                                 void         *value);
 
325
 
 
326
/**
 
327
 * Sets a feature configuration value.
 
328
 *
 
329
 * @param[in] geis_instance      An opaque pointer to a geis gesture subscription
 
330
 *                               instance.
 
331
 * @param[in] configuration_item Indicates which configuration item will be
 
332
 *                               set.
 
333
 * @param[in] value              A pointer to where the value to be set will be
 
334
 *                               read.
 
335
 *
 
336
 * @retval GEIS_BAD_ARGUMENT    an invalid argument value was passed
 
337
 * @retval GEIS_STATUS_SUCCESS  normal successful completion
 
338
 */
 
339
GEIS_API GeisStatus geis_configuration_set_value(GeisInstance geis_instance,
 
340
                                                 int          configuration_item, 
 
341
                                                 void         *value);
 
342
 
 
343
/**
 
344
 * Dispatches geis events until there are no further events available.
 
345
 *
 
346
 * @param[in] geis_instance     an opaque pointer to a geis gesture subscription
 
347
 *                              instance
 
348
 *
 
349
 * This function is used to integrate geis even dispatch into the main event
 
350
 * loop of an application or toolkit.
 
351
 *
 
352
 * @retval GEIS_BAD_ARGUMENT    an invalid GeisInstance was passed
 
353
 * @retval GEIS_STATUS_SUCCESS  normal successful completion
 
354
 */
 
355
GEIS_API GeisStatus geis_event_dispatch(GeisInstance geis_instance);
 
356
 
 
357
/* @} */
 
358
 
 
359
/**
 
360
 * @defgroup geis_v2_geis The Geis API Object
 
361
 * @ingroup geis_v2
 
362
 *
 
363
 * @{
 
364
 */
 
365
 
 
366
/**
 
367
 * @class Geis
 
368
 * Represents an instance of the gestire recognition engine
 
369
 */
 
370
/** @cond typedef */
 
371
typedef struct _Geis *Geis;
 
372
/** @endcond */
 
373
 
 
374
/**
 
375
 * @name Standard Initialization Arguments
 
376
 *
 
377
 * @par
 
378
 * These initialization arguments are defined by the GEIS v2 specification.
 
379
 *
 
380
 * @{
 
381
 *
 
382
 * @def GEIS_INIT_SERVICE_PROVIDER
240
383
 * Enables GEIS to provide a networked service.
241
 
 *
 
384
 * This initialization argument takes no parameters.
 
385
 *
 
386
 * @def GEIS_INIT_TRACK_DEVICES
 
387
 * Tells GEIS to send input device events.
 
388
 * This initialization argument takes no parameters.
 
389
 *
 
390
 * @def GEIS_INIT_TRACK_GESTURE_CLASSES
 
391
 * Tells GEIS to send gesture class events.
242
392
 * This initialization argument takes no parameters.
243
393
 */
 
394
 
244
395
#define GEIS_INIT_SERVICE_PROVIDER     "org.libgeis.init.server"
245
 
 
246
 
/**
247
 
 * Tells GEIS to send input device events.
248
 
 *
249
 
 * This initialization argument takes no parameters.
250
 
 */
251
396
#define GEIS_INIT_TRACK_DEVICES        "org.libgeis.init.track-devices"
252
 
 
253
 
/**
254
 
 * Tells GEIS to send gesture class events.
255
 
 *
256
 
 * This initialization argument takes no parameters.
257
 
 */
258
397
#define GEIS_INIT_TRACK_GESTURE_CLASSES  "org.libgeis.init.track-gesture-classes"
259
398
 
260
399
/* @} */
261
400
 
262
401
/**
263
 
 * @defgroup geis_2_geis_init_vendor Vendor-defined Initialization Arguments
 
402
 * @name Vendor-defined Initialization Arguments
264
403
 *
 
404
 * @par
265
405
 * These initialization arguments are not a part of te GEIS specification and
266
406
 * may change.
267
407
 *
268
408
 * @{
 
409
 *
 
410
 * @def GEIS_INIT_UTOUCH_MOCK_ENGINE
 
411
 *
 
412
 * @def GEIS_INIT_UTOUCH_XCB
269
413
 */
270
414
 
271
415
#define GEIS_INIT_UTOUCH_MOCK_ENGINE "com.canonical.utouch.mock.engine"
274
418
/* @} */
275
419
 
276
420
 
277
 
typedef struct _Geis *Geis;
278
 
 
279
421
/**
280
422
 * Initializes an instance of the GEIS v2.0 API.
281
 
 *
282
 
 * @param[in]  name  A name for the API instance (used for diagnostics).
283
 
 * @param[in]  ...   A set of zero or more initialization arguments.
 
423
 * @ingroup geis_v2_geis
 
424
 * @memberof Geis
 
425
 *
 
426
 * @param[in]  init_arg_name  The name of an initializaer argument.
 
427
 * @param[in]  ...            The remaining initializaer arguments.
 
428
 *
 
429
 * A NULL-terminated list of zero or more initialization arguments is passed to
 
430
 * this function to create and initialize a connection to a gesture recognition
 
431
 * engine.
 
432
 *
 
433
 * If no initialization arguments are passed, the parameter list consists of a
 
434
 * single NULL argument.
284
435
 */
285
436
GEIS_API Geis geis_new(GeisString init_arg_name, ...);
286
437
 
287
438
/**
288
439
 * Cleans up an instance of the GEIS v2.0 API.
 
440
 * @ingroup geis_v2_geis
 
441
 * @memberof Geis
289
442
 *
290
443
 * @param[in] geis  An instance of the GEIS v2.0 API.
291
444
 *
297
450
/* @} */
298
451
 
299
452
/**
300
 
 * @defgroup geis_error Error Reporting
 
453
 * @defgroup geis_v2_error Error Reporting
 
454
 * @ingroup geis_v2
301
455
 * @{
302
456
 */
303
457
 
343
497
/* @} */
344
498
 
345
499
/**
346
 
 * @defgroup geis1_config Configuration and Control (GEIS v1.0)
347
 
 * @{
348
 
 */
349
 
 
350
 
#define GEIS_CONFIG_UNIX_FD 10001
351
 
 
352
 
/**
353
 
 * Indicates if a particular feaure is supported.
354
 
 *
355
 
 * @param[in] geis_instance     an opaque pointer to a geis gesture subscription
356
 
 *                              instance
357
 
 *
358
 
 * @retval GEIS_BAD_ARGUMENT    an invalid argument value was passed
359
 
 * @retval GEIS_STATUS_SUCCESS  normal successful completion
360
 
 */
361
 
GEIS_API GeisStatus geis_configuration_supported(GeisInstance geis_instance,
362
 
                                                 int          configuration_item);
363
 
 
364
 
/**
365
 
 * Gets a feature configuration value.
366
 
 *
367
 
 * @param[in] geis_instance     an opaque pointer to a geis gesture subscription
368
 
 *                              instance
369
 
 *
370
 
 * @retval GEIS_BAD_ARGUMENT    an invalid argument value was passed
371
 
 * @retval GEIS_STATUS_SUCCESS  normal successful completion
372
 
 */
373
 
GEIS_API GeisStatus geis_configuration_get_value(GeisInstance geis_instance, 
374
 
                                                 int          configuration_item,
375
 
                                                 void         *value);
376
 
 
377
 
/**
378
 
 * Sets a feature configuration value.
379
 
 *
380
 
 * @param[in] geis_instance     an opaque pointer to a geis gesture subscription
381
 
 *                              instance
382
 
 *
383
 
 * @retval GEIS_BAD_ARGUMENT    an invalid argument value was passed
384
 
 * @retval GEIS_STATUS_SUCCESS  normal successful completion
385
 
 */
386
 
GEIS_API GeisStatus geis_configuration_set_value(GeisInstance geis_instance,
387
 
                                                 int          configuration_item, 
388
 
                                                 void         *value);
389
 
 
390
 
/**
391
 
 * Dispatches geis events until there are no further events available.
392
 
 *
393
 
 * @param[in] geis_instance     an opaque pointer to a geis gesture subscription
394
 
 *                              instance
395
 
 *
396
 
 * This function is used to integrate geis even dispatch into the main event
397
 
 * loop of an application or toolkit.
398
 
 *
399
 
 * @retval GEIS_BAD_ARGUMENT    an invalid GeisInstance was passed
400
 
 * @retval GEIS_STATUS_SUCCESS  normal successful completion
401
 
 */
402
 
GEIS_API GeisStatus geis_event_dispatch(GeisInstance geis_instance);
403
 
 
404
 
/* @} */
405
 
 
406
 
/**
407
 
 * @defgroup geis2_config Configuration (GEIS v2.0)
408
 
 * @{
409
 
 */
410
 
 
411
 
/**
412
 
 * @defgroup geis2_config_spec Required Configuration Items
413
 
 *
 
500
 * @defgroup geis_v2_config Configuration
 
501
 * @ingroup geis_v2
 
502
 * @{
 
503
 */
 
504
 
 
505
/**
 
506
 * @name Required Configuration Items
 
507
 *
 
508
 * @par
414
509
 * These configuration items are defined by the GEIS specification.
415
510
 *
416
511
 * @{
 
512
 *
 
513
 * @def GEIS_CONFIGURATION_FD
 
514
 * Gets a Unix file descriptor that will signal the availablility of GEIS events
 
515
 * for processing.
417
516
 */
418
517
 
419
518
#define GEIS_CONFIGURATION_FD "org.libgeis.configuration.fd"
421
520
/* @} */
422
521
 
423
522
/**
424
 
 * @defgroup geis2_config_vendor Vendor-defined Configuration Items
 
523
 * @name Vendor-defined Configuration Items
425
524
 *
 
525
 * @par
426
526
 * These configuration items are not a part of the GEIS specification and may
427
527
 * change.
428
528
 *
429
529
 * @{
 
530
 *
 
531
 * @def GEIS_CONFIG_UTOUCH_MAX_EVENTS
430
532
 */
431
533
 
432
534
#define GEIS_CONFIG_UTOUCH_MAX_EVENTS  "com.canonical.utouch.max_events"
454
556
/**
455
557
 * Sets a feature configuration value.
456
558
 *
457
 
 * @param[in]  geis                 An opaque GEIS API object.
458
 
 * @param[in]  configuration_value  Selects the configuration value to return.
459
 
 * @param[in]  configuration_item_name  Selects the configuration value to return.
 
559
 * @param[in] geis                     An opaque GEIS API object.
 
560
 * @param[in] configuration_item_name  Selects the configuration value to return.
460
561
 * @param[in] configuration_item_value Points to a buffer to contain the output
461
562
 *                                     configuration value.  The actual type of
462
563
 *                                     this buffer depends on the
473
574
/* @} */
474
575
 
475
576
/**
476
 
 * @defgroup geis2_attrs Attributes
477
 
 *
478
 
 * Attributes are named values associated with various GEIS entities, including
479
 
 * input devices, gesture types, and gesture events.
480
 
 *
481
 
 * @{
482
 
 */
483
 
typedef enum GeisAttrType
484
 
{
485
 
  GEIS_ATTR_TYPE_UNKNOWN,
486
 
  GEIS_ATTR_TYPE_BOOLEAN,
487
 
  GEIS_ATTR_TYPE_FLOAT,
488
 
  GEIS_ATTR_TYPE_INTEGER,
489
 
  GEIS_ATTR_TYPE_POINTER,
490
 
  GEIS_ATTR_TYPE_STRING
491
 
} GeisAttrType;
492
 
 
493
 
/**
494
 
 * An opaque type that encapsulates a GEIS attribute.
495
 
 *
496
 
 * GeisAttr objects may not be created or destroyed by the application, they may
497
 
 * only have their data examined or extracted.
498
 
 */
499
 
typedef struct _GeisAttr *GeisAttr;
500
 
 
501
 
/**
502
 
 * Gets the name of an attribute.
503
 
 *
504
 
 * @param[in] attr  Identifies the attribute.
505
 
 */
506
 
GEIS_API GeisString geis_attr_name(GeisAttr attr);
507
 
 
508
 
/**
509
 
 * Gets the type of an attribute value.
510
 
 *
511
 
 * @param[in] attr  Identifies the attribute.
512
 
 */
513
 
GEIS_API GeisAttrType geis_attr_type(GeisAttr attr);
514
 
 
515
 
/**
516
 
 * Gets the value of an attribute as a GeisBoolean.
517
 
 *
518
 
 * @param[in] attr  Identifies the attribute.
519
 
 */
520
 
GEIS_API GeisBoolean geis_attr_value_to_boolean(GeisAttr attr);
521
 
 
522
 
/**
523
 
 * Gets the value of an attribute as a GeisFloat.
524
 
 *
525
 
 * @param[in] attr  Identifies the attribute.
526
 
 */
527
 
GEIS_API GeisFloat geis_attr_value_to_float(GeisAttr attr);
528
 
 
529
 
/**
530
 
 * Gets the value of an attribute as a GeisInteger.
531
 
 *
532
 
 * @param[in] attr  Identifies the attribute.
533
 
 */
534
 
GEIS_API GeisInteger geis_attr_value_to_integer(GeisAttr attr);
535
 
 
536
 
/**
537
 
 * Gets the value of an attribute as a GeisPointer.
538
 
 *
539
 
 * @param[in] attr  Identifies the attribute.
540
 
 */
541
 
GEIS_API GeisPointer geis_attr_value_to_pointer(GeisAttr attr);
542
 
 
543
 
/**
544
 
 * Gets the value of an attribute as a GeisString.
545
 
 *
546
 
 * @param[in] attr  Identifies the attribute.
547
 
 */
548
 
GEIS_API GeisString geis_attr_value_to_string(GeisAttr attr);
549
 
 
550
 
/* @} */
551
 
 
552
 
/**
553
 
 * @defgroup geis_input Input Devices
 
577
 * @defgroup geis_v1_input Input Devices
 
578
 * @ingroup geis_v1
554
579
 * @{
555
580
 */
556
581
 
582
607
 *
583
608
 * @param[in] geis_instance   points to a geis gesture subscription
584
609
 *                            instance
585
 
 * @param[in] funcs           points to a GeisInputFuncs table
 
610
 * @param[in] func            points to a GeisInputFuncs table
586
611
 * @param[in] cookie          an application specific value to be passed to
587
612
 *                            the callback
588
613
 *
601
626
/* @} */
602
627
 
603
628
/**
604
 
 * @defgroup geis1_subscription Gesture Subscription (GEIS v1.0)
 
629
 * @defgroup geis_v1_subscription Gesture Subscription
 
630
 * @ingroup geis_v1
605
631
 * @{
606
632
 */
607
633
typedef unsigned int GeisGestureType;
608
634
typedef unsigned int GeisGestureId;
609
635
 
 
636
/** Selects ALL input devices. */
610
637
#define GEIS_ALL_GESTURES ((GeisGestureType)0)
 
638
 
611
639
#define GEIS_NO_GESTURE_ID ((GeisGestureId)0)
612
640
 
613
641
/**
614
 
 * Gesture Attributes
 
642
 * An individual gesture attribute.
 
643
 *
 
644
 * Gesture events are associated with a list of attributes, each of which is a
 
645
 * (name, type, value) tuple.  These attribute reveal a little piece of
 
646
 * information about a gesture.
615
647
 */
616
648
typedef struct GeisGestureAttr
617
649
{
 
650
  /** The name of the gesture attribute. */
618
651
  GeisString name;
 
652
  /** The data type of the gesture attribute. */
619
653
  GeisAttrType type;
 
654
  /** The value of the attributes. */
620
655
  union
621
656
  {
622
657
    GeisBoolean boolean_val;
642
677
                                    GeisGestureAttr  *attrs);
643
678
 
644
679
/**
645
 
 * A structure of callback functions.
 
680
 * The set of callback functions invoked for various gesture-related events.
 
681
 *
 
682
 * An application must define callback functions to handle the various gesture
 
683
 * events.  These callbacks are provided in a table passed to geis_subscribe for
 
684
 * each window on which gesture events may occur.
646
685
 */
647
686
typedef struct GeisGestureFuncs
648
687
{
 
688
  /** Invoked when a new gesture type has been defined. */
649
689
  GeisGestureCallback  added;
 
690
  /** Invoked when a defined gesture type is no longer available. */
650
691
  GeisGestureCallback  removed;
 
692
  /** Invoked when a new gesture starts. */
651
693
  GeisGestureCallback  start;
 
694
  /** Invoked when a gesture has changed values. */
652
695
  GeisGestureCallback  update;
 
696
  /** Invoked when a gesture finishes. */
653
697
  GeisGestureCallback  finish;
654
698
} GeisGestureFuncs;
655
699
 
688
732
/* @} */
689
733
 
690
734
/**
691
 
 * @defgroup geis2_event_control Event Control (GEIS v2.0)
 
735
 * @defgroup geis_v2_attrs Attributes
 
736
 * @ingroup geis_v2
 
737
 *
 
738
 * Attributes are named values associated with various GEIS entities, including
 
739
 * input devices, gesture types, and gesture events.
 
740
 *
 
741
 * @{
 
742
 */
 
743
 
 
744
/**
 
745
 * An opaque type that encapsulates a GEIS attribute.
 
746
 *
 
747
 * GeisAttr objects may not be created or destroyed by the application, they may
 
748
 * only have their data examined or extracted.
 
749
 */
 
750
/** @cond typedef */
 
751
typedef struct _GeisAttr *GeisAttr;
 
752
/** @endcond */
 
753
 
 
754
/**
 
755
 * Gets the name of an attribute.
 
756
 *
 
757
 * @param[in] attr  Identifies the attribute.
 
758
 */
 
759
GEIS_API GeisString geis_attr_name(GeisAttr attr);
 
760
 
 
761
/**
 
762
 * Gets the type of an attribute value.
 
763
 *
 
764
 * @param[in] attr  Identifies the attribute.
 
765
 */
 
766
GEIS_API GeisAttrType geis_attr_type(GeisAttr attr);
 
767
 
 
768
/**
 
769
 * Gets the value of an attribute as a GeisBoolean.
 
770
 *
 
771
 * @param[in] attr  Identifies the attribute.
 
772
 */
 
773
GEIS_API GeisBoolean geis_attr_value_to_boolean(GeisAttr attr);
 
774
 
 
775
/**
 
776
 * Gets the value of an attribute as a GeisFloat.
 
777
 *
 
778
 * @param[in] attr  Identifies the attribute.
 
779
 */
 
780
GEIS_API GeisFloat geis_attr_value_to_float(GeisAttr attr);
 
781
 
 
782
/**
 
783
 * Gets the value of an attribute as a GeisInteger.
 
784
 *
 
785
 * @param[in] attr  Identifies the attribute.
 
786
 */
 
787
GEIS_API GeisInteger geis_attr_value_to_integer(GeisAttr attr);
 
788
 
 
789
/**
 
790
 * Gets the value of an attribute as a GeisPointer.
 
791
 *
 
792
 * @param[in] attr  Identifies the attribute.
 
793
 */
 
794
GEIS_API GeisPointer geis_attr_value_to_pointer(GeisAttr attr);
 
795
 
 
796
/**
 
797
 * Gets the value of an attribute as a GeisString.
 
798
 *
 
799
 * @param[in] attr  Identifies the attribute.
 
800
 */
 
801
GEIS_API GeisString geis_attr_value_to_string(GeisAttr attr);
 
802
 
 
803
/* @} */
 
804
 
 
805
/**
 
806
 * @defgroup geis_v2_event_control Event Control
 
807
 * @ingroup geis_v2
692
808
 *
693
809
 * These functions are used to dispatch events generated from the various other
694
810
 * GEIS components.
718
834
} GeisEventType;
719
835
 
720
836
/**
721
 
 * Opaque pointer to a generic GEIS event.
 
837
 * @class GeisEvent
 
838
 * A generic GEIS event.
722
839
 *
723
840
 * Applications must determine the type of the actual event and convert the
724
841
 * opaque pointer to a concrete event pointer, if required.
725
842
 *
726
843
 * Events are created by the GEIS API but must be destroyed by the application.
727
844
 */
 
845
/** @cond typedef */
728
846
typedef struct _GeisEvent *GeisEvent;
 
847
/** @endcond */
729
848
 
730
849
/**
731
850
 * Destroys a GeisEvent.
 
851
 * @memberof GeisEvent
732
852
 *
733
 
 * @param[in] geis The GeisEvent to destroy.
 
853
 * @param[in] event The GeisEvent to destroy.
734
854
 */
735
855
GEIS_API void geis_event_delete(GeisEvent event);
736
856
 
737
857
/**
738
858
 * Gets the type of the event.
 
859
 * @memberof GeisEvent
739
860
 *
740
 
 * @param[in] geis The GeisEvent to destroy.
 
861
 * @param[in] event The GeisEvent to destroy.
741
862
 */
742
863
GEIS_API GeisEventType geis_event_type(GeisEvent event);
743
864
 
744
865
/**
745
866
 * Gets the number of attributes in the event.
 
867
 * @memberof GeisEvent
746
868
 *
747
 
 * @param[in] geis The GeisEvent.
 
869
 * @param[in] event The GeisEvent.
748
870
 */
749
871
GEIS_API GeisSize geis_event_attr_count(GeisEvent event);
750
872
 
751
873
/**
752
874
 * Gets an indicated attribute from the event.
 
875
 * @memberof GeisEvent
753
876
 *
754
 
 * @param[in] geis  The GeisEvent.
755
 
 * @param[in] index Indicates the attribute to retrieve.
 
877
 * @param[in] event  The GeisEvent.
 
878
 * @param[in] index  Indicates the attribute to retrieve.
756
879
 */
757
880
GEIS_API GeisAttr geis_event_attr(GeisEvent event, GeisSize index);
758
881
 
759
882
/**
760
883
 * Gets a named attribute from the event.
 
884
 * @memberof GeisEvent
761
885
 *
762
 
 * @param[in] geis      The GeisEvent.
 
886
 * @param[in] event     The GeisEvent.
763
887
 * @param[in] attr_name The name of the attribute to retrieve.
764
888
 */
765
889
GEIS_API GeisAttr geis_event_attr_by_name(GeisEvent event, GeisString attr_name);
804
928
 * Pumps the GEIS event loop.
805
929
 *
806
930
 * @param[in]  geis  The GEIS API instance.
807
 
 * @param[out] event An opeaque event object.
808
931
 *
809
932
 * Processes input events until there are no more input events to process and
810
933
 * generates zero or more gesture events, reporting them via the user-supplied
850
973
/* @} */
851
974
 
852
975
/**
853
 
 * @defgroup geis2_device Gesture Input Devices (GEIS v2.0)
854
 
 * @{
 
976
 * @defgroup geis_v2_device Input Devices
 
977
 * @ingroup geis_v2
 
978
 * @{
 
979
 */
 
980
 
 
981
/**
 
982
 * @name Device Event Attributes
 
983
 * @{
 
984
 *
 
985
 * @def GEIS_EVENT_ATTRIBUTE_DEVICE
 
986
 * The event attribute containing a pointer to a GeisDevice.
 
987
 *
 
988
 * The GEIS_EVENT_DEVICE_AVAILABLE and GEIS_EVENT_DEVICE_UNAVAILABLE events
 
989
 * should have a GEIS_ATTR_TYPE_POINTER attribute with this name.  It
 
990
 * should contain a pointer to a GeisDevice describing the device made available
 
991
 * or unavailable.
855
992
 */
856
993
#define GEIS_EVENT_ATTRIBUTE_DEVICE             "device"
857
994
 
 
995
/* @} */
 
996
 
858
997
/**
 
998
 * @name Device Attributes
 
999
 * @{
 
1000
 *
859
1001
 * @def GEIS_DEVICE_ATTRIBUTE_NAME
860
1002
 * The name of the input device.  Not guaranteed unique.
861
1003
 *
864
1006
 * instance.
865
1007
 *
866
1008
 * @def GEIS_DEVICE_ATTRIBUTE_TOUCHES
867
 
 * The simultaneous number of touches the device claims to be able to detect if
868
 
 * it is a multi-touch device.  A value of zero indicates the maximum number of
869
 
 * touches can not be determined.
 
1009
 * The maximum number of touches a device is capable of reporting.
 
1010
 * This integer is the number if simultaneous touches the device claims to be
 
1011
 * able to detect if it is a multi-touch device.  A value of zero indicates the
 
1012
 * maximum number of touches can not be determined.
870
1013
 *
871
1014
 * @def GEIS_DEVICE_ATTRIBUTE_DIRECT_TOUCH
872
 
 * Indicates if this is a direct touch device (eg. touchscreen).
 
1015
 * Indicates the device is a direct touch device.
 
1016
 * The present of this boolean attribute with a value of GEIS_TRUE indicates the
 
1017
 * device is a direct touch multi-touch device (for example, a touchscreen),
 
1018
 * otherwise it is an indirect touch device (such as a touchpad) or not a touch
 
1019
 * device at all.
873
1020
 *
874
1021
 * @def GEIS_DEVICE_ATTRIBUTE_INDEPENDENT_TOUCH
875
 
 * Indicates if this is an independent touch device (eg. Apple MagicMouse).
 
1022
 * Indicates the device is an independent touch device.
 
1023
 * The presence of this boolean attribute with a value of GEIS_TRUE indicates
 
1024
 * the device is an independent touch device (for example, an Apple MagicMouse).
 
1025
 * Other multi-touch devices should report GEIS_FALSE.
876
1026
 */
877
1027
#define GEIS_DEVICE_ATTRIBUTE_NAME              "device name"
878
1028
#define GEIS_DEVICE_ATTRIBUTE_ID                "device id"
880
1030
#define GEIS_DEVICE_ATTRIBUTE_DIRECT_TOUCH      "direct touch"
881
1031
#define GEIS_DEVICE_ATTRIBUTE_INDEPENDENT_TOUCH "independent touch"
882
1032
 
 
1033
/* @} */
883
1034
 
884
1035
/**
885
1036
 * @class GeisDevice
886
 
 * An opaque pointer type representing a gesture-capable input device.
 
1037
 * A gesture-capable input device.
887
1038
 *
888
1039
 * GeisDevice objects are created by the GEIS API and are reference counted.
889
1040
 */
 
1041
/** @cond typedef */
890
1042
typedef struct _GeisDevice *GeisDevice;
 
1043
/** @endcond */
891
1044
 
892
1045
GEIS_API void geis_register_device_callback(Geis               geis,
893
1046
                                            GeisEventCallback  event_callback,
895
1048
 
896
1049
/**
897
1050
 * Adds a reference count to a device.
898
 
 * @public @memberof GeisDevice
 
1051
 * @memberof GeisDevice
899
1052
 *
900
1053
 * @param[in] device The device.
901
1054
 *
907
1060
 
908
1061
/**
909
1062
 * Removes a reference count from a device.
910
 
 * @public @memberof GeisDevice
 
1063
 * @memberof GeisDevice
911
1064
 *
912
1065
 * @param[in] device The device.
913
1066
 *
948
1101
 * @memberof GeisDevice
949
1102
 *
950
1103
 * @param[in] device The device.
 
1104
 * @param[in] index  Indicates which attr to retrieve.
951
1105
 */
952
1106
GEIS_API GeisAttr geis_device_attr(GeisDevice device, GeisSize index);
953
1107
 
954
1108
/* @} */
955
1109
 
956
1110
/**
957
 
 * @defgroup geis2_class Gesture Classes (GEIS v2.0)
 
1111
 * @defgroup geis_v2_class Gesture Classes
 
1112
 * @ingroup geis_v2
958
1113
 * @{
959
1114
 */
960
1115
 
961
1116
/**
962
 
 * An opaque pointer type representing a gesture-capable input device.
 
1117
 * @class GeisGestureClass
 
1118
 * A defined gesture classifier.
963
1119
 *
964
 
 * GeisDevice objects are created by the GEIS API and are reference counted.  An
965
 
 * application needs to increment and decrement the reference count of a gesture
966
 
 * class object to control its persistence.
 
1120
 * GeisGestureClass objects are created by the GEIS API and are reference
 
1121
 * counted.  An application needs to increment and decrement the reference
 
1122
 * count of a gesture class object to control its persistence.
967
1123
 */
 
1124
/** @cond typedef */
968
1125
typedef struct _GeisGestureClass *GeisGestureClass;
969
 
 
 
1126
/** @endcond */
 
1127
 
 
1128
/**
 
1129
 * @name Gesture Class Event Attributes
 
1130
 * @{
 
1131
 *
 
1132
 * @def GEIS_EVENT_ATTRIBUTE_CLASS
 
1133
 * The event attribute containing a pointer to a GeisGestureClass. 
 
1134
 *
 
1135
 * The GEIS_EVENT_CLASS_AVAILABLE and GEIS_EVENT_CLASS_UNAVAILABLE events
 
1136
 * should have a GEIS_ATTR_TYPE_POINTER attribute with this name.  It
 
1137
 * should contain a pointer to a GeisGestureClass describing the gesture class
 
1138
 * made available or unavailable.
 
1139
 */
 
1140
#define GEIS_EVENT_ATTRIBUTE_CLASS  "gesture class"
 
1141
 
 
1142
/* @} */
 
1143
 
 
1144
/**
 
1145
 * @name Gesture Class Attributes
 
1146
 * @{
 
1147
 *
 
1148
 * @def GEIS_CLASS_ATTRIBUTE_NAME
 
1149
 * The name of the gesture class. 
 
1150
 *
 
1151
 * @def GEIS_CLASS_ATTRIBUTE_ID
 
1152
 * The unique integer ID of the gesture class.
 
1153
 */
970
1154
#define GEIS_CLASS_ATTRIBUTE_NAME   "class name"
971
1155
#define GEIS_CLASS_ATTRIBUTE_ID     "class id"
972
1156
 
973
 
#define GEIS_EVENT_ATTRIBUTE_CLASS  "gesture class"
 
1157
/* @} */
974
1158
 
975
1159
/**
976
1160
 * Registers a callback to receive gesture class change notifications.
997
1181
 
998
1182
/**
999
1183
 * Increments the reference count of a gesture class object.
 
1184
 * @memberof GeisGestureClass
1000
1185
 *
1001
1186
 * @param[in] gesture_class  The gesture class object.
1002
1187
 */
1004
1189
 
1005
1190
/**
1006
1191
 * Decrements the reference count of a gesture class object.
 
1192
 * @memberof GeisGestureClass
1007
1193
 *
1008
1194
 * @param[in] gesture_class  The gesture class object.
1009
1195
 *
1014
1200
 
1015
1201
/**
1016
1202
 * Gets the name of the gesture class.
 
1203
 * @memberof GeisGestureClass
1017
1204
 *
1018
1205
 * @param[in] gesture_class  The gesture class object.
1019
1206
 */
1021
1208
 
1022
1209
/**
1023
1210
 * Gets the numeric identifier of the gesture class.
 
1211
 * @memberof GeisGestureClass
1024
1212
 *
1025
1213
 * @param[in] gesture_class  The gesture class object.
1026
1214
 */
1028
1216
 
1029
1217
/**
1030
1218
 * Gets the number of attributes of the gesture class.
 
1219
 * @memberof GeisGestureClass
1031
1220
 *
1032
1221
 * @param[in] gesture_class  The gesture class object.
1033
1222
 */
1035
1224
 
1036
1225
/**
1037
1226
 * Gets the indicated attribute of teh gesture class.
 
1227
 * @memberof GeisGestureClass
1038
1228
 *
1039
1229
 * @param[in] gesture_class  The gesture class object.
1040
1230
 * @param[in] index          The index of the attribute to retrieve.
1045
1235
/* @} */
1046
1236
 
1047
1237
/**
1048
 
 * @defgroup geis2_region Gesture Regions (GEIS v2.0)
 
1238
 * @defgroup geis_v2_region Gesture Regions
 
1239
 * @ingroup geis_v2
1049
1240
 * @{
1050
1241
 */
1051
1242
 
 
1243
/**
 
1244
 * @class GeisRegion
 
1245
 * Defines a region over which gestures may take place.
 
1246
 */
 
1247
/** @cond typedef */
1052
1248
typedef struct _GeisRegion *GeisRegion;
1053
 
 
1054
 
/**
1055
 
 * @defgroup geis2_region_init_args Gesture Region Initialization Arguments
1056
 
 *
 
1249
/** @endcond */
 
1250
 
 
1251
/**
 
1252
 * @name Region Attributes
 
1253
 *
 
1254
 * @par
 
1255
 * These attributes can be used to construct filter terms to restrict a
 
1256
 * gesture subscription to a particular region.
 
1257
 *
 
1258
 * @{
 
1259
 *
 
1260
 * @def GEIS_REGION_ATTRIBUTE_WINDOWID
 
1261
 * The X11 windowid in which a gesture occurred. Used for filter matching.
 
1262
 */
 
1263
#define GEIS_REGION_ATTRIBUTE_WINDOWID          "windowid"
 
1264
 
 
1265
/* @} */
 
1266
 
 
1267
/**
 
1268
 * @name Region Initialization Arguments
 
1269
 *
 
1270
 * @par
1057
1271
 * Gesture regions are created to describe a particular display/feedback region.
1058
1272
 * The type of the region can not be changed after creation (just create a new
1059
1273
 * region for that).  The types of regions are platform specific and each type
1060
1274
 * may require addition arguments.
1061
1275
 *
 
1276
 * @par
1062
1277
 * The following region initialization argument names are required by the
1063
1278
 * GEIS v2.0 specification.
1064
1279
 *
1065
1280
 * @{
 
1281
 *
 
1282
 * @def GEIS_REGION_X11_ROOT
 
1283
 * Selects the X11 root window as a region.
 
1284
 *
 
1285
 * @def GEIS_REGION_X11_WINDOWID
 
1286
 * Selects an X11 window as a region.
 
1287
 * Requires the window_id as an argument.
1066
1288
 */
1067
1289
#define GEIS_REGION_X11_ROOT       "org.libgeis.region.x11.root"
 
1290
 
1068
1291
#define GEIS_REGION_X11_WINDOWID   "org.libgeis.region.x11.windowid"
1069
1292
 
1070
1293
/* @} */
1071
1294
 
1072
1295
/**
1073
1296
 * Creates a new GEIS v2.0 region.
 
1297
 * @memberof GeisRegion
1074
1298
 *
1075
1299
 * @param[in] geis           The GEIS API instance.
1076
1300
 * @param[in] name           A name.  Used for diagnostics.
1086
1310
 
1087
1311
/**
1088
1312
 * Destroys a GEIS v2.0 region.
 
1313
 * @memberof GeisRegion
1089
1314
 *
1090
1315
 * @param[in] region  The region.
1091
1316
 */
1093
1318
 
1094
1319
/**
1095
1320
 * Gets the name of a GEIS v2.0 region.
 
1321
 * @memberof GeisRegion
1096
1322
 *
1097
1323
 * @param[in] region  The region.
1098
1324
 *
1103
1329
/* @} */
1104
1330
 
1105
1331
/**
1106
 
 * @defgroup geis2_filter Gesture Filter (GEIS v2.0)
 
1332
 * @defgroup geis_v2_filter Gesture Filter
 
1333
 * @ingroup geis_v2
1107
1334
 * @{
1108
1335
 */
1109
1336
 
 
1337
/**
 
1338
 * @class GeisFilter
 
1339
 * Selects a subset of possible gestures in a subscription.
 
1340
 *
 
1341
 * A GeisFilter is a collection of filter terms, each of which defines a
 
1342
 * criterion for selection of gestures returned on a subscription.
 
1343
 *
 
1344
 * All filter terms are effectively ANDed together in a filter.
 
1345
 **/
 
1346
/** @cond typedef */
1110
1347
typedef struct _GeisFilter *GeisFilter;
 
1348
/** @endcond */
1111
1349
 
 
1350
/**
 
1351
 * Indicates the type of filter.
 
1352
 */
1112
1353
typedef enum _GeisFilterFacility
1113
1354
{
1114
 
  GEIS_FILTER_DEVICE   = 1000,
1115
 
  GEIS_FILTER_CLASS    = 2000,
1116
 
  GEIS_FILTER_REGION   = 3000
 
1355
  GEIS_FILTER_DEVICE   = 1000,  /**< Filters on device attributes. */
 
1356
  GEIS_FILTER_CLASS    = 2000,  /**< Filters on gesture attributes. */
 
1357
  GEIS_FILTER_REGION   = 3000   /**< Filters on region attributes. */
1117
1358
} GeisFilterFacility;
1118
1359
 
 
1360
/**
 
1361
 * Indicates the type of filter operation.
 
1362
 */
1119
1363
typedef enum _GeisFilterOperation
1120
1364
{
1121
 
  GEIS_FILTER_OP_EQ,
1122
 
  GEIS_FILTER_OP_NE,
1123
 
  GEIS_FILTER_OP_GT,
1124
 
  GEIS_FILTER_OP_GE,
1125
 
  GEIS_FILTER_OP_LT,
1126
 
  GEIS_FILTER_OP_LE
 
1365
  GEIS_FILTER_OP_EQ,      /**< Compares for equality. */
 
1366
  GEIS_FILTER_OP_NE,      /**< Compares for inequality */
 
1367
  GEIS_FILTER_OP_GT,      /**< Compares for greater-than. */
 
1368
  GEIS_FILTER_OP_GE,      /**< Compares for greater-than-or-equal. */
 
1369
  GEIS_FILTER_OP_LT,      /**< Compares for less-than. */
 
1370
  GEIS_FILTER_OP_LE       /**< Compares for less-tha-or-equal. */
1127
1371
} GeisFilterOperation;
1128
1372
 
1129
1373
 
1130
1374
/**
1131
1375
 * Creates a new, empty filter.
 
1376
 * @memberof GeisFilter
1132
1377
 *
1133
1378
 * @param[in] geis  The GEIS API instance.
1134
1379
 * @param[in] name  A name.
1139
1384
 
1140
1385
/**
1141
1386
 * Creates a new filter by copying an existing filter.
 
1387
 * @memberof GeisFilter
1142
1388
 *
1143
1389
 * @param[in] original  An existing geisFilter instance.
1144
1390
 * @param[in] name      A name.
1145
1391
 *
 
1392
 * The original filter remains unchanged.
 
1393
 *
1146
1394
 * @returns a GeisFilter object or NULL on failure.
1147
1395
 */
1148
1396
GEIS_API GeisFilter geis_filter_clone(GeisFilter original, GeisString name);
1149
1397
 
1150
1398
/**
1151
 
 * Destroys a GEIS v2.0 filter object.
 
1399
 * Destroys a GeisFilter.
 
1400
 * @memberof GeisFilter
1152
1401
 *
1153
1402
 * @param[in] filter  The filter.
1154
1403
 */
1156
1405
 
1157
1406
/**
1158
1407
 * Gets the name given to the filter when it was created.
 
1408
 * @memberof GeisFilter
1159
1409
 *
1160
1410
 * @param[in] filter  The filter.
1161
1411
 */
1163
1413
 
1164
1414
/**
1165
1415
 * Adds a term to a filter.
 
1416
 * @memberof GeisFilter
1166
1417
 *
1167
1418
 * @param[in] filter   The filter.
1168
1419
 * @param[in] facility The term facility.
1180
1431
/* @} */
1181
1432
 
1182
1433
/**
1183
 
 * @defgroup geis2_subscription Gesture Subscription (GEIS v2.0)
 
1434
 * @defgroup geis_v2_subscription Gesture Subscription
 
1435
 * @ingroup geis_v2
1184
1436
 * @{
1185
1437
 */
1186
1438
 
 
1439
/**
 
1440
 * @class GeisSubscription
 
1441
 * A gesture recognition subscription.
 
1442
 */
 
1443
/** @cond typedef */
1187
1444
typedef struct _GeisSubscription *GeisSubscription;
 
1445
/** @endcond */
1188
1446
 
1189
1447
/**
1190
 
 * Flags to refine the behaviour of the gesture subscription.
 
1448
 * @enum GeisSubscriptionFlags
 
1449
 *
 
1450
 * These flags are used when creating a new subscription and affect the nature
 
1451
 * of the gestures recognized by the subscription.  They may ORed together.
 
1452
 *
 
1453
 * @var GeisSubscriptionFlags::GEIS_SUBSCRIPTION_NONE
 
1454
 * No special subscription processing:  this is the default.
 
1455
 *
 
1456
 * @var GeisSubscriptionFlags::GEIS_SUBSCRIPTION_GRAB
 
1457
 * The subscription will "grab" all filtered gestures from subwindows.
 
1458
 *
 
1459
 * @var GeisSubscriptionFlags::GEIS_SUBSCRIPTION_CONT
 
1460
 * The gesture engine will return <em>gesture continuations</em>, in which the
 
1461
 * class of a recognized gestire may change over the lifetime of the gesture.
 
1462
 * If this flag is not set, a new gesture will be identified for each change in
 
1463
 * gesture class.
1191
1464
 */
1192
 
typedef enum _GeisSubscriptionFlags
 
1465
typedef enum GeisSubscriptionFlags
1193
1466
{
1194
1467
  GEIS_SUBSCRIPTION_NONE = 0x0000,
1195
1468
  GEIS_SUBSCRIPTION_GRAB = 0x0001,
1198
1471
 
1199
1472
/**
1200
1473
 * Creates a new subscription.
 
1474
 * @memberof GeisSubscription
1201
1475
 *
1202
1476
 * @param[in] geis  The GEIS API instance.
1203
1477
 * @param[in] name  A name.
1214
1488
 
1215
1489
/**
1216
1490
 * Destroys a GEIS v2.0 subscription object.
 
1491
 * @memberof GeisSubscription
1217
1492
 *
1218
1493
 * @param[in] subscription  The subscription.
1219
1494
 */
1221
1496
 
1222
1497
/**
1223
1498
 * Activates a subscription.
 
1499
 * @memberof GeisSubscription
1224
1500
 *
1225
1501
 * @param[in] subscription  The subscription.
1226
1502
 *
1231
1507
 
1232
1508
/**
1233
1509
 * Deactivates a subscription.
 
1510
 * @memberof GeisSubscription
1234
1511
 *
1235
1512
 * @param[in] subscription  The subscription.
1236
1513
 *
1241
1518
 
1242
1519
/**
1243
1520
 * Gets the name given to a subscription when it was created.
 
1521
 * @memberof GeisSubscription
1244
1522
 *
1245
1523
 * @param[in] subscription  The subscription.
1246
1524
 */
1248
1526
 
1249
1527
/**
1250
1528
 * Gets the ID assigned to a subscription when it was created.
 
1529
 * @memberof GeisSubscription
1251
1530
 *
1252
1531
 * @param[in] subscription  The subscription.
1253
1532
 */
1255
1534
 
1256
1535
/**
1257
1536
 * Adds a filter to a subscription.
 
1537
 * @memberof GeisSubscription
1258
1538
 *
1259
1539
 * @param[in] subscription  The subscription.
1260
1540
 * @param[in] filter        The filter to be added to the subscription.
1271
1551
 
1272
1552
/**
1273
1553
 * Gets an named filter from a subscription.
 
1554
 * @memberof GeisSubscription
1274
1555
 *
1275
1556
 * @param[in] sub  The subscription.
1276
1557
 * @param[in] name Names the filter to retrieve.
1283
1564
 
1284
1565
/**
1285
1566
 * Removes a filter from a subscription.
 
1567
 * @memberof GeisSubscription
1286
1568
 *
1287
1569
 * @param[in] subscription  The subscription.
1288
1570
 * @param[in] filter        The filter to be removed from the subscription.
1293
1575
/* @} */
1294
1576
 
1295
1577
/**
1296
 
 * @defgroup geis2_gesture Gesture Frames (GEIS v2.0)
 
1578
 * @defgroup geis_v2_gesture Gesture Frames
 
1579
 * @ingroup geis_v2
 
1580
 * Gesture state information.
 
1581
 *
 
1582
 * Gesture frames, and their associated groups and touches, convey information
 
1583
 * about the current state of recognized gestures.
 
1584
 *
1297
1585
 * @{
1298
1586
 */
1299
1587
 
 
1588
/**
 
1589
 * @class GeisGroup
 
1590
 * A collection of gesture frames.
 
1591
 *
 
1592
 * @class GeisGroupSet
 
1593
 * A collection of GeisGroups.
 
1594
 *
 
1595
 * @class GeisTouch
 
1596
 * An instance of a touch.
 
1597
 *
 
1598
 * @class GeisTouchId
 
1599
 * Relates a touch in a frame to a touch object in a set.
 
1600
 *
 
1601
 * @class GeisTouchSet
 
1602
 * A collection of GeisTouch
 
1603
 *
 
1604
 * @class GeisFrame
 
1605
 * A collection of information describing the state of a gesture.
 
1606
 */
 
1607
/** @cond typedef */
1300
1608
typedef struct _GeisGroup    *GeisGroup;
1301
1609
typedef struct _GeisGroupSet *GeisGroupSet;
1302
1610
typedef GeisSize              GeisTouchId;
1303
1611
typedef struct _GeisTouch    *GeisTouch;
1304
1612
typedef struct _GeisTouchSet *GeisTouchSet;
1305
1613
typedef struct _GeisFrame    *GeisFrame;
 
1614
/** @endcond */
1306
1615
 
 
1616
/**
 
1617
 * @name Gesture Frame Event Attributes
 
1618
 *
 
1619
 * @par
 
1620
 * A gesture event (GEIS_EVENT_GESTURE_BEGIN, GEIS_EVENT_GESTURE_UPDATE,
 
1621
 * GEIS_EVENT_GESTURE_END) should have two GEIS_ATTR_TYPE_POINTER attributes,
 
1622
 * one containing a GeisGroupSet and one containing a GeisTouchSet.
 
1623
 *
 
1624
 * @{
 
1625
 *
 
1626
 * @def GEIS_EVENT_ATTRIBUTE_GROUPSET
 
1627
 * The event attribute containing a pointer to a GeisGroupSet.
 
1628
 *
 
1629
 * @def GEIS_EVENT_ATTRIBUTE_TOUCHSET
 
1630
 * The event attribute containing a pointer to a GeisTouchSet.
 
1631
 */
1307
1632
#define GEIS_EVENT_ATTRIBUTE_GROUPSET  "group set"
1308
1633
#define GEIS_EVENT_ATTRIBUTE_TOUCHSET  "touch set"
1309
1634
 
 
1635
/* @} */
 
1636
 
 
1637
/**
 
1638
 * @name Touch Attributes
 
1639
 *
 
1640
 * @par
 
1641
 * Each touch has zero or more attributes associated with it. Differing hardware
 
1642
 * is capable of reporting differing sets of touch attributes, so there is no
 
1643
 * guarantee that any or all of the defined touch attributes will bre present.
 
1644
 *
 
1645
 * @{
 
1646
 *
 
1647
 * @def GEIS_TOUCH_ATTRIBUTE_ID
 
1648
 * Identifies the touch. 
 
1649
 *
 
1650
 * @def GEIS_TOUCH_ATTRIBUTE_X
 
1651
 * The X coordinate of the touch.
 
1652
 *
 
1653
 * @def GEIS_TOUCH_ATTRIBUTE_Y
 
1654
 * The Y coordinate of the touch.
 
1655
 */
 
1656
#define GEIS_TOUCH_ATTRIBUTE_ID                 "touch id"
 
1657
#define GEIS_TOUCH_ATTRIBUTE_X                  "touch x"
 
1658
#define GEIS_TOUCH_ATTRIBUTE_Y                  "touch y"
 
1659
 
 
1660
/* @} */
 
1661
 
1310
1662
/**
1311
1663
 * Gets the number of gesture groups in a groupset.
 
1664
 * @memberof GeisGroupSet
1312
1665
 *
1313
1666
 * @param[in] groupset The groupset.
1314
1667
 */
1316
1669
 
1317
1670
/**
1318
1671
 * Gets an indicated gesture group from a groupset.
 
1672
 * @memberof GeisGroupSet
1319
1673
 *
1320
1674
 * @param[in] groupset The groupset.
1321
1675
 * @param[in] index    Indicates which gesture group to retrieve.
1324
1678
 
1325
1679
/**
1326
1680
 * Gets the identifier of a gesture group.
 
1681
 * @memberof GeisGroup
1327
1682
 *
1328
1683
 * @param[in] group The gesture group.
1329
1684
 */
1331
1686
 
1332
1687
/**
1333
1688
 * Gets the number of gesture frames in a gesture group.
 
1689
 * @memberof GeisGroup
1334
1690
 *
1335
1691
 * @param[in] group The gesture group.
1336
1692
 */
1338
1694
 
1339
1695
/**
1340
1696
 * Gets an indicated gesture frame from a gesture group.
 
1697
 * @memberof GeisGroup
1341
1698
 *
1342
1699
 * @param[in] group The gesture group.
1343
1700
 * @param[in] index Indicates which gesture frame to retrieve.
1346
1703
 
1347
1704
/**
1348
1705
 * Marks a gesture group as rejected.
 
1706
 * @memberof GeisGroup
1349
1707
 *
1350
1708
 * @param[in] group The gesture group to reject.
1351
1709
 */
1353
1711
 
1354
1712
/**
1355
1713
 * Gets the number of touches in a touchset.
 
1714
 * @memberof GeisTouchSet
1356
1715
 *
1357
1716
 * @param[in] touchset  The touchset,
1358
1717
 */
1360
1719
 
1361
1720
/**
1362
1721
 * Gets an indicated touch from a touchset.
 
1722
 * @memberof GeisTouchSet
1363
1723
 *
1364
1724
 * @param[in] touchset  The touchset.
1365
1725
 * @param[in] index     Indicates which touch to retrieve.
1368
1728
 
1369
1729
/**
1370
1730
 * Gets an identified touch from a touchset.
 
1731
 * @memberof GeisTouchSet
1371
1732
 *
1372
1733
 * @param[in] touchset  The touchset.
1373
1734
 * @param[in] touchid   Identifies a touch.
1379
1740
 
1380
1741
/**
1381
1742
 * Gets the identifier of a touch.
 
1743
 * @memberof GeisTouch
1382
1744
 *
1383
1745
 * @param[in] touch  The touch.
1384
1746
 */
1386
1748
 
1387
1749
/**
1388
1750
 * Gets the number of attrs associated with a touch.
 
1751
 * @memberof GeisTouch
1389
1752
 *
1390
1753
 * @param[in] touch  The touch.
1391
1754
 */
1393
1756
 
1394
1757
/**
1395
1758
 * Gets an indicated attr from a touch.
 
1759
 * @memberof GeisTouch
1396
1760
 *
1397
1761
 * @param[in] touch  The touch.
1398
1762
 * @param[in] index  Indicates which attr to retrieve.
1401
1765
 
1402
1766
/**
1403
1767
 * Gets a named attr from a touch.
 
1768
 * @memberof GeisTouch
1404
1769
 *
1405
1770
 * @param[in] touch  The touch.
1406
1771
 * @param[in] name   Names the attr to retrieve.
1411
1776
 
1412
1777
/**
1413
1778
 * Gets the identifier of a gesture frame.
 
1779
 * @memberof GeisFrame
1414
1780
 *
1415
1781
 * @param[in] frame  the gesture frame.
1416
1782
 */
1418
1784
 
1419
1785
/**
1420
1786
 * Indicates if a gesture frame belongs to a gesture class.
 
1787
 * @memberof GeisFrame
1421
1788
 *
1422
1789
 * @param[in] frame         The gesture frame.
1423
1790
 * @param[in] gesture_class The gesture class.
1430
1797
 
1431
1798
/**
1432
1799
 * Gets the number of attrs associated with a gesture frame.
 
1800
 * @memberof GeisFrame
1433
1801
 *
1434
1802
 * @param[in] frame  The gesture frame.
1435
1803
 */
1437
1805
 
1438
1806
/**
1439
1807
 * Gets an indicated attr from a gesture frame.
 
1808
 * @memberof GeisFrame
1440
1809
 *
1441
1810
 * @param[in] frame  The gesture frame.
1442
1811
 * @param[in] index  Indicates which attr to retrieve.
1445
1814
 
1446
1815
/**
1447
1816
 * Gets a named attr from a gesture frame.
 
1817
 * @memberof GeisFrame
1448
1818
 *
1449
1819
 * @param[in] frame  The gesture frame.
1450
1820
 * @param[in] name   Names the attr to retrieve.
1455
1825
 
1456
1826
/**
1457
1827
 * Gets the current transform matrix of a gesture.
 
1828
 * @memberof GeisFrame
1458
1829
 *
1459
1830
 * @param[in] frame  The gesture frame.
1460
1831
 */
1462
1833
 
1463
1834
/**
1464
1835
 * Gets the number of touches making up a gesture for the frame.
 
1836
 * @memberof GeisFrame
1465
1837
 *
1466
1838
 * @param[in] frame  The gesture frame.
1467
1839
 */
1469
1841
 
1470
1842
/**
1471
1843
 * Gets the ID of the indicated touch within the gesture frame.
 
1844
 * @memberof GeisFrame
1472
1845
 *
1473
1846
 * @param[in] frame  The gesture frame.
1474
1847
 * @param[in] index  Indicates which touch ID to retrieve.
1477
1850
 
1478
1851
/**
1479
1852
 * Marks a gesture as rejected.
 
1853
 * @memberof GeisFrame
1480
1854
 *
1481
1855
 * @param[in] gesture_id  Identifies the gesture.
1482
1856
 */
1483
 
GEIS_API void geis_gesture_reject(GeisGestureId gestureid);
 
1857
GEIS_API void geis_gesture_reject(GeisGestureId gesture_id);
1484
1858
 
1485
1859
/* @} */
1486
1860