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

Proposed by Stephen M. Webb
Status: Merged
Merged at revision: 120
Proposed branch: lp:~bregma/geis/lp-737745
Merge into: lp:geis
Diff against target: 98 lines (+20/-26)
4 files modified
ChangeLog (+12/-0)
libutouch-geis/backend/xcb/geis_xcb_backend.c (+8/-7)
libutouch-geis/backend/xcb/grail_gestures.c (+0/-17)
libutouch-geis/backend/xcb/grail_gestures.h (+0/-2)
To merge this branch: bzr merge lp:~bregma/geis/lp-737745
Reviewer Review Type Date Requested Status
Henrik Rydberg (community) Approve
Chase Douglas (community) Approve
Review via email: mp+54373@code.launchpad.net

Description of the change

Corrects the gesture touch count to reflect the number of touches returned from grail.

To post a comment you must log in.
Revision history for this message
Chase Douglas (chasedouglas) wrote :

Looks good to me. Probably should have a test unit, but we're crunched on time.

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

Same here.

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-17 23:42:48 +0000
+++ ChangeLog 2011-03-22 16:16:31 +0000
@@ -1,3 +1,15 @@
12011-03-22 Stephen M. Webb <stephen.webb@canonical.com>
2
3 Corrected the number of touches on a gesture event (LP: #737745)
4
5 * libutouch-geis/backend/xcb/geis_xcb_backend.c (_dispatch_gesture):
6 replaced geis_xcb_backend_touch_count() call with a calculation based on
7 the number of touch properties passed from grail
8 * libutouch-geis/backend/xcb/grail_gestures.c (geis_xcb_backend_touch_count):
9 removed
10 * libutouch-geis/backend/xcb/grail_gestures.h (geis_xcb_backend_touch_count):
11 removed
12
12011-03-17 Stephen M. Webb <stephen.webb@canonical.com>132011-03-17 Stephen M. Webb <stephen.webb@canonical.com>
214
3 Added definitions for GEIS v1 gesture primitive types (LP: #737230).15 Added definitions for GEIS v1 gesture primitive types (LP: #737230).
416
=== modified file 'libutouch-geis/backend/xcb/geis_xcb_backend.c'
--- libutouch-geis/backend/xcb/geis_xcb_backend.c 2011-03-16 22:12:42 +0000
+++ libutouch-geis/backend/xcb/geis_xcb_backend.c 2011-03-22 16:16:31 +0000
@@ -206,6 +206,7 @@
206 float *properties = (float *)(grail_event + 1);206 float *properties = (float *)(grail_event + 1);
207 GeisSize num_properties = grail_event->num_props;207 GeisSize num_properties = grail_event->num_props;
208 GeisSize num_unmapped_properties = num_properties;208 GeisSize num_unmapped_properties = num_properties;
209 GeisSize touch_count;
209210
210 geis_attr_set_destructor(group_attr, (GeisAttrDestructor)geis_groupset_delete);211 geis_attr_set_destructor(group_attr, (GeisAttrDestructor)geis_groupset_delete);
211 geis_attr_set_destructor(touch_attr, (GeisAttrDestructor)geis_touchset_delete);212 geis_attr_set_destructor(touch_attr, (GeisAttrDestructor)geis_touchset_delete);
@@ -271,18 +272,18 @@
271 &grail_event->focus_y);272 &grail_event->focus_y);
272 geis_frame_add_attr(frame, attr);273 geis_frame_add_attr(frame, attr);
273274
274 GeisSize touch_count = geis_xcb_backend_touch_count(grail_event->gesture_type);275 num_unmapped_properties = geis_xcb_backend_map_grail_attrs(
276 grail_event->gesture_type,
277 num_properties, properties, frame);
278
279 /* any remaining properties are touch properties */
280 touch_count = (num_properties - num_unmapped_properties) / 3;
281 properties += touch_count * 3;
275 attr = geis_attr_new(GEIS_GESTURE_ATTRIBUTE_TOUCHES,282 attr = geis_attr_new(GEIS_GESTURE_ATTRIBUTE_TOUCHES,
276 GEIS_ATTR_TYPE_INTEGER,283 GEIS_ATTR_TYPE_INTEGER,
277 &touch_count);284 &touch_count);
278 geis_frame_add_attr(frame, attr);285 geis_frame_add_attr(frame, attr);
279286
280 num_unmapped_properties = geis_xcb_backend_map_grail_attrs(
281 grail_event->gesture_type,
282 num_properties, properties, frame);
283
284 /* any remaining properties are touch properties */
285 properties += (num_properties - num_unmapped_properties);
286 GeisSize i;287 GeisSize i;
287 for (i = 0; i < touch_count; ++i)288 for (i = 0; i < touch_count; ++i)
288 {289 {
289290
=== modified file 'libutouch-geis/backend/xcb/grail_gestures.c'
--- libutouch-geis/backend/xcb/grail_gestures.c 2011-03-17 23:42:48 +0000
+++ libutouch-geis/backend/xcb/grail_gestures.c 2011-03-22 16:16:31 +0000
@@ -342,23 +342,6 @@
342342
343343
344GeisSize344GeisSize
345geis_xcb_backend_touch_count(GeisInteger grail_type)
346{
347 const GrailClassMap *grail_class;
348 for (grail_class = s_grail_class_map;
349 grail_class->geis_class_id >= 0;
350 ++grail_class)
351 {
352 if (grail_class->grail_type == grail_type)
353 {
354 return grail_class->touch_count;
355 }
356 }
357 return 0;
358}
359
360
361GeisSize
362geis_xcb_backend_map_grail_attrs(GeisInteger grail_type,345geis_xcb_backend_map_grail_attrs(GeisInteger grail_type,
363 GeisSize num_properties,346 GeisSize num_properties,
364 float *properties,347 float *properties,
365348
=== modified file 'libutouch-geis/backend/xcb/grail_gestures.h'
--- libutouch-geis/backend/xcb/grail_gestures.h 2011-02-17 18:16:05 +0000
+++ libutouch-geis/backend/xcb/grail_gestures.h 2011-03-22 16:16:31 +0000
@@ -31,8 +31,6 @@
3131
32GeisInteger geis_xcb_backend_primitive_class(GeisInteger grail_gesture_type);32GeisInteger geis_xcb_backend_primitive_class(GeisInteger grail_gesture_type);
3333
34GeisSize geis_xcb_backend_touch_count(GeisInteger grail_gesture_type);
35
36GeisSize geis_xcb_backend_map_grail_attrs(GeisInteger grail_type,34GeisSize geis_xcb_backend_map_grail_attrs(GeisInteger grail_type,
37 GeisSize num_properties,35 GeisSize num_properties,
38 float *properties,36 float *properties,

Subscribers

People subscribed via source and target branches