 |
GEIS
2.0
Gesture Engine Interface Support
|
#include "geis_config.h"
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <sys/select.h>
void print_attr(GeisAttr attr)
{
{
printf(" \"%s\": %s\n", attr_name,
break;
break;
break;
break;
default:
break;
}
}
void
{
GeisAttr attr;
GeisSize i;
printf("device %02d \"%s\"\n",
{
}
}
void
{
GeisSize i;
GeisAttr attr;
printf("gesture\n");
{
GeisSize j;
{
GeisSize k;
for (k = 0; k < attr_count; ++k)
{
}
{
GeisSize n;
printf("+touch %u\n", (unsigned)k);
{
}
}
}
}
}
void
{
NULL);
{
fprintf(stderr, "error adding filter\n");
}
}
int
main(int argc GEIS_UNUSED, char* argv[] GEIS_UNUSED)
{
int fd;
NULL);
while(1)
{
fd_set read_fds;
FD_ZERO(&read_fds);
FD_SET(0, &read_fds);
FD_SET(fd, &read_fds);
int sstat = select(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(fd, &read_fds))
{
{
{
case GEIS_EVENT_INIT_COMPLETE:
target_subscription(geis, subscription);
break;
case GEIS_EVENT_DEVICE_AVAILABLE:
case GEIS_EVENT_DEVICE_UNAVAILABLE:
dump_device_event(event);
break;
case GEIS_EVENT_GESTURE_BEGIN:
case GEIS_EVENT_GESTURE_UPDATE:
case GEIS_EVENT_GESTURE_END:
dump_gesture_event(event);
break;
default:
break;
}
}
}
if (FD_ISSET(0, &read_fds))
{
break;
}
}
}
GeisAttr geis_touch_attr(GeisTouch touch, GeisSize index)
Gets an indicated attr from a touch.
GeisSize geis_device_attr_count(GeisDevice device)
Gets the number of attributes of the device.
#define GEIS_EVENT_ATTRIBUTE_GROUPSET
Definition: geis.h:2082
GeisGroup geis_groupset_group(GeisGroupSet groupset, GeisSize index)
Gets an indicated gesture group from a groupset.
GeisString geis_device_name(GeisDevice device)
Gets the name of the input device.
GeisFloat geis_attr_value_to_float(GeisAttr attr)
Gets the value of an attribute as a GeisFloat.
#define GEIS_EVENT_ATTRIBUTE_DEVICE
Definition: geis.h:1273
GeisStatus geis_subscription_activate(GeisSubscription subscription)
Activates a subscription.
GeisInteger geis_device_id(GeisDevice device)
Gets the system identifier of the iput device.
GeisStatus geis_subscription_delete(GeisSubscription subscription)
Destroys a GEIS v2.0 subscription object.
GeisAttr geis_event_attr_by_name(GeisEvent event, GeisString attr_name)
Gets a named attribute from the event.
GEIS_VARARG GeisStatus geis_filter_add_term(GeisFilter filter, GeisFilterFacility facility,...)
Adds a term to a filter.
GeisSize geis_group_frame_count(GeisGroup group)
Gets the number of gesture frames in a gesture group.
GeisStatus geis_get_configuration(Geis geis, GeisString configuration_item_name, void *configuration_item_value)
Gets a feature configuration value.
void geis_event_delete(GeisEvent event)
Destroys a GeisEvent.
GeisAttr geis_device_attr(GeisDevice device, GeisSize index)
Gets the indicated attribute of the device.
#define GEIS_INIT_TRACK_DEVICES
Definition: geis.h:566
#define GEIS_EVENT_ATTRIBUTE_TOUCHSET
Definition: geis.h:2083
GeisSize geis_frame_touchid_count(GeisFrame frame)
Gets the number of touches making up a gesture for the frame.
GeisStatus geis_subscription_add_filter(GeisSubscription subscription, GeisFilter filter)
Adds a filter to a subscription.
GeisTouchId geis_frame_touchid(GeisFrame frame, GeisSize index)
Gets the ID of the indicated touch within the gesture frame.
GeisPointer geis_attr_value_to_pointer(GeisAttr attr)
Gets the value of an attribute as a GeisPointer.
@ GEIS_ATTR_TYPE_BOOLEAN
Attr is truth-valued .
Definition: geis.h:93
@ GEIS_FILTER_OP_EQ
Compares for equality.
Definition: geis.h:1724
@ GEIS_STATUS_CONTINUE
normal successful completion with data still remaining
Definition: geis.h:75
GeisSubscription geis_subscription_new(Geis geis, GeisString name, GeisSubscriptionFlags flags)
Creates a new subscription.
GeisStatus
Errors returned from calls.
Definition: geis.h:72
GeisAttr geis_frame_attr(GeisFrame frame, GeisSize index)
Gets an indicated attr from a gesture frame.
GeisAttrType geis_attr_type(GeisAttr attr)
Gets the type of an attribute value.
GeisInteger geis_group_id(GeisGroup group)
Gets the identifier of a gesture group.
@ GEIS_ATTR_TYPE_STRING
Attr is a null-terminated UTF-8 string.
Definition: geis.h:97
GeisFrame geis_group_frame(GeisGroup group, GeisSize index)
Gets an indicated gesture frame from a gesture group.
GeisStatus geis_dispatch_events(Geis geis)
Pumps the GEIS event loop.
GeisTouch geis_touchset_touch_by_id(GeisTouchSet touchset, GeisTouchId touchid)
Gets an identified touch from a touchset.
GeisStatus geis_next_event(Geis geis, GeisEvent *event)
Retrieves the next queued GEIS event.
#define GEIS_INIT_TRACK_GESTURE_CLASSES
Definition: geis.h:567
GeisString geis_attr_value_to_string(GeisAttr attr)
Gets the value of an attribute as a GeisString.
GeisGestureId geis_frame_id(GeisFrame frame)
Gets the identifier of a gesture frame.
#define GEIS_CONFIGURATION_FD
Definition: geis.h:714
@ GEIS_ATTR_TYPE_INTEGER
Attr is a counting number.
Definition: geis.h:95
@ GEIS_SUBSCRIPTION_CONT
Definition: geis.h:1845
GeisFilter geis_filter_new(Geis geis, GeisString name)
Creates a new, empty filter.
@ GEIS_ATTR_TYPE_FLOAT
Attr is real-valued.
Definition: geis.h:94
GeisBoolean geis_attr_value_to_boolean(GeisAttr attr)
Gets the value of an attribute as a GeisBoolean.
GeisStatus geis_delete(Geis geis)
Cleans up an instance of the GEIS v2.0 API.
GeisString geis_attr_name(GeisAttr attr)
An opaque type that encapsulates a GEIS attribute.
GeisInteger geis_attr_value_to_integer(GeisAttr attr)
Gets the value of an attribute as a GeisInteger.
GeisSize geis_groupset_group_count(GeisGroupSet groupset)
Gets the number of gesture groups in a groupset.
@ GEIS_FILTER_CLASS
Filters on gesture class and gesture attributes.
Definition: geis.h:1714
GEIS_VARARG Geis geis_new(GeisString init_arg_name,...)
Initializes an instance of the GEIS v2.0 API.
GeisEventType geis_event_type(GeisEvent event)
Gets the type of the event.
GeisSize geis_frame_attr_count(GeisFrame frame)
Gets the number of attrs associated with a gesture frame.
GeisSize geis_touch_attr_count(GeisTouch touch)
Gets the number of attrs associated with a touch.
@ GEIS_STATUS_SUCCESS
normal successful completion
Definition: geis.h:74