Merge lp:~oif-packaging/libgrip/real-020 into lp:libgrip/quantal

Proposed by Jussi Pakkanen
Status: Merged
Merged at revision: 18
Proposed branch: lp:~oif-packaging/libgrip/real-020
Merge into: lp:libgrip/quantal
Diff against target: 2393 lines (+955/-620)
22 files modified
AUTHORS (+1/-0)
ChangeLog (+219/-0)
Makefile.am (+2/-5)
Makefile.in (+2/-5)
configure (+42/-42)
configure.ac (+4/-4)
debian/changelog (+7/-0)
debian/control (+15/-12)
debian/gir1.2-grip.install (+1/-1)
debian/libgrip-dev.install (+1/-1)
examples/rectangle-mover/Makefile.am (+1/-1)
examples/rectangle-mover/Makefile.in (+2/-2)
examples/rectangle-mover/gesture.c (+87/-55)
libgrip.pc.in (+3/-3)
src/Makefile.am (+12/-12)
src/Makefile.in (+22/-24)
src/grip.h (+3/-3)
src/gripgesturemanager.c (+493/-444)
src/gripgesturemanager.h (+16/-3)
src/griptypebuiltins.c (+15/-0)
src/griptypebuiltins.h.in (+3/-3)
src/libgrip.ver (+4/-0)
To merge this branch: bzr merge lp:~oif-packaging/libgrip/real-020
Reviewer Review Type Date Requested Status
OIF Packaging Pending
Review via email: mp+67536@code.launchpad.net

Description of the change

