GEIS 2.0
Gesture Engine Interface Support
/build/buildd/utouch-geis-2.1.2/include/geis/geis.h File Reference

This is the public interface for the GEIS gesture API. More...

#include <geis/geisimpl.h>

Data Structures

class  GeisWinInfo
 Generic display region description block. More...
struct  GeisInputFuncs
 Callback functions used to handle changes in the available input devices. More...
struct  GeisGestureAttr
 An individual gesture attribute. More...
struct  GeisGestureFuncs
 The set of callback functions invoked for various gesture-related events. More...

Defines

#define GEIS_VERSION_1_0
 GEIS version macros.
#define GEIS_VERSION_2_0
#define GEIS_FALSE
#define GEIS_TRUE
#define GEIS_GESTURE_DRAG
#define GEIS_GESTURE_PINCH
#define GEIS_GESTURE_ROTATE
#define GEIS_GESTURE_TAP
#define GEIS_GESTURE_TOUCH
#define GEIS_GESTURE_FLICK
#define GEIS_GESTURE_PRIMITIVE_DRAG
 A translate gesture: dragging, swiping, flicking, moving in a generally linear fashion.
#define GEIS_GESTURE_PRIMITIVE_PINCH
 A pinch or expand gesture: two or more touch points generally moving toward or away from a common point.
#define GEIS_GESTURE_PRIMITIVE_ROTATE
 A rotation gesture.
#define GEIS_GESTURE_PRIMITIVE_TAP
 A tap.
#define GEIS_GESTURE_PRIMITIVE_TOUCH
 A parenthetical gesture event.
#define GEIS_GESTURE_ID_FLICK
#define GEIS_GESTURE_TYPE_DRAG1
#define GEIS_GESTURE_TYPE_DRAG2
#define GEIS_GESTURE_TYPE_DRAG3
#define GEIS_GESTURE_TYPE_DRAG4
#define GEIS_GESTURE_TYPE_DRAG5
#define GEIS_GESTURE_TYPE_PINCH1
#define GEIS_GESTURE_TYPE_PINCH2
#define GEIS_GESTURE_TYPE_PINCH3
#define GEIS_GESTURE_TYPE_PINCH4
#define GEIS_GESTURE_TYPE_PINCH5
#define GEIS_GESTURE_TYPE_ROTATE1
#define GEIS_GESTURE_TYPE_ROTATE2
#define GEIS_GESTURE_TYPE_ROTATE3
#define GEIS_GESTURE_TYPE_ROTATE4
#define GEIS_GESTURE_TYPE_ROTATE5
#define GEIS_GESTURE_TYPE_TAP1
#define GEIS_GESTURE_TYPE_TAP2
#define GEIS_GESTURE_TYPE_TAP3
#define GEIS_GESTURE_TYPE_TAP4
#define GEIS_GESTURE_TYPE_TAP5
#define GEIS_GESTURE_TYPE_TOUCH1
#define GEIS_GESTURE_TYPE_TOUCH2
#define GEIS_GESTURE_TYPE_TOUCH3
#define GEIS_GESTURE_TYPE_TOUCH4
#define GEIS_GESTURE_TYPE_TOUCH5
#define GEIS_GESTURE_TYPE_SYSTEM
 A special gesture type than enabled system-wide gesture priority.
