Loading...
Searching...
No Matches
Event Control
The Simplified GEIS Interface » Gesture Types » Gesture Primitives » Standard Gesture Types » Vendor Extension Gesture Types » Initialization and Cleanup » Configuration and Control | The Advanced GEIS Interface » The Geis API Object » Error Reporting » Configuration » Input Devices » Gesture Subscription » Attributes

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

  These configuration items are not a part of the GEIS specification and may change.

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.

## 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

## GEIS_DEFAULT_EVENT_CALLBACK

#define GEIS_DEFAULT_EVENT_CALLBACK

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

## Typedef Documentation

## GeisEventCallback

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

The application callback type for the event dispatcher.

Parameters

  [in] | geis | the GEIS API instance
  [in] | event | the opaque event pointer
  [in] | context | the application-supplied context value

## Function Documentation

## geis_dispatch_events()

GeisStatus geis_dispatch_events | ( | Geis | geis | ) |

Pumps the GEIS event loop.

Parameters

  [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.

Return values

  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

Examples
  geis2.c.

## geis_event_attr()

GeisAttr geis_event_attr | ( | GeisEvent | event,
|  | GeisSize | index )

Gets an indicated attribute from the event.

Parameters

  [in] | event | The GeisEvent.
  [in] | index | Indicates the attribute to retrieve.

## geis_event_attr_by_name()

GeisAttr geis_event_attr_by_name | ( | GeisEvent | event,
|  | GeisString | attr_name )

Gets a named attribute from the event.

Parameters

  [in] | event | The GeisEvent.
  [in] | attr_name | The name of the attribute to retrieve.

## geis_event_attr_count()

GeisSize geis_event_attr_count | ( | GeisEvent | event | ) |

Gets the number of attributes in the event.

Parameters

  [in] | event | The GeisEvent.

## geis_event_delete()

void geis_event_delete | ( | GeisEvent | event | ) |

Destroys a GeisEvent.

Parameters

  [in] | event | The GeisEvent to destroy.

## geis_event_type()

GeisEventType geis_event_type | ( | GeisEvent | event | ) |

Gets the type of the event.

Parameters

  [in] | event | The GeisEvent to destroy.

## geis_next_event()

GeisStatus geis_next_event | ( | Geis | geis,
|  | GeisEvent * | event )

Retrieves the next queued GEIS event.

Parameters

  [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.

Return values

  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

Examples
  geis2.c.

## geis_register_event_callback()

void geis_register_event_callback | ( | Geis | geis,
|  | GeisEventCallback | event_callback,
|  | void * | context )

Registers an event-handler callback.

Parameters

  [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.