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

## Topics

| Gesture Filter

## Data Structures

class | GeisRegion
| Defines a region over which gestures may take place. More...

## Functions

GeisFilter | geis_filter_new (Geis geis, GeisString name)
| Creates a new, empty filter.
GeisFilter | geis_filter_clone (GeisFilter original, GeisString name)
| Creates a new filter by copying an existing filter.
GeisStatus | geis_filter_delete (GeisFilter filter)
| Destroys a GeisFilter.
GeisString | geis_filter_name (GeisFilter filter)
| Gets the name given to the filter when it was created.
GEIS_VARARG GeisStatus | geis_filter_add_term (GeisFilter filter, GeisFilterFacility facility,...)
| Adds a term to a filter.
GeisSubscription | geis_subscription_new (Geis geis, GeisString name, GeisSubscriptionFlags flags)
| Creates a new subscription.
GeisStatus | geis_subscription_delete (GeisSubscription subscription)
| Destroys a GEIS v2.0 subscription object.
GeisStatus | geis_subscription_activate (GeisSubscription subscription)
| Activates a subscription.
GeisStatus | geis_subscription_deactivate (GeisSubscription subscription)
| Deactivates a subscription.
GeisString | geis_subscription_name (GeisSubscription subscription)
| Gets the name given to a subscription when it was created.
GeisInteger | geis_subscription_id (GeisSubscription subscription)
| Gets the ID assigned to a subscription when it was created.
GeisStatus | geis_subscription_add_filter (GeisSubscription subscription, GeisFilter filter)
| Adds a filter to a subscription.
GeisFilter | geis_subscription_filter_by_name (GeisSubscription sub, GeisString name)
| Gets an named filter from a subscription.
GeisStatus | geis_subscription_remove_filter (GeisSubscription subscription, GeisFilter filter)
| Removes a filter from a subscription.

## 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.
GEIS_VARARG GeisRegion | geis_region_new (Geis geis, GeisString name, GeisString init_arg_name,...)
| Creates a new GEIS v2.0 region.
GeisStatus | geis_region_delete (GeisRegion region)
| Destroys a GEIS v2.0 region.
GeisString | geis_region_name (GeisRegion region)
| Gets the name of a GEIS v2.0 region.
GeisStatus | geis_subscription_get_configuration (GeisSubscription subscription, GeisString config_item_name, GeisPointer config_item_value)
| Gets a subscription-level configuration item.
GeisStatus | geis_subscription_set_configuration (GeisSubscription subscription, GeisString config_item_name, GeisPointer config_item_value)
| Sets a subscription-level configuration item.
| GEIS_SUBSCRIPTION_NONE
| No special subscription processing: this is the default.
| GEIS_SUBSCRIPTION_GRAB
| The subscription will "grab" all filtered gestures from subwindows.
| GEIS_SUBSCRIPTION_CONT
| The gesture engine will return gesture continuations, in which the class of a recognized gestire may change over the lifetime of the gesture.
| GEIS_SUBSCRIPTION_NONE
| No special subscription processing: this is the default.
| GEIS_SUBSCRIPTION_GRAB
| The subscription will "grab" all filtered gestures from subwindows.
| GEIS_SUBSCRIPTION_CONT
| The gesture engine will return gesture continuations, in which the class of a recognized gestire may change over the lifetime of the gesture.
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 | { GEIS_SUBSCRIPTION_NONE , GEIS_SUBSCRIPTION_GRAB , GEIS_SUBSCRIPTION_CONT }
typedef enum _GeisFilterFacility | GeisFilterFacility
| Indicates the type of filter.
typedef enum _GeisFilterOperation | GeisFilterOperation
| Indicates the type of filter operation.
typedef int | GeisSubscriptionFlags

## Detailed Description

## Macro Definition Documentation

## GEIS_REGION_ATTRIBUTE_WINDOWID

#define GEIS_REGION_ATTRIBUTE_WINDOWID

The X11 windowid in which a gesture occurred.

Used for filter matching.

## GEIS_REGION_X11_ROOT

#define GEIS_REGION_X11_ROOT

Selects the X11 root window as a region.

## GEIS_REGION_X11_WINDOWID

#define GEIS_REGION_X11_WINDOWID

Selects an X11 window as a region.

Requires the window_id as an argument.

## Typedef Documentation

## GeisFilterFacility

typedef enum _GeisFilterFacility GeisFilterFacility

Indicates the type of filter.

## GeisFilterOperation

typedef enum _GeisFilterOperation GeisFilterOperation

Indicates the type of filter operation.

## Enumeration Type Documentation

## anonymous enum

anonymous enum

