~ubuntu-branches/ubuntu/trusty/geis/trusty

« back to all changes in this revision

Viewing changes to python/_geis_bindings/_geis_bindings.c

  • Committer: Package Import Robot
  • Author(s): Chase Douglas
  • Date: 2012-07-30 08:51:42 UTC
  • Revision ID: package-import@ubuntu.com-20120730085142-jrc33ygjvt0ob1wl
Tags: upstream-2.2.11
ImportĀ upstreamĀ versionĀ 2.2.11

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <Python.h>
 
2
 
 
3
#include <geis/geis.h>
 
4
#include "geis_test_api.h"
 
5
 
 
6
 
 
7
PyDoc_STRVAR(module_doc,
 
8
        "Low-level python bindings for libgeis.\n"
 
9
        "Do not use this module directly "
 
10
        "-- the public API is provided by the 'geis' module."
 
11
);
 
12
 
 
13
 
 
14
static PyMethodDef exported_functions[] = {
 
15
  { NULL, NULL, 0, NULL }
 
16
};
 
17
 
 
18
PyMODINIT_FUNC
 
19
init_geis_bindings(void)
 
20
{
 
21
  PyObject *this_module;
 
22
 
 
23
  this_module = Py_InitModule3("_geis_bindings", exported_functions, module_doc);
 
24
  if (!this_module)
 
25
    return;
 
26
 
 
27
  /* Global status values. */
 
28
  PyModule_AddIntConstant(this_module, "GEIS_STATUS_SUCCESS",
 
29
                          GEIS_STATUS_SUCCESS);
 
30
  PyModule_AddIntConstant(this_module, "GEIS_STATUS_CONTINUE",
 
31
                          GEIS_STATUS_CONTINUE);
 
32
  PyModule_AddIntConstant(this_module, "GEIS_STATUS_EMPTY",
 
33
                          GEIS_STATUS_EMPTY);
 
34
  PyModule_AddIntConstant(this_module, "GEIS_STATUS_NOT_SUPPORTED",
 
35
                          GEIS_STATUS_NOT_SUPPORTED);
 
36
  PyModule_AddIntConstant(this_module, "GEIS_STATUS_BAD_ARGUMENT",
 
37
                          GEIS_STATUS_BAD_ARGUMENT);
 
38
  PyModule_AddIntConstant(this_module, "GEIS_STATUS_UNKNOWN_ERROR",
 
39
                          GEIS_STATUS_UNKNOWN_ERROR);
 
40
 
 
41
  /* Attribute types */
 
42
  PyModule_AddIntConstant(this_module, "GEIS_ATTR_TYPE_BOOLEAN",
 
43
                          GEIS_ATTR_TYPE_BOOLEAN);
 
44
  PyModule_AddIntConstant(this_module, "GEIS_ATTR_TYPE_FLOAT",
 
45
                          GEIS_ATTR_TYPE_FLOAT);
 
46
  PyModule_AddIntConstant(this_module, "GEIS_ATTR_TYPE_INTEGER",
 
47
                          GEIS_ATTR_TYPE_INTEGER);
 
48
  PyModule_AddIntConstant(this_module, "GEIS_ATTR_TYPE_POINTER",
 
49
                          GEIS_ATTR_TYPE_POINTER);
 
50
  PyModule_AddIntConstant(this_module, "GEIS_ATTR_TYPE_STRING",
 
51
                          GEIS_ATTR_TYPE_STRING);
 
52
 
 
53
  /* Initialization Options */
 
54
  PyModule_AddStringMacro(this_module, GEIS_INIT_SERVICE_PROVIDER);
 
55
  PyModule_AddStringMacro(this_module, GEIS_INIT_TRACK_DEVICES);
 
56
  PyModule_AddStringMacro(this_module, GEIS_INIT_TRACK_GESTURE_CLASSES);
 
57
  PyModule_AddStringMacro(this_module, GEIS_INIT_SYNCHRONOUS_START);
 
58
  PyModule_AddStringMacro(this_module, GEIS_INIT_MOCK_BACKEND);
 
59
  PyModule_AddStringMacro(this_module, GEIS_INIT_DBUS_BACKEND);
 
60
  PyModule_AddStringMacro(this_module, GEIS_INIT_GRAIL_BACKEND);
 
61
  PyModule_AddStringMacro(this_module, GEIS_INIT_XCB_BACKEND);
 
62
 
 
63
  /* Configuration Items */
 
64
  PyModule_AddStringMacro(this_module, GEIS_CONFIGURATION_FD);
 
65
  PyModule_AddStringMacro(this_module, GEIS_CONFIG_MAX_EVENTS);
 
66
 
 
67
  /* Device Constants */
 
68
  PyModule_AddStringMacro(this_module, GEIS_EVENT_ATTRIBUTE_DEVICE);
 
69
  PyModule_AddStringMacro(this_module, GEIS_DEVICE_ATTRIBUTE_NAME);
 
70
  PyModule_AddStringMacro(this_module, GEIS_DEVICE_ATTRIBUTE_ID);
 
71
  PyModule_AddStringMacro(this_module, GEIS_DEVICE_ATTRIBUTE_TOUCHES);
 
72
  PyModule_AddStringMacro(this_module, GEIS_DEVICE_ATTRIBUTE_DIRECT_TOUCH);
 
73
  PyModule_AddStringMacro(this_module, GEIS_DEVICE_ATTRIBUTE_INDEPENDENT_TOUCH);
 
74
 
 
75
  /* Gesture Class Constants */
 
76
  PyModule_AddStringMacro(this_module, GEIS_EVENT_ATTRIBUTE_CLASS);
 
77
  PyModule_AddStringMacro(this_module, GEIS_CLASS_ATTRIBUTE_NAME);
 
78
  PyModule_AddStringMacro(this_module, GEIS_CLASS_ATTRIBUTE_ID);
 
79
 
 
80
  /* Region Constants */
 
81
  PyModule_AddStringMacro(this_module, GEIS_REGION_ATTRIBUTE_WINDOWID);
 
82
  PyModule_AddStringMacro(this_module, GEIS_REGION_X11_ROOT);
 
83
  PyModule_AddStringMacro(this_module, GEIS_REGION_X11_WINDOWID);
 
84
 
 
85
  /* Gesture Constants */
 
86
  PyModule_AddStringMacro(this_module, GEIS_EVENT_ATTRIBUTE_GROUPSET);
 
87
  PyModule_AddStringMacro(this_module, GEIS_EVENT_ATTRIBUTE_TOUCHSET);
 
88
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_ANGLE);
 
