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
=== modified file 'ChangeLog'
--- ChangeLog 2011-03-22 16:35:35 +0000
+++ ChangeLog 2011-03-23 02:02:26 +0000
@@ -1,5 +1,13 @@
12011-03-22 Stephen M. Webb <stephen.webb@canonical.com>12011-03-22 Stephen M. Webb <stephen.webb@canonical.com>
22
3 Added a default back end (LP: #740311).
4
5 * examples/geis2.c (dump_gesture_event): dumped more info
6 (main): removed GEIS_INIT_UTOUCH_XCB from geis_new call
7 * libutouch-geis/geis.c (geis_new): added GEIS_INIT_UTOUCH_XCB as default
8
92011-03-22 Stephen M. Webb <stephen.webb@canonical.com>
10
3 Passed the correct gesture_id to GEIS v1 callbacks (LP: #740284).11 Passed the correct gesture_id to GEIS v1 callbacks (LP: #740284).
412
5 * libutouch-geis/backend/xcb/geis_xcb_backend.c (_dispatch_gesture):13 * libutouch-geis/backend/xcb/geis_xcb_backend.c (_dispatch_gesture):
614
=== modified file 'examples/geis2.c'
--- examples/geis2.c 2011-03-17 04:06:04 +0000
+++ examples/geis2.c 2011-03-23 02:02:26 +0000
@@ -87,6 +87,7 @@
87 {87 {
88 GeisSize j;88 GeisSize j;
89 GeisGroup group = geis_groupset_group(groupset, i);89 GeisGroup group = geis_groupset_group(groupset, i);
90 printf("+group %u\n", geis_group_id(group));
9091
91 for (j=0; j < geis_group_frame_count(group); ++j)92 for (j=0; j < geis_group_frame_count(group); ++j)
92 {93 {
@@ -94,6 +95,7 @@
94 GeisFrame frame = geis_group_frame(group, j);95 GeisFrame frame = geis_group_frame(group, j);
95 GeisSize attr_count = geis_frame_attr_count(frame);96 GeisSize attr_count = geis_frame_attr_count(frame);
9697
98 printf("+frame %u\n", geis_frame_id(frame));
97 for (k = 0; k < attr_count; ++k)99 for (k = 0; k < attr_count; ++k)
98 {100 {
99 print_attr(geis_frame_attr(frame, k));101 print_attr(geis_frame_attr(frame, k));
@@ -124,8 +126,7 @@
124 GeisFilter filter;126 GeisFilter filter;
125 int fd;127 int fd;
126128
127 geis = geis_new(GEIS_INIT_UTOUCH_XCB,129 geis = geis_new(GEIS_INIT_TRACK_DEVICES,
128 GEIS_INIT_TRACK_DEVICES,
129 NULL);130 NULL);
130 subscription = geis_subscription_new(geis, "example", GEIS_SUBSCRIPTION_CONT);131 subscription = geis_subscription_new(geis, "example", GEIS_SUBSCRIPTION_CONT);
131 filter = geis_filter_new(geis, "filter");132 filter = geis_filter_new(geis, "filter");
132133
=== modified file 'libutouch-geis/geis.c'
--- libutouch-geis/geis.c 2011-03-11 18:53:40 +0000
+++ libutouch-geis/geis.c 2011-03-23 02:02:26 +0000
@@ -374,10 +374,16 @@
374 }374 }
375 else375 else
376 {376 {
377 geis_warning("back end not specified, defaulting to XCB");
378 geis->backend = geis_xcb_backend_new(geis, track_devices, track_classes);
379 }
380 if (!geis->backend)
381 {
377 geis_error_push(NULL, GEIS_STATUS_UNKNOWN_ERROR);382 geis_error_push(NULL, GEIS_STATUS_UNKNOWN_ERROR);
378 geis_error("back end required but not specified");383 geis_error("can not create back end");
379 status = GEIS_FALSE;384 status = GEIS_FALSE;
380 }385 }
386
381 return status;387 return status;
382}388}
383389

Subscribers

People subscribed via source and target branches