#define GEIS_GESTURE_TYPE_FLICK1
#define GEIS_GESTURE_TYPE_FLICK2
#define GEIS_GESTURE_TYPE_FLICK3
#define GEIS_GESTURE_TYPE_FLICK4
#define GEIS_GESTURE_TYPE_FLICK5
#define GEIS_GESTURE_ATTRIBUTE_ANGLE
#define GEIS_GESTURE_ATTRIBUTE_ANGLE_DELTA
#define GEIS_GESTURE_ATTRIBUTE_ANGULAR_VELOCITY
#define GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_X1
#define GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_Y1
#define GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_X2
#define GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_Y2
#define GEIS_GESTURE_ATTRIBUTE_CHILD_WINDOW_ID
#define GEIS_GESTURE_ATTRIBUTE_CENTROID_X
#define GEIS_GESTURE_ATTRIBUTE_CENTROID_Y
#define GEIS_GESTURE_ATTRIBUTE_DELTA_X
#define GEIS_GESTURE_ATTRIBUTE_DELTA_Y
#define GEIS_GESTURE_ATTRIBUTE_DEVICE_ID
#define GEIS_GESTURE_ATTRIBUTE_EVENT_WINDOW_ID
#define GEIS_GESTURE_ATTRIBUTE_FOCUS_X
#define GEIS_GESTURE_ATTRIBUTE_FOCUS_Y
#define GEIS_GESTURE_ATTRIBUTE_GESTURE_NAME
#define GEIS_GESTURE_ATTRIBUTE_POSITION_X
#define GEIS_GESTURE_ATTRIBUTE_POSITION_Y
#define GEIS_GESTURE_ATTRIBUTE_RADIAL_VELOCITY
#define GEIS_GESTURE_ATTRIBUTE_RADIUS_DELTA
#define GEIS_GESTURE_ATTRIBUTE_RADIUS
#define GEIS_GESTURE_ATTRIBUTE_ROOT_WINDOW_ID
#define GEIS_GESTURE_ATTRIBUTE_TAP_TIME
#define GEIS_GESTURE_ATTRIBUTE_TIMESTAMP
#define GEIS_GESTURE_ATTRIBUTE_TOUCHES
#define GEIS_GESTURE_ATTRIBUTE_VELOCITY_X
#define GEIS_GESTURE_ATTRIBUTE_VELOCITY_Y
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_0_ID
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_0_X
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_0_Y
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_1_ID
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_1_X
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_1_Y
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_2_ID
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_2_X
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_2_Y
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_3_ID
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_3_X
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_3_Y
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_4_ID
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_4_X
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_4_Y
#define GEIS_CONFIG_UNIX_FD
 Gets the Unix file descriptor for GEIS events.
#define GEIS_ALL_INPUT_DEVICES
#define GEIS_ALL_GESTURES
 Selects ALL input devices.
#define GEIS_NO_GESTURE_ID
#define GEIS_DEFAULT_EVENT_CALLBACK
 A special constant indicating the use of the default event callback.
Standard Initialization Arguments
These initialization arguments are defined by the GEIS v2 specification.
#define GEIS_INIT_SERVICE_PROVIDER
 Enables GEIS to provide a networked service.
#define GEIS_INIT_TRACK_DEVICES
 Tells GEIS to send input device events.
#define GEIS_INIT_TRACK_GESTURE_CLASSES
 Tells GEIS to send gesture class events.
Vendor-defined Initialization Arguments
These initialization arguments are not a part of te GEIS specification and may change.
#define GEIS_INIT_UTOUCH_MOCK_ENGINE
#define GEIS_INIT_UTOUCH_XCB
Required Configuration Items
These configuration items are defined by the GEIS specification.
#define GEIS_CONFIGURATION_FD
 Gets a Unix file descriptor that will signal the availablility of GEIS events for processing.
Vendor-defined Configuration Items
These configuration items are not a part of the GEIS specification and may change.
#define GEIS_CONFIG_UTOUCH_MAX_EVENTS
Device Event Attributes
#define GEIS_EVENT_ATTRIBUTE_DEVICE
 The event attribute containing a pointer to a GeisDevice.
Device Attributes
#define GEIS_DEVICE_ATTRIBUTE_NAME
 The name of the input device.
#define GEIS_DEVICE_ATTRIBUTE_ID
 The unique integer ID of the device.
#define GEIS_DEVICE_ATTRIBUTE_TOUCHES
 The maximum number of touches a device is capable of reporting.
#define GEIS_DEVICE_ATTRIBUTE_DIRECT_TOUCH
 Indicates the device is a direct touch device.
#define GEIS_DEVICE_ATTRIBUTE_INDEPENDENT_TOUCH
 Indicates the device is an independent touch device.
#define GEIS_DEVICE_ATTRIBUTE_MIN_X
 The lower bound of the X-axis (nominally horizontal) coordinate values reported by the device.
#define GEIS_DEVICE_ATTRIBUTE_MAX_X
 The upper bound of the X-axis (nominally horizontal) coordinate values reported by the device.
#define GEIS_DEVICE_ATTRIBUTE_RES_X
 The resolution of the X-axis (nominally horizontal) coordinate values reported by the device.
#define GEIS_DEVICE_ATTRIBUTE_MIN_Y
 The lower bound of the Y-axis (nominally vertical) coordinate values reported by the device.