Enumerator
GEIS_SUBSCRIPTION_NONE | No special subscription processing: this is the default.
GEIS_SUBSCRIPTION_GRAB | The subscription will "grab" all filtered gestures from subwindows.
GEIS_SUBSCRIPTION_CONT | The gesture engine will return gesture continuations, in which the class of a recognized gestire may change over the lifetime of the gesture. If this flag is not set, a new gesture will be identified for each change in gesture class.

## _GeisFilterFacility

enum _GeisFilterFacility

Indicates the type of filter.

Enumerator
GEIS_FILTER_DEVICE | Filters on device attributes.
GEIS_FILTER_CLASS | Filters on gesture class and gesture attributes.
GEIS_FILTER_REGION | Filters on region attributes.
GEIS_FILTER_SPECIAL | Filters on special attributes.

## _GeisFilterOperation

enum _GeisFilterOperation

Indicates the type of filter operation.

Enumerator
GEIS_FILTER_OP_EQ | Compares for equality.
GEIS_FILTER_OP_NE | Compares for inequality.
GEIS_FILTER_OP_GT | Compares for greater-than.
GEIS_FILTER_OP_GE | Compares for greater-than-or-equal.
GEIS_FILTER_OP_LT | Compares for less-than.
GEIS_FILTER_OP_LE | Compares for less-tha-or-equal.

## Function Documentation

## geis_filter_add_term()

GEIS_VARARG GeisStatus geis_filter_add_term | ( | GeisFilter | filter,
|  | GeisFilterFacility | facility,
|  |  | ... )

Adds a term to a filter.

Parameters

  [in] | filter | The filter.
  [in] | facility | The term facility.
  [in] | ... | A list of zero or more term descriptions.

A term description is generally a (attr-name, filter-op, value) triple in which the meaning of the filter-op and value depend on the type of the attr.

The term description list must be terminated by a NULL.

In the following example we add terms to filter drag gestures made with three touch points:

geis_filter_add_term(filter,
GEIS_FILTER_CLASS,
GEIS_CLASS_ATTRIBUTE_NAME, GEIS_FILTER_OP_EQ, GEIS_GESTURE_DRAG,
GEIS_GESTURE_ATTRIBUTE_TOUCHES, GEIS_FILTER_OP_EQ, 3,
NULL);
GEIS_CLASS_ATTRIBUTE_NAME
#define GEIS_CLASS_ATTRIBUTE_NAME
The name of the gesture class.
Definition geis.h:1512
GEIS_FILTER_CLASS
@ GEIS_FILTER_CLASS
Filters on gesture class and gesture attributes.
Definition geis.h:1714
GEIS_FILTER_OP_EQ
@ GEIS_FILTER_OP_EQ
Compares for equality.
Definition geis.h:1724
GeisFilter::geis_filter_add_term
GEIS_VARARG GeisStatus geis_filter_add_term(GeisFilter filter, GeisFilterFacility facility,...)
Adds a term to a filter.

Term descriptions are usually ANDed together, so that specifying a class name and a number of touches will filter only for gestures that have both characteristics. But if you specify several class names (e.g. drag and pinch), those classes are ORed together instead. So you can receive events from a gesture that belongs to either drag, drag&pinch or only pinch classes.

## geis_filter_clone()

GeisFilter geis_filter_clone | ( | GeisFilter | original,
|  | GeisString | name )

Creates a new filter by copying an existing filter.

Parameters

  [in] | original | An existing geisFilter instance.
  [in] | name | A name.

The original filter remains unchanged.

Returns
  a GeisFilter object or NULL on failure.

## geis_filter_delete()

GeisStatus geis_filter_delete | ( | GeisFilter | filter | ) |

Destroys a GeisFilter.

Parameters

  [in] | filter | The filter.

## geis_filter_name()

GeisString geis_filter_name | ( | GeisFilter | filter | ) |

Gets the name given to the filter when it was created.

Parameters

  [in] | filter | The filter.

## geis_filter_new()

GeisFilter geis_filter_new | ( | Geis | geis,
|  | GeisString | name )

Creates a new, empty filter.

Parameters

  [in] | geis | The GEIS API instance.
  [in] | name | A name.

Returns
  a GeisFilter object or NULL on failure.

## geis_region_delete()

GeisStatus geis_region_delete | ( | GeisRegion | region | ) |

Destroys a GEIS v2.0 region.

Parameters

  [in] | region | The region.

## geis_region_name()

GeisString geis_region_name | ( | GeisRegion | region | ) |

Gets the name of a GEIS v2.0 region.

Parameters

  [in] | region | The region.

Returns the `name` value used when creating the region.

## geis_region_new()

GEIS_VARARG GeisRegion geis_region_new | ( | Geis | geis,
|  | GeisString | name,
|  | GeisString | init_arg_name,
|  |  | ... )

