GEIS  2.0
Gesture Engine Interface Support

These functions are used to dispatch events generated from the various other GEIS components. More...

Data Structures

class  GeisEvent
 A generic GEIS event. More...
 

Macros

#define GEIS_DEFAULT_EVENT_CALLBACK
 A special constant indicating the use of the default event callback. More...
 

Typedefs

typedef enum _GeisEventType GeisEventType
 
typedef void(* GeisEventCallback) (Geis geis, GeisEvent event, void *context)
 The application callback type for the event dispatcher. More...
 

Enumerations

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
}
 

Functions

void geis_register_event_callback (Geis geis, GeisEventCallback event_callback, void *context)
 Registers an event-handler callback. More...
 
GeisStatus geis_dispatch_events (Geis geis)
 Pumps the GEIS event loop. More...
 
GeisStatus geis_next_event (Geis geis, GeisEvent *event)
 Retrieves the next queued GEIS event. More...
 
void geis_event_delete (GeisEvent event)
 Destroys a GeisEvent. More...
 
GeisEventType geis_event_type (GeisEvent event)
 Gets the type of the event. More...
 
GeisSize geis_event_attr_count (GeisEvent event)
 Gets the number of attributes in the event. More...
 
GeisAttr geis_event_attr (GeisEvent event, GeisSize index)
 Gets an indicated attribute from the event. More...
 
GeisAttr geis_event_attr_by_name (GeisEvent event, GeisString attr_name)
 Gets a named attribute from the event. More...
 

Detailed Description

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.

Macro Definition Documentation

#define GEIS_DEFAULT_EVENT_CALLBACK

A special constant indicating the use of the default event callback.

Typedef Documentation

typedef void(* GeisEventCallback) (Geis geis, GeisEvent event, void *context)

The application callback type for the event dispatcher.

Parameters
[in]geisthe GEIS API instance
[in]eventthe opaque event pointer
[in]contextthe application-supplied context value

Function Documentation

GeisStatus geis_dispatch_events ( Geis  geis)

Pumps the GEIS event loop.

Parameters
[in]geisThe 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.

Return values
GEIS_STATUS_SUCCESSThe event loop was successfully pumped and no further events remain to be processed at this time.
GEIS_STATUS_CONTINUEThe event loop was successfully pumped but the system detected there are events still remaining to be processed.
GEIS_STATUS_UNKNOWN_ERRORSome error occurred
GeisAttr geis_event_attr ( GeisEvent  event,
GeisSize  index 
)

Gets an indicated attribute from the event.

Parameters
[in]eventThe GeisEvent.
[in]indexIndicates the attribute to retrieve.
GeisAttr geis_event_attr_by_name ( GeisEvent  event,
GeisString  attr_name 
)

Gets a named attribute from the event.

Parameters
[in]eventThe GeisEvent.
[in]attr_nameThe name of the attribute to retrieve.
GeisSize geis_event_attr_count ( GeisEvent  event)

Gets the number of attributes in the event.

Parameters
[in]eventThe GeisEvent.
void geis_event_delete ( GeisEvent  event)

Destroys a GeisEvent.

Parameters
[in]eventThe GeisEvent to destroy.
GeisEventType geis_event_type ( GeisEvent  event)

Gets the type of the event.

Parameters
[in]eventThe GeisEvent to destroy.
GeisStatus geis_next_event ( Geis  geis,
GeisEvent event 
)

Retrieves the next queued GEIS event.

Parameters
[in]geisThe GEIS API instance.
[out]eventThe GeisEvent retrieved, if any.

Pulls the next available GeisEvent from the internal event queue, if any, and indicates whether there are more events left.

Return values
GEIS_STATUS_SUCCESSAn event was successfully pulled from the queue and the queue is now empty.
GEIS_STATUS_CONTINUEAn event was successfully pulled from the queue and one or more events remain in the queue.
GEIS_STATUS_EMPTYNo event was pulled from the queue because it is empty. The value of *event remains unchanged.
GEIS_STATUS_UNKNOWN_ERRORSome error occurred
void geis_register_event_callback ( Geis  geis,
GeisEventCallback  event_callback,
void *  context 
)

Registers an event-handler callback.

Parameters
[in]geisthe GEIS API instance
[in]event_callbackthe callback to register
[in]contextthe 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.