Merge lp:~bregma/geis/lp-891654 into lp:geis

Proposed by Stephen M. Webb on 2011-11-22
Status: Merged
Merged at revision: 176
Proposed branch: lp:~bregma/geis/lp-891654
Merge into: lp:geis
Diff against target: 107 lines (+42/-3)
6 files modified
include/geis/geis.h (+15/-0)
libutouch-geis/Makefile.am (+1/-1)
libutouch-geis/geis.c (+15/-0)
libutouch-geis/libutouch-geis.ver (+5/-0)
testsuite/geis2/Makefile.am (+1/-2)
testsuite/geis2/check_device.c (+5/-0)
To merge this branch: bzr merge lp:~bregma/geis/lp-891654
Reviewer Review Type Date Requested Status
Jussi Pakkanen (community) Approve on 2011-11-23
Chase Douglas (community) 2011-11-22 Approve on 2011-11-22
Review via email: mp+83070@code.launchpad.net

Description of the change

Added a new API call, geis_get_device().

Includes unit tests and appropriate API versioon bump.

To post a comment you must log in.
Chase Douglas (chasedouglas) wrote :

I assume the -Wall -Werror -pedantic CFLAGS are set elsewhere when compiling the tests?

Otherwise, looks good!

review: Approve
Stephen M. Webb (bregma) wrote :

The "-Wall -Wextra -Werror -pedantic -std=iso9899:1999 -D_GNU_SOURCE=1" flags are set in AM_CFLAGS universally for the entire project, unless a $(target)_CFLAGS explicitly overrides them (which was what was happening, causing a test case failure due to a C99ism in the new test code, and I'd rather build with the same flags everywhere anyways).

Jussi Pakkanen (jpakkane) wrote :

Yes.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'include/geis/geis.h'
2--- include/geis/geis.h 2011-10-14 17:45:23 +0000
3+++ include/geis/geis.h 2011-11-22 20:39:25 +0000
4@@ -1159,6 +1159,21 @@
5 void *context);
6
7 /**
8+ * Gets a cached device description for an identified device.
9+ *
10+ * @param[in] geis The GEIS API instance.
11+ * @param[in] device_id Identifies the device.
12+ *
13+ * The GEIS instance caches a list of gesture-capable input devices that have
14+ * been reported. The GeisDevice description for an identified device may be
15+ * retrieved from that cache with this call.
16+ *
17+ * @returns a valid GeisDevice for the identified device, or NULL if no such
18+ * device is in the cache.
19+ */
20+GEIS_API GeisDevice geis_get_device(Geis geis, GeisInteger device_id);
21+
22+/**
23 * Adds a reference count to a device.
24 * @memberof GeisDevice
25 *
26
27=== modified file 'libutouch-geis/Makefile.am'
28--- libutouch-geis/Makefile.am 2011-10-04 02:53:52 +0000
29+++ libutouch-geis/Makefile.am 2011-11-22 20:39:25 +0000
30@@ -63,7 +63,7 @@
31
32 libutouch_geis_la_LDFLAGS = \
33 -Wl,-z,defs -Wl,--as-needed \
34- -version-info 3:0:2 \
35+ -version-info 4:0:3 \
36 -Wl,--version-script=$(version_script) \
37 -lm
38
39
40=== modified file 'libutouch-geis/geis.c'
41--- libutouch-geis/geis.c 2011-10-31 22:29:01 +0000
42+++ libutouch-geis/geis.c 2011-11-22 20:39:25 +0000
43@@ -1196,4 +1196,19 @@
44 return GEIS_ATTR_TYPE_UNKNOWN;
45 }
46
47+GeisDevice
48+geis_get_device(Geis geis, GeisInteger device_id)
49+{
50+ GeisDevice device = NULL;
51+ for (GeisSize i = 0; i < geis_device_bag_count(geis->devices); ++i)
52+ {
53+ GeisDevice d = geis_device_bag_device(geis->devices, i);
54+ if (geis_device_id(d) == device_id)
55+ {
56+ device = d;
57+ break;
58+ }
59+ }
60+ return device;
61+}
62
63
64=== modified file 'libutouch-geis/libutouch-geis.ver'
65--- libutouch-geis/libutouch-geis.ver 2011-02-17 17:40:49 +0000
66+++ libutouch-geis/libutouch-geis.ver 2011-11-22 20:39:25 +0000
67@@ -88,6 +88,11 @@
68 geis_touchset_touch;
69 geis_touchset_touch_by_id;
70 geis_touchset_touch_count;
71+};
72+
73+GEIS_2.2 {
74+ global:
75+ geis_get_device;
76
77 local:
78 *;
79
80=== modified file 'testsuite/geis2/Makefile.am'
81--- testsuite/geis2/Makefile.am 2011-08-17 04:26:54 +0000
82+++ testsuite/geis2/Makefile.am 2011-11-22 20:39:25 +0000
83@@ -29,8 +29,7 @@
84 check_version_macro.c \
85 check_geis2_api.c
86
87-check_geis2_api_CFLAGS = \
88- -Wall -Wextra -pedantic \
89+check_geis2_api_CPPFLAGS = \
90 -Wno-unused \
91 -I$(top_srcdir) \
92 -I$(top_srcdir)/include \
93
94=== modified file 'testsuite/geis2/check_device.c'
95--- testsuite/geis2/check_device.c 2011-08-20 02:26:43 +0000
96+++ testsuite/geis2/check_device.c 2011-11-22 20:39:25 +0000
97@@ -86,6 +86,11 @@
98 }
99 fail_unless(device_event_count > 0, "no device events received");
100
101+ GeisDevice failer = geis_get_device(g_geis, 123);
102+ fail_unless(failer == NULL, "unexpected device retrieved");
103+
104+ GeisDevice gooder = geis_get_device(g_geis, 0);
105+ fail_unless(gooder != NULL, "failed to retrive cached device");
106 }
107 END_TEST
108

Subscribers

People subscribed via source and target branches