geis.h   geis.h 
skipping to change at line 28 skipping to change at line 28
* this program; if not, write to the Free Software Foundation, Inc., 51 * this program; if not, write to the Free Software Foundation, Inc., 51
* Franklin St, Fifth Floor, Boston, MA 02110-1301 US * Franklin St, Fifth Floor, Boston, MA 02110-1301 US
*/ */
#ifndef GEIS_GEIS_H_ #ifndef GEIS_GEIS_H_
#define GEIS_GEIS_H_ #define GEIS_GEIS_H_
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/**
* @defgroup geis_common Common Types and Definitions
*
* These types and values are common to both the simplified and advanced GE
IS
* interfaces.
*/
/**
* @defgroup geis_v1 The Simplified GEIS Interface
*
* The simplified GEIS interface is the original (GEIS v1) API. It provid
es a
* way to specify a list of gesture names and input devices for which gest
ures
* will be recognized on a given window.
*
* See @ref using_geis_v1.
*/
/**
* @defgroup geis_v2 The Advanced GEIS Interface
*
* The advanced GEIS interface (GEIS v2) was developed to give a more nuanc
ed
* control over the types of gestures and input devices for which gestures
will
* be recognized.
*
* See @ref using_geis_v2.
*/
/**
* GEIS version macros
*
* These macros can be tested at compile time to query for support of vari
ous
* features.
*/
#define GEIS_VERSION_1_0 1 #define GEIS_VERSION_1_0 1
#define GEIS_VERSION_2_0 20101122 #define GEIS_VERSION_2_0 20101122
#include <geis/geisimpl.h> #include <geis/geisimpl.h>
/**
* Errors returned from calls.
* @ingroup geis_common
*
* Most GEIS API calls return a status code indicating success or, in the e
vent
* of a lack of success, the reson for failure.
*/
typedef enum GeisStatus
{
GEIS_STATUS_SUCCESS = 0, /**< normal successful completion */
GEIS_STATUS_CONTINUE = 20, /**< normal successful completion
with data still remaining */
GEIS_STATUS_EMPTY = 21, /**< normal successful completion
with no data retrieved */
GEIS_STATUS_NOT_SUPPORTED = 10, /**< a requested feature is not support
ed */
GEIS_BAD_ARGUMENT = 1000, /**< a bad argument value was passed */
GEIS_UNKNOWN_ERROR = 9999, /**< any other error condition */
GEIS_STATUS_BAD_ARGUMENT = -100, /**< a bad argument value was passed */
GEIS_STATUS_UNKNOWN_ERROR = -999 /**< any other error condition */
} GeisStatus;
/**
* Attribute data types.
* @ingroup geis_common
*/
typedef enum GeisAttrType
{
GEIS_ATTR_TYPE_UNKNOWN, /**< Attr is an unknown type. */
GEIS_ATTR_TYPE_BOOLEAN, /**< Attr is truth-valued . */
GEIS_ATTR_TYPE_FLOAT, /**< Attr is real-valued. */
GEIS_ATTR_TYPE_INTEGER, /**< Attr is a counting number. */
GEIS_ATTR_TYPE_POINTER, /**< Attr is a pointer to a data structure. */
GEIS_ATTR_TYPE_STRING /**< Attr is a null-terminated UTF-8 string. *
/
} GeisAttrType;
#define GEIS_FALSE 0
#define GEIS_TRUE 1
/* Standard fundamental gestures */ /* Standard fundamental gestures */
#define GEIS_GESTURE_DRAG "Drag" #define GEIS_GESTURE_DRAG "Drag"
#define GEIS_GESTURE_PINCH "Pinch" #define GEIS_GESTURE_PINCH "Pinch"
#define GEIS_GESTURE_ROTATE "Rotate" #define GEIS_GESTURE_ROTATE "Rotate"
#define GEIS_GESTURE_TAP "Tap" #define GEIS_GESTURE_TAP "Tap"
#define GEIS_GESTURE_TOUCH "Touch"
/** /**
* @defgroup geis_v1_gesture_types Standard Gesture Types (GEIS v1) * @defgroup geis_v1_gesture_types Gesture Types
* The names of standard gesture types. These names can be passed to * @ingroup geis_v1
*
* The names of gesture types. These names can be passed to
* geis_subscribe() in a NULL-terminated list to specify only a subset of * geis_subscribe() in a NULL-terminated list to specify only a subset of
* available gestures. * available gestures.
*/
/**
* @defgroup geis_v1_gesture_primitives Gesture Primitives
* @ingroup geis_v1_gesture_types
*
* These are the prime gesture primitive that describes the general action
of
* the touchpoints at an instant in time.
*
* These are the values passed as the @p gesture_type parameter to the
* GeisGestureCallback.
*
* @{
*
* @def GEIS_GESTURE_PRIMITIVE_DRAG
* A translate gesture: dragging, swiping, flicking, moving in a generally
* linear fashion.
*
* @def GEIS_GESTURE_PRIMITIVE_PINCH
* A pinch or expand gesture: two or more touch points generally moving to
ward
* or away from a common point.
*
* @def GEIS_GESTURE_PRIMITIVE_ROTATE
* A rotation gesture. Two or more points moving relatively along an arc w
ith a
* commonish centre.
*
* @def GEIS_GESTURE_PRIMITIVE_TAP
* A tap. Touch down, touch up, one or more touches.
*
* @def GEIS_GESTURE_PRIMITIVE_TOUCH
* A parenthetical gesture event. Touch down (start) and up (finish).
*/
#define GEIS_GESTURE_PRIMITIVE_DRAG 0
#define GEIS_GESTURE_PRIMITIVE_PINCH 1
#define GEIS_GESTURE_PRIMITIVE_ROTATE 2
#define GEIS_GESTURE_PRIMITIVE_TAP 15
#define GEIS_GESTURE_PRIMITIVE_TOUCH 32
/* @} */
/**
* @defgroup geis_v1_standar_gesture_types Standard Gesture Types
* @ingroup geis_v1_gesture_types
*
* These gesture types should be available on all GEIS implementations.
*
* @{ * @{
*/ */
/* Gesture names for the Simplified Interface */ /* Gesture names for the Simplified Interface */
#define GEIS_GESTURE_TYPE_DRAG1 "Drag,touch=1" #define GEIS_GESTURE_TYPE_DRAG1 "Drag,touch=1"
#define GEIS_GESTURE_TYPE_DRAG2 "Drag,touch=2" #define GEIS_GESTURE_TYPE_DRAG2 "Drag,touch=2"
#define GEIS_GESTURE_TYPE_DRAG3 "Drag,touch=3" #define GEIS_GESTURE_TYPE_DRAG3 "Drag,touch=3"
#define GEIS_GESTURE_TYPE_DRAG4 "Drag,touch=4" #define GEIS_GESTURE_TYPE_DRAG4 "Drag,touch=4"
#define GEIS_GESTURE_TYPE_DRAG5 "Drag,touch=5" #define GEIS_GESTURE_TYPE_DRAG5 "Drag,touch=5"
#define GEIS_GESTURE_TYPE_PINCH1 "Pinch,touch=1" #define GEIS_GESTURE_TYPE_PINCH1 "Pinch,touch=1"
skipping to change at line 68 skipping to change at line 189
#define GEIS_GESTURE_TYPE_ROTATE1 "Rotate,touch=1" #define GEIS_GESTURE_TYPE_ROTATE1 "Rotate,touch=1"
#define GEIS_GESTURE_TYPE_ROTATE2 "Rotate,touch=2" #define GEIS_GESTURE_TYPE_ROTATE2 "Rotate,touch=2"
#define GEIS_GESTURE_TYPE_ROTATE3 "Rotate,touch=3" #define GEIS_GESTURE_TYPE_ROTATE3 "Rotate,touch=3"
#define GEIS_GESTURE_TYPE_ROTATE4 "Rotate,touch=4" #define GEIS_GESTURE_TYPE_ROTATE4 "Rotate,touch=4"
#define GEIS_GESTURE_TYPE_ROTATE5 "Rotate,touch=5" #define GEIS_GESTURE_TYPE_ROTATE5 "Rotate,touch=5"
#define GEIS_GESTURE_TYPE_TAP1 "Tap,touch=1" #define GEIS_GESTURE_TYPE_TAP1 "Tap,touch=1"
#define GEIS_GESTURE_TYPE_TAP2 "Tap,touch=2" #define GEIS_GESTURE_TYPE_TAP2 "Tap,touch=2"
#define GEIS_GESTURE_TYPE_TAP3 "Tap,touch=3" #define GEIS_GESTURE_TYPE_TAP3 "Tap,touch=3"
#define GEIS_GESTURE_TYPE_TAP4 "Tap,touch=4" #define GEIS_GESTURE_TYPE_TAP4 "Tap,touch=4"
#define GEIS_GESTURE_TYPE_TAP5 "Tap,touch=5" #define GEIS_GESTURE_TYPE_TAP5 "Tap,touch=5"
#define GEIS_GESTURE_TYPE_TOUCH1 "Touch,touch=1"
#define GEIS_GESTURE_TYPE_TOUCH2 "Touch,touch=2"
#define GEIS_GESTURE_TYPE_TOUCH3 "Touch,touch=3"
#define GEIS_GESTURE_TYPE_TOUCH4 "Touch,touch=4"
#define GEIS_GESTURE_TYPE_TOUCH5 "Touch,touch=5"
/* @} */ /* @} */
/** /**
* @defgroup geis_v1_vendor_extensions Vendor Extensions (GEIS v1) * @defgroup geis_v1_vendor_extensions Vendor Extension Gesture Types
* @ingroup geis_v1_gesture_types
*
* Vendor-specific extensions to the GEIS v1 API. * Vendor-specific extensions to the GEIS v1 API.
*
* @{ * @{
*/ */
/** /**
* A special gesture type than enabled system-wide gesture priority. * A special gesture type than enabled system-wide gesture priority.
*/ */
#define GEIS_GESTURE_TYPE_SYSTEM "Sysflags" #define GEIS_GESTURE_TYPE_SYSTEM "Sysflags"
/* @} */ /* @} */
skipping to change at line 127 skipping to change at line 256
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_2_ID "touch 2 id" #define GEIS_GESTURE_ATTRIBUTE_TOUCH_2_ID "touch 2 id"
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_2_X "touch 2 x" #define GEIS_GESTURE_ATTRIBUTE_TOUCH_2_X "touch 2 x"
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_2_Y "touch 2 y" #define GEIS_GESTURE_ATTRIBUTE_TOUCH_2_Y "touch 2 y"
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_3_ID "touch 3 id" #define GEIS_GESTURE_ATTRIBUTE_TOUCH_3_ID "touch 3 id"
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_3_X "touch 3 x" #define GEIS_GESTURE_ATTRIBUTE_TOUCH_3_X "touch 3 x"
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_3_Y "touch 3 y" #define GEIS_GESTURE_ATTRIBUTE_TOUCH_3_Y "touch 3 y"
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_4_ID "touch 4 id" #define GEIS_GESTURE_ATTRIBUTE_TOUCH_4_ID "touch 4 id"
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_4_X "touch 4 x" #define GEIS_GESTURE_ATTRIBUTE_TOUCH_4_X "touch 4 x"
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_4_Y "touch 4 y" #define GEIS_GESTURE_ATTRIBUTE_TOUCH_4_Y "touch 4 y"
#define GEIS_TOUCH_ATTRIBUTE_ID "touch id"
#define GEIS_TOUCH_ATTRIBUTE_X "touch x"
#define GEIS_TOUCH_ATTRIBUTE_Y "touch y"
#define GEIS_DEVICE_ATTRIBUTE_NAME "device name"
#define GEIS_REGION_ATTRIBUTE_WINDOWID "windowid"
#define GEIS_FALSE 0
#define GEIS_TRUE 1
/**
* @defgroup geis_status Status and Errors
*
* Most GEIS API calls return a status code indicating success or, in the e
vent
* of a lack of success, the reson for failure.
*
* @{
*/
/**
* Errors returned from calls.
*/
typedef enum GeisStatus
{
GEIS_STATUS_SUCCESS = 0, /**< normal successful completion */
GEIS_STATUS_CONTINUE = 20, /**< normal successful completion
with data still remaining */
GEIS_STATUS_EMPTY = 21, /**< normal successful completion
with no data retrieved */
GEIS_STATUS_NOT_SUPPORTED = 10, /**< a requested feature is not support
ed */
GEIS_BAD_ARGUMENT = 1000, /**< a bad argument value was passed */
GEIS_UNKNOWN_ERROR = 9999, /**< any other error condition */
GEIS_STATUS_BAD_ARGUMENT = -100, /**< a bad argument value was passed */
GEIS_STATUS_UNKNOWN_ERROR = -999 /**< any other error condition */
} GeisStatus;
/* @} */
/** /**
* @defgroup geis_meta Initialization and Cleanup * @defgroup geis_meta Initialization and Cleanup
* @ingroup geis_v1
* *
* Each instance of a gesture subscription must be created using the geis_i nit() * Each instance of a gesture subscription must be created using the geis_i nit()
* call and destroyed using the geis_finish() call. * call and destroyed using the geis_finish() call.
* *
* A particular subscription instance is associated with a display region. The * A particular subscription instance is associated with a display region. The
* nature of the display region depends on the underlying display technolog y. * nature of the display region depends on the underlying display technolog y.
* For example, an X11 window or even a subregion of an X11 window could be an * For example, an X11 window or even a subregion of an X11 window could be an
* associated display region when geis is layered over X11 technology. * associated display region when geis is layered over X11 technology.
* *
* The nature of the display desciption information depends on the actual * The nature of the display desciption information depends on the actual
* underlyinggeis implementation and is documented separately. The * underlyinggeis implementation and is documented separately. The
* implementation-specific description must be passed to geis_init using a * implementation-specific description must be passed to geis_init using a
* GeisWinInfo structure. * GeisWinInfo structure.
* *
* @{ * @{
*/ */
/** /**
* An opaque type representing a geis gesture subscription instance. * @class GeisInstance
* A geis gesture subscription instance.
*/ */
/** @cond typedef */
typedef struct _GeisInstance *GeisInstance; typedef struct _GeisInstance *GeisInstance;
/** @endcond */
/** /**
* @struct GeisWinInfo * @class GeisWinInfo
* Generic display region description block * Generic display region description block
*/ */
typedef struct GeisWinInfo typedef struct GeisWinInfo
{ {
uint32_t win_type; uint32_t win_type; /**< Selects the implementation-specific window typ
void *win_info; e. */
void *win_info; /**< Additional info dependent on the window type.
*/
} GeisWinInfo; } GeisWinInfo;
/** /**
* Initializes a geis subscription instance for a display region. * Initializes a geis subscription instance for a display region.
* @memberof GeisInstance
* *
* @param[in] win_info a display region description block * @param[in] win_info a display region description block
* -- see geis implementtaion documentation * -- see geis implementtaion documentation
* @param[out] geis_instance an opaque pointer to a geis gesture subscri ption * @param[out] geis_instance an opaque pointer to a geis gesture subscri ption
* instance * instance
* *
* @retval GEIS_BAD_ARGUMENT an invalid GeisWinInfo was passed * @retval GEIS_BAD_ARGUMENT an invalid GeisWinInfo was passed
* @retval GEIS_STATUS_SUCCESS normal successful completion * @retval GEIS_STATUS_SUCCESS normal successful completion
*/ */
GEIS_API GeisStatus geis_init(GeisWinInfo *win_info, GeisInstance *geis_ins tance); GEIS_API GeisStatus geis_init(GeisWinInfo *win_info, GeisInstance *geis_ins tance);
/** /**
* Cleans up a geis subscriotion instance for a display region. * Cleans up a geis subscription instance for a display region.
* @memberof GeisInstance
* *
* @param[in] geis_instance an opaque pointer to a geis gesture subscri ption * @param[in] geis_instance an opaque pointer to a geis gesture subscri ption
* instance * instance
* *
* @retval GEIS_BAD_ARGUMENT an invalid GeisInstance was passed * @retval GEIS_BAD_ARGUMENT an invalid GeisInstance was passed
* @retval GEIS_STATUS_SUCCESS normal successful completion * @retval GEIS_STATUS_SUCCESS normal successful completion
*/ */
GEIS_API GeisStatus geis_finish(GeisInstance geis_instance); GEIS_API GeisStatus geis_finish(GeisInstance geis_instance);
/* @} */ /* @} */
/** /**
* @defgroup geis_2_geis The Geis API Object (GEIS v2.0) * @defgroup geis_v1_config Configuration and Control
* * @ingroup geis_v1
* @{ * @{
*/ */
/** /**
* @defgroup geis_2_geis_init_args Specified Initialization Arguments * Gets the Unix file descriptor for GEIS events.
* *
* These initialization arguments are defined by the GEIS specification. * Applications or toolkits can use this file descriptor to intgerate geis
event
* handling into their main event dispatch loop. When a GEIS event is avai
lable
* for processing, the fd will have a read-available state indicated in
* select(), poll(), epoll(), etc.
*/
#define GEIS_CONFIG_UNIX_FD 10001
/**
* Indicates if a particular feaure is supported.
* *
* @{ * @param[in] geis_instance An opaque pointer to a geis gesture subscr
iption
* instance.
* @param[in] configuration_item Indicates which configuration item will be
* checked for support.
*
* @retval GEIS_BAD_ARGUMENT an invalid argument value was passed
* @retval GEIS_STATUS_SUCCESS normal successful completion
*/ */
GEIS_API GeisStatus geis_configuration_supported(GeisInstance geis_instance
,
int configuration
_item);
/** /**
* Enables GEIS to provide a networked service. * Gets a feature configuration value.
* *
* This initialization argument takes no parameters. * @param[in] geis_instance An opaque pointer to a geis gesture subscr
iption
* instance.
* @param[in] configuration_item Indicates which configuration item will be
* get.
* @param[in] value A pointer to where the retrieved value wil
l be
* stored.
*
* @retval GEIS_BAD_ARGUMENT an invalid argument value was passed
* @retval GEIS_STATUS_SUCCESS normal successful completion
*/ */
#define GEIS_INIT_SERVICE_PROVIDER "org.libgeis.init.server" GEIS_API GeisStatus geis_configuration_get_value(GeisInstance geis_instance
,
int configuration
_item,
void *value);
/** /**
* Tells GEIS to send input device events. * Sets a feature configuration value.
* *
* This initialization argument takes no parameters. * @param[in] geis_instance An opaque pointer to a geis gesture subscr
iption
* instance.
* @param[in] configuration_item Indicates which configuration item will be
* set.
* @param[in] value A pointer to where the value to be set wil
l be
* read.
*
* @retval GEIS_BAD_ARGUMENT an invalid argument value was passed
* @retval GEIS_STATUS_SUCCESS normal successful completion
*/ */
#define GEIS_INIT_TRACK_DEVICES "org.libgeis.init.track-devices" GEIS_API GeisStatus geis_configuration_set_value(GeisInstance geis_instance
,
int configuration
_item,
void *value);
/** /**
* Tells GEIS to send gesture class events. * Dispatches geis events until there are no further events available.
*
* @param[in] geis_instance an opaque pointer to a geis gesture subscri
ption
* instance
*
* This function is used to integrate geis even dispatch into the main even
t
* loop of an application or toolkit.
*
* @retval GEIS_BAD_ARGUMENT an invalid GeisInstance was passed
* @retval GEIS_STATUS_SUCCESS normal successful completion
*/
GEIS_API GeisStatus geis_event_dispatch(GeisInstance geis_instance);
/* @} */
/**
* @defgroup geis_v2_geis The Geis API Object
* @ingroup geis_v2
* *
* @{
*/
/**
* @class Geis
* Represents an instance of the gestire recognition engine
*/
/** @cond typedef */
typedef struct _Geis *Geis;
/** @endcond */
/**
* @name Standard Initialization Arguments
*
* @par
* These initialization arguments are defined by the GEIS v2 specification.
*
* @{
*
* @def GEIS_INIT_SERVICE_PROVIDER
* Enables GEIS to provide a networked service.
* This initialization argument takes no parameters.
*
* @def GEIS_INIT_TRACK_DEVICES
* Tells GEIS to send input device events.
* This initialization argument takes no parameters.
*
* @def GEIS_INIT_TRACK_GESTURE_CLASSES
* Tells GEIS to send gesture class events.
* This initialization argument takes no parameters. * This initialization argument takes no parameters.
*/ */
#define GEIS_INIT_SERVICE_PROVIDER "org.libgeis.init.server"
#define GEIS_INIT_TRACK_DEVICES "org.libgeis.init.track-devices"
#define GEIS_INIT_TRACK_GESTURE_CLASSES "org.libgeis.init.track-gesture-cl asses" #define GEIS_INIT_TRACK_GESTURE_CLASSES "org.libgeis.init.track-gesture-cl asses"
/* @} */ /* @} */
/** /**
* @defgroup geis_2_geis_init_vendor Vendor-defined Initialization Argument s * @name Vendor-defined Initialization Arguments
* *
* @par
* These initialization arguments are not a part of te GEIS specification a nd * These initialization arguments are not a part of te GEIS specification a nd
* may change. * may change.
* *
* @{ * @{
*
* @def GEIS_INIT_UTOUCH_MOCK_ENGINE
*
* @def GEIS_INIT_UTOUCH_XCB
*/ */
#define GEIS_INIT_UTOUCH_MOCK_ENGINE "com.canonical.utouch.mock.engine" #define GEIS_INIT_UTOUCH_MOCK_ENGINE "com.canonical.utouch.mock.engine"
#define GEIS_INIT_UTOUCH_XCB "com.canonical.utouch.xcb" #define GEIS_INIT_UTOUCH_XCB "com.canonical.utouch.xcb"
/* @} */ /* @} */
typedef struct _Geis *Geis;
/** /**
* Initializes an instance of the GEIS v2.0 API. * Initializes an instance of the GEIS v2.0 API.
* @ingroup geis_v2_geis
* @memberof Geis
* *
* @param[in] name A name for the API instance (used for diagnostics). * @param[in] init_arg_name The name of an initializaer argument.
* @param[in] ... A set of zero or more initialization arguments. * @param[in] ... The remaining initializaer arguments.
*
* A NULL-terminated list of zero or more initialization arguments is passe
d to
* this function to create and initialize a connection to a gesture recogni
tion
* engine.
*
* If no initialization arguments are passed, the parameter list consists o
f a
* single NULL argument.
*/ */
GEIS_API Geis geis_new(GeisString init_arg_name, ...); GEIS_API Geis geis_new(GeisString init_arg_name, ...);
/** /**
* Cleans up an instance of the GEIS v2.0 API. * Cleans up an instance of the GEIS v2.0 API.
* @ingroup geis_v2_geis
* @memberof Geis
* *
* @param[in] geis An instance of the GEIS v2.0 API. * @param[in] geis An instance of the GEIS v2.0 API.
* *
* Tears down the instance of the API and releases any resources associated with * Tears down the instance of the API and releases any resources associated with
* that instance. * that instance.
*/ */
GEIS_API GeisStatus geis_delete(Geis geis); GEIS_API GeisStatus geis_delete(Geis geis);
/* @} */ /* @} */
/** /**
* @defgroup geis_error Error Reporting * @defgroup geis_v2_error Error Reporting
* @ingroup geis_v2
* @{ * @{
*/ */
/** /**
* Gets the number of status codes in the error stack. * Gets the number of status codes in the error stack.
* *
* @param[in] geis A GEIS API instance or NULL for the global stack * @param[in] geis A GEIS API instance or NULL for the global stack
* *
* This function is used primarily to determine the failure details of a GE IS * This function is used primarily to determine the failure details of a GE IS
* function that does not explicitly return a GeisStatus value. This is * function that does not explicitly return a GeisStatus value. This is
skipping to change at line 346 skipping to change at line 542
* @param[in] index Indicates the status value to retrieve. Valid status v alues * @param[in] index Indicates the status value to retrieve. Valid status v alues
* are between 0 and less than the value returned from * are between 0 and less than the value returned from
* geis_error_count() otherwise GEIS_STATUS_BAD_ARGUMENT w ill * geis_error_count() otherwise GEIS_STATUS_BAD_ARGUMENT w ill
* be returned. * be returned.
*/ */
GEIS_API GeisString geis_error_message(Geis geis, GeisSize index); GEIS_API GeisString geis_error_message(Geis geis, GeisSize index);
/* @} */ /* @} */
/** /**
* @defgroup geis1_config Configuration and Control (GEIS v1.0) * @defgroup geis_v2_config Configuration
* @{ * @ingroup geis_v2
*/
#define GEIS_CONFIG_UNIX_FD 10001
/**
* Indicates if a particular feaure is supported.
*
* @param[in] geis_instance an opaque pointer to a geis gesture subscri
ption
* instance
*
* @retval GEIS_BAD_ARGUMENT an invalid argument value was passed
* @retval GEIS_STATUS_SUCCESS normal successful completion
*/
GEIS_API GeisStatus geis_configuration_supported(GeisInstance geis_instance
,
int configuration
_item);
/**
* Gets a feature configuration value.
*
* @param[in] geis_instance an opaque pointer to a geis gesture subscri
ption
* instance
*
* @retval GEIS_BAD_ARGUMENT an invalid argument value was passed
* @retval GEIS_STATUS_SUCCESS normal successful completion
*/
GEIS_API GeisStatus geis_configuration_get_value(GeisInstance geis_instance
,
int configuration
_item,
void *value);
/**
* Sets a feature configuration value.
*
* @param[in] geis_instance an opaque pointer to a geis gesture subscri
ption
* instance
*
* @retval GEIS_BAD_ARGUMENT an invalid argument value was passed
* @retval GEIS_STATUS_SUCCESS normal successful completion
*/
GEIS_API GeisStatus geis_configuration_set_value(GeisInstance geis_instance
,
int configuration
_item,
void *value);
/**
* Dispatches geis events until there are no further events available.
*
* @param[in] geis_instance an opaque pointer to a geis gesture subscri
ption
* instance
*
* This function is used to integrate geis even dispatch into the main even
t
* loop of an application or toolkit.
*
* @retval GEIS_BAD_ARGUMENT an invalid GeisInstance was passed
* @retval GEIS_STATUS_SUCCESS normal successful completion
*/
GEIS_API GeisStatus geis_event_dispatch(GeisInstance geis_instance);
/* @} */
/**
* @defgroup geis2_config Configuration (GEIS v2.0)
* @{ * @{
*/ */
/** /**
* @defgroup geis2_config_spec Required Configuration Items * @name Required Configuration Items
* *
* @par
* These configuration items are defined by the GEIS specification. * These configuration items are defined by the GEIS specification.
* *
* @{ * @{
*
* @def GEIS_CONFIGURATION_FD
* Gets a Unix file descriptor that will signal the availablility of GEIS e
vents
* for processing.
*/ */
#define GEIS_CONFIGURATION_FD "org.libgeis.configuration.fd" #define GEIS_CONFIGURATION_FD "org.libgeis.configuration.fd"
/* @} */ /* @} */
/** /**
* @defgroup geis2_config_vendor Vendor-defined Configuration Items * @name Vendor-defined Configuration Items
* *
* @par
* These configuration items are not a part of the GEIS specification and m ay * These configuration items are not a part of the GEIS specification and m ay
* change. * change.
* *
* @{ * @{
*
* @def GEIS_CONFIG_UTOUCH_MAX_EVENTS
*/ */
#define GEIS_CONFIG_UTOUCH_MAX_EVENTS "com.canonical.utouch.max_events" #define GEIS_CONFIG_UTOUCH_MAX_EVENTS "com.canonical.utouch.max_events"
/* @} */ /* @} */
/** /**
* Gets a feature configuration value. * Gets a feature configuration value.
* *
* @param[in] geis An opaque GEIS API object. * @param[in] geis An opaque GEIS API object.
skipping to change at line 457 skipping to change at line 601
* @retval GEIS_STATUS_NOT_SUPPORTED the configuration value is not suppor ted * @retval GEIS_STATUS_NOT_SUPPORTED the configuration value is not suppor ted
* @retval GEIS_STATUS_SUCCESS normal successful completion * @retval GEIS_STATUS_SUCCESS normal successful completion
*/ */
GEIS_API GeisStatus geis_get_configuration(Geis geis, GEIS_API GeisStatus geis_get_configuration(Geis geis,
GeisString configuration_item_n ame, GeisString configuration_item_n ame,
void *configuration_item_v alue); void *configuration_item_v alue);
/** /**
* Sets a feature configuration value. * Sets a feature configuration value.
* *
* @param[in] geis An opaque GEIS API object. * @param[in] geis An opaque GEIS API object.
* @param[in] configuration_value Selects the configuration value to retu * @param[in] configuration_item_name Selects the configuration value to r
rn. eturn.
* @param[in] configuration_item_name Selects the configuration value to
return.
* @param[in] configuration_item_value Points to a buffer to contain the ou tput * @param[in] configuration_item_value Points to a buffer to contain the ou tput
* configuration value. The actual typ e of * configuration value. The actual typ e of
* this buffer depends on the * this buffer depends on the
* @p configuration_value_name. * @p configuration_value_name.
* *
* @retval GEIS_STATUS_BAD_ARGUMENT an invalid argument value was passed * @retval GEIS_STATUS_BAD_ARGUMENT an invalid argument value was passed
* @retval GEIS_STATUS_NOT_SUPPORTED the configuration value is not suppor ted * @retval GEIS_STATUS_NOT_SUPPORTED the configuration value is not suppor ted
* @retval GEIS_STATUS_SUCCESS normal successful completion * @retval GEIS_STATUS_SUCCESS normal successful completion
*/ */
GEIS_API GeisStatus geis_set_configuration(Geis geis, GEIS_API GeisStatus geis_set_configuration(Geis geis,
GeisString configuration_item_n ame, GeisString configuration_item_n ame,
void *configuration_item_v alue); void *configuration_item_v alue);
/* @} */ /* @} */
/** /**
* @defgroup geis2_attrs Attributes * @defgroup geis_v1_input Input Devices
* * @ingroup geis_v1
* Attributes are named values associated with various GEIS entities, inclu
ding
* input devices, gesture types, and gesture events.
*
* @{
*/
typedef 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
} GeisAttrType;
/**
* An opaque type that encapsulates a GEIS attribute.
*
* GeisAttr objects may not be created or destroyed by the application, the
y may
* only have their data examined or extracted.
*/
typedef struct _GeisAttr *GeisAttr;
/**
* Gets the name of an attribute.
*
* @param[in] attr Identifies the attribute.
*/
GEIS_API GeisString geis_attr_name(GeisAttr attr);
/**
* Gets the type of an attribute value.
*
* @param[in] attr Identifies the attribute.
*/
GEIS_API GeisAttrType geis_attr_type(GeisAttr attr);
/**
* Gets the value of an attribute as a GeisBoolean.
*
* @param[in] attr Identifies the attribute.
*/
GEIS_API GeisBoolean geis_attr_value_to_boolean(GeisAttr attr);
/**
* Gets the value of an attribute as a GeisFloat.
*
* @param[in] attr Identifies the attribute.
*/
GEIS_API GeisFloat geis_attr_value_to_float(GeisAttr attr);
/**
* Gets the value of an attribute as a GeisInteger.
*
* @param[in] attr Identifies the attribute.
*/
GEIS_API GeisInteger geis_attr_value_to_integer(GeisAttr attr);
/**
* Gets the value of an attribute as a GeisPointer.
*
* @param[in] attr Identifies the attribute.
*/
GEIS_API GeisPointer geis_attr_value_to_pointer(GeisAttr attr);
/**
* Gets the value of an attribute as a GeisString.
*
* @param[in] attr Identifies the attribute.
*/
GEIS_API GeisString geis_attr_value_to_string(GeisAttr attr);
/* @} */
/**
* @defgroup geis_input Input Devices
* @{ * @{
*/ */
typedef unsigned int GeisInputDeviceId; typedef unsigned int GeisInputDeviceId;
#define GEIS_ALL_INPUT_DEVICES ((GeisInputDeviceId)0) #define GEIS_ALL_INPUT_DEVICES ((GeisInputDeviceId)0)
/** /**
* Prototype for input device callback functions. * Prototype for input device callback functions.
*/ */
skipping to change at line 584 skipping to change at line 651
GeisInputCallback changed; /**< Receives modified input device notices * / GeisInputCallback changed; /**< Receives modified input device notices * /
GeisInputCallback removed; /**< Receives removes input device notices */ GeisInputCallback removed; /**< Receives removes input device notices */
} GeisInputFuncs; } GeisInputFuncs;
/** /**
* Registers a callback to receive information on input devices. * Registers a callback to receive information on input devices.
* *
* @param[in] geis_instance points to a geis gesture subscription * @param[in] geis_instance points to a geis gesture subscription
* instance * instance
* @param[in] funcs points to a GeisInputFuncs table * @param[in] func points to a GeisInputFuncs table
* @param[in] cookie an application specific value to be passed to * @param[in] cookie an application specific value to be passed to
* the callback * the callback
* *
* The callback is called for each gesture-capable input device available f or * The callback is called for each gesture-capable input device available f or
* the display region associated with the geis subscription instance. Over * the display region associated with the geis subscription instance. Over
* time, as gesture-capable input devices appear and disappear or change th eir * time, as gesture-capable input devices appear and disappear or change th eir
* abilities or configuration, the callback may be called again. * abilities or configuration, the callback may be called again.
* *
* @retval GEIS_BAD_ARGUMENT an invalid argument value was passed * @retval GEIS_BAD_ARGUMENT an invalid argument value was passed
* @retval GEIS_STATUS_SUCCESS normal successful completion * @retval GEIS_STATUS_SUCCESS normal successful completion
*/ */
GEIS_API GeisStatus geis_input_devices(GeisInstance geis_instance, GEIS_API GeisStatus geis_input_devices(GeisInstance geis_instance,
GeisInputFuncs *func, GeisInputFuncs *func,
void *cookie); void *cookie);
/* @} */ /* @} */
/** /**
* @defgroup geis1_subscription Gesture Subscription (GEIS v1.0) * @defgroup geis_v1_subscription Gesture Subscription
* @ingroup geis_v1
* @{ * @{
*/ */
typedef unsigned int GeisGestureType; typedef unsigned int GeisGestureType;
typedef unsigned int GeisGestureId; typedef unsigned int GeisGestureId;
/** Selects ALL input devices. */
#define GEIS_ALL_GESTURES ((GeisGestureType)0) #define GEIS_ALL_GESTURES ((GeisGestureType)0)
#define GEIS_NO_GESTURE_ID ((GeisGestureId)0) #define GEIS_NO_GESTURE_ID ((GeisGestureId)0)
/** /**
* Gesture Attributes * An individual gesture attribute.
*
* Gesture events are associated with a list of attributes, each of which i
s a
* (name, type, value) tuple. These attribute reveal a little piece of
* information about a gesture.
*/ */
typedef struct GeisGestureAttr typedef struct GeisGestureAttr
{ {
/** The name of the gesture attribute. */
GeisString name; GeisString name;
/** The data type of the gesture attribute. */
GeisAttrType type; GeisAttrType type;
/** The value of the attributes. */
union union
{ {
GeisBoolean boolean_val; GeisBoolean boolean_val;
GeisFloat float_val; GeisFloat float_val;
GeisInteger integer_val; GeisInteger integer_val;
GeisString string_val; GeisString string_val;
}; };
} GeisGestureAttr; } GeisGestureAttr;
/** /**
skipping to change at line 644 skipping to change at line 721
* @param[in] gesture_id a unique gesture identifier * @param[in] gesture_id a unique gesture identifier
* @param[in] attrs parameters * @param[in] attrs parameters
*/ */
typedef void (*GeisGestureCallback)(void *cookie, typedef void (*GeisGestureCallback)(void *cookie,
GeisGestureType gesture_type, GeisGestureType gesture_type,
GeisGestureId gesture_id, GeisGestureId gesture_id,
GeisSize attr_count, GeisSize attr_count,
GeisGestureAttr *attrs); GeisGestureAttr *attrs);
/** /**
* A structure of callback functions. * The set of callback functions invoked for various gesture-related events
.
*
* An application must define callback functions to handle the various gest
ure
* events. These callbacks are provided in a table passed to geis_subscrib
e for
* each window on which gesture events may occur.
*/ */
typedef struct GeisGestureFuncs typedef struct GeisGestureFuncs
{ {
/** Invoked when a new gesture type has been defined. */
GeisGestureCallback added; GeisGestureCallback added;
/** Invoked when a defined gesture type is no longer available. */
GeisGestureCallback removed; GeisGestureCallback removed;
/** Invoked when a new gesture starts. */
GeisGestureCallback start; GeisGestureCallback start;
/** Invoked when a gesture has changed values. */
GeisGestureCallback update; GeisGestureCallback update;
/** Invoked when a gesture finishes. */
GeisGestureCallback finish; GeisGestureCallback finish;
} GeisGestureFuncs; } GeisGestureFuncs;
/** /**
* Registers a callback to receive gesture events. * Registers a callback to receive gesture events.
* *
* @param[in] geis_instance an opaque pointer to a geis gesture subscri ption * @param[in] geis_instance an opaque pointer to a geis gesture subscri ption
* instance * instance
* @param[in] input_list a null-terminated list of input device IDs * @param[in] input_list a null-terminated list of input device IDs
* @param[in] gesture_list a null-terminated list of C-style strings n aming * @param[in] gesture_list a null-terminated list of C-style strings n aming
skipping to change at line 689 skipping to change at line 775
* @param[in] geis_instance an opaque pointer to a geis gesture subscri ption * @param[in] geis_instance an opaque pointer to a geis gesture subscri ption
* instance * instance
* @param[in] gesture_list a null-terminated list of gesture types * @param[in] gesture_list a null-terminated list of gesture types
*/ */
GEIS_API GeisStatus geis_unsubscribe(GeisInstance geis_instance, GEIS_API GeisStatus geis_unsubscribe(GeisInstance geis_instance,
GeisGestureType *gesture_list); GeisGestureType *gesture_list);
/* @} */ /* @} */
/** /**
* @defgroup geis2_event_control Event Control (GEIS v2.0) * @defgroup geis_v2_attrs Attributes
* @ingroup geis_v2
*
* Attributes are named values associated with various GEIS entities, inclu
ding
* input devices, gesture types, and gesture events.
*
* @{
*/
/**
* An opaque type that encapsulates a GEIS attribute.
*
* GeisAttr objects may not be created or destroyed by the application, the
y may
* only have their data examined or extracted.
*/
/** @cond typedef */
typedef struct _GeisAttr *GeisAttr;
/** @endcond */
/**
* Gets the name of an attribute.
*
* @param[in] attr Identifies the attribute.
*/
GEIS_API GeisString geis_attr_name(GeisAttr attr);
/**
* Gets the type of an attribute value.
*
* @param[in] attr Identifies the attribute.
*/
GEIS_API GeisAttrType geis_attr_type(GeisAttr attr);
/**
* Gets the value of an attribute as a GeisBoolean.
*
* @param[in] attr Identifies the attribute.
*/
GEIS_API GeisBoolean geis_attr_value_to_boolean(GeisAttr attr);
/**
* Gets the value of an attribute as a GeisFloat.
*
* @param[in] attr Identifies the attribute.
*/
GEIS_API GeisFloat geis_attr_value_to_float(GeisAttr attr);
/**
* Gets the value of an attribute as a GeisInteger.
*
* @param[in] attr Identifies the attribute.
*/
GEIS_API GeisInteger geis_attr_value_to_integer(GeisAttr attr);
/**
* Gets the value of an attribute as a GeisPointer.
*
* @param[in] attr Identifies the attribute.
*/
GEIS_API GeisPointer geis_attr_value_to_pointer(GeisAttr attr);
/**
* Gets the value of an attribute as a GeisString.
*
* @param[in] attr Identifies the attribute.
*/
GEIS_API GeisString geis_attr_value_to_string(GeisAttr attr);
/* @} */
/**
* @defgroup geis_v2_event_control Event Control
* @ingroup geis_v2
* *
* These functions are used to dispatch events generated from the various o ther * These functions are used to dispatch events generated from the various o ther
* GEIS components. * GEIS components.
* *
* Applications must invoke geis_dispatch_events() from time to time to gen erate * Applications must invoke geis_dispatch_events() from time to time to gen erate
* input device, gesture type, and gesture events. The GEIS events are the n * input device, gesture type, and gesture events. The GEIS events are the n
* retrieved either from the internal event queue using the geis_next_event () * retrieved either from the internal event queue using the geis_next_event ()
* call or through an application-supplied callback set through the * call or through an application-supplied callback set through the
* geis_register_event_callback() call. * geis_register_event_callback() call.
* *
skipping to change at line 719 skipping to change at line 877
GEIS_EVENT_CLASS_UNAVAILABLE = 2010, GEIS_EVENT_CLASS_UNAVAILABLE = 2010,
GEIS_EVENT_GESTURE_BEGIN = 3000, GEIS_EVENT_GESTURE_BEGIN = 3000,
GEIS_EVENT_GESTURE_UPDATE = 3010, GEIS_EVENT_GESTURE_UPDATE = 3010,
GEIS_EVENT_GESTURE_END = 3020, GEIS_EVENT_GESTURE_END = 3020,
GEIS_EVENT_INIT_COMPLETE = 4000, GEIS_EVENT_INIT_COMPLETE = 4000,
GEIS_EVENT_USER_DEFINED = 6000, GEIS_EVENT_USER_DEFINED = 6000,
GEIS_EVENT_ERROR = 7000 GEIS_EVENT_ERROR = 7000
} GeisEventType; } GeisEventType;
/** /**
* Opaque pointer to a generic GEIS event. * @class GeisEvent
* A generic GEIS event.
* *
* Applications must determine the type of the actual event and convert the * Applications must determine the type of the actual event and convert the
* opaque pointer to a concrete event pointer, if required. * opaque pointer to a concrete event pointer, if required.
* *
* Events are created by the GEIS API but must be destroyed by the applicat ion. * Events are created by the GEIS API but must be destroyed by the applicat ion.
*/ */
/** @cond typedef */
typedef struct _GeisEvent *GeisEvent; typedef struct _GeisEvent *GeisEvent;
/** @endcond */
/** /**
* Destroys a GeisEvent. * Destroys a GeisEvent.
* @memberof GeisEvent
* *
* @param[in] geis The GeisEvent to destroy. * @param[in] event The GeisEvent to destroy.
*/ */
GEIS_API void geis_event_delete(GeisEvent event); GEIS_API void geis_event_delete(GeisEvent event);
/** /**
* Gets the type of the event. * Gets the type of the event.
* @memberof GeisEvent
* *
* @param[in] geis The GeisEvent to destroy. * @param[in] event The GeisEvent to destroy.
*/ */
GEIS_API GeisEventType geis_event_type(GeisEvent event); GEIS_API GeisEventType geis_event_type(GeisEvent event);
/** /**
* Gets the number of attributes in the event. * Gets the number of attributes in the event.
* @memberof GeisEvent
* *
* @param[in] geis The GeisEvent. * @param[in] event The GeisEvent.
*/ */
GEIS_API GeisSize geis_event_attr_count(GeisEvent event); GEIS_API GeisSize geis_event_attr_count(GeisEvent event);
/** /**
* Gets an indicated attribute from the event. * Gets an indicated attribute from the event.
* @memberof GeisEvent
* *
* @param[in] geis The GeisEvent. * @param[in] event The GeisEvent.
* @param[in] index Indicates the attribute to retrieve. * @param[in] index Indicates the attribute to retrieve.
*/ */
GEIS_API GeisAttr geis_event_attr(GeisEvent event, GeisSize index); GEIS_API GeisAttr geis_event_attr(GeisEvent event, GeisSize index);
/** /**
* Gets a named attribute from the event. * Gets a named attribute from the event.
* @memberof GeisEvent
* *
* @param[in] geis The GeisEvent. * @param[in] event The GeisEvent.
* @param[in] attr_name The name of the attribute to retrieve. * @param[in] attr_name The name of the attribute to retrieve.
*/ */
GEIS_API GeisAttr geis_event_attr_by_name(GeisEvent event, GeisString attr_ name); GEIS_API GeisAttr geis_event_attr_by_name(GeisEvent event, GeisString attr_ name);
/** /**
* The application callback type for the event dispatcher. * The application callback type for the event dispatcher.
* *
* @param[in] geis the GEIS API instance * @param[in] geis the GEIS API instance
* @param[in] event the opaque event pointer * @param[in] event the opaque event pointer
* @param[in] context the application-supplied context value * @param[in] context the application-supplied context value
skipping to change at line 805 skipping to change at line 971
* geis_dispatch_events() is called from. * geis_dispatch_events() is called from.
*/ */
GEIS_API void geis_register_event_callback(Geis geis, GEIS_API void geis_register_event_callback(Geis geis,
GeisEventCallback event_callbac k, GeisEventCallback event_callbac k,
void *context); void *context);
/** /**
* Pumps the GEIS event loop. * Pumps the GEIS event loop.
* *
* @param[in] geis The GEIS API instance. * @param[in] geis The GEIS API instance.
* @param[out] event An opeaque event object.
* *
* Processes input events until there are no more input events to process a nd * Processes input events until there are no more input events to process a nd
* generates zero or more gesture events, reporting them via the user-suppl ied * generates zero or more gesture events, reporting them via the user-suppl ied
* callback or pushing them on the internal event queue for retrieval via t he * callback or pushing them on the internal event queue for retrieval via t he
* geis_next_event() call. * geis_next_event() call.
* *
* @retval GEIS_STATUS_SUCCESS The event loop was successfully pumped and * @retval GEIS_STATUS_SUCCESS The event loop was successfully pumped and
* no further events remain to be process ed at * no further events remain to be process ed at
* this time. * this time.
* *
skipping to change at line 851 skipping to change at line 1016
* it is empty. The value of *event rema ins * it is empty. The value of *event rema ins
* unchanged. * unchanged.
* *
* @retval GEIS_STATUS_UNKNOWN_ERROR Some error occurred * @retval GEIS_STATUS_UNKNOWN_ERROR Some error occurred
*/ */
GEIS_API GeisStatus geis_next_event(Geis geis, GeisEvent *event); GEIS_API GeisStatus geis_next_event(Geis geis, GeisEvent *event);
/* @} */ /* @} */
/** /**
* @defgroup geis2_device Gesture Input Devices (GEIS v2.0) * @defgroup geis_v2_device Input Devices
* @ingroup geis_v2
* @{ * @{
*/ */
/** /**
* An opaque pointer type representing a gesture-capable input device. * @name Device Event Attributes
* @{
*
* @def GEIS_EVENT_ATTRIBUTE_DEVICE
* The event attribute containing a pointer to a GeisDevice.
*
* The GEIS_EVENT_DEVICE_AVAILABLE and GEIS_EVENT_DEVICE_UNAVAILABLE events
* should have a GEIS_ATTR_TYPE_POINTER attribute with this name. It
* should contain a pointer to a GeisDevice describing the device made avai
lable
* or unavailable.
*/
#define GEIS_EVENT_ATTRIBUTE_DEVICE "device"
/* @} */
/**
* @name Device Attributes
* @{
*
* @def GEIS_DEVICE_ATTRIBUTE_NAME
* The name of the input device. Not guaranteed unique.
*
* @def GEIS_DEVICE_ATTRIBUTE_ID
* The unique integer ID of the device. Guaranteed unique within a Geis
* instance.
*
* @def GEIS_DEVICE_ATTRIBUTE_TOUCHES
* The maximum number of touches a device is capable of reporting.
* This integer is the number if simultaneous touches the device claims to
be
* able to detect if it is a multi-touch device. A value of zero indicates
the
* maximum number of touches can not be determined.
*
* @def GEIS_DEVICE_ATTRIBUTE_DIRECT_TOUCH
* Indicates the device is a direct touch device.
* The present of this boolean attribute with a value of GEIS_TRUE indicate
s the
* device is a direct touch multi-touch device (for example, a touchscreen)
,
* otherwise it is an indirect touch device (such as a touchpad) or not a t
ouch
* device at all.
*
* @def GEIS_DEVICE_ATTRIBUTE_INDEPENDENT_TOUCH
* Indicates the device is an independent touch device.
* The presence of this boolean attribute with a value of GEIS_TRUE indicat
es
* the device is an independent touch device (for example, an Apple MagicMo
use).
* Other multi-touch devices should report GEIS_FALSE.
*/
#define GEIS_DEVICE_ATTRIBUTE_NAME "device name"
#define GEIS_DEVICE_ATTRIBUTE_ID "device id"
#define GEIS_DEVICE_ATTRIBUTE_TOUCHES "device touches"
#define GEIS_DEVICE_ATTRIBUTE_DIRECT_TOUCH "direct touch"
#define GEIS_DEVICE_ATTRIBUTE_INDEPENDENT_TOUCH "independent touch"
/* @} */
/**
* @class GeisDevice
* A gesture-capable input device.
* *
* GeisDevice objects are created by the GEIS API and are reference counted . * GeisDevice objects are created by the GEIS API and are reference counted .
*/ */
/** @cond typedef */
typedef struct _GeisDevice *GeisDevice; typedef struct _GeisDevice *GeisDevice;
/** @endcond */
GEIS_API void geis_register_device_callback(Geis geis, GEIS_API void geis_register_device_callback(Geis geis,
GeisEventCallback event_callba ck, GeisEventCallback event_callba ck,
void *context); void *context);
/** /**
* Adds a reference count to a device. * Adds a reference count to a device.
* @memberof GeisDevice
* *
* @param[in] device The device. * @param[in] device The device.
* *
* An application that wishes to guarantee the device object remains valid * An application that wishes to guarantee the device object remains valid
* should add a reference using this call, and unref when the object is no * should add a reference using this call, and unref when the object is no
* longer needed. * longer needed.
*/ */
GEIS_API void geis_device_ref(GeisDevice device); GEIS_API void geis_device_ref(GeisDevice device);
/** /**
* Removes a reference count from a device. * Removes a reference count from a device.
* @memberof GeisDevice
* *
* @param[in] device The device. * @param[in] device The device.
* *
* This function decrements the number of references to the device and, if the * This function decrements the number of references to the device and, if the
* number of references hits zero, deletes the device. * number of references hits zero, deletes the device.
*/ */
GEIS_API void geis_device_unref(GeisDevice device); GEIS_API void geis_device_unref(GeisDevice device);
/** /**
* Gets the name of the input device. * Gets the name of the input device.
* @memberof GeisDevice
* *
* @param[in] device The device. * @param[in] device The device.
*/ */
GEIS_API GeisString geis_device_name(GeisDevice device); GEIS_API GeisString geis_device_name(GeisDevice device);
/** /**
* Gets the system identifier of the iput device. * Gets the system identifier of the iput device.
* @memberof GeisDevice
* *
* @param[in] device The device. * @param[in] device The device.
* *
* The system-defined device identifier is system- and possibly * The system-defined device identifier is system- and possibly
* device-dependent. * device-dependent.
*/ */
GEIS_API GeisInteger geis_device_id(GeisDevice device); GEIS_API GeisInteger geis_device_id(GeisDevice device);
/** /**
* Gets the number of attributes of the device. * Gets the number of attributes of the device.
* @memberof GeisDevice
* *
* @param[in] device The device. * @param[in] device The device.
*/ */
GEIS_API GeisSize geis_device_attr_count(GeisDevice device); GEIS_API GeisSize geis_device_attr_count(GeisDevice device);
/** /**
* Gets the indicated attribute of the device. * Gets the indicated attribute of the device.
* @memberof GeisDevice
* *
* @param[in] device The device. * @param[in] device The device.
* @param[in] index Indicates which attr to retrieve.
*/ */
GEIS_API GeisAttr geis_device_attr(GeisDevice device, GeisSize index); GEIS_API GeisAttr geis_device_attr(GeisDevice device, GeisSize index);
/* @} */ /* @} */
/** /**
* @defgroup geis2_class Gesture Classes (GEIS v2.0) * @defgroup geis_v2_class Gesture Classes
* @ingroup geis_v2
* @{ * @{
*/ */
/** /**
* An opaque pointer type representing a gesture-capable input device. * @class GeisGestureClass
* A defined gesture classifier.
* *
* GeisDevice objects are created by the GEIS API and are reference counted * GeisGestureClass objects are created by the GEIS API and are reference
. An * counted. An application needs to increment and decrement the reference
* application needs to increment and decrement the reference count of a ge * count of a gesture class object to control its persistence.
sture
* class object to control its persistence.
*/ */
/** @cond typedef */
typedef struct _GeisGestureClass *GeisGestureClass; typedef struct _GeisGestureClass *GeisGestureClass;
/** @endcond */
/**
* @name Gesture Class Event Attributes
* @{
*
* @def GEIS_EVENT_ATTRIBUTE_CLASS
* The event attribute containing a pointer to a GeisGestureClass.
*
* The GEIS_EVENT_CLASS_AVAILABLE and GEIS_EVENT_CLASS_UNAVAILABLE events
* should have a GEIS_ATTR_TYPE_POINTER attribute with this name. It
* should contain a pointer to a GeisGestureClass describing the gesture cl
ass
* made available or unavailable.
*/
#define GEIS_EVENT_ATTRIBUTE_CLASS "gesture class"
/* @} */
/**
* @name Gesture Class Attributes
* @{
*
* @def GEIS_CLASS_ATTRIBUTE_NAME
* The name of the gesture class.
*
* @def GEIS_CLASS_ATTRIBUTE_ID
* The unique integer ID of the gesture class.
*/
#define GEIS_CLASS_ATTRIBUTE_NAME "class name" #define GEIS_CLASS_ATTRIBUTE_NAME "class name"
#define GEIS_CLASS_ATTRIBUTE_ID "class id" #define GEIS_CLASS_ATTRIBUTE_ID "class id"
#define GEIS_EVENT_ATTRIBUTE_CLASS "gesture class" /* @} */
/** /**
* Registers a callback to receive gesture class change notifications. * Registers a callback to receive gesture class change notifications.
* *
* @param[in] geis The API instance. * @param[in] geis The API instance.
* @param[in] event_callback The callback function. * @param[in] event_callback The callback function.
* @param[in] context Contextual data to be passed through to the * @param[in] context Contextual data to be passed through to the
* callback. * callback.
* *
* This function is used to register a function to be executed when a chang e to * This function is used to register a function to be executed when a chang e to
skipping to change at line 964 skipping to change at line 1224
* *
* The @p event_callback function will be executed in the same thread conte xt as * The @p event_callback function will be executed in the same thread conte xt as
* geis_dispatch_events(). * geis_dispatch_events().
*/ */
GEIS_API void geis_register_class_callback(Geis geis, GEIS_API void geis_register_class_callback(Geis geis,
GeisEventCallback event_callbac k, GeisEventCallback event_callbac k,
void *context); void *context);
/** /**
* Increments the reference count of a gesture class object. * Increments the reference count of a gesture class object.
* @memberof GeisGestureClass
* *
* @param[in] gesture_class The gesture class object. * @param[in] gesture_class The gesture class object.
*/ */
GEIS_API void geis_gesture_class_ref(GeisGestureClass gesture_class); GEIS_API void geis_gesture_class_ref(GeisGestureClass gesture_class);
/** /**
* Decrements the reference count of a gesture class object. * Decrements the reference count of a gesture class object.
* @memberof GeisGestureClass
* *
* @param[in] gesture_class The gesture class object. * @param[in] gesture_class The gesture class object.
* *
* The reference count of teh object is decremented and, if it reaches zero , the * The reference count of teh object is decremented and, if it reaches zero , the
* object is destroyed. * object is destroyed.
*/ */
GEIS_API void geis_gesture_class_unref(GeisGestureClass gesture_class); GEIS_API void geis_gesture_class_unref(GeisGestureClass gesture_class);
/** /**
* Gets the name of the gesture class. * Gets the name of the gesture class.
* @memberof GeisGestureClass
* *
* @param[in] gesture_class The gesture class object. * @param[in] gesture_class The gesture class object.
*/ */
GEIS_API GeisString geis_gesture_class_name(GeisGestureClass gesture_class) ; GEIS_API GeisString geis_gesture_class_name(GeisGestureClass gesture_class) ;
/** /**
* Gets the numeric identifier of the gesture class. * Gets the numeric identifier of the gesture class.
* @memberof GeisGestureClass
* *
* @param[in] gesture_class The gesture class object. * @param[in] gesture_class The gesture class object.
*/ */
GEIS_API GeisInteger geis_gesture_class_id(GeisGestureClass gesture_class); GEIS_API GeisInteger geis_gesture_class_id(GeisGestureClass gesture_class);
/** /**
* Gets the number of attributes of the gesture class. * Gets the number of attributes of the gesture class.
* @memberof GeisGestureClass
* *
* @param[in] gesture_class The gesture class object. * @param[in] gesture_class The gesture class object.
*/ */
GEIS_API GeisSize geis_gesture_class_attr_count(GeisGestureClass gesture_cl ass); GEIS_API GeisSize geis_gesture_class_attr_count(GeisGestureClass gesture_cl ass);
/** /**
* Gets the indicated attribute of teh gesture class. * Gets the indicated attribute of teh gesture class.
* @memberof GeisGestureClass
* *
* @param[in] gesture_class The gesture class object. * @param[in] gesture_class The gesture class object.
* @param[in] index The index of the attribute to retrieve. * @param[in] index The index of the attribute to retrieve.
*/ */
GEIS_API GeisAttr geis_gesture_class_attr(GeisGestureClass gesture_class, GEIS_API GeisAttr geis_gesture_class_attr(GeisGestureClass gesture_class,
int index); int index);
/* @} */ /* @} */
/** /**
* @defgroup geis2_region Gesture Regions (GEIS v2.0) * @defgroup geis_v2_region Gesture Regions
* @ingroup geis_v2
* @{ * @{
*/ */
/**
* @class GeisRegion
* Defines a region over which gestures may take place.
*/
/** @cond typedef */
typedef struct _GeisRegion *GeisRegion; typedef struct _GeisRegion *GeisRegion;
/** @endcond */
/** /**
* @defgroup geis2_region_init_args Gesture Region Initialization Arguments * @name Region Attributes
*
* @par
* These attributes can be used to construct filter terms to restrict a
* gesture subscription to a particular region.
*
* @{
* *
* @def GEIS_REGION_ATTRIBUTE_WINDOWID
* The X11 windowid in which a gesture occurred. Used for filter matching.
*/
#define GEIS_REGION_ATTRIBUTE_WINDOWID "windowid"
/* @} */
/**
* @name Region Initialization Arguments
*
* @par
* Gesture regions are created to describe a particular display/feedback re gion. * Gesture regions are created to describe a particular display/feedback re gion.
* The type of the region can not be changed after creation (just create a new * 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 t ype * region for that). The types of regions are platform specific and each t ype
* may require addition arguments. * may require addition arguments.
* *
* @par
* The following region initialization argument names are required by the * The following region initialization argument names are required by the
* GEIS v2.0 specification. * GEIS v2.0 specification.
* *
* @{ * @{
*
* @def GEIS_REGION_X11_ROOT
* Selects the X11 root window as a region.
*
* @def GEIS_REGION_X11_WINDOWID
* Selects an X11 window as a region.
* Requires the window_id as an argument.
*/ */
#define GEIS_REGION_X11_ROOT "org.libgeis.region.x11.root" #define GEIS_REGION_X11_ROOT "org.libgeis.region.x11.root"
#define GEIS_REGION_X11_WINDOWID "org.libgeis.region.x11.windowid" #define GEIS_REGION_X11_WINDOWID "org.libgeis.region.x11.windowid"
/* @} */ /* @} */
/** /**
* Creates a new GEIS v2.0 region. * Creates a new GEIS v2.0 region.
* @memberof GeisRegion
* *
* @param[in] geis The GEIS API instance. * @param[in] geis The GEIS API instance.
* @param[in] name A name. Used for diagnostics. * @param[in] name A name. Used for diagnostics.
* @param[in] init_arg_name The name of the first initialization argument. * @param[in] init_arg_name The name of the first initialization argument.
* *
* The initialization argument list must be terminated by a NULL. * The initialization argument list must be terminated by a NULL.
* *
* @returns a newly created region, or NULL on failure. * @returns a newly created region, or NULL on failure.
*/ */
GEIS_API GeisRegion geis_region_new(Geis geis, GEIS_API GeisRegion geis_region_new(Geis geis,
GeisString name, GeisString name,
GeisString init_arg_name, ...); GeisString init_arg_name, ...);
/** /**
* Destroys a GEIS v2.0 region. * Destroys a GEIS v2.0 region.
* @memberof GeisRegion
* *
* @param[in] region The region. * @param[in] region The region.
*/ */
GEIS_API GeisStatus geis_region_delete(GeisRegion region); GEIS_API GeisStatus geis_region_delete(GeisRegion region);
/** /**
* Gets the name of a GEIS v2.0 region. * Gets the name of a GEIS v2.0 region.
* @memberof GeisRegion
* *
* @param[in] region The region. * @param[in] region The region.
* *
* Returns the @p name value used when creating the region. * Returns the @p name value used when creating the region.
*/ */
GEIS_API GeisString geis_region_name(GeisRegion region); GEIS_API GeisString geis_region_name(GeisRegion region);
/* @} */ /* @} */
/** /**
* @defgroup geis2_filter Gesture Filter (GEIS v2.0) * @defgroup geis_v2_filter Gesture Filter
* @ingroup geis_v2
* @{ * @{
*/ */
/**
* @class GeisFilter
* Selects a subset of possible gestures in a subscription.
*
* A GeisFilter is a collection of filter terms, each of which defines a
* criterion for selection of gestures returned on a subscription.
*
* All filter terms are effectively ANDed together in a filter.
**/
/** @cond typedef */
typedef struct _GeisFilter *GeisFilter; typedef struct _GeisFilter *GeisFilter;
/** @endcond */
/**
* Indicates the type of filter.
*/
typedef enum _GeisFilterFacility typedef enum _GeisFilterFacility
{ {
GEIS_FILTER_DEVICE = 1000, GEIS_FILTER_DEVICE = 1000, /**< Filters on device attributes. */
GEIS_FILTER_CLASS = 2000, GEIS_FILTER_CLASS = 2000, /**< Filters on gesture attributes. */
GEIS_FILTER_REGION = 3000 GEIS_FILTER_REGION = 3000 /**< Filters on region attributes. */
} GeisFilterFacility; } GeisFilterFacility;
/**
* Indicates the type of filter operation.
*/
typedef enum _GeisFilterOperation typedef enum _GeisFilterOperation
{ {
GEIS_FILTER_OP_EQ, GEIS_FILTER_OP_EQ, /**< Compares for equality. */
GEIS_FILTER_OP_NE, GEIS_FILTER_OP_NE, /**< Compares for inequality */
GEIS_FILTER_OP_GT, GEIS_FILTER_OP_GT, /**< Compares for greater-than. */
GEIS_FILTER_OP_GE, GEIS_FILTER_OP_GE, /**< Compares for greater-than-or-equal. */
GEIS_FILTER_OP_LT, GEIS_FILTER_OP_LT, /**< Compares for less-than. */
GEIS_FILTER_OP_LE GEIS_FILTER_OP_LE /**< Compares for less-tha-or-equal. */
} GeisFilterOperation; } GeisFilterOperation;
/** /**
* Creates a new, empty filter. * Creates a new, empty filter.
* @memberof GeisFilter
* *
* @param[in] geis The GEIS API instance. * @param[in] geis The GEIS API instance.
* @param[in] name A name. * @param[in] name A name.
* *
* @returns a GeisFilter object or NULL on failure. * @returns a GeisFilter object or NULL on failure.
*/ */
GEIS_API GeisFilter geis_filter_new(Geis geis, GeisString name); GEIS_API GeisFilter geis_filter_new(Geis geis, GeisString name);
/** /**
* Creates a new filter by copying an existing filter. * Creates a new filter by copying an existing filter.
* @memberof GeisFilter
* *
* @param[in] original An existing geisFilter instance. * @param[in] original An existing geisFilter instance.
* @param[in] name A name. * @param[in] name A name.
* *
* The original filter remains unchanged.
*
* @returns a GeisFilter object or NULL on failure. * @returns a GeisFilter object or NULL on failure.
*/ */
GEIS_API GeisFilter geis_filter_clone(GeisFilter original, GeisString name) ; GEIS_API GeisFilter geis_filter_clone(GeisFilter original, GeisString name) ;
/** /**
* Destroys a GEIS v2.0 filter object. * Destroys a GeisFilter.
* @memberof GeisFilter
* *
* @param[in] filter The filter. * @param[in] filter The filter.
*/ */
GEIS_API GeisStatus geis_filter_delete(GeisFilter filter); GEIS_API GeisStatus geis_filter_delete(GeisFilter filter);
/** /**
* Gets the name given to the filter when it was created. * Gets the name given to the filter when it was created.
* @memberof GeisFilter
* *
* @param[in] filter The filter. * @param[in] filter The filter.
*/ */
GEIS_API GeisString geis_filter_name(GeisFilter filter); GEIS_API GeisString geis_filter_name(GeisFilter filter);
/** /**
* Adds a term to a filter. * Adds a term to a filter.
* @memberof GeisFilter
* *
* @param[in] filter The filter. * @param[in] filter The filter.
* @param[in] facility The term facility. * @param[in] facility The term facility.
* @param[in] ... A list of zero or more term descriptions. * @param[in] ... A list of zero or more term descriptions.
* *
* A term description is generally a (attr-name, filter-op, value) triple i n * A term description is generally a (attr-name, filter-op, value) triple i n
* which the meaning of the filter-op and value depend on the type of the a ttr. * which the meaning of the filter-op and value depend on the type of the a ttr.
* *
* The term description list must be terminated by a NULL. * The term description list must be terminated by a NULL.
*/ */
GEIS_API GeisStatus geis_filter_add_term(GeisFilter filter, GEIS_API GeisStatus geis_filter_add_term(GeisFilter filter,
GeisFilterFacility facility, GeisFilterFacility facility,
...); ...);
/* @} */ /* @} */
/** /**
* @defgroup geis2_subscription Gesture Subscription (GEIS v2.0) * @defgroup geis_v2_subscription Gesture Subscription
* @ingroup geis_v2
* @{ * @{
*/ */
/**
* @class GeisSubscription
* A gesture recognition subscription.
*/
/** @cond typedef */
typedef struct _GeisSubscription *GeisSubscription; typedef struct _GeisSubscription *GeisSubscription;
/** @endcond */
/** /**
* Flags to refine the behaviour of the gesture subscription. * @enum GeisSubscriptionFlags
*
* These flags are used when creating a new subscription and affect the nat
ure
* of the gestures recognized by the subscription. They may ORed together.
*
* @var GeisSubscriptionFlags::GEIS_SUBSCRIPTION_NONE
* No special subscription processing: this is the default.
*
* @var GeisSubscriptionFlags::GEIS_SUBSCRIPTION_GRAB
* The subscription will "grab" all filtered gestures from subwindows.
*
* @var GeisSubscriptionFlags::GEIS_SUBSCRIPTION_CONT
* The gesture engine will return <em>gesture continuations</em>, in which
the
* class of a recognized gestire may change over the lifetime of the gestur
e.
* If this flag is not set, a new gesture will be identified for each chang
e in
* gesture class.
*/ */
typedef enum _GeisSubscriptionFlags typedef enum GeisSubscriptionFlags
{ {
GEIS_SUBSCRIPTION_NONE = 0x0000, GEIS_SUBSCRIPTION_NONE = 0x0000,
GEIS_SUBSCRIPTION_GRAB = 0x0001, GEIS_SUBSCRIPTION_GRAB = 0x0001,
GEIS_SUBSCRIPTION_CONT = 0x0002 GEIS_SUBSCRIPTION_CONT = 0x0002
} GeisSubscriptionFlags; } GeisSubscriptionFlags;
/** /**
* Creates a new subscription. * Creates a new subscription.
* @memberof GeisSubscription
* *
* @param[in] geis The GEIS API instance. * @param[in] geis The GEIS API instance.
* @param[in] name A name. * @param[in] name A name.
* @param[in] flags Some flags. * @param[in] flags Some flags.
* *
* @returns a GeisSubscription object or NULL on failure. * @returns a GeisSubscription object or NULL on failure.
* *
* A gesture subscription is required for any gesture events to be delivere d * A gesture subscription is required for any gesture events to be delivere d
* from the GEIS API. * from the GEIS API.
*/ */
GEIS_API GeisSubscription geis_subscription_new(Geis geis, GEIS_API GeisSubscription geis_subscription_new(Geis geis,
GeisString name, GeisString name,
GeisSubscriptionFlags flags ); GeisSubscriptionFlags flags );
/** /**
* Destroys a GEIS v2.0 subscription object. * Destroys a GEIS v2.0 subscription object.
* @memberof GeisSubscription
* *
* @param[in] subscription The subscription. * @param[in] subscription The subscription.
*/ */
GEIS_API GeisStatus geis_subscription_delete(GeisSubscription subscription) ; GEIS_API GeisStatus geis_subscription_delete(GeisSubscription subscription) ;
/** /**
* Activates a subscription. * Activates a subscription.
* @memberof GeisSubscription
* *
* @param[in] subscription The subscription. * @param[in] subscription The subscription.
* *
* Puts the subscription into the active state. Gesture events will be * Puts the subscription into the active state. Gesture events will be
* delivered for this subscription. * delivered for this subscription.
*/ */
GEIS_API GeisStatus geis_subscription_activate(GeisSubscription subscriptio n); GEIS_API GeisStatus geis_subscription_activate(GeisSubscription subscriptio n);
/** /**
* Deactivates a subscription. * Deactivates a subscription.
* @memberof GeisSubscription
* *
* @param[in] subscription The subscription. * @param[in] subscription The subscription.
* *
* Puts the subscription into the inactive state. Gesture events will not be * Puts the subscription into the inactive state. Gesture events will not be
* delivered for this subscription. * delivered for this subscription.
*/ */
GEIS_API GeisStatus geis_subscription_deactivate(GeisSubscription subscript ion); GEIS_API GeisStatus geis_subscription_deactivate(GeisSubscription subscript ion);
/** /**
* Gets the name given to a subscription when it was created. * Gets the name given to a subscription when it was created.
* @memberof GeisSubscription
* *
* @param[in] subscription The subscription. * @param[in] subscription The subscription.
*/ */
GEIS_API GeisString geis_subscription_name(GeisSubscription subscription); GEIS_API GeisString geis_subscription_name(GeisSubscription subscription);
/** /**
* Gets the ID assigned to a subscription when it was created. * Gets the ID assigned to a subscription when it was created.
* @memberof GeisSubscription
* *
* @param[in] subscription The subscription. * @param[in] subscription The subscription.
*/ */
GEIS_API GeisInteger geis_subscription_id(GeisSubscription subscription); GEIS_API GeisInteger geis_subscription_id(GeisSubscription subscription);
/** /**
* Adds a filter to a subscription. * Adds a filter to a subscription.
* @memberof GeisSubscription
* *
* @param[in] subscription The subscription. * @param[in] subscription The subscription.
* @param[in] filter The filter to be added to the subscription. * @param[in] filter The filter to be added to the subscription.
* *
* Thye effect of filters are ANDed together so that, for example, a * Thye effect of filters are ANDed together so that, for example, a
* subscription that has a filter for 3-finger gestures and drag gestures w ill * subscription that has a filter for 3-finger gestures and drag gestures w ill
* produce events only for 3-finger drag gestures. * produce events only for 3-finger drag gestures.
* *
* The default is no filters: that is, all possible gesture events will be * The default is no filters: that is, all possible gesture events will be
* reported. * reported.
*/ */
GEIS_API GeisStatus geis_subscription_add_filter(GeisSubscription subscript ion, GEIS_API GeisStatus geis_subscription_add_filter(GeisSubscription subscript ion,
GeisFilter filter); GeisFilter filter);
/** /**
* Gets an named filter from a subscription. * Gets an named filter from a subscription.
* @memberof GeisSubscription
* *
* @param[in] sub The subscription. * @param[in] sub The subscription.
* @param[in] name Names the filter to retrieve. * @param[in] name Names the filter to retrieve.
* *
* Returns the first filter with the given name or NULL if no such named fi lter * Returns the first filter with the given name or NULL if no such named fi lter
* is found. * is found.
*/ */
GEIS_API GeisFilter geis_subscription_filter_by_name(GeisSubscription sub, GEIS_API GeisFilter geis_subscription_filter_by_name(GeisSubscription sub,
GeisString name) ; GeisString name) ;
/** /**
* Removes a filter from a subscription. * Removes a filter from a subscription.
* @memberof GeisSubscription
* *
* @param[in] subscription The subscription. * @param[in] subscription The subscription.
* @param[in] filter The filter to be removed from the subscription. * @param[in] filter The filter to be removed from the subscription.
*/ */
GEIS_API GeisStatus geis_subscription_remove_filter(GeisSubscription subscr iption, GEIS_API GeisStatus geis_subscription_remove_filter(GeisSubscription subscr iption,
GeisFilter filter ); GeisFilter filter );
/* @} */ /* @} */
/** /**
* @defgroup geis2_gesture Gesture Frames (GEIS v2.0) * @defgroup geis_v2_gesture Gesture Frames
* @ingroup geis_v2
* Gesture state information.
*
* Gesture frames, and their associated groups and touches, convey informat
ion
* about the current state of recognized gestures.
*
* @{ * @{
*/ */
/**
* @class GeisGroup
* A collection of gesture frames.
*
* @class GeisGroupSet
* A collection of GeisGroups.
*
* @class GeisTouch
* An instance of a touch.
*
* @class GeisTouchId
* Relates a touch in a frame to a touch object in a set.
*
* @class GeisTouchSet
* A collection of GeisTouch
*
* @class GeisFrame
* A collection of information describing the state of a gesture.
*/
/** @cond typedef */
typedef struct _GeisGroup *GeisGroup; typedef struct _GeisGroup *GeisGroup;
typedef struct _GeisGroupSet *GeisGroupSet; typedef struct _GeisGroupSet *GeisGroupSet;
typedef GeisSize GeisTouchId; typedef GeisSize GeisTouchId;
typedef struct _GeisTouch *GeisTouch; typedef struct _GeisTouch *GeisTouch;
typedef struct _GeisTouchSet *GeisTouchSet; typedef struct _GeisTouchSet *GeisTouchSet;
typedef struct _GeisFrame *GeisFrame; typedef struct _GeisFrame *GeisFrame;
/** @endcond */
/**
* @name Gesture Frame Event Attributes
*
* @par
* A gesture event (GEIS_EVENT_GESTURE_BEGIN, GEIS_EVENT_GESTURE_UPDATE,
* GEIS_EVENT_GESTURE_END) should have two GEIS_ATTR_TYPE_POINTER attribute
s,
* one containing a GeisGroupSet and one containing a GeisTouchSet.
*
* @{
*
* @def GEIS_EVENT_ATTRIBUTE_GROUPSET
* The event attribute containing a pointer to a GeisGroupSet.
*
* @def GEIS_EVENT_ATTRIBUTE_TOUCHSET
* The event attribute containing a pointer to a GeisTouchSet.
*/
#define GEIS_EVENT_ATTRIBUTE_GROUPSET "group set" #define GEIS_EVENT_ATTRIBUTE_GROUPSET "group set"
#define GEIS_EVENT_ATTRIBUTE_TOUCHSET "touch set" #define GEIS_EVENT_ATTRIBUTE_TOUCHSET "touch set"
/* @} */
/**
* @name Touch Attributes
*
* @par
* Each touch has zero or more attributes associated with it. Differing har
dware
* 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 prese
nt.
*
* @{
*
* @def GEIS_TOUCH_ATTRIBUTE_ID
* Identifies the touch.
*
* @def GEIS_TOUCH_ATTRIBUTE_X
* The X coordinate of the touch.
*
* @def GEIS_TOUCH_ATTRIBUTE_Y
* The Y coordinate of the touch.
*/
#define GEIS_TOUCH_ATTRIBUTE_ID "touch id"
#define GEIS_TOUCH_ATTRIBUTE_X "touch x"
#define GEIS_TOUCH_ATTRIBUTE_Y "touch y"
/* @} */
/** /**
* Gets the number of gesture groups in a groupset. * Gets the number of gesture groups in a groupset.
* @memberof GeisGroupSet
* *
* @param[in] groupset The groupset. * @param[in] groupset The groupset.
*/ */
GEIS_API GeisSize geis_groupset_group_count(GeisGroupSet groupset); GEIS_API GeisSize geis_groupset_group_count(GeisGroupSet groupset);
/** /**
* Gets an indicated gesture group from a groupset. * Gets an indicated gesture group from a groupset.
* @memberof GeisGroupSet
* *
* @param[in] groupset The groupset. * @param[in] groupset The groupset.
* @param[in] index Indicates which gesture group to retrieve. * @param[in] index Indicates which gesture group to retrieve.
*/ */
GEIS_API GeisGroup geis_groupset_group(GeisGroupSet groupset, GeisSize inde x); GEIS_API GeisGroup geis_groupset_group(GeisGroupSet groupset, GeisSize inde x);
/** /**
* Gets the identifier of a gesture group. * Gets the identifier of a gesture group.
* @memberof GeisGroup
* *
* @param[in] group The gesture group. * @param[in] group The gesture group.
*/ */
GEIS_API GeisInteger geis_group_id(GeisGroup group); GEIS_API GeisInteger geis_group_id(GeisGroup group);
/** /**
* Gets the number of gesture frames in a gesture group. * Gets the number of gesture frames in a gesture group.
* @memberof GeisGroup
* *
* @param[in] group The gesture group. * @param[in] group The gesture group.
*/ */
GEIS_API GeisSize geis_group_frame_count(GeisGroup group); GEIS_API GeisSize geis_group_frame_count(GeisGroup group);
/** /**
* Gets an indicated gesture frame from a gesture group. * Gets an indicated gesture frame from a gesture group.
* @memberof GeisGroup
* *
* @param[in] group The gesture group. * @param[in] group The gesture group.
* @param[in] index Indicates which gesture frame to retrieve. * @param[in] index Indicates which gesture frame to retrieve.
*/ */
GEIS_API GeisFrame geis_group_frame(GeisGroup group, GeisSize index); GEIS_API GeisFrame geis_group_frame(GeisGroup group, GeisSize index);
/** /**
* Marks a gesture group as rejected. * Marks a gesture group as rejected.
* @memberof GeisGroup
* *
* @param[in] group The gesture group to reject. * @param[in] group The gesture group to reject.
*/ */
GEIS_API void geis_group_reject(GeisGroup group); GEIS_API void geis_group_reject(GeisGroup group);
/** /**
* Gets the number of touches in a touchset. * Gets the number of touches in a touchset.
* @memberof GeisTouchSet
* *
* @param[in] touchset The touchset, * @param[in] touchset The touchset,
*/ */
GEIS_API GeisSize geis_touchset_touch_count(GeisTouchSet touchset); GEIS_API GeisSize geis_touchset_touch_count(GeisTouchSet touchset);
/** /**
* Gets an indicated touch from a touchset. * Gets an indicated touch from a touchset.
* @memberof GeisTouchSet
* *
* @param[in] touchset The touchset. * @param[in] touchset The touchset.
* @param[in] index Indicates which touch to retrieve. * @param[in] index Indicates which touch to retrieve.
*/ */
GEIS_API GeisTouch geis_touchset_touch(GeisTouchSet touchset, GeisSize inde x); GEIS_API GeisTouch geis_touchset_touch(GeisTouchSet touchset, GeisSize inde x);
/** /**
* Gets an identified touch from a touchset. * Gets an identified touch from a touchset.
* @memberof GeisTouchSet
* *
* @param[in] touchset The touchset. * @param[in] touchset The touchset.
* @param[in] touchid Identifies a touch. * @param[in] touchid Identifies a touch.
* *
* Returns the identified touch, or NULL if the touchid is not in the touch set. * Returns the identified touch, or NULL if the touchid is not in the touch set.
*/ */
GEIS_API GeisTouch geis_touchset_touch_by_id(GeisTouchSet touchset, GEIS_API GeisTouch geis_touchset_touch_by_id(GeisTouchSet touchset,
GeisTouchId touchid); GeisTouchId touchid);
/** /**
* Gets the identifier of a touch. * Gets the identifier of a touch.
* @memberof GeisTouch
* *
* @param[in] touch The touch. * @param[in] touch The touch.
*/ */
GEIS_API GeisTouchId geis_touch_id(GeisTouch touch); GEIS_API GeisTouchId geis_touch_id(GeisTouch touch);
/** /**
* Gets the number of attrs associated with a touch. * Gets the number of attrs associated with a touch.
* @memberof GeisTouch
* *
* @param[in] touch The touch. * @param[in] touch The touch.
*/ */
GEIS_API GeisSize geis_touch_attr_count(GeisTouch touch); GEIS_API GeisSize geis_touch_attr_count(GeisTouch touch);
/** /**
* Gets an indicated attr from a touch. * Gets an indicated attr from a touch.
* @memberof GeisTouch
* *
* @param[in] touch The touch. * @param[in] touch The touch.
* @param[in] index Indicates which attr to retrieve. * @param[in] index Indicates which attr to retrieve.
*/ */
GEIS_API GeisAttr geis_touch_attr(GeisTouch touch, GeisSize index); GEIS_API GeisAttr geis_touch_attr(GeisTouch touch, GeisSize index);
/** /**
* Gets a named attr from a touch. * Gets a named attr from a touch.
* @memberof GeisTouch
* *
* @param[in] touch The touch. * @param[in] touch The touch.
* @param[in] name Names the attr to retrieve. * @param[in] name Names the attr to retrieve.
* *
* @returns the named attr if it is present, NULL otherwise. * @returns the named attr if it is present, NULL otherwise.
*/ */
GEIS_API GeisAttr geis_touch_attr_by_name(GeisTouch touch, GeisString name) ; GEIS_API GeisAttr geis_touch_attr_by_name(GeisTouch touch, GeisString name) ;
/** /**
* Gets the identifier of a gesture frame. * Gets the identifier of a gesture frame.
* @memberof GeisFrame
* *
* @param[in] frame the gesture frame. * @param[in] frame the gesture frame.
*/ */
GEIS_API GeisGestureId geis_frame_id(GeisFrame frame); GEIS_API GeisGestureId geis_frame_id(GeisFrame frame);
/** /**
* Indicates if a gesture frame belongs to a gesture class. * Indicates if a gesture frame belongs to a gesture class.
* @memberof GeisFrame
* *
* @param[in] frame The gesture frame. * @param[in] frame The gesture frame.
* @param[in] gesture_class The gesture class. * @param[in] gesture_class The gesture class.
* *
* @returns true if the gesture can currently be classified by the @p * @returns true if the gesture can currently be classified by the @p
* gesture_class, false otherwise. * gesture_class, false otherwise.
*/ */
GEIS_API GeisBoolean geis_frame_is_class(GeisFrame frame, GEIS_API GeisBoolean geis_frame_is_class(GeisFrame frame,
GeisGestureClass gesture_class); GeisGestureClass gesture_class);
/** /**
* Gets the number of attrs associated with a gesture frame. * Gets the number of attrs associated with a gesture frame.
* @memberof GeisFrame
* *
* @param[in] frame The gesture frame. * @param[in] frame The gesture frame.
*/ */
GEIS_API GeisSize geis_frame_attr_count(GeisFrame frame); GEIS_API GeisSize geis_frame_attr_count(GeisFrame frame);
/** /**
* Gets an indicated attr from a gesture frame. * Gets an indicated attr from a gesture frame.
* @memberof GeisFrame
* *
* @param[in] frame The gesture frame. * @param[in] frame The gesture frame.
* @param[in] index Indicates which attr to retrieve. * @param[in] index Indicates which attr to retrieve.
*/ */
GEIS_API GeisAttr geis_frame_attr(GeisFrame frame, GeisSize index); GEIS_API GeisAttr geis_frame_attr(GeisFrame frame, GeisSize index);
/** /**
* Gets a named attr from a gesture frame. * Gets a named attr from a gesture frame.
* @memberof GeisFrame
* *
* @param[in] frame The gesture frame. * @param[in] frame The gesture frame.
* @param[in] name Names the attr to retrieve. * @param[in] name Names the attr to retrieve.
* *
* @returns the named attr if it is present, NULL otherwise. * @returns the named attr if it is present, NULL otherwise.
*/ */
GEIS_API GeisAttr geis_frame_attr_by_name(GeisFrame frame, GeisString name) ; GEIS_API GeisAttr geis_frame_attr_by_name(GeisFrame frame, GeisString name) ;
/** /**
* Gets the current transform matrix of a gesture. * Gets the current transform matrix of a gesture.
* @memberof GeisFrame
* *
* @param[in] frame The gesture frame. * @param[in] frame The gesture frame.
*/ */
GEIS_API GeisFloat *geis_frame_matrix(GeisFrame frame); GEIS_API GeisFloat *geis_frame_matrix(GeisFrame frame);
/** /**
* Gets the number of touches making up a gesture for the frame. * Gets the number of touches making up a gesture for the frame.
* @memberof GeisFrame
* *
* @param[in] frame The gesture frame. * @param[in] frame The gesture frame.
*/ */
GEIS_API GeisSize geis_frame_touchid_count(GeisFrame frame); GEIS_API GeisSize geis_frame_touchid_count(GeisFrame frame);
/** /**
* Gets the ID of the indicated touch within the gesture frame. * Gets the ID of the indicated touch within the gesture frame.
* @memberof GeisFrame
* *
* @param[in] frame The gesture frame. * @param[in] frame The gesture frame.
* @param[in] index Indicates which touch ID to retrieve. * @param[in] index Indicates which touch ID to retrieve.
*/ */
GEIS_API GeisTouchId geis_frame_touchid(GeisFrame frame, GeisSize index); GEIS_API GeisTouchId geis_frame_touchid(GeisFrame frame, GeisSize index);
/** /**
* Marks a gesture as rejected. * Marks a gesture as rejected.
* @memberof GeisFrame
* *
* @param[in] gesture_id Identifies the gesture. * @param[in] gesture_id Identifies the gesture.
*/ */
GEIS_API void geis_gesture_reject(GeisGestureId gestureid); GEIS_API void geis_gesture_reject(GeisGestureId gesture_id);
/* @} */ /* @} */
#ifdef __cplusplus #ifdef __cplusplus
} /* extern "C" */ } /* extern "C" */
#endif #endif
#endif /* GEIS_GEIS_H_ */ #endif /* GEIS_GEIS_H_ */
 End of changes. 167 change blocks. 
268 lines changed or deleted 757 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/