Packaging update to 0.2.0. Haven't actually tried building it yet, though...

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 'AUTHORS'
2--- AUTHORS 2011-03-23 18:20:10 +0000
3+++ AUTHORS 2011-07-11 12:13:41 +0000
4@@ -4,6 +4,7 @@
5 Chase Douglas
6 Cody Russell
7 Duncan McGreggor
8+ Jussi Pakkanen
9 Ken VanDine
10 Kevin Wells
11 Stephen M. Webb
12
13=== modified file 'ChangeLog'
14--- ChangeLog 2011-03-23 18:20:10 +0000
15+++ ChangeLog 2011-07-11 12:13:41 +0000
16@@ -1,5 +1,224 @@
17 # Generated by Makefile. Do not edit.
18
19+2011-07-11 Jussi Pakkanen <jussi.pakkanen@canonical.com>
20+
21+ Merged device separation branch.
22+
23+2011-07-08 Jussi Pakkanen <jussi.pakkanen@canonical.com>
24+
25+ Drop libgrip element from pkg-config file.
26+
27+2011-07-07 Jussi Pakkanen <jussi.pakkanen@canonical.com>
28+
29+ Update Geis dependency info.
30+
31+2011-06-30 Jussi Pakkanen <jussi.pakkanen@canonical.com>
32+
33+ Fix exit crashing bug.
34+
35+2011-06-29 Jussi Pakkanen <jussi.pakkanen@canonical.com>
36+
37+ Do not subscribe if the list of devices is empty.
38+
39+2011-06-29 Jussi Pakkanen <jussi.pakkanen@canonical.com>
40+
41+ Code hygiene additions.
42+
43+2011-06-22 Jussi Pakkanen <jussi.pakkanen@canonical.com>
44+
45+ If clause simplification.
46+
47+2011-06-20 Jussi Pakkanen <jussi.pakkanen@canonical.com>
48+
49+ Merged changes in trunk.
50+
51+2011-06-20 Jussi Pakkanen <jussi.pakkanen@canonical.com>
52+
53+ Work on separating different device types to their own subscriptions.
54+
55+2011-06-20 Jussi Pakkanen <jussi.pakkanen@canonical.com>
56+
57+ Reordered function arguments for consistency.
58+
59+2011-06-20 Jussi Pakkanen <jussi.pakkanen@canonical.com>
60+
61+ Extract binding to a function.
62+
63+2011-06-20 Jussi Pakkanen <jussi.pakkanen@canonical.com>
64+
65+ Extract registration to a function.
66+
67+2011-06-20 Jussi Pakkanen <jussi.pakkanen@canonical.com>
68+
69+ Merged build fixes.
70+
71+2011-06-20 Jussi Pakkanen <jussi.pakkanen@canonical.com>
72+
73+ Fixed documentation for register_window.
74+
75+2011-06-20 Jussi Pakkanen <jussi.pakkanen@canonical.com>
76+
77+ Fix registration calls.
78+
79+2011-06-20 Jussi Pakkanen <jussi.pakkanen@canonical.com>
80+
81+ Removed circular dependency.
82+
83+2011-06-17 Chase Douglas <chase.douglas@ubuntu.com>
84+
85+ Merge remove-version branch to remove version from library name
86+
87+2011-06-14 Chase Douglas <chase.douglas@ubuntu.com>
88+
89+ Remove the version number from the library name
90+
91+ This will make it easier to maintain since we only plan to support one
92+ version of libgrip at any time.
93+
94+2011-06-17 Jussi Pakkanen <jussi.pakkanen@canonical.com>
95+
96+ Hide all Autotools garbage from bzr st.
97+
98+2011-06-17 Chase Douglas <chase.douglas@ubuntu.com>
99+
100+ Merge device class types subscription changes
101+
102+2011-06-17 Chase Douglas <chase.douglas@ubuntu.com>
103+
104+ Remove GRIP_DEVICE_ALL from GripDeviceType enum
105+
106+2011-06-14 Chase Douglas <chase.douglas@ubuntu.com>
107+
108+ Bump the version to 0.2.0
109+
110+ This brings with it API and ABI breakage
111+
112+2011-06-14 Chase Douglas <chase.douglas@ubuntu.com>
113+
114+ Move devices array allocation to object init time from construction time
115+
116+2011-06-14 Chase Douglas <chase.douglas@ubuntu.com>
117+
118+ Rework GRIP_DEVICE_ALL so it is the union of all the device types
119+
120+2011-06-13 Chase Douglas <chase.douglas@ubuntu.com>
121+
122+ Add argument to specify device type when registering for gestures
123+
124+ Possible values:
125+
126+ * GRIP_DEVICE_ALL
127+
128+ or the logical OR'ing of:
129+
130+ * GRIP_DEVICE_TOUCHSCREEN
131+ * GRIP_DEVICE_TOUCHPAD
132+ * GRIP_DEVICE_INDEPENDENT
133+
134+2011-06-13 Chase Douglas <chase.douglas@ubuntu.com>
135+
136+ Get device types at initialization time
137+
138+2011-06-17 Jussi Pakkanen <jussi.pakkanen@canonical.com>
139+
140+ Merged unsubscribe branch.
141+
142+2011-06-16 Jussi Pakkanen <jussi.pakkanen@canonical.com>
143+
144+ Terminate Geis instance on unregistering.
145+
146+2011-06-16 Jussi Pakkanen <jussi.pakkanen@canonical.com>
147+
148+ Re-subscribe to gestures. Doesn't work yet for some reason.
149+
150+2011-06-16 Jussi Pakkanen <jussi.pakkanen@canonical.com>
151+
152+ Prepare version-script for the next release.
153+
154+2011-06-16 Jussi Pakkanen <jussi.pakkanen@canonical.com>
155+
156+ Free the registration object.
157+
158+2011-06-16 Jussi Pakkanen <jussi.pakkanen@canonical.com>
159+
160+ Unregistering works for some values of works.
161+
162+2011-06-16 Jussi Pakkanen <jussi.pakkanen@canonical.com>
163+
164+ Minor refactoring.
165+
166+2011-06-16 Jussi Pakkanen <jussi.pakkanen@canonical.com>
167+
168+ Refactored main program so that unregistering is possible.
169+
170+2011-06-16 Jussi Pakkanen <jussi.pakkanen@canonical.com>
171+
172+ Renamed element for clarity.
173+
174+2011-06-16 Jussi Pakkanen <jussi.pakkanen@canonical.com>
175+
176+ GUI has a button to enable and disable gestures.
177+
178+2011-06-16 Jussi Pakkanen <jussi.pakkanen@canonical.com>
179+
180+ Move subscription to its own function.
181+
182+2011-06-16 Jussi Pakkanen <jussi.pakkanen@canonical.com>
183+
184+ Merged deduplication.
185+
186+2011-06-15 Jussi Pakkanen <jussi.pakkanen@canonical.com>
187+
188+ Put braces according to coding standards.
189+
190+2011-06-15 Jussi Pakkanen <jussi.pakkanen@canonical.com>
191+
192+ Removed useless duplication with a common function.
193+
194+2011-06-09 Jussi Pakkanen <jussi.pakkanen@canonical.com>
195+
196+ Merged GTK3 branch.
197+
198+2011-05-23 Jussi Pakkanen <jussi.pakkanen@canonical.com>
199+
200+ Fix dependencies in pkg-config file.
201+
202+2011-05-19 Jussi Pakkanen <jussi.pakkanen@canonical.com>
203+
204+ Use GTK3 drawing model.
205+
206+2011-05-19 Jussi Pakkanen <jussi.pakkanen@canonical.com>
207+
208+ Final accessor function change.
209+
210+2011-05-19 Jussi Pakkanen <jussi.pakkanen@canonical.com>
211+
212+ Use correct X backend call.
213+
214+2011-05-19 Jussi Pakkanen <jussi.pakkanen@canonical.com>
215+
216+ Convert GtkObject to GtkWidget.
217+
218+2011-05-19 Jussi Pakkanen <jussi.pakkanen@canonical.com>
219+
220+ Converted struct accesses to accessor functions.
221+
222+2011-06-07 Jussi Pakkanen <jussi.pakkanen@canonical.com>
223+
224+ Merged underscore 2 fix.
225+
226+2011-06-07 Jussi Pakkanen <jussi.pakkanen@canonical.com>
227+
228+ More underscore removal.
229+
230+2011-05-31 Jussi Pakkanen <jussi.pakkanen@canonical.com>
231+
232+ Merged underscore removal.
233+
234+2011-05-31 Jussi Pakkanen <jussi.pakkanen@canonical.com>
235+
236+ Removed double underscores.
237+
238 2011-03-23 Chase Douglas <chase.douglas@ubuntu.com>
239
240 Release version 0.1.7
241
242=== modified file 'Makefile.am'
243--- Makefile.am 2011-03-23 18:20:10 +0000
244+++ Makefile.am 2011-07-11 12:13:41 +0000
245@@ -1,12 +1,9 @@
246 SUBDIRS = src bindings examples/rectangle-mover
247
248-libgrip-0.1.pc: libgrip.pc
249- cp -f libgrip.pc libgrip-0.1.pc
250-
251 pkgconfigdir = $(libdir)/pkgconfig
252-pkgconfig_DATA = libgrip-0.1.pc
253+pkgconfig_DATA = libgrip.pc
254
255-CLEANFILES = libgrip-0.1.pc
256+CLEANFILES = libgrip.pc
257 DISTCLEANFILES = libgrip.pc grip*.tar.gz
258 EXTRA_DIST = libgrip.pc.in m4/introspection.m4
259
260
261=== modified file 'Makefile.in'
262--- Makefile.in 2011-03-23 18:20:10 +0000
263+++ Makefile.in 2011-07-11 12:13:41 +0000
264@@ -285,8 +285,8 @@
265 top_srcdir = @top_srcdir@
266 SUBDIRS = src bindings examples/rectangle-mover
267 pkgconfigdir = $(libdir)/pkgconfig
268-pkgconfig_DATA = libgrip-0.1.pc
269-CLEANFILES = libgrip-0.1.pc
270+pkgconfig_DATA = libgrip.pc
271+CLEANFILES = libgrip.pc
272 DISTCLEANFILES = libgrip.pc grip*.tar.gz
273 EXTRA_DIST = libgrip.pc.in m4/introspection.m4
274 ACLOCAL_AMFLAGS = -I m4
275@@ -817,9 +817,6 @@
276 uninstall uninstall-am uninstall-pkgconfigDATA
277
278
279-libgrip-0.1.pc: libgrip.pc
280- cp -f libgrip.pc libgrip-0.1.pc
281-
282 dist-hook:
283 @if test -d "$(top_srcdir)/.bzr"; \
284 then \
285
286=== modified file 'configure'
287--- configure 2011-03-23 18:20:10 +0000
288+++ configure 2011-07-11 12:13:41 +0000
289@@ -1,6 +1,6 @@
290 #! /bin/sh
291 # Guess values for system-dependent variables and create Makefiles.
292-# Generated by GNU Autoconf 2.67 for grip 0.1.7.
293+# Generated by GNU Autoconf 2.67 for grip 0.2.0.
294 #
295 # Report bugs to <https://bugs.launchpad.net/libgrip>.
296 #
297@@ -701,8 +701,8 @@
298 # Identity of this package.
299 PACKAGE_NAME='grip'
300 PACKAGE_TARNAME='grip'
301-PACKAGE_VERSION='0.1.7'
302-PACKAGE_STRING='grip 0.1.7'
303+PACKAGE_VERSION='0.2.0'
304+PACKAGE_STRING='grip 0.2.0'
305 PACKAGE_BUGREPORT='https://bugs.launchpad.net/libgrip'
306 PACKAGE_URL=''
307
308@@ -1481,7 +1481,7 @@
309 # Omit some internal or obsolete options to make the list less imposing.
310 # This message is too long to be a string in the A/UX 3.1 sh.
311 cat <<_ACEOF
312-\`configure' configures grip 0.1.7 to adapt to many kinds of systems.
313+\`configure' configures grip 0.2.0 to adapt to many kinds of systems.
314
315 Usage: $0 [OPTION]... [VAR=VALUE]...
316
317@@ -1551,7 +1551,7 @@
318
319 if test -n "$ac_init_help"; then
320 case $ac_init_help in
321- short | recursive ) echo "Configuration of grip 0.1.7:";;
322+ short | recursive ) echo "Configuration of grip 0.2.0:";;
323 esac
324 cat <<\_ACEOF
325
326@@ -1671,7 +1671,7 @@
327 test -n "$ac_init_help" && exit $ac_status
328 if $ac_init_version; then
329 cat <<\_ACEOF
330-grip configure 0.1.7
331+grip configure 0.2.0
332 generated by GNU Autoconf 2.67
333
334 Copyright (C) 2010 Free Software Foundation, Inc.
335@@ -2040,7 +2040,7 @@
336 This file contains any messages produced by compilers while
337 running configure, to aid debugging if configure makes a mistake.
338
339-It was created by grip $as_me 0.1.7, which was
340+It was created by grip $as_me 0.2.0, which was
341 generated by GNU Autoconf 2.67. Invocation command line was
342
343 $ $0 $@
344@@ -2875,7 +2875,7 @@
345
346 # Define the identity of the package.
347 PACKAGE='grip'
348- VERSION='0.1.7'
349+ VERSION='0.2.0'
350
351
352 cat >>confdefs.h <<_ACEOF
353@@ -3127,20 +3127,20 @@
354
355
356 GRIP_MAJOR_VERSION=0
357-GRIP_MINOR_VERSION=1
358-GRIP_MICRO_VERSION=7
359-GRIP_VERSION=0.1.7
360-
361-
362-
363-
364-
365-
366-
367-
368-GRIP_LT_CURRENT=107
369+GRIP_MINOR_VERSION=2
370+GRIP_MICRO_VERSION=0
371+GRIP_VERSION=0.2.0
372+
373+
374+
375+
376+
377+
378+
379+
380+GRIP_LT_CURRENT=200
381 GRIP_LT_REV=0
382-GRIP_LT_AGE=107
383+GRIP_LT_AGE=200
384 GRIP_LT_VERSION="$GRIP_LT_CURRENT:$GRIP_LT_REV:$GRIP_LT_AGE"
385 GRIP_LT_LDFLAGS="-version-info $GRIP_LT_VERSION"
386
387@@ -11416,12 +11416,12 @@
388 pkg_cv_GTK_CFLAGS="$GTK_CFLAGS"
389 elif test -n "$PKG_CONFIG"; then
390 if test -n "$PKG_CONFIG" && \
391- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 >= 2.19.7\""; } >&5
392- ($PKG_CONFIG --exists --print-errors "gtk+-2.0 >= 2.19.7") 2>&5
393+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-3.0 >= 3.0.8\""; } >&5
394+ ($PKG_CONFIG --exists --print-errors "gtk+-3.0 >= 3.0.8") 2>&5
395 ac_status=$?
396 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
397 test $ac_status = 0; }; then
398- pkg_cv_GTK_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 >= 2.19.7" 2>/dev/null`
399+ pkg_cv_GTK_CFLAGS=`$PKG_CONFIG --cflags "gtk+-3.0 >= 3.0.8" 2>/dev/null`
400 else
401 pkg_failed=yes
402 fi
403@@ -11432,12 +11432,12 @@
404 pkg_cv_GTK_LIBS="$GTK_LIBS"
405 elif test -n "$PKG_CONFIG"; then
406 if test -n "$PKG_CONFIG" && \
407- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 >= 2.19.7\""; } >&5
408- ($PKG_CONFIG --exists --print-errors "gtk+-2.0 >= 2.19.7") 2>&5
409+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-3.0 >= 3.0.8\""; } >&5
410+ ($PKG_CONFIG --exists --print-errors "gtk+-3.0 >= 3.0.8") 2>&5
411 ac_status=$?
412 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
413 test $ac_status = 0; }; then
414- pkg_cv_GTK_LIBS=`$PKG_CONFIG --libs "gtk+-2.0 >= 2.19.7" 2>/dev/null`
415+ pkg_cv_GTK_LIBS=`$PKG_CONFIG --libs "gtk+-3.0 >= 3.0.8" 2>/dev/null`
416 else
417 pkg_failed=yes
418 fi
419@@ -11457,14 +11457,14 @@
420 _pkg_short_errors_supported=no
421 fi
422 if test $_pkg_short_errors_supported = yes; then
423- GTK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gtk+-2.0 >= 2.19.7" 2>&1`
424+ GTK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gtk+-3.0 >= 3.0.8" 2>&1`
425 else
426- GTK_PKG_ERRORS=`$PKG_CONFIG --print-errors "gtk+-2.0 >= 2.19.7" 2>&1`
427+ GTK_PKG_ERRORS=`$PKG_CONFIG --print-errors "gtk+-3.0 >= 3.0.8" 2>&1`
428 fi
429 # Put the nasty error message in config.log where it belongs
430 echo "$GTK_PKG_ERRORS" >&5
431
432- as_fn_error $? "Package requirements (gtk+-2.0 >= 2.19.7) were not met:
433+ as_fn_error $? "Package requirements (gtk+-3.0 >= 3.0.8) were not met:
434
435 $GTK_PKG_ERRORS
436
437@@ -11508,12 +11508,12 @@
438 pkg_cv_GEIS_CFLAGS="$GEIS_CFLAGS"
439 elif test -n "$PKG_CONFIG"; then
440 if test -n "$PKG_CONFIG" && \
441- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libutouch-geis >= 0.3\""; } >&5
442- ($PKG_CONFIG --exists --print-errors "libutouch-geis >= 0.3") 2>&5
443+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libutouch-geis >= 2.1.1\""; } >&5
444+ ($PKG_CONFIG --exists --print-errors "libutouch-geis >= 2.1.1") 2>&5
445 ac_status=$?
446 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
447 test $ac_status = 0; }; then
448- pkg_cv_GEIS_CFLAGS=`$PKG_CONFIG --cflags "libutouch-geis >= 0.3" 2>/dev/null`
449+ pkg_cv_GEIS_CFLAGS=`$PKG_CONFIG --cflags "libutouch-geis >= 2.1.1" 2>/dev/null`
450 else
451 pkg_failed=yes
452 fi
453@@ -11524,12 +11524,12 @@
454 pkg_cv_GEIS_LIBS="$GEIS_LIBS"
455 elif test -n "$PKG_CONFIG"; then
456 if test -n "$PKG_CONFIG" && \
457- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libutouch-geis >= 0.3\""; } >&5
458- ($PKG_CONFIG --exists --print-errors "libutouch-geis >= 0.3") 2>&5
459+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libutouch-geis >= 2.1.1\""; } >&5
460+ ($PKG_CONFIG --exists --print-errors "libutouch-geis >= 2.1.1") 2>&5
461 ac_status=$?
462 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
463 test $ac_status = 0; }; then
464- pkg_cv_GEIS_LIBS=`$PKG_CONFIG --libs "libutouch-geis >= 0.3" 2>/dev/null`
465+ pkg_cv_GEIS_LIBS=`$PKG_CONFIG --libs "libutouch-geis >= 2.1.1" 2>/dev/null`
466 else
467 pkg_failed=yes
468 fi
469@@ -11549,14 +11549,14 @@
470 _pkg_short_errors_supported=no
471 fi
472 if test $_pkg_short_errors_supported = yes; then
473- GEIS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libutouch-geis >= 0.3" 2>&1`
474+ GEIS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libutouch-geis >= 2.1.1" 2>&1`
475 else
476- GEIS_PKG_ERRORS=`$PKG_CONFIG --print-errors "libutouch-geis >= 0.3" 2>&1`
477+ GEIS_PKG_ERRORS=`$PKG_CONFIG --print-errors "libutouch-geis >= 2.1.1" 2>&1`
478 fi
479 # Put the nasty error message in config.log where it belongs
480 echo "$GEIS_PKG_ERRORS" >&5
481
482- as_fn_error $? "Package requirements (libutouch-geis >= 0.3) were not met:
483+ as_fn_error $? "Package requirements (libutouch-geis >= 2.1.1) were not met:
484
485 $GEIS_PKG_ERRORS
486
487@@ -11691,7 +11691,7 @@
488 if test "${enable_maintainer_flags+set}" = set; then :
489 enableval=$enable_maintainer_flags;
490 else
491- enable_maintainer_flags=yes
492+ enable_maintainer_flags=no
493 fi
494
495
496@@ -12489,7 +12489,7 @@
497 # report actual input values of CONFIG_FILES etc. instead of their
498 # values after options handling.
499 ac_log="
500-This file was extended by grip $as_me 0.1.7, which was
501+This file was extended by grip $as_me 0.2.0, which was
502 generated by GNU Autoconf 2.67. Invocation command line was
503
504 CONFIG_FILES = $CONFIG_FILES
505@@ -12555,7 +12555,7 @@
506 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
507 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
508 ac_cs_version="\\
509-grip config.status 0.1.7
510+grip config.status 0.2.0
511 configured by $0, generated by GNU Autoconf 2.67,
512 with options \\"\$ac_cs_config\\"
513
514
515=== modified file 'configure.ac'
516--- configure.ac 2011-03-23 18:20:10 +0000
517+++ configure.ac 2011-07-11 12:13:41 +0000
518@@ -2,8 +2,8 @@
519 # shamelessly stolen from clutter-gtk
520 #
521 m4_define([grip_major_version], [0])
522-m4_define([grip_minor_version], [1])
523-m4_define([grip_micro_version], [7])
524+m4_define([grip_minor_version], [2])
525+m4_define([grip_micro_version], [0])
526
527 m4_define([grip_api_version],
528 [grip_major_version.grip_minor_version])
529@@ -71,11 +71,11 @@
530 AC_FUNC_MMAP
531 AC_CHECK_FUNCS([memset munmap strcasecmp strdup])
532
533-PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.19.7)
534+PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.0.8)
535 AC_SUBST(GTK_CFLAGS)
536 AC_SUBST(GTK_LIBS)
537
538-PKG_CHECK_MODULES(GEIS, libutouch-geis >= 0.3)
539+PKG_CHECK_MODULES(GEIS, libutouch-geis >= 2.1.1)
540 AC_SUBST(GEIS_CFLAGS)
541 AC_SUBST(GEIS_LIBS)
542
543
544=== modified file 'debian/changelog'
545--- debian/changelog 2011-03-23 18:21:01 +0000
546+++ debian/changelog 2011-07-11 12:13:41 +0000
547@@ -1,3 +1,10 @@
548+libgrip (0.2.0-0ubuntu1) natty; urgency=low
549+
550+ * New upstream release.
551+ - Renamed all packages for consistency
552+
553+ -- Jussi Pakkanen <jussi.pakkanen@ubuntu.com> Mon, 11 Jul 2011 11:37:29 +0300
554+
555 libgrip (0.1.7-0ubuntu1) UNRELEASED; urgency=low
556
557 * New upstream release.
558
559=== modified file 'debian/control'
560--- debian/control 2011-03-07 12:53:14 +0000
561+++ debian/control 2011-07-11 12:13:41 +0000
562@@ -5,13 +5,13 @@
563 Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
564 Build-Depends: debhelper (>= 5.0),
565 cdbs (>= 0.4.41),
566- libglib2.0-dev (>=2.14.0),
567- libgtk2.0-dev (>= 2.21.5-1ubuntu3),
568- libutouch-geis-dev,
569+ libglib2.0-dev (>=2.28.6),
570+ libgtk-3-dev (>= 3.0.8-0ubuntu1),
571+ libutouch-geis-dev (>= 2.1.1),
572 gobject-introspection,
573 libgirepository1.0-dev,
574 gir1.2-glib-2.0,
575- gir1.2-gtk-2.0,
576+ gir1.2-gtk-3.0,
577 gir1.2-pango-1.0,
578 gir1.2-gdkpixbuf-2.0,
579 gir1.2-freedesktop
580@@ -19,33 +19,36 @@
581 Homepage: https://launchpad.net/libgrip
582 Vcs-Bzr: https://code.launchpad.net/~utouch-packaging/libgrip/packaging
583
584-Package: libgrip-0.1-0
585+Package: libgrip0
586 Section: libs
587 Architecture: any
588 Depends: ${shlibs:Depends}, ${misc:Depends}
589-Description: Shared library providing multitouch gestures to gtk apps.
590+Replaces: libgrip-0.1-0
591+Description: Shared library providing multitouch gestures to GTK+ apps.
592 .
593 This package contains shared libraries to be used by applications.
594
595-Package: libgrip-0.1-dev
596+Package: libgrip-dev
597 Section: libdevel
598 Architecture: any
599 Depends: ${shlibs:Depends},
600 ${misc:Depends},
601- libgrip-0.1-0 (= ${binary:Version}),
602+ libgrip0 (= ${binary:Version}),
603 pkg-config,
604- libglib2.0-dev (>=2.14.0),
605- libgtk2.0-dev (>= 2.19.7),
606+ libglib2.0-dev (>=2.28.6),
607+ libgtk-3.0-dev (>= 3.0.8),
608 libutouch-geis-dev
609-Description: Shared library providing multitouch gestures to gtk apps.
610+Replaces: libgrip-0.1-dev
611+Description: Shared library providing multitouch gestures to GTK+ apps.
612 .
613 This package contains files that are needed to build applications.
614
615-Package: gir1.2-grip-0.1
616+Package: gir1.2-grip
617 Section: libs
618 Architecture: any
619 Depends: ${misc:Depends},
620 ${gir:Depends}
621+Replaces: gir1.2-grip-0.1
622 Description: typelib file for libgrip
623 .
624 This package can be used by other packages using the GIRepository format to
625
626=== renamed file 'debian/gir1.2-grip-0.1.install' => 'debian/gir1.2-grip.install'
627--- debian/gir1.2-grip-0.1.install 2011-03-03 16:13:57 +0000
628+++ debian/gir1.2-grip.install 2011-07-11 12:13:41 +0000
629@@ -1,1 +1,1 @@
630-debian/tmp/usr/lib/girepository-1.0/Grip-0.1.typelib
631+debian/tmp/usr/lib/girepository-1.0/Grip.typelib
632
633=== renamed file 'debian/libgrip-0.1-0.symbols' => 'debian/libbrip0.symbols'
634=== renamed file 'debian/libgrip-0.1-dev.install' => 'debian/libgrip-dev.install'
635--- debian/libgrip-0.1-dev.install 2011-03-03 16:13:57 +0000
636+++ debian/libgrip-dev.install 2011-07-11 12:13:41 +0000
637@@ -1,4 +1,4 @@
638 debian/tmp/usr/include/
639 debian/tmp/usr/lib/pkgconfig
640 debian/tmp/usr/lib/*.so
641-debian/tmp/usr/share/gir-1.0/Grip-0.1.gir
642+debian/tmp/usr/share/gir-1.0/Grip.gir
643
644=== renamed file 'debian/libgrip-0.1-0.install' => 'debian/libgrip0.install'
645=== modified file 'examples/rectangle-mover/Makefile.am'
646--- examples/rectangle-mover/Makefile.am 2011-02-04 19:08:39 +0000
647+++ examples/rectangle-mover/Makefile.am 2011-07-11 12:13:41 +0000
648@@ -12,4 +12,4 @@
649 $(GTK_CFLAGS) \
650 $(MAINTAINER_CFLAGS)
651
652-grip_test_LDADD = $(top_builddir)/src/libgrip-0.1.la $(GTK_LIBS)
653+grip_test_LDADD = $(top_builddir)/src/libgrip.la $(GTK_LIBS)
654
655=== modified file 'examples/rectangle-mover/Makefile.in'
656--- examples/rectangle-mover/Makefile.in 2011-03-23 18:20:10 +0000
657+++ examples/rectangle-mover/Makefile.in 2011-07-11 12:13:41 +0000
658@@ -54,7 +54,7 @@
659 am_grip_test_OBJECTS = grip_test-gesture.$(OBJEXT)
660 grip_test_OBJECTS = $(am_grip_test_OBJECTS)
661 am__DEPENDENCIES_1 =
662-grip_test_DEPENDENCIES = $(top_builddir)/src/libgrip-0.1.la \
663+grip_test_DEPENDENCIES = $(top_builddir)/src/libgrip.la \
664 $(am__DEPENDENCIES_1)
665 AM_V_lt = $(am__v_lt_$(V))
666 am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
667@@ -248,7 +248,7 @@
668 $(GTK_CFLAGS) \
669 $(MAINTAINER_CFLAGS)
670
671-grip_test_LDADD = $(top_builddir)/src/libgrip-0.1.la $(GTK_LIBS)
672+grip_test_LDADD = $(top_builddir)/src/libgrip.la $(GTK_LIBS)
673 all: all-am
674
675 .SUFFIXES:
676
677=== modified file 'examples/rectangle-mover/gesture.c'
678--- examples/rectangle-mover/gesture.c 2011-01-13 05:50:41 +0000
679+++ examples/rectangle-mover/gesture.c 2011-07-11 12:13:41 +0000
680@@ -9,17 +9,22 @@
681 static gdouble translate[2] = { 200, 200 };
682 static gint in_touch = 0;
683
684+static void subscribe_gestures(GripGestureManager *manager, GtkWidget *window, GtkWidget *da);
685+
686+struct app_data {
687+ GripGestureManager *manager;
688+ GtkWidget *main_window;
689+ GtkWidget *da;
690+};
691+
692 static gboolean
693-expose_event (GtkWidget *widget,
694- GdkEventExpose *event,
695- gpointer data)
696+draw_canvas (GtkWidget *widget,
697+ cairo_t *cr,
698+ gpointer data)
699 {
700- cairo_t *cr;
701 gdouble radians;
702 gint width = (in_touch > 0) ? 10 : 1;
703
704- cr = gdk_cairo_create (widget->window);
705-
706 cairo_set_source_rgb (cr, 0, 0, 0);
707 cairo_set_line_width (cr, width);
708
709@@ -33,8 +38,6 @@
710 cairo_set_source_rgb (cr, 1, 0, 1);
711 cairo_fill (cr);
712
713- cairo_destroy (cr);
714-
715 return FALSE;
716 }
717
718@@ -89,6 +92,16 @@
719 gtk_widget_queue_draw (GTK_WIDGET (widget));
720 }
721
722+static void
723+subscribe_toggled(GtkToggleButton *toggle_button, gpointer user_data)
724+{
725+ struct app_data *app = (struct app_data*)(user_data);
726+ if (gtk_toggle_button_get_active(toggle_button)) {
727+ subscribe_gestures(app->manager, app->main_window, app->da);
728+ } else {
729+ grip_gesture_manager_unregister_window(app->manager, app->main_window);
730+ }
731+}
732
733 static GtkTreeModel *
734 create_model ()
735@@ -96,20 +109,61 @@
736 return (GtkTreeModel *)gtk_list_store_new (1, G_TYPE_STRING);
737 }
738
739+/* Change this to suit your needs. */
740+#define DEVICE_TYPE GRIP_DEVICE_ALL
741+
742+static void
743+subscribe_gestures(GripGestureManager *manager, GtkWidget *window,
744+ GtkWidget *da)
745+{
746+ grip_gesture_manager_register_window (manager,
747+ da,
748+ GRIP_GESTURE_PINCH,
749+ DEVICE_TYPE,
750+ 2,
751+ gesture_callback,
752+ NULL, NULL);
753+
754+ grip_gesture_manager_register_window (manager,
755+ da,
756+ GRIP_GESTURE_ROTATE,
757+ DEVICE_TYPE,
758+ 2,
759+ gesture_callback,
760+ NULL, NULL);
761+
762+ grip_gesture_manager_register_window (manager,
763+ da,
764+ GRIP_GESTURE_DRAG,
765+ DEVICE_TYPE,
766+ 2,
767+ gesture_callback,
768+ NULL, NULL);
769+
770+ grip_gesture_manager_register_window (manager,
771+ da,
772+ GRIP_GESTURE_TAP,
773+ DEVICE_TYPE,
774+ 2,
775+ gesture_callback,
776+ NULL, NULL);
777+}
778+
779 static GtkWidget *
780-create_window (GripGestureManager *manager)
781+create_window (struct app_data *app)
782 {
783- GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
784- GtkWidget *da;
785+ app->main_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
786+ GtkWidget *window = app->main_window;
787 GtkWidget *hbox;
788 GtkWidget *vbox;
789 GtkWidget *button;
790+ GtkWidget *subscribed_toggle;
791 GtkWidget *tv;
792 GtkTreeModel *model;
793 GtkWidget *sw;
794 const GdkColor white = { 0, 0xffff, 0xffff, 0xffff };
795
796- da = gtk_drawing_area_new ();
797+ app->da = gtk_drawing_area_new ();
798
799 gtk_window_set_title (GTK_WINDOW (window), "Touch Demo");
800 gtk_window_set_default_size (GTK_WINDOW (window), 600, 600);
801@@ -120,7 +174,7 @@
802 vbox = gtk_vbox_new (FALSE, 0);
803
804 gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0);
805- gtk_box_pack_start (GTK_BOX (hbox), da, TRUE, TRUE, 0);
806+ gtk_box_pack_start (GTK_BOX (hbox), app->da, TRUE, TRUE, 0);
807
808 model = create_model ();
809 sw = gtk_scrolled_window_new (NULL, NULL);
810@@ -136,44 +190,23 @@
811 "clicked",
812 G_CALLBACK (gtk_main_quit),
813 NULL);
814-
815+ subscribed_toggle = gtk_toggle_button_new_with_label ("Gestures");
816+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(subscribed_toggle), TRUE);
817+ g_signal_connect (subscribed_toggle,
818+ "toggled",
819+ G_CALLBACK (subscribe_toggled),
820+ app);
821+ gtk_box_pack_start (GTK_BOX (vbox), subscribed_toggle, FALSE, FALSE, 0);
822 gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
823
824 gtk_container_add (GTK_CONTAINER (window), hbox);
825
826- gtk_widget_modify_bg (da, GTK_STATE_NORMAL, &white);
827-
828- g_signal_connect (da, "expose-event",
829- G_CALLBACK (expose_event), NULL);
830-
831- grip_gesture_manager_register_window (manager,
832- da,
833- GRIP_GESTURE_PINCH,
834- 2,
835- gesture_callback,
836- NULL, NULL);
837-
838- grip_gesture_manager_register_window (manager,
839- da,
840- GRIP_GESTURE_ROTATE,
841- 2,
842- gesture_callback,
843- NULL, NULL);
844-
845- grip_gesture_manager_register_window (manager,
846- da,
847- GRIP_GESTURE_DRAG,
848- 2,
849- gesture_callback,
850- NULL, NULL);
851-
852- grip_gesture_manager_register_window (manager,
853- da,
854- GRIP_GESTURE_TAP,
855- 2,
856- gesture_callback,
857- NULL, NULL);
858-
859+ gtk_widget_modify_bg (app->da, GTK_STATE_NORMAL, &white);
860+
861+ g_signal_connect (app->da, "draw",
862+ G_CALLBACK (draw_canvas), NULL);
863+
864+ subscribe_gestures(app->manager, window, app->da);
865 return window;
866 }
867
868@@ -188,8 +221,7 @@
869 int
870 main (int argc, char **argv)
871 {
872- GtkWidget *window;
873- GripGestureManager *manager;
874+ struct app_data app;
875
876 gtk_init (&argc, &argv);
877
878@@ -197,12 +229,12 @@
879 * my Dell XT2 has in it. */
880 signal (SIGABRT, abort_handler);
881
882- manager = grip_gesture_manager_get ();
883- window = create_window (manager);
884-
885- g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
886-
887- gtk_widget_show_all (GTK_WIDGET (window));
888+ app.manager = grip_gesture_manager_get ();
889+ create_window (&app);
890+
891+ g_signal_connect (app.main_window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
892+
893+ gtk_widget_show_all (GTK_WIDGET (app.main_window));
894
895 gtk_main ();
896
897
898=== modified file 'libgrip.pc.in'
899--- libgrip.pc.in 2011-03-04 19:15:32 +0000
900+++ libgrip.pc.in 2011-07-11 12:13:41 +0000
901@@ -6,6 +6,6 @@
902 Name: libgrip
903 Description: Multitouch gesture library
904 Version: @VERSION@
905-Libs: -L${libdir} -lgrip-0.1
906-Cflags: -I${includedir}/libgrip-0.1
907-Requires: gtk+-2.0
908+Libs: -L${libdir} -lgrip
909+Cflags: -I${includedir}
910+Requires: gtk+-3.0
911
912=== modified file 'src/Makefile.am'
913--- src/Makefile.am 2011-03-06 15:19:16 +0000
914+++ src/Makefile.am 2011-07-11 12:13:41 +0000
915@@ -1,5 +1,5 @@
916 grip_version_script = \
917- $(srcdir)/libgrip-0.1.ver
918+ $(srcdir)/libgrip.ver
919
920 grip_built_public_sources = \
921 griptypebuiltins.h
922@@ -38,21 +38,21 @@
923 introspection_sources = $(patsubst %,$(srcdir)/%,$(sources_h))
924
925 irscanner_headers = $(patsubst %,$(srcdir)/%,$(sources_h))
926-Grip-0.1.gir: $(INTROSPECTION_SCANNER) $(irscanner_headers) Makefile.am
927+Grip.gir: $(INTROSPECTION_SCANNER) $(irscanner_headers) Makefile.am
928 $(INTROSPECTION_SCANNER) \
929 -v --namespace Grip \
930- --nsversion=0.1 \
931+ --nsversion=0.2 \
932 --warn-all \
933 --libtool=$(top_builddir)/libtool \
934 --add-include-path=$(srcdir) $(GTK_CFLAGS) \
935 --include=GObject-2.0 \
936 --include=GLib-2.0 \
937 --include=Gtk-2.0 \
938- --library=grip-0.1 \
939- --output Grip-0.1.gir $(irscanner_headers) \
940+ --library=grip \
941+ --output Grip.gir $(irscanner_headers) \
942 $(addprefix --c-include=src/, $(grip_headers))
943
944-BUILT_GIRSOURCES += Grip-0.1.gir
945+BUILT_GIRSOURCES += Grip.gir
946
947 girdir = $(datadir)/gir-1.0
948 gir_DATA = $(BUILT_GIRSOURCES)
949@@ -90,26 +90,26 @@
950 $(GEIS_CFLAGS) \
951 $(MAINTAINER_CFLAGS)
952
953-lib_LTLIBRARIES = libgrip-0.1.la
954+lib_LTLIBRARIES = libgrip.la
955
956-libgrip_0_1_la_SOURCES = \
957+libgrip_la_SOURCES = \
958 gripgesturemanager.c \
959 griptypebuiltins.c
960
961-libgripincludedir=$(includedir)/libgrip-0.1/libgrip
962+libgripincludedir=$(includedir)/libgrip
963
964 libgripinclude_HEADERS = \
965 gripgesturemanager.h \
966 grip.h
967
968-libgrip_0_1_la_LIBADD = $(GTK_LIBS) $(GEIS_LIBS)
969-libgrip_0_1_la_LDFLAGS = \
970+libgrip_la_LIBADD = $(GTK_LIBS) $(GEIS_LIBS)
971+libgrip_la_LDFLAGS = \
972 -Wl,-z,defs -Wl,--as-needed \
973 -Wl,--version-script=$(grip_version_script) \
974 $(GRIP_LT_LDFLAGS) \
975 $(GTK_LT_LDFLAGS)
976
977-gripheadersdir = $(includedir)/grip-0.1/grip
978+gripheadersdir = $(includedir)/grip
979
980 DISTCLEANFILES = \
981 stamp-griptypebuiltins.h \
982
983=== modified file 'src/Makefile.in'
984--- src/Makefile.in 2011-03-23 18:20:10 +0000
985+++ src/Makefile.in 2011-07-11 12:13:41 +0000
986@@ -77,17 +77,15 @@
987 "$(DESTDIR)$(typelibsdir)" "$(DESTDIR)$(libgripincludedir)"
988 LTLIBRARIES = $(lib_LTLIBRARIES)
989 am__DEPENDENCIES_1 =
990-libgrip_0_1_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
991- $(am__DEPENDENCIES_1)
992-am_libgrip_0_1_la_OBJECTS = gripgesturemanager.lo griptypebuiltins.lo
993-libgrip_0_1_la_OBJECTS = $(am_libgrip_0_1_la_OBJECTS)
994+libgrip_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
995+am_libgrip_la_OBJECTS = gripgesturemanager.lo griptypebuiltins.lo
996+libgrip_la_OBJECTS = $(am_libgrip_la_OBJECTS)
997 AM_V_lt = $(am__v_lt_$(V))
998 am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
999 am__v_lt_0 = --silent
1000-libgrip_0_1_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
1001- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
1002- $(AM_CFLAGS) $(CFLAGS) $(libgrip_0_1_la_LDFLAGS) $(LDFLAGS) -o \
1003- $@
1004+libgrip_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
1005+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
1006+ $(libgrip_la_LDFLAGS) $(LDFLAGS) -o $@
1007 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
1008 depcomp = $(SHELL) $(top_srcdir)/depcomp
1009 am__depfiles_maybe = depfiles
1010@@ -114,8 +112,8 @@
1011 AM_V_GEN = $(am__v_GEN_$(V))
1012 am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
1013 am__v_GEN_0 = @echo " GEN " $@;
1014-SOURCES = $(libgrip_0_1_la_SOURCES)
1015-DIST_SOURCES = $(libgrip_0_1_la_SOURCES)
1016+SOURCES = $(libgrip_la_SOURCES)
1017+DIST_SOURCES = $(libgrip_la_SOURCES)
1018 DATA = $(gir_DATA) $(typelibs_DATA)
1019 HEADERS = $(libgripinclude_HEADERS)
1020 ETAGS = etags
1021@@ -269,7 +267,7 @@
1022 top_builddir = @top_builddir@
1023 top_srcdir = @top_srcdir@
1024 grip_version_script = \
1025- $(srcdir)/libgrip-0.1.ver
1026+ $(srcdir)/libgrip.ver
1027
1028 grip_built_public_sources = \
1029 griptypebuiltins.h
1030@@ -287,7 +285,7 @@
1031 $(grip_version_script)
1032
1033 CLEANFILES = $(am__append_1)
1034-@HAVE_INTROSPECTION_TRUE@BUILT_GIRSOURCES = Grip-0.1.gir
1035+@HAVE_INTROSPECTION_TRUE@BUILT_GIRSOURCES = Grip.gir
1036 @HAVE_INTROSPECTION_TRUE@introspection_sources = $(patsubst %,$(srcdir)/%,$(sources_h))
1037 @HAVE_INTROSPECTION_TRUE@irscanner_headers = $(patsubst %,$(srcdir)/%,$(sources_h))
1038 @HAVE_INTROSPECTION_TRUE@girdir = $(datadir)/gir-1.0
1039@@ -311,24 +309,24 @@
1040 $(GEIS_CFLAGS) \
1041 $(MAINTAINER_CFLAGS)
1042
1043-lib_LTLIBRARIES = libgrip-0.1.la
1044-libgrip_0_1_la_SOURCES = \
1045+lib_LTLIBRARIES = libgrip.la
1046+libgrip_la_SOURCES = \
1047 gripgesturemanager.c \
1048 griptypebuiltins.c
1049
1050-libgripincludedir = $(includedir)/libgrip-0.1/libgrip
1051+libgripincludedir = $(includedir)/libgrip
1052 libgripinclude_HEADERS = \
1053 gripgesturemanager.h \
1054 grip.h
1055
1056-libgrip_0_1_la_LIBADD = $(GTK_LIBS) $(GEIS_LIBS)
1057-libgrip_0_1_la_LDFLAGS = \
1058+libgrip_la_LIBADD = $(GTK_LIBS) $(GEIS_LIBS)
1059+libgrip_la_LDFLAGS = \
1060 -Wl,-z,defs -Wl,--as-needed \
1061 -Wl,--version-script=$(grip_version_script) \
1062 $(GRIP_LT_LDFLAGS) \
1063 $(GTK_LT_LDFLAGS)
1064
1065-gripheadersdir = $(includedir)/grip-0.1/grip
1066+gripheadersdir = $(includedir)/grip
1067 DISTCLEANFILES = \
1068 stamp-griptypebuiltins.h \
1069 griptypebuiltins.h \
1070@@ -399,8 +397,8 @@
1071 echo "rm -f \"$${dir}/so_locations\""; \
1072 rm -f "$${dir}/so_locations"; \
1073 done
1074-libgrip-0.1.la: $(libgrip_0_1_la_OBJECTS) $(libgrip_0_1_la_DEPENDENCIES)
1075- $(AM_V_CCLD)$(libgrip_0_1_la_LINK) -rpath $(libdir) $(libgrip_0_1_la_OBJECTS) $(libgrip_0_1_la_LIBADD) $(LIBS)
1076+libgrip.la: $(libgrip_la_OBJECTS) $(libgrip_la_DEPENDENCIES)
1077+ $(AM_V_CCLD)$(libgrip_la_LINK) -rpath $(libdir) $(libgrip_la_OBJECTS) $(libgrip_la_LIBADD) $(LIBS)
1078
1079 mostlyclean-compile:
1080 -rm -f *.$(OBJEXT)
1081@@ -722,18 +720,18 @@
1082 ( cd $(srcdir) && $(GLIB_MKENUMS) --template griptypebuiltins.c.in \
1083 $(sources_h) ) > xgen-gtbc \
1084 && cp xgen-gtbc griptypebuiltins.c && rm -f xgen-gtbc
1085-@HAVE_INTROSPECTION_TRUE@Grip-0.1.gir: $(INTROSPECTION_SCANNER) $(irscanner_headers) Makefile.am
1086+@HAVE_INTROSPECTION_TRUE@Grip.gir: $(INTROSPECTION_SCANNER) $(irscanner_headers) Makefile.am
1087 @HAVE_INTROSPECTION_TRUE@ $(INTROSPECTION_SCANNER) \
1088 @HAVE_INTROSPECTION_TRUE@ -v --namespace Grip \
1089-@HAVE_INTROSPECTION_TRUE@ --nsversion=0.1 \
1090+@HAVE_INTROSPECTION_TRUE@ --nsversion=0.2 \
1091 @HAVE_INTROSPECTION_TRUE@ --warn-all \
1092 @HAVE_INTROSPECTION_TRUE@ --libtool=$(top_builddir)/libtool \
1093 @HAVE_INTROSPECTION_TRUE@ --add-include-path=$(srcdir) $(GTK_CFLAGS) \
1094 @HAVE_INTROSPECTION_TRUE@ --include=GObject-2.0 \
1095 @HAVE_INTROSPECTION_TRUE@ --include=GLib-2.0 \
1096 @HAVE_INTROSPECTION_TRUE@ --include=Gtk-2.0 \
1097-@HAVE_INTROSPECTION_TRUE@ --library=grip-0.1 \
1098-@HAVE_INTROSPECTION_TRUE@ --output Grip-0.1.gir $(irscanner_headers) \
1099+@HAVE_INTROSPECTION_TRUE@ --library=grip \
1100+@HAVE_INTROSPECTION_TRUE@ --output Grip.gir $(irscanner_headers) \
1101 @HAVE_INTROSPECTION_TRUE@ $(addprefix --c-include=src/, $(grip_headers))
1102 @HAVE_INTROSPECTION_TRUE@%.typelib: %.gir $(INTROSPECTION_COMPILER)
1103 @HAVE_INTROSPECTION_TRUE@ $(INTROSPECTION_COMPILER) \
1104
1105=== modified file 'src/grip.h'
1106--- src/grip.h 2010-11-22 14:49:44 +0000
1107+++ src/grip.h 2011-07-11 12:13:41 +0000
1108@@ -23,9 +23,9 @@
1109 * Cody Russell <crussell@canonical.com>
1110 */
1111
1112-#ifndef __GRIP_H__
1113-#define __GRIP_H__
1114+#ifndef GRIP_H
1115+#define GRIP_H
1116
1117 #include <libgrip/gripgesturemanager.h>
1118
1119-#endif /* __GRIP_H__ */
1120+#endif /* GRIP_H */
1121
1122=== modified file 'src/gripgesturemanager.c'
1123--- src/gripgesturemanager.c 2011-03-23 15:17:02 +0000
1124+++ src/gripgesturemanager.c 2011-07-11 12:13:41 +0000
1125@@ -32,10 +32,23 @@
1126 typedef struct _GripGestureBinding GripGestureBinding;
1127 typedef struct _GripRegistrationRequest GripRegistrationRequest;
1128
1129+typedef struct {
1130+ GArray *touchscreen;
1131+ GArray *touchpad;
1132+ GArray *independent;
1133+} GripDevices;
1134+
1135+struct Registrations {
1136+ GripGestureRegistration *touchscreen;
1137+ GripGestureRegistration *touchpad;
1138+ GripGestureRegistration *independent;
1139+};
1140+
1141 struct _GripGestureManagerPrivate
1142 {
1143- GHashTable *hash;
1144+ GHashTable *registered_windows;
1145 GList *requests;
1146+ GripDevices devices;
1147 };
1148
1149 struct _GripGestureBinding
1150@@ -62,6 +75,7 @@
1151 GripGestureManager *manager;
1152 GtkWidget *widget;
1153 GripGestureType gesture_type;
1154+ GripDeviceType device_type;
1155 gint touch_points;
1156 GripGestureCallback callback;
1157 gpointer user_data;
1158@@ -134,6 +148,74 @@
1159 gesture_finish
1160 };
1161
1162+static void device_added (void *cookie, GeisInputDeviceId id, void *attrs)
1163+{
1164+ GripDevices *devices = (GripDevices *) cookie;
1165+ GeisGestureAttr *a;
1166+ gboolean direct = FALSE;
1167+ gboolean independent = FALSE;
1168+
1169+ for (a = attrs; a->name; a++)
1170+ {
1171+ if (g_strcmp0(GEIS_DEVICE_ATTRIBUTE_DIRECT_TOUCH, a->name) == 0)
1172+ direct = a->boolean_val;
1173+ else if (g_strcmp0(GEIS_DEVICE_ATTRIBUTE_INDEPENDENT_TOUCH, a->name) == 0)
1174+ independent = a->boolean_val;
1175+ }
1176+
1177+ if (direct && !independent)
1178+ g_array_append_val (devices->touchscreen, id);
1179+ else if (!direct && !independent)
1180+ g_array_append_val (devices->touchpad, id);
1181+ else if (!direct && independent)
1182+ g_array_append_val (devices->independent, id);
1183+}
1184+
1185+static GeisInputFuncs input_funcs = {
1186+ device_added,
1187+ NULL,
1188+ NULL,
1189+};
1190+
1191+static void
1192+grip_get_devices (GripDevices *devices)
1193+{
1194+ GeisXcbWinInfo xcb_win_info = {
1195+ .display_name = NULL,
1196+ .screenp = NULL,
1197+ .window_id = 0,
1198+ };
1199+ GeisWinInfo win_info = {
1200+ GEIS_XCB_FULL_WINDOW,
1201+ &xcb_win_info,
1202+ };
1203+ GeisInstance instance;
1204+ GeisStatus status;
1205+
1206+ status = geis_init (&win_info, &instance);
1207+ if (status != GEIS_STATUS_SUCCESS)
1208+ {
1209+ g_warning ("failed to determine device types\n");
1210+ return;
1211+ }
1212+
1213+ status = geis_input_devices (instance, &input_funcs, devices);
1214+ if (status != GEIS_STATUS_SUCCESS)
1215+ {
1216+ g_warning ("failed to determine device types\n");
1217+ return;
1218+ }
1219+
1220+ status = geis_event_dispatch (instance);
1221+ if (status != GEIS_STATUS_SUCCESS)
1222+ {
1223+ g_warning ("failed to determine device types\n");
1224+ return;
1225+ }
1226+
1227+ geis_finish (instance);
1228+}
1229+
1230 G_DEFINE_TYPE (GripGestureManager, grip_gesture_manager, G_TYPE_OBJECT)
1231
1232 #define GRIP_GESTURE_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GRIP_TYPE_GESTURE_MANAGER, GripGestureManagerPrivate))
1233@@ -143,16 +225,17 @@
1234 {
1235 }
1236
1237+
1238 static void
1239-free_registration (gpointer key,
1240- gpointer value,
1241- gpointer user_data)
1242+free_registration(GripGestureRegistration *reg)
1243 {
1244- GripGestureRegistration *reg = (GripGestureRegistration *)value;
1245 GList *tmp = NULL;
1246
1247+ if (!reg)
1248+ return;
1249+
1250 geis_unsubscribe (reg->instance,
1251- (GeisGestureType*)reg->gesture_list->pdata);
1252+ (GeisGestureType*)reg->gesture_list->pdata);
1253
1254 /* We don't need to free the values in the GPtrArray. */
1255 g_ptr_array_free (reg->gesture_list, TRUE);
1256@@ -165,19 +248,36 @@
1257 g_list_free (reg->bindings);
1258 }
1259
1260+/* Helper function needed to make things work with GTK. */
1261+
1262+static void
1263+free_registration_adapter (gpointer key,
1264+ gpointer value,
1265+ gpointer user_data)
1266+{
1267+ struct Registrations *regs = (struct Registrations *)value;
1268+ free_registration(regs->touchscreen);
1269+ free_registration(regs->touchpad);
1270+ free_registration(regs->independent);
1271+}
1272+
1273 static void
1274 grip_gesture_manager_finalize (GObject *object)
1275 {
1276 GripGestureManagerPrivate *priv = GRIP_GESTURE_MANAGER_GET_PRIVATE (object);
1277
1278- if (priv->hash != NULL)
1279+ if (priv->registered_windows != NULL)
1280 {
1281- g_hash_table_foreach (priv->hash,
1282- free_registration,
1283+ g_hash_table_foreach (priv->registered_windows,
1284+ free_registration_adapter,
1285 NULL);
1286
1287- g_hash_table_unref (priv->hash);
1288- priv->hash = NULL;
1289+ g_hash_table_unref (priv->registered_windows);
1290+ priv->registered_windows = NULL;
1291+
1292+ g_array_unref (priv->devices.touchscreen);
1293+ g_array_unref (priv->devices.touchpad);
1294+ g_array_unref (priv->devices.independent);
1295 }
1296 }
1297
1298@@ -187,6 +287,7 @@
1299 GObjectConstructParam *params)
1300 {
1301 GObject *object;
1302+ GripGestureManagerPrivate *priv;
1303
1304 if (manager_singleton != NULL)
1305 {
1306@@ -200,6 +301,9 @@
1307
1308 manager_singleton = GRIP_GESTURE_MANAGER (object);
1309 g_object_add_weak_pointer (object, (gpointer) &manager_singleton);
1310+
1311+ priv = manager_singleton->priv;
1312+ grip_get_devices (&priv->devices);
1313 }
1314
1315 return object;
1316@@ -489,6 +593,127 @@
1317 return (x >= ax && x < ax + alloc.width && y >= ay && y < ay + alloc.height);
1318 }
1319
1320+
1321+static void process_gesture (void *cookie,
1322+ GeisGestureType type,
1323+ GeisGestureId id,
1324+ GeisSize attr_count,
1325+ GeisGestureAttr *attrs,
1326+ GripTimeType time_type)
1327+{
1328+ GripGestureRegistration *reg = (GripGestureRegistration *)cookie;
1329+ GList *l = NULL;
1330+
1331+ for (l = reg->bindings; l != NULL; l = l->next)
1332+ {
1333+ GripGestureBinding *binding = (GripGestureBinding *)l->data;
1334+
1335+ if (binding->type == type)
1336+ {
1337+ GripGestureEvent *event = grip_gesture_event_new (type);
1338+
1339+ if (type == GRIP_GESTURE_DRAG)
1340+ {
1341+ GripEventGestureDrag *drag = (GripEventGestureDrag *)event;
1342+
1343+ drag->type = type;
1344+ drag->id = id;
1345+ drag->fingers = drag_gesture_handle_properties (drag,
1346+ attr_count,
1347+ attrs);
1348+
1349+ if (drag->fingers == binding->touches)
1350+ {
1351+ if (matches_widget (binding->widget,
1352+ gtk_widget_get_window(GTK_WIDGET (reg->window)),
1353+ (gint)drag->focus_x,
1354+ (gint)drag->focus_y))
1355+ {
1356+ binding->callback (binding->widget,
1357+ time_type,
1358+ event,
1359+ binding->data);
1360+ }
1361+ }
1362+ }
1363+ else if (type == GRIP_GESTURE_PINCH)
1364+ {
1365+ GripEventGesturePinch *pinch = (GripEventGesturePinch *)event;
1366+
1367+ pinch->type = type;
1368+ pinch->id = id;
1369+ pinch->fingers = pinch_gesture_handle_properties (pinch,
1370+ attr_count,
1371+ attrs);
1372+
1373+ if (pinch->fingers == binding->touches)
1374+ {
1375+ if (matches_widget (binding->widget,
1376+ gtk_widget_get_window(GTK_WIDGET(reg->window)),
1377+ (gint)pinch->focus_x,
1378+ (gint)pinch->focus_y))
1379+ {
1380+ binding->callback (binding->widget,
1381+ time_type,
1382+ event,
1383+ binding->data);
1384+ }
1385+ }
1386+ }
1387+ else if (type == GRIP_GESTURE_ROTATE)
1388+ {
1389+ GripEventGestureRotate *rotate = (GripEventGestureRotate *)event;
1390+
1391+ rotate->type = type;
1392+ rotate->id = id;
1393+ rotate->fingers = rotate_gesture_handle_properties (rotate,
1394+ attr_count,
1395+ attrs);
1396+
1397+ if (rotate->fingers == binding->touches)
1398+ {
1399+ if (matches_widget (binding->widget,
1400+ gtk_widget_get_window(GTK_WIDGET (reg->window)),
1401+ (gint)rotate->focus_x,
1402+ (gint)rotate->focus_y))
1403+ {
1404+ binding->callback (binding->widget,
1405+ time_type,
1406+ event,
1407+ binding->data);
1408+ }
1409+ }
1410+ }
1411+ else if (type == GRIP_GESTURE_TAP)
1412+ {
1413+ GripEventGestureTap *tap = (GripEventGestureTap *)event;
1414+
1415+ tap->type = type;
1416+ tap->id = id;
1417+ tap->fingers = tap_gesture_handle_properties (tap,
1418+ attr_count,
1419+ attrs);
1420+
1421+ if (tap->fingers == binding->touches)
1422+ {
1423+ if (matches_widget (binding->widget,
1424+ gtk_widget_get_window(GTK_WIDGET (reg->window)),
1425+ (gint)tap->focus_x,
1426+ (gint)tap->focus_y))
1427+ {
1428+ binding->callback (binding->widget,
1429+ time_type,
1430+ event,
1431+ binding->data);
1432+ }
1433+ }
1434+ }
1435+
1436+ grip_gesture_event_free (event);
1437+ }
1438+ }
1439+}
1440+
1441 static void
1442 gesture_start (void *cookie,
1443 GeisGestureType type,
1444@@ -496,117 +721,7 @@
1445 GeisSize attr_count,
1446 GeisGestureAttr *attrs)
1447 {
1448- GripGestureRegistration *reg = (GripGestureRegistration *)cookie;
1449- GList *l = NULL;
1450-
1451- for (l = reg->bindings; l != NULL; l = l->next)
1452- {
1453- GripGestureBinding *binding = (GripGestureBinding *)l->data;
1454-
1455- if (binding->type == type)
1456- {
1457- GripGestureEvent *event = grip_gesture_event_new (type);
1458-
1459- if (type == GRIP_GESTURE_DRAG)
1460- {
1461- GripEventGestureDrag *drag = (GripEventGestureDrag *)event;
1462-
1463- drag->type = type;
1464- drag->id = id;
1465- drag->fingers = drag_gesture_handle_properties (drag,
1466- attr_count,
1467- attrs);
1468-
1469- if (drag->fingers == binding->touches)
1470- {
1471- if (matches_widget (binding->widget,
1472- GTK_WIDGET (reg->window)->window,
1473- (gint)drag->focus_x,
1474- (gint)drag->focus_y))
1475- {
1476- binding->callback (binding->widget,
1477- GRIP_TIME_START,
1478- event,
1479- binding->data);
1480- }
1481- }
1482- }
1483- else if (type == GRIP_GESTURE_PINCH)
1484- {
1485- GripEventGesturePinch *pinch = (GripEventGesturePinch *)event;
1486-
1487- pinch->type = type;
1488- pinch->id = id;
1489- pinch->fingers = pinch_gesture_handle_properties (pinch,
1490- attr_count,
1491- attrs);
1492-
1493- if (pinch->fingers == binding->touches)
1494- {
1495- if (matches_widget (binding->widget,
1496- GTK_WIDGET (reg->window)->window,
1497- (gint)pinch->focus_x,
1498- (gint)pinch->focus_y))
1499- {
1500- binding->callback (binding->widget,
1501- GRIP_TIME_START,
1502- event,
1503- binding->data);
1504- }
1505- }
1506- }
1507- else if (type == GRIP_GESTURE_ROTATE)
1508- {
1509- GripEventGestureRotate *rotate = (GripEventGestureRotate *)event;
1510-
1511- rotate->type = type;
1512- rotate->id = id;
1513- rotate->fingers = rotate_gesture_handle_properties (rotate,
1514- attr_count,
1515- attrs);
1516-
1517- if (rotate->fingers == binding->touches)
1518- {
1519- if (matches_widget (binding->widget,
1520- GTK_WIDGET (reg->window)->window,
1521- (gint)rotate->focus_x,
1522- (gint)rotate->focus_y))
1523- {
1524- binding->callback (binding->widget,
1525- GRIP_TIME_START,
1526- event,
1527- binding->data);
1528- }
1529- }
1530- }
1531- else if (type == GRIP_GESTURE_TAP)
1532- {
1533- GripEventGestureTap *tap = (GripEventGestureTap *)event;
1534-
1535- tap->type = type;
1536- tap->id = id;
1537- tap->fingers = tap_gesture_handle_properties (tap,
1538- attr_count,
1539- attrs);
1540-
1541- if (tap->fingers == binding->touches)
1542- {
1543- if (matches_widget (binding->widget,
1544- GTK_WIDGET (reg->window)->window,
1545- (gint)tap->focus_x,
1546- (gint)tap->focus_y))
1547- {
1548- binding->callback (binding->widget,
1549- GRIP_TIME_START,
1550- event,
1551- binding->data);
1552- }
1553- }
1554- }
1555-
1556- grip_gesture_event_free (event);
1557- }
1558- }
1559+ process_gesture(cookie, type, id, attr_count, attrs, GRIP_TIME_START);
1560 }
1561
1562 static void
1563@@ -616,117 +731,7 @@
1564 GeisSize attr_count,
1565 GeisGestureAttr *attrs)
1566 {
1567- GripGestureRegistration *reg = (GripGestureRegistration *)cookie;
1568- GList *l = NULL;
1569-
1570- for (l = reg->bindings; l != NULL; l = l->next)
1571- {
1572- GripGestureBinding *binding = (GripGestureBinding *)l->data;
1573-
1574- if (binding->type == type)
1575- {
1576- GripGestureEvent *event = grip_gesture_event_new (type);
1577-
1578- if (type == GRIP_GESTURE_DRAG)
1579- {
1580- GripEventGestureDrag *drag = (GripEventGestureDrag *)event;
1581-
1582- drag->type = type;
1583- drag->id = id;
1584- drag->fingers = drag_gesture_handle_properties (drag,
1585- attr_count,
1586- attrs);
1587-
1588- if (drag->fingers == binding->touches)
1589- {
1590- if (matches_widget (binding->widget,
1591- GTK_WIDGET (reg->window)->window,
1592- (gint)drag->focus_x,
1593- (gint)drag->focus_y))
1594- {
1595- binding->callback (binding->widget,
1596- GRIP_TIME_UPDATE,
1597- event,
1598- binding->data);
1599- }
1600- }
1601- }
1602- else if (type == GRIP_GESTURE_PINCH)
1603- {
1604- GripEventGesturePinch *pinch = (GripEventGesturePinch *)event;
1605-
1606- pinch->type = type;
1607- pinch->id = id;
1608- pinch->fingers = pinch_gesture_handle_properties (pinch,
1609- attr_count,
1610- attrs);
1611-
1612- if (pinch->fingers == binding->touches)
1613- {
1614- if (matches_widget (binding->widget,
1615- GTK_WIDGET (reg->window)->window,
1616- (gint)pinch->focus_x,
1617- (gint)pinch->focus_y))
1618- {
1619- binding->callback (binding->widget,
1620- GRIP_TIME_UPDATE,
1621- event,
1622- binding->data);
1623- }
1624- }
1625- }
1626- else if (type == GRIP_GESTURE_ROTATE)
1627- {
1628- GripEventGestureRotate *rotate = (GripEventGestureRotate *)event;
1629-
1630- rotate->type = type;
1631- rotate->id = id;
1632- rotate->fingers = rotate_gesture_handle_properties (rotate,
1633- attr_count,
1634- attrs);
1635-
1636- if (rotate->fingers == binding->touches)
1637- {
1638- if (matches_widget (binding->widget,
1639- GTK_WIDGET (reg->window)->window,
1640- (gint)rotate->focus_x,
1641- (gint)rotate->focus_y))
1642- {
1643- binding->callback (binding->widget,
1644- GRIP_TIME_UPDATE,
1645- event,
1646- binding->data);
1647- }
1648- }
1649- }
1650- else if (type == GRIP_GESTURE_TAP)
1651- {
1652- GripEventGestureTap *tap = (GripEventGestureTap *)event;
1653-
1654- tap->type = type;
1655- tap->id = id;
1656- tap->fingers = tap_gesture_handle_properties (tap,
1657- attr_count,
1658- attrs);
1659-
1660- if (tap->fingers == binding->touches)
1661- {
1662- if (matches_widget (binding->widget,
1663- GTK_WIDGET (reg->window)->window,
1664- (gint)tap->focus_x,
1665- (gint)tap->focus_y))
1666- {
1667- binding->callback (binding->widget,
1668- GRIP_TIME_UPDATE,
1669- event,
1670- binding->data);
1671- }
1672- }
1673- }
1674-
1675- grip_gesture_event_free (event);
1676- }
1677- }
1678+ process_gesture(cookie, type, id, attr_count, attrs, GRIP_TIME_UPDATE);
1679 }
1680
1681 static void
1682@@ -736,117 +741,7 @@
1683 GeisSize attr_count,
1684 GeisGestureAttr *attrs)
1685 {
1686- GripGestureRegistration *reg = (GripGestureRegistration *)cookie;
1687- GList *l = NULL;
1688-
1689- for (l = reg->bindings; l != NULL; l = l->next)
1690- {
1691- GripGestureBinding *binding = (GripGestureBinding *)l->data;
1692-
1693- if (binding->type == type)
1694- {
1695- GripGestureEvent *event = grip_gesture_event_new (type);
1696-
1697- if (type == GRIP_GESTURE_DRAG)
1698- {
1699- GripEventGestureDrag *drag = (GripEventGestureDrag *)event;
1700-
1701- drag->type = type;
1702- drag->id = id;
1703- drag->fingers = drag_gesture_handle_properties (drag,
1704- attr_count,
1705- attrs);
1706-
1707- if (drag->fingers == binding->touches)
1708- {
1709- if (matches_widget (binding->widget,
1710- GTK_WIDGET (reg->window)->window,
1711- (gint)drag->focus_x,
1712- (gint)drag->focus_y))
1713- {
1714- binding->callback (binding->widget,
1715- GRIP_TIME_END,
1716- event,
1717- binding->data);
1718- }
1719- }
1720- }
1721- else if (type == GRIP_GESTURE_PINCH)
1722- {
1723- GripEventGesturePinch *pinch = (GripEventGesturePinch *)event;
1724-
1725- pinch->type = type;
1726- pinch->id = id;
1727- pinch->fingers = pinch_gesture_handle_properties (pinch,
1728- attr_count,
1729- attrs);
1730-
1731- if (pinch->fingers == binding->touches)
1732- {
1733- if (matches_widget (binding->widget,
1734- GTK_WIDGET (reg->window)->window,
1735- (gint)pinch->focus_x,
1736- (gint)pinch->focus_y))
1737- {
1738- binding->callback (binding->widget,
1739- GRIP_TIME_END,
1740- event,
1741- binding->data);
1742- }
1743- }
1744- }
1745- else if (type == GRIP_GESTURE_ROTATE)
1746- {
1747- GripEventGestureRotate *rotate = (GripEventGestureRotate *)event;
1748-
1749- rotate->type = type;
1750- rotate->id = id;
1751- rotate->fingers = rotate_gesture_handle_properties (rotate,
1752- attr_count,
1753- attrs);
1754-
1755- if (rotate->fingers == binding->touches)
1756- {
1757- if (matches_widget (binding->widget,
1758- GTK_WIDGET (reg->window)->window,
1759- (gint)rotate->focus_x,
1760- (gint)rotate->focus_y))
1761- {
1762- binding->callback (binding->widget,
1763- GRIP_TIME_END,
1764- event,
1765- binding->data);
1766- }
1767- }
1768- }
1769- else if (type == GRIP_GESTURE_TAP)
1770- {
1771- GripEventGestureTap *tap = (GripEventGestureTap *)event;
1772-
1773- tap->type = type;
1774- tap->id = id;
1775- tap->fingers = tap_gesture_handle_properties (tap,
1776- attr_count,
1777- attrs);
1778-
1779- if (tap->fingers == binding->touches)
1780- {
1781- if (matches_widget (binding->widget,
1782- GTK_WIDGET (reg->window)->window,
1783- (gint)tap->focus_x,
1784- (gint)tap->focus_y))
1785- {
1786- binding->callback (binding->widget,
1787- GRIP_TIME_END,
1788- event,
1789- binding->data);
1790- }
1791- }
1792- }
1793-
1794- grip_gesture_event_free (event);
1795- }
1796- }
1797+ process_gesture(cookie, type, id, attr_count, attrs, GRIP_TIME_END);
1798 }
1799
1800 static void
1801@@ -856,7 +751,14 @@
1802
1803 priv = item->priv = GRIP_GESTURE_MANAGER_GET_PRIVATE (item);
1804
1805- priv->hash = g_hash_table_new (g_direct_hash, g_direct_equal);
1806+ priv->registered_windows = g_hash_table_new (g_direct_hash, g_direct_equal);
1807+
1808+ priv->devices.touchscreen = g_array_new (FALSE, FALSE,
1809+ sizeof(GeisInputDeviceId));
1810+ priv->devices.touchpad = g_array_new (FALSE, FALSE,
1811+ sizeof(GeisInputDeviceId));
1812+ priv->devices.independent = g_array_new (FALSE, FALSE,
1813+ sizeof(GeisInputDeviceId));
1814 }
1815
1816 static gboolean
1817@@ -872,12 +774,8 @@
1818 }
1819
1820 static void
1821-window_destroyed_cb (GtkObject *object,
1822- gpointer user_data)
1823+destroy_registration(GripGestureRegistration *reg)
1824 {
1825- GripGestureManager *manager = (GripGestureManager *)user_data;
1826- GripGestureManagerPrivate *priv = manager->priv;
1827- GripGestureRegistration *reg = g_hash_table_lookup (priv->hash, object);
1828 GList *list;
1829
1830 for (list = reg->bindings; list != NULL; list = list->next)
1831@@ -895,12 +793,23 @@
1832 }
1833
1834 g_list_free (reg->bindings);
1835-
1836 g_io_channel_shutdown (reg->iochannel, TRUE, NULL);
1837-
1838 geis_finish (reg->instance);
1839-
1840- g_hash_table_remove (priv->hash, object);
1841+}
1842+
1843+static void
1844+window_destroyed_cb (GtkWidget *object,
1845+ gpointer user_data)
1846+{
1847+ GripGestureManager *manager = (GripGestureManager *)user_data;
1848+ GripGestureManagerPrivate *priv = manager->priv;
1849+ struct Registrations *reg = g_hash_table_lookup (priv->registered_windows, object);
1850+
1851+ destroy_registration(reg->touchpad);
1852+ destroy_registration(reg->touchscreen);
1853+ destroy_registration(reg->independent);
1854+
1855+ g_hash_table_remove (priv->registered_windows, object);
1856 g_free (reg);
1857 }
1858
1859@@ -924,104 +833,141 @@
1860 }
1861
1862 static void
1863-register_internal (GripGestureManager *manager,
1864- GtkWidget *widget,
1865- GripGestureType gesture_type,
1866- gint touch_points,
1867- GripGestureCallback callback,
1868- gpointer user_data,
1869- GDestroyNotify destroy)
1870-{
1871- GripGestureManagerPrivate *priv;
1872+grip_devices_for_type (GripDeviceType type, GArray *selection,
1873+ GripDevices *devices)
1874+{
1875+ GeisInputDeviceId id;
1876+ int i;
1877+
1878+ if (type & GRIP_DEVICE_TOUCHSCREEN)
1879+ {
1880+ for (i = 0; i < devices->touchscreen->len; i++)
1881+ {
1882+ id = g_array_index (devices->touchscreen, GeisInputDeviceId, i);
1883+ g_array_append_val (selection, id);
1884+ }
1885+ }
1886+ if (type & GRIP_DEVICE_TOUCHPAD)
1887+ {
1888+ for (i = 0; i < devices->touchpad->len; i++)
1889+ {
1890+ id = g_array_index (devices->touchpad, GeisInputDeviceId, i);
1891+ g_array_append_val (selection, id);
1892+ }
1893+ }
1894+ if (type & GRIP_DEVICE_INDEPENDENT)
1895+ {
1896+ for (i = 0; i < devices->independent->len; i++)
1897+ {
1898+ id = g_array_index (devices->independent, GeisInputDeviceId, i);
1899+ g_array_append_val (selection, id);
1900+ }
1901+ }
1902+}
1903+
1904+static GripGestureRegistration* new_window_registration(GripGestureManager *manager,
1905+ GtkWidget *toplevel)
1906+{
1907 GripGestureRegistration *reg;
1908+ GeisInstance instance;
1909+ GIOChannel *iochannel;
1910+ gint fd = -1;
1911+ GeisXcbWinInfo xcb_win_info = {
1912+ .display_name = NULL,
1913+ .screenp = NULL,
1914+ .window_id = GDK_WINDOW_XID (gtk_widget_get_window(toplevel))
1915+ };
1916+ GeisWinInfo win_info = {
1917+ GEIS_XCB_FULL_WINDOW,
1918+ &xcb_win_info
1919+ };
1920+
1921+ if (geis_init (&win_info, &instance) != GEIS_STATUS_SUCCESS)
1922+ {
1923+ g_warning ("Failed to initialize gesture manager.");
1924+ return NULL;
1925+ }
1926+
1927+ if (geis_configuration_supported (instance,
1928+ GEIS_CONFIG_UNIX_FD) != GEIS_STATUS_SUCCESS)
1929+ {
1930+ g_warning ("Gesture manager does not support UNIX fd.");
1931+ return NULL;
1932+ }
1933+
1934+ if (geis_configuration_get_value (instance,
1935+ GEIS_CONFIG_UNIX_FD,
1936+ &fd) != GEIS_STATUS_SUCCESS)
1937+ {
1938+ g_error ("Gesture manager failed to obtain UNIX fd.");
1939+ return NULL;
1940+ }
1941+
1942+ reg = g_new0 (GripGestureRegistration, 1);
1943+
1944+ reg->window = GTK_WINDOW (toplevel);
1945+ reg->instance = instance;
1946+
1947+ g_signal_connect (toplevel,
1948+ "destroy",
1949+ G_CALLBACK (window_destroyed_cb),
1950+ manager);
1951+
1952+ iochannel = g_io_channel_unix_new (fd);
1953+ g_io_add_watch (iochannel,
1954+ G_IO_IN,
1955+ io_callback,
1956+ reg);
1957+
1958+ reg->iochannel = iochannel;
1959+
1960+ reg->gesture_list = g_ptr_array_new ();
1961+
1962+ return reg;
1963+}
1964+
1965+static void
1966+bind_registration(GripGestureManager *manager,
1967+ GripGestureRegistration *reg,
1968+ GtkWidget *widget,
1969+ GripGestureType gesture_type,
1970+ GripDeviceType device_type,
1971+ gint touch_points,
1972+ GripGestureCallback callback,
1973+ gpointer user_data,
1974+ GDestroyNotify destroy)
1975+{
1976+ GripGestureManagerPrivate *priv;
1977 GripGestureBinding *binding;
1978- GtkWidget *toplevel;
1979-
1980- g_return_if_fail (GRIP_IS_GESTURE_MANAGER (manager));
1981- g_return_if_fail (GTK_IS_WIDGET (widget));
1982-
1983- toplevel = gtk_widget_get_toplevel (widget);
1984-
1985- g_return_if_fail (GTK_IS_WINDOW (toplevel));
1986+ GArray *devices;
1987
1988 priv = manager->priv;
1989
1990- if (!(reg = g_hash_table_lookup (priv->hash, toplevel)))
1991- {
1992- GeisInstance instance;
1993- GIOChannel *iochannel;
1994- gint fd = -1;
1995- GeisXcbWinInfo xcb_win_info = {
1996- .display_name = NULL,
1997- .screenp = NULL,
1998- .window_id = GDK_DRAWABLE_XID (toplevel->window)
1999- };
2000- GeisWinInfo win_info = {
2001- GEIS_XCB_FULL_WINDOW,
2002- &xcb_win_info
2003- };
2004-
2005- if (geis_init (&win_info, &instance) != GEIS_STATUS_SUCCESS)
2006- {
2007- g_warning ("Failed to initialize gesture manager.");
2008- return;
2009- }
2010-
2011- if (geis_configuration_supported (instance,
2012- GEIS_CONFIG_UNIX_FD) != GEIS_STATUS_SUCCESS)
2013- {
2014- g_warning ("Gesture manager does not support UNIX fd.");
2015- return;
2016- }
2017-
2018- if (geis_configuration_get_value (instance,
2019- GEIS_CONFIG_UNIX_FD,
2020- &fd) != GEIS_STATUS_SUCCESS)
2021- {
2022- g_error ("Gesture manager failed to obtain UNIX fd.");
2023- return;
2024- }
2025-
2026- reg = g_new0 (GripGestureRegistration, 1);
2027-
2028- reg->window = GTK_WINDOW (toplevel);
2029- reg->instance = instance;
2030-
2031- g_signal_connect (toplevel,
2032- "destroy",
2033- G_CALLBACK (window_destroyed_cb),
2034- manager);
2035-
2036- iochannel = g_io_channel_unix_new (fd);
2037- g_io_add_watch (iochannel,
2038- G_IO_IN,
2039- io_callback,
2040- reg);
2041-
2042- reg->iochannel = iochannel;
2043-
2044- reg->gesture_list = g_ptr_array_new ();
2045- }
2046- else
2047- {
2048- geis_unsubscribe (reg->instance,
2049- (GeisGestureType*)reg->gesture_list->pdata);
2050- }
2051
2052 if (reg->gesture_list->len)
2053 g_ptr_array_remove_index (reg->gesture_list,
2054- reg->gesture_list->len - 1);
2055-
2056- g_ptr_array_add (reg->gesture_list,
2057- (gchar *)grip_type_to_geis_type (gesture_type, touch_points));
2058- g_ptr_array_add (reg->gesture_list,
2059- NULL);
2060+ reg->gesture_list->len - 1);
2061+
2062+ devices = g_array_new (TRUE, FALSE, sizeof(GeisInputDeviceId));
2063+ grip_devices_for_type(device_type, devices, &priv->devices);
2064+ if (devices->len == 0) {
2065+ g_array_free(devices, TRUE);
2066+ return;
2067+ }
2068+
2069+ g_ptr_array_add (reg->gesture_list,
2070+ (gchar *)grip_type_to_geis_type (gesture_type, touch_points));
2071+ g_ptr_array_add (reg->gesture_list,
2072+ NULL);
2073+
2074
2075 geis_subscribe (reg->instance,
2076- GEIS_ALL_INPUT_DEVICES,
2077- (const char**)reg->gesture_list->pdata,
2078- &gesture_funcs,
2079- reg);
2080+ (GeisInputDeviceId *)devices->data,
2081+ (const char**)reg->gesture_list->pdata,
2082+ &gesture_funcs,
2083+ reg);
2084+
2085+ g_array_unref (devices);
2086
2087 /* XXX - check for duplicates in reg->bindings first */
2088 binding = g_new0 (GripGestureBinding, 1);
2089@@ -1035,9 +981,69 @@
2090
2091 reg->bindings = g_list_append (reg->bindings, binding);
2092
2093- g_hash_table_insert (priv->hash,
2094+}
2095+
2096+static void
2097+register_internal (GripGestureManager *manager,
2098+ GtkWidget *widget,
2099+ GripGestureType gesture_type,
2100+ GripDeviceType device_type,
2101+ gint touch_points,
2102+ GripGestureCallback callback,
2103+ gpointer user_data,
2104+ GDestroyNotify destroy)
2105+{
2106+ GripGestureManagerPrivate *priv;
2107+ GtkWidget *toplevel;
2108+ struct Registrations *registrations;
2109+
2110+ g_return_if_fail (GRIP_IS_GESTURE_MANAGER (manager));
2111+ g_return_if_fail (GTK_IS_WIDGET (widget));
2112+
2113+ toplevel = gtk_widget_get_toplevel (widget);
2114+
2115+ g_return_if_fail (GTK_IS_WINDOW (toplevel));
2116+
2117+ priv = manager->priv;
2118+
2119+ if (!(registrations = g_hash_table_lookup (priv->registered_windows, toplevel)))
2120+ {
2121+ registrations = g_new(struct Registrations, 1);
2122+ registrations->touchscreen = new_window_registration(manager, toplevel);
2123+ registrations->touchpad = new_window_registration(manager, toplevel);
2124+ registrations->independent = new_window_registration(manager, toplevel);
2125+
2126+ if (registrations->touchscreen == NULL ||
2127+ registrations->touchpad == NULL ||
2128+ registrations->independent == NULL)
2129+ return;
2130+ }
2131+ else
2132+ {
2133+ geis_unsubscribe (registrations->touchscreen->instance,
2134+ (GeisGestureType*)registrations->touchscreen->gesture_list->pdata);
2135+ geis_unsubscribe (registrations->touchpad->instance,
2136+ (GeisGestureType*)registrations->touchpad->gesture_list->pdata);
2137+ geis_unsubscribe (registrations->independent->instance,
2138+ (GeisGestureType*)registrations->independent->gesture_list->pdata);
2139+ }
2140+
2141+ if (device_type & GRIP_DEVICE_TOUCHSCREEN)
2142+ bind_registration(manager,
2143+ registrations->touchscreen, widget, gesture_type, GRIP_DEVICE_TOUCHSCREEN, touch_points,
2144+ callback, user_data, destroy);
2145+
2146+ if (device_type & GRIP_DEVICE_TOUCHPAD)
2147+ bind_registration(manager,
2148+ registrations->touchpad, widget, gesture_type, GRIP_DEVICE_TOUCHPAD, touch_points,
2149+ callback, user_data, destroy);
2150+ if (device_type & GRIP_DEVICE_INDEPENDENT)
2151+ bind_registration(manager,
2152+ registrations->independent, widget, gesture_type, GRIP_DEVICE_INDEPENDENT, touch_points,
2153+ callback, user_data, destroy);
2154+ g_hash_table_insert (priv->registered_windows,
2155 toplevel,
2156- reg);
2157+ registrations);
2158 }
2159
2160 static void
2161@@ -1061,6 +1067,7 @@
2162 register_internal (req->manager,
2163 req->widget,
2164 req->gesture_type,
2165+ req->device_type,
2166 req->touch_points,
2167 req->callback,
2168 req->user_data,
2169@@ -1094,6 +1101,7 @@
2170 register_widget (GripGestureManager *manager,
2171 GtkWidget *widget,
2172 GripGestureType gesture_type,
2173+ GripDeviceType device_type,
2174 gint touch_points,
2175 GripGestureCallback callback,
2176 gpointer user_data,
2177@@ -1106,6 +1114,7 @@
2178 register_internal (manager,
2179 widget,
2180 gesture_type,
2181+ device_type,
2182 touch_points,
2183 callback,
2184 user_data,
2185@@ -1118,6 +1127,7 @@
2186 req->manager = manager;
2187 req->widget = widget;
2188 req->gesture_type = gesture_type;
2189+ req->device_type = device_type;
2190 req->touch_points = touch_points;
2191 req->callback = callback;
2192 req->user_data = user_data;
2193@@ -1146,6 +1156,7 @@
2194 register_widget (req->manager,
2195 req->widget,
2196 req->gesture_type,
2197+ req->device_type,
2198 req->touch_points,
2199 req->callback,
2200 req->user_data,
2201@@ -1181,6 +1192,7 @@
2202 grip_gesture_manager_register_window (GripGestureManager *manager,
2203 GtkWidget *widget,
2204 GripGestureType gesture_type,
2205+ GripDeviceType device_type,
2206 gint touch_points,
2207 GripGestureCallback callback,
2208 gpointer user_data,
2209@@ -1200,6 +1212,7 @@
2210 register_internal (manager,
2211 widget,
2212 gesture_type,
2213+ device_type,
2214 touch_points,
2215 callback,
2216 user_data,
2217@@ -1213,6 +1226,7 @@
2218 req->manager = manager;
2219 req->widget = widget;
2220 req->gesture_type = gesture_type;
2221+ req->device_type = device_type;
2222 req->touch_points = touch_points;
2223 req->callback = callback;
2224 req->user_data = user_data;
2225@@ -1233,6 +1247,7 @@
2226 req->manager = manager;
2227 req->widget = widget;
2228 req->gesture_type = gesture_type;
2229+ req->device_type = device_type;
2230 req->touch_points = touch_points;
2231 req->callback = callback;
2232 req->user_data = user_data;
2233@@ -1245,6 +1260,40 @@
2234 }
2235 }
2236
2237+static void
2238+shutdown_registration(GripGestureRegistration *reg)
2239+{
2240+ free_registration(reg);
2241+ geis_finish(reg->instance);
2242+ reg->instance = NULL;
2243+ g_free(reg);
2244+}
2245+
2246+void
2247+grip_gesture_manager_unregister_window (GripGestureManager *manager,
2248+ GtkWidget *toplevel)
2249+{
2250+ GripGestureManagerPrivate *priv = manager->priv;
2251+ struct Registrations *registrations;
2252+
2253+ g_return_if_fail (GRIP_IS_GESTURE_MANAGER (manager));
2254+ g_return_if_fail (GTK_IS_WINDOW (toplevel));
2255+
2256+ /* Currently only allow unsubscribing after the window has been shown. */
2257+ g_return_if_fail (gtk_widget_get_mapped (GTK_WIDGET (toplevel)));
2258+ registrations = g_hash_table_lookup (priv->registered_windows, toplevel);
2259+ if (!registrations) {
2260+ return;
2261+ }
2262+
2263+ shutdown_registration(registrations->touchscreen);
2264+ shutdown_registration(registrations->touchpad);
2265+ shutdown_registration(registrations->independent);
2266+ g_free(registrations);
2267+ g_hash_table_remove(priv->registered_windows, toplevel);
2268+
2269+}
2270+
2271 GType
2272 grip_gesture_event_get_type (void)
2273 {
2274
2275=== modified file 'src/gripgesturemanager.h'
2276--- src/gripgesturemanager.h 2011-03-23 15:17:02 +0000
2277+++ src/gripgesturemanager.h 2011-07-11 12:13:41 +0000
2278@@ -23,8 +23,8 @@
2279 * Cody Russell <crussell@canonical.com>
2280 */
2281
2282-#ifndef __GRIP_GESTURE_MANAGER_H__
2283-#define __GRIP_GESTURE_MANAGER_H__
2284+#ifndef GRIP_GESTURE_MANAGER_H
2285+#define GRIP_GESTURE_MANAGER_H
2286
2287 #include <gtk/gtk.h>
2288
2289@@ -56,6 +56,14 @@
2290 } GripGestureType;
2291
2292 typedef enum {
2293+ GRIP_DEVICE_TOUCHSCREEN = 1,
2294+ GRIP_DEVICE_TOUCHPAD = 2,
2295+ GRIP_DEVICE_INDEPENDENT = 4,
2296+} GripDeviceType;
2297+
2298+#define GRIP_DEVICE_ALL (GRIP_DEVICE_TOUCHSCREEN | GRIP_DEVICE_TOUCHPAD | GRIP_DEVICE_INDEPENDENT)
2299+
2300+typedef enum {
2301 GRIP_TIME_START,
2302 GRIP_TIME_UPDATE,
2303 GRIP_TIME_END
2304@@ -201,6 +209,7 @@
2305 * @manager: self
2306 * @widget: A #GtkWidget on which to register the gesture
2307 * @gesture_type: Gesture type
2308+ * @device_type: Type of the device producing the gesture.
2309 * @touch_points: Number of touch points
2310 * @callback: Callback
2311 * @user_data: (transfer none): User data
2312@@ -209,11 +218,15 @@
2313 void grip_gesture_manager_register_window (GripGestureManager *manager,
2314 GtkWidget *widget,
2315 GripGestureType gesture_type,
2316+ GripDeviceType device_type,
2317 gint touch_points,
2318 GripGestureCallback callback,
2319 gpointer user_data,
2320 GDestroyNotify destroy);
2321
2322+void grip_gesture_manager_unregister_window (GripGestureManager *manager,
2323+ GtkWidget *widget);
2324+
2325 GType grip_gesture_event_get_type (void) G_GNUC_CONST;
2326 GripGestureEvent *grip_gesture_event_new (GripGestureType gesture_type);
2327 void grip_gesture_event_free (GripGestureEvent *event);
2328@@ -222,4 +235,4 @@
2329
2330 G_END_DECLS
2331
2332-#endif /* __GRIP_GESTURE_MANAGER_H__ */
2333+#endif /* GRIP_GESTURE_MANAGER_H */
2334
2335=== modified file 'src/griptypebuiltins.c'
2336--- src/griptypebuiltins.c 2011-03-04 19:15:32 +0000
2337+++ src/griptypebuiltins.c 2011-07-11 12:13:41 +0000
2338@@ -21,6 +21,21 @@
2339 return enum_type_id;
2340 }
2341 GType
2342+grip_device_type_get_type(void) {
2343+ static GType enum_type_id = 0;
2344+ if (G_UNLIKELY (!enum_type_id))
2345+ {
2346+ static const GEnumValue values[] = {
2347+ { GRIP_DEVICE_TOUCHSCREEN, "GRIP_DEVICE_TOUCHSCREEN", "touchscreen" },
2348+ { GRIP_DEVICE_TOUCHPAD, "GRIP_DEVICE_TOUCHPAD", "touchpad" },
2349+ { GRIP_DEVICE_INDEPENDENT, "GRIP_DEVICE_INDEPENDENT", "independent" },
2350+ { 0, NULL, NULL }
2351+ };
2352+ enum_type_id = g_enum_register_static (g_intern_static_string ("GripDeviceType"), values);
2353+ }
2354+ return enum_type_id;
2355+}
2356+GType
2357 grip_time_type_get_type(void) {
2358 static GType enum_type_id = 0;
2359 if (G_UNLIKELY (!enum_type_id))
2360
2361=== modified file 'src/griptypebuiltins.h.in'
2362--- src/griptypebuiltins.h.in 2010-11-22 14:49:44 +0000
2363+++ src/griptypebuiltins.h.in 2011-07-11 12:13:41 +0000
2364@@ -1,6 +1,6 @@
2365 /*** BEGIN file-header ***/
2366-#ifndef __GRIP_ENUM_TYPES_H__
2367-#define __GRIP_ENUM_TYPES_H__
2368+#ifndef GRIP_ENUM_TYPES_H
2369+#define GRIP_ENUM_TYPES_H
2370
2371 #include <glib-object.h>
2372
2373@@ -15,7 +15,7 @@
2374 /*** BEGIN file-tail ***/
2375 G_END_DECLS
2376
2377-#endif /* !__GRIP_ENUM_TYPES_H__ */
2378+#endif /* !GRIP_ENUM_TYPES_H */
2379 /*** END file-tail ***/
2380
2381 /*** BEGIN value-header ***/
2382
2383=== renamed file 'src/libgrip-0.1.ver' => 'src/libgrip.ver'
2384--- src/libgrip-0.1.ver 2011-03-04 21:48:13 +0000
2385+++ src/libgrip.ver 2011-07-11 12:13:41 +0000
2386@@ -37,3 +37,7 @@
2387 *;
2388 };
2389
2390+GRIP_0.2 {
2391+ global:
2392+ grip_gesture_manager_unregister_window;
2393+} GRIP_0.1;

Subscribers

People subscribed via source and target branches

to all changes: