![]() |
GEIS 2.0
Gesture Engine Interface Support
|
These functions are used to dispatch events generated from the various other GEIS components. More...
Topics | |
| Input Devices | |
Data Structures | |
| class | GeisEvent |
| A generic GEIS event. More... | |
Vendor-defined Configuration Items | |
| |
| enum | _GeisEventType { GEIS_EVENT_DEVICE_AVAILABLE , GEIS_EVENT_DEVICE_UNAVAILABLE , GEIS_EVENT_CLASS_AVAILABLE , GEIS_EVENT_CLASS_CHANGED , GEIS_EVENT_CLASS_UNAVAILABLE , GEIS_EVENT_GESTURE_BEGIN , GEIS_EVENT_GESTURE_UPDATE , GEIS_EVENT_GESTURE_END , GEIS_EVENT_TENTATIVE_BEGIN , GEIS_EVENT_TENTATIVE_UPDATE , GEIS_EVENT_TENTATIVE_END , GEIS_EVENT_INIT_COMPLETE , GEIS_EVENT_USER_DEFINED , GEIS_EVENT_ERROR } |
| typedef enum _GeisEventType | GeisEventType |
| typedef void(* | GeisEventCallback) (Geis geis, GeisEvent event, void *context) |
| The application callback type for the event dispatcher. | |
| void | geis_register_event_callback (Geis geis, GeisEventCallback event_callback, void *context) |
| Registers an event-handler callback. | |
| GeisStatus | geis_dispatch_events (Geis geis) |
| Pumps the GEIS event loop. | |
| GeisStatus | geis_next_event (Geis geis, GeisEvent *event) |
| Retrieves the next queued GEIS event. | |
| void | geis_event_delete (GeisEvent event) |
| Destroys a GeisEvent. | |
| GeisEventType | geis_event_type (GeisEvent event) |
| Gets the type of the event. | |
| GeisSize | geis_event_attr_count (GeisEvent event) |
| Gets the number of attributes in the event. | |
| GeisAttr | geis_event_attr (GeisEvent event, GeisSize index) |
| Gets an indicated attribute from the event. | |
| GeisAttr | geis_event_attr_by_name (GeisEvent event, GeisString attr_name) |
| Gets a named attribute from the event. | |
| #define | GEIS_DEFAULT_EVENT_CALLBACK |
| A special constant indicating the use of the default event callback. | |
These functions are used to dispatch events generated from the various other GEIS components.
Applications must invoke geis_dispatch_events() from time to time to generate input device, gesture type, and gesture events. The GEIS events are then retrieved either from the internal event queue using the geis_next_event() call or through an application-supplied callback set through the geis_register_event_callback() call.
| #define GEIS_DEFAULT_EVENT_CALLBACK |
A special constant indicating the use of the default event callback.
The application callback type for the event dispatcher.
| [in] | geis | the GEIS API instance |
| [in] | event | the opaque event pointer |
| [in] | context | the application-supplied context value |
| GeisStatus geis_dispatch_events | ( | Geis | geis | ) |
Pumps the GEIS event loop.
| [in] | geis | The GEIS API instance. |
Processes input events until there are no more input events to process and generates zero or more gesture events, reporting them via the user-supplied callback or pushing them on the internal event queue for retrieval via the geis_next_event() call.
| GEIS_STATUS_SUCCESS | The event loop was successfully pumped and no further events remain to be processed at this time. |
| GEIS_STATUS_CONTINUE | The event loop was successfully pumped but the system detected there are events still remaining to be processed. |
| GEIS_STATUS_UNKNOWN_ERROR | Some error occurred |
| GeisAttr geis_event_attr | ( | GeisEvent | event, |
| GeisSize | index ) |
Gets an indicated attribute from the event.
| [in] | event | The GeisEvent. |
| [in] | index | Indicates the attribute to retrieve. |
| GeisAttr geis_event_attr_by_name | ( | GeisEvent | event, |
| GeisString | attr_name ) |
Gets a named attribute from the event.
| [in] | event | The GeisEvent. |
| [in] | attr_name | The name of the attribute to retrieve. |
| GeisSize geis_event_attr_count | ( | GeisEvent | event | ) |
Gets the number of attributes in the event.
| [in] | event | The GeisEvent. |
| void geis_event_delete | ( | GeisEvent | event | ) |
| GeisEventType geis_event_type | ( | GeisEvent | event | ) |
Gets the type of the event.
| [in] | event | The GeisEvent to destroy. |
| GeisStatus geis_next_event | ( | Geis | geis, |
| GeisEvent * | event ) |
Retrieves the next queued GEIS event.
| [in] | geis | The GEIS API instance. |
| [out] | event | The GeisEvent retrieved, if any. |
Pulls the next available GeisEvent from the internal event queue, if any, and indicates whether there are more events left.
| GEIS_STATUS_SUCCESS | An event was successfully pulled from the queue and the queue is now empty. |
| GEIS_STATUS_CONTINUE | An event was successfully pulled from the queue and one or more events remain in the queue. |
| GEIS_STATUS_EMPTY | No event was pulled from the queue because it is empty. The value of *event remains unchanged. |
| GEIS_STATUS_UNKNOWN_ERROR | Some error occurred |
| void geis_register_event_callback | ( | Geis | geis, |
| GeisEventCallback | event_callback, | ||
| void * | context ) |
Registers an event-handler callback.
| [in] | geis | the GEIS API instance |
| [in] | event_callback | the callback to register |
| [in] | context | the caller context |
This function registers the callback to be executed whenever a new GeisEvent is generated. The default function pushes the GeisEvent onto an internal queue to be picked up by a call to geis_next_event().
Calling geis_register_event_callback() with a callback of GEIS_DEFAULT_EVENT_CALLBACK replaces any registered function wit hthe default function.
The callback is executed in the same thread context as the one geis_dispatch_events() is called from.