89
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_ANGLE_DELTA);
 
90
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_ANGULAR_VELOCITY);
 
91
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_X1);
 
92
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_X2);
 
93
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_Y1);
 
94
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_Y2);
 
95
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_CHILD_WINDOW_ID);
 
96
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_DELTA_X);
 
97
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_DELTA_Y);
 
98
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_DEVICE_ID);
 
99
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_EVENT_WINDOW_ID);
 
100
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_FOCUS_X);
 
101
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_FOCUS_Y);
 
102
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_GESTURE_NAME);
 
103
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_POSITION_X);
 
104
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_POSITION_Y);
 
105
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_RADIAL_VELOCITY);
 
106
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_RADIUS);
 
107
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_RADIUS_DELTA);
 
108
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_ROOT_WINDOW_ID);
 
109
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_TAP_TIME);
 
110
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_TIMESTAMP);
 
111
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_TOUCH_0_ID);
 
112
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_TOUCH_0_X);
 
113
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_TOUCH_0_Y);
 
114
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_TOUCH_1_ID);
 
115
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_TOUCH_1_X);
 
116
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_TOUCH_1_Y);
 
117
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_TOUCH_2_ID);
 
118
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_TOUCH_2_X);
 
119
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_TOUCH_2_Y);
 
120
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_TOUCH_3_ID);
 
121
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_TOUCH_3_X);
 
122
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_TOUCH_3_Y);
 
123
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_TOUCH_4_ID);
 
124
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_TOUCH_4_X);
 
125
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_TOUCH_4_Y);
 
126
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_TOUCHES);
 
127
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_VELOCITY_X);
 
128
  PyModule_AddStringMacro(this_module, GEIS_GESTURE_ATTRIBUTE_VELOCITY_Y);
 
129
  PyModule_AddStringMacro(this_module, GEIS_TOUCH_ATTRIBUTE_ID);
 
130
  PyModule_AddStringMacro(this_module, GEIS_TOUCH_ATTRIBUTE_X);
 
131
  PyModule_AddStringMacro(this_module, GEIS_TOUCH_ATTRIBUTE_Y);
 
132
 
 
133
  /* Event Types */
 
134
  PyModule_AddIntConstant(this_module, "GEIS_EVENT_DEVICE_AVAILABLE",
 
135
                          GEIS_EVENT_DEVICE_AVAILABLE);
 
136
  PyModule_AddIntConstant(this_module, "GEIS_EVENT_DEVICE_UNAVAILABLE",
 
137
                          GEIS_EVENT_DEVICE_UNAVAILABLE);
 
138
  PyModule_AddIntConstant(this_module, "GEIS_EVENT_CLASS_AVAILABLE",
 
139
                          GEIS_EVENT_CLASS_AVAILABLE);
 
140
  PyModule_AddIntConstant(this_module, "GEIS_EVENT_CLASS_CHANGED",
 
141
                          GEIS_EVENT_CLASS_CHANGED);
 
142
  PyModule_AddIntConstant(this_module, "GEIS_EVENT_CLASS_UNAVAILABLE",
 
143
                          GEIS_EVENT_CLASS_UNAVAILABLE);
 
144
  PyModule_AddIntConstant(this_module, "GEIS_EVENT_GESTURE_BEGIN",
 
145
                          GEIS_EVENT_GESTURE_BEGIN);
 
146
  PyModule_AddIntConstant(this_module, "GEIS_EVENT_GESTURE_UPDATE",
 
147
                          GEIS_EVENT_GESTURE_UPDATE);
 
148
  PyModule_AddIntConstant(this_module, "GEIS_EVENT_GESTURE_END",
 
149
                          GEIS_EVENT_GESTURE_END);
 
150
  PyModule_AddIntConstant(this_module, "GEIS_EVENT_INIT_COMPLETE",
 
151
                          GEIS_EVENT_INIT_COMPLETE);
 
152
  PyModule_AddIntConstant(this_module, "GEIS_EVENT_USER_DEFINED",
 
153
                          GEIS_EVENT_USER_DEFINED);
 
154
  PyModule_AddIntConstant(this_module, "GEIS_EVENT_ERROR",
 
155
                          GEIS_EVENT_ERROR);
 
156
 
 
157
  /* Filtery Bits */
 
158
  PyModule_AddIntConstant(this_module, "GEIS_FILTER_DEVICE", GEIS_FILTER_DEVICE);
 
159
  PyModule_AddIntConstant(this_module, "GEIS_FILTER_CLASS", GEIS_FILTER_CLASS);
 
160
  PyModule_AddIntConstant(this_module, "GEIS_FILTER_REGION", GEIS_FILTER_REGION);
 
161
 
 
162
  PyModule_AddIntConstant(this_module, "GEIS_FILTER_OP_EQ", GEIS_FILTER_OP_EQ);
 
163
  PyModule_AddIntConstant(this_module, "GEIS_FILTER_OP_NE", GEIS_FILTER_OP_NE);
 
164
  PyModule_AddIntConstant(this_module, "GEIS_FILTER_OP_GT", GEIS_FILTER_OP_GT);
 
165
  PyModule_AddIntConstant(this_module, "GEIS_FILTER_OP_GE", GEIS_FILTER_OP_GE);
 
166
  PyModule_AddIntConstant(this_module, "GEIS_FILTER_OP_LT", GEIS_FILTER_OP_LT);
 
167
  PyModule_AddIntConstant(this_module, "GEIS_FILTER_OP_LE", GEIS_FILTER_OP_LE);
 
168
}
 
169