#define GEIS_DEVICE_ATTRIBUTE_MAX_Y
 The upper bound of the Y-axis (nominally vertical) coordinate values reported by the device.
#define GEIS_DEVICE_ATTRIBUTE_RES_Y
 The resolution of the Y-axis (nominally vertical) coordinate values reported by the device.
Gesture Class Event Attributes
#define GEIS_EVENT_ATTRIBUTE_CLASS
 The event attribute containing a pointer to a GeisGestureClass.
Gesture Class Attributes
#define GEIS_CLASS_ATTRIBUTE_NAME
 The name of the gesture class.
#define GEIS_CLASS_ATTRIBUTE_ID
 The unique integer ID of the gesture class.
Region Attributes
These attributes can be used to construct filter terms to restrict a gesture subscription to a particular region.
#define GEIS_REGION_ATTRIBUTE_WINDOWID
 The X11 windowid in which a gesture occurred.
Region Initialization Arguments
Gesture regions are created to describe a particular display/feedback region. The type of the region can not be changed after creation (just create a new region for that). The types of regions are platform specific and each type may require addition arguments.
The following region initialization argument names are required by the GEIS v2.0 specification.
#define GEIS_REGION_X11_ROOT
 Selects the X11 root window as a region.
#define GEIS_REGION_X11_WINDOWID
 Selects an X11 window as a region.
Gesture Frame Event Attributes
A gesture event (GEIS_EVENT_GESTURE_BEGIN, GEIS_EVENT_GESTURE_UPDATE, GEIS_EVENT_GESTURE_END) should have two GEIS_ATTR_TYPE_POINTER attributes, one containing a GeisGroupSet and one containing a GeisTouchSet.
#define GEIS_EVENT_ATTRIBUTE_GROUPSET
 The event attribute containing a pointer to a GeisGroupSet.
#define GEIS_EVENT_ATTRIBUTE_TOUCHSET
 The event attribute containing a pointer to a GeisTouchSet.
Touch Attributes
Each touch has zero or more attributes associated with it. Differing hardware is capable of reporting differing sets of touch attributes, so there is no guarantee that any or all of the defined touch attributes will bre present.
#define GEIS_TOUCH_ATTRIBUTE_ID
 Identifies the touch.
#define GEIS_TOUCH_ATTRIBUTE_X
 The X coordinate of the touch.
#define GEIS_TOUCH_ATTRIBUTE_Y
 The Y coordinate of the touch.

Typedefs

typedef enum GeisStatus GeisStatus
 Errors returned from calls.
typedef enum GeisAttrType GeisAttrType
 Attribute data types.
typedef struct GeisWinInfo GeisWinInfo
typedef unsigned int GeisInputDeviceId
typedef void(* GeisInputCallback )(void *cookie, GeisInputDeviceId device_id, void *attrs)
 Prototype for input device callback functions.
typedef struct GeisInputFuncs GeisInputFuncs
 Callback functions used to handle changes in the available input devices.
typedef unsigned int GeisGestureType
typedef unsigned int GeisGestureId
typedef struct GeisGestureAttr GeisGestureAttr
 An individual gesture attribute.
typedef void(* GeisGestureCallback )(void *cookie, GeisGestureType gesture_type, GeisGestureId gesture_id, GeisSize attr_count, GeisGestureAttr *attrs)
 A callback used for different gesture events.
typedef struct GeisGestureFuncs GeisGestureFuncs
 The set of callback functions invoked for various gesture-related events.
typedef enum _GeisEventType GeisEventType
typedef void(* GeisEventCallback )(Geis geis, GeisEvent event, void *context)
 The application callback type for the event dispatcher.
typedef enum _GeisFilterFacility GeisFilterFacility
 Indicates the type of filter.
typedef enum _GeisFilterOperation GeisFilterOperation
 Indicates the type of filter operation.
typedef enum GeisSubscriptionFlags GeisSubscriptionFlags

Enumerations

enum  GeisStatus {
  GEIS_STATUS_SUCCESS, GEIS_STATUS_CONTINUE, GEIS_STATUS_EMPTY, GEIS_STATUS_NOT_SUPPORTED,
  GEIS_BAD_ARGUMENT, GEIS_UNKNOWN_ERROR, GEIS_STATUS_BAD_ARGUMENT, GEIS_STATUS_UNKNOWN_ERROR
}
 Errors returned from calls. More...
