geis-2.2.17+16.04.20160126/ 0000755 0000156 0000165 00000000000 12651717732 015107 5 ustar pbuser pbgroup 0000000 0000000 geis-2.2.17+16.04.20160126/doc/ 0000755 0000156 0000165 00000000000 12651717732 015654 5 ustar pbuser pbgroup 0000000 0000000 geis-2.2.17+16.04.20160126/doc/geistest.1 0000644 0000156 0000165 00000002234 12651717544 017567 0 ustar pbuser pbgroup 0000000 0000000 .TH geistest 1 "August 16, 2010" "" "geistest"
.SH NAME
geistest \- test operation of the GEIS API
.SH SYNOPSIS
.B geistest [
.B -w
.I windowid
.B ]
.B [
.B -d
.I deviceid
.B ]
.br
.SH DESCRIPTION
This manual page explains the
.B geistest
program. This program is a test driver for verifying the recognition and propagation of gestures through the GEIS API.
Hitting any key on the keyboard will exit the program gracefully.
.SH OPTIONS
.IP -w
Specifies the
.I windowId
of a specific window to associate with gestures.
Particularly useful with touchscreens.
If this argument is not set, the default action is to read gestures on all
windows.
The
.I windowId
can be determined using the program
.BR xwininfo .
.IP -d
Specifies the
.I deviceId
of a specific input device to be tested for multi-touch gestural input.
If this argument is not set, the default action is to listen to multi-touch
input on all devices. This argument may be used more than once to specify
multiple input devices.
The
.I deviceId
can be determined using the program
.BR xinput .
.SH ENVIRONMENT
.IP GEIS_DEBUG
Enables GEIS library diagnostic messages on stderr.
.SH "SEE ALSO"
gesturetest(1)
geis-2.2.17+16.04.20160126/doc/pygeis.1 0000644 0000156 0000165 00000001132 12651717544 017234 0 ustar pbuser pbgroup 0000000 0000000 .TH pygeis 1 "February 12, 2013" "" "pygeis"
.SH NAME
pygeis \- test operation of the GEIS API Python bindings
.SH SYNOPSIS
.B pygeis [
.B \-V
.B ]
.br
.SH DESCRIPTION
This manual page explains the
.B pygeis
program. This program is a test driver for verifying the recognition and
propagation of gestures through the GEIS API Python bindings.
Hitting any key on the keyboard will exit the program gracefully.
.SH OPTIONS
.IP \-V
Prints the version number of the program and exits.
.SH ENVIRONMENT
.IP GEIS_DEBUG
Enables GEIS library diagnostic messages on stderr.
.SH "SEE ALSO"
gesturetest(1)
geis-2.2.17+16.04.20160126/doc/using_geis_v2.dox 0000644 0000156 0000165 00000005050 12651717544 021134 0 ustar pbuser pbgroup 0000000 0000000 /**
@page using_geis_v2 Using The Advanced Interface
@section using_geis_v2_intro Introduction to the Advanced GEIS Interface
The advanced GEIS interface is designed around the idea that you can create
filters to limit the kinds of gestures received and combine those
filters into subscriptions that interact with the gesture
recognizer to deliver gesture events.
The normal flow for using the advanced interface is as follows.
-# create a Geis object
-# create a GeisSubscription object on the Geis object
-# create and add one or more GeisFilter to the GeisSubscription
-# activate the GeisSubscription
-# wait for and process a series of GeisEvent
@subsection using_geis_v2_example An example of advanced API usage
This is an example of using the advanced (GEIS v2) API. The full source code
for this example (including details missing here) is included in the source
distribution of geis.
Please note that these examples omit all of the error checking for expository
purposes only.
@dontinclude geis2.c
First, a function to create the filters for a subscription. the filters can not
be created until the gesture recognition engine initialization is complete,
since otherwise the expected types of the gesture attributes on which to filter
are not known by the interface.
An empty filter is created. An empty filter means all input devices,
all gestures, all regions.
For the purpose of this example, we want just 2-touch gestures, so we need to
add a term to the filter specifying only those gestures with two touches.
@skip target_subscription
@until }
@line }
In the main fucntion, the API instance is created.
We tell it to report input devices and gesture classes.
@skip geis_new
@until NULL
For the event loop processing, we're going to need the event fd (this is
assuming a Unix implementation of GEIS, other platforms may have a different
event indicator).
@line geis_get_configuration
A subscription object is created. We want gesture continuations.
@line geis_subscription_new
The application's main event loop is run until a read is indicated as available
on the event fd, at which point the GEIS event loop is pumped.
@skip geis_dispatch_events
@until geis_next_event
The events are handled and the event loop pumped until it's empty.
@until geis_next_event
Finally, the API objects are cleaned up.
@skip geis_subscription_delete
@until geis_delete
@subsection using_geis_v2_examining_devices Examining Devices
@dontinclude geis2.c
@skip dump_device_event
@until }
@line }
@example geis2.c
*/
geis-2.2.17+16.04.20160126/doc/Makefile.am 0000644 0000156 0000165 00000003020 12651717544 017704 0 ustar pbuser pbgroup 0000000 0000000 ##
## Makefile for the doc subdirectory of libgeis
##
## Copyright (C) 2010 Canonical Ltd.
##
## Process this file with automake to produce Makefile.in.
##
## This file is part of the libgeis project. This library is free
## software; you can redistribute it and/or modify it under the
## terms of version 3 of the GNU General Public License as published
## by the Free Software Foundation.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License along
## with this library; see the file COPYING3. If not see
## .
##
dist_doc_DATA = \
Doxyfile \
geisspec-1.0.asc \
geisspec-docbook.xml
dist_man_MANS = geistest.1 pygeis.1
api/html:
mkdir -p api/html
doc-html: doc-html-doxygen
doc-man: doc-man-doxygen
doc-pdf: doc-pdf-doxygen doc-pdf-asciidoc
doc-html-doxygen:
doxygen
doc-man-doxygen:
doxygen
doc-pdf-doxygen:
doxygen
doc-html-asciidoc: geisspec-1.0.html
doc-pdf-asciidoc: geisspec-1.0.pdf
geisspec-1.0.html: geisspec-1.0.asc geisspec-docbook.xml
a2x -v -f xhtml -a geisspec geisspec-1.0.asc
geisspec-1.0.pdf: geisspec-1.0.asc geisspec-docbook.xml
a2x -v -a geisspec geisspec-1.0.asc
install-data-local: api/html
$(INSTALL) -d $(DESTDIR)$(docdir)
cp -a api/html $(DESTDIR)$(docdir)
clean-local:
-rm -rf *.pdf *.html api
geis-2.2.17+16.04.20160126/doc/geisspec-docbook.xml 0000644 0000156 0000165 00000000774 12651717544 021627 0 ustar pbuser pbgroup 0000000 0000000
2010
Stephen M. Webb
1.0.0
22 July 2010
SMW
First release.
1.0.1
06 August 2010
SMW
Added gesture attribute support functions.
geis-2.2.17+16.04.20160126/doc/geisspec-1.0.asc 0000644 0000156 0000165 00000046265 12651717544 020460 0 ustar pbuser pbgroup 0000000 0000000 Gesture Engine Interface Support
================================
Stephen M. Webb
:Author Initials: SMW
v1.0, 12 August 2010
Overview
--------
This document describes GEIS, an interface between an application and an
underlying gesture recognition system.
A GEIS implementation provides a mechanism for recognizing user interface
gestures on various configurable devices and for propagating those recognized
gestures to subscribed applications.
Gestures
~~~~~~~~
A _gesture_ is a defined set of particular movements of pointing devices. GEIS
provides no interpretation of gestures, only recognition and propagation.
Because gestures can be defined to have global meaning as well as local meaning,
it makes sense that gesture recognition be provided by the system rather than be
included as a library by a particular application or toolkit. This allows, for
example, a set of gestures to be defined for the window manager in use on a
display to receive gesture events even when another application is in the
foreground and receiving the input.
GEIS Operation
--------------
The purpose of GEIS is intended to provide a consistent and stable application
programming interface for gesture recognition and propagation on multiple target
platforms (for example, Linux, Unix, and Windows), multiple target input
devices (for example mice, touch pads, mutitouch touchscreens, tables, nunchuks),
and multiple gesture recognition engines. Different gesture engines may be
available on the same platform.
A number of basic types are defined for portability between various underlying
display, input, and operating systems.
GEIS Basic Types
~~~~~~~~~~~~~~~~~
+GeisBoolean+ is an integral type representing a boolean value and should only
hold the values +GEIS_TRUE+ (1) and +GEIS_FALSE+ (0).
+GeisInt+ is an integral type large enough to hold any integral gesture attribute
value which may be represented on the native platform. This may includes
bitmasks, enumerants, integers, handles, and so forth.
+GeisFloat+ is a floating-point type which can represent floating-point valued
gesture attributes,
+GeisString+ is a C-style zero-terminated string of characters in some character
set. A +GeisString+ is a read-only string and does not have to be freed or
disposed of by the caller.
GEIS Instances
~~~~~~~~~~~~~~
An application may need to support different sets of gestures from different
input devices or associated with different regions of the same device. For this
reason, GEIS provides for one or more distinct connections to the underlying
gesture engine. The instances are distinguished by a GeisInstance object. All
gesture types and gesture instances IDs are in a namespace associated with the
GeisInstance and are not guaranteed to be system wide unique.
Threading and Concurrency
^^^^^^^^^^^^^^^^^^^^^^^^^
The GEIS API does not specify threading, reentrancy, or concurrency attributes.
The implementation must supply detailed documentation on these aspects.
Input Devices
^^^^^^^^^^^^^
The API provides a method to enumerate the available gesture-capable input
devices (including the dynamic appearance and disappearance of such devices) and
a way to specify a subset of these devices for use in a particular gesture
detection instance. A client application might typically respond to gestures
from any input device, but others, such as a drawing application, may wish to
bypass gesture detection on, for example, a drawing tablet while accepting them
from a touchscreen for other functions such as zoom and rotate.
GEIS uses a set of client-supplied callbacks to report the availability of input
devices so that devices that dynamically appear or disappear can be reported
through a consistent interface.
GEIS Functions and Errors
-------------------------
Errors
~~~~~~
NOTE: This section is not complete.
GEIS functions usually return a status code indicating success or failure. The
status codes that may be returned, and their meanings, are as follows.
+GEIS_SUCCESS+::
Normal, successful completion of the function.
+GEIS_BAD_ARGUMENT+::
One or more argument values are invalid. Any command taking parameters may
generate this error.
+GEIS_STATUS_NOT_SUPPORTED+::
An operation or configuration item is not supported by the implementation.
+GEIS_UNKNOWN_ERROR+::
A general catchall error: an error occurred that is not covered by any other
defined status code.
Initialization
~~~~~~~~~~~~~~
NOTE: This section is not complete.
A GEIS instance may be initialized by calling
[source, C]
-----------
GeisStatus geis_init(GeisWinInfo *win_info, GeisInstance *geis_instance);
-----------
+GEIS_SUCCESS+ is returned on success and _geis_instance_ is updated with an
instance value to be used in subsequent GEIS calls.
The definition of the +GeisWinInfo+ fields is entirely dependant on the
implementation. For example, an X11-based gesture recognizer may specify the
_window_id_ as the _win_info_ argument.
Configuration and Control
~~~~~~~~~~~~~~~~~~~~~~~~~
A particular GEIS implementation may support a subset of standard configuarable
items and, in addition, zero or more implementation-specific configuration
items. The implementation-specific configuration items will be documented by
the implementation.
To determine of a confiuration item is supported, use the following call.
[source, C]
-----------
GeisStatus geis_configuration_supported(GeisInstance instance,
int configuration_item);
-----------
This function will return +GEIS_STATUS_SUCCESS+ if the _configuration_item_ is
supported by the implementation, +GEIS_STATUS_NOT_SUPPORTED+ otherwise.
The following standard configuration items must be available.
.Input Standard Configuration Items
[width="60%",cols="<,3d",frame="topbot",options="header"]
|===================
|+configuration item+ | description
|GEIS_CONFIG_UNIX_FD | A posix descriptor for event loop synchronization is available.
|===================
Configuration-specifc values may be set and retrieved using the following calls.
[source,C]
----------
GeisStatus geis_configuration_get_value(GeisInstance instance,
int configuration_item,
void* value);
GeisStatus geis_configuration_set_value(GeisInstance instance,
int configuration_item,
void* value);
----------
The actual type and meaning of the _value_ argument depends on the
_configuration_item_. Standard configuration item types are described in the
following table.
.Input Standard Configuration Item Types
[width="60%",cols="<,<,2d",frame="topbot",options="header"]
|===================
|+configuration item+ | type | description
|GEIS_CONFIG_UNIX_FD | int | A posix file descriptor
|===================
Integration with the native event loop is through an implementation-specific
mechanism (likely obtained through the configuration calls above, but documented
more thoroughly in the implementation documentation) combined with a call to the
GEIS dispatch mechanism.
[source,C]
----------
GeisStatus geis_event_dispatch(geisInstance instance);
----------
Input Devices
~~~~~~~~~~~~~
Gestures are associated with input devices (a gesture must be input on a
device). Client software may subscribe to gestures that occur on all input
devices or on only a subset of input devices. For that to be possible, the
client needs to enumerate all available input devices. In addition, many input
devices have a dynamic lifetime -- they may be added or removed asynchronously.
the client software needs to be made aware that new input devices have become
available or existing devices have become unavailable.
GEIS input device enumeration and availability notification is performed through
the following interface.
[source, C]
-----------
typedef unsigned int GeisInputDeviceId;
#define GEIS_ALL_INPUT_DEVICES ((GeisInputDeviceId)0)
typedef void (*GeisInputCallback)(void *cookie,
GeisInputDeviceId device_id,
void *attrs);
typedef struct GeisInputFuncs
{
GeisInputCallback added; /**< Receives new input device notices */
GeisInputCallback changed; /**< Receives modified input device notices */
GeisInputCallback removed; /**< Receives removes input device notices */
} GeisInputFuncs;
GeisStatus geis_input_devices(GeisInstance geis_instance,
GeisInputFuncs funcs,
void *cookie);
-----------
The API provides a list of available input devices one at a time through the
client-supplied _added_ callback function.
The _changed_ callback function or the _removed_ callback function may be
invoked at any time after *geis_input_devices* is called and before
*geis_finish* is called to tear down the +GeisInstance+ or *geis_input_devices*
is called again to replace the callback function. This can occur when input
devices are, for example, physically connected to or disconnected from the
system.
The _cookie_ value passed to *geis_input_devices* is passed unmodified to
callback function. Client programs may use this for passing context-specific
information into the callback.
The suggested behaviour of an implementation is to invoke the _callback_ for
each input device known at call time _before_ returning from the
*geis_input_devices* call.
Subscribing to Gestures
~~~~~~~~~~~~~~~~~~~~~~~
Gestures are specific to a +GeisInstance+ and set of input devices. The
+GeisInstance+ must be informed of the set of gestures (and input devices) of
interest.
[source, C]
-----------
typedef unsigned int GeisGestureType;
typedef unsigned int GeisGestureId;
#define GEIS_ALL_GESTURES ((GeisGestureType)0)
#define GEIS_NO_GESTURE_ID ((GeisGestureId)0)
typedef void (*GeisGestureCallback)(void *cookie,
GeisGestureType gesture_type,
GeisGestureId gesture_id,
GeisSize attr_count,
GeisGestureAttr *attrs);
typedef struct GeisGestureFuncs
{
GeisGestureCallback added;
GeisGestureCallback removed;
GeisGestureCallback start;
GeisGestureCallback update;
GeisGestureCallback finish;
} GeisGestureFuncs;
GeisStatus geis_subscribe(GeisInstance geis_instance,
GeisInputDeviceId *input_list,
const char* *gesture_list,
GeisGestureFuncs funcs,
void *cookie);
GeisStatus geis_unsubscribe(GeisInstance geis_instance,
GeisGestureType *gesture_list);
-----------
The client supplies a list of input devices (or the constant
+GEIS_ALL_INPUT_DEVICES+) and a +NULL+ terminated list of C-style strings naming
the gestures to be recognized. The constant +GEIS_ALL_GESTURES+ indicates all
available gestures should be detected.
GEIS provides a list of gestures available in the desired window and input
device(s) one at a time through the client-supplied _added_ callback function
with the +GEIS_GESTURE_TYPE_ADDED+ action. This allows the client to build a
map of gesture names to +GeisGestureType+. If the recognition engine does not
support a named gesture type passed to *geis_subscribe* then no
+GeisGestureType+ is passed to the callback function for the named gesture.
The _cookie_ value passed to *geis_subscribe* is passed unmodified to
_callback_. Client programs may use this for passing context-specific
information into the callback.
Receiving Gestures
~~~~~~~~~~~~~~~~~~
One of the gesture event callback functions may be invoked at any time after
*geis_input_devices* is called and before *geis_finish* is called to tear down
the +GeisInstance+ or *geis_input_devices* is called again to replace the
_callback_ function. This can occur when input devices are, for example,
physically connected to or disconnected from the system.
Most gestures will result in a _start_ callback, zero or more _update_
callbacks, and a _finish_ callback. Some gestures such as _tap_ gestures may
result in only a single _update_ callback. This behaviour is dependent on the
underlying gesture recognition engine
Once a gesture is recognized, a +GEIS_GESTURE_STARTED+ action is sent. A set of
zero or more attributes will be returned. These attributes are specific to the
gesture. Depending on the nature of the gesture, one or more
+GEIS_GESTURE_UPDATED+ actions may be sent, and finally a
+GEIS_GESTURE_FINISHED+ action will be sent. Each of these may or may not have
a set of attributes associated.
A gesture or gesture type action is often associated with a set of attributes.
These attributes are delivered to the callback function as a read-only array of
_GeisGestureAttr_ type, defined below.
[source, C]
-----------
typedef struct GeisGestureAttr
{
GeisString name;
GeisAttrType type;
union
{
GeisBoolean boolean_val;
GeisFloat float_val;
GeisInteger integer_val;
GeisString string_val;
};
} GeisGestureAttr;
-----------
Recognizer Teardown
~~~~~~~~~~~~~~~~~~~
Teardown of the gesture recognition session is accomplished by the *geis_finish*
function.
[source, C]
-----------
GeisStatus geis_finish(GeisInstance *geis_instance);
----------
This function frees any allocated resources associated with _geis_instance_. It
does not affect other instances.
All resources are expected to be freed automatically on process termination.
The *geis_finish* function is not expected to return any status value other than
+GEIS_SUCCESS+.
Standard Gestures
-----------------
A limited number of fundamental gestures are expected to be supplied with the
API. All implementations are expected to support at least this set of
predefined gestures. Additional predefined gestures and user- or
application-defined gestures are beyond the scope of this specification but are
expected to be made available by the implementation.
.Predefined Gestures
[width="60%",cols="<,2d,2d",frame="topbot",options="header"]
|========================================================
|gesture name |symbolic name |description
| Drag | GEIS_GESTURE_DRAG |
| Pinch | GEIS_GESTURE_PINCH |
| Rotate | GEIS_GESTURE_ROTATE |
| Tap | GEIS_GESTURE_TAP |
|=========================================================
Common Attributes
~~~~~~~~~~~~~~~~~~~
All standard gestures provide a common set of attributes.
.Common Gesture Attributes
[width="60%",cols="3<,m,d",frame="topbot",options="header"]
|=========================================================
|name |type |description
| GEIS_GESTURE_ATTRIBUTE_DEVICE_ID | GeisInteger |
| GEIS_GESTURE_ATTRIBUTE_TIMESTAMP | GeisInteger |
| GEIS_GESTURE_ATTRIBUTE_ROOT_WINDOW_ID | GeisInteger |
| GEIS_GESTURE_ATTRIBUTE_EVENT_WINDOW_ID | GeisInteger |
| GEIS_GESTURE_ATTRIBUTE_CHILD_WINDOW_ID | GeisInteger |
| GEIS_GESTURE_ATTRIBUTE_FOCUS_X | GeisFloat |
| GEIS_GESTURE_ATTRIBUTE_FOCUS_Y | GeisFloat |
| GEIS_GESTURE_ATTRIBUTE_GESTURE_NAME | GeisString |
| GEIS_GESTURE_ATTRIBUTE_FINGERS | GeisInteger |
|=========================================================
Drag
~~~~
NOTE: This section is not complete.
.Pan Gesture Attributes
[width="60%",cols="3<,m,d",frame="topbot",options="header"]
|=========================================================
|name |type |description
| GEIS_GESTURE_ATTRIBUTE_DELTA_X | GeisFloat |
| GEIS_GESTURE_ATTRIBUTE_DELTA_Y | GeisFloat |
| GEIS_GESTURE_ATTRIBUTE_VELOCITY_X | GeisFloat |
| GEIS_GESTURE_ATTRIBUTE_VELOCITY_Y | GeisFloat |
| GEIS_GESTURE_ATTRIBUTE_POSITION_X | GeisFloat |
| GEIS_GESTURE_ATTRIBUTE_POSITION_Y | GeisFloat |
|=========================================================
Pinch
~~~~~
NOTE: This section is not complete.
. Pinch Gesture Attributes
[width="60%",cols="3<,m,d",frame="topbot",options="header"]
|=========================================================
|name |type |description
| GEIS_GESTURE_ATTRIBUTE_RADIUS_DELTA | GeisFloat |
| GEIS_GESTURE_ATTRIBUTE_RADIAL_VELOCITY | GeisFloat |
| GEIS_GESTURE_ATTRIBUTE_RADIUS | GeisFloat |
| GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_X1 | GeisFloat |
| GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_Y1 | GeisFloat |
| GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_X2 | GeisFloat |
| GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_Y2 | GeisFloat |
|=========================================================
Rotate
~~~~~~
NOTE: This section is not complete.
. Swipe Gesture Attributes
[width="60%",cols="3<,m,d",frame="topbot",options="header"]
|=========================================================
|name |type |description
| GEIS_GESTURE_ATTRIBUTE_ANGLE_DELTA | GeisFloat |
| GEIS_GESTURE_ATTRIBUTE_ANGULAR_VELOCITY | GeisFloat |
| GEIS_GESTURE_ATTRIBUTE_ANGLE | GeisFloat |
|=========================================================
Tap
~~~
NOTE: This section is not complete.
.Tap Gesture Attributes
[width="60%",cols="3<,m,d",frame="topbot",options="header"]
|=========================================================
|name |type |description
| GEIS_GESTURE_ATTRIBUTE_POSITION_X | GeisFloat |
| GEIS_GESTURE_ATTRIBUTE_POSITION_Y | GeisFloat |
|=========================================================
GEIS Versioning, Header Files, and Constants
--------------------------------------------
Each published version of GEIS supports the specified client API of that
version and all prior versions of those APIs (backwards compatibility).
Header Files
~~~~~~~~~~~~
The GEIS specification defines an ISO C language binding. The GEIS header file
++ provides prototypes for all GEIS entry points and C preprocessors
for all GEIS tokens, for use both by client code and implementers.
Languages other than C and C++ will define GEIS interfaces using other methods
outside the scope of this specification.
Compile-time Version Detection
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To allow code to be written portably against future GEIS versions, the
compile-time environment must make it possible to determine which GEIS version
interface are available. For C and C++ code the ++ header defined C
preprocessor symbols corresponding to all versions of GEIS supported by the
implementation.
[source, C]
-----------
#define GEIS_VERSION_1_0 1
-----------
Future versions of GEIS will define additional preprocessor symbols
corresponding to the major and minor numbers of those versions.
Constants and Implementation-Supplied Values
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Constants and enumerator values for GEIS tokens defined in this specification are
required to be common across all implementations. A reference version of the
+geis.h+ header file can be downloaded from *to be determined*.
All implementation-specific types, values, and macros used in +geis.h+ are
partitioned into an implementation header, +geisimpl.h+, which is automatically6
included by +geis.h+. Implementers should need only modify +geisimpl.h+, never
+geis.h+.
Conformance Testing for Implementers
------------------------------------
NOTE: This section is not complete.
geis-2.2.17+16.04.20160126/doc/Doxyfile 0000644 0000156 0000165 00000221505 12651717544 017370 0 ustar pbuser pbgroup 0000000 0000000 # Doxyfile 1.7.4
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project
#
# All text after a hash (#) is considered a comment and will be ignored
# The format is:
# TAG = value [value, ...]
# For lists items can also be appended using:
# TAG += value [value, ...]
# Values that contain spaces should be placed between quotes (" ")
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
# This tag specifies the encoding used for all characters in the config file
# that follow. The default is UTF-8 which is also the encoding used for all
# text before the first occurrence of this tag. Doxygen uses libiconv (or the
# iconv built into libc) for the transcoding. See
# http://www.gnu.org/software/libiconv for the list of possible encodings.
DOXYFILE_ENCODING = UTF-8
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.
PROJECT_NAME = GEIS
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = 2.0
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer
# a quick idea about the purpose of the project. Keep the description short.
PROJECT_BRIEF = "Gesture Engine Interface Support"
# With the PROJECT_LOGO tag one can specify an logo or icon that is
# included in the documentation. The maximum height of the logo should not
# exceed 55 pixels and the maximum width should not exceed 200 pixels.
# Doxygen will copy the logo to the output directory.
PROJECT_LOGO = ../data/logo_x64.png
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
# If a relative path is entered, it will be relative to the location
# where doxygen was started. If left blank the current directory will be used.
OUTPUT_DIRECTORY = api
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
# 4096 sub-directories (in 2 levels) under the output directory of each output
# format and will distribute the generated files over these directories.
# Enabling this option can be useful when feeding doxygen a huge amount of
# source files, where putting all generated files in the same directory would
# otherwise cause performance problems for the file system.
CREATE_SUBDIRS = NO
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
# documentation generated by doxygen is written. Doxygen will use this
# information to generate all constant output in the proper language.
# The default language is English, other supported languages are:
# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak,
# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
OUTPUT_LANGUAGE = English
# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
# include brief member descriptions after the members that are listed in
# the file and class documentation (similar to JavaDoc).
# Set to NO to disable this.
BRIEF_MEMBER_DESC = YES
# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
# the brief description of a member or function before the detailed description.
# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
# brief descriptions will be completely suppressed.
REPEAT_BRIEF = YES
# This tag implements a quasi-intelligent brief description abbreviator
# that is used to form the text in various listings. Each string
# in this list, if found as the leading text of the brief description, will be
# stripped from the text and the result after processing the whole list, is
# used as the annotated text. Otherwise, the brief description is used as-is.
# If left blank, the following values are used ("$name" is automatically
# replaced with the name of the entity): "The $name class" "The $name widget"
# "The $name file" "is" "provides" "specifies" "contains"
# "represents" "a" "an" "the"
ABBREVIATE_BRIEF = "The $name class" \
"The $name widget" \
"The $name file" \
is \
provides \
specifies \
contains \
represents \
a \
an \
the
# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
# Doxygen will generate a detailed section even if there is only a brief
# description.
ALWAYS_DETAILED_SEC = YES
# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
# inherited members of a class in the documentation of that class as if those
# members were ordinary class members. Constructors, destructors and assignment
# operators of the base classes will not be shown.
INLINE_INHERITED_MEMB = NO
# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
# path before files name in the file list and in the header files. If set
# to NO the shortest path that makes the file name unique will be used.
FULL_PATH_NAMES = YES
# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
# can be used to strip a user-defined part of the path. Stripping is
# only done if one of the specified strings matches the left-hand part of
# the path. The tag can be used to show relative paths in the file list.
# If left blank the directory from which doxygen is run is used as the
# path to strip.
STRIP_FROM_PATH =
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
# the path mentioned in the documentation of a class, which tells
# the reader which header file to include in order to use a class.
# If left blank only the name of the header file containing the class
# definition is used. Otherwise one should specify the include paths that
# are normally passed to the compiler using the -I flag.
STRIP_FROM_INC_PATH =
# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
# (but less readable) file names. This can be useful if your file system
# doesn't support long names like on DOS, Mac, or CD-ROM.
SHORT_NAMES = NO
# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
# will interpret the first line (until the first dot) of a JavaDoc-style
# comment as the brief description. If set to NO, the JavaDoc
# comments will behave just like regular Qt-style comments
# (thus requiring an explicit @brief command for a brief description.)
JAVADOC_AUTOBRIEF = YES
# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
# interpret the first line (until the first dot) of a Qt-style
# comment as the brief description. If set to NO, the comments
# will behave just like regular Qt-style comments (thus requiring
# an explicit \brief command for a brief description.)
QT_AUTOBRIEF = NO
# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
# treat a multi-line C++ special comment block (i.e. a block of //! or ///
# comments) as a brief description. This used to be the default behaviour.
# The new default is to treat a multi-line C++ comment block as a detailed
# description. Set this tag to YES if you prefer the old behaviour instead.
MULTILINE_CPP_IS_BRIEF = NO
# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
# member inherits the documentation from any documented member that it
# re-implements.
INHERIT_DOCS = YES
# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
# a new page for each member. If set to NO, the documentation of a member will
# be part of the file/class/namespace that contains it.
SEPARATE_MEMBER_PAGES = NO
# The TAB_SIZE tag can be used to set the number of spaces in a tab.
# Doxygen uses this value to replace tabs by spaces in code fragments.
TAB_SIZE = 8
# This tag can be used to specify a number of aliases that acts
# as commands in the documentation. An alias has the form "name=value".
# For example adding "sideeffect=\par Side Effects:\n" will allow you to
# put the command \sideeffect (or @sideeffect) in the documentation, which
# will result in a user-defined paragraph with heading "Side Effects:".
# You can put \n's in the value part of an alias to insert newlines.
ALIASES =
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
# sources only. Doxygen will then generate output that is more tailored for C.
# For instance, some of the names that are used will be different. The list
# of all members will be omitted, etc.
OPTIMIZE_OUTPUT_FOR_C = YES
# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
# sources only. Doxygen will then generate output that is more tailored for
# Java. For instance, namespaces will be presented as packages, qualified
# scopes will look different, etc.
OPTIMIZE_OUTPUT_JAVA = NO
# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
# sources only. Doxygen will then generate output that is more tailored for
# Fortran.
OPTIMIZE_FOR_FORTRAN = NO
# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
# sources. Doxygen will then generate output that is tailored for
# VHDL.
OPTIMIZE_OUTPUT_VHDL = NO
# Doxygen selects the parser to use depending on the extension of the files it
# parses. With this tag you can assign which parser to use for a given extension.
# Doxygen has a built-in mapping, but you can override or extend it using this
# tag. The format is ext=language, where ext is a file extension, and language
# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
EXTENSION_MAPPING =
# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
# to include (a tag file for) the STL sources as input, then you should
# set this tag to YES in order to let doxygen match functions declarations and
# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
# func(std::string) {}). This also makes the inheritance and collaboration
# diagrams that involve STL classes more complete and accurate.
BUILTIN_STL_SUPPORT = NO
# If you use Microsoft's C++/CLI language, you should set this option to YES to
# enable parsing support.
CPP_CLI_SUPPORT = NO
# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
# Doxygen will parse them like normal C++ but will assume all classes use public
# instead of private inheritance when no explicit protection keyword is present.
SIP_SUPPORT = NO
# For Microsoft's IDL there are propget and propput attributes to indicate getter
# and setter methods for a property. Setting this option to YES (the default)
# will make doxygen replace the get and set methods by a property in the
# documentation. This will only work if the methods are indeed getting or
# setting a simple type. If this is not the case, or you want to show the
# methods anyway, you should set this option to NO.
IDL_PROPERTY_SUPPORT = YES
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
# tag is set to YES, then doxygen will reuse the documentation of the first
# member in the group (if any) for the other members of the group. By default
# all members of a group must be documented explicitly.
DISTRIBUTE_GROUP_DOC = NO
# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
# the same type (for instance a group of public functions) to be put as a
# subgroup of that type (e.g. under the Public Functions section). Set it to
# NO to prevent subgrouping. Alternatively, this can be done per class using
# the \nosubgrouping command.
SUBGROUPING = YES
# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
# unions are shown inside the group in which they are included (e.g. using
# @ingroup) instead of on a separate page (for HTML and Man pages) or
# section (for LaTeX and RTF).
INLINE_GROUPED_CLASSES = NO
# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
# is documented as struct, union, or enum with the name of the typedef. So
# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
# with name TypeT. When disabled the typedef will appear as a member of a file,
# namespace, or class. And the struct will be named TypeS. This can typically
# be useful for C code in case the coding convention dictates that all compound
# types are typedef'ed and only the typedef is referenced, never the tag name.
TYPEDEF_HIDES_STRUCT = NO
# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
# determine which symbols to keep in memory and which to flush to disk.
# When the cache is full, less often used symbols will be written to disk.
# For small to medium size projects (<1000 input files) the default value is
# probably good enough. For larger projects a too small cache size can cause
# doxygen to be busy swapping symbols to and from disk most of the time
# causing a significant performance penalty.
# If the system has enough physical memory increasing the cache will improve the
# performance by keeping more symbols in memory. Note that the value works on
# a logarithmic scale so increasing the size by one will roughly double the
# memory usage. The cache size is given by this formula:
# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
# corresponding to a cache size of 2^16 = 65536 symbols
SYMBOL_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
# documentation are documented, even if no documentation was available.
# Private class members and static file members will be hidden unless
# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
EXTRACT_ALL = NO
# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
# will be included in the documentation.
EXTRACT_PRIVATE = NO
# If the EXTRACT_STATIC tag is set to YES all static members of a file
# will be included in the documentation.
EXTRACT_STATIC = NO
# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
# defined locally in source files will be included in the documentation.
# If set to NO only classes defined in header files are included.
EXTRACT_LOCAL_CLASSES = YES
# This flag is only useful for Objective-C code. When set to YES local
# methods, which are defined in the implementation section but not in
# the interface are included in the documentation.
# If set to NO (the default) only methods in the interface are included.
EXTRACT_LOCAL_METHODS = NO
# If this flag is set to YES, the members of anonymous namespaces will be
# extracted and appear in the documentation as a namespace called
# 'anonymous_namespace{file}', where file will be replaced with the base
# name of the file that contains the anonymous namespace. By default
# anonymous namespaces are hidden.
EXTRACT_ANON_NSPACES = NO
# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
# undocumented members of documented classes, files or namespaces.
# If set to NO (the default) these members will be included in the
# various overviews, but no documentation section is generated.
# This option has no effect if EXTRACT_ALL is enabled.
HIDE_UNDOC_MEMBERS = NO
# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
# undocumented classes that are normally visible in the class hierarchy.
# If set to NO (the default) these classes will be included in the various
# overviews. This option has no effect if EXTRACT_ALL is enabled.
HIDE_UNDOC_CLASSES = NO
# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
# friend (class|struct|union) declarations.
# If set to NO (the default) these declarations will be included in the
# documentation.
HIDE_FRIEND_COMPOUNDS = NO
# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
# documentation blocks found inside the body of a function.
# If set to NO (the default) these blocks will be appended to the
# function's detailed documentation block.
HIDE_IN_BODY_DOCS = NO
# The INTERNAL_DOCS tag determines if documentation
# that is typed after a \internal command is included. If the tag is set
# to NO (the default) then the documentation will be excluded.
# Set it to YES to include the internal documentation.
INTERNAL_DOCS = NO
# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
# file names in lower-case letters. If set to YES upper-case letters are also
# allowed. This is useful if you have classes or files whose names only differ
# in case and if your file system supports case sensitive file names. Windows
# and Mac users are advised to set this option to NO.
CASE_SENSE_NAMES = NO
# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
# will show members with their full class and namespace scopes in the
# documentation. If set to YES the scope will be hidden.
HIDE_SCOPE_NAMES = YES
# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
# will put a list of the files that are included by a file in the documentation
# of that file.
SHOW_INCLUDE_FILES = YES
# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
# will list include files with double quotes in the documentation
# rather than with sharp brackets.
FORCE_LOCAL_INCLUDES = NO
# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
# is inserted in the documentation for inline members.
INLINE_INFO = YES
# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
# will sort the (detailed) documentation of file and class members
# alphabetically by member name. If set to NO the members will appear in
# declaration order.
SORT_MEMBER_DOCS = YES
# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
# brief documentation of file, namespace and class members alphabetically
# by member name. If set to NO (the default) the members will appear in
# declaration order.
SORT_BRIEF_DOCS = NO
# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
# will sort the (brief and detailed) documentation of class members so that
# constructors and destructors are listed first. If set to NO (the default)
# the constructors will appear in the respective orders defined by
# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
SORT_MEMBERS_CTORS_1ST = NO
# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
# hierarchy of group names into alphabetical order. If set to NO (the default)
# the group names will appear in their defined order.
SORT_GROUP_NAMES = NO
# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
# sorted by fully-qualified names, including namespaces. If set to
# NO (the default), the class list will be sorted only by class name,
# not including the namespace part.
# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
# Note: This option applies only to the class list, not to the
# alphabetical list.
SORT_BY_SCOPE_NAME = NO
# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
# do proper type resolution of all parameters of a function it will reject a
# match between the prototype and the implementation of a member function even
# if there is only one candidate or it is obvious which candidate to choose
# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
# will still accept a match between prototype and implementation in such cases.
STRICT_PROTO_MATCHING = NO
# The GENERATE_TODOLIST tag can be used to enable (YES) or
# disable (NO) the todo list. This list is created by putting \todo
# commands in the documentation.
GENERATE_TODOLIST = YES
# The GENERATE_TESTLIST tag can be used to enable (YES) or
# disable (NO) the test list. This list is created by putting \test
# commands in the documentation.
GENERATE_TESTLIST = YES
# The GENERATE_BUGLIST tag can be used to enable (YES) or
# disable (NO) the bug list. This list is created by putting \bug
# commands in the documentation.
GENERATE_BUGLIST = YES
# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
# disable (NO) the deprecated list. This list is created by putting
# \deprecated commands in the documentation.
GENERATE_DEPRECATEDLIST= YES
# The ENABLED_SECTIONS tag can be used to enable conditional
# documentation sections, marked by \if sectionname ... \endif.
ENABLED_SECTIONS =
# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
# the initial value of a variable or macro consists of for it to appear in
# the documentation. If the initializer consists of more lines than specified
# here it will be hidden. Use a value of 0 to hide initializers completely.
# The appearance of the initializer of individual variables and macros in the
# documentation can be controlled using \showinitializer or \hideinitializer
# command in the documentation regardless of this setting.
MAX_INITIALIZER_LINES = 0
# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
# at the bottom of the documentation of classes and structs. If set to YES the
# list will mention the files that were used to generate the documentation.
SHOW_USED_FILES = YES
# If the sources in your project are distributed over multiple directories
# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
# in the documentation. The default is NO.
SHOW_DIRECTORIES = NO
# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
# This will remove the Files entry from the Quick Index and from the
# Folder Tree View (if specified). The default is YES.
SHOW_FILES = YES
# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
# Namespaces page. This will remove the Namespaces entry from the Quick Index
# and from the Folder Tree View (if specified). The default is YES.
SHOW_NAMESPACES = YES
# The FILE_VERSION_FILTER tag can be used to specify a program or script that
# doxygen should invoke to get the current version for each file (typically from
# the version control system). Doxygen will invoke the program by executing (via
# popen()) the command , where is the value of
# the FILE_VERSION_FILTER tag, and is the name of an input file
# provided by doxygen. Whatever the program writes to standard output
# is used as the file version. See the manual for examples.
FILE_VERSION_FILTER =
# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
# by doxygen. The layout file controls the global structure of the generated
# output files in an output format independent way. The create the layout file
# that represents doxygen's defaults, run doxygen with the -l option.
# You can optionally specify a file name after the option, if omitted
# DoxygenLayout.xml will be used as the name of the layout file.
LAYOUT_FILE =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
# The QUIET tag can be used to turn on/off the messages that are generated
# by doxygen. Possible values are YES and NO. If left blank NO is used.
QUIET = NO
# The WARNINGS tag can be used to turn on/off the warning messages that are
# generated by doxygen. Possible values are YES and NO. If left blank
# NO is used.
WARNINGS = YES
# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
# automatically be disabled.
WARN_IF_UNDOCUMENTED = YES
# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
# potential errors in the documentation, such as not documenting some
# parameters in a documented function, or documenting parameters that
# don't exist or using markup commands wrongly.
WARN_IF_DOC_ERROR = YES
# The WARN_NO_PARAMDOC option can be enabled to get warnings for
# functions that are documented, but have no documentation for their parameters
# or return value. If set to NO (the default) doxygen will only warn about
# wrong or incomplete parameter documentation, but not about the absence of
# documentation.
WARN_NO_PARAMDOC = NO
# The WARN_FORMAT tag determines the format of the warning messages that
# doxygen can produce. The string should contain the $file, $line, and $text
# tags, which will be replaced by the file and line number from which the
# warning originated and the warning text. Optionally the format may contain
# $version, which will be replaced by the version of the file (if it could
# be obtained via FILE_VERSION_FILTER)
WARN_FORMAT = "$file:$line: $text"
# The WARN_LOGFILE tag can be used to specify a file to which warning
# and error messages should be written. If left blank the output is written
# to stderr.
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
# The INPUT tag can be used to specify the files and/or directories that contain
# documented source files. You may enter file names like "myfile.cpp" or
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = ../include \
../doc
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
# also the default input encoding. Doxygen uses libiconv (or the iconv built
# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
# the list of possible encodings.
INPUT_ENCODING = UTF-8
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
# and *.h) to filter out the source-files in the directories. If left
# blank the following patterns are tested:
# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
# *.f90 *.f *.for *.vhd *.vhdl
FILE_PATTERNS = *.c \
*.cc \
*.cxx \
*.cpp \
*.c++ \
*.d \
*.java \
*.ii \
*.ixx \
*.ipp \
*.i++ \
*.inl \
*.h \
*.hh \
*.hxx \
*.hpp \
*.h++ \
*.idl \
*.odl \
*.cs \
*.php \
*.php3 \
*.inc \
*.m \
*.mm \
*.dox \
*.py \
*.f90 \
*.f \
*.vhd \
*.vhdl \
*.dox
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
# should be searched for input files as well. Possible values are YES and NO.
# If left blank NO is used.
RECURSIVE = YES
# The EXCLUDE tag can be used to specify files and/or directories that should
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
EXCLUDE =
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
# from the input.
EXCLUDE_SYMLINKS = NO
# If the value of the INPUT tag contains directories, you can use the
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
# certain files from those directories. Note that the wildcards are matched
# against the file with absolute path, so to exclude all test directories
# for example use the pattern */test/*
EXCLUDE_PATTERNS =
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
# output. The symbol name can be a fully qualified name, a word, or if the
# wildcard * is used, a substring. Examples: ANamespace, AClass,
# AClass::ANamespace, ANamespace::*Test
EXCLUDE_SYMBOLS =
# The EXAMPLE_PATH tag can be used to specify one or more files or
# directories that contain example code fragments that are included (see
# the \include command).
EXAMPLE_PATH = ../examples
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
# and *.h) to filter out the source-files in the directories. If left
# blank all files are included.
EXAMPLE_PATTERNS = *
# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
# searched for input files to be used with the \include or \dontinclude
# commands irrespective of the value of the RECURSIVE tag.
# Possible values are YES and NO. If left blank NO is used.
EXAMPLE_RECURSIVE = NO
# The IMAGE_PATH tag can be used to specify one or more files or
# directories that contain image that are included in the documentation (see
# the \image command).
IMAGE_PATH =
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
# by executing (via popen()) the command , where
# is the value of the INPUT_FILTER tag, and is the name of an
# input file. Doxygen will then use the output that the filter program writes
# to standard output. If FILTER_PATTERNS is specified, this tag will be
# ignored.
INPUT_FILTER =
# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
# basis. Doxygen will compare the file name with each pattern and apply the
# filter if there is a match. The filters are a list of the form:
# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
# info on how filters are used. If FILTER_PATTERNS is empty or if
# non of the patterns match the file name, INPUT_FILTER is applied.
FILTER_PATTERNS =
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
# INPUT_FILTER) will be used to filter the input files when producing source
# files to browse (i.e. when SOURCE_BROWSER is set to YES).
FILTER_SOURCE_FILES = NO
# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
# and it is also possible to disable source filtering for a specific pattern
# using *.ext= (so without naming a filter). This option only has effect when
# FILTER_SOURCE_FILES is enabled.
FILTER_SOURCE_PATTERNS =
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
# If the SOURCE_BROWSER tag is set to YES then a list of source files will
# be generated. Documented entities will be cross-referenced with these sources.
# Note: To get rid of all source code in the generated output, make sure also
# VERBATIM_HEADERS is set to NO.
SOURCE_BROWSER = NO
# Setting the INLINE_SOURCES tag to YES will include the body
# of functions and classes directly in the documentation.
INLINE_SOURCES = NO
# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
# doxygen to hide any special comment blocks from generated source code
# fragments. Normal C and C++ comments will always remain visible.
STRIP_CODE_COMMENTS = YES
# If the REFERENCED_BY_RELATION tag is set to YES
# then for each documented function all documented
# functions referencing it will be listed.
REFERENCED_BY_RELATION = NO
# If the REFERENCES_RELATION tag is set to YES
# then for each documented function all documented entities
# called/used by that function will be listed.
REFERENCES_RELATION = NO
# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
# link to the source code. Otherwise they will link to the documentation.
REFERENCES_LINK_SOURCE = YES
# If the USE_HTAGS tag is set to YES then the references to source code
# will point to the HTML generated by the htags(1) tool instead of doxygen
# built-in source browser. The htags tool is part of GNU's global source
# tagging system (see http://www.gnu.org/software/global/global.html). You
# will need version 4.8.6 or higher.
USE_HTAGS = NO
# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
# will generate a verbatim copy of the header file for each class for
# which an include is specified. Set to NO to disable this.
VERBATIM_HEADERS = NO
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
# of all compounds will be generated. Enable this if the project
# contains a lot of classes, structs, unions or interfaces.
ALPHABETICAL_INDEX = YES
# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
# in which this list will be split (can be a number in the range [1..20])
COLS_IN_ALPHA_INDEX = 5
# In case all classes in a project start with a common prefix, all
# classes will be put under the same header in the alphabetical index.
# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
# should be ignored while generating the index headers.
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
# generate HTML output.
GENERATE_HTML = YES
# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `html' will be used as the default path.
HTML_OUTPUT = html
# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
# doxygen will generate files with .html extension.
HTML_FILE_EXTENSION = .html
# The HTML_HEADER tag can be used to specify a personal HTML header for
# each generated HTML page. If it is left blank doxygen will generate a
# standard header. Note that when using a custom header you are responsible
# for the proper inclusion of any scripts and style sheets that doxygen
# needs, which is dependent on the configuration options used.
# It is adviced to generate a default header using "doxygen -w html
# header.html footer.html stylesheet.css YourConfigFile" and then modify
# that header. Note that the header is subject to change so you typically
# have to redo this when upgrading to a newer version of doxygen or when
# changing the value of configuration settings such as GENERATE_TREEVIEW!
HTML_HEADER =
# The HTML_FOOTER tag can be used to specify a personal HTML footer for
# each generated HTML page. If it is left blank doxygen will generate a
# standard footer.
HTML_FOOTER =
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
# style sheet that is used by each HTML page. It can be used to
# fine-tune the look of the HTML output. If the tag is left blank doxygen
# will generate a default style sheet. Note that doxygen will try to copy
# the style sheet file to the HTML output directory, so don't put your own
# stylesheet in the HTML output directory as well, or it will be erased!
HTML_STYLESHEET =
# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the HTML output directory. Note
# that these files will be copied to the base HTML output directory. Use the
# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
# files. In the HTML_STYLESHEET file, use the file name only. Also note that
# the files will be copied as-is; there are no commands or markers available.
HTML_EXTRA_FILES =
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
# Doxygen will adjust the colors in the stylesheet and background images
# according to this color. Hue is specified as an angle on a colorwheel,
# see http://en.wikipedia.org/wiki/Hue for more information.
# For instance the value 0 represents red, 60 is yellow, 120 is green,
# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
# The allowed range is 0 to 359.
HTML_COLORSTYLE_HUE = 220
# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
# the colors in the HTML output. For a value of 0 the output will use
# grayscales only. A value of 255 will produce the most vivid colors.
HTML_COLORSTYLE_SAT = 100
# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
# the luminance component of the colors in the HTML output. Values below
# 100 gradually make the output lighter, whereas values above 100 make
# the output darker. The value divided by 100 is the actual gamma applied,
# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
# and 100 does not change the gamma.
HTML_COLORSTYLE_GAMMA = 80
# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
# page will contain the date and time when the page was generated. Setting
# this to NO can help when comparing the output of multiple runs.
HTML_TIMESTAMP = NO
# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
# files or namespaces will be aligned in HTML using tables. If set to
# NO a bullet list will be used.
HTML_ALIGN_MEMBERS = YES
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
# page has loaded. For this to work a browser that supports
# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
HTML_DYNAMIC_SECTIONS = NO
# If the GENERATE_DOCSET tag is set to YES, additional index files
# will be generated that can be used as input for Apple's Xcode 3
# integrated development environment, introduced with OSX 10.5 (Leopard).
# To create a documentation set, doxygen will generate a Makefile in the
# HTML output directory. Running make will produce the docset in that
# directory and running "make install" will install the docset in
# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
# it at startup.
# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
# for more information.
GENERATE_DOCSET = NO
# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
# feed. A documentation feed provides an umbrella under which multiple
# documentation sets from a single provider (such as a company or product suite)
# can be grouped.
DOCSET_FEEDNAME = "Doxygen generated docs"
# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
# should uniquely identify the documentation set bundle. This should be a
# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
# will append .docset to the name.
DOCSET_BUNDLE_ID = org.doxygen.Project
# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
# the documentation publisher. This should be a reverse domain-name style
# string, e.g. com.mycompany.MyDocSet.documentation.
DOCSET_PUBLISHER_ID = org.doxygen.Publisher
# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
DOCSET_PUBLISHER_NAME = Publisher
# If the GENERATE_HTMLHELP tag is set to YES, additional index files
# will be generated that can be used as input for tools like the
# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
# of the generated HTML documentation.
GENERATE_HTMLHELP = NO
# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
# be used to specify the file name of the resulting .chm file. You
# can add a path in front of the file if the result should not be
# written to the html output directory.
CHM_FILE =
# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
# be used to specify the location (absolute path including file name) of
# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
# the HTML help compiler on the generated index.hhp.
HHC_LOCATION =
# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
# controls if a separate .chi index file is generated (YES) or that
# it should be included in the master .chm file (NO).
GENERATE_CHI = NO
# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
# is used to encode HtmlHelp index (hhk), content (hhc) and project file
# content.
CHM_INDEX_ENCODING =
# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
# controls whether a binary table of contents is generated (YES) or a
# normal table of contents (NO) in the .chm file.
BINARY_TOC = NO
# The TOC_EXPAND flag can be set to YES to add extra items for group members
# to the contents of the HTML help documentation and to the tree view.
TOC_EXPAND = NO
# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
# that can be used as input for Qt's qhelpgenerator to generate a
# Qt Compressed Help (.qch) of the generated HTML documentation.
GENERATE_QHP = NO
# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
# be used to specify the file name of the resulting .qch file.
# The path specified is relative to the HTML output folder.
QCH_FILE =
# The QHP_NAMESPACE tag specifies the namespace to use when generating
# Qt Help Project output. For more information please see
# http://doc.trolltech.com/qthelpproject.html#namespace
QHP_NAMESPACE = org.doxygen.Project
# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
# Qt Help Project output. For more information please see
# http://doc.trolltech.com/qthelpproject.html#virtual-folders
QHP_VIRTUAL_FOLDER = doc
# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
# add. For more information please see
# http://doc.trolltech.com/qthelpproject.html#custom-filters
QHP_CUST_FILTER_NAME =
# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
# custom filter to add. For more information please see
#
# Qt Help Project / Custom Filters.
QHP_CUST_FILTER_ATTRS =
# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
# project's
# filter section matches.
#
# Qt Help Project / Filter Attributes.
QHP_SECT_FILTER_ATTRS =
# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
# be used to specify the location of Qt's qhelpgenerator.
# If non-empty doxygen will try to run qhelpgenerator on the generated
# .qhp file.
QHG_LOCATION =
# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
# will be generated, which together with the HTML files, form an Eclipse help
# plugin. To install this plugin and make it available under the help contents
# menu in Eclipse, the contents of the directory containing the HTML and XML
# files needs to be copied into the plugins directory of eclipse. The name of
# the directory within the plugins directory should be the same as
# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
# the help appears.
GENERATE_ECLIPSEHELP = NO
# A unique identifier for the eclipse help plugin. When installing the plugin
# the directory name containing the HTML and XML files should also have
# this name.
ECLIPSE_DOC_ID = org.doxygen.Project
# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
# top of each HTML page. The value NO (the default) enables the index and
# the value YES disables it.
DISABLE_INDEX = NO
# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
# (range [0,1..20]) that doxygen will group on one line in the generated HTML
# documentation. Note that a value of 0 will completely suppress the enum
# values from appearing in the overview section.
ENUM_VALUES_PER_LINE = 4
# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
# structure should be generated to display hierarchical information.
# If the tag value is set to YES, a side panel will be generated
# containing a tree-like index structure (just like the one that
# is generated for HTML Help). For this to work a browser that supports
# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
# Windows users are probably better off using the HTML help feature.
GENERATE_TREEVIEW = YES
# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
# and Class Hierarchy pages using a tree view instead of an ordered list.
USE_INLINE_TREES = NO
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
# used to set the initial width (in pixels) of the frame in which the tree
# is shown.
TREEVIEW_WIDTH = 250
# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
# links to external symbols imported via tag files in a separate window.
EXT_LINKS_IN_WINDOW = NO
# Use this tag to change the font size of Latex formulas included
# as images in the HTML documentation. The default is 10. Note that
# when you change the font size after a successful doxygen run you need
# to manually remove any form_*.png images from the HTML output directory
# to force them to be regenerated.
FORMULA_FONTSIZE = 10
# Use the FORMULA_TRANPARENT tag to determine whether or not the images
# generated for formulas are transparent PNGs. Transparent PNGs are
# not supported properly for IE 6.0, but are supported on all modern browsers.
# Note that when changing this option you need to delete any form_*.png files
# in the HTML output before the changes have effect.
FORMULA_TRANSPARENT = YES
# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax
# (see http://www.mathjax.org) which uses client side Javascript for the
# rendering instead of using prerendered bitmaps. Use this if you do not
# have LaTeX installed or if you want to formulas look prettier in the HTML
# output. When enabled you also need to install MathJax separately and
# configure the path to it using the MATHJAX_RELPATH option.
USE_MATHJAX = NO
# When MathJax is enabled you need to specify the location relative to the
# HTML output directory using the MATHJAX_RELPATH option. The destination
# directory should contain the MathJax.js script. For instance, if the mathjax
# directory is located at the same level as the HTML output directory, then
# MATHJAX_RELPATH should be ../mathjax. The default value points to the
# mathjax.org site, so you can quickly see the result without installing
# MathJax, but it is strongly recommended to install a local copy of MathJax
# before deployment.
MATHJAX_RELPATH = http://www.mathjax.org/mathjax
# When the SEARCHENGINE tag is enabled doxygen will generate a search box
# for the HTML output. The underlying search engine uses javascript
# and DHTML and should work on any modern browser. Note that when using
# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
# (GENERATE_DOCSET) there is already a search function so this one should
# typically be disabled. For large projects the javascript based search engine
# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
SEARCHENGINE = YES
# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
# implemented using a PHP enabled web server instead of at the web client
# using Javascript. Doxygen will generate the search PHP script and index
# file to put on the web server. The advantage of the server
# based approach is that it scales better to large projects and allows
# full text search. The disadvantages are that it is more difficult to setup
# and does not have live searching capabilities.
SERVER_BASED_SEARCH = NO
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
# generate Latex output.
GENERATE_LATEX = NO
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `latex' will be used as the default path.
LATEX_OUTPUT = latex
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
# invoked. If left blank `latex' will be used as the default command name.
# Note that when enabling USE_PDFLATEX this option is only used for
# generating bitmaps for formulas in the HTML output, but not in the
# Makefile that is written to the output directory.
LATEX_CMD_NAME = latex
# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
# generate index for LaTeX. If left blank `makeindex' will be used as the
# default command name.
MAKEINDEX_CMD_NAME = makeindex
# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
# LaTeX documents. This may be useful for small projects and may help to
# save some trees in general.
COMPACT_LATEX = NO
# The PAPER_TYPE tag can be used to set the paper type that is used
# by the printer. Possible values are: a4, letter, legal and
# executive. If left blank a4wide will be used.
PAPER_TYPE = a4wide
# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
# packages that should be included in the LaTeX output.
EXTRA_PACKAGES =
# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
# the generated latex document. The header should contain everything until
# the first chapter. If it is left blank doxygen will generate a
# standard header. Notice: only use this tag if you know what you are doing!
LATEX_HEADER =
# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
# the generated latex document. The footer should contain everything after
# the last chapter. If it is left blank doxygen will generate a
# standard footer. Notice: only use this tag if you know what you are doing!
LATEX_FOOTER =
# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
# is prepared for conversion to pdf (using ps2pdf). The pdf file will
# contain links (just like the HTML output) instead of page references
# This makes the output suitable for online browsing using a pdf viewer.
PDF_HYPERLINKS = YES
# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
# plain latex in the generated Makefile. Set this option to YES to get a
# higher quality PDF documentation.
USE_PDFLATEX = YES
# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
# command to the generated LaTeX files. This will instruct LaTeX to keep
# running if errors occur, instead of asking the user for help.
# This option is also used when generating formulas in HTML.
LATEX_BATCHMODE = NO
# If LATEX_HIDE_INDICES is set to YES then doxygen will not
# include the index chapters (such as File Index, Compound Index, etc.)
# in the output.
LATEX_HIDE_INDICES = NO
# If LATEX_SOURCE_CODE is set to YES then doxygen will include
# source code with syntax highlighting in the LaTeX output.
# Note that which sources are shown also depends on other settings
# such as SOURCE_BROWSER.
LATEX_SOURCE_CODE = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
# The RTF output is optimized for Word 97 and may not look very pretty with
# other RTF readers or editors.
GENERATE_RTF = NO
# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `rtf' will be used as the default path.
RTF_OUTPUT = rtf
# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
# RTF documents. This may be useful for small projects and may help to
# save some trees in general.
COMPACT_RTF = NO
# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
# will contain hyperlink fields. The RTF file will
# contain links (just like the HTML output) instead of page references.
# This makes the output suitable for online browsing using WORD or other
# programs which support those fields.
# Note: wordpad (write) and others do not support links.
RTF_HYPERLINKS = NO
# Load stylesheet definitions from file. Syntax is similar to doxygen's
# config file, i.e. a series of assignments. You only have to provide
# replacements, missing definitions are set to their default value.
RTF_STYLESHEET_FILE =
# Set optional variables used in the generation of an rtf document.
# Syntax is similar to doxygen's config file.
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
# generate man pages
GENERATE_MAN = YES
# The MAN_OUTPUT tag is used to specify where the man pages will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `man' will be used as the default path.
MAN_OUTPUT = man
# The MAN_EXTENSION tag determines the extension that is added to
# the generated man pages (default is the subroutine's section .3)
MAN_EXTENSION = .3
# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
# then it will generate one additional man file for each entity
# documented in the real man page(s). These additional files
# only source the real man page, but without them the man command
# would be unable to find the correct page. The default is NO.
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
# If the GENERATE_XML tag is set to YES Doxygen will
# generate an XML file that captures the structure of
# the code including all documentation.
GENERATE_XML = NO
# The XML_OUTPUT tag is used to specify where the XML pages will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `xml' will be used as the default path.
XML_OUTPUT = xml
# The XML_SCHEMA tag can be used to specify an XML schema,
# which can be used by a validating XML parser to check the
# syntax of the XML files.
XML_SCHEMA =
# The XML_DTD tag can be used to specify an XML DTD,
# which can be used by a validating XML parser to check the
# syntax of the XML files.
XML_DTD =
# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
# dump the program listings (including syntax highlighting
# and cross-referencing information) to the XML output. Note that
# enabling this will significantly increase the size of the XML output.
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
# generate an AutoGen Definitions (see autogen.sf.net) file
# that captures the structure of the code including all
# documentation. Note that this feature is still experimental
# and incomplete at the moment.
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
# If the GENERATE_PERLMOD tag is set to YES Doxygen will
# generate a Perl module file that captures the structure of
# the code including all documentation. Note that this
# feature is still experimental and incomplete at the
# moment.
GENERATE_PERLMOD = NO
# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
# the necessary Makefile rules, Perl scripts and LaTeX code to be able
# to generate PDF and DVI output from the Perl module output.
PERLMOD_LATEX = NO
# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
# nicely formatted so it can be parsed by a human reader. This is useful
# if you want to understand what is going on. On the other hand, if this
# tag is set to NO the size of the Perl module output will be much smaller
# and Perl will parse it just the same.
PERLMOD_PRETTY = YES
# The names of the make variables in the generated doxyrules.make file
# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
# This is useful so different doxyrules.make files included by the same
# Makefile don't overwrite each other's variables.
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
# evaluate all C-preprocessor directives found in the sources and include
# files.
ENABLE_PREPROCESSING = YES
# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
# names in the source code. If set to NO (the default) only conditional
# compilation will be performed. Macro expansion can be done in a controlled
# way by setting EXPAND_ONLY_PREDEF to YES.
MACRO_EXPANSION = YES
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
# then the macro expansion is limited to the macros specified with the
# PREDEFINED and EXPAND_AS_DEFINED tags.
EXPAND_ONLY_PREDEF = YES
# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
# pointed to by INCLUDE_PATH will be searched when a #include is found.
SEARCH_INCLUDES = YES
# The INCLUDE_PATH tag can be used to specify one or more directories that
# contain include files that are not input files but should be processed by
# the preprocessor.
INCLUDE_PATH =
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
# directories. If left blank, the patterns specified with FILE_PATTERNS will
# be used.
INCLUDE_FILE_PATTERNS =
# The PREDEFINED tag can be used to specify one or more macro names that
# are defined before the preprocessor is started (similar to the -D option of
# gcc). The argument of the tag is a list of macros of the form: name
# or name=definition (no spaces). If the definition and the = are
# omitted =1 is assumed. To prevent a macro definition from being
# undefined via #undef or recursively expanded use the := operator
# instead of the = operator.
PREDEFINED = GEIS_API=
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.
# The macro definition that is found in the sources will be used.
# Use the PREDEFINED tag if you want to use a different macro definition that
# overrules the definition found in the source code.
EXPAND_AS_DEFINED =
# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
# doxygen's preprocessor will remove all references to function-like macros
# that are alone on a line, have an all uppercase name, and do not end with a
# semicolon, because these will confuse the parser if not removed.
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
#---------------------------------------------------------------------------
# The TAGFILES option can be used to specify one or more tagfiles.
# Optionally an initial location of the external documentation
# can be added for each tagfile. The format of a tag file without
# this location is as follows:
# TAGFILES = file1 file2 ...
# Adding location for the tag files is done as follows:
# TAGFILES = file1=loc1 "file2 = loc2" ...
# where "loc1" and "loc2" can be relative or absolute paths or
# URLs. If a location is present for each tag, the installdox tool
# does not have to be run to correct the links.
# Note that each tag file must have a unique name
# (where the name does NOT include the path)
# If a tag file is not located in the directory in which doxygen
# is run, you must also specify the path to the tagfile here.
TAGFILES =
# When a file name is specified after GENERATE_TAGFILE, doxygen will create
# a tag file that is based on the input files it reads.
GENERATE_TAGFILE =
# If the ALLEXTERNALS tag is set to YES all external classes will be listed
# in the class index. If set to NO only the inherited external classes
# will be listed.
ALLEXTERNALS = NO
# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
# in the modules index. If set to NO, only the current project's groups will
# be listed.
EXTERNAL_GROUPS = YES
# The PERL_PATH should be the absolute path and name of the perl script
# interpreter (i.e. the result of `which perl').
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
# or super classes. Setting the tag to NO turns the diagrams off. Note that
# this option also works with HAVE_DOT disabled, but it is recommended to
# install and use dot, since it yields more powerful graphs.
CLASS_DIAGRAMS = YES
# You can define message sequence charts within doxygen comments using the \msc
# command. Doxygen will then run the mscgen tool (see
# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
# documentation. The MSCGEN_PATH tag allows you to specify the directory where
# the mscgen tool resides. If left empty the tool is assumed to be found in the
# default search path.
MSCGEN_PATH =
# If set to YES, the inheritance and collaboration graphs will hide
# inheritance and usage relations if the target is undocumented
# or is not a class.
HIDE_UNDOC_RELATIONS = YES
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
# available from the path. This tool is part of Graphviz, a graph visualization
# toolkit from AT&T and Lucent Bell Labs. The other options in this section
# have no effect if this option is set to NO (the default)
HAVE_DOT = NO
# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
# allowed to run in parallel. When set to 0 (the default) doxygen will
# base this on the number of processors available in the system. You can set it
# explicitly to a value larger than 0 to get control over the balance
# between CPU load and processing speed.
DOT_NUM_THREADS = 0
# By default doxygen will write a font called Helvetica to the output
# directory and reference it in all dot files that doxygen generates.
# When you want a differently looking font you can specify the font name
# using DOT_FONTNAME. You need to make sure dot is able to find the font,
# which can be done by putting it in a standard location or by setting the
# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
# containing the font.
DOT_FONTNAME = FreeSans.ttf
# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
# The default size is 10pt.
DOT_FONTSIZE = 10
# By default doxygen will tell dot to use the output directory to look for the
# FreeSans.ttf font (which doxygen will put there itself). If you specify a
# different font using DOT_FONTNAME you can set the path where dot
# can find it using this tag.
DOT_FONTPATH =
# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for each documented class showing the direct and
# indirect inheritance relations. Setting this tag to YES will force the
# the CLASS_DIAGRAMS tag to NO.
CLASS_GRAPH = YES
# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for each documented class showing the direct and
# indirect implementation dependencies (inheritance, containment, and
# class references variables) of the class with other documented classes.
COLLABORATION_GRAPH = YES
# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for groups, showing the direct groups dependencies
GROUP_GRAPHS = YES
# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
# collaboration diagrams in a style similar to the OMG's Unified Modeling
# Language.
UML_LOOK = NO
# If set to YES, the inheritance and collaboration graphs will show the
# relations between templates and their instances.
TEMPLATE_RELATIONS = NO
# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
# tags are set to YES then doxygen will generate a graph for each documented
# file showing the direct and indirect include dependencies of the file with
# other documented files.
INCLUDE_GRAPH = YES
# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
# documented header file showing the documented files that directly or
# indirectly include this file.
INCLUDED_BY_GRAPH = YES
# If the CALL_GRAPH and HAVE_DOT options are set to YES then
# doxygen will generate a call dependency graph for every global function
# or class method. Note that enabling this option will significantly increase
# the time of a run. So in most cases it will be better to enable call graphs
# for selected functions only using the \callgraph command.
CALL_GRAPH = NO
# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
# doxygen will generate a caller dependency graph for every global function
# or class method. Note that enabling this option will significantly increase
# the time of a run. So in most cases it will be better to enable caller
# graphs for selected functions only using the \callergraph command.
CALLER_GRAPH = NO
# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
# will generate a graphical hierarchy of all classes instead of a textual one.
GRAPHICAL_HIERARCHY = YES
# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
# then doxygen will show the dependencies a directory has on other directories
# in a graphical way. The dependency relations are determined by the #include
# relations between the files in the directories.
DIRECTORY_GRAPH = YES
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
# generated by dot. Possible values are svg, png, jpg, or gif.
# If left blank png will be used.
DOT_IMAGE_FORMAT = png
# The tag DOT_PATH can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
DOT_PATH =
# The DOTFILE_DIRS tag can be used to specify one or more directories that
# contain dot files that are included in the documentation (see the
# \dotfile command).
DOTFILE_DIRS =
# The MSCFILE_DIRS tag can be used to specify one or more directories that
# contain msc files that are included in the documentation (see the
# \mscfile command).
MSCFILE_DIRS =
# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
# nodes that will be shown in the graph. If the number of nodes in a graph
# becomes larger than this value, doxygen will truncate the graph, which is
# visualized by representing a node as a red box. Note that doxygen if the
# number of direct children of the root node in a graph is already larger than
# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
DOT_GRAPH_MAX_NODES = 50
# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
# graphs generated by dot. A depth value of 3 means that only nodes reachable
# from the root by following a path via at most 3 edges will be shown. Nodes
# that lay further from the root node will be omitted. Note that setting this
# option to 1 or 2 may greatly reduce the computation time needed for large
# code bases. Also note that the size of a graph can be further restricted by
# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
MAX_DOT_GRAPH_DEPTH = 0
# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
# background. This is disabled by default, because dot on Windows does not
# seem to support this out of the box. Warning: Depending on the platform used,
# enabling this option may lead to badly anti-aliased labels on the edges of
# a graph (i.e. they become hard to read).
DOT_TRANSPARENT = NO
# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
# files in one run (i.e. multiple -o and -T options on the command line). This
# makes dot run faster, but since only newer versions of dot (>1.8.10)
# support this, this feature is disabled by default.
DOT_MULTI_TARGETS = NO
# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
# generate a legend page explaining the meaning of the various boxes and
# arrows in the dot generated graphs.
GENERATE_LEGEND = YES
# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
# remove the intermediate dot files that are used to generate
# the various graphs.
DOT_CLEANUP = YES
geis-2.2.17+16.04.20160126/doc/api.dox 0000644 0000156 0000165 00000001341 12651717544 017141 0 ustar pbuser pbgroup 0000000 0000000 /**
* @mainpage The GEIS API
*
* @section sec_intro Introduction
*
* The GEIS API provides a defined, stable, portable interface for receiving
* gestural input.
*
* GEIS actually provides two APIs:
* the @ref using_geis_v1 "simplified interface"
* and the @ref using_geis_v2 "advanced interface".
*
* @page using_geis_v1 Using The Simplified Interface
*
* @section using_geis_v1_intro Introduction to the Simplified GEIS Interface
*
* The goal of the simplified GEIS interface is to minimize the work required to
* receive gestures from the gesture recognition engine. It is designed around
* the idea of creating a set of callback functions and installing them to
* receive gesture events on a selected window.
*/
geis-2.2.17+16.04.20160126/autogen.sh 0000755 0000156 0000165 00000000324 12651717544 017110 0 ustar pbuser pbgroup 0000000 0000000 #!/bin/sh
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
ORIGDIR=`pwd`
cd $srcdir
autoreconf --force --verbose --install || exit 1
cd $ORIGDIR || exit $?
test -n "$NOCONFIGURE" || "$srcdir/configure" "$@"
geis-2.2.17+16.04.20160126/include/ 0000755 0000156 0000165 00000000000 12651717732 016532 5 ustar pbuser pbgroup 0000000 0000000 geis-2.2.17+16.04.20160126/include/Makefile.am 0000644 0000156 0000165 00000001647 12651717544 020577 0 ustar pbuser pbgroup 0000000 0000000 #
# @file include/Makefile.am
# @brief automake recipe for the geis (public) includes directory
#
# Copyright 2010 Canonical, Ltd.
#
# This file is part of the geis library. This library is free software;
# you can redistribute it and/or modify it under the terms of the GNU Lesser
# General Public License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
nobase_include_HEADERS = geis/geis.h
geis-2.2.17+16.04.20160126/include/geis/ 0000755 0000156 0000165 00000000000 12651717732 017461 5 ustar pbuser pbgroup 0000000 0000000 geis-2.2.17+16.04.20160126/include/geis/geis.h 0000644 0000156 0000165 00000225611 12651717544 020571 0 ustar pbuser pbgroup 0000000 0000000 /**
* @file geis/geis.h
* This is the public interface for the GEIS gesture API.
*
* Copyright 2010-2013 Canonical Ltd.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of version 3 of the GNU Lesser General Public License as published
* by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 51
* Franklin St, Fifth Floor, Boston, MA 02110-1301 US
*/
#ifndef GEIS_GEIS_H_
#define GEIS_GEIS_H_
#ifdef __cplusplus
extern "C" {
#endif
/**
* @defgroup geis_common Common Types and Definitions
*
* These types and values are common to both the simplified and advanced GEIS
* interfaces.
*/
/**
* @defgroup geis_v1 The Simplified GEIS Interface
*
* The simplified GEIS interface is the original (GEIS v1) API. It provides a
* way to specify a list of gesture names and input devices for which gestures
* 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 nuanced
* 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 various
* features.
*/
#define GEIS_VERSION_1_0 1
#define GEIS_VERSION_2_0 20101122
#include
/**
* Errors returned from calls.
* @ingroup geis_common
*
* Most GEIS API calls return a status code indicating success or, in the event
* 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 supported */
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 */
#define GEIS_GESTURE_DRAG "Drag"
#define GEIS_GESTURE_PINCH "Pinch"
#define GEIS_GESTURE_ROTATE "Rotate"
#define GEIS_GESTURE_TAP "Tap"
#define GEIS_GESTURE_TOUCH "Touch"
/* Extra higher-level gestures. */
#define GEIS_GESTURE_FLICK "Flick"
/**
* @defgroup geis_v1_gesture_types Gesture Types
* @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
* 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 toward
* or away from a common point.
*
* @def GEIS_GESTURE_PRIMITIVE_ROTATE
* A rotation gesture. Two or more points moving relatively along an arc with 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
/* @} */
#define GEIS_GESTURE_ID_FLICK 128
/**
* @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 */
#define GEIS_GESTURE_TYPE_DRAG1 "Drag,touch=1"
#define GEIS_GESTURE_TYPE_DRAG2 "Drag,touch=2"
#define GEIS_GESTURE_TYPE_DRAG3 "Drag,touch=3"
#define GEIS_GESTURE_TYPE_DRAG4 "Drag,touch=4"
#define GEIS_GESTURE_TYPE_DRAG5 "Drag,touch=5"
#define GEIS_GESTURE_TYPE_PINCH1 "Pinch,touch=1"
#define GEIS_GESTURE_TYPE_PINCH2 "Pinch,touch=2"
#define GEIS_GESTURE_TYPE_PINCH3 "Pinch,touch=3"
#define GEIS_GESTURE_TYPE_PINCH4 "Pinch,touch=4"
#define GEIS_GESTURE_TYPE_PINCH5 "Pinch,touch=5"
#define GEIS_GESTURE_TYPE_ROTATE1 "Rotate,touch=1"
#define GEIS_GESTURE_TYPE_ROTATE2 "Rotate,touch=2"
#define GEIS_GESTURE_TYPE_ROTATE3 "Rotate,touch=3"
#define GEIS_GESTURE_TYPE_ROTATE4 "Rotate,touch=4"
#define GEIS_GESTURE_TYPE_ROTATE5 "Rotate,touch=5"
#define GEIS_GESTURE_TYPE_TAP1 "Tap,touch=1"
#define GEIS_GESTURE_TYPE_TAP2 "Tap,touch=2"
#define GEIS_GESTURE_TYPE_TAP3 "Tap,touch=3"
#define GEIS_GESTURE_TYPE_TAP4 "Tap,touch=4"
#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 Extension Gesture Types
* @ingroup geis_v1_gesture_types
*
* Vendor-specific extensions to the GEIS v1 API.
*
* @{
*/
/**
* A special gesture type than enabled system-wide gesture priority.
*/
#define GEIS_GESTURE_TYPE_SYSTEM "Sysflags"
#define GEIS_GESTURE_TYPE_FLICK1 "Flick,touch=1"
#define GEIS_GESTURE_TYPE_FLICK2 "Flick,touch=2"
#define GEIS_GESTURE_TYPE_FLICK3 "Flick,touch=3"
#define GEIS_GESTURE_TYPE_FLICK4 "Flick,touch=4"
#define GEIS_GESTURE_TYPE_FLICK5 "Flick,touch=5"
/* @} */
/**
* @name Standard fundamental gesture attributes
*
* @{
*
* @def GEIS_GESTURE_ATTRIBUTE_ANGLE
* Angle covered by a gesture since it has started, in radians, counterclockwise.
* Its value ranges from -pi to pi.
*
* @def GEIS_GESTURE_ATTRIBUTE_ANGLE_DELTA
* Angle covered by a gesture since its last update, in radians,
* counterclockwise.
*
* @def GEIS_GESTURE_ATTRIBUTE_CENTROID_X
* This attribute provides the X coordinate of the centroid of the
* non-self-intersecting closed polygon defined by the touch points of the
* gesture, in device coordinates.
*
* @def GEIS_GESTURE_ATTRIBUTE_CENTROID_Y
* This attribute provides the Y coordinate of the centroid of the
* non-self-intersecting closed polygon defined by the touch points of the
* gesture, in device coordinates.
*
* @def GEIS_GESTURE_ATTRIBUTE_FOCUS_X
* This attribute provides the X coordinate of the focus point of a gesture,
* in screen coordinates.
* For direct devices (GEIS_DEVICE_ATTRIBUTE_DIRECT_TOUCH is GEIS_TRUE) it's
* the centroid point. For indirect devices it's the pointer/cursor position.
*
* @def GEIS_GESTURE_ATTRIBUTE_FOCUS_Y
* This attribute provides the Y coordinate of the focus point of a gesture,
* in screen coordinates.
* For direct devices (GEIS_DEVICE_ATTRIBUTE_DIRECT_TOUCH is GEIS_TRUE) it's
* the centroid point. For indirect devices it's the pointer/cursor position.
*
* @def GEIS_GESTURE_ATTRIBUTE_GESTURE_NAME
* Name of the gesture.
* This attribute is filled only when using GEIS v1 API (the simplified
* interface). On GEIS v2 this attribute has been replaced by the concept of
* gesture classes. Use geis_frame_is_class() instead.
*
* @def GEIS_GESTURE_ATTRIBUTE_POSITION_X
* This attribute provides the X coordinate of the position of a gesture, in
* device coordinates. It's the same as the centroid of a gesture. See
* GEIS_GESTURE_ATTRIBUTE_CENTROID_X.
*
* @def GEIS_GESTURE_ATTRIBUTE_POSITION_Y
* This attribute provides the Y coordinate of the position of a gesture, in
* device coordinates. It's the same as the centroid of a gesture. See
* GEIS_GESTURE_ATTRIBUTE_CENTROID_Y.
*
* @def GEIS_GESTURE_ATTRIBUTE_TOUCH_0_ID
* This attribute provides the ID of the touch at index0.
* Only used by GEIS v1 API.
*
* @def GEIS_GESTURE_ATTRIBUTE_TOUCH_0_X
* This attribute provides the X coordinate of the touch at index0.
* Only used by GEIS v1 API.
*
* @def GEIS_GESTURE_ATTRIBUTE_TOUCH_0_Y
* This attribute provides the Y coordinate of the touch at index0.
* Only used by GEIS v1 API.
*
* @def GEIS_GESTURE_ATTRIBUTE_TOUCH_1_ID
* This attribute provides the ID of the touch at index1.
* Only used by GEIS v1 API.
*
* @def GEIS_GESTURE_ATTRIBUTE_TOUCH_1_X
* This attribute provides the X coordinate of the touch at index1.
* Only used by GEIS v1 API.
*
* @def GEIS_GESTURE_ATTRIBUTE_TOUCH_1_Y
* This attribute provides the Y coordinate of the touch at index1.
* Only used by GEIS v1 API.
*
* @def GEIS_GESTURE_ATTRIBUTE_TOUCH_2_ID
* This attribute provides the ID of the touch at index2.
* Only used by GEIS v1 API.
*
* @def GEIS_GESTURE_ATTRIBUTE_TOUCH_2_X
* This attribute provides the X coordinate of the touch at index2.
* Only used by GEIS v1 API.
*
* @def GEIS_GESTURE_ATTRIBUTE_TOUCH_2_Y
* This attribute provides the Y coordinate of the touch at index2.
* Only used by GEIS v1 API.
*
* @def GEIS_GESTURE_ATTRIBUTE_TOUCH_3_ID
* This attribute provides the ID of the touch at index3.
* Only used by GEIS v1 API.
*
* @def GEIS_GESTURE_ATTRIBUTE_TOUCH_3_X
* This attribute provides the X coordinate of the touch at index3.
* Only used by GEIS v1 API.
*
* @def GEIS_GESTURE_ATTRIBUTE_TOUCH_3_Y
* This attribute provides the Y coordinate of the touch at index3.
* Only used by GEIS v1 API.
*
* @def GEIS_GESTURE_ATTRIBUTE_TOUCH_4_ID
* This attribute provides the ID of the touch at index4.
* Only used by GEIS v1 API.
*
* @def GEIS_GESTURE_ATTRIBUTE_TOUCH_4_X
* This attribute provides the X coordinate of the touch at index4.
* Only used by GEIS v1 API.
*
* @def GEIS_GESTURE_ATTRIBUTE_TOUCH_4_Y
* This attribute provides the Y coordinate of the touch at index4.
* Only used by GEIS v1 API.
*/
#define GEIS_GESTURE_ATTRIBUTE_ANGLE "angle"
#define GEIS_GESTURE_ATTRIBUTE_ANGLE_DELTA "angle delta"
#define GEIS_GESTURE_ATTRIBUTE_ANGULAR_VELOCITY "angular velocity"
#define GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_X1 "boundingbox x1"
#define GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_Y1 "boundingbox y1"
#define GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_X2 "boundingbox x2"
#define GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_Y2 "boundingbox y2"
#define GEIS_GESTURE_ATTRIBUTE_CHILD_WINDOW_ID "child window id"
#define GEIS_GESTURE_ATTRIBUTE_CENTROID_X "centroid x"
#define GEIS_GESTURE_ATTRIBUTE_CENTROID_Y "centroid y"
#define GEIS_GESTURE_ATTRIBUTE_DELTA_X "delta x"
#define GEIS_GESTURE_ATTRIBUTE_DELTA_Y "delta y"
#define GEIS_GESTURE_ATTRIBUTE_DEVICE_ID "device id"
#define GEIS_GESTURE_ATTRIBUTE_EVENT_WINDOW_ID "event window id"
#define GEIS_GESTURE_ATTRIBUTE_FOCUS_X "focus x"
#define GEIS_GESTURE_ATTRIBUTE_FOCUS_Y "focus y"
#define GEIS_GESTURE_ATTRIBUTE_GESTURE_NAME "gesture name"
#define GEIS_GESTURE_ATTRIBUTE_POSITION_X "position x"
#define GEIS_GESTURE_ATTRIBUTE_POSITION_Y "position y"
#define GEIS_GESTURE_ATTRIBUTE_RADIAL_VELOCITY "radial velocity"
#define GEIS_GESTURE_ATTRIBUTE_RADIUS_DELTA "radius delta"
#define GEIS_GESTURE_ATTRIBUTE_RADIUS "radius"
#define GEIS_GESTURE_ATTRIBUTE_ROOT_WINDOW_ID "root window id"
#define GEIS_GESTURE_ATTRIBUTE_TAP_TIME "tap time"
#define GEIS_GESTURE_ATTRIBUTE_TIMESTAMP "timestamp"
#define GEIS_GESTURE_ATTRIBUTE_TOUCHES "touches"
#define GEIS_GESTURE_ATTRIBUTE_VELOCITY_X "velocity x"
#define GEIS_GESTURE_ATTRIBUTE_VELOCITY_Y "velocity y"
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_0_ID "touch 0 id"
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_0_X "touch 0 x"
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_0_Y "touch 0 y"
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_1_ID "touch 1 id"
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_1_X "touch 1 x"
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_1_Y "touch 1 y"
#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_Y "touch 2 y"
#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_Y "touch 3 y"
#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_Y "touch 4 y"
/* @} */
/**
* @defgroup geis_meta Initialization and Cleanup
* @ingroup geis_v1
*
* Each instance of a gesture subscription must be created using the geis_init()
* call and destroyed using the geis_finish() call.
*
* A particular subscription instance is associated with a display region. The
* nature of the display region depends on the underlying display technology.
* 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.
*
* The nature of the display desciption information depends on the actual
* underlyinggeis implementation and is documented separately. The
* implementation-specific description must be passed to geis_init using a
* GeisWinInfo structure.
*
* @{
*/
/**
* @class GeisInstance
* A geis gesture subscription instance.
*/
/** @cond typedef */
typedef struct _GeisInstance *GeisInstance;
/** @endcond */
/**
* @class GeisWinInfo
* Generic display region description block
*/
typedef struct GeisWinInfo
{
uint32_t win_type; /**< Selects the implementation-specific window type. */
void *win_info; /**< Additional info dependent on the window type. */
} GeisWinInfo;
/**
* Initializes a geis subscription instance for a display region.
* @memberof GeisInstance
*
* @param[in] win_info a display region description block
* -- see geis implementtaion documentation
* @param[out] geis_instance an opaque pointer to a geis gesture subscription
* instance
*
* @retval GEIS_BAD_ARGUMENT an invalid GeisWinInfo was passed
* @retval GEIS_STATUS_SUCCESS normal successful completion
*/
GEIS_API GeisStatus geis_init(GeisWinInfo *win_info, GeisInstance *geis_instance);
/**
* Cleans up a geis subscription instance for a display region.
* @memberof GeisInstance
*
* @param[in] geis_instance an opaque pointer to a geis gesture subscription
* instance
*
* @retval GEIS_BAD_ARGUMENT an invalid GeisInstance was passed
* @retval GEIS_STATUS_SUCCESS normal successful completion
*/
GEIS_API GeisStatus geis_finish(GeisInstance geis_instance);
/* @} */
/**
* @defgroup geis_v1_config Configuration and Control
* @ingroup geis_v1
* @{
*/
/**
* Gets the Unix file descriptor for GEIS events.
*
* Applications or toolkits can use this file descriptor to intgerate geis event
* handling into their main event dispatch loop. When a GEIS event is available
* 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 subscription
* 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);
/**
* Gets a feature configuration value.
*
* @param[in] geis_instance An opaque pointer to a geis gesture subscription
* instance.
* @param[in] configuration_item Indicates which configuration item will be
* get.
* @param[in] value A pointer to where the retrieved value will be
* stored.
*
* @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 subscription
* instance.
* @param[in] configuration_item Indicates which configuration item will be
* set.
* @param[in] value A pointer to where the value to be set will be
* read.
*
* @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 subscription
* instance
*
* This function is used to integrate geis even dispatch into the main event
* 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 gesture 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.
*
* @def GEIS_INIT_SYNCHRONOUS_START
* Performs all setup synchronously: geis_new() will block until all setup has
* completed successfully or unsuccessfully.
*/
#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-classes"
#define GEIS_INIT_SYNCHRONOUS_START "org.libgeis.init.synchronous-start"
/* @} */
/**
* @name Vendor-defined Initialization Arguments
*
* @par
* These initialization arguments are not a part of the GEIS specification and
* may change.
*
* @{
*
* @def GEIS_INIT_DBUS_BACKEND
* Uses the DBus back end (default).
*
* @def GEIS_INIT_GRAIL_BACKEND
* Uses the native grail back end (fallback).
*
* @def GEIS_INIT_XCB_BACKEND
* Uses the grail-embedded-in-X11 back end.
*
* @def GEIS_INIT_NO_ATOMIC_GESTURES
* Disables the use of (GEIS v1-style) atomic gestures: only a single gesture
* is recognized at a time.
*
* @def GEIS_INIT_SEND_TENTATIVE_EVENTS
* Causes tentative events to be sent. Tentative events indicate gestures may
* possibly be detected soon and allow early rejection if the events occur
* outside any area of interest.
*
* @def GEIS_INIT_SEND_SYNCHRONOS_EVENTS
* Causes all gesture events to be sent, even if there is zero apparent time
* difference between the events. Normally all but the first consecutive event
* are discarded, since velocity values can not be calculated and multiple
* events between frame redraws are unlikely do have any value beyong consuming
* CPU. Setting this init value will give the events to you if you really want
* them.
*/
#define GEIS_INIT_DBUS_BACKEND "com.canonical.oif.backend.dbus"
#define GEIS_INIT_GRAIL_BACKEND "com.canonical.oif.backend.grail"
#define GEIS_INIT_XCB_BACKEND "com.canonical.oif.backend.xcb"
#define GEIS_INIT_NO_ATOMIC_GESTURES "com.canonical.oif.no-atomic.gestures"
#define GEIS_INIT_SEND_TENTATIVE_EVENTS "com.canonical.oif.events.tentative"
#define GEIS_INIT_SEND_SYNCHRONOS_EVENTS "com.canonical.oif.events.synchronous"
/* @} */
/**
* Initializes an instance of the GEIS v2.0 API.
* @ingroup geis_v2_geis
* @memberof Geis
*
* @param[in] init_arg_name The name of an initializaer argument.
* @param[in] ... The remaining initializaer arguments.
*
* A NULL-terminated list of zero or more initialization arguments is passed to
* this function to create and initialize a connection to a gesture recognition
* engine.
*
* If no initialization arguments are passed, the parameter list consists of a
* single NULL argument.
*/
GEIS_API GEIS_VARARG Geis geis_new(GeisString init_arg_name, ...);
/**
* 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.
*
* Tears down the instance of the API and releases any resources associated with
* that instance.
*/
GEIS_API GeisStatus geis_delete(Geis geis);
/* @} */
/**
* @defgroup geis_v2_error Error Reporting
* @ingroup geis_v2
* @{
*/
/**
* Gets the number of status codes in the error 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 GEIS
* function that does not explicitly return a GeisStatus value. This is
* required for _new() fucntions that return NULL to indicate failure. If the
* call to geis_new() itself fails and returns a NULL, the global error stack
* must be used, otherwise the API instance error stack must be used.
*
* The error stack is reset on each GEIS API call, so failure reasons should be
* determined immmediately after a GEIS API call.
*/
GEIS_API GeisSize geis_error_count(Geis geis);
/**
* Gets the indicated status code from the error stack.
*
* @param[in] geis A GEIS API instance or NULL for the global stack
* @param[in] index Indicates the status value to retrieve. Valid status values
* are between 0 and less than the value returned from
* geis_error_count() otherwise GEIS_STATUS_BAD_ARGUMENT will
* be returned.
*/
GEIS_API GeisStatus geis_error_code(Geis geis, GeisSize index);
/**
* Gets the localized error message, if any, associated with the indicated
* error.
*
* @param[in] geis A GEIS API instance or NULL for the global stack
* @param[in] index Indicates the status value to retrieve. Valid status values
* are between 0 and less than the value returned from
* geis_error_count() otherwise GEIS_STATUS_BAD_ARGUMENT will
* be returned.
*/
GEIS_API GeisString geis_error_message(Geis geis, GeisSize index);
/* @} */
/**
* @defgroup geis_v2_config Configuration
* @ingroup geis_v2
* @{
*/
/**
* @name Required Configuration Items
*
* @par
* 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 events
* for processing.
*/
#define GEIS_CONFIGURATION_FD "org.libgeis.configuration.fd"
/* @} */
/**
* @name Vendor-defined Configuration Items
*
* @par
* These configuration items are not a part of the GEIS specification and may
* change.
*
* @{
*
* @def GEIS_CONFIG_MAX_EVENTS
*/
#define GEIS_CONFIG_MAX_EVENTS "com.canonical.oif.max_events"
/**
* @def GEIS_CONFIG_ATOMIC_GESTURES
* Indicates if atomic gestures are in use. Value type GeisBoolean.
*/
#define GEIS_CONFIG_ATOMIC_GESTURES "com.canonical.use.atomic.gestures"
/**
* @def GEIS_CONFIG_SEND_TENTATIVE_EVENTS
* See GEIS_INIT_SEND_TENTATIVE_EVENTS
*/
#define GEIS_CONFIG_SEND_TENTATIVE_EVENTS "com.canonical.oif.events.tentative"
/**
* @def GEIS_CONFIG_SEND_SYNCHRONOS_EVENTS
* See GEIS_INIT_SEND_SYNCHRONOS_EVENTS
*/
#define GEIS_CONFIG_SEND_SYNCHRONOS_EVENTS "com.canonical.oif.events.synchronous"
/**
* @def GEIS_CONFIG_DRAG_THRESHOLD
* Movement threshold for recognizing a DRAG gesture (in meters). Value type
* GeisFloat.
*/
#define GEIS_CONFIG_DRAG_THRESHOLD "com.canonical.oif.drag.threshold"
/**
* @def GEIS_CONFIG_DRAG_TIMEOUT
* Timeout for recognizing a DRAG gesture (in milliseconds). Value type
* GeisInteger.
*/
#define GEIS_CONFIG_DRAG_TIMEOUT "com.canonical.oif.drag.timeout"
/**
* @def GEIS_CONFIG_PINCH_THRESHOLD
* Movement threshold for recognizing a PINCH gesture (in meters). Value type
* GeisFloat.
*/
#define GEIS_CONFIG_PINCH_THRESHOLD "com.canonical.oif.pinch.threshold"
/**
* @def GEIS_CONFIG_PINCH_TIMEOUT
* Timeout for recognizing a PINCH gesture (in milliseconds). Value type
* GeisInteger.
*/
#define GEIS_CONFIG_PINCH_TIMEOUT "com.canonical.oif.pinch.timeout"
/**
* @def GEIS_CONFIG_ROTATE_THRESHOLD
* Movement threshold for recognizing a ROTATE gesture (in meters). Value type
* GeisFloat.
*/
#define GEIS_CONFIG_ROTATE_THRESHOLD "com.canonical.oif.rotate.threshold"
/**
* @def GEIS_CONFIG_ROTATE_TIMEOUT
* Timeout for recognizing a ROTATE gesture (in milliseconds). Value type
* GeisInteger.
*/
#define GEIS_CONFIG_ROTATE_TIMEOUT "com.canonical.oif.rotate.timeout"
/**
* @def GEIS_CONFIG_TAP_THRESHOLD
* Movement threshold for recognizing a TAP gesture (in meters). Value type
* GeisFloat.
*/
#define GEIS_CONFIG_TAP_THRESHOLD "com.canonical.oif.tap.threshold"
/**
* @def GEIS_CONFIG_TAP_TIMEOUT
* Timeout for recognizing a TAP gesture (in milliseconds). Value type
* GeisInteger.
*/
#define GEIS_CONFIG_TAP_TIMEOUT "com.canonical.oif.tap.timeout"
/**
* @def GEIS_CONFIG_NUM_ACTIVE_SUBSCRIPTIONS
* The number of subscriptions currently active in the back end.
* This config is query-only and intended for unit test validations.
*/
#define GEIS_CONFIG_NUM_ACTIVE_SUBSCRIPTIONS "com.canonical.oif.debug.active_subs"
/* @} */
/**
* Gets a feature configuration value.
*
* @param[in] geis An opaque GEIS API object.
* @param[in] configuration_item_name Selects the configuration value to return.
* @param[out] configuration_item_value Points to a buffer to contain the output
* value. The actual type of this buffer
* depends on the
* @p configuration_value_name.
*
* @retval GEIS_STATUS_BAD_ARGUMENT an invalid argument value was passed
* @retval GEIS_STATUS_NOT_SUPPORTED the configuration value is not supported
* @retval GEIS_STATUS_SUCCESS normal successful completion
*/
GEIS_API GeisStatus geis_get_configuration(Geis geis,
GeisString configuration_item_name,
void *configuration_item_value);
/**
* Sets a feature configuration value.
*
* @param[in] geis An opaque GEIS API object.
* @param[in] configuration_item_name Selects the configuration value to return.
* @param[in] configuration_item_value Points to a buffer to contain the output
* configuration value. The actual type of
* this buffer depends on the
* @p configuration_value_name.
*
* @retval GEIS_STATUS_BAD_ARGUMENT an invalid argument value was passed
* @retval GEIS_STATUS_NOT_SUPPORTED the configuration value is not supported
* @retval GEIS_STATUS_SUCCESS normal successful completion
*/
GEIS_API GeisStatus geis_set_configuration(Geis geis,
GeisString configuration_item_name,
void *configuration_item_value);
/* @} */
/**
* @defgroup geis_v1_input Input Devices
* @ingroup geis_v1
* @{
*/
typedef unsigned int GeisInputDeviceId;
#define GEIS_ALL_INPUT_DEVICES ((GeisInputDeviceId*)0)
/**
* Prototype for input device callback functions.
*/
typedef void (*GeisInputCallback)(void *cookie,
GeisInputDeviceId device_id,
void *attrs);
/**
* Callback functions used to handle changes in the available input devices.
*/
typedef struct GeisInputFuncs
{
GeisInputCallback added; /**< Receives new input device notices */
GeisInputCallback changed; /**< Receives modified input device notices */
GeisInputCallback removed; /**< Receives removes input device notices */
} GeisInputFuncs;
/**
* Registers a callback to receive information on input devices.
*
* @param[in] geis_instance points to a geis gesture subscription
* instance
* @param[in] func points to a GeisInputFuncs table
* @param[in] cookie an application specific value to be passed to
* the callback
*
* The callback is called for each gesture-capable input device available for
* the display region associated with the geis subscription instance. Over
* time, as gesture-capable input devices appear and disappear or change their
* abilities or configuration, the callback may be called again.
*
* @retval GEIS_BAD_ARGUMENT an invalid argument value was passed
* @retval GEIS_STATUS_SUCCESS normal successful completion
*/
GEIS_API GeisStatus geis_input_devices(GeisInstance geis_instance,
GeisInputFuncs *func,
void *cookie);
/* @} */
/**
* @defgroup geis_v1_subscription Gesture Subscription
* @ingroup geis_v1
* @{
*/
typedef unsigned int GeisGestureType;
typedef unsigned int GeisGestureId;
/** Selects ALL input devices. */
#define GEIS_ALL_GESTURES ((GeisGestureType)0)
#define GEIS_NO_GESTURE_ID ((GeisGestureId)0)
/**
* An individual gesture attribute.
*
* Gesture events are associated with a list of attributes, each of which is a
* (name, type, value) tuple. These attribute reveal a little piece of
* information about a gesture.
*/
typedef struct GeisGestureAttr
{
/** The name of the gesture attribute. */
GeisString name;
/** The data type of the gesture attribute. */
GeisAttrType type;
/** The value of the attributes. */
__extension__ union
{
GeisBoolean boolean_val;
GeisFloat float_val;
GeisInteger integer_val;
GeisString string_val;
};
} GeisGestureAttr;
/**
* A callback used for different gesture events.
*
* @param[in] cookie an application-specific value to be passed to the
* callback.
* @param[in] gesture_type a gesture type
* @param[in] gesture_id a unique gesture identifier
* @param[in] attrs parameters
*/
typedef void (*GeisGestureCallback)(void *cookie,
GeisGestureType gesture_type,
GeisGestureId gesture_id,
GeisSize attr_count,
GeisGestureAttr *attrs);
/**
* The set of callback functions invoked for various gesture-related events.
*
* An application must define callback functions to handle the various gesture
* events. These callbacks are provided in a table passed to geis_subscribe for
* each window on which gesture events may occur.
*/
typedef struct GeisGestureFuncs
{
/** Invoked when a new gesture type has been defined. */
GeisGestureCallback added;
/** Invoked when a defined gesture type is no longer available. */
GeisGestureCallback removed;
/** Invoked when a new gesture starts. */
GeisGestureCallback start;
/** Invoked when a gesture has changed values. */
GeisGestureCallback update;
/** Invoked when a gesture finishes. */
GeisGestureCallback finish;
} GeisGestureFuncs;
/**
* Registers a callback to receive gesture events.
*
* @param[in] geis_instance an opaque pointer to a geis gesture subscription
* instance
* @param[in] input_list a null-terminated list of input device IDs
* @param[in] gesture_list a null-terminated list of C-style strings naming
* gestures for subscription
* @param[in] funcs a pointer to a GeisGestureFuncs structure
* @param[in] cookie an application specific value to be passed to
* the callback
*
* @retval GEIS_BAD_ARGUMENT an invalid argument value was passed
* @retval GEIS_STATUS_SUCCESS normal successful completion
*/
GEIS_API GeisStatus geis_subscribe(GeisInstance geis_instance,
GeisInputDeviceId *input_list,
const char* *gesture_list,
GeisGestureFuncs *funcs,
void *cookie);
/**
* Unsubscribes to one or more gestures.
*
* @param[in] geis_instance an opaque pointer to a geis gesture subscription
* instance
* @param[in] gesture_list a null-terminated list of gesture types
*/
GEIS_API GeisStatus geis_unsubscribe(GeisInstance geis_instance,
GeisGestureType *gesture_list);
/* @} */
/**
* @defgroup geis_v2_attrs Attributes
* @ingroup geis_v2
*
* Attributes are named values associated with various GEIS entities, including
* 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, they 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 other
* GEIS components.
*
* Applications must invoke geis_dispatch_events() from time to time to generate
* input device, gesture type, and gesture events. The GEIS events are then
* retrieved either from the internal event queue using the geis_next_event()
* call or through an application-supplied callback set through the
* geis_register_event_callback() call.
*
* @{
*/
typedef enum _GeisEventType
{
GEIS_EVENT_DEVICE_AVAILABLE = 1000,
GEIS_EVENT_DEVICE_UNAVAILABLE = 1010,
GEIS_EVENT_CLASS_AVAILABLE = 2000,
GEIS_EVENT_CLASS_CHANGED = 2005,
GEIS_EVENT_CLASS_UNAVAILABLE = 2010,
GEIS_EVENT_GESTURE_BEGIN = 3000,
GEIS_EVENT_GESTURE_UPDATE = 3010,
GEIS_EVENT_GESTURE_END = 3020,
GEIS_EVENT_TENTATIVE_BEGIN = 3500,
GEIS_EVENT_TENTATIVE_UPDATE = 3510,
GEIS_EVENT_TENTATIVE_END = 3520,
GEIS_EVENT_INIT_COMPLETE = 4000,
GEIS_EVENT_USER_DEFINED = 6000,
GEIS_EVENT_ERROR = 7000
} GeisEventType;
/**
* @class GeisEvent
* A generic GEIS event.
*
* Applications must determine the type of the actual event and convert the
* opaque pointer to a concrete event pointer, if required.
*
* Events are created by the GEIS API but must be destroyed by the application.
*/
/** @cond typedef */
typedef struct _GeisEvent *GeisEvent;
/** @endcond */
/**
* Destroys a GeisEvent.
* @memberof GeisEvent
*
* @param[in] event The GeisEvent to destroy.
*/
GEIS_API void geis_event_delete(GeisEvent event);
/**
* Gets the type of the event.
* @memberof GeisEvent
*
* @param[in] event The GeisEvent to destroy.
*/
GEIS_API GeisEventType geis_event_type(GeisEvent event);
/**
* Gets the number of attributes in the event.
* @memberof GeisEvent
*
* @param[in] event The GeisEvent.
*/
GEIS_API GeisSize geis_event_attr_count(GeisEvent event);
/**
* Gets an indicated attribute from the event.
* @memberof GeisEvent
*
* @param[in] event The GeisEvent.
* @param[in] index Indicates the attribute to retrieve.
*/
GEIS_API GeisAttr geis_event_attr(GeisEvent event, GeisSize index);
/**
* Gets a named attribute from the event.
* @memberof GeisEvent
*
* @param[in] event The GeisEvent.
* @param[in] attr_name The name of the attribute to retrieve.
*/
GEIS_API GeisAttr geis_event_attr_by_name(GeisEvent event, GeisString attr_name);
/**
* The application callback type for the event dispatcher.
*
* @param[in] geis the GEIS API instance
* @param[in] event the opaque event pointer
* @param[in] context the application-supplied context value
*/
typedef void (*GeisEventCallback)(Geis geis, GeisEvent event, void *context);
/**
* A special constant indicating the use of the default event callback.
*/
#define GEIS_DEFAULT_EVENT_CALLBACK ((GeisEventCallback)0)
/**
* Registers an event-handler callback.
*
* @param[in] geis the GEIS API instance
* @param[in] event_callback the callback to register
* @param[in] context the caller context
*
* This function registers the callback to be executed whenever a new GeisEvent
* is generated. The default function pushes the GeisEvent onto an internal
* queue to be picked up by a call to geis_next_event().
*
* Calling geis_register_event_callback() with a callback of
* GEIS_DEFAULT_EVENT_CALLBACK replaces any registered function wit hthe default
* function.
*
* The callback is executed in the same thread context as the one
* geis_dispatch_events() is called from.
*/
GEIS_API void geis_register_event_callback(Geis geis,
GeisEventCallback event_callback,
void *context);
/**
* Pumps the GEIS event loop.
*
* @param[in] geis The GEIS API instance.
*
* Processes input events until there are no more input events to process and
* generates zero or more gesture events, reporting them via the user-supplied
* callback or pushing them on the internal event queue for retrieval via the
* geis_next_event() call.
*
* @retval GEIS_STATUS_SUCCESS The event loop was successfully pumped and
* no further events remain to be processed at
* this time.
*
* @retval GEIS_STATUS_CONTINUE The event loop was successfully pumped but
* the system detected there are events
* still remaining to be processed.
*
* @retval GEIS_STATUS_UNKNOWN_ERROR Some error occurred
*/
GEIS_API GeisStatus geis_dispatch_events(Geis geis);
/**
* Retrieves the next queued GEIS event.
*
* @param[in] geis The GEIS API instance.
* @param[out] event The GeisEvent retrieved, if any.
*
* Pulls the next available GeisEvent from the internal event queue, if any, and
* indicates whether there are more events left.
*
* @retval GEIS_STATUS_SUCCESS An event was successfully pulled from the
* queue and the queue is now empty.
*
* @retval GEIS_STATUS_CONTINUE An event was successfully pulled from the
* queue and one or more events remain in the
* queue.
*
* @retval GEIS_STATUS_EMPTY No event was pulled from the queue because
* it is empty. The value of *event remains
* unchanged.
*
* @retval GEIS_STATUS_UNKNOWN_ERROR Some error occurred
*/
GEIS_API GeisStatus geis_next_event(Geis geis, GeisEvent *event);
/* @} */
/**
* @defgroup geis_v2_device Input Devices
* @ingroup geis_v2
* @{
*/
/**
* @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 available
* 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.
*
* The attribute value is of type GeisString.
*
* @def GEIS_DEVICE_ATTRIBUTE_ID
* The unique integer ID of the device. Guaranteed unique within a Geis
* instance.
*
* The attribute values is of type GeisInteger.
*
* @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.
*
* The attribute value is of type GeisInteger.
*
* @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 indicates 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 touch
* device at all.
*
* The attribute value is of type GeisBoolean.
*
* @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 indicates
* the device is an independent touch device (for example, an Apple MagicMouse).
* Other multi-touch devices should report GEIS_FALSE.
*
* The attribute value is of type GeisBoolean.
*
* @def GEIS_DEVICE_ATTRIBUTE_MIN_X
* The lower bound of the X-axis (nominally horizontal) coordinate values
* reported by the device.
*
* The attribute values is of type GeisFloat.
*
* @def GEIS_DEVICE_ATTRIBUTE_MAX_X
* The upper bound of the X-axis (nominally horizontal) coordinate values
* reported by the device.
*
* The attribute values is of type GeisFloat.
*
* @def GEIS_DEVICE_ATTRIBUTE_RES_X
* The resolution of the X-axis (nominally horizontal) coordinate values
* reported by the device.
*
* The attribute values is of type GeisFloat.
*
* @def GEIS_DEVICE_ATTRIBUTE_MIN_Y
* The lower bound of the Y-axis (nominally vertical) coordinate values
* reported by the device.
*
* The attribute values is of type GeisFloat.
*
* @def GEIS_DEVICE_ATTRIBUTE_MAX_Y
* The upper bound of the Y-axis (nominally vertical) coordinate values
* reported by the device.
*
* The attribute values is of type GeisFloat.
*
* @def GEIS_DEVICE_ATTRIBUTE_RES_Y
* The resolution of the Y-axis (nominally vertical) coordinate values
* reported by the device.
*
* The attribute values is of type GeisFloat.
*/
#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"
#define GEIS_DEVICE_ATTRIBUTE_MIN_X "device X minimum"
#define GEIS_DEVICE_ATTRIBUTE_MAX_X "device X maximum"
#define GEIS_DEVICE_ATTRIBUTE_RES_X "device X resolution"
#define GEIS_DEVICE_ATTRIBUTE_MIN_Y "device Y minimum"
#define GEIS_DEVICE_ATTRIBUTE_MAX_Y "device Y maximum"
#define GEIS_DEVICE_ATTRIBUTE_RES_Y "device Y resolution"
/* @} */
/**
* @class GeisDevice
* A gesture-capable input device.
*
* GeisDevice objects are created by the GEIS API and are reference counted.
*/
/** @cond typedef */
typedef struct _GeisDevice *GeisDevice;
/** @endcond */
GEIS_API void geis_register_device_callback(Geis geis,
GeisEventCallback event_callback,
void *context);
/**
* Gets a cached device description for an identified device.
*
* @param[in] geis The GEIS API instance.
* @param[in] device_id Identifies the device.
*
* The GEIS instance caches a list of gesture-capable input devices that have
* been reported. The GeisDevice description for an identified device may be
* retrieved from that cache with this call.
*
* @returns a valid GeisDevice for the identified device, or NULL if no such
* device is in the cache.
*/
GEIS_API GeisDevice geis_get_device(Geis geis, GeisInteger device_id);
/**
* Adds a reference count to a device.
* @memberof GeisDevice
*
* @param[in] device The device.
*
* 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
* longer needed.
*
* @returns @p device for syntactic convenience.
*/
GEIS_API GeisDevice geis_device_ref(GeisDevice device);
/**
* Removes a reference count from a device.
* @memberof GeisDevice
*
* @param[in] device The device.
*
* This function decrements the number of references to the device and, if the
* number of references hits zero, deletes the device.
*/
GEIS_API void geis_device_unref(GeisDevice device);
/**
* Gets the name of the input device.
* @memberof GeisDevice
*
* @param[in] device The device.
*/
GEIS_API GeisString geis_device_name(GeisDevice device);
/**
* Gets the system identifier of the iput device.
* @memberof GeisDevice
*
* @param[in] device The device.
*
* The system-defined device identifier is system- and possibly
* device-dependent.
*/
GEIS_API GeisInteger geis_device_id(GeisDevice device);
/**
* Gets the number of attributes of the device.
* @memberof GeisDevice
*
* @param[in] device The device.
*/
GEIS_API GeisSize geis_device_attr_count(GeisDevice device);
/**
* Gets the indicated attribute of the device.
* @memberof GeisDevice
*
* @param[in] device The device.
* @param[in] index Indicates which attr to retrieve.
*/
GEIS_API GeisAttr geis_device_attr(GeisDevice device, GeisSize index);
/**
* Gets a named attribute from the device.
* @memberof GeisDevice
*
* @param[in] device The device.
* @param[in] attr_name The name of the attribute to retrieve.
*/
GEIS_API GeisAttr geis_device_attr_by_name(GeisDevice device, GeisString attr_name);
/* @} */
/**
* @defgroup geis_v2_class Gesture Classes
* @ingroup geis_v2
* @{
*/
/**
* @class GeisGestureClass
* A defined gesture classifier.
*
* GeisGestureClass objects are created by the GEIS API and are reference
* counted. An application needs to increment and decrement the reference
* count of a gesture class object to control its persistence.
*/
/** @cond typedef */
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 class
* 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_ID "class id"
/* @} */
/**
* Registers a callback to receive gesture class change notifications.
*
* @param[in] geis The API instance.
* @param[in] event_callback The callback function.
* @param[in] context Contextual data to be passed through to the
* callback.
*
* This function is used to register a function to be executed when a change to
* the available gesture class definitions has occurred. If no function is
* registered, the default action is to deliver gesture class events through the
* main event mechanism.
*
* Passing a value of GEIS_DEFAULT_EVENT_CALLBACK as the @p event-callback will
* reset the callback function to the default action.
*
* The @p event_callback function will be executed in the same thread context as
* geis_dispatch_events().
*/
GEIS_API void geis_register_class_callback(Geis geis,
GeisEventCallback event_callback,
void *context);
/**
* Increments the reference count of a gesture class object.
* @memberof GeisGestureClass
*
* @param[in] gesture_class The gesture class object.
*/
GEIS_API void geis_gesture_class_ref(GeisGestureClass gesture_class);
/**
* Decrements the reference count of a gesture class object.
* @memberof GeisGestureClass
*
* @param[in] gesture_class The gesture class object.
*
* The reference count of the object is decremented and, if it reaches zero, the
* object is destroyed.
*/
GEIS_API void geis_gesture_class_unref(GeisGestureClass gesture_class);
/**
* Gets the name of the gesture class.
* @memberof GeisGestureClass
*
* @param[in] gesture_class The gesture class object.
*/
GEIS_API GeisString geis_gesture_class_name(GeisGestureClass gesture_class);
/**
* Gets the numeric identifier of the gesture class.
* @memberof GeisGestureClass
*
* @param[in] gesture_class The gesture class object.
*/
GEIS_API GeisInteger geis_gesture_class_id(GeisGestureClass gesture_class);
/**
* Gets the number of attributes of the gesture class.
* @memberof GeisGestureClass
*
* @param[in] gesture_class The gesture class object.
*/
GEIS_API GeisSize geis_gesture_class_attr_count(GeisGestureClass gesture_class);
/**
* Gets the indicated attribute of the gesture class.
* @memberof GeisGestureClass
*
* @param[in] gesture_class The gesture class object.
* @param[in] index The index of the attribute to retrieve.
*/
GEIS_API GeisAttr geis_gesture_class_attr(GeisGestureClass gesture_class,
int index);
/* @} */
/**
* @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;
/** @endcond */
/**
* @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 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.
*
* @par
* The following region initialization argument names are required by the
* 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_WINDOWID "org.libgeis.region.x11.windowid"
/* @} */
/**
* Creates a new GEIS v2.0 region.
* @memberof GeisRegion
*
* @param[in] geis The GEIS API instance.
* @param[in] name A name. Used for diagnostics.
* @param[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_API GEIS_VARARG GeisRegion geis_region_new(Geis geis,
GeisString name,
GeisString init_arg_name, ...);
/**
* Destroys a GEIS v2.0 region.
* @memberof GeisRegion
*
* @param[in] region The region.
*/
GEIS_API GeisStatus geis_region_delete(GeisRegion region);
/**
* Gets the name of a GEIS v2.0 region.
* @memberof GeisRegion
*
* @param[in] region The region.
*
* Returns the @p name value used when creating the region.
*/
GEIS_API GeisString geis_region_name(GeisRegion region);
/* @} */
/**
* @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;
/** @endcond */
/**
* Indicates the type of filter.
*/
typedef enum _GeisFilterFacility
{
GEIS_FILTER_DEVICE = 1000, /**< Filters on device attributes. */
GEIS_FILTER_CLASS = 2000, /**< Filters on gesture class and gesture attributes. */
GEIS_FILTER_REGION = 3000, /**< Filters on region attributes. */
GEIS_FILTER_SPECIAL = 5000 /**< Filters on special attributes. */
} GeisFilterFacility;
/**
* Indicates the type of filter operation.
*/
typedef enum _GeisFilterOperation
{
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. */
} GeisFilterOperation;
/**
* Creates a new, empty filter.
* @memberof GeisFilter
*
* @param[in] geis The GEIS API instance.
* @param[in] name A name.
*
* @returns a GeisFilter object or NULL on failure.
*/
GEIS_API GeisFilter geis_filter_new(Geis geis, GeisString name);
/**
* Creates a new filter by copying an existing filter.
* @memberof GeisFilter
*
* @param[in] original An existing geisFilter instance.
* @param[in] name A name.
*
* The original filter remains unchanged.
*
* @returns a GeisFilter object or NULL on failure.
*/
GEIS_API GeisFilter geis_filter_clone(GeisFilter original, GeisString name);
/**
* Destroys a GeisFilter.
* @memberof GeisFilter
*
* @param[in] filter The filter.
*/
GEIS_API GeisStatus geis_filter_delete(GeisFilter filter);
/**
* Gets the name given to the filter when it was created.
* @memberof GeisFilter
*
* @param[in] filter The filter.
*/
GEIS_API GeisString geis_filter_name(GeisFilter filter);
/**
* Adds a term to a filter.
* @memberof GeisFilter
*
* @param[in] filter The filter.
* @param[in] facility The term facility.
* @param[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:
* @code
* 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);
* @endcode
*
* 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_API GEIS_VARARG GeisStatus geis_filter_add_term(GeisFilter filter,
GeisFilterFacility facility,
...);
/* @} */
/**
* @defgroup geis_v2_subscription Gesture Subscription
* @ingroup geis_v2
* @{
*/
/**
* @class GeisSubscription
* A gesture recognition subscription.
*/
/** @cond typedef */
typedef struct _GeisSubscription *GeisSubscription;
/** @endcond */
/**
* @enum GeisSubscriptionFlags
*
* These flags are used when creating a new subscription and affect the nature
* 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 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.
*/
enum
{
GEIS_SUBSCRIPTION_NONE = 0x0000,
GEIS_SUBSCRIPTION_GRAB = 0x0001,
GEIS_SUBSCRIPTION_CONT = 0x0002
};
typedef int GeisSubscriptionFlags;
/**
* Creates a new subscription.
* @memberof GeisSubscription
*
* @param[in] geis The GEIS API instance.
* @param[in] name A name.
* @param[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_API GeisSubscription geis_subscription_new(Geis geis,
GeisString name,
GeisSubscriptionFlags flags);
/**
* Destroys a GEIS v2.0 subscription object.
* @memberof GeisSubscription
*
* @param[in] subscription The subscription.
*/
GEIS_API GeisStatus geis_subscription_delete(GeisSubscription subscription);
/**
* Activates a subscription.
* @memberof GeisSubscription
*
* @param[in] subscription The subscription.
*
* Puts the subscription into the active state. Gesture events will be
* delivered for this subscription.
*/
GEIS_API GeisStatus geis_subscription_activate(GeisSubscription subscription);
/**
* Deactivates a subscription.
* @memberof GeisSubscription
*
* @param[in] subscription The subscription.
*
* Puts the subscription into the inactive state. Gesture events will not be
* delivered for this subscription.
*/
GEIS_API GeisStatus geis_subscription_deactivate(GeisSubscription subscription);
/**
* Gets the name given to a subscription when it was created.
* @memberof GeisSubscription
*
* @param[in] subscription The subscription.
*/
GEIS_API GeisString geis_subscription_name(GeisSubscription subscription);
/**
* Gets the ID assigned to a subscription when it was created.
* @memberof GeisSubscription
*
* @param[in] subscription The subscription.
*/
GEIS_API GeisInteger geis_subscription_id(GeisSubscription subscription);
/**
* Adds a filter to a subscription.
* @memberof GeisSubscription
*
* @param[in] subscription The subscription.
* @param[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_API GeisStatus geis_subscription_add_filter(GeisSubscription subscription,
GeisFilter filter);
/**
* Gets an named filter from a subscription.
* @memberof GeisSubscription
*
* @param[in] sub The subscription.
* @param[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_API GeisFilter geis_subscription_filter_by_name(GeisSubscription sub,
GeisString name);
/**
* Removes a filter from a subscription.
* @memberof GeisSubscription
*
* @param[in] subscription The subscription.
* @param[in] filter The filter to be removed from the subscription.
*
* Ownership of the filter is passed to the caller.
*/
GEIS_API GeisStatus geis_subscription_remove_filter(GeisSubscription subscription,
GeisFilter filter);
/**
* Gets a subscription-level configuration item.
*
* @param[in] subscription The subscription from which the configuration
* item will be retrieved.
* @param[in] config_item_name The name of the configuration item.
* @param[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.
*
* @retval GEIS_STATUS_BAD_ARGUMENT an invalid argument value was passed
* @retval GEIS_STATUS_NOT_SUPPORTED the configuration value is not supported
* @retval GEIS_STATUS_SUCCESS normal successful completion
*/
GEIS_API GeisStatus geis_subscription_get_configuration(GeisSubscription subscription,
GeisString config_item_name,
GeisPointer config_item_value);
/**
* Sets a subscription-level configuration item.
*
* @param[in] subscription The subscription from which the configuration
* item will be retrieved.
* @param[in] config_item_name The name of the configuration item.
* @param[in] config_item_value A pointer to an appropriate variable holding
* the config item value.
*
* Not all back ends support all configuration items.
*
* @retval GEIS_STATUS_BAD_ARGUMENT an invalid argument value was passed
* @retval GEIS_STATUS_NOT_SUPPORTED the configuration value is not supported
* @retval GEIS_STATUS_SUCCESS normal successful completion
*/
GEIS_API GeisStatus geis_subscription_set_configuration(GeisSubscription subscription,
GeisString config_item_name,
GeisPointer config_item_value);
/* @} */
/**
* @defgroup geis_v2_gesture Gesture Frames
* @ingroup geis_v2
* Gesture state information.
*
* Gesture frames, and their associated groups and touches, convey information
* 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 _GeisGroupSet *GeisGroupSet;
typedef GeisSize GeisTouchId;
typedef struct _GeisTouch *GeisTouch;
typedef struct _GeisTouchSet *GeisTouchSet;
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 attributes,
* one containing a GeisGroupSet and one containing a GeisTouchSet.
*
* For example: If four fingers are being simultaneously moved over a touchpad
* or touchscreen surface, Geis could start generating gesture events
* containing two groups: One group having a single frame from a four-fingers
* gesture of some class and a second group having two frames, each from a
* different two-fingers gesture (like one from a Rotate and the other from a
* Pinch gesture).
* This means that geis could interpret the movements of those four touch points as
* both a single four-fingers gesture and as two separate two-fingers gestures.
*
* There can be only a single frame per gesture in a gesture event. I.e. no two
* frames will return the same GeisGestureId in the same gesture event.
*
* @{
*
* @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.
*
* @def GEIS_EVENT_ATTRIBUTE_CONSTRUCTION_FINISHED
* Event attribute containing a boolean.
* This property allows the client to determine if all the possible gestures
* from the set of touches in this event have already been presented. When
* this value is true, the client will have received all the information needed
* to make a gesture accept and reject decision based on potentially
* overlapping gestures. An example is when both one and two touch gestures are
* subscribed on the same window with the same gesture classes and thresholds.
* When this property is true for one touch gesture events, the client can be
* sure there are no other touches unless a two touch gesture event has already
* been sent.
* Another example is when you subscribe for three touches Touch and four
* touches Drag. As soon as a third finger is detected a three touches Touch
* gesture will begin, but you cannot be sure a fourth finger isn't coming
* right after (that can eventually cause a four touches Drag) until this
* property is true.
*/
#define GEIS_EVENT_ATTRIBUTE_GROUPSET "group set"
#define GEIS_EVENT_ATTRIBUTE_TOUCHSET "touch set"
#define GEIS_EVENT_ATTRIBUTE_CONSTRUCTION_FINISHED "construction finished"
/* @} */
/**
* @name Touch Attributes
*
* @par
* Each touch has zero or more attributes associated with it. Differing hardware
* is capable of reporting differing sets of touch attributes, so there is no
* guarantee that any or all of the defined touch attributes will bre present.
*
* If the touch comes from a direct device (see
* GEIS_DEVICE_ATTRIBUTE_DIRECT_TOUCH) its position (x and y attributes) will
* be in window coordinates, otherwise it will be in the input device's own
* coordinate system.
*
* @{
*
* @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.
* @memberof GeisGroupSet
*
* @param[in] groupset The groupset.
*/
GEIS_API GeisSize geis_groupset_group_count(GeisGroupSet groupset);
/**
* Gets an indicated gesture group from a groupset.
* @memberof GeisGroupSet
*
* @param[in] groupset The groupset.
* @param[in] index Indicates which gesture group to retrieve.
*/
GEIS_API GeisGroup geis_groupset_group(GeisGroupSet groupset, GeisSize index);
/**
* Gets the identifier of a gesture group.
* @memberof GeisGroup
*
* @param[in] group The gesture group.
*/
GEIS_API GeisInteger geis_group_id(GeisGroup group);
/**
* Gets the number of gesture frames in a gesture group.
* @memberof GeisGroup
*
* @param[in] group The gesture group.
*/
GEIS_API GeisSize geis_group_frame_count(GeisGroup group);
/**
* Gets an indicated gesture frame from a gesture group.
* @memberof GeisGroup
*
* @param[in] group The gesture group.
* @param[in] index Indicates which gesture frame to retrieve.
*/
GEIS_API GeisFrame geis_group_frame(GeisGroup group, GeisSize index);
/**
* Marks a gesture group as rejected.
* @memberof GeisGroup
*
* @param[in] group The gesture group to reject.
*/
GEIS_API void geis_group_reject(GeisGroup group);
/**
* Gets the number of touches in a touchset.
* @memberof GeisTouchSet
*
* @param[in] touchset The touchset,
*/
GEIS_API GeisSize geis_touchset_touch_count(GeisTouchSet touchset);
/**
* Gets an indicated touch from a touchset.
* @memberof GeisTouchSet
*
* @param[in] touchset The touchset.
* @param[in] index Indicates which touch to retrieve.
*/
GEIS_API GeisTouch geis_touchset_touch(GeisTouchSet touchset, GeisSize index);
/**
* Gets an identified touch from a touchset.
* @memberof GeisTouchSet
*
* @param[in] touchset The touchset.
* @param[in] touchid Identifies a touch.
*
* Returns the identified touch, or NULL if the touchid is not in the touchset.
*/
GEIS_API GeisTouch geis_touchset_touch_by_id(GeisTouchSet touchset,
GeisTouchId touchid);
/**
* Gets the identifier of a touch.
* @memberof GeisTouch
*
* @param[in] touch The touch.
*/
GEIS_API GeisTouchId geis_touch_id(GeisTouch touch);
/**
* Gets the number of attrs associated with a touch.
* @memberof GeisTouch
*
* @param[in] touch The touch.
*/
GEIS_API GeisSize geis_touch_attr_count(GeisTouch touch);
/**
* Gets an indicated attr from a touch.
* @memberof GeisTouch
*
* @param[in] touch The touch.
* @param[in] index Indicates which attr to retrieve.
*/
GEIS_API GeisAttr geis_touch_attr(GeisTouch touch, GeisSize index);
/**
* Gets a named attr from a touch.
* @memberof GeisTouch
*
* @param[in] touch The touch.
* @param[in] name Names the attr to retrieve.
*
* @returns the named attr if it is present, NULL otherwise.
*/
GEIS_API GeisAttr geis_touch_attr_by_name(GeisTouch touch, GeisString name);
/**
* Gets the identifier of a gesture frame.
* @memberof GeisFrame
*
* @param[in] frame the gesture frame.
*
* @returns the identifier of the gesture to which the given frame belongs.
*/
GEIS_API GeisGestureId geis_frame_id(GeisFrame frame);
/**
* Indicates if a gesture frame belongs to a gesture class.
* @memberof GeisFrame
*
* @param[in] frame The gesture frame.
* @param[in] gesture_class The gesture class.
*
* @returns true if the gesture can currently be classified by the @p
* gesture_class, false otherwise.
*/
GEIS_API GeisBoolean geis_frame_is_class(GeisFrame frame,
GeisGestureClass gesture_class);
/**
* Gets the number of attrs associated with a gesture frame.
* @memberof GeisFrame
*
* @param[in] frame The gesture frame.
*/
GEIS_API GeisSize geis_frame_attr_count(GeisFrame frame);
/**
* Gets an indicated attr from a gesture frame.
* @memberof GeisFrame
*
* @param[in] frame The gesture frame.
* @param[in] index Indicates which attr to retrieve.
*/
GEIS_API GeisAttr geis_frame_attr(GeisFrame frame, GeisSize index);
/**
* Gets a named attr from a gesture frame.
* @memberof GeisFrame
*
* @param[in] frame The gesture frame.
* @param[in] name Names the attr to retrieve, such as one of the
* GEIS_GESTURE_ATTRIBUTE_* constants.
* @returns the named attr if it is present, NULL otherwise.
*
* Usage example:
* @code
* GeisAttr angle = geis_frame_attr_by_name(frame, GEIS_GESTURE_ATTRIBUTE_ANGLE);
* @endcode
*/
GEIS_API GeisAttr geis_frame_attr_by_name(GeisFrame frame, GeisString name);
/**
* Gets the current transform matrix of a gesture.
* @memberof GeisFrame
*
* @param[in] frame The gesture frame.
*/
GEIS_API GeisFloat *geis_frame_matrix(GeisFrame frame);
/**
* Gets the number of touches making up a gesture for the frame.
* @memberof GeisFrame
*
* @param[in] frame The gesture frame.
*/
GEIS_API GeisSize geis_frame_touchid_count(GeisFrame frame);
/**
* Gets the ID of the indicated touch within the gesture frame.
* @memberof GeisFrame
*
* @param[in] frame The gesture frame.
* @param[in] index Indicates which touch ID to retrieve.
*/
GEIS_API GeisTouchId geis_frame_touchid(GeisFrame frame, GeisSize index);
/**
* Marks a gesture as accepted.
*
* @param[in] geis The GEIS instance.
* @param[in] group The gesture group containing the accepted gesture.
* @param[in] gesture_id Identifies the gesture.
*
* @sa geis_frame_id
*/
GEIS_API GeisStatus geis_gesture_accept(Geis geis,
GeisGroup group,
GeisGestureId gesture_id);
/**
* Marks a gesture as rejected.
*
* @param[in] geis The GEIS instance.
* @param[in] group The gesture group containing the rejected gesture.
* @param[in] gesture_id Identifies the gesture.
*
* After you reject a gesture you no longer get its frames.
*
* @sa geis_frame_id
*/
GEIS_API GeisStatus geis_gesture_reject(Geis geis,
GeisGroup group,
GeisGestureId gesture_id);
/* @} */
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* GEIS_GEIS_H_ */
geis-2.2.17+16.04.20160126/libs/ 0000755 0000156 0000165 00000000000 12651717732 016040 5 ustar pbuser pbgroup 0000000 0000000 geis-2.2.17+16.04.20160126/libs/geis-dbus/ 0000755 0000156 0000165 00000000000 12651717732 017722 5 ustar pbuser pbgroup 0000000 0000000 geis-2.2.17+16.04.20160126/libs/geis-dbus/geis_dbus_region.h 0000644 0000156 0000165 00000002511 12651717544 023402 0 ustar pbuser pbgroup 0000000 0000000 /**
* @file geis_dbus_region.h
* @brief Interface for the GEIS DBus region transport.
*/
/*
* Copyright 2011 Canonical Ltd.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of version 3 of the GNU Lesser General Public License as published
* by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef GEIS_DBUS_REGION_H_
#define GEIS_DBUS_REGION_H_
#include
#include "geis/geis.h"
#include "geis_filterable.h"
/**
* Creates a Dbus "region available" message from a GEIS region.
*
* @param[in] fa A GEIS region filterable attribute.
*/
DBusMessage *
geis_dbus_region_available_message_from_region(GeisFilterableAttribute fa);
/**
* Creates GEIS region filterable attribute from a DBus "region available"
* message.
*
* @param[in] message A DBus message.
*/
GeisFilterableAttribute
geis_dbus_region_from_region_available_message(DBusMessage *message);
#endif /* GEIS_DBUS_REGION_H_ */
geis-2.2.17+16.04.20160126/libs/geis-dbus/geis_dbus_gesture_event.c 0000644 0000156 0000165 00000045747 12651717544 025013 0 ustar pbuser pbgroup 0000000 0000000 /**
* @file geis_dbus_gesture_event.c
* @brief Implementation of the GEIS DBus gesture event transport.
*/
/*
* Copyright 2011 Canonical Ltd.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of version 3 of the GNU Lesser General Public License as published
* by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include "geis_config.h"
#include "geis_dbus_gesture_event.h"
#include "geis_attr.h"
#include "geis_dbus.h"
#include "geis_dbus_attr.h"
#include "geis_event.h"
#include "geis_group.h"
#include "geis_logging.h"
#include "geis_private.h"
#include "geis_touch.h"
/**
* A frame is marshalled as a dict entry of
* {id: [array of attrs, array of classes, array of touch ids]}, which is
* {i(a(sv)aiai))} in DBus terminaology.
*/
#define GEIS_DBUS_TYPE_SIGNATURE_FRAME \
DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING \
DBUS_TYPE_INT32_AS_STRING \
DBUS_STRUCT_BEGIN_CHAR_AS_STRING \
DBUS_TYPE_ARRAY_AS_STRING \
GEIS_DBUS_TYPE_SIGNATURE_ATTR \
DBUS_TYPE_ARRAY_AS_STRING \
DBUS_TYPE_INT32_AS_STRING \
DBUS_TYPE_ARRAY_AS_STRING \
DBUS_TYPE_INT32_AS_STRING \
DBUS_STRUCT_END_CHAR_AS_STRING \
DBUS_DICT_ENTRY_END_CHAR_AS_STRING \
#define GEIS_DBUS_TYPE_SIGNATURE_FRAMESET \
DBUS_TYPE_ARRAY_AS_STRING \
GEIS_DBUS_TYPE_SIGNATURE_FRAME
static void
_marshall_touchset(GeisTouchSet touchset, DBusMessageIter *iter)
{
DBusMessageIter touchset_iter;
dbus_message_iter_open_container(iter,
DBUS_TYPE_ARRAY,
DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
DBUS_TYPE_INT32_AS_STRING
DBUS_TYPE_ARRAY_AS_STRING
GEIS_DBUS_TYPE_SIGNATURE_ATTR
DBUS_DICT_ENTRY_END_CHAR_AS_STRING,
&touchset_iter);
for (GeisSize t = 0; t < geis_touchset_touch_count(touchset); ++t)
{
DBusMessageIter touch_iter;
dbus_message_iter_open_container(&touchset_iter,
DBUS_TYPE_DICT_ENTRY,
NULL,
&touch_iter);
GeisTouch touch = geis_touchset_touch(touchset, t);
dbus_int32_t touch_id = geis_touch_id(touch);
dbus_message_iter_append_basic(&touch_iter, DBUS_TYPE_INT32, &touch_id);
DBusMessageIter attr_iter;
dbus_message_iter_open_container(&touch_iter,
DBUS_TYPE_ARRAY,
GEIS_DBUS_TYPE_SIGNATURE_ATTR,
&attr_iter);
for (GeisSize a = 0; a < geis_touch_attr_count(touch); ++a)
{
geis_dbus_attr_marshall(geis_touch_attr(touch, a), &attr_iter);
}
dbus_message_iter_close_container(&touch_iter, &attr_iter);
dbus_message_iter_close_container(&touchset_iter, &touch_iter);
}
dbus_message_iter_close_container(iter, &touchset_iter);
}
static void
_unmarshall_touchset(DBusMessageIter *iter, GeisTouchSet touchset)
{
int dtype = dbus_message_iter_get_arg_type(iter);
if (dtype != DBUS_TYPE_ARRAY)
{
geis_error("malformed GeisEvent touchset");
}
DBusMessageIter touch_iter;
dbus_message_iter_recurse(iter, &touch_iter);
for (dtype = dbus_message_iter_get_arg_type(&touch_iter);
dtype != DBUS_TYPE_INVALID;
dbus_message_iter_next(&touch_iter),
dtype = dbus_message_iter_get_arg_type(&touch_iter))
{
DBusMessageIter dict_iter;
dbus_message_iter_recurse(&touch_iter, &dict_iter);
int type = dbus_message_iter_get_arg_type(&dict_iter);
if (type != DBUS_TYPE_INT32)
{
geis_error("malformed GeisEvent touchset");
continue;
}
dbus_int32_t touch_id;
dbus_message_iter_get_basic(&dict_iter, &touch_id);
dbus_message_iter_next(&dict_iter);
GeisTouch touch = geis_touch_new(touch_id);
type = dbus_message_iter_get_arg_type(&dict_iter);
if (type != DBUS_TYPE_ARRAY)
{
geis_error("malformed GeisEvent touchset");
continue;
}
DBusMessageIter attr_iter;
dbus_message_iter_recurse(&dict_iter, &attr_iter);
for (int type = dbus_message_iter_get_arg_type(&attr_iter);
type != DBUS_TYPE_INVALID;
dbus_message_iter_next(&attr_iter),
type = dbus_message_iter_get_arg_type(&attr_iter))
{
GeisAttr attr = geis_dbus_attr_unmarshall(&attr_iter);
geis_touch_add_attr(touch, attr);
}
geis_touchset_insert(touchset, touch);
}
}
/**
* Marshalls a GEIS frame to a DBus message via a message iterator.
* @param[in] frame The GEIS frame to marshall.
* @param[in] iter The DBus message iterator.
*
* @todo The class set and matrix need to be added.
*/
static void
_marshall_frame(GeisFrame frame, DBusMessageIter *frame_iter)
{
DBusMessageIter dict_iter;
dbus_message_iter_open_container(frame_iter,
DBUS_TYPE_DICT_ENTRY,
NULL,
&dict_iter);
dbus_int32_t frame_id = geis_frame_id(frame);
dbus_message_iter_append_basic(&dict_iter, DBUS_TYPE_INT32, &frame_id);
{
DBusMessageIter struct_iter;
dbus_message_iter_open_container(&dict_iter,
DBUS_TYPE_STRUCT,
NULL,
&struct_iter);
{
DBusMessageIter attr_iter;
dbus_message_iter_open_container(&struct_iter,
DBUS_TYPE_ARRAY,
GEIS_DBUS_TYPE_SIGNATURE_ATTR,
&attr_iter);
for (GeisSize a = 0; a < geis_frame_attr_count(frame); ++a)
{
geis_dbus_attr_marshall(geis_frame_attr(frame, a), &attr_iter);
}
dbus_message_iter_close_container(&struct_iter, &attr_iter);
}
{
DBusMessageIter class_iter;
dbus_message_iter_open_container(&struct_iter,
DBUS_TYPE_ARRAY,
DBUS_TYPE_INT32_AS_STRING,
&class_iter);
for (GeisSize t = 0; t < geis_frame_class_count(frame); ++t)
{
GeisGestureClass frame_class = geis_frame_class(frame, t);
dbus_int32_t class_id = geis_gesture_class_id(frame_class);
dbus_message_iter_append_basic(&class_iter, DBUS_TYPE_INT32, &class_id);
}
dbus_message_iter_close_container(&struct_iter, &class_iter);
}
{
DBusMessageIter touch_iter;
dbus_message_iter_open_container(&struct_iter,
DBUS_TYPE_ARRAY,
DBUS_TYPE_INT32_AS_STRING,
&touch_iter);
for (GeisSize t = 0; t < geis_frame_touchid_count(frame); ++t)
{
dbus_int32_t touch_id = geis_frame_touchid(frame, t);
dbus_message_iter_append_basic(&touch_iter, DBUS_TYPE_INT32, &touch_id);
}
dbus_message_iter_close_container(&struct_iter, &touch_iter);
}
dbus_message_iter_close_container(&dict_iter, &struct_iter);
}
dbus_message_iter_close_container(frame_iter, &dict_iter);
}
/**
* Unmarshalls a GEIS frame from a DBus message via a message iterator.
* @param[in] frame_iter The DBus message iterator.
* @param[in] group The group the unmarshalled frame will belong to.
*/
static void
_unmarshall_frame(Geis geis, DBusMessageIter *frame_iter, GeisGroup group)
{
int type = dbus_message_iter_get_arg_type(frame_iter);
if (type != DBUS_TYPE_DICT_ENTRY)
{
geis_error("malformed GeisEvent frame: expected %c, received %c",
DBUS_TYPE_DICT_ENTRY, type);
goto final_exit;
}
DBusMessageIter dict_iter;
dbus_message_iter_recurse(frame_iter, &dict_iter);
type = dbus_message_iter_get_arg_type(&dict_iter);
if (type != DBUS_TYPE_INT32)
{
geis_error("malformed GeisEvent frame: expected %c, received %c",
DBUS_TYPE_INT32, type);
goto final_exit;
}
dbus_int32_t frame_id;
dbus_message_iter_get_basic(&dict_iter, &frame_id);
GeisFrame frame = geis_frame_new(frame_id);
geis_group_insert_frame(group, frame);
dbus_message_iter_next(&dict_iter);
type = dbus_message_iter_get_arg_type(&dict_iter);
if (type != DBUS_TYPE_STRUCT)
{
geis_error("malformed GeisEvent frame: expected %c, received %c",
DBUS_TYPE_STRUCT, type);
}
else
{
DBusMessageIter struct_iter;
dbus_message_iter_recurse(&dict_iter, &struct_iter);
type = dbus_message_iter_get_arg_type(&struct_iter);
if (type != DBUS_TYPE_ARRAY)
{
geis_error("malformed GeisEvent frame: expected %c, received %c",
DBUS_TYPE_ARRAY, type);
}
else
{
DBusMessageIter attr_iter;
dbus_message_iter_recurse(&struct_iter, &attr_iter);
for (int type = dbus_message_iter_get_arg_type(&attr_iter);
type != DBUS_TYPE_INVALID;
dbus_message_iter_next(&attr_iter),
type = dbus_message_iter_get_arg_type(&attr_iter))
{
GeisAttr attr = geis_dbus_attr_unmarshall(&attr_iter);
geis_frame_add_attr(frame, attr);
}
}
dbus_message_iter_next(&struct_iter),
type = dbus_message_iter_get_arg_type(&struct_iter);
if (type != DBUS_TYPE_ARRAY)
{
geis_error("malformed GeisEvent frame: expected %c, received %c",
DBUS_TYPE_ARRAY, type);
}
else
{
DBusMessageIter class_iter;
dbus_message_iter_recurse(&struct_iter, &class_iter);
for (int type = dbus_message_iter_get_arg_type(&class_iter);
type != DBUS_TYPE_INVALID;
dbus_message_iter_next(&class_iter),
type = dbus_message_iter_get_arg_type(&class_iter))
{
type = dbus_message_iter_get_arg_type(&class_iter);
if (type != DBUS_TYPE_INT32)
{
geis_error("malformed GeisEvent frame: expected %c, received %c",
DBUS_TYPE_INT32, type);
break;
}
dbus_int32_t class_id;
dbus_message_iter_get_basic(&class_iter, &class_id);
GeisGestureClassBag bag = geis_gesture_classes(geis);
for (GeisSize i = 0; i < geis_gesture_class_bag_count(bag); ++i)
{
GeisGestureClass gesture_class;
gesture_class = geis_gesture_class_bag_gesture_class(bag, i);
if (geis_gesture_class_id(gesture_class) == class_id)
{
geis_frame_set_is_class(frame, gesture_class);
break;
}
}
}
}
dbus_message_iter_next(&struct_iter),
type = dbus_message_iter_get_arg_type(&struct_iter);
if (type != DBUS_TYPE_ARRAY)
{
geis_error("malformed GeisEvent frame: expected %c, received %c",
DBUS_TYPE_ARRAY, type);
}
else
{
DBusMessageIter touch_iter;
dbus_message_iter_recurse(&struct_iter, &touch_iter);
for (int type = dbus_message_iter_get_arg_type(&touch_iter);
type != DBUS_TYPE_INVALID;
dbus_message_iter_next(&touch_iter),
type = dbus_message_iter_get_arg_type(&touch_iter))
{
type = dbus_message_iter_get_arg_type(&touch_iter);
if (type != DBUS_TYPE_INT32)
{
geis_error("malformed GeisEvent frame: expected %c, received %c",
DBUS_TYPE_INT32, type);
break;
}
dbus_int32_t touch_id;
dbus_message_iter_get_basic(&touch_iter, &touch_id);
geis_frame_add_touchid(frame, touch_id);
}
}
}
final_exit:
return;
}
/**
* Marshalls a GEIS groupset to a DBus message via a message iterator.
* @param[in] groupset The GEIS groupset.
* @param[in] iter A DBus message iterator.
*/
static void
_marshall_groupset(GeisGroupSet groupset, DBusMessageIter *iter)
{
DBusMessageIter groupset_iter;
dbus_message_iter_open_container(iter,
DBUS_TYPE_ARRAY,
DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
DBUS_TYPE_INT32_AS_STRING
GEIS_DBUS_TYPE_SIGNATURE_FRAMESET
DBUS_DICT_ENTRY_END_CHAR_AS_STRING,
&groupset_iter);
for (GeisSize i = 0; i < geis_groupset_group_count(groupset); ++i)
{
GeisGroup group = geis_groupset_group(groupset, i);
if (!group)
{
geis_warning("can not extract group %zu from groupset", i);
goto final_exit;
}
DBusMessageIter group_iter;
dbus_message_iter_open_container(&groupset_iter,
DBUS_TYPE_DICT_ENTRY,
NULL,
&group_iter);
dbus_int32_t group_id = geis_group_id(group);
dbus_message_iter_append_basic(&group_iter, DBUS_TYPE_INT32, &group_id);
DBusMessageIter frameset_iter;
dbus_message_iter_open_container(&group_iter,
DBUS_TYPE_ARRAY,
GEIS_DBUS_TYPE_SIGNATURE_FRAME,
&frameset_iter);
for (GeisSize j = 0; j < geis_group_frame_count(group); ++j)
{
GeisFrame frame = geis_group_frame(group, j);
if (!frame)
{
geis_warning("can not extract frame %zu from group", j);
goto final_exit;
}
_marshall_frame(frame, &frameset_iter);
}
dbus_message_iter_close_container(&group_iter, &frameset_iter);
dbus_message_iter_close_container(&groupset_iter, &group_iter);
}
dbus_message_iter_close_container(iter, &groupset_iter);
final_exit:
return;
}
static void
_unmarshall_groupset(Geis geis, DBusMessageIter *iter, GeisGroupSet groupset)
{
int dtype = dbus_message_iter_get_arg_type(iter);
if (dtype != DBUS_TYPE_ARRAY)
{
geis_error("malformed GeisEvent groupset");
}
DBusMessageIter groupset_iter;
dbus_message_iter_recurse(iter, &groupset_iter);
for (dtype = dbus_message_iter_get_arg_type(&groupset_iter);
dtype != DBUS_TYPE_INVALID;
dbus_message_iter_next(&groupset_iter),
dtype = dbus_message_iter_get_arg_type(&groupset_iter))
{
DBusMessageIter group_iter;
dbus_message_iter_recurse(&groupset_iter, &group_iter);
int type = dbus_message_iter_get_arg_type(&group_iter);
if (type != DBUS_TYPE_INT32)
{
geis_error("malformed GeisEvent group");
continue;
}
dbus_int32_t group_id;
dbus_message_iter_get_basic(&group_iter, &group_id);
GeisGroup group = geis_group_new(group_id);
geis_groupset_insert(groupset, group);
dbus_message_iter_next(&group_iter);
DBusMessageIter frameset_iter;
dbus_message_iter_recurse(&group_iter, &frameset_iter);
for (int ftype = dbus_message_iter_get_arg_type(&frameset_iter);
ftype != DBUS_TYPE_INVALID;
dbus_message_iter_next(&frameset_iter),
ftype = dbus_message_iter_get_arg_type(&frameset_iter))
{
_unmarshall_frame(geis, &frameset_iter, group);
}
}
}
/*
* Creates a Dbus "gesture event" message from a GEIS gesture event.
*
* A gesture event has the following structure.
* - a numeric event type (begin/update/end)
* - a set of one or more touches, where each touch has
* - a touch ID
* - a set of one or more attrs
* - a set of one or more gesture groups, where is group has
* - a group ID
* - a set of one or more gesture frames, where each frame has
* - a set of one or more gesture classes
* - a set of one or more gesture attrs
* - a zet of one or more touch indexes
*
* @todo add the gesture classes
*/
DBusMessage *
geis_dbus_gesture_event_message_from_geis_event(GeisEvent event)
{
DBusMessage *message = dbus_message_new_signal(GEIS_DBUS_SERVICE_PATH,
GEIS_DBUS_SERVICE_INTERFACE,
GEIS_DBUS_GESTURE_EVENT);
DBusMessageIter iter;
dbus_message_iter_init_append(message, &iter);
dbus_uint32_t event_type = geis_event_type(event);
dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &event_type);
GeisAttr attr = geis_event_attr_by_name(event, GEIS_EVENT_ATTRIBUTE_TOUCHSET);
if (!attr)
{
geis_error("no touchset for gesture event");
goto final_exit;
}
GeisTouchSet touchset = geis_attr_value_to_pointer(attr);
if (!touchset)
{
geis_warning("can not convert attr to touchset");
goto final_exit;
}
_marshall_touchset(touchset, &iter);
attr = geis_event_attr_by_name(event, GEIS_EVENT_ATTRIBUTE_GROUPSET);
if (!attr)
{
geis_error("no groupset for gesture event");
goto final_exit;
}
GeisGroupSet groupset = geis_attr_value_to_pointer(attr);
if (!groupset)
{
geis_warning("can not convert attr to groupset");
goto final_exit;
}
_marshall_groupset(groupset, &iter);
final_exit:
return message;
}
/*
* Indicates if a DBus message is a "gesture event" message.
*/
GeisBoolean
geis_dbus_message_is_gesture_event(DBusMessage *message)
{
GeisBoolean is_gesture_event_message = GEIS_FALSE;
if (dbus_message_is_signal(message,
GEIS_DBUS_SERVICE_INTERFACE,
GEIS_DBUS_GESTURE_EVENT))
{
is_gesture_event_message = GEIS_TRUE;
}
return is_gesture_event_message;
}
/*
* Creates GEIS event from a DBus "gesture_event" message.
*/
GeisEvent
geis_dbus_gesture_event_from_message(Geis geis, DBusMessage *message)
{
DBusMessageIter iter;
dbus_message_iter_init(message, &iter);
dbus_uint32_t event_type;
dbus_message_iter_get_basic(&iter, &event_type);
GeisEvent event = geis_event_new(event_type);
dbus_message_iter_next(&iter);
GeisTouchSet touchset = geis_touchset_new();
_unmarshall_touchset(&iter, touchset);
GeisAttr touch_attr = geis_attr_new(GEIS_EVENT_ATTRIBUTE_TOUCHSET,
GEIS_ATTR_TYPE_POINTER,
touchset);
geis_attr_set_destructor(touch_attr, (GeisAttrDestructor)geis_touchset_delete);
geis_event_add_attr(event, touch_attr);
dbus_message_iter_next(&iter);
GeisGroupSet groupset = geis_groupset_new();
_unmarshall_groupset(geis, &iter, groupset);
GeisAttr group_attr = geis_attr_new(GEIS_EVENT_ATTRIBUTE_GROUPSET,
GEIS_ATTR_TYPE_POINTER,
groupset);
geis_attr_set_destructor(group_attr, (GeisAttrDestructor)geis_groupset_delete);
geis_event_add_attr(event, group_attr);
return event;
}
geis-2.2.17+16.04.20160126/libs/geis-dbus/geis_dbus_device.h 0000644 0000156 0000165 00000003173 12651717544 023363 0 ustar pbuser pbgroup 0000000 0000000 /**
* @file geis_dbus_device.h
* @brief Interface for the GEIS DBus device transport.
*/
/*
* Copyright 2011 Canonical Ltd.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of version 3 of the GNU Lesser General Public License as published
* by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef GEIS_DBUS_DEVICE_H_
#define GEIS_DBUS_DEVICE_H_
#include
#include "geis/geis.h"
/**
* Creates a Dbus "device available" message from a GEIS device.
*
* @param[in] device A GEIS device.
*/
DBusMessage *
geis_dbus_device_available_message_from_device(GeisDevice device);
/**
* Creates GEIS device from a DBus "device available" message.
*
* @param[in] message A DBus message.
*/
GeisDevice
geis_dbus_device_device_from_available_message(DBusMessage *message);
/**
* Creates a Dbus "device unavailable" message from a GEIS device.
*
* @param[in] device A GEIS device.
*/
DBusMessage *
geis_dbus_device_unavailable_message_from_device(GeisDevice device);
/**
* Creates GEIS device from a DBus "device unavailable" message.
*
* @param[in] message A DBus message.
*/
GeisDevice
geis_dbus_device_device_from_unavailable_message(DBusMessage *message);
#endif /* GEIS_DBUS_DEVICE_H_ */
geis-2.2.17+16.04.20160126/libs/geis-dbus/Makefile.am 0000644 0000156 0000165 00000002751 12651717544 021764 0 ustar pbuser pbgroup 0000000 0000000 #
# @file libs/geis-dbus/Makefile.am
# @brief automake recipe for the GEIS v2.0 DBus helper library
#
# Copyright 2011 Canonical, Ltd.
#
# This file is part of the geis library. This library is free software;
# you can redistribute it and/or modify it under the terms of the GNU Lesser
# General Public License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
noinst_LTLIBRARIES = libgeis-dbus.la
dist_libgeis_dbus_la_SOURCES = \
geis_dbus.h \
geis_dbus_attr.h geis_dbus_attr.c \
geis_dbus_class.h geis_dbus_class.c \
geis_dbus_device.h geis_dbus_device.c \
geis_dbus_dispatcher.h geis_dbus_dispatcher.c \
geis_dbus_gesture_event.h geis_dbus_gesture_event.c \
geis_dbus_region.h geis_dbus_region.c \
geis_dbus_subscription.h geis_dbus_subscription.c
libgeis_dbus_la_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/libgeis \
-I$(top_srcdir)/libs/geis-util \
$(DBUS_CFLAGS)
libgeis_dbus_la_LIBADD = \
$(DBUS_LIBS)
geis-2.2.17+16.04.20160126/libs/geis-dbus/geis_dbus_attr.h 0000644 0000156 0000165 00000003124 12651717544 023072 0 ustar pbuser pbgroup 0000000 0000000 /**
* @file geis_dbus_attr.h
* @brief Interface for the GEIS DBus attr transport.
*/
/*
* Copyright 2011 Canonical Ltd.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of version 3 of the GNU Lesser General Public License as published
* by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef GEIS_DBUS_ATTR_H_
#define GEIS_DBUS_ATTR_H_
#include
#include "geis/geis.h"
/**
* The DBus type signature for a GEIS attrlist entry.
*/
#define GEIS_DBUS_TYPE_SIGNATURE_ATTR \
DBUS_STRUCT_BEGIN_CHAR_AS_STRING \
DBUS_TYPE_STRING_AS_STRING \
DBUS_TYPE_VARIANT_AS_STRING \
DBUS_STRUCT_END_CHAR_AS_STRING
/**
* Marshalls a single GEIS attr to an open DBus message container iterator.
*
* @param[in] attr The GEIS attr.
* @param[in] iter The DBus message iterator.
*/
void
geis_dbus_attr_marshall(GeisAttr attr, DBusMessageIter *iter);
/**
* Unmarshalls a single GEIS attr from a DBus message iterator.
*
* @param[in] iter The DBus message iterator.
*
* @returns a GEIS attribute or NULL on error.
*/
GeisAttr
geis_dbus_attr_unmarshall(DBusMessageIter *iter);
#endif /* GEIS_DBUS_ATTR_H_ */
geis-2.2.17+16.04.20160126/libs/geis-dbus/geis_dbus.h 0000644 0000156 0000165 00000003445 12651717544 022046 0 ustar pbuser pbgroup 0000000 0000000 /**
* @file geis_dbus.h
* @brief Common definitions for the GEIS DBus module(s).
*/
/*
* Copyright 2011 Canonical Ltd.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of version 3 of the GNU Lesser General Public License as published
* by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef GEIS_DBUS_H_
#define GEIS_DBUS_H_
#define GEIS_DBUS_SERVICE_PATH "/com/canonical/oif/Geis"
#define GEIS_DBUS_SERVICE_INTERFACE "com.canonical.oif.Geis"
#define GEIS_DBUS_GET_SERVER_ADDRESS "GetServerAddress"
#define GEIS_DBUS_INIT_COMPLETE "InitComplete"
#define GEIS_DBUS_DEVICE_AVAILABLE "DeviceAvailable"
#define GEIS_DBUS_DEVICE_UNAVAILABLE "DeviceUnavailable"
#define GEIS_DBUS_CLASS_AVAILABLE "ClassAvailable"
#define GEIS_DBUS_CLASS_UNAVAILABLE "ClassUnavailable"
#define GEIS_DBUS_REGION_AVAILABLE "RegionAvailable"
#define GEIS_DBUS_REGION_UNAVAILABLE "RegionUnavailable"
#define GEIS_DBUS_SUBSCRIPTION_CREATE "SubscriptionCreate"
#define GEIS_DBUS_SUBSCRIPTION_ACTIVATE "SubscriptionActivate"
#define GEIS_DBUS_SUBSCRIPTION_DEACTIVATE "SubscriptionDeactivate"
#define GEIS_DBUS_SUBSCRIPTION_DESTROY "SubscriptionDestroy"
#define GEIS_DBUS_GESTURE_EVENT "GestureEvent"
#define GEIS_DBUS_ERROR_SUBSCRIPTION_FAIL GEIS_DBUS_SERVICE_INTERFACE \
".SubscriptionFail"
#endif /* GEIS_DBUS_H_ */
geis-2.2.17+16.04.20160126/libs/geis-dbus/geis_dbus_subscription.h 0000644 0000156 0000165 00000014502 12651717544 024646 0 ustar pbuser pbgroup 0000000 0000000 /**
* @file geis_dbus_subscription.h
* @brief Interface for the GEIS DBus subscription transport.
*/
/*
* Copyright 2011 Canonical Ltd.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of version 3 of the GNU Lesser General Public License as published
* by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef GEIS_DBUS_SUBSCRIPTION_H_
#define GEIS_DBUS_SUBSCRIPTION_H_
#include
#include "geis/geis.h"
/**
* Indicates if a DBus message is a GEIS_DBUS_SUBSCRIPTION_CREATE method call.
*
* @param[in] message A DBus message.
*
* This function is used on the server side to identify if a received message is
* a GEIS_DBUS_SUBSCRIPTION_CREATE method call.
*
* @returns GEIS_TRUE if the message is GEIS_DBUS_SUBSCRIPTION_CREATE,
* GEIS_FALSE otherwise.
*/
GeisBoolean
geis_dbus_message_is_subscription_create_call(DBusMessage *message);
/**
* Creates a GEIS_DBUS_SUBSCRIPTION_CREATE method call message.
*
* @param[in] subscription A GEIS subscription.
*
* This function is used on the client side to create a
* GEIS_DBUS_SUBSCRIPTION_CREATE method call message from a local
* %GeisSubscription object.
*
* @returns A DBus message object.
*/
DBusMessage *
geis_dbus_subscription_create_call_message(GeisSubscription subscription);
/**
* Creates a %GeisSubscription from a GEIS_DBUS_SUBSCRIPTION_CREATE method call
* message.
*
* @param[in] geis A %Geis instance.
* @param[in] message A DBus message.
*
* This function is used on the server side to create a subscription object to
* proxy the client-side subscription object.
*
* @returns a %GeisSubscription or NULL on failure.
*/
GeisSubscription
geis_dbus_subscription_from_create_call_message(Geis geis, DBusMessage *message);
/**
* Creates a GEIS_DBUS_SUBSCRIPTION_CREATE method return message.
*
* @param[in] message The DBUs method_call message to reply to.
* @param[in] subscription A GEIS subscription.
*
* This function is used on the server side to create a response to a received
* GEIS_DBUS_SUBSCRIPTION_CREATE method call message.
*
* @returns A DBus message object.
*/
DBusMessage *
geis_dbus_subscription_create_return_message(DBusMessage *message,
GeisSubscription subscription);
/**
* Indicates if a DBus message is a GEIS_DBUS_SUBSCRIPTION_ACTIVATE message.
*
* @param[in] message A DBus message.
*
* @returns GEIS_TRUE if the message is GEIS_DBUS_SUBSCRIPTION_ACTIVATE,
* GEIS_FALSE otherwise.
*/
GeisBoolean
geis_dbus_message_is_subscription_activate_call(DBusMessage *message);
/**
* Creates a GEIS_DBUS_SUBSCRIPTION_ACTIVATE method call message.
*
* @param[in] subscription A GEIS subscription.
*
* This function is used on the client side to create a
* GEIS_DBUS_SUBSCRIPTION_ACTIVATE method call message from a local
* %GeisSubscription object.
*
* @returns A DBus message object.
*/
DBusMessage *
geis_dbus_subscription_activate_call_message(GeisSubscription subscription);
/**
* Creates a GEIS_DBUS_SUBSCRIPTION_ACTIVATE method return message.
*
* @param[in] message The DBUs method_call message to reply to.
* @param[in] subscription A GEIS subscription.
*
* This function is used on the server side to create a response to a received
* GEIS_DBUS_SUBSCRIPTION_ACTIVATE method call message.
*
* @returns A DBus message object.
*/
DBusMessage *
geis_dbus_subscription_activate_return_message(DBusMessage *message,
GeisSubscription subscription);
/**
* Indicates if a DBus message is a GEIS_DBUS_SUBSCRIPTION_DEACTIVATE message.
*
* @param[in] message A DBus message.
*
* @returns GEIS_TRUE if the message is GEIS_DBUS_SUBSCRIPTION_DEACTIVATE,
* GEIS_FALSE otherwise.
*/
GeisBoolean
geis_dbus_message_is_subscription_deactivate_call(DBusMessage *message);
/**
* Creates a GEIS_DBUS_SUBSCRIPTION_DEACTIVATE method return message.
*
* @param[in] message The DBUs method_call message to reply to.
* @param[in] subscription A GEIS subscription.
*
* This function is used on the server side to create a response to a received
* GEIS_DBUS_SUBSCRIPTION_DEACTIVATE method call message.
*
* @returns A DBus message object.
*/
DBusMessage *
geis_dbus_subscription_deactivate_return_message(DBusMessage *message,
GeisSubscription subscription);
/**
* Creates a GEIS_DBUS_SUBSCRIPTION_DEACTIVATE method call message.
*
* @param[in] subscription A GEIS subscription.
*
* This function is used on the client side to create a
* GEIS_DBUS_SUBSCRIPTION_DEACTIVATE method call message from a local
* %GeisSubscription object.
*
* @returns A DBus message object.
*/
DBusMessage *
geis_dbus_subscription_deactivate_call_message(GeisSubscription subscription);
/**
* Indicates if a DBus message is a GEIS_DBUS_SUBSCRIPTION_DESTROY message.
*
* @param[in] message A DBus message.
*
* @returns GEIS_TRUE if the message is GEIS_DBUS_SUBSCRIPTION_DESTROY,
* GEIS_FALSE otherwise.
*/
GeisBoolean
geis_dbus_message_is_subscription_destroy_call(DBusMessage *message);
/**
* Creates a GEIS_DBUS_SUBSCRIPTION_DESTROY method call message.
*
* @param[in] subscription A GEIS subscription.
*
* This function is used on the client side to create a
* GEIS_DBUS_SUBSCRIPTION_DESTROY method call message from a local
* %GeisSubscription object.
*
* @returns A DBus message object.
*/
DBusMessage *
geis_dbus_subscription_destroy_call_message(GeisSubscription subscription);
/**
* Creates a GEIS_DBUS_SUBSCRIPTION_DESTROY method return message.
*
* @param[in] message The DBUs method_call message to reply to.
*
* This function is used on the server side to create a response to a received
* GEIS_DBUS_SUBSCRIPTION_DESTROY method call message.
*
* @returns A DBus message object.
*/
DBusMessage *
geis_dbus_subscription_destroy_return_message(DBusMessage *message);
#endif /* GEIS_DBUS_SUBSCRIPTION_H_ */
geis-2.2.17+16.04.20160126/libs/geis-dbus/geis_dbus_class.h 0000644 0000156 0000165 00000002431 12651717544 023225 0 ustar pbuser pbgroup 0000000 0000000 /**
* @file geis_dbus_class.h
* @brief Interface for the GEIS DBus gesture class transport.
*/
/*
* Copyright 2011 Canonical Ltd.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of version 3 of the GNU Lesser General Public License as published
* by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef GEIS_DBUS_GESTURE_CLASS_H_
#define GEIS_DBUS_GESTURE_CLASS_H_
#include
#include "geis/geis.h"
/**
* Creates a Dbus "class available" message from a GEIS class.
*
* @param[in] class A GEIS gesture class.
*/
DBusMessage *
geis_dbus_class_available_message_from_class(GeisGestureClass gesture_class);
/**
* Creates GEIS class from a DBus "class available" message.
*
* @param[in] message A DBus message.
*/
GeisGestureClass
geis_dbus_class_class_from_available_message(DBusMessage *message);
#endif /* GEIS_DBUS_GESTURE_CLASS_H_ */
geis-2.2.17+16.04.20160126/libs/geis-dbus/geis_dbus_attr.c 0000644 0000156 0000165 00000012461 12651717544 023071 0 ustar pbuser pbgroup 0000000 0000000 /**
* @file geis_dbus_attr.c
* @brief Implementation of the GEIS DBus attr transport.
*/
/*
* Copyright 2011 Canonical Ltd.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of version 3 of the GNU Lesser General Public License as published
* by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include "geis_config.h"
#include "geis_dbus_attr.h"
#include "geis_attr.h"
#include "geis_logging.h"
/*
* Marshalls a single GEIS attr to an open DBus message container iterator.
*/
void
geis_dbus_attr_marshall(GeisAttr attr, DBusMessageIter *iter)
{
DBusMessageIter dict_iter;
GeisString attr_name = geis_attr_name(attr);
dbus_message_iter_open_container(iter,
DBUS_TYPE_STRUCT,
NULL,
&dict_iter);
dbus_message_iter_append_basic(&dict_iter, DBUS_TYPE_STRING, &attr_name);
switch (geis_attr_type(attr))
{
case GEIS_ATTR_TYPE_BOOLEAN:
{
DBusMessageIter variant_iter;
dbus_bool_t val = geis_attr_value_to_boolean(attr);
dbus_message_iter_open_container(&dict_iter,
DBUS_TYPE_VARIANT,
DBUS_TYPE_BOOLEAN_AS_STRING,
&variant_iter);
dbus_message_iter_append_basic(&variant_iter, DBUS_TYPE_BOOLEAN, &val);
dbus_message_iter_close_container(&dict_iter, &variant_iter);
break;
}
case GEIS_ATTR_TYPE_FLOAT:
{
DBusMessageIter variant_iter;
double val = geis_attr_value_to_float(attr);
dbus_message_iter_open_container(&dict_iter,
DBUS_TYPE_VARIANT,
DBUS_TYPE_DOUBLE_AS_STRING,
&variant_iter);
dbus_message_iter_append_basic(&variant_iter, DBUS_TYPE_DOUBLE, &val);
dbus_message_iter_close_container(&dict_iter, &variant_iter);
break;
}
case GEIS_ATTR_TYPE_INTEGER:
{
DBusMessageIter variant_iter;
dbus_int32_t val = geis_attr_value_to_integer(attr);
dbus_message_iter_open_container(&dict_iter,
DBUS_TYPE_VARIANT,
DBUS_TYPE_INT32_AS_STRING,
&variant_iter);
dbus_message_iter_append_basic(&variant_iter, DBUS_TYPE_INT32, &val);
dbus_message_iter_close_container(&dict_iter, &variant_iter);
break;
}
case GEIS_ATTR_TYPE_STRING:
{
DBusMessageIter variant_iter;
GeisString val = geis_attr_value_to_string(attr);
dbus_message_iter_open_container(&dict_iter,
DBUS_TYPE_VARIANT,
DBUS_TYPE_STRING_AS_STRING,
&variant_iter);
dbus_message_iter_append_basic(&variant_iter, DBUS_TYPE_STRING, &val);
dbus_message_iter_close_container(&dict_iter, &variant_iter);
break;
}
default:
geis_error("invalid attribute type for DBus");
}
dbus_message_iter_close_container(iter, &dict_iter);
}
/*
* Unmarshalls a single GEIS attr from a DBus message iterator.
*/
GeisAttr
geis_dbus_attr_unmarshall(DBusMessageIter *iter)
{
GeisAttr attr = NULL;
DBusMessageIter dict_iter;
dbus_message_iter_recurse(iter, &dict_iter);
int dtype = dbus_message_iter_get_arg_type(&dict_iter);
if (dtype != DBUS_TYPE_STRING)
{
geis_error("error getting attr name from DBus message");
goto final_exit;
}
char *attr_name;
dbus_message_iter_get_basic(&dict_iter, &attr_name);
dbus_message_iter_next(&dict_iter);
dtype = dbus_message_iter_get_arg_type(&dict_iter);
if (dtype != DBUS_TYPE_VARIANT)
{
geis_error("error getting attr variant from DBus message");
goto final_exit;
}
DBusMessageIter variant_iter;
dbus_message_iter_recurse(&dict_iter, &variant_iter);
int vtype = dbus_message_iter_get_arg_type(&variant_iter);
switch (vtype)
{
case DBUS_TYPE_BOOLEAN:
{
dbus_bool_t val;
dbus_message_iter_get_basic(&variant_iter, &val);
attr = geis_attr_new(attr_name, GEIS_ATTR_TYPE_BOOLEAN, &val);
break;
}
case DBUS_TYPE_DOUBLE:
{
double dval;
dbus_message_iter_get_basic(&variant_iter, &dval);
float fval = dval;
attr = geis_attr_new(attr_name, GEIS_ATTR_TYPE_FLOAT, &fval);
break;
}
case DBUS_TYPE_INT32:
{
dbus_int32_t val;
dbus_message_iter_get_basic(&variant_iter, &val);
attr = geis_attr_new(attr_name, GEIS_ATTR_TYPE_INTEGER, &val);
break;
}
case DBUS_TYPE_STRING:
{
GeisString val;
dbus_message_iter_get_basic(&variant_iter, &val);
attr = geis_attr_new(attr_name, GEIS_ATTR_TYPE_STRING, (void *)val);
break;
}
default:
geis_error("unexpected attr data type from DBus");
break;
}
final_exit:
return attr;
}
geis-2.2.17+16.04.20160126/libs/geis-dbus/geis_dbus_dispatcher.c 0000644 0000156 0000165 00000031220 12651717544 024237 0 ustar pbuser pbgroup 0000000 0000000 /**
* @file geis_dbus_dispatcher.c
* @brief Implementation of the GEIS DBus dispatcher.
*/
/*
* Copyright 2011 Canonical Ltd.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of version 3 of the GNU Lesser General Public License as published
* by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include "geis_config.h"
#include "geis_dbus_dispatcher.h"
#include "geis_logging.h"
#include "geis_private.h"
#include
#include
typedef struct GeisDBusWatch *GeisDBusWatch;
typedef struct GeisDBusWatchBag *GeisDBusWatchBag;
/*
* Connects a DBusWatch back to a DBusConnection.
*
* This is an intrusive linked list node. See GeisDBusWatchBag.
*/
struct GeisDBusWatch
{
DBusConnection *connection;
DBusWatch *watch;
GeisDBusWatch next;
};
/*
* Maps file descriptors to watches and connections.
*
* A DBusWatch is assciated with a single file descriptor, but each file
* descriptor may be associated with more than one DBusWatch.
*
* Each DBusConnection has one or more DBusWatch. The DBusWatches are passed
* around without reference to the connection itself, but we often need the
* connection when all we have is the watch.
*
* To make things more complex, the DBusServer does not have a connection
* associated with its watches.
*
* This is a linked list with a free pool.
*/
struct GeisDBusWatchBag
{
GeisDBusWatch front;
GeisDBusWatch back;
GeisDBusWatch pool;
};
static const int _geis_dbus_watch_bag_initial_size = 4;
struct GeisDBusDispatcher
{
Geis geis;
GeisDBusWatchBag watches;
};
/*
* Creates a new empty collection of watches.
*
* The pool is primed with a few empty watches to save time later, on the
* assumption that if you're creating a bag you're going to use it.
*/
static GeisDBusWatchBag
_geis_dbus_watch_bag_new()
{
GeisDBusWatchBag bag = calloc(1, sizeof(struct GeisDBusWatchBag));
if (!bag)
{
geis_error("error allocating GeisDBusWatchBag");
goto final_exit;
}
/* Prime the free pool. */
for (int i = 0; i < _geis_dbus_watch_bag_initial_size; ++i)
{
GeisDBusWatch gdbw = calloc(1, sizeof(struct GeisDBusWatch));
if (!gdbw)
{
geis_error("error allocating GeisDBusWatchBag");
goto unwind_pool;
}
gdbw->next = bag->pool;
bag->pool = gdbw;
}
goto final_exit;
unwind_pool:
final_exit:
return bag;
}
/*
* Destroys a collection of watches.
*
* @param[in] bag A collection of %GeisDBusWatches.
*
* There should be no need to unref any of the contents of the bag, they can
* just be freed without consequence.
*/
static void
_geis_dbus_watch_bag_delete(GeisDBusWatchBag bag)
{
/* Free the pool. */
GeisDBusWatch gdbw = bag->pool;
while (gdbw)
{
GeisDBusWatch next = gdbw->next;
free(gdbw);
gdbw = next;
}
/* Free the in-use watches. */
gdbw = bag->front;
while (gdbw)
{
GeisDBusWatch next = gdbw->next;
free(gdbw);
gdbw = next;
}
free(bag);
}
/*
* Gets an allocated watch from the bag.
*
* @param[in] bag A collection of %GeisDBusWatches.
* @param[in] connection A DBusConnection.
* @param[in] watch A DBusWatch.
*
* A factory function to create a new watch in the collection and return a
* pointer to it.
*/
static GeisDBusWatch
_geis_dbus_watch_bag_alloc_watch(GeisDBusWatchBag bag,
DBusConnection *connection,
DBusWatch *watch)
{
GeisDBusWatch gdbw = NULL;
/* Either pull a free watch off the pool or allocate a new one. */
if (bag->pool)
{
gdbw = bag->pool;
bag->pool = bag->pool->next;
}
else
{
gdbw = calloc(1, sizeof(struct GeisDBusWatch));
if (!gdbw)
{
geis_error("error allocating GeisDBusWatchBag");
goto final_exit;
}
}
/* Fill in the data bits. */
gdbw->connection = connection;
gdbw->watch = watch;
gdbw->next = NULL;
/* Add it to the in-use list. */
if (!bag->front)
{
bag->front = gdbw;
}
if (bag->back)
{
bag->back->next = gdbw;
}
bag->back = gdbw;
final_exit:
return gdbw;
}
/*
* Removes a watch from a collection of such beasts.
*
* @param[in] bag A collection of %GeisDBusWatches.
* @param[in] watch The watch to remove.
*/
static void
_geis_dbus_watch_bag_remove_watch(GeisDBusWatchBag bag,
DBusWatch *watch)
{
for (GeisDBusWatch gdbw = bag->front, prev = NULL; gdbw; gdbw = gdbw->next)
{
if (gdbw->watch == watch)
{
if (gdbw == bag->front)
{
bag->front = gdbw->next;
}
else
{
prev->next = gdbw->next;
}
if (gdbw == bag->back)
{
bag->back = prev;
}
gdbw->next = bag->pool;
bag->pool = gdbw;
break;
}
prev = gdbw;
}
}
/*
* Indicates if a file descriptor is already held in the watch bag.
*
* @param[in] bag A collection of %GeisDBusWatches.
* @param[in] fd A file descriptor.
* @param[out] flags The DBus watch flags for any enabled watches found.
*
* @returns zero if the file descriptor is not in the bag, non-zero otherwise.
*/
static int
_geis_dbus_watch_bag_has_fd(GeisDBusWatchBag bag, int fd, unsigned int *flags)
{
int has_fd = 0;
for (GeisDBusWatch gdbw = bag->front; gdbw; gdbw = gdbw->next)
{
if (dbus_watch_get_unix_fd(gdbw->watch) == fd)
{
has_fd |= ~0;
if (dbus_watch_get_enabled(gdbw->watch))
{
*flags |= dbus_watch_get_flags(gdbw->watch);
}
}
}
return has_fd;
}
/*
* Finds a DBusWatch in the bag that matches the fd and current activity.
*
* @param[in] bag A collection of %GeisDBusWatches.
* @param[in] fd The file descriptor on which an activity has been detected.
* @param[in] activity The bitmask of currently detected activity on the fd.
*
* A DBusWatch will match if it has the same file descriptor and is watching for
* (one of) the activity(ies) that has just occurred.
*
* Note that writers are implicitly looking for hangups or errors but the DBus
* library goes into an infinite loop when a hangup has occurred no a write
* watch, so defer that to a read watch.
*
* @returns a GeisDBusWatch or NULL if no matching watch was found.
*/
static GeisDBusWatch
_geis_dbus_watch_bag_find_fd_activity(GeisDBusWatchBag bag,
int fd,
GeisBackendMultiplexorActivity activity)
{
GeisDBusWatch gdbw = NULL;
for (gdbw = bag->front; gdbw; gdbw = gdbw->next)
{
if (dbus_watch_get_unix_fd(gdbw->watch) == fd)
{
unsigned int flags = dbus_watch_get_flags(gdbw->watch);
if ((activity & GEIS_BE_MX_READ_AVAILABLE && flags & DBUS_WATCH_READABLE)
|| (activity & GEIS_BE_MX_WRITE_AVAILABLE && flags & DBUS_WATCH_WRITABLE)
|| (activity & GEIS_BE_MX_HANGUP_DETECTED && flags & DBUS_WATCH_READABLE)
|| (activity & GEIS_BE_MX_ERROR_DETECTED))
{
break;
}
}
}
return gdbw;
}
/*
* A callback function passed to the Geis multiplexor.
*
* @param[in] fd The file descriptor on which an activity has been detected.
* @param[in] activity The bitmask of currently detected activity on the fd.
* @param[in] context The %GeisDBusDispatcher passed through the multiplexor.
*
* This callback gets invoked whenever a requested activity is detected on a
* regostered DBusWatch file descriptor. It translates the GEIS Multiplexor
* activity to DBus activity.
*/
static void
_geis_dbus_dispatcher_callback(int fd,
GeisBackendMultiplexorActivity activity,
void *context)
{
GeisDBusDispatcher dispatcher = (GeisDBusDispatcher)context;
GeisDBusWatch gdb = _geis_dbus_watch_bag_find_fd_activity(dispatcher->watches,
fd,
activity);
if (gdb)
{
/* Translate GEIS multiplexor activity to DBus watch flags. */
unsigned int flags = 0;
if (activity & GEIS_BE_MX_READ_AVAILABLE) flags |= DBUS_WATCH_READABLE;
if (activity & GEIS_BE_MX_WRITE_AVAILABLE) flags |= DBUS_WATCH_WRITABLE;
if (activity & GEIS_BE_MX_HANGUP_DETECTED) flags |= DBUS_WATCH_HANGUP;
if (activity & GEIS_BE_MX_ERROR_DETECTED) flags |= DBUS_WATCH_ERROR;
dbus_watch_handle(gdb->watch, flags);
if (gdb->connection)
{
if (activity & GEIS_BE_MX_HANGUP_DETECTED)
{
dbus_connection_close(gdb->connection);
}
else
{
DBusDispatchStatus s;
s = dbus_connection_get_dispatch_status(gdb->connection);
while (DBUS_DISPATCH_DATA_REMAINS == s)
{
s = dbus_connection_dispatch(gdb->connection);
}
}
}
}
}
/*
* Creates a new GEIS DBus dispatcher.
*/
GeisDBusDispatcher
geis_dbus_dispatcher_new(Geis geis)
{
GeisDBusDispatcher dispatcher = calloc(1, sizeof(struct GeisDBusDispatcher));
if (!dispatcher)
{
geis_error("error allocating GEIS DBus dispatcher.");
goto final_exit;
}
dispatcher->geis = geis;
dispatcher->watches = _geis_dbus_watch_bag_new();
if (!dispatcher->watches)
{
geis_error("error creating GEIS DBus dispatcher watches.");
goto unwind_dispatcher;
}
goto final_exit;
unwind_dispatcher:
free(dispatcher);
final_exit:
return dispatcher;
}
/*
* Destroys an existing %GeisDBusDispatcher object.
*/
void
geis_dbus_dispatcher_delete(GeisDBusDispatcher dispatcher)
{
for (GeisDBusWatch gdbw = dispatcher->watches->front;
gdbw; gdbw = gdbw->next)
{
geis_dbus_dispatcher_unregister(dispatcher, gdbw->watch);
}
_geis_dbus_watch_bag_delete(dispatcher->watches);
free(dispatcher);
}
/*
* Registers a new DBusWatch with a %GeisDBusDispatcher object.
*/
void
geis_dbus_dispatcher_register(GeisDBusDispatcher dispatcher,
DBusConnection *connection,
DBusWatch *watch)
{
int watch_fd = dbus_watch_get_unix_fd(watch);
/* Calculate all the enabled flags on the fd for all watches. */
unsigned int flags = 0;
int has_fd = _geis_dbus_watch_bag_has_fd(dispatcher->watches, watch_fd, &flags);
_geis_dbus_watch_bag_alloc_watch(dispatcher->watches, connection, watch);
if (dbus_watch_get_enabled(watch))
{
flags |= dbus_watch_get_flags(watch);
}
/* Convert the watch flags to multiplexor activities. */
GeisBackendMultiplexorActivity activity = 0;
if (flags & DBUS_WATCH_READABLE) activity |= GEIS_BE_MX_READ_AVAILABLE;
if (flags & DBUS_WATCH_WRITABLE) activity |= GEIS_BE_MX_WRITE_AVAILABLE;
/* Set or adjust the multiplexor seubscription. */
if (has_fd)
{
geis_remultiplex_fd(dispatcher->geis, watch_fd, activity);
}
else
{
geis_multiplex_fd(dispatcher->geis,
watch_fd,
activity,
_geis_dbus_dispatcher_callback,
dispatcher);
}
}
/*
* Unregisters a DBusWatch for events.
*/
void
geis_dbus_dispatcher_unregister(GeisDBusDispatcher dispatcher,
DBusWatch *watch)
{
int watch_fd = dbus_watch_get_unix_fd(watch);
unsigned int flags = 0;
_geis_dbus_watch_bag_remove_watch(dispatcher->watches, watch);
if (!_geis_dbus_watch_bag_has_fd(dispatcher->watches, watch_fd, &flags))
{
geis_demultiplex_fd(dispatcher->geis, watch_fd);
}
}
/*
* Marks a DBusWatch as active, maybe.
*/
void
geis_dbus_dispatcher_toggle_watch(GeisDBusDispatcher dispatcher,
DBusWatch *watch)
{
int watch_fd = dbus_watch_get_unix_fd(watch);
/* Calculate all the enabled flags on the fd for all watches. */
unsigned int flags = 0;
_geis_dbus_watch_bag_has_fd(dispatcher->watches, watch_fd, &flags);
if (dbus_watch_get_enabled(watch))
{
flags |= dbus_watch_get_flags(watch);
}
else
{
flags &= ~dbus_watch_get_flags(watch);
}
/* Convert the watch flags to multiplexor activities. */
GeisBackendMultiplexorActivity activity = 0;
if (flags & DBUS_WATCH_READABLE) activity |= GEIS_BE_MX_READ_AVAILABLE;
if (flags & DBUS_WATCH_WRITABLE) activity |= GEIS_BE_MX_WRITE_AVAILABLE;
/* Set or adjust the multiplexor seubscription. */
geis_remultiplex_fd(dispatcher->geis, watch_fd, activity);
}
geis-2.2.17+16.04.20160126/libs/geis-dbus/geis_dbus_gesture_event.h 0000644 0000156 0000165 00000002705 12651717544 025003 0 ustar pbuser pbgroup 0000000 0000000 /**
* @file geis_dbus_gesture_event.h
* @brief Interface for the GEIS DBus gesture event transport.
*/
/*
* Copyright 2011 Canonical Ltd.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of version 3 of the GNU Lesser General Public License as published
* by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef GEIS_DBUS_GESTURE_EVENT_H_
#define GEIS_DBUS_GESTURE_EVENT_H_
#include
#include "geis/geis.h"
/**
* Creates a Dbus "gesture event" message from a GEIS gesture event.
*
* @param[in] event A GEIS event.
*/
DBusMessage *
geis_dbus_gesture_event_message_from_geis_event(GeisEvent event);
/**
* Indicates if a DBus message is a "gesture event" message.
*
* @param[in] message A DBus message.
*/
GeisBoolean
geis_dbus_message_is_gesture_event(DBusMessage *message);
/**
* Creates GEIS event from a DBus "gesture_event" message.
*
* @param[in] message A DBus message.
*/
GeisEvent
geis_dbus_gesture_event_from_message(Geis geis, DBusMessage *message);
#endif /* GEIS_DBUS_GESTURE_EVENT_H_ */
geis-2.2.17+16.04.20160126/libs/geis-dbus/geis_dbus_region.c 0000644 0000156 0000165 00000004726 12651717544 023407 0 ustar pbuser pbgroup 0000000 0000000 /**
* @file geis_dbus_region.c
* @brief Implementations of the GEIS DBus region transport.
*/
/*
* Copyright 2011 Canonical Ltd.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of version 3 of the GNU Lesser General Public License as published
* by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*/
#include "geis_config.h"
#include "geis_dbus_region.h"
#include "geis_dbus.h"
#include "geis_logging.h"
/*
* Creates a Dbus "region available" message from a GEIS region.
*/
DBusMessage *
geis_dbus_region_available_message_from_region(GeisFilterableAttribute fa)
{
DBusMessage *message = dbus_message_new_signal(GEIS_DBUS_SERVICE_PATH,
GEIS_DBUS_SERVICE_INTERFACE,
GEIS_DBUS_REGION_AVAILABLE);
DBusMessageIter iter;
dbus_message_iter_init_append(message, &iter);
const char *attr_name = fa->name;
dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &attr_name);
dbus_int32_t attr_type = fa->type;
dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &attr_type);
return message;
}
/*
* Creates GEIS region filterable attribute from a DBus "region available"
* message.
*/
GeisFilterableAttribute
geis_dbus_region_from_region_available_message(DBusMessage *message)
{
geis_debug("begins");
static struct GeisFilterableAttribute attr;
DBusMessageIter iter;
dbus_message_iter_init(message, &iter);
int type = dbus_message_iter_get_arg_type(&iter);
if (type != DBUS_TYPE_STRING)
{
geis_error("error getting attr name name from DBus message.");
goto final_exit;
}
char *attr_name;
dbus_message_iter_get_basic(&iter, &attr_name);
dbus_message_iter_next(&iter);
type = dbus_message_iter_get_arg_type(&iter);
if (type != DBUS_TYPE_INT32)
{
geis_error("error getting attr type from DBus message.");
goto final_exit;
}
dbus_int32_t attr_type;
dbus_message_iter_get_basic(&iter, &attr_type);
attr.name = attr_name;
attr.type = attr_type;
final_exit:
geis_debug("ends");
return &attr;
}
geis-2.2.17+16.04.20160126/libs/geis-dbus/geis_dbus_device.c 0000644 0000156 0000165 00000010303 12651717544 023347 0 ustar pbuser pbgroup 0000000 0000000 /**
* @file geis_dbus_device.c
* @brief Implementations of the GEIS DBus device transport.
*/
/*
* Copyright 2011 Canonical Ltd.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of version 3 of the GNU Lesser General Public License as published
* by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*/
#include "geis_config.h"
#include "geis_dbus_device.h"
#include "geis_dbus.h"
#include "geis_dbus_attr.h"
#include "geis_device.h"
#include "geis_logging.h"
/*
* Creates a Dbus "device available" message from a GEIS device.
*
* The Wire protocol for this message is device_id and device_name followed by
* the list of device attributes.
*/
DBusMessage *
geis_dbus_device_available_message_from_device(GeisDevice device)
{
DBusMessage *message = dbus_message_new_signal(GEIS_DBUS_SERVICE_PATH,
GEIS_DBUS_SERVICE_INTERFACE,
GEIS_DBUS_DEVICE_AVAILABLE);
DBusMessageIter iter;
dbus_message_iter_init_append(message, &iter);
dbus_int32_t device_id = geis_device_id(device);
dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &device_id);
const char *device_name = geis_device_name(device);
dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &device_name);
DBusMessageIter array_iter;
dbus_message_iter_open_container(&iter,
DBUS_TYPE_ARRAY,
GEIS_DBUS_TYPE_SIGNATURE_ATTR,
&array_iter);
GeisSize attr_count = geis_device_attr_count(device);
for (GeisSize i = 0; i < attr_count; ++i)
{
geis_dbus_attr_marshall(geis_device_attr(device, i), &array_iter);
}
dbus_message_iter_close_container(&iter, &array_iter);
return message;
}
/*
* Creates GEIS device from a DBus "device available" message.
*/
GeisDevice
geis_dbus_device_device_from_available_message(DBusMessage *message)
{
geis_debug("begins");
GeisDevice device = NULL;
DBusMessageIter iter;
dbus_message_iter_init(message, &iter);
int type = dbus_message_iter_get_arg_type(&iter);
if (type != DBUS_TYPE_INT32)
{
geis_error("error getting device ID from DBus message.");
goto final_exit;
}
dbus_int32_t device_id;
dbus_message_iter_get_basic(&iter, &device_id);
dbus_message_iter_next(&iter);
type = dbus_message_iter_get_arg_type(&iter);
if (type != DBUS_TYPE_STRING)
{
geis_error("error getting device name from DBus message.");
goto final_exit;
}
char *device_name;
dbus_message_iter_get_basic(&iter, &device_name);
device = geis_device_new(device_name, device_id);
dbus_message_iter_next(&iter);
type = dbus_message_iter_get_arg_type(&iter);
if (type != DBUS_TYPE_ARRAY)
{
geis_error("error getting device attr list from DBus message.");
goto final_exit;
}
DBusMessageIter array_iter;
dbus_message_iter_recurse(&iter, &array_iter);
int atype = dbus_message_iter_get_arg_type(&array_iter);
while (atype == DBUS_TYPE_DICT_ENTRY)
{
GeisAttr attr = geis_dbus_attr_unmarshall(&array_iter);
if (attr)
{
geis_device_add_attr(device, attr);
}
dbus_message_iter_next(&array_iter);
atype = dbus_message_iter_get_arg_type(&array_iter);
}
final_exit:
geis_debug("ends");
return device;
}
/*
* Creates a Dbus "device unavailable" message from a GEIS device.
*/
DBusMessage *
geis_dbus_device_unavailable_message_from_device(GeisDevice device GEIS_UNUSED)
{
geis_debug("begins");
DBusMessage *message = NULL;
geis_debug("ends");
return message;
}
/*
* Creates GEIS device from a DBus "device unavailable" message.
*/
GeisDevice
geis_dbus_device_device_from_unavailable_message(DBusMessage *message GEIS_UNUSED)
{
geis_debug("begins");
GeisDevice device = NULL;
geis_debug("ends");
return device;
}
geis-2.2.17+16.04.20160126/libs/geis-dbus/geis_dbus_class.c 0000644 0000156 0000165 00000007624 12651717544 023231 0 ustar pbuser pbgroup 0000000 0000000 /**
* @file geis_dbus_gesture_class.c
* @brief Implementations of the GEIS DBus gesture_class transport.
*/
/*
* Copyright 2011 Canonical Ltd.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of version 3 of the GNU Lesser General Public License as published
* by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*/
#include "geis_config.h"
#include "geis_dbus_class.h"
#include "geis_dbus.h"
#include "geis_dbus_attr.h"
#include "geis_class.h"
#include "geis_logging.h"
/*
* Creates a Dbus "gesture_class available" message from a GEIS gesture_class.
*
* The Wire protocol for this message is class_id and class_name followed by
* the list of class attributes.
*/
DBusMessage *
geis_dbus_class_available_message_from_class(GeisGestureClass gesture_class)
{
DBusMessage *message = dbus_message_new_signal(GEIS_DBUS_SERVICE_PATH,
GEIS_DBUS_SERVICE_INTERFACE,
GEIS_DBUS_CLASS_AVAILABLE);
DBusMessageIter iter;
dbus_message_iter_init_append(message, &iter);
dbus_int32_t gesture_class_id = geis_gesture_class_id(gesture_class);
dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &gesture_class_id);
const char *gesture_class_name = geis_gesture_class_name(gesture_class);
dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &gesture_class_name);
DBusMessageIter array_iter;
dbus_message_iter_open_container(&iter,
DBUS_TYPE_ARRAY,
GEIS_DBUS_TYPE_SIGNATURE_ATTR,
&array_iter);
GeisSize attr_count = geis_gesture_class_attr_count(gesture_class);
for (GeisSize i = 0; i < attr_count; ++i)
{
geis_dbus_attr_marshall(geis_gesture_class_attr(gesture_class, i),
&array_iter);
}
dbus_message_iter_close_container(&iter, &array_iter);
return message;
}
/*
* Creates GEIS gesture_class from a DBus "gesture_class available" message.
*/
GeisGestureClass
geis_dbus_class_class_from_available_message(DBusMessage *message)
{
GeisGestureClass gesture_class = NULL;
DBusMessageIter iter;
dbus_message_iter_init(message, &iter);
int type = dbus_message_iter_get_arg_type(&iter);
if (type != DBUS_TYPE_INT32)
{
geis_error("error getting gesture_class ID from DBus message.");
goto final_exit;
}
dbus_int32_t gesture_class_id;
dbus_message_iter_get_basic(&iter, &gesture_class_id);
dbus_message_iter_next(&iter);
type = dbus_message_iter_get_arg_type(&iter);
if (type != DBUS_TYPE_STRING)
{
geis_error("error getting gesture_class name from DBus message.");
goto final_exit;
}
char *gesture_class_name;
dbus_message_iter_get_basic(&iter, &gesture_class_name);
gesture_class = geis_gesture_class_new(gesture_class_name, gesture_class_id);
dbus_message_iter_next(&iter);
type = dbus_message_iter_get_arg_type(&iter);
if (type != DBUS_TYPE_ARRAY)
{
geis_error("error getting gesture_class attr list from DBus message.");
goto final_exit;
}
DBusMessageIter array_iter;
dbus_message_iter_recurse(&iter, &array_iter);
int atype = dbus_message_iter_get_arg_type(&array_iter);
while (atype == DBUS_TYPE_DICT_ENTRY)
{
GeisAttr attr = geis_dbus_attr_unmarshall(&array_iter);
if (attr)
{
geis_gesture_class_add_attr(gesture_class, attr);
}
dbus_message_iter_next(&array_iter);
atype = dbus_message_iter_get_arg_type(&array_iter);
}
final_exit:
return gesture_class;
}
geis-2.2.17+16.04.20160126/libs/geis-dbus/geis_dbus_dispatcher.h 0000644 0000156 0000165 00000007102 12651717544 024246 0 ustar pbuser pbgroup 0000000 0000000 /**
* @file geis_dbus_dispatcher.h
* @brief Interface for the GEIS DBus dispatcher.
*
* The GEIS DBus dispatcher provides a central dispatch point for all DBus
* events used internally by GEIS.
*
* This header is for internal GEIS use only and contains no client
* (externally-visible) symbols.
*/
/*
* Copyright 2011 Canonical Ltd.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of version 3 of the GNU Lesser General Public License as published
* by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef GEIS_DBUS_DISPATCHER_H_
#define GEIS_DBUS_DISPATCHER_H_
#include
#include "geis/geis.h"
/**
* The %GeisDBusDispatcher centralizes all dispatch for all DBus events used
* internally by the GEIS client-server mechanism.
*
* Geis implements single-threaded ansynchronous dispatch for DBus events, in
* case a single-threaded client is making use of GEIS. This also simplifies a
* lot of the internal design of the GEIS DBus service, since no locking or
* other forms of synchronization are required.
*/
typedef struct GeisDBusDispatcher *GeisDBusDispatcher;
/**
* A callback type for the handler function dispatched on DBus events.
*
* @todo the parameters of the GeisDispatchCallback must be defined.
*/
typedef void (*GeisDispatchCallback)(void *context);
/**
* Creates a new GEIS DBus dispatcher.
*
* @param[in] geis A GEIS instance.
*
* Creates a new %GeisDBusDispatcher and registers it with the GEIS API instance
* so it will be multiplexed and receive event notification.
*
* @returns a new %GeisDBusDispatcher object or NULL on failure.
*/
GeisDBusDispatcher
geis_dbus_dispatcher_new(Geis geis);
/**
* Destroys an existing %GeisDBusDispatcher object.
*
* @param[in] dispatcher A %GeisDBusDispatcher object.
*/
void
geis_dbus_dispatcher_delete(GeisDBusDispatcher dispatcher);
/**
* Registers a new DBusWatch with a %GeisDBusDispatcher object.
*
* @param[in] dispatcher A %GeisDBusDispatcher object.
* @param[in] connection A DBus connection.
* @param[in] watch A DBusWatch om the connection.
*
* The @p watch will be registered with the @p dispatcher for future DBus
* events. The @p watch may or may not be activated, depending on its @a
* enabled state at the time of registration.
*/
void
geis_dbus_dispatcher_register(GeisDBusDispatcher dispatcher,
DBusConnection *connection,
DBusWatch *watch);
/**
* Unregisters a DBusWatch for events.
*
* @param[in] dispatcher A %GeisDBusDispatcher object.
* @param[in] watch A DBusWatch.
*/
void
geis_dbus_dispatcher_unregister(GeisDBusDispatcher dispatcher,
DBusWatch *watch);
/**
* Marks a DBusWatch as active or not, depending on its state.
*
* @param[in] dispatcher A %GeisDBusDispatcher object.
* @param[in] watch A pointer to a DBusWatch object.
*
* The @p dispatcher will listen for events on the @p watch if its @a is_enabled
* state is true or not.
*/
void
geis_dbus_dispatcher_toggle_watch(GeisDBusDispatcher dispatcher,
DBusWatch *watch);
#endif /* GEIS_DBUS_DISPATCHER_H_ */
geis-2.2.17+16.04.20160126/libs/geis-dbus/geis_dbus_subscription.c 0000644 0000156 0000165 00000037620 12651717544 024647 0 ustar pbuser pbgroup 0000000 0000000 /**
* @file geis_dbus_subscription.c
* @brief Implementation of the GEIS DBus subscription transport.
*/
/*
* Copyright 2011 Canonical Ltd.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of version 3 of the GNU Lesser General Public License as published
* by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include "geis_config.h"
#include "geis_dbus_subscription.h"
#include "geis_dbus.h"
#include "geis_dbus_attr.h"
#include "geis_filter_term.h"
#include "geis_logging.h"
#include "geis_subscription.h"
#include
/*
* A filter term is marshalled as a (facility, operation, value) tuple.
* That would be a (ii(sv)) in DBusspeak.
*/
#define GEIS_DBUS_TYPE_SIGNATURE_TERM \
DBUS_STRUCT_BEGIN_CHAR_AS_STRING \
DBUS_TYPE_INT32_AS_STRING \
DBUS_TYPE_INT32_AS_STRING \
GEIS_DBUS_TYPE_SIGNATURE_ATTR \
DBUS_STRUCT_END_CHAR_AS_STRING
/*
* A term list is an array of terms, as in a(ii(sv)).
*/
#define GEIS_DBUS_TYPE_SIGNATURE_TERM_LIST \
DBUS_TYPE_ARRAY_AS_STRING \
GEIS_DBUS_TYPE_SIGNATURE_TERM
/*
* A filter is a named array of filter terms.
* That's a {sa(ii(sv))} in the DBus tongue.
*/
#define GEIS_DBUS_TYPE_SIGNATURE_FILTER \
DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING \
DBUS_TYPE_STRING_AS_STRING \
GEIS_DBUS_TYPE_SIGNATURE_TERM_LIST \
DBUS_DICT_ENTRY_END_CHAR_AS_STRING
/**
* Adds filter terms to a DBus message.
*
* @param[in] filter The filter for which terms will be marshalled.
* @param[in] filter_iter A DBus message output iterator.
*/
static void
_geis_dbus_marshall_subscription_filter_terms(GeisFilter filter,
DBusMessageIter *filter_iter)
{
DBusMessageIter term_list_iter;
dbus_message_iter_open_container(filter_iter,
DBUS_TYPE_ARRAY,
GEIS_DBUS_TYPE_SIGNATURE_TERM,
&term_list_iter);
for (GeisSize i = 0; i < geis_filter_term_count(filter); ++i)
{
GeisFilterTerm term = geis_filter_term(filter, i);
dbus_int32_t facility = geis_filter_term_facility(term);
dbus_int32_t operation = geis_filter_term_operation(term);
GeisAttr attr = geis_filter_term_attr(term);
DBusMessageIter term_iter;
dbus_message_iter_open_container(&term_list_iter,
DBUS_TYPE_STRUCT,
NULL,
&term_iter);
dbus_message_iter_append_basic(&term_iter, DBUS_TYPE_INT32, &facility);
dbus_message_iter_append_basic(&term_iter, DBUS_TYPE_INT32, &operation);
geis_dbus_attr_marshall(attr, &term_iter);
dbus_message_iter_close_container(&term_list_iter, &term_iter);
}
dbus_message_iter_close_container(filter_iter, &term_list_iter);
}
/**
* Squeezes the filters on a subscription into the DBus wire protocol.
*
* @param[in] sub A %GeisSubscription
* @param[in] msg_iter The open output iterator for a DBus message.
*
* The filters are marshalled as an array of DBus dict entries.
*/
static void
_geis_dbus_marshall_subscription_filters(GeisSubscription subscription,
DBusMessageIter *msg_iter)
{
DBusMessageIter filter_list_iter;
dbus_message_iter_open_container(msg_iter,
DBUS_TYPE_ARRAY,
GEIS_DBUS_TYPE_SIGNATURE_FILTER,
&filter_list_iter);
for (GeisFilterIterator it = geis_subscription_filter_begin(subscription);
it != geis_subscription_filter_end(subscription);
it = geis_subscription_filter_next(subscription, it))
{
const char *filter_name = geis_filter_name(*it);
DBusMessageIter filter_iter;
dbus_message_iter_open_container(&filter_list_iter,
DBUS_TYPE_DICT_ENTRY,
NULL,
&filter_iter);
dbus_message_iter_append_basic(&filter_iter, DBUS_TYPE_STRING, &filter_name);
_geis_dbus_marshall_subscription_filter_terms(*it, &filter_iter);
dbus_message_iter_close_container(&filter_list_iter, &filter_iter);
}
dbus_message_iter_close_container(msg_iter, &filter_list_iter);
}
static void
_geis_dbus_unmarshall_filter_terms(GeisFilter filter,
DBusMessageIter *filter_iter)
{
DBusMessageIter term_list_iter;
dbus_message_iter_recurse(filter_iter, &term_list_iter);
for (int dtype = dbus_message_iter_get_arg_type(&term_list_iter);
dtype != DBUS_TYPE_INVALID;
dbus_message_iter_next(&term_list_iter),
dtype = dbus_message_iter_get_arg_type(&term_list_iter))
{
int ttype = dbus_message_iter_get_arg_type(&term_list_iter);
if (ttype != DBUS_TYPE_STRUCT)
{
geis_error("malformed GeisSubscription term");
goto final_exit;
}
DBusMessageIter term_iter;
dbus_message_iter_recurse(&term_list_iter, &term_iter);
dbus_int32_t facility;
dbus_message_iter_get_basic(&term_iter, &facility);
dbus_message_iter_next(&term_iter);
dbus_int32_t operation;
dbus_message_iter_get_basic(&term_iter, &operation);
dbus_message_iter_next(&term_iter);
GeisAttr attr = geis_dbus_attr_unmarshall(&term_iter);
GeisFilterTerm term = geis_filter_term_new(facility, operation, attr);
geis_filter_add_term_internal(filter, term);
}
final_exit:
return;
}
/**
* Unmarshalls a filter from a DBus message.
*
* @param[in] geis A GEIS instance.
* @param[in] filter_iter A DBus message iterator pointing to the filter.
*/
static GeisFilter
_geis_dbus_unmarshall_filter(Geis geis, DBusMessageIter *filter_iter)
{
GeisFilter filter = NULL;
int ftype = dbus_message_iter_get_arg_type(filter_iter);
if (ftype != DBUS_TYPE_DICT_ENTRY)
{
geis_error("malformed GeisSubscription filter");
goto final_exit;
}
DBusMessageIter dict_iter;
dbus_message_iter_recurse(filter_iter, &dict_iter);
ftype = dbus_message_iter_get_arg_type(&dict_iter);
if (ftype != DBUS_TYPE_STRING)
{
geis_error("malformed GeisSubscription filter");
goto final_exit;
}
GeisString filter_name;
dbus_message_iter_get_basic(&dict_iter, &filter_name);
dbus_message_iter_next(&dict_iter);
filter = geis_filter_new(geis, filter_name);
ftype = dbus_message_iter_get_arg_type(&dict_iter);
if (ftype != DBUS_TYPE_ARRAY)
{
geis_error("malformed GeisSubscription filter");
goto final_exit;
}
_geis_dbus_unmarshall_filter_terms(filter, &dict_iter);
final_exit:
return filter;
}
/**
* Unmarshalls a list of filters from a DBus message.
*
* @param[in] geis A GEIS instance.
* @param[in] subscription_iter A DBus message iterator for the subscription.
* @param[in] subscription A GEIS subsccription.
*
* This function unmarshalls filters from a GEIS DBus subscription message and
* adds them to a existing GEIS subscription.
*/
static void
_geis_dbus_unmarshall_subscription_filters(Geis geis,
DBusMessageIter *subscription_iter,
GeisSubscription subscription)
{
DBusMessageIter filter_list_iter;
dbus_message_iter_recurse(subscription_iter, &filter_list_iter);
for (int dtype = dbus_message_iter_get_arg_type(&filter_list_iter);
dtype != DBUS_TYPE_INVALID;
dbus_message_iter_next(&filter_list_iter),
dtype = dbus_message_iter_get_arg_type(&filter_list_iter))
{
GeisFilter filter = _geis_dbus_unmarshall_filter(geis, &filter_list_iter);
if (filter)
{
geis_subscription_add_filter(subscription, filter);
}
}
}
/*
* Indicates if a DBus message is a GEIS_DBUS_SUBSCRIPTION_CREATE method call.
*/
GeisBoolean
geis_dbus_message_is_subscription_create_call(DBusMessage *message)
{
return dbus_message_is_method_call(message,
GEIS_DBUS_SERVICE_INTERFACE,
GEIS_DBUS_SUBSCRIPTION_CREATE);
}
/*
* Creates a GEIS_DBUS_SUBSCRIPTION_CREATE method call message.
*/
DBusMessage *
geis_dbus_subscription_create_call_message(GeisSubscription subscription)
{
DBusMessage *message = NULL;
GeisString sub_name = "dummy";
dbus_int32_t sub_id = -1;
dbus_uint32_t sub_flags = 0;
DBusMessageIter iter;
message = dbus_message_new_method_call(GEIS_DBUS_SERVICE_INTERFACE,
GEIS_DBUS_SERVICE_PATH,
GEIS_DBUS_SERVICE_INTERFACE,
GEIS_DBUS_SUBSCRIPTION_CREATE);
if (subscription)
{
sub_name = geis_subscription_name(subscription);
sub_id = geis_subscription_id(subscription);
sub_flags = geis_subscription_flags(subscription);
}
dbus_message_iter_init_append(message, &iter);
dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &sub_name);
dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &sub_id);
dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &sub_flags);
_geis_dbus_marshall_subscription_filters(subscription, &iter);
return message;
}
/*
* Creates a %GeisSubscription from a method call message.
*/
GeisSubscription
geis_dbus_subscription_from_create_call_message(Geis geis, DBusMessage *message)
{
DBusMessageIter message_iter;
dbus_message_iter_init(message, &message_iter);
GeisString client_sub_name;
dbus_message_iter_get_basic(&message_iter, &client_sub_name);
dbus_message_iter_next(&message_iter);
dbus_int32_t client_sub_id;
dbus_message_iter_get_basic(&message_iter, &client_sub_id);
dbus_message_iter_next(&message_iter);
dbus_uint32_t client_sub_flags;
dbus_message_iter_get_basic(&message_iter, &client_sub_flags);
dbus_message_iter_next(&message_iter);
GeisSubscription subscription = NULL;
subscription = geis_subscription_new(geis, client_sub_name, client_sub_flags);
if (!subscription)
{
geis_error("error creating proxy subscription");
goto final_exit;
}
intptr_t fudge = client_sub_id;
geis_subscription_set_pdata(subscription, (GeisPointer)fudge);
int dtype = dbus_message_iter_get_arg_type(&message_iter);
if (dtype != DBUS_TYPE_ARRAY)
{
geis_error("malformed GeisSubscription message"
" (expected type %c, received type %c)",
DBUS_TYPE_ARRAY, dtype);
goto final_exit;
}
_geis_dbus_unmarshall_subscription_filters(geis, &message_iter, subscription);
final_exit:
return subscription;
}
/*
* Creates a GEIS_DBUS_SUBSCRIPTION_CREATE method return message.
*/
DBusMessage *
geis_dbus_subscription_create_return_message(DBusMessage *message,
GeisSubscription subscription)
{
DBusMessage *reply = dbus_message_new_method_return(message);
intptr_t fudge = (intptr_t)geis_subscription_pdata(subscription);
dbus_int32_t client_sub_id = fudge;
dbus_int32_t server_sub_id = geis_subscription_id(subscription);
dbus_message_append_args(reply,
DBUS_TYPE_INT32, &client_sub_id,
DBUS_TYPE_INT32, &server_sub_id,
DBUS_TYPE_INVALID);
return reply;
}
/*
* Indicates if a DBus message is a GEIS_DBUS_SUBSCRIPTION_ACTIVATE message.
*/
GeisBoolean
geis_dbus_message_is_subscription_activate_call(DBusMessage *message)
{
return dbus_message_is_method_call(message,
GEIS_DBUS_SERVICE_INTERFACE,
GEIS_DBUS_SUBSCRIPTION_ACTIVATE);
}
/*
* Creates a GEIS_DBUS_SUBSCRIPTION_ACTIVATE method call message.
*/
DBusMessage *
geis_dbus_subscription_activate_call_message(GeisSubscription subscription)
{
DBusMessage *message = NULL;
DBusMessageIter iter;
message = dbus_message_new_method_call(GEIS_DBUS_SERVICE_INTERFACE,
GEIS_DBUS_SERVICE_PATH,
GEIS_DBUS_SERVICE_INTERFACE,
GEIS_DBUS_SUBSCRIPTION_ACTIVATE);
dbus_message_iter_init_append(message, &iter);
dbus_int32_t subscription_id = geis_subscription_id(subscription);
dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &subscription_id);
_geis_dbus_marshall_subscription_filters(subscription, &iter);
return message;
}
/*
* Creates a GEIS_DBUS_SUBSCRIPTION_ACTIVATE method return message.
*/
DBusMessage *
geis_dbus_subscription_activate_return_message(DBusMessage *message,
GeisSubscription subscription)
{
DBusMessage *reply = NULL;
reply = dbus_message_new_method_return(message);
dbus_int32_t subscription_id = -1;
if (subscription)
{
subscription_id = geis_subscription_id(subscription);
}
dbus_message_append_args(reply,
DBUS_TYPE_INT32, &subscription_id,
DBUS_TYPE_INVALID);
return reply;
}
/*
* Indicates if a DBus message is a GEIS_DBUS_SUBSCRIPTION_DEACTIVATE message.
*/
GeisBoolean
geis_dbus_message_is_subscription_deactivate_call(DBusMessage *message)
{
return dbus_message_is_method_call(message,
GEIS_DBUS_SERVICE_INTERFACE,
GEIS_DBUS_SUBSCRIPTION_DEACTIVATE);
}
/*
* Creates a GEIS_DBUS_SUBSCRIPTION_DEACTIVATE method call message.
*/
DBusMessage *
geis_dbus_subscription_deactivate_call_message(GeisSubscription subscription GEIS_UNUSED)
{
DBusMessage *message = NULL;
message = dbus_message_new_method_call(GEIS_DBUS_SERVICE_INTERFACE,
GEIS_DBUS_SERVICE_PATH,
GEIS_DBUS_SERVICE_INTERFACE,
GEIS_DBUS_SUBSCRIPTION_DEACTIVATE);
return message;
}
/**
*/
DBusMessage *
geis_dbus_subscription_deactivate_return_message(DBusMessage *message,
GeisSubscription subscription)
{
DBusMessage *reply = NULL;
reply = dbus_message_new_method_return(message);
dbus_int32_t subscription_id = geis_subscription_id(subscription);
dbus_message_append_args(reply,
DBUS_TYPE_INT32, &subscription_id,
DBUS_TYPE_INVALID);
return reply;
}
/*
* Indicates if a DBus message is a GEIS_DBUS_SUBSCRIPTION_DESTROY message.
*/
GeisBoolean
geis_dbus_message_is_subscription_destroy_call(DBusMessage *message)
{
return dbus_message_is_method_call(message,
GEIS_DBUS_SERVICE_INTERFACE,
GEIS_DBUS_SUBSCRIPTION_DESTROY);
}
/*
* Creates a GEIS_DBUS_SUBSCRIPTION_DESTROY method call message.
*/
DBusMessage *
geis_dbus_subscription_destroy_call_message(GeisSubscription subscription)
{
DBusMessage *message = NULL;
message = dbus_message_new_method_call(GEIS_DBUS_SERVICE_INTERFACE,
GEIS_DBUS_SERVICE_PATH,
GEIS_DBUS_SERVICE_INTERFACE,
GEIS_DBUS_SUBSCRIPTION_DESTROY);
dbus_int32_t server_sub_id = (intptr_t)geis_subscription_pdata(subscription);
dbus_message_append_args(message,
DBUS_TYPE_INT32, &server_sub_id,
DBUS_TYPE_INVALID);
return message;
}
/*
* Creates a GEIS_DBUS_SUBSCRIPTION_DESTROY method return message.
*/
DBusMessage *
geis_dbus_subscription_destroy_return_message(DBusMessage *message)
{
return dbus_message_new_method_return(message);
}
geis-2.2.17+16.04.20160126/libs/Makefile.am 0000644 0000156 0000165 00000001635 12651717544 020102 0 ustar pbuser pbgroup 0000000 0000000 #
# @file libs/Makefile.am
# @brief automake recipe for the geis helper libraries subproject
#
# Copyright 2011 Canonical, Ltd.
#
# This file is part of the geis library. This library is free software;
# you can redistribute it and/or modify it under the terms of the GNU Lesser
# General Public License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
SUBDIRS = geis-util geis-dbus
geis-2.2.17+16.04.20160126/libs/geis-util/ 0000755 0000156 0000165 00000000000 12651717732 017742 5 ustar pbuser pbgroup 0000000 0000000 geis-2.2.17+16.04.20160126/libs/geis-util/geis_bag.h 0000644 0000156 0000165 00000010406 12651717551 021653 0 ustar pbuser pbgroup 0000000 0000000 /**
* @file geis_bag.h
* @brief generic bag container interface
*/
/*
* Copyright 2011 Canonical Ltd.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see .
*/
#ifndef GEIS_UTIL_BAG_H
#define GEIS_UTIL_BAG_H
#include "geis/geis.h"
/**
* @struct GeisBag
* @brief A handle for a generic value-storage bag.
* @ingroup geis_util
*
* A bag is a container that holds zero or more copies of a data structure of
* homogeneous type. It is implemented as a contiguous store of data that grows
* when needed using a predetermined growth factor to give amortized constant
* insertion and removal rates.
*
* Uses of this structure should be wrapped by more type-specific functions.
*
* @typedef GeisBag
* @brief opaque pointer to a GeisBag object.
*/
typedef struct GeisBag *GeisBag;
struct GeisBag
{
GeisSize store_size; /**< The size of data_store in datum_size
* units. */
GeisFloat store_growth_factor; /**< The storage growth factor. */
GeisSize datum_size; /**< The number of bytes in each datum. */
GeisSize data_count; /**< The number of data in data_store. */
void *data_store; /**< The the data store. */
};
#define geis_bag_default_init_alloc 2
#define geis_bag_default_growth_factor 1.5f
/**
* Creates a new, empty bag.
* @memberof GeisBag
*
* @param[in] data_size The size (in bytes) of the stored datum.
* @param[in] init_alloc The initial number of data to allocate space for.
* @param[in] growth_factor The growth factor for extending the bag.
*
* Constructs a generic homogenous container that is designed to hold data with
* a size of @p data_size (in bytes). Space for @p init_alloc data is initially
* allocated, and subsequent expansions will be done by a factor of
* @p growth_factor (taking the ceiling of the current allocation times the @p
* growth_factor).
*
* @returns a new, empty GeisBag on success or a NULL on failure.
*/
GeisBag
geis_bag_new(GeisSize data_size, GeisSize init_alloc, GeisFloat growth_factor);
/**
* Destroys a bag.
* @memberof GeisBag
*
* @param[in] bag The bag to destroy.
*
* Frees all resources used by the bag itself: does not destroy any store data.
*/
void
geis_bag_delete(GeisBag bag);
/**
* Gets the number of data contained in the bag.
* @memberof GeisBag
*
* @param[in] bag The bag.
*
* @returns the count of the data contained in the bag.
*/
GeisSize
geis_bag_count(GeisBag bag);
/**
* Appends a new datam to the store.
* @memberof GeisBag
*
* @param[in] bag The bag to append to.
* @param[in] datum The datum to append.
*
* @returns GEIS_STATUS_UNKNOWN_ERROR if @p datum failed to be appended (for
* example, memory allocation failure during bag expansion), GEIS_STATUS_SUCCESS
* otherwise.
*/
GeisStatus
geis_bag_append(GeisBag bag, void *datum);
/**
* Gets a pointer to a datum by index.
* @memberof GeisBag
*
* @param[in] bag The bag.
* @param[in] index Indicates the datum to retrieve.
*
* @returns NULL if @p index is out of range, a pointer to the indictaed datum
* otherwise.
*/
void*
geis_bag_at(GeisBag bag, GeisSize index);
/**
* Removes an indicated datum from the bag.
* @memberof GeisBag
*
* @param[in] bag The bag.
* @param[in] index Indicates the datum to remove.
*
* This function removes the datum and if necessary fills in the 'hole' in the
* store by moving other data around. It will invalidate any pointers into the
* bag: avoid using 'em. Does not call any deleter functions, so plan
* accordingly.
*
* @returns GEIS_STATUS_BAD_ARGUMENT if @p index is out of range,
* GEIS_STATUS_SUCCESS otherwise.
*/
GeisStatus
geis_bag_remove(GeisBag bag, GeisSize index);
#endif /* GEIS_UTIL_BAG_H */
geis-2.2.17+16.04.20160126/libs/geis-util/geis_bag.c 0000644 0000156 0000165 00000007016 12651717544 021653 0 ustar pbuser pbgroup 0000000 0000000 /**
* @file geis_bag.c
* @brief generic bag container
*/
/*
* Copyright 2011 Canonical Ltd.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see .
*/
#include "geis_config.h"
#include "geis_bag.h"
#include
#include "geis_logging.h"
#include
#include
#include
/**
* Allocates data storage for a GeisBag.
*/
static void *
_bag_store_allocate(GeisSize store_size, GeisSize data_size)
{
void *store = calloc(store_size, data_size);
if (!store)
geis_error("failed to allocate bag store");
return store;
}
/*
* Creates a new, empty bag.
*/
GeisBag
geis_bag_new(GeisSize datum_size, GeisSize init_alloc, GeisFloat growth_factor)
{
GeisBag bag = calloc(1, sizeof(struct GeisBag));
if (!bag)
{
geis_error("failed to allocate bag");
goto final_exit;
}
bag->store_size = init_alloc;
bag->store_growth_factor = growth_factor;
bag->datum_size = datum_size;
bag->data_count = 0;
bag->data_store = _bag_store_allocate(bag->store_size, bag->datum_size);
if (!bag->data_store)
{
free(bag);
bag = NULL;
}
final_exit:
return bag;
}
/*
* Destroys a bag.
*/
void
geis_bag_delete(GeisBag bag)
{
free(bag->data_store);
free(bag);
}
/*
* Gets the number of data contained in the bag.
*/
GeisSize
geis_bag_count(GeisBag bag)
{
return bag->data_count;
}
/*
* Appends a new datam to the store.
*/
GeisStatus
geis_bag_append(GeisBag bag, void *datum)
{
GeisStatus status = GEIS_STATUS_UNKNOWN_ERROR;
if (bag->data_count >= bag->store_size)
{
GeisSize new_store_size = ceilf(bag->store_size * bag->store_growth_factor);
void *new_data_store = _bag_store_allocate(new_store_size, bag->datum_size);
if (!new_data_store)
{
goto final_exit;
}
memcpy(new_data_store, bag->data_store, bag->data_count * bag->datum_size);
free(bag->data_store);
bag->data_store = new_data_store;
bag->store_size = new_store_size;
}
memcpy((char *)bag->data_store + bag->data_count * bag->datum_size,
datum,
bag->datum_size);
++bag->data_count;
status = GEIS_STATUS_SUCCESS;
final_exit:
return status;
}
/*
* Gets a pointer to a datum by index.
*/
void *
geis_bag_at(GeisBag bag, GeisSize index)
{
void *datum = NULL;
if (index >= bag->data_count)
{
assert(index < bag->data_count);
goto final_exit;
}
datum = (char *)bag->data_store + bag->datum_size * index;
final_exit:
return datum;
}
/*
* Removes an indicated datum from the bag.
*/
GeisStatus
geis_bag_remove(GeisBag bag, GeisSize index)
{
GeisStatus status = GEIS_STATUS_BAD_ARGUMENT;
if (index >= bag->data_count)
{
assert(index < bag->data_count);
goto final_exit;
}
size_t size = (bag->data_count - index - 1) * bag->datum_size;
if (size)
{
char *dst = (char *)bag->data_store + bag->datum_size * index;
char *src = dst + bag->datum_size;
memmove(dst, src, size);
}
--bag->data_count;
status = GEIS_STATUS_SUCCESS;
final_exit:
return status;
}
geis-2.2.17+16.04.20160126/libs/geis-util/Makefile.am 0000644 0000156 0000165 00000001726 12651717544 022005 0 ustar pbuser pbgroup 0000000 0000000 #
# @file libs/geis-util/Makefile.am
# @brief automake recipe for the GEIS utilities convenience library
#
# Copyright 2011 Canonical Ltd.
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranties of
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see .
#
noinst_LTLIBRARIES = libgeis-util.la
dist_libgeis_util_la_SOURCES = \
geis_bag.h geis_bag.c \
geis_logging.h geis_logging.c
libgeis_util_la_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_srcdir)/include \
-I$(top_srcdir)/libgeis
geis-2.2.17+16.04.20160126/libs/geis-util/geis_util.dox 0000644 0000156 0000165 00000000276 12651717544 022450 0 ustar pbuser pbgroup 0000000 0000000 /**
* @defgroup geis_util GEIS internal utility library
*
* This is a collection of various utilities used throughout the GEIS
* implementation. It is not a part of the public API.
*/
geis-2.2.17+16.04.20160126/libs/geis-util/geis_logging.h 0000644 0000156 0000165 00000004633 12651717544 022557 0 ustar pbuser pbgroup 0000000 0000000 /**
* @file geis_logging.h
* @brief internal GEIS debug/logging facilities
*
* Copyright 2010 Canonical Ltd.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of version 3 of the GNU Lesser General Public License as published
* by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef GEIS_LOGGING_H_
#define GEIS_LOGGING_H_
/**
* @defgroup geis_logging GEIS Logging Facilities
* @ingroup geis_util
*
* This facility allows the run-time delivery of debugging and error emssages
* from the library. By default, no debug or error diagnostics are emitted by
* the library. However, if the environment variable GEIS_DEBUG is set to an
* appropriate value, these diagnostic messages will be emitted to stderr.
*
* The following GEIS_DEBUG values are supported.
*
* GEIS_DEBUG=1 error messages only are emitted
* GEIS_DEBUG=2 error and warning messages are emitted
* GEIS_DEBUG=3 error, warning, and debug messages are emitted
*
* @{
*/
#define _GEIS_LOG_LEVEL_ERROR 1
#define _GEIS_LOG_LEVEL_WARNING 2
#define _GEIS_LOG_LEVEL_DEBUG 3
/**
* Emits a message at the DEBUG logging level.
* @param[in] fmt printf-style format string
*/
#define geis_debug(...) _geis_message(_GEIS_LOG_LEVEL_DEBUG, \
__extension__ __FUNCTION__, __LINE__, \
__VA_ARGS__)
#define geis_warning(...) _geis_message(_GEIS_LOG_LEVEL_WARNING, \
__extension__ __FUNCTION__, __LINE__, \
__VA_ARGS__)
#define geis_error(...) _geis_message(_GEIS_LOG_LEVEL_ERROR, \
__extension__ __FUNCTION__, __LINE__, \
__VA_ARGS__)
int _geis_message(int level,
const char *function, int line,
const char *format, ...) __attribute__((format(printf, 4, 5)));
/* @} */
#endif /* GEIS_LOGGING_H_ */
geis-2.2.17+16.04.20160126/libs/geis-util/geis_logging.c 0000644 0000156 0000165 00000003613 12651717544 022547 0 ustar pbuser pbgroup 0000000 0000000 /**
* @file geis_logging.h
*
* Copyright 2010 Canonical Ltd.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of version 3 of the GNU Lesser General Public License as published
* by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "geis_logging.h"
#include
#include
#include
#include
static const char *prefix_format = "GEIS(%s)-%s:%d ";
static const char *debug_marker = "debug";
static const char *warning_marker = "warning";
static const char *error_marker = "error";
static int
reporting_level()
{
char *level = getenv("GEIS_DEBUG");
if (level)
{
return atoi(level);
}
return 0;
}
static int
level_is_enabled(int desired_level)
{
static int level = -1;
if (level < 0)
level = reporting_level();
return level >= desired_level;
}
int
_geis_message(int level, const char* function, int line, const char *format, ...)
{
int count = 0;
if (level_is_enabled(level))
{
const char *marker = NULL;
switch (level)
{
case _GEIS_LOG_LEVEL_DEBUG:
marker = debug_marker;
break;
case _GEIS_LOG_LEVEL_WARNING:
marker = warning_marker;
break;
default:
marker = error_marker;
break;
}
fprintf(stderr, prefix_format, marker, function, line);
va_list ap;
va_start(ap, format);
count = vfprintf(stderr, format, ap);
va_end(ap);
fprintf(stderr, "\n");
}
return count;
}
geis-2.2.17+16.04.20160126/README 0000644 0000156 0000165 00000001266 12651717544 015775 0 ustar pbuser pbgroup 0000000 0000000 This is the source for the GEIS (Gesture Engine Implementation Support) library
built on top of the XCB bindings to the GRAIL gesture recognition and
instantiation library.
Please see the file INSTALL for instructoins on building and installing this
software. Better yet, pull the binaries from your operating system
distribution.
To prepare the sources for building on a fresh VCS checkout, you will need to
run the shell script autogen.sh. This requires that the following packages be
installed first so that autoconf macros are available. In addition, the full
autotools suite (autoconf, automake, libtool, etc) must be available.
libxorg-gtest-dev 0.2.0
pkg-config 0.26
geis-2.2.17+16.04.20160126/Makefile.am 0000644 0000156 0000165 00000002355 12651717544 017151 0 ustar pbuser pbgroup 0000000 0000000 #
# @file Makefile.am
# @brief top-level makefile for the libgeis project
#
# Copyright 2010, 2011, 2012 Canonical, Ltd.
#
# This file is part of the geis library. This library is free software;
# you can redistribute it and/or modify it under the terms of the GNU Lesser
# General Public License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
ACLOCAL_AMFLAGS = -I m4 --install
AM_MAKEFLAGS = --no-print-directory
AM_DISTCHECK_CONFIGURE_FLAGS = --disable-integration-tests
SUBDIRS = include libs libgeis testsuite python tools examples doc data
doc-%:
$(MAKE) -C doc $@
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libgeis.pc
EXTRA_DIST = \
AUTHORS \
COPYING \
COPYING.GPL \
INSTALL \
NEWS \
README
geis-2.2.17+16.04.20160126/tools/ 0000755 0000156 0000165 00000000000 12651717732 016247 5 ustar pbuser pbgroup 0000000 0000000 geis-2.2.17+16.04.20160126/tools/geis-server/ 0000755 0000156 0000165 00000000000 12651717732 020502 5 ustar pbuser pbgroup 0000000 0000000 geis-2.2.17+16.04.20160126/tools/geis-server/geis-server.c 0000644 0000156 0000165 00000003761 12651717544 023111 0 ustar pbuser pbgroup 0000000 0000000 /**
* geis-server.c Test driver for the GEIS server.
*
* Copyright 2011 Canonical Ltd.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of version 3 of the GNU General Public License as published by the
* Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see
#include
#include
#include
#include
int
main()
{
GeisStatus status;
Geis geis = geis_new(GEIS_INIT_SERVICE_PROVIDER,
GEIS_INIT_XCB_BACKEND,
NULL);
if (!geis)
{
fprintf(stderr, "error creating geis instance.\n");
goto final_exit;
}
int geis_fd = -1;
status = geis_get_configuration(geis, GEIS_CONFIGURATION_FD, &geis_fd);
if (status != GEIS_STATUS_SUCCESS)
{
fprintf(stderr, "error obtaining geis fd.\n");
goto unwind_geis;
}
while (1)
{
fd_set read_fds;
FD_ZERO(&read_fds);
FD_SET(0, &read_fds);
FD_SET(geis_fd, &read_fds);
int sstat = select(geis_fd + 1, &read_fds, NULL, NULL, NULL);
if (sstat < 0)
{
fprintf(stderr, "error %d in select(): %s\n", errno, strerror(errno));
break;
}
if (FD_ISSET(geis_fd, &read_fds))
{
status = geis_dispatch_events(geis);
GeisEvent event_out;
status = geis_next_event(geis, &event_out);
while (status == GEIS_STATUS_CONTINUE || status == GEIS_STATUS_SUCCESS)
{
geis_event_delete(event_out);
status = geis_next_event(geis, &event_out);
}
}
if (FD_ISSET(0, &read_fds))
{
break;
}
}
unwind_geis:
geis_delete(geis);
final_exit:
return 0;
}
geis-2.2.17+16.04.20160126/tools/geis-server/Makefile.am 0000644 0000156 0000165 00000002014 12651717544 022534 0 ustar pbuser pbgroup 0000000 0000000 #
# @file tools/geis-server
# @brief automake recipe for the GEIS v2.0 test server
#
# Copyright 2011 Canonical, Ltd.
#
# This file is part of the geis library. This library is free software;
# you can redistribute it and/or modify it under the terms of the GNU Lesser
# General Public License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see