Merge lp:~bregma/geis/packaging-1.0.11 into lp:~oif-team/geis/packaging
- packaging-1.0.11
- Merge into packaging
Proposed by
Stephen M. Webb
Status: | Merged |
---|---|
Merged at revision: | 84 |
Proposed branch: | lp:~bregma/geis/packaging-1.0.11 |
Merge into: | lp:~oif-team/geis/packaging |
Diff against target: |
2812 lines (+1641/-391) 24 files modified
ChangeLog (+169/-0) Makefile.in (+4/-0) configure (+177/-25) configure.ac (+6/-1) debian/changelog (+6/-2) doc/Makefile.in (+4/-0) doc/geistest.1 (+23/-5) geis/Makefile.in (+4/-0) geis/geis.h (+24/-2) libutouch-geis-xcb/Makefile.am (+11/-6) libutouch-geis-xcb/Makefile.in (+44/-16) libutouch-geis-xcb/geis.c (+16/-5) libutouch-geis-xcb/geis_debug.h (+0/-27) libutouch-geis-xcb/geis_instance.c (+44/-24) libutouch-geis-xcb/geis_instance.h (+7/-11) libutouch-geis-xcb/geis_instance_table.c (+127/-0) libutouch-geis-xcb/geis_instance_table.h (+41/-0) libutouch-geis-xcb/geis_logging.c (+87/-0) libutouch-geis-xcb/geis_logging.h (+64/-0) libutouch-geis-xcb/geis_xcb.c (+530/-215) libutouch-geis-xcb/geis_xcb.h (+25/-17) testsuite/Makefile.in (+4/-0) testsuite/geistest/Makefile.in (+4/-0) testsuite/geistest/geistest.c (+220/-35) |
To merge this branch: | bzr merge lp:~bregma/geis/packaging-1.0.11 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Henrik Rydberg (community) | Approve | ||
Review via email: mp+35685@code.launchpad.net |
Commit message
Packging utouch-geis release 1.0.11
Description of the change
Packages utouch-geis 1.0.11 for Ubuntu
This merge request supersedes the previous similar merge requires because a step was missed during upstream source merging.
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'ChangeLog' | |||
2 | --- ChangeLog 2010-08-23 14:34:23 +0000 | |||
3 | +++ ChangeLog 2010-09-16 16:28:52 +0000 | |||
4 | @@ -1,3 +1,172 @@ | |||
5 | 1 | 2010-09-14 Stephen M. Webb <stephen.webb@canonical.com> | ||
6 | 2 | |||
7 | 3 | Version bump tp 1.0.11 | ||
8 | 4 | |||
9 | 5 | * configure.ac: bumped package version to 1.0.11 | ||
10 | 6 | * libutouch-geis-xcb/Makefile.am: bumped shlib version to reflect changes | ||
11 | 7 | |||
12 | 8 | 2010-09-01 Stephen M. Webb <stephen.webb@canonical.com> | ||
13 | 9 | |||
14 | 10 | Fixed typos in manpage. | ||
15 | 11 | |||
16 | 12 | * doc/geistest.1: fixed several typographical errors | ||
17 | 13 | |||
18 | 14 | 2010-09-01 Stephen M. Webb <stephen.webb@canonical.com> | ||
19 | 15 | |||
20 | 16 | Fixed a memory leak when logging messages. | ||
21 | 17 | |||
22 | 18 | * libutouch-geis-xcb/geis_logging.c (_geis_message): fixed memory leak | ||
23 | 19 | |||
24 | 20 | 2010-08-31 Stephen M. Webb <stephen.webb@canonical.com> | ||
25 | 21 | |||
26 | 22 | Fixed prefix string used in diagnostics. | ||
27 | 23 | |||
28 | 24 | * libutouch-geis-xcb/geis_logging.c (_geis_message): fixed which prefix string | ||
29 | 25 | gets used for which diagnostic level | ||
30 | 26 | |||
31 | 27 | 2010-08-31 Stephen M. Webb <stephen.webb@canonical.com> | ||
32 | 28 | |||
33 | 29 | Removed input device enumeration handling until later. | ||
34 | 30 | |||
35 | 31 | * libutouch-geis-xcb/geis.c (geis_input_devices): removed #if 0 block | ||
36 | 32 | * libutouch-geis-xcb/geis_instance.h (geis_instance_input_devices): removed | ||
37 | 33 | * libutouch-geis-xcb/geis_instance.c (geis_instance_input_devices): removed | ||
38 | 34 | * libutouch-geis-xcb/geis_xcb.h (geis_xcb_input_devices): added funcs and | ||
39 | 35 | cookie parameters | ||
40 | 36 | * libutouch-geis-xcb/geis_xcb.c (_GeisXcb): added input_funcs and input_cookie | ||
41 | 37 | (geis_xcb_new): removed #if 0 blocks | ||
42 | 38 | (geis_xcb_input_devices): removed XInput handling until later | ||
43 | 39 | |||
44 | 40 | 2010-08-30 Stephen M. Webb <stephen.webb@canonical.com> | ||
45 | 41 | |||
46 | 42 | Removed some debug code and fixed pasto. | ||
47 | 43 | |||
48 | 44 | * libutouch-geis-xcb/geis_instance.c: fixed a pasto | ||
49 | 45 | * testsuite/geistest/geistest.c: removed debug code | ||
50 | 46 | |||
51 | 47 | 2010-08-30 Stephen M. Webb <stephen.webb@canonical.com> | ||
52 | 48 | |||
53 | 49 | Fixed so multiple windows will work. | ||
54 | 50 | |||
55 | 51 | Altered geistest to work with a single window or all windows, had to fix geis | ||
56 | 52 | implementation so this was possible. | ||
57 | 53 | |||
58 | 54 | * libutouch-geis-xcb/geis_instance_table.c: new file | ||
59 | 55 | * libutouch-geis-xcb/geis_instance_table.h: new file | ||
60 | 56 | * configure.ac: added package checks for x11-xcb and xi | ||
61 | 57 | * doc/geistest.1: documented new CLI switches | ||
62 | 58 | * geis/geis.h (geis_input_devices): fixed argument type | ||
63 | 59 | * libutouch-geis-xcb/Makefile.am (libutouch_geis_la_SOURCES): added new files | ||
64 | 60 | (libutouch_geis_la_CFLAGS): aded X11XCB_CFLAGS and XI2_CFLAGS | ||
65 | 61 | (libutouch_geis_la_LIBADD): aded X11XCB_LIBS and XI2LIBS_ | ||
66 | 62 | * libutouch-geis-xcb/geis.c (s_geis_xcb): new static global | ||
67 | 63 | (geis_init): used it | ||
68 | 64 | * libutouch-geis-xcb/geis_instance.h (_GeisInstance): added window_id | ||
69 | 65 | (geis_instance_new): renamed from geis_instance_get | ||
70 | 66 | (geis_instance_input_devices): new function | ||
71 | 67 | (geis_instance_subscribe): added GeisXcb parameter | ||
72 | 68 | (geis_instance_get_window_id): new function | ||
73 | 69 | (geis_instance_fd): removed function | ||
74 | 70 | (geis_instance_event_dispatch): removed function | ||
75 | 71 | * libutouch-geis-xcb/geis_instance.c: implemented new functions | ||
76 | 72 | * libutouch-geis-xcb/geis_xcb.h (geis_xcb_new): renamed from geis_xcb_get | ||
77 | 73 | (geis_xcb_create_instance): new function | ||
78 | 74 | (geis_xcb_input_devices): new function | ||
79 | 75 | (geis_xcb_subscribe): added GeisInstance parameter | ||
80 | 76 | (geis_xcb_dispatch): changed parameter type to GeisXcb | ||
81 | 77 | * libutouch-geis-xcb/geis_xcb.c: Implemeneted new functions | ||
82 | 78 | * testsuite/geistest/geistest.c (parse_opts): added -w switch | ||
83 | 79 | (subscribe_window): new function | ||
84 | 80 | (subscribe_windows_preorder): new function | ||
85 | 81 | (subscribe_all_windows): new function | ||
86 | 82 | (main): used the new functions | ||
87 | 83 | |||
88 | 84 | 2010-08-30 Stephen M. Webb <stephen.webb@canonical.com> | ||
89 | 85 | |||
90 | 86 | Added runtime diagnostic facility. | ||
91 | 87 | |||
92 | 88 | * libutouch-geis-xcb/geis_debug.h: replaced with | ||
93 | 89 | * libutouch-geis-xcb/geis_logging.h: mew file | ||
94 | 90 | * libutouch-geis-xcb/geis_logging.c: new file | ||
95 | 91 | * libutouch-geis-xcb/Makefile.am: replaced above files | ||
96 | 92 | * libutouch-geis-xcb/geis_xcb.c: replaced geis_debug calls with | ||
97 | 93 | geis_warning or geis_error as appropriate | ||
98 | 94 | |||
99 | 95 | 2010-08-27 Stephen M. Webb <stephen.webb@canonical.com> | ||
100 | 96 | |||
101 | 97 | Fixed checking of gesture masks for multiple input devices. | ||
102 | 98 | |||
103 | 99 | * libutouch-geis-xcb/geis_instance.c (geis_instance_subscribe): | ||
104 | 100 | added missing index increment | ||
105 | 101 | * libutouch-geis-xcb/geis_xcb.c (geis_xcb_verify_event_selection): | ||
106 | 102 | added logic for iterating through multiple input devices | ||
107 | 103 | |||
108 | 104 | 2010-08-27 Stephen M. Webb <stephen.webb@canonical.com> | ||
109 | 105 | |||
110 | 106 | Move gesture-type-added callback until later in the subscription sequence. | ||
111 | 107 | |||
112 | 108 | * libutouch-geis-xcb/geis_xcb.c (geis_xcb_subscribe): move call to | ||
113 | 109 | geis_xcb_dispatch_gesture_type until later in sequence | ||
114 | 110 | |||
115 | 111 | 2010-08-27 Stephen M. Webb <stephen.webb@canonical.com> | ||
116 | 112 | |||
117 | 113 | Removed "Grab" gestire entirely from the list of known gestures. | ||
118 | 114 | |||
119 | 115 | * libutouch-geis-xcb/geis_xcb.c (s_grail_type_map): removed GRAIL_TYPE_SYSFLAG1 | ||
120 | 116 | (geis_xcb_dispatch_gesture_type): removed references to GRAIL_TYPE_SYSFLAG1 | ||
121 | 117 | |||
122 | 118 | 2010-08-26 Stephen M. Webb <stephen.webb@canonical.com> | ||
123 | 119 | |||
124 | 120 | Prevented "Grab" gesture from being propagated. | ||
125 | 121 | |||
126 | 122 | * libutouch-geis-xcb/geis_xcb.c (geis_xcb_dispatch_gesture_type): skipped | ||
127 | 123 | notification of the availability of the "Grab" gesture type. | ||
128 | 124 | |||
129 | 125 | 2010-08-26 Stephen M. Webb <stephen.webb@canonical.com> | ||
130 | 126 | |||
131 | 127 | Fixed an allocation size issue. | ||
132 | 128 | |||
133 | 129 | * libutouch-geis-xcb/geis_instance.c (geis_instance_get): fixed allocation | ||
134 | 130 | size issue | ||
135 | 131 | |||
136 | 132 | 2010-08-26 Stephen M. Webb <stephen.webb@canonical.com> | ||
137 | 133 | |||
138 | 134 | Minor style adjustments. Adjusted whitespace for consistency. | ||
139 | 135 | |||
140 | 136 | * libutouch-geis-xcb/geis_xcb.c (geis_xcb_verify_event_selection): | ||
141 | 137 | renamed function from geis_xcb_select_events | ||
142 | 138 | (geis_xcb_determine_primitive_type): renamed from | ||
143 | 139 | geis_xcb_determine_fundamental_gesture_type | ||
144 | 140 | (geis_xcb_get_gesture_type_primitive_name): renamed form | ||
145 | 141 | geis_xcb_get_gesture_type_fundamental_name | ||
146 | 142 | |||
147 | 143 | 2010-08-25 Stephen M. Webb <stephen.webb@canonical.com> | ||
148 | 144 | |||
149 | 145 | Reverted version bump. | ||
150 | 146 | |||
151 | 147 | * configure,.ac (AC_INIT): reverted to version 1.0.10 | ||
152 | 148 | |||
153 | 149 | 2010-08-23 Stephen M. Webb <stephen.webb@canonical.com> | ||
154 | 150 | |||
155 | 151 | Implemented gesture and input device selection. | ||
156 | 152 | |||
157 | 153 | * geis/geis.h: new gesture definitions | ||
158 | 154 | * libutouch-geis-xcb/geis_xcb.h (geis_xcb_subscribe): | ||
159 | 155 | added device_id parameter | ||
160 | 156 | * libutouch-geis-xcb/geis_xcb.c (s_grail_type_map): new gesture definitions | ||
161 | 157 | (geis_xcb_map_gestures_to_mask): new function | ||
162 | 158 | (geis_xcb_select_events): new function | ||
163 | 159 | (geis_xcb_subscribe): used them | ||
164 | 160 | added device_id parameter | ||
165 | 161 | (geis_xcb_determine_gesture_type): renamed to | ||
166 | 162 | geis_xcb_determine_fundamental_gesture_type | ||
167 | 163 | (geis_xcb_get_gesture_type_fundamental_name): new function | ||
168 | 164 | (geis_xcb_dispatch_gesture_type): mapped public gesture definitions to | ||
169 | 165 | fundamental gesture types | ||
170 | 166 | * libutouch-geis-xcb/geis_instance.c (geis_instance_subscribe): | ||
171 | 167 | handled input_list argument | ||
172 | 168 | * testsuite/geistest/geistest.c: included an example of selecting gestures | ||
173 | 169 | |||
174 | 1 | 2010-08-22 Chase Douglas <chase.douglas@canonical.com> | 170 | 2010-08-22 Chase Douglas <chase.douglas@canonical.com> |
175 | 2 | 171 | ||
176 | 3 | Bumped to version 1.0.10 for various fixes | 172 | Bumped to version 1.0.10 for various fixes |
177 | 4 | 173 | ||
178 | === modified file 'Makefile.in' | |||
179 | --- Makefile.in 2010-08-20 22:03:52 +0000 | |||
180 | +++ Makefile.in 2010-09-16 16:28:52 +0000 | |||
181 | @@ -205,11 +205,15 @@ | |||
182 | 205 | SHELL = @SHELL@ | 205 | SHELL = @SHELL@ |
183 | 206 | STRIP = @STRIP@ | 206 | STRIP = @STRIP@ |
184 | 207 | VERSION = @VERSION@ | 207 | VERSION = @VERSION@ |
185 | 208 | X11XCB_CFLAGS = @X11XCB_CFLAGS@ | ||
186 | 209 | X11XCB_LIBS = @X11XCB_LIBS@ | ||
187 | 208 | XCBINCLUDEDIR = @XCBINCLUDEDIR@ | 210 | XCBINCLUDEDIR = @XCBINCLUDEDIR@ |
188 | 209 | XCBPROTO_XCBINCLUDEDIR = @XCBPROTO_XCBINCLUDEDIR@ | 211 | XCBPROTO_XCBINCLUDEDIR = @XCBPROTO_XCBINCLUDEDIR@ |
189 | 210 | XCBPROTO_XCBPYTHONDIR = @XCBPROTO_XCBPYTHONDIR@ | 212 | XCBPROTO_XCBPYTHONDIR = @XCBPROTO_XCBPYTHONDIR@ |
190 | 211 | XCB_CFLAGS = @XCB_CFLAGS@ | 213 | XCB_CFLAGS = @XCB_CFLAGS@ |
191 | 212 | XCB_LIBS = @XCB_LIBS@ | 214 | XCB_LIBS = @XCB_LIBS@ |
192 | 215 | XI2_CFLAGS = @XI2_CFLAGS@ | ||
193 | 216 | XI2_LIBS = @XI2_LIBS@ | ||
194 | 213 | abs_builddir = @abs_builddir@ | 217 | abs_builddir = @abs_builddir@ |
195 | 214 | abs_srcdir = @abs_srcdir@ | 218 | abs_srcdir = @abs_srcdir@ |
196 | 215 | abs_top_builddir = @abs_top_builddir@ | 219 | abs_top_builddir = @abs_top_builddir@ |
197 | 216 | 220 | ||
198 | === modified file 'configure' | |||
199 | --- configure 2010-08-23 14:54:15 +0000 | |||
200 | +++ configure 2010-09-16 16:28:52 +0000 | |||
201 | @@ -1,6 +1,6 @@ | |||
202 | 1 | #! /bin/sh | 1 | #! /bin/sh |
203 | 2 | # Guess values for system-dependent variables and create Makefiles. | 2 | # Guess values for system-dependent variables and create Makefiles. |
205 | 3 | # Generated by GNU Autoconf 2.67 for utouch-geis 1.0.10. | 3 | # Generated by GNU Autoconf 2.67 for utouch-geis 1.0.11. |
206 | 4 | # | 4 | # |
207 | 5 | # Report bugs to <stephen.webb@canonical.com>. | 5 | # Report bugs to <stephen.webb@canonical.com>. |
208 | 6 | # | 6 | # |
209 | @@ -701,8 +701,8 @@ | |||
210 | 701 | # Identity of this package. | 701 | # Identity of this package. |
211 | 702 | PACKAGE_NAME='utouch-geis' | 702 | PACKAGE_NAME='utouch-geis' |
212 | 703 | PACKAGE_TARNAME='utouch-geis' | 703 | PACKAGE_TARNAME='utouch-geis' |
215 | 704 | PACKAGE_VERSION='1.0.10' | 704 | PACKAGE_VERSION='1.0.11' |
216 | 705 | PACKAGE_STRING='utouch-geis 1.0.10' | 705 | PACKAGE_STRING='utouch-geis 1.0.11' |
217 | 706 | PACKAGE_BUGREPORT='stephen.webb@canonical.com' | 706 | PACKAGE_BUGREPORT='stephen.webb@canonical.com' |
218 | 707 | PACKAGE_URL='https://launchpad.net/utouch-geis' | 707 | PACKAGE_URL='https://launchpad.net/utouch-geis' |
219 | 708 | 708 | ||
220 | @@ -749,6 +749,10 @@ | |||
221 | 749 | XCBINCLUDEDIR | 749 | XCBINCLUDEDIR |
222 | 750 | XCBPROTO_XCBPYTHONDIR | 750 | XCBPROTO_XCBPYTHONDIR |
223 | 751 | XCBPROTO_XCBINCLUDEDIR | 751 | XCBPROTO_XCBINCLUDEDIR |
224 | 752 | XI2_LIBS | ||
225 | 753 | XI2_CFLAGS | ||
226 | 754 | X11XCB_LIBS | ||
227 | 755 | X11XCB_CFLAGS | ||
228 | 752 | XCB_LIBS | 756 | XCB_LIBS |
229 | 753 | XCB_CFLAGS | 757 | XCB_CFLAGS |
230 | 754 | GRAIL_LIBS | 758 | GRAIL_LIBS |
231 | @@ -896,7 +900,11 @@ | |||
232 | 896 | GRAIL_CFLAGS | 900 | GRAIL_CFLAGS |
233 | 897 | GRAIL_LIBS | 901 | GRAIL_LIBS |
234 | 898 | XCB_CFLAGS | 902 | XCB_CFLAGS |
236 | 899 | XCB_LIBS' | 903 | XCB_LIBS |
237 | 904 | X11XCB_CFLAGS | ||
238 | 905 | X11XCB_LIBS | ||
239 | 906 | XI2_CFLAGS | ||
240 | 907 | XI2_LIBS' | ||
241 | 900 | 908 | ||
242 | 901 | 909 | ||
243 | 902 | # Initialize some variables set by options. | 910 | # Initialize some variables set by options. |
244 | @@ -1439,7 +1447,7 @@ | |||
245 | 1439 | # Omit some internal or obsolete options to make the list less imposing. | 1447 | # Omit some internal or obsolete options to make the list less imposing. |
246 | 1440 | # This message is too long to be a string in the A/UX 3.1 sh. | 1448 | # This message is too long to be a string in the A/UX 3.1 sh. |
247 | 1441 | cat <<_ACEOF | 1449 | cat <<_ACEOF |
249 | 1442 | \`configure' configures utouch-geis 1.0.10 to adapt to many kinds of systems. | 1450 | \`configure' configures utouch-geis 1.0.11 to adapt to many kinds of systems. |
250 | 1443 | 1451 | ||
251 | 1444 | Usage: $0 [OPTION]... [VAR=VALUE]... | 1452 | Usage: $0 [OPTION]... [VAR=VALUE]... |
252 | 1445 | 1453 | ||
253 | @@ -1509,7 +1517,7 @@ | |||
254 | 1509 | 1517 | ||
255 | 1510 | if test -n "$ac_init_help"; then | 1518 | if test -n "$ac_init_help"; then |
256 | 1511 | case $ac_init_help in | 1519 | case $ac_init_help in |
258 | 1512 | short | recursive ) echo "Configuration of utouch-geis 1.0.10:";; | 1520 | short | recursive ) echo "Configuration of utouch-geis 1.0.11:";; |
259 | 1513 | esac | 1521 | esac |
260 | 1514 | cat <<\_ACEOF | 1522 | cat <<\_ACEOF |
261 | 1515 | 1523 | ||
262 | @@ -1551,6 +1559,11 @@ | |||
263 | 1551 | GRAIL_LIBS linker flags for GRAIL, overriding pkg-config | 1559 | GRAIL_LIBS linker flags for GRAIL, overriding pkg-config |
264 | 1552 | XCB_CFLAGS C compiler flags for XCB, overriding pkg-config | 1560 | XCB_CFLAGS C compiler flags for XCB, overriding pkg-config |
265 | 1553 | XCB_LIBS linker flags for XCB, overriding pkg-config | 1561 | XCB_LIBS linker flags for XCB, overriding pkg-config |
266 | 1562 | X11XCB_CFLAGS | ||
267 | 1563 | C compiler flags for X11XCB, overriding pkg-config | ||
268 | 1564 | X11XCB_LIBS linker flags for X11XCB, overriding pkg-config | ||
269 | 1565 | XI2_CFLAGS C compiler flags for XI2, overriding pkg-config | ||
270 | 1566 | XI2_LIBS linker flags for XI2, overriding pkg-config | ||
271 | 1554 | 1567 | ||
272 | 1555 | Use these variables to override the choices made by `configure' or to help | 1568 | Use these variables to override the choices made by `configure' or to help |
273 | 1556 | it to find libraries and programs with nonstandard names/locations. | 1569 | it to find libraries and programs with nonstandard names/locations. |
274 | @@ -1619,7 +1632,7 @@ | |||
275 | 1619 | test -n "$ac_init_help" && exit $ac_status | 1632 | test -n "$ac_init_help" && exit $ac_status |
276 | 1620 | if $ac_init_version; then | 1633 | if $ac_init_version; then |
277 | 1621 | cat <<\_ACEOF | 1634 | cat <<\_ACEOF |
279 | 1622 | utouch-geis configure 1.0.10 | 1635 | utouch-geis configure 1.0.11 |
280 | 1623 | generated by GNU Autoconf 2.67 | 1636 | generated by GNU Autoconf 2.67 |
281 | 1624 | 1637 | ||
282 | 1625 | Copyright (C) 2010 Free Software Foundation, Inc. | 1638 | Copyright (C) 2010 Free Software Foundation, Inc. |
283 | @@ -1897,7 +1910,7 @@ | |||
284 | 1897 | This file contains any messages produced by compilers while | 1910 | This file contains any messages produced by compilers while |
285 | 1898 | running configure, to aid debugging if configure makes a mistake. | 1911 | running configure, to aid debugging if configure makes a mistake. |
286 | 1899 | 1912 | ||
288 | 1900 | It was created by utouch-geis $as_me 1.0.10, which was | 1913 | It was created by utouch-geis $as_me 1.0.11, which was |
289 | 1901 | generated by GNU Autoconf 2.67. Invocation command line was | 1914 | generated by GNU Autoconf 2.67. Invocation command line was |
290 | 1902 | 1915 | ||
291 | 1903 | $ $0 $@ | 1916 | $ $0 $@ |
292 | @@ -2715,7 +2728,7 @@ | |||
293 | 2715 | 2728 | ||
294 | 2716 | # Define the identity of the package. | 2729 | # Define the identity of the package. |
295 | 2717 | PACKAGE='utouch-geis' | 2730 | PACKAGE='utouch-geis' |
297 | 2718 | VERSION='1.0.10' | 2731 | VERSION='1.0.11' |
298 | 2719 | 2732 | ||
299 | 2720 | 2733 | ||
300 | 2721 | cat >>confdefs.h <<_ACEOF | 2734 | cat >>confdefs.h <<_ACEOF |
301 | @@ -4770,13 +4783,13 @@ | |||
302 | 4770 | else | 4783 | else |
303 | 4771 | lt_cv_nm_interface="BSD nm" | 4784 | lt_cv_nm_interface="BSD nm" |
304 | 4772 | echo "int some_variable = 0;" > conftest.$ac_ext | 4785 | echo "int some_variable = 0;" > conftest.$ac_ext |
306 | 4773 | (eval echo "\"\$as_me:4773: $ac_compile\"" >&5) | 4786 | (eval echo "\"\$as_me:4786: $ac_compile\"" >&5) |
307 | 4774 | (eval "$ac_compile" 2>conftest.err) | 4787 | (eval "$ac_compile" 2>conftest.err) |
308 | 4775 | cat conftest.err >&5 | 4788 | cat conftest.err >&5 |
310 | 4776 | (eval echo "\"\$as_me:4776: $NM \\\"conftest.$ac_objext\\\"\"" >&5) | 4789 | (eval echo "\"\$as_me:4789: $NM \\\"conftest.$ac_objext\\\"\"" >&5) |
311 | 4777 | (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) | 4790 | (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) |
312 | 4778 | cat conftest.err >&5 | 4791 | cat conftest.err >&5 |
314 | 4779 | (eval echo "\"\$as_me:4779: output\"" >&5) | 4792 | (eval echo "\"\$as_me:4792: output\"" >&5) |
315 | 4780 | cat conftest.out >&5 | 4793 | cat conftest.out >&5 |
316 | 4781 | if $GREP 'External.*some_variable' conftest.out > /dev/null; then | 4794 | if $GREP 'External.*some_variable' conftest.out > /dev/null; then |
317 | 4782 | lt_cv_nm_interface="MS dumpbin" | 4795 | lt_cv_nm_interface="MS dumpbin" |
318 | @@ -5982,7 +5995,7 @@ | |||
319 | 5982 | ;; | 5995 | ;; |
320 | 5983 | *-*-irix6*) | 5996 | *-*-irix6*) |
321 | 5984 | # Find out which ABI we are using. | 5997 | # Find out which ABI we are using. |
323 | 5985 | echo '#line 5985 "configure"' > conftest.$ac_ext | 5998 | echo '#line 5998 "configure"' > conftest.$ac_ext |
324 | 5986 | if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 | 5999 | if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 |
325 | 5987 | (eval $ac_compile) 2>&5 | 6000 | (eval $ac_compile) 2>&5 |
326 | 5988 | ac_status=$? | 6001 | ac_status=$? |
327 | @@ -7511,11 +7524,11 @@ | |||
328 | 7511 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ | 7524 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
329 | 7512 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | 7525 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
330 | 7513 | -e 's:$: $lt_compiler_flag:'` | 7526 | -e 's:$: $lt_compiler_flag:'` |
332 | 7514 | (eval echo "\"\$as_me:7514: $lt_compile\"" >&5) | 7527 | (eval echo "\"\$as_me:7527: $lt_compile\"" >&5) |
333 | 7515 | (eval "$lt_compile" 2>conftest.err) | 7528 | (eval "$lt_compile" 2>conftest.err) |
334 | 7516 | ac_status=$? | 7529 | ac_status=$? |
335 | 7517 | cat conftest.err >&5 | 7530 | cat conftest.err >&5 |
337 | 7518 | echo "$as_me:7518: \$? = $ac_status" >&5 | 7531 | echo "$as_me:7531: \$? = $ac_status" >&5 |
338 | 7519 | if (exit $ac_status) && test -s "$ac_outfile"; then | 7532 | if (exit $ac_status) && test -s "$ac_outfile"; then |
339 | 7520 | # The compiler can only warn and ignore the option if not recognized | 7533 | # The compiler can only warn and ignore the option if not recognized |
340 | 7521 | # So say no if there are warnings other than the usual output. | 7534 | # So say no if there are warnings other than the usual output. |
341 | @@ -7850,11 +7863,11 @@ | |||
342 | 7850 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ | 7863 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
343 | 7851 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | 7864 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
344 | 7852 | -e 's:$: $lt_compiler_flag:'` | 7865 | -e 's:$: $lt_compiler_flag:'` |
346 | 7853 | (eval echo "\"\$as_me:7853: $lt_compile\"" >&5) | 7866 | (eval echo "\"\$as_me:7866: $lt_compile\"" >&5) |
347 | 7854 | (eval "$lt_compile" 2>conftest.err) | 7867 | (eval "$lt_compile" 2>conftest.err) |
348 | 7855 | ac_status=$? | 7868 | ac_status=$? |
349 | 7856 | cat conftest.err >&5 | 7869 | cat conftest.err >&5 |
351 | 7857 | echo "$as_me:7857: \$? = $ac_status" >&5 | 7870 | echo "$as_me:7870: \$? = $ac_status" >&5 |
352 | 7858 | if (exit $ac_status) && test -s "$ac_outfile"; then | 7871 | if (exit $ac_status) && test -s "$ac_outfile"; then |
353 | 7859 | # The compiler can only warn and ignore the option if not recognized | 7872 | # The compiler can only warn and ignore the option if not recognized |
354 | 7860 | # So say no if there are warnings other than the usual output. | 7873 | # So say no if there are warnings other than the usual output. |
355 | @@ -7955,11 +7968,11 @@ | |||
356 | 7955 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ | 7968 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
357 | 7956 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | 7969 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
358 | 7957 | -e 's:$: $lt_compiler_flag:'` | 7970 | -e 's:$: $lt_compiler_flag:'` |
360 | 7958 | (eval echo "\"\$as_me:7958: $lt_compile\"" >&5) | 7971 | (eval echo "\"\$as_me:7971: $lt_compile\"" >&5) |
361 | 7959 | (eval "$lt_compile" 2>out/conftest.err) | 7972 | (eval "$lt_compile" 2>out/conftest.err) |
362 | 7960 | ac_status=$? | 7973 | ac_status=$? |
363 | 7961 | cat out/conftest.err >&5 | 7974 | cat out/conftest.err >&5 |
365 | 7962 | echo "$as_me:7962: \$? = $ac_status" >&5 | 7975 | echo "$as_me:7975: \$? = $ac_status" >&5 |
366 | 7963 | if (exit $ac_status) && test -s out/conftest2.$ac_objext | 7976 | if (exit $ac_status) && test -s out/conftest2.$ac_objext |
367 | 7964 | then | 7977 | then |
368 | 7965 | # The compiler can only warn and ignore the option if not recognized | 7978 | # The compiler can only warn and ignore the option if not recognized |
369 | @@ -8010,11 +8023,11 @@ | |||
370 | 8010 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ | 8023 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
371 | 8011 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | 8024 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
372 | 8012 | -e 's:$: $lt_compiler_flag:'` | 8025 | -e 's:$: $lt_compiler_flag:'` |
374 | 8013 | (eval echo "\"\$as_me:8013: $lt_compile\"" >&5) | 8026 | (eval echo "\"\$as_me:8026: $lt_compile\"" >&5) |
375 | 8014 | (eval "$lt_compile" 2>out/conftest.err) | 8027 | (eval "$lt_compile" 2>out/conftest.err) |
376 | 8015 | ac_status=$? | 8028 | ac_status=$? |
377 | 8016 | cat out/conftest.err >&5 | 8029 | cat out/conftest.err >&5 |
379 | 8017 | echo "$as_me:8017: \$? = $ac_status" >&5 | 8030 | echo "$as_me:8030: \$? = $ac_status" >&5 |
380 | 8018 | if (exit $ac_status) && test -s out/conftest2.$ac_objext | 8031 | if (exit $ac_status) && test -s out/conftest2.$ac_objext |
381 | 8019 | then | 8032 | then |
382 | 8020 | # The compiler can only warn and ignore the option if not recognized | 8033 | # The compiler can only warn and ignore the option if not recognized |
383 | @@ -10394,7 +10407,7 @@ | |||
384 | 10394 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 | 10407 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 |
385 | 10395 | lt_status=$lt_dlunknown | 10408 | lt_status=$lt_dlunknown |
386 | 10396 | cat > conftest.$ac_ext <<_LT_EOF | 10409 | cat > conftest.$ac_ext <<_LT_EOF |
388 | 10397 | #line 10397 "configure" | 10410 | #line 10410 "configure" |
389 | 10398 | #include "confdefs.h" | 10411 | #include "confdefs.h" |
390 | 10399 | 10412 | ||
391 | 10400 | #if HAVE_DLFCN_H | 10413 | #if HAVE_DLFCN_H |
392 | @@ -10490,7 +10503,7 @@ | |||
393 | 10490 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 | 10503 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 |
394 | 10491 | lt_status=$lt_dlunknown | 10504 | lt_status=$lt_dlunknown |
395 | 10492 | cat > conftest.$ac_ext <<_LT_EOF | 10505 | cat > conftest.$ac_ext <<_LT_EOF |
397 | 10493 | #line 10493 "configure" | 10506 | #line 10506 "configure" |
398 | 10494 | #include "confdefs.h" | 10507 | #include "confdefs.h" |
399 | 10495 | 10508 | ||
400 | 10496 | #if HAVE_DLFCN_H | 10509 | #if HAVE_DLFCN_H |
401 | @@ -10978,6 +10991,145 @@ | |||
402 | 10978 | $as_echo "yes" >&6; } | 10991 | $as_echo "yes" >&6; } |
403 | 10979 | 10992 | ||
404 | 10980 | fi | 10993 | fi |
405 | 10994 | |||
406 | 10995 | pkg_failed=no | ||
407 | 10996 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X11XCB" >&5 | ||
408 | 10997 | $as_echo_n "checking for X11XCB... " >&6; } | ||
409 | 10998 | |||
410 | 10999 | if test -n "$X11XCB_CFLAGS"; then | ||
411 | 11000 | pkg_cv_X11XCB_CFLAGS="$X11XCB_CFLAGS" | ||
412 | 11001 | elif test -n "$PKG_CONFIG"; then | ||
413 | 11002 | if test -n "$PKG_CONFIG" && \ | ||
414 | 11003 | { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11-xcb >= 1.3.3\""; } >&5 | ||
415 | 11004 | ($PKG_CONFIG --exists --print-errors "x11-xcb >= 1.3.3") 2>&5 | ||
416 | 11005 | ac_status=$? | ||
417 | 11006 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | ||
418 | 11007 | test $ac_status = 0; }; then | ||
419 | 11008 | pkg_cv_X11XCB_CFLAGS=`$PKG_CONFIG --cflags "x11-xcb >= 1.3.3" 2>/dev/null` | ||
420 | 11009 | else | ||
421 | 11010 | pkg_failed=yes | ||
422 | 11011 | fi | ||
423 | 11012 | else | ||
424 | 11013 | pkg_failed=untried | ||
425 | 11014 | fi | ||
426 | 11015 | if test -n "$X11XCB_LIBS"; then | ||
427 | 11016 | pkg_cv_X11XCB_LIBS="$X11XCB_LIBS" | ||
428 | 11017 | elif test -n "$PKG_CONFIG"; then | ||
429 | 11018 | if test -n "$PKG_CONFIG" && \ | ||
430 | 11019 | { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11-xcb >= 1.3.3\""; } >&5 | ||
431 | 11020 | ($PKG_CONFIG --exists --print-errors "x11-xcb >= 1.3.3") 2>&5 | ||
432 | 11021 | ac_status=$? | ||
433 | 11022 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | ||
434 | 11023 | test $ac_status = 0; }; then | ||
435 | 11024 | pkg_cv_X11XCB_LIBS=`$PKG_CONFIG --libs "x11-xcb >= 1.3.3" 2>/dev/null` | ||
436 | 11025 | else | ||
437 | 11026 | pkg_failed=yes | ||
438 | 11027 | fi | ||
439 | 11028 | else | ||
440 | 11029 | pkg_failed=untried | ||
441 | 11030 | fi | ||
442 | 11031 | |||
443 | 11032 | |||
444 | 11033 | |||
445 | 11034 | if test $pkg_failed = yes; then | ||
446 | 11035 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | ||
447 | 11036 | $as_echo "no" >&6; } | ||
448 | 11037 | |||
449 | 11038 | if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then | ||
450 | 11039 | _pkg_short_errors_supported=yes | ||
451 | 11040 | else | ||
452 | 11041 | _pkg_short_errors_supported=no | ||
453 | 11042 | fi | ||
454 | 11043 | if test $_pkg_short_errors_supported = yes; then | ||
455 | 11044 | X11XCB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "x11-xcb >= 1.3.3" 2>&1` | ||
456 | 11045 | else | ||
457 | 11046 | X11XCB_PKG_ERRORS=`$PKG_CONFIG --print-errors "x11-xcb >= 1.3.3" 2>&1` | ||
458 | 11047 | fi | ||
459 | 11048 | # Put the nasty error message in config.log where it belongs | ||
460 | 11049 | echo "$X11XCB_PKG_ERRORS" >&5 | ||
461 | 11050 | |||
462 | 11051 | as_fn_error $? "X11-XCB development libraries not found" "$LINENO" 5 | ||
463 | 11052 | elif test $pkg_failed = untried; then | ||
464 | 11053 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | ||
465 | 11054 | $as_echo "no" >&6; } | ||
466 | 11055 | as_fn_error $? "X11-XCB development libraries not found" "$LINENO" 5 | ||
467 | 11056 | else | ||
468 | 11057 | X11XCB_CFLAGS=$pkg_cv_X11XCB_CFLAGS | ||
469 | 11058 | X11XCB_LIBS=$pkg_cv_X11XCB_LIBS | ||
470 | 11059 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | ||
471 | 11060 | $as_echo "yes" >&6; } | ||
472 | 11061 | |||
473 | 11062 | fi | ||
474 | 11063 | |||
475 | 11064 | pkg_failed=no | ||
476 | 11065 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XI2" >&5 | ||
477 | 11066 | $as_echo_n "checking for XI2... " >&6; } | ||
478 | 11067 | |||
479 | 11068 | if test -n "$XI2_CFLAGS"; then | ||
480 | 11069 | pkg_cv_XI2_CFLAGS="$XI2_CFLAGS" | ||
481 | 11070 | elif test -n "$PKG_CONFIG"; then | ||
482 | 11071 | if test -n "$PKG_CONFIG" && \ | ||
483 | 11072 | { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xi >= 1.3\""; } >&5 | ||
484 | 11073 | ($PKG_CONFIG --exists --print-errors "xi >= 1.3") 2>&5 | ||
485 | 11074 | ac_status=$? | ||
486 | 11075 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | ||
487 | 11076 | test $ac_status = 0; }; then | ||
488 | 11077 | pkg_cv_XI2_CFLAGS=`$PKG_CONFIG --cflags "xi >= 1.3" 2>/dev/null` | ||
489 | 11078 | else | ||
490 | 11079 | pkg_failed=yes | ||
491 | 11080 | fi | ||
492 | 11081 | else | ||
493 | 11082 | pkg_failed=untried | ||
494 | 11083 | fi | ||
495 | 11084 | if test -n "$XI2_LIBS"; then | ||
496 | 11085 | pkg_cv_XI2_LIBS="$XI2_LIBS" | ||
497 | 11086 | elif test -n "$PKG_CONFIG"; then | ||
498 | 11087 | if test -n "$PKG_CONFIG" && \ | ||
499 | 11088 | { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xi >= 1.3\""; } >&5 | ||
500 | 11089 | ($PKG_CONFIG --exists --print-errors "xi >= 1.3") 2>&5 | ||
501 | 11090 | ac_status=$? | ||
502 | 11091 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | ||
503 | 11092 | test $ac_status = 0; }; then | ||
504 | 11093 | pkg_cv_XI2_LIBS=`$PKG_CONFIG --libs "xi >= 1.3" 2>/dev/null` | ||
505 | 11094 | else | ||
506 | 11095 | pkg_failed=yes | ||
507 | 11096 | fi | ||
508 | 11097 | else | ||
509 | 11098 | pkg_failed=untried | ||
510 | 11099 | fi | ||
511 | 11100 | |||
512 | 11101 | |||
513 | 11102 | |||
514 | 11103 | if test $pkg_failed = yes; then | ||
515 | 11104 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | ||
516 | 11105 | $as_echo "no" >&6; } | ||
517 | 11106 | |||
518 | 11107 | if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then | ||
519 | 11108 | _pkg_short_errors_supported=yes | ||
520 | 11109 | else | ||
521 | 11110 | _pkg_short_errors_supported=no | ||
522 | 11111 | fi | ||
523 | 11112 | if test $_pkg_short_errors_supported = yes; then | ||
524 | 11113 | XI2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xi >= 1.3" 2>&1` | ||
525 | 11114 | else | ||
526 | 11115 | XI2_PKG_ERRORS=`$PKG_CONFIG --print-errors "xi >= 1.3" 2>&1` | ||
527 | 11116 | fi | ||
528 | 11117 | # Put the nasty error message in config.log where it belongs | ||
529 | 11118 | echo "$XI2_PKG_ERRORS" >&5 | ||
530 | 11119 | |||
531 | 11120 | as_fn_error $? "XI2 development libraries not found" "$LINENO" 5 | ||
532 | 11121 | elif test $pkg_failed = untried; then | ||
533 | 11122 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | ||
534 | 11123 | $as_echo "no" >&6; } | ||
535 | 11124 | as_fn_error $? "XI2 development libraries not found" "$LINENO" 5 | ||
536 | 11125 | else | ||
537 | 11126 | XI2_CFLAGS=$pkg_cv_XI2_CFLAGS | ||
538 | 11127 | XI2_LIBS=$pkg_cv_XI2_LIBS | ||
539 | 11128 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | ||
540 | 11129 | $as_echo "yes" >&6; } | ||
541 | 11130 | |||
542 | 11131 | fi | ||
543 | 11132 | |||
544 | 10981 | # XCB code generation configuration | 11133 | # XCB code generation configuration |
545 | 10982 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking XCBPROTO_XCBINCLUDEDIR" >&5 | 11134 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking XCBPROTO_XCBINCLUDEDIR" >&5 |
546 | 10983 | $as_echo_n "checking XCBPROTO_XCBINCLUDEDIR... " >&6; } | 11135 | $as_echo_n "checking XCBPROTO_XCBINCLUDEDIR... " >&6; } |
547 | @@ -11552,7 +11704,7 @@ | |||
548 | 11552 | # report actual input values of CONFIG_FILES etc. instead of their | 11704 | # report actual input values of CONFIG_FILES etc. instead of their |
549 | 11553 | # values after options handling. | 11705 | # values after options handling. |
550 | 11554 | ac_log=" | 11706 | ac_log=" |
552 | 11555 | This file was extended by utouch-geis $as_me 1.0.10, which was | 11707 | This file was extended by utouch-geis $as_me 1.0.11, which was |
553 | 11556 | generated by GNU Autoconf 2.67. Invocation command line was | 11708 | generated by GNU Autoconf 2.67. Invocation command line was |
554 | 11557 | 11709 | ||
555 | 11558 | CONFIG_FILES = $CONFIG_FILES | 11710 | CONFIG_FILES = $CONFIG_FILES |
556 | @@ -11619,7 +11771,7 @@ | |||
557 | 11619 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | 11771 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
558 | 11620 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" | 11772 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
559 | 11621 | ac_cs_version="\\ | 11773 | ac_cs_version="\\ |
561 | 11622 | utouch-geis config.status 1.0.10 | 11774 | utouch-geis config.status 1.0.11 |
562 | 11623 | configured by $0, generated by GNU Autoconf 2.67, | 11775 | configured by $0, generated by GNU Autoconf 2.67, |
563 | 11624 | with options \\"\$ac_cs_config\\" | 11776 | with options \\"\$ac_cs_config\\" |
564 | 11625 | 11777 | ||
565 | 11626 | 11778 | ||
566 | === modified file 'configure.ac' | |||
567 | --- configure.ac 2010-08-23 14:54:15 +0000 | |||
568 | +++ configure.ac 2010-09-16 16:28:52 +0000 | |||
569 | @@ -2,7 +2,7 @@ | |||
570 | 2 | # Process this file with autoconf to produce a configure script. | 2 | # Process this file with autoconf to produce a configure script. |
571 | 3 | 3 | ||
572 | 4 | AC_PREREQ(2.65) | 4 | AC_PREREQ(2.65) |
574 | 5 | AC_INIT([utouch-geis],[1.0.10], | 5 | AC_INIT([utouch-geis],[1.0.11], |
575 | 6 | [stephen.webb@canonical.com],, | 6 | [stephen.webb@canonical.com],, |
576 | 7 | [https://launchpad.net/utouch-geis]) | 7 | [https://launchpad.net/utouch-geis]) |
577 | 8 | AC_CONFIG_HEADERS([geis_config.h]) | 8 | AC_CONFIG_HEADERS([geis_config.h]) |
578 | @@ -24,6 +24,11 @@ | |||
579 | 24 | AC_MSG_ERROR([Grail development libraries not found])) | 24 | AC_MSG_ERROR([Grail development libraries not found])) |
580 | 25 | PKG_CHECK_MODULES([XCB], [xcb >= 1.6], , | 25 | PKG_CHECK_MODULES([XCB], [xcb >= 1.6], , |
581 | 26 | AC_MSG_ERROR([XCB development libraries not found])) | 26 | AC_MSG_ERROR([XCB development libraries not found])) |
582 | 27 | PKG_CHECK_MODULES([X11XCB], [x11-xcb >= 1.3.3], , | ||
583 | 28 | AC_MSG_ERROR([X11-XCB development libraries not found])) | ||
584 | 29 | PKG_CHECK_MODULES([XI2], [xi >= 1.3], , | ||
585 | 30 | AC_MSG_ERROR([XI2 development libraries not found])) | ||
586 | 31 | |||
587 | 27 | # XCB code generation configuration | 32 | # XCB code generation configuration |
588 | 28 | AC_MSG_CHECKING(XCBPROTO_XCBINCLUDEDIR) | 33 | AC_MSG_CHECKING(XCBPROTO_XCBINCLUDEDIR) |
589 | 29 | XCBPROTO_XCBINCLUDEDIR=`$PKG_CONFIG --variable=xcbincludedir xcb-proto` | 34 | XCBPROTO_XCBINCLUDEDIR=`$PKG_CONFIG --variable=xcbincludedir xcb-proto` |
590 | 30 | 35 | ||
591 | === modified file 'debian/changelog' | |||
592 | --- debian/changelog 2010-08-25 15:34:20 +0000 | |||
593 | +++ debian/changelog 2010-09-16 16:28:52 +0000 | |||
594 | @@ -1,8 +1,12 @@ | |||
596 | 1 | utouch-geis (1.0.10-0ubuntu2) UNRELEASED; urgency=low | 1 | utouch-geis (1.0.11-0ubuntu1) maverick; urgency=low |
597 | 2 | 2 | ||
598 | 3 | [ Ara Pulido ] | ||
599 | 3 | * Added apport hook for utouch-geis (LP: #622817) | 4 | * Added apport hook for utouch-geis (LP: #622817) |
600 | 4 | 5 | ||
602 | 5 | -- Ara Pulido <ara@ubuntu.com> Wed, 25 Aug 2010 15:47:49 +0200 | 6 | [ Stephen M. Webb ] |
603 | 7 | * New upstream release (LP: #640530) | ||
604 | 8 | |||
605 | 9 | -- Stephen M. Webb <stephen.webb@canonical.com> Thu, 16 Sep 2010 12:10:13 -0400 | ||
606 | 6 | 10 | ||
607 | 7 | utouch-geis (1.0.10-0ubuntu1) maverick; urgency=low | 11 | utouch-geis (1.0.10-0ubuntu1) maverick; urgency=low |
608 | 8 | 12 | ||
609 | 9 | 13 | ||
610 | === modified file 'doc/Makefile.in' | |||
611 | --- doc/Makefile.in 2010-08-20 22:03:52 +0000 | |||
612 | +++ doc/Makefile.in 2010-09-16 16:28:52 +0000 | |||
613 | @@ -146,11 +146,15 @@ | |||
614 | 146 | SHELL = @SHELL@ | 146 | SHELL = @SHELL@ |
615 | 147 | STRIP = @STRIP@ | 147 | STRIP = @STRIP@ |
616 | 148 | VERSION = @VERSION@ | 148 | VERSION = @VERSION@ |
617 | 149 | X11XCB_CFLAGS = @X11XCB_CFLAGS@ | ||
618 | 150 | X11XCB_LIBS = @X11XCB_LIBS@ | ||
619 | 149 | XCBINCLUDEDIR = @XCBINCLUDEDIR@ | 151 | XCBINCLUDEDIR = @XCBINCLUDEDIR@ |
620 | 150 | XCBPROTO_XCBINCLUDEDIR = @XCBPROTO_XCBINCLUDEDIR@ | 152 | XCBPROTO_XCBINCLUDEDIR = @XCBPROTO_XCBINCLUDEDIR@ |
621 | 151 | XCBPROTO_XCBPYTHONDIR = @XCBPROTO_XCBPYTHONDIR@ | 153 | XCBPROTO_XCBPYTHONDIR = @XCBPROTO_XCBPYTHONDIR@ |
622 | 152 | XCB_CFLAGS = @XCB_CFLAGS@ | 154 | XCB_CFLAGS = @XCB_CFLAGS@ |
623 | 153 | XCB_LIBS = @XCB_LIBS@ | 155 | XCB_LIBS = @XCB_LIBS@ |
624 | 156 | XI2_CFLAGS = @XI2_CFLAGS@ | ||
625 | 157 | XI2_LIBS = @XI2_LIBS@ | ||
626 | 154 | abs_builddir = @abs_builddir@ | 158 | abs_builddir = @abs_builddir@ |
627 | 155 | abs_srcdir = @abs_srcdir@ | 159 | abs_srcdir = @abs_srcdir@ |
628 | 156 | abs_top_builddir = @abs_top_builddir@ | 160 | abs_top_builddir = @abs_top_builddir@ |
629 | 157 | 161 | ||
630 | === modified file 'doc/geistest.1' | |||
631 | --- doc/geistest.1 2010-08-16 16:25:17 +0000 | |||
632 | +++ doc/geistest.1 2010-09-16 16:28:52 +0000 | |||
633 | @@ -1,10 +1,13 @@ | |||
634 | 1 | .TH geistest 1 "August 16, 2010" "" "geistest" | 1 | .TH geistest 1 "August 16, 2010" "" "geistest" |
635 | 2 | 2 | ||
636 | 3 | .SH NAME | 3 | .SH NAME |
638 | 4 | geistest \- test operatoin of the GEIS API | 4 | geistest \- test operation of the GEIS API |
639 | 5 | 5 | ||
640 | 6 | .SH SYNOPSIS | 6 | .SH SYNOPSIS |
642 | 7 | .B geistest windowid | 7 | .B geistest [ |
643 | 8 | .B -w | ||
644 | 9 | .I windowid | ||
645 | 10 | .B ] | ||
646 | 8 | .br | 11 | .br |
647 | 9 | 12 | ||
648 | 10 | .SH DESCRIPTION | 13 | .SH DESCRIPTION |
649 | @@ -12,8 +15,23 @@ | |||
650 | 12 | .B geistest | 15 | .B geistest |
651 | 13 | program. This program is a test driver for verifying the recognition and propagation of gestures through the GEIS API. | 16 | program. This program is a test driver for verifying the recognition and propagation of gestures through the GEIS API. |
652 | 14 | 17 | ||
655 | 15 | 18 | .SH OPTIONS | |
656 | 16 | .SH EXAMPLE | 19 | .IP -w |
657 | 20 | Specifies the | ||
658 | 21 | .I windowId | ||
659 | 22 | of a specific window to associate with gestures. | ||
660 | 23 | Particularly useful with touchscreens. | ||
661 | 24 | |||
662 | 25 | The | ||
663 | 26 | .I windowId | ||
664 | 27 | can be determined using the program | ||
665 | 28 | .BR xwininfo . | ||
666 | 29 | |||
667 | 30 | If this argument is not set, the default action is to read gestures on all windows. | ||
668 | 31 | |||
669 | 32 | .SH ENVIRONMENT | ||
670 | 33 | .IP GEIS_DEBUG | ||
671 | 34 | Enables GEIS library diagnostic messages on stderr. | ||
672 | 17 | 35 | ||
673 | 18 | .SH "SEE ALSO" | 36 | .SH "SEE ALSO" |
674 | 19 | gesturetest(1) | ||
675 | 20 | \ No newline at end of file | 37 | \ No newline at end of file |
676 | 38 | gesturetest(1) | ||
677 | 21 | 39 | ||
678 | === modified file 'geis/Makefile.in' | |||
679 | --- geis/Makefile.in 2010-08-20 22:03:52 +0000 | |||
680 | +++ geis/Makefile.in 2010-09-16 16:28:52 +0000 | |||
681 | @@ -145,11 +145,15 @@ | |||
682 | 145 | SHELL = @SHELL@ | 145 | SHELL = @SHELL@ |
683 | 146 | STRIP = @STRIP@ | 146 | STRIP = @STRIP@ |
684 | 147 | VERSION = @VERSION@ | 147 | VERSION = @VERSION@ |
685 | 148 | X11XCB_CFLAGS = @X11XCB_CFLAGS@ | ||
686 | 149 | X11XCB_LIBS = @X11XCB_LIBS@ | ||
687 | 148 | XCBINCLUDEDIR = @XCBINCLUDEDIR@ | 150 | XCBINCLUDEDIR = @XCBINCLUDEDIR@ |
688 | 149 | XCBPROTO_XCBINCLUDEDIR = @XCBPROTO_XCBINCLUDEDIR@ | 151 | XCBPROTO_XCBINCLUDEDIR = @XCBPROTO_XCBINCLUDEDIR@ |
689 | 150 | XCBPROTO_XCBPYTHONDIR = @XCBPROTO_XCBPYTHONDIR@ | 152 | XCBPROTO_XCBPYTHONDIR = @XCBPROTO_XCBPYTHONDIR@ |
690 | 151 | XCB_CFLAGS = @XCB_CFLAGS@ | 153 | XCB_CFLAGS = @XCB_CFLAGS@ |
691 | 152 | XCB_LIBS = @XCB_LIBS@ | 154 | XCB_LIBS = @XCB_LIBS@ |
692 | 155 | XI2_CFLAGS = @XI2_CFLAGS@ | ||
693 | 156 | XI2_LIBS = @XI2_LIBS@ | ||
694 | 153 | abs_builddir = @abs_builddir@ | 157 | abs_builddir = @abs_builddir@ |
695 | 154 | abs_srcdir = @abs_srcdir@ | 158 | abs_srcdir = @abs_srcdir@ |
696 | 155 | abs_top_builddir = @abs_top_builddir@ | 159 | abs_top_builddir = @abs_top_builddir@ |
697 | 156 | 160 | ||
698 | === modified file 'geis/geis.h' | |||
699 | --- geis/geis.h 2010-08-23 14:54:18 +0000 | |||
700 | +++ geis/geis.h 2010-09-16 16:28:52 +0000 | |||
701 | @@ -30,6 +30,28 @@ | |||
702 | 30 | #define GEIS_GESTURE_ROTATE "Rotate" | 30 | #define GEIS_GESTURE_ROTATE "Rotate" |
703 | 31 | #define GEIS_GESTURE_TAP "Tap" | 31 | #define GEIS_GESTURE_TAP "Tap" |
704 | 32 | 32 | ||
705 | 33 | /* Gesture names for the Simplified Interface */ | ||
706 | 34 | #define GEIS_GESTURE_TYPE_DRAG1 "Drag,touch=1" | ||
707 | 35 | #define GEIS_GESTURE_TYPE_DRAG2 "Drag,touch=2" | ||
708 | 36 | #define GEIS_GESTURE_TYPE_DRAG3 "Drag,touch=3" | ||
709 | 37 | #define GEIS_GESTURE_TYPE_DRAG4 "Drag,touch=4" | ||
710 | 38 | #define GEIS_GESTURE_TYPE_DRAG5 "Drag,touch=5" | ||
711 | 39 | #define GEIS_GESTURE_TYPE_PINCH1 "Pinch,touch=1" | ||
712 | 40 | #define GEIS_GESTURE_TYPE_PINCH2 "Pinch,touch=2" | ||
713 | 41 | #define GEIS_GESTURE_TYPE_PINCH3 "Pinch,touch=3" | ||
714 | 42 | #define GEIS_GESTURE_TYPE_PINCH4 "Pinch,touch=4" | ||
715 | 43 | #define GEIS_GESTURE_TYPE_PINCH5 "Pinch,touch=5" | ||
716 | 44 | #define GEIS_GESTURE_TYPE_ROTATE1 "Rotate,touch=1" | ||
717 | 45 | #define GEIS_GESTURE_TYPE_ROTATE2 "Rotate,touch=2" | ||
718 | 46 | #define GEIS_GESTURE_TYPE_ROTATE3 "Rotate,touch=3" | ||
719 | 47 | #define GEIS_GESTURE_TYPE_ROTATE4 "Rotate,touch=4" | ||
720 | 48 | #define GEIS_GESTURE_TYPE_ROTATE5 "Rotate,touch=5" | ||
721 | 49 | #define GEIS_GESTURE_TYPE_TAP1 "Tap,touch=1" | ||
722 | 50 | #define GEIS_GESTURE_TYPE_TAP2 "Tap,touch=2" | ||
723 | 51 | #define GEIS_GESTURE_TYPE_TAP3 "Tap,touch=3" | ||
724 | 52 | #define GEIS_GESTURE_TYPE_TAP4 "Tap,touch=4" | ||
725 | 53 | #define GEIS_GESTURE_TYPE_TAP5 "Tap,touch=5" | ||
726 | 54 | |||
727 | 33 | /* Standard fundamental gesture attributes */ | 55 | /* Standard fundamental gesture attributes */ |
728 | 34 | #define GEIS_GESTURE_ATTRIBUTE_ANGLE "angle" | 56 | #define GEIS_GESTURE_ATTRIBUTE_ANGLE "angle" |
729 | 35 | #define GEIS_GESTURE_ATTRIBUTE_ANGLE_DELTA "angle delta" | 57 | #define GEIS_GESTURE_ATTRIBUTE_ANGLE_DELTA "angle delta" |
730 | @@ -43,7 +65,6 @@ | |||
731 | 43 | #define GEIS_GESTURE_ATTRIBUTE_DELTA_Y "delta y" | 65 | #define GEIS_GESTURE_ATTRIBUTE_DELTA_Y "delta y" |
732 | 44 | #define GEIS_GESTURE_ATTRIBUTE_DEVICE_ID "device id" | 66 | #define GEIS_GESTURE_ATTRIBUTE_DEVICE_ID "device id" |
733 | 45 | #define GEIS_GESTURE_ATTRIBUTE_EVENT_WINDOW_ID "event window id" | 67 | #define GEIS_GESTURE_ATTRIBUTE_EVENT_WINDOW_ID "event window id" |
734 | 46 | #define GEIS_GESTURE_ATTRIBUTE_FINGERS "fingers" | ||
735 | 47 | #define GEIS_GESTURE_ATTRIBUTE_FOCUS_X "focus x" | 68 | #define GEIS_GESTURE_ATTRIBUTE_FOCUS_X "focus x" |
736 | 48 | #define GEIS_GESTURE_ATTRIBUTE_FOCUS_Y "focus y" | 69 | #define GEIS_GESTURE_ATTRIBUTE_FOCUS_Y "focus y" |
737 | 49 | #define GEIS_GESTURE_ATTRIBUTE_GESTURE_NAME "gesture name" | 70 | #define GEIS_GESTURE_ATTRIBUTE_GESTURE_NAME "gesture name" |
738 | @@ -55,6 +76,7 @@ | |||
739 | 55 | #define GEIS_GESTURE_ATTRIBUTE_ROOT_WINDOW_ID "root window id" | 76 | #define GEIS_GESTURE_ATTRIBUTE_ROOT_WINDOW_ID "root window id" |
740 | 56 | #define GEIS_GESTURE_ATTRIBUTE_TAP_TIME "tap time" | 77 | #define GEIS_GESTURE_ATTRIBUTE_TAP_TIME "tap time" |
741 | 57 | #define GEIS_GESTURE_ATTRIBUTE_TIMESTAMP "timestamp" | 78 | #define GEIS_GESTURE_ATTRIBUTE_TIMESTAMP "timestamp" |
742 | 79 | #define GEIS_GESTURE_ATTRIBUTE_TOUCHES "touches" | ||
743 | 58 | #define GEIS_GESTURE_ATTRIBUTE_VELOCITY_X "velocity x" | 80 | #define GEIS_GESTURE_ATTRIBUTE_VELOCITY_X "velocity x" |
744 | 59 | #define GEIS_GESTURE_ATTRIBUTE_VELOCITY_Y "velocity y" | 81 | #define GEIS_GESTURE_ATTRIBUTE_VELOCITY_Y "velocity y" |
745 | 60 | #define GEIS_GESTURE_ATTRIBUTE_TOUCH_0_ID "touch 0 id" | 82 | #define GEIS_GESTURE_ATTRIBUTE_TOUCH_0_ID "touch 0 id" |
746 | @@ -271,7 +293,7 @@ | |||
747 | 271 | * @retval GEIS_STATUS_SUCCESS normal successful completion | 293 | * @retval GEIS_STATUS_SUCCESS normal successful completion |
748 | 272 | */ | 294 | */ |
749 | 273 | GEIS_API GeisStatus geis_input_devices(GeisInstance geis_instance, | 295 | GEIS_API GeisStatus geis_input_devices(GeisInstance geis_instance, |
751 | 274 | GeisInputFuncs func, | 296 | GeisInputFuncs *func, |
752 | 275 | void *cookie); | 297 | void *cookie); |
753 | 276 | 298 | ||
754 | 277 | /* @} */ | 299 | /* @} */ |
755 | 278 | 300 | ||
756 | === modified file 'libutouch-geis-xcb/Makefile.am' | |||
757 | --- libutouch-geis-xcb/Makefile.am 2010-08-23 14:54:15 +0000 | |||
758 | +++ libutouch-geis-xcb/Makefile.am 2010-09-16 16:28:52 +0000 | |||
759 | @@ -16,9 +16,10 @@ | |||
760 | 16 | 16 | ||
761 | 17 | libutouch_geis_la_SOURCES = \ | 17 | libutouch_geis_la_SOURCES = \ |
762 | 18 | geis.c \ | 18 | geis.c \ |
766 | 19 | geis_debug.h \ | 19 | geis_logging.h geis_logging.c \ |
767 | 20 | geis_xcb.h geis_xcb.c \ | 20 | geis_instance.h geis_instance.c \ |
768 | 21 | geis_instance.h geis_instance.c | 21 | geis_instance_table.h geis_instance_table.c \ |
769 | 22 | geis_xcb.h geis_xcb.c | ||
770 | 22 | 23 | ||
771 | 23 | dist_libutouch_geis_la_SOURCES = \ | 24 | dist_libutouch_geis_la_SOURCES = \ |
772 | 24 | xcb_gesture.h xcb_gesture.c | 25 | xcb_gesture.h xcb_gesture.c |
773 | @@ -29,15 +30,19 @@ | |||
774 | 29 | -DGEIS_BUILDING_DSO=1 \ | 30 | -DGEIS_BUILDING_DSO=1 \ |
775 | 30 | -I$(top_srcdir) \ | 31 | -I$(top_srcdir) \ |
776 | 31 | $(GRAIL_CFLAGS) \ | 32 | $(GRAIL_CFLAGS) \ |
778 | 32 | $(XCB_CFLAGS) | 33 | $(X11XCB_CFLAGS) \ |
779 | 34 | $(XCB_CFLAGS) \ | ||
780 | 35 | $(XI2_CFLAGS) | ||
781 | 33 | 36 | ||
782 | 34 | libutouch_geis_la_LDFLAGS = \ | 37 | libutouch_geis_la_LDFLAGS = \ |
783 | 35 | -Wl,-z,defs -Wl,--as-needed \ | 38 | -Wl,-z,defs -Wl,--as-needed \ |
785 | 36 | -version-info 1:0:0 \ | 39 | -version-info 1:1:0 \ |
786 | 37 | -Wl,--version-script=$(version_script) | 40 | -Wl,--version-script=$(version_script) |
787 | 38 | 41 | ||
788 | 39 | libutouch_geis_la_LIBADD = \ | 42 | libutouch_geis_la_LIBADD = \ |
790 | 40 | $(XCB_LIBS) | 43 | $(X11XCB_LIBS) \ |
791 | 44 | $(XCB_LIBS) \ | ||
792 | 45 | $(XI2_LIBS) | ||
793 | 41 | 46 | ||
794 | 42 | BUILT_SOURCES = $(dist_libutouch_geis_la_SOURCES) | 47 | BUILT_SOURCES = $(dist_libutouch_geis_la_SOURCES) |
795 | 43 | CLEANFILES = $(dist_libutouch_geis_la_SOURCES) | 48 | CLEANFILES = $(dist_libutouch_geis_la_SOURCES) |
796 | 44 | 49 | ||
797 | === modified file 'libutouch-geis-xcb/Makefile.in' | |||
798 | --- libutouch-geis-xcb/Makefile.in 2010-08-20 22:03:52 +0000 | |||
799 | +++ libutouch-geis-xcb/Makefile.in 2010-09-16 16:28:52 +0000 | |||
800 | @@ -73,10 +73,13 @@ | |||
801 | 73 | am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(incdir)" | 73 | am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(incdir)" |
802 | 74 | LTLIBRARIES = $(lib_LTLIBRARIES) | 74 | LTLIBRARIES = $(lib_LTLIBRARIES) |
803 | 75 | am__DEPENDENCIES_1 = | 75 | am__DEPENDENCIES_1 = |
805 | 76 | libutouch_geis_la_DEPENDENCIES = $(am__DEPENDENCIES_1) | 76 | libutouch_geis_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ |
806 | 77 | $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) | ||
807 | 77 | am_libutouch_geis_la_OBJECTS = libutouch_geis_la-geis.lo \ | 78 | am_libutouch_geis_la_OBJECTS = libutouch_geis_la-geis.lo \ |
810 | 78 | libutouch_geis_la-geis_xcb.lo \ | 79 | libutouch_geis_la-geis_logging.lo \ |
811 | 79 | libutouch_geis_la-geis_instance.lo | 80 | libutouch_geis_la-geis_instance.lo \ |
812 | 81 | libutouch_geis_la-geis_instance_table.lo \ | ||
813 | 82 | libutouch_geis_la-geis_xcb.lo | ||
814 | 80 | dist_libutouch_geis_la_OBJECTS = libutouch_geis_la-xcb_gesture.lo | 83 | dist_libutouch_geis_la_OBJECTS = libutouch_geis_la-xcb_gesture.lo |
815 | 81 | libutouch_geis_la_OBJECTS = $(am_libutouch_geis_la_OBJECTS) \ | 84 | libutouch_geis_la_OBJECTS = $(am_libutouch_geis_la_OBJECTS) \ |
816 | 82 | $(dist_libutouch_geis_la_OBJECTS) | 85 | $(dist_libutouch_geis_la_OBJECTS) |
817 | @@ -173,6 +176,8 @@ | |||
818 | 173 | SHELL = @SHELL@ | 176 | SHELL = @SHELL@ |
819 | 174 | STRIP = @STRIP@ | 177 | STRIP = @STRIP@ |
820 | 175 | VERSION = @VERSION@ | 178 | VERSION = @VERSION@ |
821 | 179 | X11XCB_CFLAGS = @X11XCB_CFLAGS@ | ||
822 | 180 | X11XCB_LIBS = @X11XCB_LIBS@ | ||
823 | 176 | XCBINCLUDEDIR = @XCBINCLUDEDIR@ | 181 | XCBINCLUDEDIR = @XCBINCLUDEDIR@ |
824 | 177 | XCBPROTO_XCBINCLUDEDIR = @XCBPROTO_XCBINCLUDEDIR@ | 182 | XCBPROTO_XCBINCLUDEDIR = @XCBPROTO_XCBINCLUDEDIR@ |
825 | 178 | XCBPROTO_XCBPYTHONDIR = @XCBPROTO_XCBPYTHONDIR@ | 183 | XCBPROTO_XCBPYTHONDIR = @XCBPROTO_XCBPYTHONDIR@ |
826 | @@ -180,6 +185,8 @@ | |||
827 | 180 | # work around a problem with XCB tools | 185 | # work around a problem with XCB tools |
828 | 181 | XCB_CFLAGS = @XCB_CFLAGS@ -I$(includedir)/xcb -I$(XCBINCLUDEDIR)/xcb | 186 | XCB_CFLAGS = @XCB_CFLAGS@ -I$(includedir)/xcb -I$(XCBINCLUDEDIR)/xcb |
829 | 182 | XCB_LIBS = @XCB_LIBS@ | 187 | XCB_LIBS = @XCB_LIBS@ |
830 | 188 | XI2_CFLAGS = @XI2_CFLAGS@ | ||
831 | 189 | XI2_LIBS = @XI2_LIBS@ | ||
832 | 183 | abs_builddir = @abs_builddir@ | 190 | abs_builddir = @abs_builddir@ |
833 | 184 | abs_srcdir = @abs_srcdir@ | 191 | abs_srcdir = @abs_srcdir@ |
834 | 185 | abs_top_builddir = @abs_top_builddir@ | 192 | abs_top_builddir = @abs_top_builddir@ |
835 | @@ -248,9 +255,10 @@ | |||
836 | 248 | lib_LTLIBRARIES = libutouch-geis.la | 255 | lib_LTLIBRARIES = libutouch-geis.la |
837 | 249 | libutouch_geis_la_SOURCES = \ | 256 | libutouch_geis_la_SOURCES = \ |
838 | 250 | geis.c \ | 257 | geis.c \ |
842 | 251 | geis_debug.h \ | 258 | geis_logging.h geis_logging.c \ |
843 | 252 | geis_xcb.h geis_xcb.c \ | 259 | geis_instance.h geis_instance.c \ |
844 | 253 | geis_instance.h geis_instance.c | 260 | geis_instance_table.h geis_instance_table.c \ |
845 | 261 | geis_xcb.h geis_xcb.c | ||
846 | 254 | 262 | ||
847 | 255 | dist_libutouch_geis_la_SOURCES = \ | 263 | dist_libutouch_geis_la_SOURCES = \ |
848 | 256 | xcb_gesture.h xcb_gesture.c | 264 | xcb_gesture.h xcb_gesture.c |
849 | @@ -261,15 +269,19 @@ | |||
850 | 261 | -DGEIS_BUILDING_DSO=1 \ | 269 | -DGEIS_BUILDING_DSO=1 \ |
851 | 262 | -I$(top_srcdir) \ | 270 | -I$(top_srcdir) \ |
852 | 263 | $(GRAIL_CFLAGS) \ | 271 | $(GRAIL_CFLAGS) \ |
854 | 264 | $(XCB_CFLAGS) | 272 | $(X11XCB_CFLAGS) \ |
855 | 273 | $(XCB_CFLAGS) \ | ||
856 | 274 | $(XI2_CFLAGS) | ||
857 | 265 | 275 | ||
858 | 266 | libutouch_geis_la_LDFLAGS = \ | 276 | libutouch_geis_la_LDFLAGS = \ |
859 | 267 | -Wl,-z,defs -Wl,--as-needed \ | 277 | -Wl,-z,defs -Wl,--as-needed \ |
861 | 268 | -version-info 1:0:0 \ | 278 | -version-info 1:1:0 \ |
862 | 269 | -Wl,--version-script=$(version_script) | 279 | -Wl,--version-script=$(version_script) |
863 | 270 | 280 | ||
864 | 271 | libutouch_geis_la_LIBADD = \ | 281 | libutouch_geis_la_LIBADD = \ |
866 | 272 | $(XCB_LIBS) | 282 | $(X11XCB_LIBS) \ |
867 | 283 | $(XCB_LIBS) \ | ||
868 | 284 | $(XI2_LIBS) | ||
869 | 273 | 285 | ||
870 | 274 | BUILT_SOURCES = $(dist_libutouch_geis_la_SOURCES) | 286 | BUILT_SOURCES = $(dist_libutouch_geis_la_SOURCES) |
871 | 275 | CLEANFILES = $(dist_libutouch_geis_la_SOURCES) | 287 | CLEANFILES = $(dist_libutouch_geis_la_SOURCES) |
872 | @@ -354,6 +366,8 @@ | |||
873 | 354 | 366 | ||
874 | 355 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libutouch_geis_la-geis.Plo@am__quote@ | 367 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libutouch_geis_la-geis.Plo@am__quote@ |
875 | 356 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libutouch_geis_la-geis_instance.Plo@am__quote@ | 368 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libutouch_geis_la-geis_instance.Plo@am__quote@ |
876 | 369 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libutouch_geis_la-geis_instance_table.Plo@am__quote@ | ||
877 | 370 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libutouch_geis_la-geis_logging.Plo@am__quote@ | ||
878 | 357 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libutouch_geis_la-geis_xcb.Plo@am__quote@ | 371 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libutouch_geis_la-geis_xcb.Plo@am__quote@ |
879 | 358 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libutouch_geis_la-xcb_gesture.Plo@am__quote@ | 372 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libutouch_geis_la-xcb_gesture.Plo@am__quote@ |
880 | 359 | 373 | ||
881 | @@ -385,6 +399,27 @@ | |||
882 | 385 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | 399 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
883 | 386 | @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutouch_geis_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libutouch_geis_la-geis.lo `test -f 'geis.c' || echo '$(srcdir)/'`geis.c | 400 | @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutouch_geis_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libutouch_geis_la-geis.lo `test -f 'geis.c' || echo '$(srcdir)/'`geis.c |
884 | 387 | 401 | ||
885 | 402 | libutouch_geis_la-geis_logging.lo: geis_logging.c | ||
886 | 403 | @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutouch_geis_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libutouch_geis_la-geis_logging.lo -MD -MP -MF $(DEPDIR)/libutouch_geis_la-geis_logging.Tpo -c -o libutouch_geis_la-geis_logging.lo `test -f 'geis_logging.c' || echo '$(srcdir)/'`geis_logging.c | ||
887 | 404 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libutouch_geis_la-geis_logging.Tpo $(DEPDIR)/libutouch_geis_la-geis_logging.Plo | ||
888 | 405 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='geis_logging.c' object='libutouch_geis_la-geis_logging.lo' libtool=yes @AMDEPBACKSLASH@ | ||
889 | 406 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
890 | 407 | @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutouch_geis_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libutouch_geis_la-geis_logging.lo `test -f 'geis_logging.c' || echo '$(srcdir)/'`geis_logging.c | ||
891 | 408 | |||
892 | 409 | libutouch_geis_la-geis_instance.lo: geis_instance.c | ||
893 | 410 | @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutouch_geis_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libutouch_geis_la-geis_instance.lo -MD -MP -MF $(DEPDIR)/libutouch_geis_la-geis_instance.Tpo -c -o libutouch_geis_la-geis_instance.lo `test -f 'geis_instance.c' || echo '$(srcdir)/'`geis_instance.c | ||
894 | 411 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libutouch_geis_la-geis_instance.Tpo $(DEPDIR)/libutouch_geis_la-geis_instance.Plo | ||
895 | 412 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='geis_instance.c' object='libutouch_geis_la-geis_instance.lo' libtool=yes @AMDEPBACKSLASH@ | ||
896 | 413 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
897 | 414 | @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutouch_geis_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libutouch_geis_la-geis_instance.lo `test -f 'geis_instance.c' || echo '$(srcdir)/'`geis_instance.c | ||
898 | 415 | |||
899 | 416 | libutouch_geis_la-geis_instance_table.lo: geis_instance_table.c | ||
900 | 417 | @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutouch_geis_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libutouch_geis_la-geis_instance_table.lo -MD -MP -MF $(DEPDIR)/libutouch_geis_la-geis_instance_table.Tpo -c -o libutouch_geis_la-geis_instance_table.lo `test -f 'geis_instance_table.c' || echo '$(srcdir)/'`geis_instance_table.c | ||
901 | 418 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libutouch_geis_la-geis_instance_table.Tpo $(DEPDIR)/libutouch_geis_la-geis_instance_table.Plo | ||
902 | 419 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='geis_instance_table.c' object='libutouch_geis_la-geis_instance_table.lo' libtool=yes @AMDEPBACKSLASH@ | ||
903 | 420 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
904 | 421 | @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutouch_geis_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libutouch_geis_la-geis_instance_table.lo `test -f 'geis_instance_table.c' || echo '$(srcdir)/'`geis_instance_table.c | ||
905 | 422 | |||
906 | 388 | libutouch_geis_la-geis_xcb.lo: geis_xcb.c | 423 | libutouch_geis_la-geis_xcb.lo: geis_xcb.c |
907 | 389 | @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutouch_geis_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libutouch_geis_la-geis_xcb.lo -MD -MP -MF $(DEPDIR)/libutouch_geis_la-geis_xcb.Tpo -c -o libutouch_geis_la-geis_xcb.lo `test -f 'geis_xcb.c' || echo '$(srcdir)/'`geis_xcb.c | 424 | @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutouch_geis_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libutouch_geis_la-geis_xcb.lo -MD -MP -MF $(DEPDIR)/libutouch_geis_la-geis_xcb.Tpo -c -o libutouch_geis_la-geis_xcb.lo `test -f 'geis_xcb.c' || echo '$(srcdir)/'`geis_xcb.c |
908 | 390 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libutouch_geis_la-geis_xcb.Tpo $(DEPDIR)/libutouch_geis_la-geis_xcb.Plo | 425 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libutouch_geis_la-geis_xcb.Tpo $(DEPDIR)/libutouch_geis_la-geis_xcb.Plo |
909 | @@ -392,13 +427,6 @@ | |||
910 | 392 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | 427 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
911 | 393 | @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutouch_geis_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libutouch_geis_la-geis_xcb.lo `test -f 'geis_xcb.c' || echo '$(srcdir)/'`geis_xcb.c | 428 | @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutouch_geis_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libutouch_geis_la-geis_xcb.lo `test -f 'geis_xcb.c' || echo '$(srcdir)/'`geis_xcb.c |
912 | 394 | 429 | ||
913 | 395 | libutouch_geis_la-geis_instance.lo: geis_instance.c | ||
914 | 396 | @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutouch_geis_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libutouch_geis_la-geis_instance.lo -MD -MP -MF $(DEPDIR)/libutouch_geis_la-geis_instance.Tpo -c -o libutouch_geis_la-geis_instance.lo `test -f 'geis_instance.c' || echo '$(srcdir)/'`geis_instance.c | ||
915 | 397 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libutouch_geis_la-geis_instance.Tpo $(DEPDIR)/libutouch_geis_la-geis_instance.Plo | ||
916 | 398 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='geis_instance.c' object='libutouch_geis_la-geis_instance.lo' libtool=yes @AMDEPBACKSLASH@ | ||
917 | 399 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
918 | 400 | @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutouch_geis_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libutouch_geis_la-geis_instance.lo `test -f 'geis_instance.c' || echo '$(srcdir)/'`geis_instance.c | ||
919 | 401 | |||
920 | 402 | libutouch_geis_la-xcb_gesture.lo: xcb_gesture.c | 430 | libutouch_geis_la-xcb_gesture.lo: xcb_gesture.c |
921 | 403 | @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutouch_geis_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libutouch_geis_la-xcb_gesture.lo -MD -MP -MF $(DEPDIR)/libutouch_geis_la-xcb_gesture.Tpo -c -o libutouch_geis_la-xcb_gesture.lo `test -f 'xcb_gesture.c' || echo '$(srcdir)/'`xcb_gesture.c | 431 | @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutouch_geis_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libutouch_geis_la-xcb_gesture.lo -MD -MP -MF $(DEPDIR)/libutouch_geis_la-xcb_gesture.Tpo -c -o libutouch_geis_la-xcb_gesture.lo `test -f 'xcb_gesture.c' || echo '$(srcdir)/'`xcb_gesture.c |
922 | 404 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libutouch_geis_la-xcb_gesture.Tpo $(DEPDIR)/libutouch_geis_la-xcb_gesture.Plo | 432 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libutouch_geis_la-xcb_gesture.Tpo $(DEPDIR)/libutouch_geis_la-xcb_gesture.Plo |
923 | 405 | 433 | ||
924 | === modified file 'libutouch-geis-xcb/geis.c' | |||
925 | --- libutouch-geis-xcb/geis.c 2010-08-11 13:54:54 +0000 | |||
926 | +++ libutouch-geis-xcb/geis.c 2010-09-16 16:28:52 +0000 | |||
927 | @@ -20,9 +20,13 @@ | |||
928 | 20 | #include <geis/geis.h> | 20 | #include <geis/geis.h> |
929 | 21 | 21 | ||
930 | 22 | #include "geis_instance.h" | 22 | #include "geis_instance.h" |
931 | 23 | #include "geis_xcb.h" | ||
932 | 23 | #include <stdlib.h> | 24 | #include <stdlib.h> |
933 | 24 | 25 | ||
934 | 25 | 26 | ||
935 | 27 | static GeisXcb s_geis_xcb = NULL; | ||
936 | 28 | |||
937 | 29 | |||
938 | 26 | /** | 30 | /** |
939 | 27 | * @param[in] win_info | 31 | * @param[in] win_info |
940 | 28 | * @param[out] geis_instance | 32 | * @param[out] geis_instance |
941 | @@ -34,13 +38,19 @@ | |||
942 | 34 | geis_init(GeisWinInfo *win_info, GeisInstance *geis_instance) | 38 | geis_init(GeisWinInfo *win_info, GeisInstance *geis_instance) |
943 | 35 | { | 39 | { |
944 | 36 | *geis_instance = NULL; | 40 | *geis_instance = NULL; |
945 | 41 | GeisXcbWinInfo *xcb_win_info = (GeisXcbWinInfo*)win_info->win_info; | ||
946 | 37 | 42 | ||
947 | 38 | if (win_info->win_type != GEIS_XCB_FULL_WINDOW) | 43 | if (win_info->win_type != GEIS_XCB_FULL_WINDOW) |
948 | 39 | { | 44 | { |
949 | 40 | return GEIS_BAD_ARGUMENT; | 45 | return GEIS_BAD_ARGUMENT; |
950 | 41 | } | 46 | } |
951 | 42 | 47 | ||
953 | 43 | *geis_instance = geis_instance_get((GeisXcbWinInfo*)win_info->win_info); | 48 | if (!s_geis_xcb) |
954 | 49 | { | ||
955 | 50 | s_geis_xcb = geis_xcb_new(xcb_win_info); | ||
956 | 51 | } | ||
957 | 52 | |||
958 | 53 | *geis_instance = geis_xcb_create_instance(s_geis_xcb, xcb_win_info->window_id); | ||
959 | 44 | return GEIS_STATUS_SUCCESS; | 54 | return GEIS_STATUS_SUCCESS; |
960 | 45 | } | 55 | } |
961 | 46 | 56 | ||
962 | @@ -109,7 +119,7 @@ | |||
963 | 109 | switch (configuration_item) | 119 | switch (configuration_item) |
964 | 110 | { | 120 | { |
965 | 111 | case GEIS_CONFIG_UNIX_FD: | 121 | case GEIS_CONFIG_UNIX_FD: |
967 | 112 | *(int *)value = geis_instance_fd(geis_instance); | 122 | *(int *)value = geis_xcb_fd(s_geis_xcb); |
968 | 113 | status = GEIS_STATUS_SUCCESS; | 123 | status = GEIS_STATUS_SUCCESS; |
969 | 114 | break; | 124 | break; |
970 | 115 | } | 125 | } |
971 | @@ -147,7 +157,7 @@ | |||
972 | 147 | return GEIS_BAD_ARGUMENT; | 157 | return GEIS_BAD_ARGUMENT; |
973 | 148 | } | 158 | } |
974 | 149 | 159 | ||
976 | 150 | geis_instance_event_dispatch(geis_instance); | 160 | geis_xcb_dispatch(s_geis_xcb); |
977 | 151 | return GEIS_STATUS_SUCCESS; | 161 | return GEIS_STATUS_SUCCESS; |
978 | 152 | } | 162 | } |
979 | 153 | 163 | ||
980 | @@ -159,7 +169,7 @@ | |||
981 | 159 | */ | 169 | */ |
982 | 160 | GeisStatus | 170 | GeisStatus |
983 | 161 | geis_input_devices(GeisInstance geis_instance, | 171 | geis_input_devices(GeisInstance geis_instance, |
985 | 162 | GeisInputFuncs funcs, | 172 | GeisInputFuncs *funcs, |
986 | 163 | void *cookie) | 173 | void *cookie) |
987 | 164 | { | 174 | { |
988 | 165 | if (!geis_instance_is_valid(geis_instance)) | 175 | if (!geis_instance_is_valid(geis_instance)) |
989 | @@ -167,7 +177,7 @@ | |||
990 | 167 | return GEIS_BAD_ARGUMENT; | 177 | return GEIS_BAD_ARGUMENT; |
991 | 168 | } | 178 | } |
992 | 169 | 179 | ||
994 | 170 | return GEIS_UNKNOWN_ERROR; | 180 | return geis_xcb_input_devices(s_geis_xcb, funcs, cookie); |
995 | 171 | } | 181 | } |
996 | 172 | 182 | ||
997 | 173 | 183 | ||
998 | @@ -191,6 +201,7 @@ | |||
999 | 191 | } | 201 | } |
1000 | 192 | 202 | ||
1001 | 193 | return geis_instance_subscribe(geis_instance, | 203 | return geis_instance_subscribe(geis_instance, |
1002 | 204 | s_geis_xcb, | ||
1003 | 194 | input_list, | 205 | input_list, |
1004 | 195 | gesture_list, | 206 | gesture_list, |
1005 | 196 | funcs, | 207 | funcs, |
1006 | 197 | 208 | ||
1007 | === removed file 'libutouch-geis-xcb/geis_debug.h' | |||
1008 | --- libutouch-geis-xcb/geis_debug.h 2010-08-11 13:54:54 +0000 | |||
1009 | +++ libutouch-geis-xcb/geis_debug.h 1970-01-01 00:00:00 +0000 | |||
1010 | @@ -1,27 +0,0 @@ | |||
1011 | 1 | /** | ||
1012 | 2 | * @file geis_debug,h | ||
1013 | 3 | * | ||
1014 | 4 | * Copyright 2010 Canonical Ltd. | ||
1015 | 5 | * | ||
1016 | 6 | * This library is free software; you can redistribute it and/or modify it under | ||
1017 | 7 | * the terms of the GNU Lesser General Public License as published by the Free | ||
1018 | 8 | * Software Foundation; either version 3 of the License, or (at your option) any | ||
1019 | 9 | * later version. | ||
1020 | 10 | * | ||
1021 | 11 | * This library is distributed in the hope that it will be useful, but WITHOUT | ||
1022 | 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
1023 | 13 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more | ||
1024 | 14 | * details. | ||
1025 | 15 | * | ||
1026 | 16 | * You should have received a copy of the GNU Lesser General Public License | ||
1027 | 17 | * along with this program; if not, write to the Free Software Foundation, Inc., | ||
1028 | 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
1029 | 19 | */ | ||
1030 | 20 | #ifndef GEIS_DEBUG_H_ | ||
1031 | 21 | #define GEIS_DEBUG_H_ | ||
1032 | 22 | |||
1033 | 23 | #include <stdio.h> | ||
1034 | 24 | |||
1035 | 25 | #define geis_debug printf | ||
1036 | 26 | |||
1037 | 27 | #endif /* GEIS_DEBUG_H_ */ | ||
1038 | 28 | 0 | ||
1039 | === modified file 'libutouch-geis-xcb/geis_instance.c' | |||
1040 | --- libutouch-geis-xcb/geis_instance.c 2010-08-11 13:54:54 +0000 | |||
1041 | +++ libutouch-geis-xcb/geis_instance.c 2010-09-16 16:28:52 +0000 | |||
1042 | @@ -19,17 +19,27 @@ | |||
1043 | 19 | */ | 19 | */ |
1044 | 20 | #include "geis_instance.h" | 20 | #include "geis_instance.h" |
1045 | 21 | 21 | ||
1046 | 22 | #include "geis_logging.h" | ||
1047 | 22 | #include <stdlib.h> | 23 | #include <stdlib.h> |
1048 | 23 | 24 | ||
1049 | 24 | 25 | ||
1050 | 26 | /** | ||
1051 | 27 | * Creates a new GeisInstance for an X11 windowId. | ||
1052 | 28 | * | ||
1053 | 29 | * @param[in] An X11 windowId. | ||
1054 | 30 | * | ||
1055 | 31 | * @returns a new GeisInstance or NULL on failure. | ||
1056 | 32 | */ | ||
1057 | 25 | GeisInstance | 33 | GeisInstance |
1059 | 26 | geis_instance_get(GeisXcbWinInfo* win_info) | 34 | geis_instance_new(uint32_t window_id) |
1060 | 27 | { | 35 | { |
1063 | 28 | GeisInstance instance = calloc(1, sizeof(GeisInstance)); | 36 | GeisInstance instance = calloc(1, sizeof(struct _GeisInstance)); |
1064 | 29 | if (instance) | 37 | if (!instance) |
1065 | 30 | { | 38 | { |
1067 | 31 | instance->xcb = geis_xcb_get(win_info); | 39 | geis_error("allocating GeisInstance"); |
1068 | 40 | return NULL; | ||
1069 | 32 | } | 41 | } |
1070 | 42 | instance->window_id = window_id; | ||
1071 | 33 | return instance; | 43 | return instance; |
1072 | 34 | } | 44 | } |
1073 | 35 | 45 | ||
1074 | @@ -44,42 +54,52 @@ | |||
1075 | 44 | int | 54 | int |
1076 | 45 | geis_instance_is_valid(GeisInstance instance) | 55 | geis_instance_is_valid(GeisInstance instance) |
1077 | 46 | { | 56 | { |
1079 | 47 | return (instance != 0 && instance->xcb != 0); | 57 | return (instance != 0 && instance->window_id != 0); |
1080 | 48 | } | 58 | } |
1081 | 49 | 59 | ||
1082 | 50 | 60 | ||
1083 | 51 | GeisStatus | 61 | GeisStatus |
1084 | 52 | geis_instance_subscribe(GeisInstance instance, | 62 | geis_instance_subscribe(GeisInstance instance, |
1085 | 63 | GeisXcb xcb, | ||
1086 | 53 | GeisInputDeviceId *input_list, | 64 | GeisInputDeviceId *input_list, |
1087 | 54 | const char* *gesture_list, | 65 | const char* *gesture_list, |
1088 | 55 | GeisGestureFuncs *funcs, | 66 | GeisGestureFuncs *funcs, |
1089 | 56 | void *cookie) | 67 | void *cookie) |
1090 | 57 | { | 68 | { |
1091 | 69 | GeisStatus result = GEIS_UNKNOWN_ERROR; | ||
1092 | 58 | instance->gesture_funcs = funcs; | 70 | instance->gesture_funcs = funcs; |
1093 | 59 | instance->gesture_cookie = cookie; | 71 | instance->gesture_cookie = cookie; |
1112 | 60 | return geis_xcb_subscribe(instance, gesture_list); | 72 | if (input_list == GEIS_ALL_INPUT_DEVICES) |
1113 | 61 | } | 73 | { |
1114 | 62 | 74 | result = geis_xcb_subscribe(xcb, instance, 0, gesture_list); | |
1115 | 63 | 75 | } | |
1116 | 64 | int | 76 | else |
1117 | 65 | geis_instance_fd(GeisInstance instance) | 77 | { |
1118 | 66 | { | 78 | GeisInputDeviceId *device_id = input_list; |
1119 | 67 | if (instance == NULL) | 79 | for (; *device_id; ++device_id) |
1120 | 68 | return -1; | 80 | { |
1121 | 69 | 81 | GeisStatus a_result = geis_xcb_subscribe(xcb, instance, | |
1122 | 70 | return geis_xcb_fd(instance->xcb); | 82 | (uint16_t)*device_id, |
1123 | 71 | } | 83 | gesture_list); |
1124 | 72 | 84 | if (a_result == GEIS_STATUS_SUCCESS) | |
1125 | 73 | 85 | { | |
1126 | 74 | void | 86 | result = a_result; |
1127 | 75 | geis_instance_event_dispatch(GeisInstance instance) | 87 | } |
1128 | 76 | { | 88 | } |
1129 | 77 | geis_xcb_dispatch(instance); | 89 | } |
1130 | 90 | return result; | ||
1131 | 91 | } | ||
1132 | 92 | |||
1133 | 93 | |||
1134 | 94 | uint32_t | ||
1135 | 95 | geis_instance_get_window_id(GeisInstance instance) | ||
1136 | 96 | { | ||
1137 | 97 | return instance->window_id; | ||
1138 | 78 | } | 98 | } |
1139 | 79 | 99 | ||
1140 | 80 | 100 | ||
1141 | 81 | void | 101 | void |
1142 | 82 | geis_instance_free(GeisInstance instance) | 102 | geis_instance_free(GeisInstance instance) |
1143 | 83 | { | 103 | { |
1145 | 84 | geis_xcb_free(instance->xcb); | 104 | free(instance); |
1146 | 85 | } | 105 | } |
1147 | 86 | 106 | ||
1148 | === modified file 'libutouch-geis-xcb/geis_instance.h' | |||
1149 | --- libutouch-geis-xcb/geis_instance.h 2010-08-23 14:54:18 +0000 | |||
1150 | +++ libutouch-geis-xcb/geis_instance.h 2010-09-16 16:28:52 +0000 | |||
1151 | @@ -26,31 +26,27 @@ | |||
1152 | 26 | 26 | ||
1153 | 27 | struct _GeisInstance | 27 | struct _GeisInstance |
1154 | 28 | { | 28 | { |
1160 | 29 | GeisXcb *xcb; | 29 | uint32_t window_id; |
1161 | 30 | GeisInputCallback input_callback; | 30 | GeisGestureFuncs *gesture_funcs; |
1162 | 31 | void *input_cookie; | 31 | void *gesture_cookie; |
1158 | 32 | GeisGestureFuncs *gesture_funcs; | ||
1159 | 33 | void *gesture_cookie; | ||
1163 | 34 | }; | 32 | }; |
1164 | 35 | 33 | ||
1165 | 36 | /** @brief Constructs a GeisInstance. */ | 34 | /** @brief Constructs a GeisInstance. */ |
1167 | 37 | GeisInstance geis_instance_get(GeisXcbWinInfo* win_info); | 35 | GeisInstance geis_instance_new(uint32_t win_info); |
1168 | 36 | |||
1169 | 38 | 37 | ||
1170 | 39 | /** @brief Indicates if the GeisInstance is valid. */ | 38 | /** @brief Indicates if the GeisInstance is valid. */ |
1171 | 40 | int geis_instance_is_valid(GeisInstance instance); | 39 | int geis_instance_is_valid(GeisInstance instance); |
1172 | 41 | 40 | ||
1173 | 42 | /** @brief Subscribe to gestures. */ | 41 | /** @brief Subscribe to gestures. */ |
1174 | 43 | GeisStatus geis_instance_subscribe(GeisInstance instance, | 42 | GeisStatus geis_instance_subscribe(GeisInstance instance, |
1175 | 43 | GeisXcb xcb, | ||
1176 | 44 | GeisInputDeviceId *input_list, | 44 | GeisInputDeviceId *input_list, |
1177 | 45 | const char* *gesture_list, | 45 | const char* *gesture_list, |
1178 | 46 | GeisGestureFuncs *funcs, | 46 | GeisGestureFuncs *funcs, |
1179 | 47 | void *cookie); | 47 | void *cookie); |
1180 | 48 | 48 | ||
1186 | 49 | /** @brief Gets the event file descriptor. */ | 49 | uint32_t geis_instance_get_window_id(GeisInstance instance); |
1182 | 50 | int geis_instance_fd(GeisInstance instance); | ||
1183 | 51 | |||
1184 | 52 | /** @brief Dispatches events. */ | ||
1185 | 53 | void geis_instance_event_dispatch(GeisInstance instance); | ||
1187 | 54 | 50 | ||
1188 | 55 | /** @brief Tears down the GeisInstance. */ | 51 | /** @brief Tears down the GeisInstance. */ |
1189 | 56 | void geis_instance_free(GeisInstance instance); | 52 | void geis_instance_free(GeisInstance instance); |
1190 | 57 | 53 | ||
1191 | === added file 'libutouch-geis-xcb/geis_instance_table.c' | |||
1192 | --- libutouch-geis-xcb/geis_instance_table.c 1970-01-01 00:00:00 +0000 | |||
1193 | +++ libutouch-geis-xcb/geis_instance_table.c 2010-09-16 16:28:52 +0000 | |||
1194 | @@ -0,0 +1,127 @@ | |||
1195 | 1 | /** | ||
1196 | 2 | * geis_instance_table.h | ||
1197 | 3 | * | ||
1198 | 4 | * Copyright 2010 Canonical Ltd. | ||
1199 | 5 | * | ||
1200 | 6 | * This library is free software; you can redistribute it and/or modify it under | ||
1201 | 7 | * the terms of the GNU Lesser General Public License as published by the Free | ||
1202 | 8 | * Software Foundation; either version 3 of the License, or (at your option) any | ||
1203 | 9 | * later version. | ||
1204 | 10 | * | ||
1205 | 11 | * This library is distributed in the hope that it will be useful, but WITHOUT | ||
1206 | 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
1207 | 13 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for | ||
1208 | 14 | * more details. | ||
1209 | 15 | * | ||
1210 | 16 | * You should have received a copy of the GNU General Public License along with | ||
1211 | 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 | ||
1212 | 18 | * Franklin St, Fifth Floor, Boston, MA 02110-1301 US | ||
1213 | 19 | */ | ||
1214 | 20 | #include "geis_instance_table.h" | ||
1215 | 21 | |||
1216 | 22 | #include "geis_instance.h" | ||
1217 | 23 | #include <stdlib.h> | ||
1218 | 24 | |||
1219 | 25 | #define GROWTH_FACTOR 2 | ||
1220 | 26 | |||
1221 | 27 | |||
1222 | 28 | typedef struct _GeisInstanceTableEntry | ||
1223 | 29 | { | ||
1224 | 30 | uint32_t id; | ||
1225 | 31 | GeisInstance type; | ||
1226 | 32 | } *GeisInstanceTableEntry; | ||
1227 | 33 | |||
1228 | 34 | struct _GeisInstanceTable | ||
1229 | 35 | { | ||
1230 | 36 | size_t capacity; | ||
1231 | 37 | size_t size; | ||
1232 | 38 | GeisInstanceTableEntry data; | ||
1233 | 39 | }; | ||
1234 | 40 | |||
1235 | 41 | |||
1236 | 42 | GeisInstanceTable | ||
1237 | 43 | geis_instance_table_new(int size_hint) | ||
1238 | 44 | { | ||
1239 | 45 | GeisInstanceTable table = malloc(sizeof(struct _GeisInstanceTable)); | ||
1240 | 46 | if (!table) | ||
1241 | 47 | { | ||
1242 | 48 | /* TODO: report error */ | ||
1243 | 49 | } | ||
1244 | 50 | |||
1245 | 51 | table->capacity = size_hint; | ||
1246 | 52 | table->size = 0; | ||
1247 | 53 | table->data = calloc(table->capacity, | ||
1248 | 54 | size_hint * sizeof(struct _GeisInstanceTableEntry)); | ||
1249 | 55 | if (!table->data) | ||
1250 | 56 | { | ||
1251 | 57 | /* TODO: report error */ | ||
1252 | 58 | } | ||
1253 | 59 | |||
1254 | 60 | return table; | ||
1255 | 61 | } | ||
1256 | 62 | |||
1257 | 63 | |||
1258 | 64 | /** | ||
1259 | 65 | * Adds (or replaces) a gesture type in the table. | ||
1260 | 66 | */ | ||
1261 | 67 | void | ||
1262 | 68 | geis_instance_table_add(GeisInstanceTable table, | ||
1263 | 69 | GeisInstance instance) | ||
1264 | 70 | { | ||
1265 | 71 | size_t i; | ||
1266 | 72 | uint32_t window_id = geis_instance_get_window_id(instance); | ||
1267 | 73 | |||
1268 | 74 | /* If the ID is already present, just replace the gesture type */ | ||
1269 | 75 | for (i = 0; i < table->size; ++i) | ||
1270 | 76 | { | ||
1271 | 77 | if (table->data[i].id == window_id) | ||
1272 | 78 | { | ||
1273 | 79 | table->data[i].type = instance; | ||
1274 | 80 | return; | ||
1275 | 81 | } | ||
1276 | 82 | } | ||
1277 | 83 | |||
1278 | 84 | /* If there is no space to insert, grow the table. */ | ||
1279 | 85 | if (table->size >= table->capacity) | ||
1280 | 86 | { | ||
1281 | 87 | size_t new_capacity = table->capacity * GROWTH_FACTOR; | ||
1282 | 88 | GeisInstanceTableEntry new_data = realloc(table->data, | ||
1283 | 89 | new_capacity * sizeof(struct _GeisInstanceTableEntry)); | ||
1284 | 90 | if (!new_data) | ||
1285 | 91 | { | ||
1286 | 92 | /* TODO: report error */ | ||
1287 | 93 | } | ||
1288 | 94 | |||
1289 | 95 | table->capacity = new_capacity; | ||
1290 | 96 | table->data = new_data; | ||
1291 | 97 | } | ||
1292 | 98 | |||
1293 | 99 | table->data[table->size].id = window_id; | ||
1294 | 100 | table->data[table->size].type = instance; | ||
1295 | 101 | ++table->size; | ||
1296 | 102 | } | ||
1297 | 103 | |||
1298 | 104 | |||
1299 | 105 | GeisInstance | ||
1300 | 106 | geis_instance_table_get(GeisInstanceTable table, | ||
1301 | 107 | uint32_t window_id) | ||
1302 | 108 | { | ||
1303 | 109 | size_t i; | ||
1304 | 110 | for (i = 0; i < table->size; ++i) | ||
1305 | 111 | { | ||
1306 | 112 | if (table->data[i].id == window_id) | ||
1307 | 113 | { | ||
1308 | 114 | return table->data[i].type; | ||
1309 | 115 | } | ||
1310 | 116 | } | ||
1311 | 117 | return NULL; | ||
1312 | 118 | } | ||
1313 | 119 | |||
1314 | 120 | |||
1315 | 121 | void | ||
1316 | 122 | geis_instance_table_free(GeisInstanceTable table) | ||
1317 | 123 | { | ||
1318 | 124 | free(table->data); | ||
1319 | 125 | free(table); | ||
1320 | 126 | } | ||
1321 | 127 | |||
1322 | 0 | 128 | ||
1323 | === added file 'libutouch-geis-xcb/geis_instance_table.h' | |||
1324 | --- libutouch-geis-xcb/geis_instance_table.h 1970-01-01 00:00:00 +0000 | |||
1325 | +++ libutouch-geis-xcb/geis_instance_table.h 2010-09-16 16:28:52 +0000 | |||
1326 | @@ -0,0 +1,41 @@ | |||
1327 | 1 | /** | ||
1328 | 2 | * geis_instance_table.h | ||
1329 | 3 | * | ||
1330 | 4 | * Copyright 2010 Canonical Ltd. | ||
1331 | 5 | * | ||
1332 | 6 | * This library is free software; you can redistribute it and/or modify it under | ||
1333 | 7 | * the terms of the GNU Lesser General Public License as published by the Free | ||
1334 | 8 | * Software Foundation; either version 3 of the License, or (at your option) any | ||
1335 | 9 | * later version. | ||
1336 | 10 | * | ||
1337 | 11 | * This library is distributed in the hope that it will be useful, but WITHOUT | ||
1338 | 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
1339 | 13 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for | ||
1340 | 14 | * more details. | ||
1341 | 15 | * | ||
1342 | 16 | * You should have received a copy of the GNU General Public License along with | ||
1343 | 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 | ||
1344 | 18 | * Franklin St, Fifth Floor, Boston, MA 02110-1301 US | ||
1345 | 19 | */ | ||
1346 | 20 | #ifndef GEIS_INSTANCE_TABLE_H_ | ||
1347 | 21 | #define GEIS_INSTANCE_TABLE_H_ | ||
1348 | 22 | |||
1349 | 23 | #include "geis_config.h" | ||
1350 | 24 | #include <geis/geis.h> | ||
1351 | 25 | |||
1352 | 26 | /** | ||
1353 | 27 | * A map from XCB window IDs to geisInstances. | ||
1354 | 28 | */ | ||
1355 | 29 | typedef struct _GeisInstanceTable *GeisInstanceTable; | ||
1356 | 30 | |||
1357 | 31 | GeisInstanceTable geis_instance_table_new(int size_hint); | ||
1358 | 32 | |||
1359 | 33 | void geis_instance_table_add(GeisInstanceTable type_table, | ||
1360 | 34 | GeisInstance instance); | ||
1361 | 35 | |||
1362 | 36 | GeisInstance geis_instance_table_get(GeisInstanceTable type_table, | ||
1363 | 37 | uint32_t window_id); | ||
1364 | 38 | |||
1365 | 39 | void geis_instance_table_free(GeisInstanceTable type_table); | ||
1366 | 40 | |||
1367 | 41 | #endif /* GEIS_INSTANCE_TABLE_H_ */ | ||
1368 | 0 | 42 | ||
1369 | === added file 'libutouch-geis-xcb/geis_logging.c' | |||
1370 | --- libutouch-geis-xcb/geis_logging.c 1970-01-01 00:00:00 +0000 | |||
1371 | +++ libutouch-geis-xcb/geis_logging.c 2010-09-16 16:28:52 +0000 | |||
1372 | @@ -0,0 +1,87 @@ | |||
1373 | 1 | /** | ||
1374 | 2 | * @file geis_logging.h | ||
1375 | 3 | * | ||
1376 | 4 | * Copyright 2010 Canonical Ltd. | ||
1377 | 5 | * | ||
1378 | 6 | * This library is free software; you can redistribute it and/or modify it under | ||
1379 | 7 | * the terms of the GNU Lesser General Public License as published by the Free | ||
1380 | 8 | * Software Foundation; either version 3 of the License, or (at your option) any | ||
1381 | 9 | * later version. | ||
1382 | 10 | * | ||
1383 | 11 | * This library is distributed in the hope that it will be useful, but WITHOUT | ||
1384 | 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
1385 | 13 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more | ||
1386 | 14 | * details. | ||
1387 | 15 | * | ||
1388 | 16 | * You should have received a copy of the GNU Lesser General Public License | ||
1389 | 17 | * along with this program; if not, write to the Free Software Foundation, Inc., | ||
1390 | 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
1391 | 19 | */ | ||
1392 | 20 | #include "geis_logging.h" | ||
1393 | 21 | |||
1394 | 22 | #include <stdarg.h> | ||
1395 | 23 | #include <stdio.h> | ||
1396 | 24 | #include <stdlib.h> | ||
1397 | 25 | #include <string.h> | ||
1398 | 26 | |||
1399 | 27 | |||
1400 | 28 | static const char *prefix_format = "GEIS(%s)-%s:%d "; | ||
1401 | 29 | static const char *debug_marker = "debug"; | ||
1402 | 30 | static const char *warning_marker = "warning"; | ||
1403 | 31 | static const char *error_marker = "error"; | ||
1404 | 32 | |||
1405 | 33 | |||
1406 | 34 | static int | ||
1407 | 35 | reporting_level() | ||
1408 | 36 | { | ||
1409 | 37 | char *level = getenv("GEIS_DEBUG"); | ||
1410 | 38 | if (level) | ||
1411 | 39 | { | ||
1412 | 40 | return atoi(level); | ||
1413 | 41 | } | ||
1414 | 42 | return 0; | ||
1415 | 43 | } | ||
1416 | 44 | |||
1417 | 45 | static int | ||
1418 | 46 | level_is_enabled(int desired_level) | ||
1419 | 47 | { | ||
1420 | 48 | static int level = -1; | ||
1421 | 49 | if (level < 0) | ||
1422 | 50 | level = reporting_level(); | ||
1423 | 51 | return level >= desired_level; | ||
1424 | 52 | } | ||
1425 | 53 | |||
1426 | 54 | |||
1427 | 55 | int | ||
1428 | 56 | _geis_message(int level, const char* function, int line, const char *format, ...) | ||
1429 | 57 | { | ||
1430 | 58 | int count = 0; | ||
1431 | 59 | if (level_is_enabled(level)) | ||
1432 | 60 | { | ||
1433 | 61 | const char *marker = NULL; | ||
1434 | 62 | switch (level) | ||
1435 | 63 | { | ||
1436 | 64 | case _GEIS_LOG_LEVEL_DEBUG: | ||
1437 | 65 | marker = debug_marker; | ||
1438 | 66 | break; | ||
1439 | 67 | case _GEIS_LOG_LEVEL_WARNING: | ||
1440 | 68 | marker = warning_marker; | ||
1441 | 69 | break; | ||
1442 | 70 | default: | ||
1443 | 71 | marker = error_marker; | ||
1444 | 72 | break; | ||
1445 | 73 | } | ||
1446 | 74 | |||
1447 | 75 | fprintf(stderr, prefix_format, marker, function, line); | ||
1448 | 76 | |||
1449 | 77 | va_list ap; | ||
1450 | 78 | va_start(ap, format); | ||
1451 | 79 | count = vfprintf(stderr, format, ap); | ||
1452 | 80 | va_end(ap); | ||
1453 | 81 | |||
1454 | 82 | fprintf(stderr, "\n"); | ||
1455 | 83 | } | ||
1456 | 84 | return count; | ||
1457 | 85 | } | ||
1458 | 86 | |||
1459 | 87 | |||
1460 | 0 | 88 | ||
1461 | === added file 'libutouch-geis-xcb/geis_logging.h' | |||
1462 | --- libutouch-geis-xcb/geis_logging.h 1970-01-01 00:00:00 +0000 | |||
1463 | +++ libutouch-geis-xcb/geis_logging.h 2010-09-16 16:28:52 +0000 | |||
1464 | @@ -0,0 +1,64 @@ | |||
1465 | 1 | /** | ||
1466 | 2 | * @file geis_logging.h | ||
1467 | 3 | * @brief internal GEIS debug/logging facilities | ||
1468 | 4 | * | ||
1469 | 5 | * Copyright 2010 Canonical Ltd. | ||
1470 | 6 | * | ||
1471 | 7 | * This library is free software; you can redistribute it and/or modify it under | ||
1472 | 8 | * the terms of the GNU Lesser General Public License as published by the Free | ||
1473 | 9 | * Software Foundation; either version 3 of the License, or (at your option) any | ||
1474 | 10 | * later version. | ||
1475 | 11 | * | ||
1476 | 12 | * This library is distributed in the hope that it will be useful, but WITHOUT | ||
1477 | 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
1478 | 14 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more | ||
1479 | 15 | * details. | ||
1480 | 16 | * | ||
1481 | 17 | * You should have received a copy of the GNU Lesser General Public License | ||
1482 | 18 | * along with this program; if not, write to the Free Software Foundation, Inc., | ||
1483 | 19 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
1484 | 20 | */ | ||
1485 | 21 | #ifndef GEIS_LOGGING_H_ | ||
1486 | 22 | #define GEIS_LOGGING_H_ | ||
1487 | 23 | |||
1488 | 24 | /** | ||
1489 | 25 | * @defgroup geis_logging GEIS Logging Facilities | ||
1490 | 26 | * | ||
1491 | 27 | * This facility allows the run-time delivery of debugging and error emssages | ||
1492 | 28 | * from the library. By default, no debug or error diagnostics are emitted by | ||
1493 | 29 | * the library. However, if the environment variable GEIS_DEBUG is set to an | ||
1494 | 30 | * appropriate value, these diagnostic messages will be emitted to stderr. | ||
1495 | 31 | * | ||
1496 | 32 | * The following GEIS_DEBUG values are supported. | ||
1497 | 33 | * | ||
1498 | 34 | * GEIS_DEBUG=1 error messages only are emitted | ||
1499 | 35 | * GEIS_DEBUG=2 error and warning messages are emitted | ||
1500 | 36 | * GEIS_DEBUG=3 error, warning, and debug messages are emitted | ||
1501 | 37 | * | ||
1502 | 38 | * @{ | ||
1503 | 39 | */ | ||
1504 | 40 | |||
1505 | 41 | #define _GEIS_LOG_LEVEL_ERROR 1 | ||
1506 | 42 | #define _GEIS_LOG_LEVEL_WARNING 2 | ||
1507 | 43 | #define _GEIS_LOG_LEVEL_DEBUG 3 | ||
1508 | 44 | |||
1509 | 45 | /** | ||
1510 | 46 | * Emits a message at the DEBUG logging level. | ||
1511 | 47 | * @param[in] fmt printf-style format string | ||
1512 | 48 | */ | ||
1513 | 49 | #define geis_debug(...) _geis_message(_GEIS_LOG_LEVEL_DEBUG, \ | ||
1514 | 50 | __FUNCTION__, __LINE__, \ | ||
1515 | 51 | __VA_ARGS__) | ||
1516 | 52 | #define geis_warning(...) _geis_message(_GEIS_LOG_LEVEL_WARNING, \ | ||
1517 | 53 | __FUNCTION__, __LINE__, \ | ||
1518 | 54 | __VA_ARGS__) | ||
1519 | 55 | #define geis_error(...) _geis_message(_GEIS_LOG_LEVEL_ERROR, \ | ||
1520 | 56 | __FUNCTION__, __LINE__, \ | ||
1521 | 57 | __VA_ARGS__) | ||
1522 | 58 | int _geis_message(int level, | ||
1523 | 59 | const char *function, int line, | ||
1524 | 60 | const char *format, ...) __attribute__((format(printf, 4, 5))); | ||
1525 | 61 | |||
1526 | 62 | /* @} */ | ||
1527 | 63 | |||
1528 | 64 | #endif /* GEIS_LOGGING_H_ */ | ||
1529 | 0 | 65 | ||
1530 | === modified file 'libutouch-geis-xcb/geis_xcb.c' | |||
1531 | --- libutouch-geis-xcb/geis_xcb.c 2010-08-23 14:54:15 +0000 | |||
1532 | +++ libutouch-geis-xcb/geis_xcb.c 2010-09-16 16:28:52 +0000 | |||
1533 | @@ -19,12 +19,14 @@ | |||
1534 | 19 | */ | 19 | */ |
1535 | 20 | #include "geis_xcb.h" | 20 | #include "geis_xcb.h" |
1536 | 21 | 21 | ||
1537 | 22 | #include "geis_debug.h" | ||
1538 | 23 | #include "geis_instance.h" | 22 | #include "geis_instance.h" |
1539 | 23 | #include "geis_instance_table.h" | ||
1540 | 24 | #include "geis_logging.h" | ||
1541 | 24 | #include <grail.h> | 25 | #include <grail.h> |
1542 | 25 | #include <grail-types.h> | 26 | #include <grail-types.h> |
1543 | 26 | #include <stdlib.h> | 27 | #include <stdlib.h> |
1544 | 27 | #include <string.h> | 28 | #include <string.h> |
1545 | 29 | #include <X11/Xlib-xcb.h> | ||
1546 | 28 | #include <X11/X.h> | 30 | #include <X11/X.h> |
1547 | 29 | #include "xcb_gesture.h" | 31 | #include "xcb_gesture.h" |
1548 | 30 | #include <xcb/xcb.h> | 32 | #include <xcb/xcb.h> |
1549 | @@ -32,15 +34,12 @@ | |||
1550 | 32 | struct _GeisXcb | 34 | struct _GeisXcb |
1551 | 33 | { | 35 | { |
1552 | 34 | GeisXcbWinInfo *win_info; | 36 | GeisXcbWinInfo *win_info; |
1553 | 37 | Display *display; | ||
1554 | 35 | xcb_connection_t *connection; | 38 | xcb_connection_t *connection; |
1555 | 36 | int fd; | 39 | int fd; |
1563 | 37 | }; | 40 | GeisInstanceTable instance_table; |
1564 | 38 | 41 | GeisInputFuncs *input_funcs; | |
1565 | 39 | static GeisXcb s_geis_xcb = | 42 | void *input_cookie; |
1559 | 40 | { | ||
1560 | 41 | NULL, | ||
1561 | 42 | NULL, | ||
1562 | 43 | -1 | ||
1566 | 44 | }; | 43 | }; |
1567 | 45 | 44 | ||
1568 | 46 | typedef struct _GrailAttrMap | 45 | typedef struct _GrailAttrMap |
1569 | @@ -171,71 +170,182 @@ | |||
1570 | 171 | 170 | ||
1571 | 172 | static const GrailTypeMap s_grail_type_map[] = | 171 | static const GrailTypeMap s_grail_type_map[] = |
1572 | 173 | { | 172 | { |
1635 | 174 | { GEIS_GESTURE_TYPE_DRAG, GEIS_GESTURE_DRAG, sizeof(s_grail_drag_attrs) / sizeof(GrailAttrMap), s_grail_drag_attrs }, | 173 | { |
1636 | 175 | { GEIS_GESTURE_TYPE_PINCH, GEIS_GESTURE_PINCH, sizeof(s_grail_pinch_attrs) / sizeof(GrailAttrMap), s_grail_pinch_attrs }, | 174 | GEIS_GESTURE_TYPE_DRAG, |
1637 | 176 | { GEIS_GESTURE_TYPE_ROTATE, GEIS_GESTURE_ROTATE, sizeof(s_grail_rotate_attrs) / sizeof(GrailAttrMap), s_grail_rotate_attrs }, | 175 | GEIS_GESTURE_DRAG, |
1638 | 177 | { GEIS_GESTURE_TYPE_TAP, GEIS_GESTURE_TAP, sizeof(s_grail_tap_attrs) / sizeof(GrailAttrMap), s_grail_tap_attrs }, | 176 | sizeof(s_grail_drag_attrs) / sizeof(GrailAttrMap), |
1639 | 178 | { 0, 0, 0, 0 } | 177 | s_grail_drag_attrs |
1640 | 179 | }; | 178 | }, |
1641 | 180 | 179 | { | |
1642 | 181 | 180 | GEIS_GESTURE_TYPE_PINCH, | |
1643 | 182 | GeisGestureAttr s_name_attr = | 181 | GEIS_GESTURE_PINCH, |
1644 | 183 | { | 182 | sizeof(s_grail_pinch_attrs) / sizeof(GrailAttrMap), |
1645 | 184 | .name="name", | 183 | s_grail_pinch_attrs |
1646 | 185 | .type=GEIS_ATTR_TYPE_STRING | 184 | }, |
1647 | 186 | }; | 185 | { |
1648 | 187 | 186 | GEIS_GESTURE_TYPE_ROTATE, | |
1649 | 188 | /** | 187 | GEIS_GESTURE_ROTATE, |
1650 | 189 | * Dispatches gesture events to the instance's callback. | 188 | sizeof(s_grail_rotate_attrs) / sizeof(GrailAttrMap), |
1651 | 190 | */ | 189 | s_grail_rotate_attrs |
1652 | 191 | static void | 190 | }, |
1653 | 192 | geis_xcb_dispatch_gesture_type(GeisInstance instance, | 191 | { |
1654 | 193 | const char **gesture_list) | 192 | GEIS_GESTURE_TYPE_TAP, |
1655 | 194 | { | 193 | GEIS_GESTURE_TAP, |
1656 | 195 | if (gesture_list == GEIS_ALL_GESTURES) | 194 | sizeof(s_grail_tap_attrs) / sizeof(GrailAttrMap), |
1657 | 196 | { | 195 | s_grail_tap_attrs |
1658 | 197 | const GrailTypeMap *type = s_grail_type_map; | 196 | }, |
1659 | 198 | for (; type->name; ++type) | 197 | { |
1660 | 199 | { | 198 | GRAIL_TYPE_DRAG2, |
1661 | 200 | s_name_attr.string_val = type->name; | 199 | GEIS_GESTURE_TYPE_DRAG2, |
1662 | 201 | if (instance->gesture_funcs && | 200 | sizeof(s_grail_drag_attrs) / sizeof(GrailAttrMap), |
1663 | 202 | instance->gesture_funcs->added) | 201 | s_grail_drag_attrs |
1664 | 203 | { | 202 | }, |
1665 | 204 | instance->gesture_funcs->added (instance->gesture_cookie, | 203 | { |
1666 | 205 | type->type, | 204 | GRAIL_TYPE_PINCH2, |
1667 | 206 | 0, | 205 | GEIS_GESTURE_TYPE_PINCH2, |
1668 | 207 | 1, &s_name_attr); | 206 | sizeof(s_grail_pinch_attrs) / sizeof(GrailAttrMap), |
1669 | 208 | } | 207 | s_grail_pinch_attrs |
1670 | 209 | } | 208 | }, |
1671 | 210 | } | 209 | { |
1672 | 211 | else | 210 | GRAIL_TYPE_ROTATE2, |
1673 | 212 | { | 211 | GEIS_GESTURE_TYPE_ROTATE2, |
1674 | 213 | const char **gesture = NULL; | 212 | sizeof(s_grail_rotate_attrs) / sizeof(GrailAttrMap), |
1675 | 214 | for (gesture = gesture_list; *gesture; ++gesture) | 213 | s_grail_rotate_attrs |
1676 | 215 | { | 214 | }, |
1677 | 216 | const GrailTypeMap *type = s_grail_type_map; | 215 | { |
1678 | 217 | for (; type->name; ++type) | 216 | GRAIL_TYPE_DRAG3, |
1679 | 218 | { | 217 | GEIS_GESTURE_TYPE_DRAG3, |
1680 | 219 | if (strcmp(type->name, *gesture) == 0) | 218 | sizeof(s_grail_drag_attrs) / sizeof(GrailAttrMap), |
1681 | 220 | { | 219 | s_grail_drag_attrs |
1682 | 221 | s_name_attr.string_val = type->name; | 220 | }, |
1683 | 222 | if (instance->gesture_funcs && instance->gesture_funcs->added) | 221 | { |
1684 | 223 | { | 222 | GRAIL_TYPE_PINCH3, |
1685 | 224 | instance->gesture_funcs->added (instance->gesture_cookie, | 223 | GEIS_GESTURE_TYPE_PINCH3, |
1686 | 225 | type->type, | 224 | sizeof(s_grail_pinch_attrs) / sizeof(GrailAttrMap), |
1687 | 226 | 0, | 225 | s_grail_pinch_attrs |
1688 | 227 | 1, &s_name_attr); | 226 | }, |
1689 | 228 | } | 227 | { |
1690 | 229 | 228 | GRAIL_TYPE_ROTATE3, | |
1691 | 230 | break; | 229 | GEIS_GESTURE_TYPE_ROTATE3, |
1692 | 231 | } | 230 | sizeof(s_grail_rotate_attrs) / sizeof(GrailAttrMap), |
1693 | 232 | } | 231 | s_grail_rotate_attrs |
1694 | 233 | } | 232 | }, |
1695 | 234 | } | 233 | { |
1696 | 235 | } | 234 | GRAIL_TYPE_DRAG4, |
1697 | 235 | GEIS_GESTURE_TYPE_DRAG4, | ||
1698 | 236 | sizeof(s_grail_drag_attrs) / sizeof(GrailAttrMap), | ||
1699 | 237 | s_grail_drag_attrs | ||
1700 | 238 | }, | ||
1701 | 239 | { | ||
1702 | 240 | GRAIL_TYPE_PINCH4, | ||
1703 | 241 | GEIS_GESTURE_TYPE_PINCH4, | ||
1704 | 242 | sizeof(s_grail_pinch_attrs) / sizeof(GrailAttrMap), | ||
1705 | 243 | s_grail_pinch_attrs | ||
1706 | 244 | }, | ||
1707 | 245 | { | ||
1708 | 246 | GRAIL_TYPE_ROTATE4, | ||
1709 | 247 | GEIS_GESTURE_TYPE_ROTATE4, | ||
1710 | 248 | sizeof(s_grail_rotate_attrs) / sizeof(GrailAttrMap), | ||
1711 | 249 | s_grail_rotate_attrs | ||
1712 | 250 | }, | ||
1713 | 251 | { | ||
1714 | 252 | GRAIL_TYPE_DRAG5, | ||
1715 | 253 | GEIS_GESTURE_TYPE_DRAG5, | ||
1716 | 254 | sizeof(s_grail_drag_attrs) / sizeof(GrailAttrMap), | ||
1717 | 255 | s_grail_drag_attrs | ||
1718 | 256 | }, | ||
1719 | 257 | { | ||
1720 | 258 | GRAIL_TYPE_PINCH5, | ||
1721 | 259 | GEIS_GESTURE_TYPE_PINCH5, | ||
1722 | 260 | sizeof(s_grail_pinch_attrs) / sizeof(GrailAttrMap), | ||
1723 | 261 | s_grail_pinch_attrs | ||
1724 | 262 | }, | ||
1725 | 263 | { | ||
1726 | 264 | GRAIL_TYPE_ROTATE5, | ||
1727 | 265 | GEIS_GESTURE_TYPE_ROTATE5, | ||
1728 | 266 | sizeof(s_grail_rotate_attrs) / sizeof(GrailAttrMap), | ||
1729 | 267 | s_grail_rotate_attrs | ||
1730 | 268 | }, | ||
1731 | 269 | { | ||
1732 | 270 | GRAIL_TYPE_TAP1, | ||
1733 | 271 | GEIS_GESTURE_TYPE_TAP1, | ||
1734 | 272 | sizeof(s_grail_tap_attrs) / sizeof(GrailAttrMap), | ||
1735 | 273 | s_grail_tap_attrs | ||
1736 | 274 | }, | ||
1737 | 275 | { | ||
1738 | 276 | GRAIL_TYPE_TAP2, | ||
1739 | 277 | GEIS_GESTURE_TYPE_TAP2, | ||
1740 | 278 | sizeof(s_grail_tap_attrs) / sizeof(GrailAttrMap), | ||
1741 | 279 | s_grail_tap_attrs | ||
1742 | 280 | }, | ||
1743 | 281 | { | ||
1744 | 282 | GRAIL_TYPE_TAP3, | ||
1745 | 283 | GEIS_GESTURE_TYPE_TAP3, | ||
1746 | 284 | sizeof(s_grail_tap_attrs) / sizeof(GrailAttrMap), | ||
1747 | 285 | s_grail_tap_attrs | ||
1748 | 286 | }, | ||
1749 | 287 | { | ||
1750 | 288 | GRAIL_TYPE_TAP4, | ||
1751 | 289 | GEIS_GESTURE_TYPE_TAP4, | ||
1752 | 290 | sizeof(s_grail_tap_attrs) / sizeof(GrailAttrMap), | ||
1753 | 291 | s_grail_tap_attrs | ||
1754 | 292 | }, | ||
1755 | 293 | { | ||
1756 | 294 | GRAIL_TYPE_TAP5, | ||
1757 | 295 | GEIS_GESTURE_TYPE_TAP5, | ||
1758 | 296 | sizeof(s_grail_tap_attrs) / sizeof(GrailAttrMap), | ||
1759 | 297 | s_grail_tap_attrs | ||
1760 | 298 | }, | ||
1761 | 299 | // special (undocumented) gestures available in Grail | ||
1762 | 300 | { | ||
1763 | 301 | GRAIL_TYPE_EDRAG, | ||
1764 | 302 | "EDrag", | ||
1765 | 303 | sizeof(s_grail_drag_attrs) / sizeof(GrailAttrMap), | ||
1766 | 304 | s_grail_drag_attrs | ||
1767 | 305 | }, | ||
1768 | 306 | { | ||
1769 | 307 | GRAIL_TYPE_EPINCH, | ||
1770 | 308 | "EPinch", | ||
1771 | 309 | sizeof(s_grail_drag_attrs) / sizeof(GrailAttrMap), | ||
1772 | 310 | s_grail_drag_attrs | ||
1773 | 311 | }, | ||
1774 | 312 | { | ||
1775 | 313 | GRAIL_TYPE_EROTATE, | ||
1776 | 314 | "ERotate", | ||
1777 | 315 | sizeof(s_grail_drag_attrs) / sizeof(GrailAttrMap), | ||
1778 | 316 | s_grail_drag_attrs | ||
1779 | 317 | }, | ||
1780 | 318 | { | ||
1781 | 319 | GRAIL_TYPE_MDRAG, | ||
1782 | 320 | "MDrag", | ||
1783 | 321 | sizeof(s_grail_drag_attrs) / sizeof(GrailAttrMap), | ||
1784 | 322 | s_grail_drag_attrs | ||
1785 | 323 | }, | ||
1786 | 324 | { | ||
1787 | 325 | GRAIL_TYPE_MPINCH, | ||
1788 | 326 | "MPinch", | ||
1789 | 327 | sizeof(s_grail_drag_attrs) / sizeof(GrailAttrMap), | ||
1790 | 328 | s_grail_drag_attrs | ||
1791 | 329 | }, | ||
1792 | 330 | { | ||
1793 | 331 | GRAIL_TYPE_MROTATE, | ||
1794 | 332 | "MRotate", | ||
1795 | 333 | sizeof(s_grail_drag_attrs) / sizeof(GrailAttrMap), | ||
1796 | 334 | s_grail_drag_attrs | ||
1797 | 335 | }, | ||
1798 | 336 | { 0, NULL, 0, NULL } | ||
1799 | 337 | }; | ||
1800 | 338 | |||
1801 | 339 | |||
1802 | 340 | |||
1803 | 341 | GeisGestureAttr s_name_attr[2] = | ||
1804 | 342 | { | ||
1805 | 343 | { GEIS_GESTURE_ATTRIBUTE_GESTURE_NAME, GEIS_ATTR_TYPE_STRING, 0 }, | ||
1806 | 344 | { GEIS_GESTURE_ATTRIBUTE_TOUCHES, GEIS_ATTR_TYPE_INTEGER, 0 } | ||
1807 | 345 | }; | ||
1808 | 236 | 346 | ||
1809 | 237 | static GeisInteger | 347 | static GeisInteger |
1811 | 238 | geis_xcb_determine_gesture_type(int xcb_gesture_type) | 348 | geis_xcb_determine_primitive_type(int xcb_gesture_type) |
1812 | 239 | { | 349 | { |
1813 | 240 | switch (xcb_gesture_type) | 350 | switch (xcb_gesture_type) |
1814 | 241 | { | 351 | { |
1815 | @@ -322,6 +432,75 @@ | |||
1816 | 322 | return 0; | 432 | return 0; |
1817 | 323 | } | 433 | } |
1818 | 324 | 434 | ||
1819 | 435 | static const char * | ||
1820 | 436 | geis_xcb_get_gesture_type_primitive_name(GeisInteger gesture_type) | ||
1821 | 437 | { | ||
1822 | 438 | GeisInteger primitive_type = geis_xcb_determine_primitive_type(gesture_type); | ||
1823 | 439 | const GrailTypeMap *type = s_grail_type_map; | ||
1824 | 440 | for (; type->name; ++type) | ||
1825 | 441 | { | ||
1826 | 442 | if (type->type == primitive_type) | ||
1827 | 443 | { | ||
1828 | 444 | return type->name; | ||
1829 | 445 | } | ||
1830 | 446 | } | ||
1831 | 447 | return "unknown"; | ||
1832 | 448 | } | ||
1833 | 449 | |||
1834 | 450 | /** | ||
1835 | 451 | * Dispatches gesture events to the instance's callback. | ||
1836 | 452 | */ | ||
1837 | 453 | static void | ||
1838 | 454 | geis_xcb_dispatch_gesture_type(GeisInstance instance, | ||
1839 | 455 | const char **gesture_list) | ||
1840 | 456 | { | ||
1841 | 457 | if (gesture_list == GEIS_ALL_GESTURES) | ||
1842 | 458 | { | ||
1843 | 459 | const GrailTypeMap *type = s_grail_type_map; | ||
1844 | 460 | for (; type->name; ++type) | ||
1845 | 461 | { | ||
1846 | 462 | s_name_attr[0].string_val = | ||
1847 | 463 | geis_xcb_get_gesture_type_primitive_name(type->type); | ||
1848 | 464 | s_name_attr[1].integer_val = geis_xcb_determine_fingers(type->type); | ||
1849 | 465 | if (instance->gesture_funcs && instance->gesture_funcs->added) | ||
1850 | 466 | { | ||
1851 | 467 | instance->gesture_funcs->added(instance->gesture_cookie, | ||
1852 | 468 | type->type, | ||
1853 | 469 | 0, | ||
1854 | 470 | sizeof(s_name_attr) / sizeof(GeisGestureAttr), | ||
1855 | 471 | s_name_attr); | ||
1856 | 472 | } | ||
1857 | 473 | } | ||
1858 | 474 | } | ||
1859 | 475 | else | ||
1860 | 476 | { | ||
1861 | 477 | const char **gesture = NULL; | ||
1862 | 478 | for (gesture = gesture_list; *gesture; ++gesture) | ||
1863 | 479 | { | ||
1864 | 480 | const GrailTypeMap *type = s_grail_type_map; | ||
1865 | 481 | for (; type->name; ++type) | ||
1866 | 482 | { | ||
1867 | 483 | if (strcmp(type->name, *gesture) == 0) | ||
1868 | 484 | { | ||
1869 | 485 | s_name_attr[0].string_val = | ||
1870 | 486 | geis_xcb_get_gesture_type_primitive_name(type->type); | ||
1871 | 487 | s_name_attr[1].integer_val = geis_xcb_determine_fingers(type->type); | ||
1872 | 488 | if (instance->gesture_funcs && instance->gesture_funcs->added) | ||
1873 | 489 | { | ||
1874 | 490 | instance->gesture_funcs->added(instance->gesture_cookie, | ||
1875 | 491 | type->type, | ||
1876 | 492 | 0, | ||
1877 | 493 | sizeof(s_name_attr) / sizeof(GeisGestureAttr), | ||
1878 | 494 | s_name_attr); | ||
1879 | 495 | } | ||
1880 | 496 | |||
1881 | 497 | break; | ||
1882 | 498 | } | ||
1883 | 499 | } | ||
1884 | 500 | } | ||
1885 | 501 | } | ||
1886 | 502 | } | ||
1887 | 503 | |||
1888 | 325 | /** | 504 | /** |
1889 | 326 | * Dispatches gesture events to the instance's callback. | 505 | * Dispatches gesture events to the instance's callback. |
1890 | 327 | */ | 506 | */ |
1891 | @@ -332,7 +511,7 @@ | |||
1892 | 332 | static const int num_standard_attrs = 9; | 511 | static const int num_standard_attrs = 9; |
1893 | 333 | int num_attrs = num_standard_attrs + event->num_props; | 512 | int num_attrs = num_standard_attrs + event->num_props; |
1894 | 334 | float *properties = NULL; | 513 | float *properties = NULL; |
1896 | 335 | GeisInteger gesture_type = geis_xcb_determine_gesture_type(event->gesture_type); | 514 | GeisInteger gesture_type = geis_xcb_determine_primitive_type(event->gesture_type); |
1897 | 336 | 515 | ||
1898 | 337 | GeisGestureAttr *attrs = calloc(num_attrs, sizeof(GeisGestureAttr)); | 516 | GeisGestureAttr *attrs = calloc(num_attrs, sizeof(GeisGestureAttr)); |
1899 | 338 | if (!attrs) | 517 | if (!attrs) |
1900 | @@ -362,7 +541,7 @@ | |||
1901 | 362 | attrs[6].type = GEIS_ATTR_TYPE_FLOAT; | 541 | attrs[6].type = GEIS_ATTR_TYPE_FLOAT; |
1902 | 363 | attrs[6].float_val = event->focus_y; | 542 | attrs[6].float_val = event->focus_y; |
1903 | 364 | 543 | ||
1905 | 365 | attrs[8].name = GEIS_GESTURE_ATTRIBUTE_FINGERS; | 544 | attrs[8].name = GEIS_GESTURE_ATTRIBUTE_TOUCHES; |
1906 | 366 | attrs[8].type = GEIS_ATTR_TYPE_INTEGER; | 545 | attrs[8].type = GEIS_ATTR_TYPE_INTEGER; |
1907 | 367 | attrs[8].integer_val = geis_xcb_determine_fingers(event->gesture_type); | 546 | attrs[8].integer_val = geis_xcb_determine_fingers(event->gesture_type); |
1908 | 368 | 547 | ||
1909 | @@ -442,82 +621,114 @@ | |||
1910 | 442 | } | 621 | } |
1911 | 443 | 622 | ||
1912 | 444 | 623 | ||
1978 | 445 | /** | 624 | GeisXcb |
1979 | 446 | * @param[in] win_info | 625 | geis_xcb_new(GeisXcbWinInfo *win_info) |
1980 | 447 | */ | 626 | { |
1981 | 448 | GeisXcb * | 627 | GeisXcb xcb = calloc(1, sizeof(struct _GeisXcb)); |
1982 | 449 | geis_xcb_get(GeisXcbWinInfo *win_info) | 628 | if (!xcb) |
1983 | 450 | { | 629 | { |
1984 | 451 | if (!s_geis_xcb.connection) | 630 | geis_error("error allocating GeisXcb"); |
1985 | 452 | { | 631 | return NULL; |
1986 | 453 | xcb_generic_error_t *error; | 632 | } |
1987 | 454 | 633 | ||
1988 | 455 | s_geis_xcb.win_info = win_info; | 634 | xcb->win_info = win_info; |
1989 | 456 | s_geis_xcb.connection = xcb_connect(win_info->display_name, | 635 | xcb->display = XOpenDisplay(win_info->display_name); |
1990 | 457 | win_info->screenp); | 636 | if (!xcb->display) |
1991 | 458 | if (!s_geis_xcb.connection) | 637 | { |
1992 | 459 | { | 638 | geis_error("error opening X server."); |
1993 | 460 | geis_debug("error connecting to X server."); | 639 | goto error_exit; |
1994 | 461 | return NULL; | 640 | } |
1995 | 462 | } | 641 | |
1996 | 463 | 642 | xcb->connection = XGetXCBConnection(xcb->display); | |
1997 | 464 | #if 0 | 643 | if (!xcb->connection) |
1998 | 465 | { | 644 | { |
1999 | 466 | char buffer[128]; | 645 | geis_error("error connecting to X server."); |
2000 | 467 | xcb_input_get_extension_version_cookie_t input_version_cookie; | 646 | goto error_exit; |
2001 | 468 | 647 | } | |
2002 | 469 | input_version_cookie = xcb_input_get_extension_version(s_geis_xcb.connection, | 648 | |
2003 | 470 | 127, | 649 | { |
2004 | 471 | buffer); | 650 | xcb_gesture_query_version_cookie_t version_cookie; |
2005 | 472 | } | 651 | xcb_gesture_query_version_reply_t *version_reply = NULL; |
2006 | 473 | #endif | 652 | xcb_generic_error_t *error = NULL; |
2007 | 474 | 653 | ||
2008 | 475 | { | 654 | version_cookie = xcb_gesture_query_version(xcb->connection, |
2009 | 476 | xcb_gesture_query_version_cookie_t version_cookie; | 655 | XCB_GESTURE_MAJOR_VERSION, |
2010 | 477 | xcb_gesture_query_version_reply_t *version_reply = NULL; | 656 | XCB_GESTURE_MINOR_VERSION); |
2011 | 478 | 657 | version_reply = xcb_gesture_query_version_reply(xcb->connection, | |
2012 | 479 | version_cookie = xcb_gesture_query_version(s_geis_xcb.connection, | 658 | version_cookie, |
2013 | 480 | XCB_GESTURE_MAJOR_VERSION, | 659 | &error); |
2014 | 481 | XCB_GESTURE_MINOR_VERSION); | 660 | if (!version_reply) |
2015 | 482 | version_reply = xcb_gesture_query_version_reply(s_geis_xcb.connection, | 661 | { |
2016 | 483 | version_cookie, | 662 | geis_error("failed to receive gesture version reply\n"); |
2017 | 484 | &error); | 663 | goto error_exit; |
2018 | 485 | if (!version_reply) | 664 | } |
2019 | 486 | { | 665 | |
2020 | 487 | geis_debug("failed to receive gesture version reply\n"); | 666 | if (version_reply->major_version != XCB_GESTURE_MAJOR_VERSION |
2021 | 488 | return NULL; | 667 | && version_reply->minor_version != XCB_GESTURE_MINOR_VERSION) |
2022 | 489 | } | 668 | { |
2023 | 490 | 669 | geis_error("server supports unrecognized version: %d.%d\n", | |
2024 | 491 | if (version_reply->major_version != XCB_GESTURE_MAJOR_VERSION | 670 | version_reply->major_version, version_reply->minor_version); |
2025 | 492 | && version_reply->minor_version != XCB_GESTURE_MINOR_VERSION) | 671 | } |
2026 | 493 | { | 672 | |
2027 | 494 | geis_debug("server supports unrecognized version: %d.%d\n", | 673 | free(version_reply); |
2028 | 495 | version_reply->major_version, version_reply->minor_version); | 674 | } |
2029 | 496 | return NULL; | 675 | |
2030 | 497 | } | 676 | |
2031 | 498 | 677 | xcb->fd = xcb_get_file_descriptor(xcb->connection); | |
2032 | 499 | free(version_reply); | 678 | xcb->instance_table = geis_instance_table_new(1); |
2033 | 500 | } | 679 | if (!xcb->instance_table) |
2034 | 501 | 680 | { | |
2035 | 502 | 681 | geis_error("error constructing instance table"); | |
2036 | 503 | s_geis_xcb.fd = xcb_get_file_descriptor(s_geis_xcb.connection); | 682 | goto error_exit; |
2037 | 504 | } | 683 | } |
2038 | 505 | 684 | ||
2039 | 506 | return &s_geis_xcb; | 685 | goto final_exit; |
2040 | 507 | } | 686 | |
2041 | 508 | 687 | error_exit: | |
2042 | 509 | 688 | free(xcb); | |
2043 | 689 | |||
2044 | 690 | final_exit: | ||
2045 | 691 | return xcb; | ||
2046 | 692 | } | ||
2047 | 693 | |||
2048 | 694 | |||
2049 | 695 | /** | ||
2050 | 696 | * Create a new GeisInstance for a windowId. | ||
2051 | 697 | * | ||
2052 | 698 | * @param[in] An X11 windowId. | ||
2053 | 699 | */ | ||
2054 | 700 | GeisInstance | ||
2055 | 701 | geis_xcb_create_instance(GeisXcb xcb, uint32_t window_id) | ||
2056 | 702 | { | ||
2057 | 703 | GeisInstance instance = geis_instance_new(window_id); | ||
2058 | 704 | if (!instance) | ||
2059 | 705 | { | ||
2060 | 706 | geis_error("failure to create GeisInstance"); | ||
2061 | 707 | } | ||
2062 | 708 | else | ||
2063 | 709 | { | ||
2064 | 710 | geis_instance_table_add(xcb->instance_table, instance); | ||
2065 | 711 | } | ||
2066 | 712 | return instance; | ||
2067 | 713 | } | ||
2068 | 714 | |||
2069 | 715 | |||
2070 | 716 | /** | ||
2071 | 717 | * Gets the file description on which events will appear. | ||
2072 | 718 | */ | ||
2073 | 510 | int | 719 | int |
2075 | 511 | geis_xcb_fd(GeisXcb *xcb) | 720 | geis_xcb_fd(GeisXcb xcb) |
2076 | 512 | { | 721 | { |
2078 | 513 | return xcb->fd; | 722 | return xcb->fd; |
2079 | 514 | } | 723 | } |
2080 | 515 | 724 | ||
2081 | 516 | 725 | ||
2082 | 726 | /** | ||
2083 | 727 | * Dispatches events. | ||
2084 | 728 | */ | ||
2085 | 517 | void | 729 | void |
2087 | 518 | geis_xcb_dispatch(GeisInstance instance) | 730 | geis_xcb_dispatch(GeisXcb xcb) |
2088 | 519 | { | 731 | { |
2089 | 520 | GeisXcb *xcb = instance->xcb; | ||
2090 | 521 | if (xcb->connection) | 732 | if (xcb->connection) |
2091 | 522 | { | 733 | { |
2092 | 523 | const xcb_query_extension_reply_t *extension_info; | 734 | const xcb_query_extension_reply_t *extension_info; |
2093 | @@ -528,27 +739,37 @@ | |||
2094 | 528 | { | 739 | { |
2095 | 529 | xcb_gesture_notify_event_t *gesture_event = NULL; | 740 | xcb_gesture_notify_event_t *gesture_event = NULL; |
2096 | 530 | if (event->response_type != GenericEvent) { | 741 | if (event->response_type != GenericEvent) { |
2099 | 531 | geis_debug("warning: Received non-generic event type: %d\n", | 742 | geis_warning("received non-generic event type: %d\n", |
2100 | 532 | event->response_type); | 743 | event->response_type); |
2101 | 533 | continue; | 744 | continue; |
2102 | 534 | } | 745 | } |
2103 | 535 | 746 | ||
2104 | 536 | gesture_event = (xcb_gesture_notify_event_t*)event; | 747 | gesture_event = (xcb_gesture_notify_event_t*)event; |
2105 | 537 | if (gesture_event->extension != extension_info->major_opcode) | 748 | if (gesture_event->extension != extension_info->major_opcode) |
2106 | 538 | { | 749 | { |
2109 | 539 | geis_debug("warning: Received non-gesture extension event: %d\n", | 750 | geis_warning("received non-gesture extension event: %d\n", |
2110 | 540 | gesture_event->extension); | 751 | gesture_event->extension); |
2111 | 541 | continue; | 752 | continue; |
2112 | 542 | } | 753 | } |
2113 | 543 | 754 | ||
2114 | 544 | if (gesture_event->event_type != XCB_GESTURE_NOTIFY) | 755 | if (gesture_event->event_type != XCB_GESTURE_NOTIFY) |
2115 | 545 | { | 756 | { |
2118 | 546 | geis_debug("warning: Received unrecognized gesture event type: %d\n", | 757 | geis_warning("received unrecognized gesture event type: %d\n", |
2119 | 547 | gesture_event->event_type); | 758 | gesture_event->event_type); |
2120 | 548 | continue; | 759 | continue; |
2121 | 549 | } | 760 | } |
2122 | 550 | 761 | ||
2124 | 551 | geis_xcb_dispatch_gesture(instance, gesture_event); | 762 | GeisInstance instance = geis_instance_table_get(xcb->instance_table, |
2125 | 763 | gesture_event->event); | ||
2126 | 764 | if (!instance) | ||
2127 | 765 | { | ||
2128 | 766 | geis_error("no instance found for window_id 0x%08x\n", | ||
2129 | 767 | gesture_event->event); | ||
2130 | 768 | } | ||
2131 | 769 | else | ||
2132 | 770 | { | ||
2133 | 771 | geis_xcb_dispatch_gesture(instance, gesture_event); | ||
2134 | 772 | } | ||
2135 | 552 | 773 | ||
2136 | 553 | event = xcb_poll_for_event(xcb->connection); | 774 | event = xcb_poll_for_event(xcb->connection); |
2137 | 554 | } | 775 | } |
2138 | @@ -557,89 +778,183 @@ | |||
2139 | 557 | 778 | ||
2140 | 558 | 779 | ||
2141 | 559 | void | 780 | void |
2143 | 560 | geis_xcb_free(GeisXcb* xcb) | 781 | geis_xcb_free(GeisXcb xcb) |
2144 | 561 | { | 782 | { |
2145 | 562 | xcb_disconnect(xcb->connection); | 783 | xcb_disconnect(xcb->connection); |
2146 | 784 | XCloseDisplay(xcb->display); | ||
2147 | 785 | } | ||
2148 | 786 | |||
2149 | 787 | |||
2150 | 788 | static void | ||
2151 | 789 | geis_xcb_map_gestures_to_mask(const char **gesture_list, | ||
2152 | 790 | uint32_t **gesture_mask, | ||
2153 | 791 | uint32_t *gesture_mask_len) | ||
2154 | 792 | { | ||
2155 | 793 | *gesture_mask_len = 1; | ||
2156 | 794 | *gesture_mask = calloc(sizeof(uint32_t), *gesture_mask_len); | ||
2157 | 795 | if (!gesture_mask) | ||
2158 | 796 | return; | ||
2159 | 797 | |||
2160 | 798 | const char **g = gesture_list; | ||
2161 | 799 | if (g == GEIS_ALL_GESTURES) | ||
2162 | 800 | { | ||
2163 | 801 | uint32_t all = 0xffffffff; | ||
2164 | 802 | memcpy(*gesture_mask, &all, sizeof(uint32_t)); | ||
2165 | 803 | } | ||
2166 | 804 | else | ||
2167 | 805 | { | ||
2168 | 806 | while (*g) | ||
2169 | 807 | { | ||
2170 | 808 | const GrailTypeMap *type = s_grail_type_map; | ||
2171 | 809 | for (; type->name; ++type) | ||
2172 | 810 | { | ||
2173 | 811 | if (strcmp(type->name, *g) == 0) | ||
2174 | 812 | { | ||
2175 | 813 | if (type->type < 32) | ||
2176 | 814 | { | ||
2177 | 815 | **gesture_mask |= (1 << type->type); | ||
2178 | 816 | } | ||
2179 | 817 | break; | ||
2180 | 818 | } | ||
2181 | 819 | } | ||
2182 | 820 | ++g; | ||
2183 | 821 | } | ||
2184 | 822 | } | ||
2185 | 823 | } | ||
2186 | 824 | |||
2187 | 825 | |||
2188 | 826 | static GeisStatus | ||
2189 | 827 | geis_xcb_verify_event_selection(GeisXcb xcb, | ||
2190 | 828 | uint32_t window_id, | ||
2191 | 829 | uint16_t device_id, | ||
2192 | 830 | uint32_t mask_len, | ||
2193 | 831 | uint32_t *mask) | ||
2194 | 832 | { | ||
2195 | 833 | GeisStatus result = GEIS_UNKNOWN_ERROR; | ||
2196 | 834 | xcb_generic_error_t *error; | ||
2197 | 835 | xcb_gesture_get_selected_events_cookie_t events_cookie; | ||
2198 | 836 | xcb_gesture_get_selected_events_reply_t *events_reply = NULL; | ||
2199 | 837 | xcb_gesture_event_mask_iterator_t event_mask_it; | ||
2200 | 838 | uint32_t mask_len_reply = 0; | ||
2201 | 839 | uint32_t *mask_reply = NULL; | ||
2202 | 840 | int device_is_found = 0; | ||
2203 | 841 | |||
2204 | 842 | events_cookie = xcb_gesture_get_selected_events(xcb->connection, | ||
2205 | 843 | window_id); | ||
2206 | 844 | events_reply = xcb_gesture_get_selected_events_reply(xcb->connection, | ||
2207 | 845 | events_cookie, | ||
2208 | 846 | &error); | ||
2209 | 847 | if (!events_reply) | ||
2210 | 848 | { | ||
2211 | 849 | geis_error("failed to receive selected events reply\n"); | ||
2212 | 850 | goto really_done; | ||
2213 | 851 | } | ||
2214 | 852 | |||
2215 | 853 | for (event_mask_it = xcb_gesture_get_selected_events_masks_iterator(events_reply); | ||
2216 | 854 | event_mask_it.rem; | ||
2217 | 855 | xcb_gesture_event_mask_next(&event_mask_it)) | ||
2218 | 856 | { | ||
2219 | 857 | xcb_gesture_event_mask_t *event_mask = event_mask_it.data; | ||
2220 | 858 | if (event_mask->device_id == device_id) | ||
2221 | 859 | { | ||
2222 | 860 | mask_len_reply = xcb_gesture_event_mask_mask_data_length(event_mask); | ||
2223 | 861 | if (mask_len_reply != mask_len) | ||
2224 | 862 | { | ||
2225 | 863 | geis_error("incorrect mask length returned by server - expected %d, got %d\n", | ||
2226 | 864 | mask_len, mask_len_reply); | ||
2227 | 865 | goto done; | ||
2228 | 866 | } | ||
2229 | 867 | |||
2230 | 868 | mask_reply = xcb_gesture_event_mask_mask_data(event_mask); | ||
2231 | 869 | if (memcmp(mask, mask_reply, mask_len * 4) != 0) | ||
2232 | 870 | { | ||
2233 | 871 | geis_error("incorrect mask returned by server\n"); | ||
2234 | 872 | goto done; | ||
2235 | 873 | } | ||
2236 | 874 | |||
2237 | 875 | device_is_found = 1; | ||
2238 | 876 | } | ||
2239 | 877 | } | ||
2240 | 878 | |||
2241 | 879 | if (!device_is_found) | ||
2242 | 880 | { | ||
2243 | 881 | geis_error("gesture mask for device %d not returned by server\n", device_id); | ||
2244 | 882 | goto done; | ||
2245 | 883 | } | ||
2246 | 884 | |||
2247 | 885 | result = GEIS_STATUS_SUCCESS; | ||
2248 | 886 | done: | ||
2249 | 887 | free(events_reply); | ||
2250 | 888 | really_done: | ||
2251 | 889 | return result; | ||
2252 | 563 | } | 890 | } |
2253 | 564 | 891 | ||
2254 | 565 | 892 | ||
2255 | 566 | GeisStatus | 893 | GeisStatus |
2257 | 567 | geis_xcb_subscribe(GeisInstance instance, | 894 | geis_xcb_subscribe(GeisXcb xcb, |
2258 | 895 | GeisInstance instance, | ||
2259 | 896 | uint16_t device_id, | ||
2260 | 568 | const char **gesture_list) | 897 | const char **gesture_list) |
2261 | 569 | { | 898 | { |
2271 | 570 | uint16_t device_id = 0; //< temporary for dev testing | 899 | GeisStatus result = GEIS_UNKNOWN_ERROR; |
2272 | 571 | uint32_t mask_len = 1; //< temporary for dev testing | 900 | uint32_t mask_len = 1; |
2273 | 572 | uint32_t mask[] = { 0xffffffff }; //< temporary for dev testing | 901 | uint32_t *mask = 0; |
2274 | 573 | 902 | const char **g; | |
2275 | 574 | xcb_generic_error_t *error; | 903 | xcb_generic_error_t *error; |
2276 | 575 | xcb_void_cookie_t select_cookie; | 904 | xcb_void_cookie_t select_cookie; |
2277 | 576 | GeisXcb *xcb = instance->xcb; | 905 | xcb_window_t window_id = geis_instance_get_window_id(instance); |
2278 | 577 | 906 | ||
2279 | 578 | geis_xcb_dispatch_gesture_type(instance, gesture_list); | 907 | if (gesture_list == GEIS_ALL_GESTURES) |
2280 | 908 | { | ||
2281 | 909 | geis_debug("subscribing device %d for the all gestures\n", device_id); | ||
2282 | 910 | } | ||
2283 | 911 | else | ||
2284 | 912 | { | ||
2285 | 913 | geis_debug("subscribing device %d for the following gestures:\n", device_id); | ||
2286 | 914 | for (g = gesture_list; *g; ++g) | ||
2287 | 915 | { | ||
2288 | 916 | geis_debug("\t\"%s\"\n", *g); | ||
2289 | 917 | } | ||
2290 | 918 | } | ||
2291 | 919 | |||
2292 | 920 | geis_xcb_map_gestures_to_mask(gesture_list, &mask, &mask_len); | ||
2293 | 921 | if (!mask) | ||
2294 | 922 | { | ||
2295 | 923 | geis_error("failed to allocate mask\n"); | ||
2296 | 924 | goto really_done; | ||
2297 | 925 | } | ||
2298 | 579 | 926 | ||
2299 | 580 | select_cookie = xcb_gesture_select_events_checked(xcb->connection, | 927 | select_cookie = xcb_gesture_select_events_checked(xcb->connection, |
2304 | 581 | xcb->win_info->window_id, | 928 | window_id, |
2305 | 582 | device_id, | 929 | device_id, |
2306 | 583 | mask_len, | 930 | mask_len, |
2307 | 584 | mask); | 931 | mask); |
2308 | 585 | error = xcb_request_check(xcb->connection, select_cookie); | 932 | error = xcb_request_check(xcb->connection, select_cookie); |
2309 | 586 | if (error) | 933 | if (error) |
2310 | 587 | { | 934 | { |
2313 | 588 | geis_debug("failed to select events\n"); | 935 | geis_error("failed to select events for window 0x%08x\n", window_id); |
2314 | 589 | return GEIS_UNKNOWN_ERROR; | 936 | goto done; |
2315 | 590 | } | 937 | } |
2316 | 591 | 938 | ||
2317 | 939 | result = geis_xcb_verify_event_selection(xcb, window_id, device_id, mask_len, mask); | ||
2318 | 940 | if (result == GEIS_STATUS_SUCCESS) | ||
2319 | 592 | { | 941 | { |
2369 | 593 | xcb_gesture_get_selected_events_cookie_t events_cookie; | 942 | geis_xcb_dispatch_gesture_type(instance, gesture_list); |
2321 | 594 | xcb_gesture_get_selected_events_reply_t *events_reply = NULL; | ||
2322 | 595 | xcb_gesture_event_mask_iterator_t events_iterator; | ||
2323 | 596 | unsigned masks_len_reply = 0; | ||
2324 | 597 | unsigned mask_len_reply = 0; | ||
2325 | 598 | uint32_t *mask_reply; | ||
2326 | 599 | |||
2327 | 600 | events_cookie = xcb_gesture_get_selected_events(xcb->connection, | ||
2328 | 601 | xcb->win_info->window_id); | ||
2329 | 602 | events_reply = xcb_gesture_get_selected_events_reply(xcb->connection, | ||
2330 | 603 | events_cookie, | ||
2331 | 604 | &error); | ||
2332 | 605 | if (!events_reply) | ||
2333 | 606 | { | ||
2334 | 607 | geis_debug("failed to receive selected events reply\n"); | ||
2335 | 608 | return GEIS_UNKNOWN_ERROR; | ||
2336 | 609 | } | ||
2337 | 610 | |||
2338 | 611 | masks_len_reply = xcb_gesture_get_selected_events_masks_length(events_reply); | ||
2339 | 612 | if (masks_len_reply != 1) | ||
2340 | 613 | { | ||
2341 | 614 | geis_debug("wrong selected masks length returned: %d\n", masks_len_reply); | ||
2342 | 615 | return GEIS_UNKNOWN_ERROR; | ||
2343 | 616 | } | ||
2344 | 617 | |||
2345 | 618 | events_iterator = xcb_gesture_get_selected_events_masks_iterator(events_reply); | ||
2346 | 619 | if (events_iterator.data->device_id != device_id) | ||
2347 | 620 | { | ||
2348 | 621 | geis_debug("incorrect device id returned by server: %d\n", | ||
2349 | 622 | events_iterator.data->device_id); | ||
2350 | 623 | return GEIS_UNKNOWN_ERROR; | ||
2351 | 624 | } | ||
2352 | 625 | |||
2353 | 626 | mask_len_reply = xcb_gesture_event_mask_mask_data_length(events_iterator.data); | ||
2354 | 627 | if (mask_len_reply != mask_len) | ||
2355 | 628 | { | ||
2356 | 629 | geis_debug("incorrect mask length returned by server: %d\n", | ||
2357 | 630 | mask_len_reply); | ||
2358 | 631 | return GEIS_UNKNOWN_ERROR; | ||
2359 | 632 | } | ||
2360 | 633 | |||
2361 | 634 | mask_reply = xcb_gesture_event_mask_mask_data(events_iterator.data); | ||
2362 | 635 | if (memcmp(mask, mask_reply, mask_len * 4) != 0) | ||
2363 | 636 | { | ||
2364 | 637 | geis_debug("incorrect mask returned by server\n"); | ||
2365 | 638 | return GEIS_UNKNOWN_ERROR; | ||
2366 | 639 | } | ||
2367 | 640 | |||
2368 | 641 | free(events_reply); | ||
2370 | 642 | } | 943 | } |
2371 | 643 | 944 | ||
2372 | 945 | done: | ||
2373 | 946 | free(mask); | ||
2374 | 947 | really_done: | ||
2375 | 948 | return result; | ||
2376 | 949 | } | ||
2377 | 950 | |||
2378 | 951 | |||
2379 | 952 | GeisStatus | ||
2380 | 953 | geis_xcb_input_devices(GeisXcb xcb, GeisInputFuncs *funcs, void *cookie) | ||
2381 | 954 | { | ||
2382 | 955 | xcb->input_funcs = funcs; | ||
2383 | 956 | xcb->input_cookie = cookie; | ||
2384 | 644 | return GEIS_STATUS_SUCCESS; | 957 | return GEIS_STATUS_SUCCESS; |
2385 | 645 | } | 958 | } |
2386 | 959 | |||
2387 | 960 | |||
2388 | 646 | 961 | ||
2389 | === modified file 'libutouch-geis-xcb/geis_xcb.h' | |||
2390 | --- libutouch-geis-xcb/geis_xcb.h 2010-08-11 13:54:54 +0000 | |||
2391 | +++ libutouch-geis-xcb/geis_xcb.h 2010-09-16 16:28:52 +0000 | |||
2392 | @@ -4,18 +4,18 @@ | |||
2393 | 4 | * Copyright 2010 Canonical Ltd. | 4 | * Copyright 2010 Canonical Ltd. |
2394 | 5 | * | 5 | * |
2395 | 6 | * This library is free software; you can redistribute it and/or modify it under | 6 | * This library is free software; you can redistribute it and/or modify it under |
2399 | 7 | * the terms of the GNU Lesser General Public License as published by the Free Software | 7 | * the terms of the GNU Lesser General Public License as published by the Free |
2400 | 8 | * Foundation; either version 3 of the License, or (at your option) any later | 8 | * Software Foundation; either version 3 of the License, or (at your option) any |
2401 | 9 | * version. | 9 | * later version. |
2402 | 10 | * | 10 | * |
2403 | 11 | * This library is distributed in the hope that it will be useful, but WITHOUT | 11 | * This library is distributed in the hope that it will be useful, but WITHOUT |
2404 | 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
2407 | 13 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for | 13 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more |
2408 | 14 | * more details. | 14 | * details. |
2409 | 15 | * | 15 | * |
2410 | 16 | * You should have received a copy of the GNU Lesser General Public License | 16 | * You should have received a copy of the GNU Lesser General Public License |
2413 | 17 | * along with this program; if not, write to the Free Software | 17 | * along with this program; if not, write to the Free Software Foundation, Inc., |
2414 | 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
2415 | 19 | */ | 19 | */ |
2416 | 20 | #ifndef GEIS_XCB_H_ | 20 | #ifndef GEIS_XCB_H_ |
2417 | 21 | #define GEIS_XCB_H_ | 21 | #define GEIS_XCB_H_ |
2418 | @@ -23,17 +23,25 @@ | |||
2419 | 23 | #include "geis_config.h" | 23 | #include "geis_config.h" |
2420 | 24 | #include <geis/geis.h> | 24 | #include <geis/geis.h> |
2421 | 25 | 25 | ||
2427 | 26 | typedef struct _GeisXcb GeisXcb; | 26 | typedef struct _GeisXcb *GeisXcb; |
2428 | 27 | 27 | ||
2429 | 28 | GeisXcb *geis_xcb_get(GeisXcbWinInfo *win_info); | 28 | GeisXcb geis_xcb_new(GeisXcbWinInfo *win_info); |
2430 | 29 | 29 | ||
2431 | 30 | GeisStatus geis_xcb_subscribe(GeisInstance instance, | 30 | GeisInstance geis_xcb_create_instance(GeisXcb xcb, uint32_t window_id); |
2432 | 31 | |||
2433 | 32 | GeisStatus geis_xcb_input_devices(GeisXcb xcb, | ||
2434 | 33 | GeisInputFuncs *funcs, | ||
2435 | 34 | void *cookie); | ||
2436 | 35 | |||
2437 | 36 | GeisStatus geis_xcb_subscribe(GeisXcb xcb, | ||
2438 | 37 | GeisInstance instance, | ||
2439 | 38 | uint16_t device_id, | ||
2440 | 31 | const char **gesture_list); | 39 | const char **gesture_list); |
2441 | 32 | 40 | ||
2447 | 33 | int geis_xcb_fd(GeisXcb* xcb); | 41 | int geis_xcb_fd(GeisXcb xcb); |
2448 | 34 | 42 | ||
2449 | 35 | void geis_xcb_dispatch(GeisInstance instance); | 43 | void geis_xcb_dispatch(GeisXcb xcb); |
2450 | 36 | 44 | ||
2451 | 37 | void geis_xcb_free(GeisXcb *xcb); | 45 | void geis_xcb_free(GeisXcb xcb); |
2452 | 38 | 46 | ||
2453 | 39 | #endif /* GEIS_XCB_H_ */ | 47 | #endif /* GEIS_XCB_H_ */ |
2454 | 40 | 48 | ||
2455 | === modified file 'testsuite/Makefile.in' | |||
2456 | --- testsuite/Makefile.in 2010-08-20 22:03:52 +0000 | |||
2457 | +++ testsuite/Makefile.in 2010-09-16 16:28:52 +0000 | |||
2458 | @@ -158,11 +158,15 @@ | |||
2459 | 158 | SHELL = @SHELL@ | 158 | SHELL = @SHELL@ |
2460 | 159 | STRIP = @STRIP@ | 159 | STRIP = @STRIP@ |
2461 | 160 | VERSION = @VERSION@ | 160 | VERSION = @VERSION@ |
2462 | 161 | X11XCB_CFLAGS = @X11XCB_CFLAGS@ | ||
2463 | 162 | X11XCB_LIBS = @X11XCB_LIBS@ | ||
2464 | 161 | XCBINCLUDEDIR = @XCBINCLUDEDIR@ | 163 | XCBINCLUDEDIR = @XCBINCLUDEDIR@ |
2465 | 162 | XCBPROTO_XCBINCLUDEDIR = @XCBPROTO_XCBINCLUDEDIR@ | 164 | XCBPROTO_XCBINCLUDEDIR = @XCBPROTO_XCBINCLUDEDIR@ |
2466 | 163 | XCBPROTO_XCBPYTHONDIR = @XCBPROTO_XCBPYTHONDIR@ | 165 | XCBPROTO_XCBPYTHONDIR = @XCBPROTO_XCBPYTHONDIR@ |
2467 | 164 | XCB_CFLAGS = @XCB_CFLAGS@ | 166 | XCB_CFLAGS = @XCB_CFLAGS@ |
2468 | 165 | XCB_LIBS = @XCB_LIBS@ | 167 | XCB_LIBS = @XCB_LIBS@ |
2469 | 168 | XI2_CFLAGS = @XI2_CFLAGS@ | ||
2470 | 169 | XI2_LIBS = @XI2_LIBS@ | ||
2471 | 166 | abs_builddir = @abs_builddir@ | 170 | abs_builddir = @abs_builddir@ |
2472 | 167 | abs_srcdir = @abs_srcdir@ | 171 | abs_srcdir = @abs_srcdir@ |
2473 | 168 | abs_top_builddir = @abs_top_builddir@ | 172 | abs_top_builddir = @abs_top_builddir@ |
2474 | 169 | 173 | ||
2475 | === modified file 'testsuite/geistest/Makefile.in' | |||
2476 | --- testsuite/geistest/Makefile.in 2010-08-20 22:03:52 +0000 | |||
2477 | +++ testsuite/geistest/Makefile.in 2010-09-16 16:28:52 +0000 | |||
2478 | @@ -141,11 +141,15 @@ | |||
2479 | 141 | SHELL = @SHELL@ | 141 | SHELL = @SHELL@ |
2480 | 142 | STRIP = @STRIP@ | 142 | STRIP = @STRIP@ |
2481 | 143 | VERSION = @VERSION@ | 143 | VERSION = @VERSION@ |
2482 | 144 | X11XCB_CFLAGS = @X11XCB_CFLAGS@ | ||
2483 | 145 | X11XCB_LIBS = @X11XCB_LIBS@ | ||
2484 | 144 | XCBINCLUDEDIR = @XCBINCLUDEDIR@ | 146 | XCBINCLUDEDIR = @XCBINCLUDEDIR@ |
2485 | 145 | XCBPROTO_XCBINCLUDEDIR = @XCBPROTO_XCBINCLUDEDIR@ | 147 | XCBPROTO_XCBINCLUDEDIR = @XCBPROTO_XCBINCLUDEDIR@ |
2486 | 146 | XCBPROTO_XCBPYTHONDIR = @XCBPROTO_XCBPYTHONDIR@ | 148 | XCBPROTO_XCBPYTHONDIR = @XCBPROTO_XCBPYTHONDIR@ |
2487 | 147 | XCB_CFLAGS = @XCB_CFLAGS@ | 149 | XCB_CFLAGS = @XCB_CFLAGS@ |
2488 | 148 | XCB_LIBS = @XCB_LIBS@ | 150 | XCB_LIBS = @XCB_LIBS@ |
2489 | 151 | XI2_CFLAGS = @XI2_CFLAGS@ | ||
2490 | 152 | XI2_LIBS = @XI2_LIBS@ | ||
2491 | 149 | abs_builddir = @abs_builddir@ | 153 | abs_builddir = @abs_builddir@ |
2492 | 150 | abs_srcdir = @abs_srcdir@ | 154 | abs_srcdir = @abs_srcdir@ |
2493 | 151 | abs_top_builddir = @abs_top_builddir@ | 155 | abs_top_builddir = @abs_top_builddir@ |
2494 | 152 | 156 | ||
2495 | === modified file 'testsuite/geistest/geistest.c' | |||
2496 | --- testsuite/geistest/geistest.c 2010-08-11 13:54:54 +0000 | |||
2497 | +++ testsuite/geistest/geistest.c 2010-09-16 16:28:52 +0000 | |||
2498 | @@ -23,6 +23,8 @@ | |||
2499 | 23 | #include <stdlib.h> | 23 | #include <stdlib.h> |
2500 | 24 | #include <string.h> | 24 | #include <string.h> |
2501 | 25 | #include <sys/select.h> | 25 | #include <sys/select.h> |
2502 | 26 | #include <unistd.h> | ||
2503 | 27 | #include <xcb/xcb.h> | ||
2504 | 26 | 28 | ||
2505 | 27 | 29 | ||
2506 | 28 | static void | 30 | static void |
2507 | @@ -51,6 +53,24 @@ | |||
2508 | 51 | 53 | ||
2509 | 52 | 54 | ||
2510 | 53 | static void | 55 | static void |
2511 | 56 | input_device_added(void *cookie, GeisInputDeviceId device_id, void *attrs) | ||
2512 | 57 | { | ||
2513 | 58 | } | ||
2514 | 59 | |||
2515 | 60 | |||
2516 | 61 | static void | ||
2517 | 62 | input_device_changed(void *cookie, GeisInputDeviceId device_id, void *attrs) | ||
2518 | 63 | { | ||
2519 | 64 | } | ||
2520 | 65 | |||
2521 | 66 | |||
2522 | 67 | static void | ||
2523 | 68 | input_device_removed(void *cookie, GeisInputDeviceId device_id, void *attrs) | ||
2524 | 69 | { | ||
2525 | 70 | } | ||
2526 | 71 | |||
2527 | 72 | |||
2528 | 73 | static void | ||
2529 | 54 | gesture_added(void *cookie, | 74 | gesture_added(void *cookie, |
2530 | 55 | GeisGestureType gesture_type, | 75 | GeisGestureType gesture_type, |
2531 | 56 | GeisGestureId gesture_id, | 76 | GeisGestureId gesture_id, |
2532 | @@ -116,6 +136,12 @@ | |||
2533 | 116 | } | 136 | } |
2534 | 117 | 137 | ||
2535 | 118 | 138 | ||
2536 | 139 | GeisInputFuncs input_funcs = { | ||
2537 | 140 | input_device_added, | ||
2538 | 141 | input_device_changed, | ||
2539 | 142 | input_device_removed | ||
2540 | 143 | }; | ||
2541 | 144 | |||
2542 | 119 | GeisGestureFuncs gesture_funcs = { | 145 | GeisGestureFuncs gesture_funcs = { |
2543 | 120 | gesture_added, | 146 | gesture_added, |
2544 | 121 | gesture_removed, | 147 | gesture_removed, |
2545 | @@ -128,22 +154,33 @@ | |||
2546 | 128 | int | 154 | int |
2547 | 129 | parse_opts(int argc, char* argv[], uint32_t *window_id) | 155 | parse_opts(int argc, char* argv[], uint32_t *window_id) |
2548 | 130 | { | 156 | { |
2553 | 131 | if (argc != 2) | 157 | int opt; |
2554 | 132 | return 0; | 158 | |
2555 | 133 | 159 | while ((opt = getopt(argc, argv, "w:")) != -1) | |
2556 | 134 | *window_id = strtol(argv[1], NULL, 0); | 160 | { |
2557 | 161 | switch (opt) | ||
2558 | 162 | { | ||
2559 | 163 | case 'w': | ||
2560 | 164 | *window_id = strtol(optarg, NULL, 0); | ||
2561 | 165 | break; | ||
2562 | 166 | |||
2563 | 167 | default: | ||
2564 | 168 | return 0; | ||
2565 | 169 | } | ||
2566 | 170 | } | ||
2567 | 171 | |||
2568 | 135 | return 1; | 172 | return 1; |
2569 | 136 | } | 173 | } |
2570 | 137 | 174 | ||
2571 | 138 | 175 | ||
2574 | 139 | int | 176 | static GeisInstance |
2575 | 140 | main(int argc, char* argv[]) | 177 | subscribe_window(uint32_t window_id) |
2576 | 141 | { | 178 | { |
2577 | 142 | GeisStatus status = GEIS_UNKNOWN_ERROR; | 179 | GeisStatus status = GEIS_UNKNOWN_ERROR; |
2578 | 143 | GeisXcbWinInfo xcb_win_info = { | 180 | GeisXcbWinInfo xcb_win_info = { |
2579 | 144 | .display_name = NULL, | 181 | .display_name = NULL, |
2580 | 145 | .screenp = NULL, | 182 | .screenp = NULL, |
2582 | 146 | .window_id = 0x296 | 183 | .window_id = window_id |
2583 | 147 | }; | 184 | }; |
2584 | 148 | GeisWinInfo win_info = { | 185 | GeisWinInfo win_info = { |
2585 | 149 | GEIS_XCB_FULL_WINDOW, | 186 | GEIS_XCB_FULL_WINDOW, |
2586 | @@ -151,32 +188,18 @@ | |||
2587 | 151 | }; | 188 | }; |
2588 | 152 | GeisInstance instance; | 189 | GeisInstance instance; |
2589 | 153 | 190 | ||
2590 | 154 | if (!parse_opts(argc, argv, &xcb_win_info.window_id)) | ||
2591 | 155 | { | ||
2592 | 156 | fprintf(stderr, "usage: %s windowid\n", argv[0]); | ||
2593 | 157 | return -1; | ||
2594 | 158 | } | ||
2595 | 159 | |||
2596 | 160 | status = geis_init(&win_info, &instance); | 191 | status = geis_init(&win_info, &instance); |
2597 | 161 | if (status != GEIS_STATUS_SUCCESS) | 192 | if (status != GEIS_STATUS_SUCCESS) |
2598 | 162 | { | 193 | { |
2599 | 163 | fprintf(stderr, "error in geis_init\n"); | 194 | fprintf(stderr, "error in geis_init\n"); |
2616 | 164 | return 1; | 195 | return NULL; |
2617 | 165 | } | 196 | } |
2618 | 166 | 197 | ||
2619 | 167 | status = geis_configuration_supported(instance, GEIS_CONFIG_UNIX_FD); | 198 | status = geis_input_devices(instance, &input_funcs, NULL); |
2620 | 168 | if (status != GEIS_STATUS_SUCCESS) | 199 | if (status != GEIS_STATUS_SUCCESS) |
2621 | 169 | { | 200 | { |
2622 | 170 | fprintf(stderr, "GEIS does not support Unix fd\n"); | 201 | fprintf(stderr, "error subscribing to input devices\n"); |
2623 | 171 | return 1; | 202 | return NULL; |
2608 | 172 | } | ||
2609 | 173 | |||
2610 | 174 | int fd = -1; | ||
2611 | 175 | status = geis_configuration_get_value(instance, GEIS_CONFIG_UNIX_FD, &fd); | ||
2612 | 176 | if (status != GEIS_STATUS_SUCCESS) | ||
2613 | 177 | { | ||
2614 | 178 | fprintf(stderr, "error retrieving GEIS fd\n"); | ||
2615 | 179 | return 1; | ||
2624 | 180 | } | 203 | } |
2625 | 181 | 204 | ||
2626 | 182 | status = geis_subscribe(instance, | 205 | status = geis_subscribe(instance, |
2627 | @@ -187,7 +210,155 @@ | |||
2628 | 187 | if (status != GEIS_STATUS_SUCCESS) | 210 | if (status != GEIS_STATUS_SUCCESS) |
2629 | 188 | { | 211 | { |
2630 | 189 | fprintf(stderr, "error subscribing to gestures\n"); | 212 | fprintf(stderr, "error subscribing to gestures\n"); |
2632 | 190 | return 1; | 213 | return NULL; |
2633 | 214 | } | ||
2634 | 215 | |||
2635 | 216 | return instance; | ||
2636 | 217 | } | ||
2637 | 218 | |||
2638 | 219 | |||
2639 | 220 | static size_t | ||
2640 | 221 | subscribe_windows_preorder(xcb_connection_t *xcb, | ||
2641 | 222 | xcb_window_t window, | ||
2642 | 223 | size_t instance_table_size, | ||
2643 | 224 | GeisInstance **instance_table) | ||
2644 | 225 | { | ||
2645 | 226 | ++instance_table_size; | ||
2646 | 227 | GeisInstance *new_instance_table; | ||
2647 | 228 | new_instance_table = realloc(*instance_table, | ||
2648 | 229 | instance_table_size * sizeof(GeisInstance)); | ||
2649 | 230 | new_instance_table[instance_table_size-1] = subscribe_window(window); | ||
2650 | 231 | if (!new_instance_table[instance_table_size-1]) | ||
2651 | 232 | { | ||
2652 | 233 | fprintf(stderr, "error creating geis instance for window 0x%08x\n", window); | ||
2653 | 234 | free(new_instance_table); | ||
2654 | 235 | instance_table_size = 0; | ||
2655 | 236 | goto error_exit; | ||
2656 | 237 | } | ||
2657 | 238 | |||
2658 | 239 | xcb_generic_error_t *error; | ||
2659 | 240 | xcb_query_tree_cookie_t tree_cookie = xcb_query_tree(xcb, window); | ||
2660 | 241 | xcb_query_tree_reply_t *tree_reply = xcb_query_tree_reply(xcb, | ||
2661 | 242 | tree_cookie, | ||
2662 | 243 | &error); | ||
2663 | 244 | if (!tree_reply) | ||
2664 | 245 | { | ||
2665 | 246 | fprintf(stderr, "failed to query tree for window 0x%x\n", window); | ||
2666 | 247 | goto error_exit; | ||
2667 | 248 | } | ||
2668 | 249 | |||
2669 | 250 | int num_children = xcb_query_tree_children_length(tree_reply); | ||
2670 | 251 | if (num_children <= 0) | ||
2671 | 252 | goto tree_exit; | ||
2672 | 253 | |||
2673 | 254 | xcb_window_t *children = xcb_query_tree_children(tree_reply); | ||
2674 | 255 | if (!children) | ||
2675 | 256 | { | ||
2676 | 257 | fprintf(stderr, "failed to retrieve children of window 0x%x\n", window); | ||
2677 | 258 | goto tree_exit; | ||
2678 | 259 | } | ||
2679 | 260 | |||
2680 | 261 | int i; | ||
2681 | 262 | for (i = 0; i < num_children; i++) | ||
2682 | 263 | { | ||
2683 | 264 | instance_table_size = subscribe_windows_preorder(xcb, | ||
2684 | 265 | children[i], | ||
2685 | 266 | instance_table_size, | ||
2686 | 267 | &new_instance_table); | ||
2687 | 268 | if (instance_table_size == 0) | ||
2688 | 269 | break; | ||
2689 | 270 | } | ||
2690 | 271 | |||
2691 | 272 | tree_exit: | ||
2692 | 273 | free(tree_reply); | ||
2693 | 274 | error_exit: | ||
2694 | 275 | *instance_table = new_instance_table; | ||
2695 | 276 | return instance_table_size; | ||
2696 | 277 | } | ||
2697 | 278 | |||
2698 | 279 | |||
2699 | 280 | static size_t | ||
2700 | 281 | subscribe_all_windows(GeisInstance **instance_table) | ||
2701 | 282 | { | ||
2702 | 283 | int instance_table_size = 0; | ||
2703 | 284 | |||
2704 | 285 | xcb_connection_t *xcb = xcb_connect(NULL, NULL); | ||
2705 | 286 | if (!xcb) { | ||
2706 | 287 | fprintf(stderr, "error connecting to X server\n"); | ||
2707 | 288 | return -1; | ||
2708 | 289 | } | ||
2709 | 290 | |||
2710 | 291 | const xcb_setup_t *setup = xcb_get_setup(xcb); | ||
2711 | 292 | if (!setup) | ||
2712 | 293 | { | ||
2713 | 294 | fprintf(stderr, "error getting xcb setup\n"); | ||
2714 | 295 | return -1; | ||
2715 | 296 | } | ||
2716 | 297 | |||
2717 | 298 | xcb_screen_iterator_t screen = xcb_setup_roots_iterator(setup); | ||
2718 | 299 | while (screen.rem) | ||
2719 | 300 | { | ||
2720 | 301 | instance_table_size = subscribe_windows_preorder(xcb, | ||
2721 | 302 | screen.data->root, | ||
2722 | 303 | instance_table_size, | ||
2723 | 304 | instance_table); | ||
2724 | 305 | |||
2725 | 306 | xcb_screen_next(&screen); | ||
2726 | 307 | } | ||
2727 | 308 | |||
2728 | 309 | xcb_disconnect(xcb); | ||
2729 | 310 | return instance_table_size; | ||
2730 | 311 | } | ||
2731 | 312 | |||
2732 | 313 | int | ||
2733 | 314 | main(int argc, char* argv[]) | ||
2734 | 315 | { | ||
2735 | 316 | int result = -1; | ||
2736 | 317 | uint32_t window_id = 0; | ||
2737 | 318 | int fd = -1; | ||
2738 | 319 | GeisStatus status = GEIS_UNKNOWN_ERROR; | ||
2739 | 320 | GeisInstance *instance_table = NULL; | ||
2740 | 321 | size_t instance_table_size = 0; | ||
2741 | 322 | |||
2742 | 323 | if (!parse_opts(argc, argv, &window_id)) | ||
2743 | 324 | { | ||
2744 | 325 | fprintf(stderr, "usage: %s windowid\n", argv[0]); | ||
2745 | 326 | return -1; | ||
2746 | 327 | } | ||
2747 | 328 | |||
2748 | 329 | if (window_id != 0) | ||
2749 | 330 | { | ||
2750 | 331 | instance_table_size = 1; | ||
2751 | 332 | instance_table = calloc(instance_table_size, sizeof(GeisInstance)); | ||
2752 | 333 | instance_table[0] = subscribe_window(window_id); | ||
2753 | 334 | if (!instance_table[0]) | ||
2754 | 335 | { | ||
2755 | 336 | fprintf(stderr, "can not continue, exiting....\n"); | ||
2756 | 337 | goto error_exit; | ||
2757 | 338 | } | ||
2758 | 339 | } | ||
2759 | 340 | else | ||
2760 | 341 | { | ||
2761 | 342 | instance_table_size = subscribe_all_windows(&instance_table); | ||
2762 | 343 | if (instance_table_size == 0) | ||
2763 | 344 | { | ||
2764 | 345 | fprintf(stderr, "can not continue, exiting....\n"); | ||
2765 | 346 | goto error_exit; | ||
2766 | 347 | } | ||
2767 | 348 | } | ||
2768 | 349 | |||
2769 | 350 | status = geis_configuration_supported(instance_table[0], GEIS_CONFIG_UNIX_FD); | ||
2770 | 351 | if (status != GEIS_STATUS_SUCCESS) | ||
2771 | 352 | { | ||
2772 | 353 | fprintf(stderr, "GEIS does not support Unix fd\n"); | ||
2773 | 354 | goto fail_exit; | ||
2774 | 355 | } | ||
2775 | 356 | |||
2776 | 357 | status = geis_configuration_get_value(instance_table[0], GEIS_CONFIG_UNIX_FD, &fd); | ||
2777 | 358 | if (status != GEIS_STATUS_SUCCESS) | ||
2778 | 359 | { | ||
2779 | 360 | fprintf(stderr, "error retrieving GEIS fd\n"); | ||
2780 | 361 | goto fail_exit; | ||
2781 | 191 | } | 362 | } |
2782 | 192 | 363 | ||
2783 | 193 | while(1) | 364 | while(1) |
2784 | @@ -204,10 +375,24 @@ | |||
2785 | 204 | 375 | ||
2786 | 205 | if (FD_ISSET(fd, &read_fds)) | 376 | if (FD_ISSET(fd, &read_fds)) |
2787 | 206 | { | 377 | { |
2793 | 207 | geis_event_dispatch(instance); | 378 | geis_event_dispatch(instance_table[0]); |
2794 | 208 | } | 379 | } |
2795 | 209 | } | 380 | } |
2796 | 210 | 381 | ||
2797 | 211 | geis_finish(instance); | 382 | fail_exit: |
2798 | 383 | { | ||
2799 | 384 | int i; | ||
2800 | 385 | for (i = 0; i < instance_table_size; ++i) | ||
2801 | 386 | { | ||
2802 | 387 | geis_finish(instance_table[i]); | ||
2803 | 388 | } | ||
2804 | 389 | } | ||
2805 | 390 | |||
2806 | 391 | error_exit: | ||
2807 | 392 | if (instance_table_size > 0) | ||
2808 | 393 | { | ||
2809 | 394 | free(instance_table); | ||
2810 | 395 | } | ||
2811 | 396 | return result; | ||
2812 | 212 | } | 397 | } |
2813 | 213 | 398 |
Look ok now. :-)