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

Proposed by Stephen M. Webb
Status: Merged
Merged at revision: 122
Proposed branch: lp:~bregma/geis/lp-740311
Merge into: lp:geis
Diff against target: 68 lines (+18/-3)
3 files modified
ChangeLog (+8/-0)
examples/geis2.c (+3/-2)
libutouch-geis/geis.c (+7/-1)
To merge this branch: bzr merge lp:~bregma/geis/lp-740311
Reviewer Review Type Date Requested Status
Chase Douglas (community) Approve
Henrik Rydberg (community) Approve
Review via email: mp+54459@code.launchpad.net

Description of the change

Removes the requirement of choosing a default in client code.

This change can not rationally be tested using automated unit testing. The program examples/geis2.c was modified to remove the back end init argument to geis_init() and run manually. The program correctly used the XCB back end, confirming the effect of the change.

To post a comment you must log in.
Revision history for this message
Henrik Rydberg (rydberg) wrote :

Does geis_new() require a NULL argument now?

review: Needs Information
Revision history for this message
Stephen M. Webb (bregma) wrote :

> Does geis_new() require a NULL argument now?

The function geis_new() still requires a NULL argument to terminate the list of initializers, even if that list is empty. Only the requirement to specify the back end to use has been removed from the code, bringing the code into line with the C bindings specification.

Revision history for this message
Henrik Rydberg (rydberg) wrote :

Thank you - I was reading the function declaration of an old version.

review: Approve
Revision history for this message
Chase Douglas (chasedouglas) wrote :

Looks good to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2011-03-22 16:35:35 +0000
3+++ ChangeLog 2011-03-23 02:02:26 +0000
4@@ -1,5 +1,13 @@
5 2011-03-22 Stephen M. Webb <stephen.webb@canonical.com>
6
7+ Added a default back end (LP: #740311).
8+
9+ * examples/geis2.c (dump_gesture_event): dumped more info
10+ (main): removed GEIS_INIT_UTOUCH_XCB from geis_new call
11+ * libutouch-geis/geis.c (geis_new): added GEIS_INIT_UTOUCH_XCB as default
12+
13+2011-03-22 Stephen M. Webb <stephen.webb@canonical.com>
14+
15 Passed the correct gesture_id to GEIS v1 callbacks (LP: #740284).
16
17 * libutouch-geis/backend/xcb/geis_xcb_backend.c (_dispatch_gesture):
18
19=== modified file 'examples/geis2.c'
20--- examples/geis2.c 2011-03-17 04:06:04 +0000
21+++ examples/geis2.c 2011-03-23 02:02:26 +0000
22@@ -87,6 +87,7 @@
23 {
24 GeisSize j;
25 GeisGroup group = geis_groupset_group(groupset, i);
26+ printf("+group %u\n", geis_group_id(group));
27
28 for (j=0; j < geis_group_frame_count(group); ++j)
29 {
30@@ -94,6 +95,7 @@
31 GeisFrame frame = geis_group_frame(group, j);
32 GeisSize attr_count = geis_frame_attr_count(frame);
33
34+ printf("+frame %u\n", geis_frame_id(frame));
35 for (k = 0; k < attr_count; ++k)
36 {
37 print_attr(geis_frame_attr(frame, k));
38@@ -124,8 +126,7 @@
39 GeisFilter filter;
40 int fd;
41
42- geis = geis_new(GEIS_INIT_UTOUCH_XCB,
43- GEIS_INIT_TRACK_DEVICES,
44+ geis = geis_new(GEIS_INIT_TRACK_DEVICES,
45 NULL);
46 subscription = geis_subscription_new(geis, "example", GEIS_SUBSCRIPTION_CONT);
47 filter = geis_filter_new(geis, "filter");
48
49=== modified file 'libutouch-geis/geis.c'
50--- libutouch-geis/geis.c 2011-03-11 18:53:40 +0000
51+++ libutouch-geis/geis.c 2011-03-23 02:02:26 +0000
52@@ -374,10 +374,16 @@
53 }
54 else
55 {
56+ geis_warning("back end not specified, defaulting to XCB");
57+ geis->backend = geis_xcb_backend_new(geis, track_devices, track_classes);
58+ }
59+ if (!geis->backend)
60+ {
61 geis_error_push(NULL, GEIS_STATUS_UNKNOWN_ERROR);
62- geis_error("back end required but not specified");
63+ geis_error("can not create back end");
64 status = GEIS_FALSE;
65 }
66+
67 return status;
68 }
69

Subscribers

People subscribed via source and target branches