Creates a new GEIS v2.0 region.

Parameters

  [in] | geis | The GEIS API instance.
  [in] | name | A name. Used for diagnostics.
  [in] | init_arg_name | The name of the first initialization argument.

The initialization argument list must be terminated by a NULL.

Returns
  a newly created region, or NULL on failure.

## geis_subscription_activate()

GeisStatus geis_subscription_activate | ( | GeisSubscription | subscription | ) |

Activates a subscription.

Parameters

  [in] | subscription | The subscription.

Puts the subscription into the active state. Gesture events will be delivered for this subscription.

## geis_subscription_add_filter()

GeisStatus geis_subscription_add_filter | ( | GeisSubscription | subscription,
|  | GeisFilter | filter )

Adds a filter to a subscription.

Parameters

  [in] | subscription | The subscription.
  [in] | filter | The filter to be added to the subscription.

The effect of filters are ORed together so that, for example, a subscription that has a filter for 3-finger drag gestures and another for 2-finger pinch gestures will produce events for both 3-finger drag gestures and 2-finger pinch gestures.

The default is no filters: that is, all possible gesture events will be reported.

The subscription will take ownership of the filter.

## geis_subscription_deactivate()

GeisStatus geis_subscription_deactivate | ( | GeisSubscription | subscription | ) |

Deactivates a subscription.

Parameters

  [in] | subscription | The subscription.

Puts the subscription into the inactive state. Gesture events will not be delivered for this subscription.

## geis_subscription_delete()

GeisStatus geis_subscription_delete | ( | GeisSubscription | subscription | ) |

Destroys a GEIS v2.0 subscription object.

Parameters

  [in] | subscription | The subscription.

## geis_subscription_filter_by_name()

GeisFilter geis_subscription_filter_by_name | ( | GeisSubscription | sub,
|  | GeisString | name )

Gets an named filter from a subscription.

Parameters

  [in] | sub | The subscription.
  [in] | name | Names the filter to retrieve.

Returns the first filter with the given name or NULL if no such named filter is found.

## geis_subscription_get_configuration()

GeisStatus geis_subscription_get_configuration | ( | GeisSubscription | subscription,
|  | GeisString | config_item_name,
|  | GeisPointer | config_item_value )

Gets a subscription-level configuration item.

Parameters

  [in] | subscription | The subscription from which the configuration item will be retrieved.
  [in] | config_item_name | The name of the configuration item.
  [out] | config_item_value | A pointer to an appropriate variable to hold the retrieved config item value.

Not all back ends support all configuration items.

Return values

  GEIS_STATUS_BAD_ARGUMENT | an invalid argument value was passed
  GEIS_STATUS_NOT_SUPPORTED | the configuration value is not supported
  GEIS_STATUS_SUCCESS | normal successful completion

## geis_subscription_id()

GeisInteger geis_subscription_id | ( | GeisSubscription | subscription | ) |

Gets the ID assigned to a subscription when it was created.

Parameters

  [in] | subscription | The subscription.

## geis_subscription_name()

GeisString geis_subscription_name | ( | GeisSubscription | subscription | ) |

Gets the name given to a subscription when it was created.

Parameters

  [in] | subscription | The subscription.

## geis_subscription_new()

GeisSubscription geis_subscription_new | ( | Geis | geis,
|  | GeisString | name,
|  | GeisSubscriptionFlags | flags )

Creates a new subscription.

Parameters

  [in] | geis | The GEIS API instance.
  [in] | name | A name.
  [in] | flags | Some flags.

Returns
  a GeisSubscription object or NULL on failure.

A gesture subscription is required for any gesture events to be delivered from the GEIS API.

## geis_subscription_remove_filter()

GeisStatus geis_subscription_remove_filter | ( | GeisSubscription | subscription,
|  | GeisFilter | filter )

Removes a filter from a subscription.

Parameters

  [in] | subscription | The subscription.
  [in] | filter | The filter to be removed from the subscription.

Ownership of the filter is passed to the caller.

## geis_subscription_set_configuration()

GeisStatus geis_subscription_set_configuration | ( | GeisSubscription | subscription,
|  | GeisString | config_item_name,
|  | GeisPointer | config_item_value )

Sets a subscription-level configuration item.

Parameters

  [in] | subscription | The subscription from which the configuration item will be retrieved.
  [in] | config_item_name | The name of the configuration item.
  [in] | config_item_value | A pointer to an appropriate variable holding the config item value.

Not all back ends support all configuration items.

Return values

  GEIS_STATUS_BAD_ARGUMENT | an invalid argument value was passed
  GEIS_STATUS_NOT_SUPPORTED | the configuration value is not supported
  GEIS_STATUS_SUCCESS | normal successful completion