enum  GeisAttrType {
  GEIS_ATTR_TYPE_UNKNOWN, GEIS_ATTR_TYPE_BOOLEAN, GEIS_ATTR_TYPE_FLOAT, GEIS_ATTR_TYPE_INTEGER,
  GEIS_ATTR_TYPE_POINTER, GEIS_ATTR_TYPE_STRING
}
 Attribute data types. More...
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_INIT_COMPLETE, GEIS_EVENT_USER_DEFINED, GEIS_EVENT_ERROR
}
enum  _GeisFilterFacility { GEIS_FILTER_DEVICE, GEIS_FILTER_CLASS, GEIS_FILTER_REGION, GEIS_FILTER_SPECIAL }
 Indicates the type of filter. More...
enum  _GeisFilterOperation {
  GEIS_FILTER_OP_EQ, GEIS_FILTER_OP_NE, GEIS_FILTER_OP_GT, GEIS_FILTER_OP_GE,
  GEIS_FILTER_OP_LT, GEIS_FILTER_OP_LE
}
 Indicates the type of filter operation. More...
enum  GeisSubscriptionFlags { GEIS_SUBSCRIPTION_NONE, GEIS_SUBSCRIPTION_GRAB, GEIS_SUBSCRIPTION_CONT }
 These flags are used when creating a new subscription and affect the nature of the gestures recognized by the subscription. More...

Functions

GeisStatus geis_configuration_supported (GeisInstance geis_instance, int configuration_item)
 Indicates if a particular feaure is supported.
GeisStatus geis_configuration_get_value (GeisInstance geis_instance, int configuration_item, void *value)
 Gets a feature configuration value.
GeisStatus geis_configuration_set_value (GeisInstance geis_instance, int configuration_item, void *value)
 Sets a feature configuration value.
GeisStatus geis_event_dispatch (GeisInstance geis_instance)
 Dispatches geis events until there are no further events available.
GeisSize geis_error_count (Geis geis)
 Gets the number of status codes in the error stack.
GeisStatus geis_error_code (Geis geis, GeisSize index)
 Gets the indicated status code from the error stack.
GeisString geis_error_message (Geis geis, GeisSize index)
 Gets the localized error message, if any, associated with the indicated error.
GeisStatus geis_get_configuration (Geis geis, GeisString configuration_item_name, void *configuration_item_value)
 Gets a feature configuration value.
GeisStatus geis_set_configuration (Geis geis, GeisString configuration_item_name, void *configuration_item_value)
 Sets a feature configuration value.
GeisStatus geis_input_devices (GeisInstance geis_instance, GeisInputFuncs *func, void *cookie)
 Registers a callback to receive information on input devices.
GeisStatus geis_subscribe (GeisInstance geis_instance, GeisInputDeviceId *input_list, const char **gesture_list, GeisGestureFuncs *funcs, void *cookie)
 Registers a callback to receive gesture events.
GeisStatus geis_unsubscribe (GeisInstance geis_instance, GeisGestureType *gesture_list)
 Unsubscribes to one or more gestures.
GeisString geis_attr_name (GeisAttr attr)
 An opaque type that encapsulates a GEIS attribute.
GeisAttrType geis_attr_type (GeisAttr attr)
 Gets the type of an attribute value.
GeisBoolean geis_attr_value_to_boolean (GeisAttr attr)
 Gets the value of an attribute as a GeisBoolean.
GeisFloat geis_attr_value_to_float (GeisAttr attr)
 Gets the value of an attribute as a GeisFloat.
GeisInteger geis_attr_value_to_integer (GeisAttr attr)
 Gets the value of an attribute as a GeisInteger.
GeisPointer geis_attr_value_to_pointer (GeisAttr attr)
 Gets the value of an attribute as a GeisPointer.
GeisString geis_attr_value_to_string (GeisAttr attr)
 Gets the value of an attribute as a GeisString.
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_register_device_callback (Geis geis, GeisEventCallback event_callback, void *context)
void geis_register_class_callback (Geis geis, GeisEventCallback event_callback, void *context)
 Registers a callback to receive gesture class change notifications.

Detailed Description

This is the public interface for the GEIS gesture API.

Copyright 2010, 2011 Canonical Ltd.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 US


Define Documentation

#define GEIS_VERSION_1_0

GEIS version macros.

These macros can be tested at compile time to query for support of various features.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines