Merge lp:~laney/platform-api/1350874 into lp:platform-api

Proposed by Iain Lane
Status: Merged
Approved by: Thomas Voß
Approved revision: 258
Merged at revision: 258
Proposed branch: lp:~laney/platform-api/1350874
Merge into: lp:platform-api
Diff against target: 64 lines (+14/-22)
2 files modified
include/ubuntu/application/ui/input/event.h (+13/-11)
include/ubuntu/application/ui/input/event_deprecated.h (+1/-11)
To merge this branch: bzr merge lp:~laney/platform-api/1350874
Reviewer Review Type Date Requested Status
Thomas Voß (community) Approve
PS Jenkins bot continuous-integration Approve
Ubuntu Phablet Team Pending
Review via email: mp+231171@code.launchpad.net

Commit message

Fix error by pulling out and sharing a struct instead of defining it twice.

Description of the change

Pull out PointerCoordinate struct shared between two files

structs have file scope. This means that a struct declared within a struct is
still visible outside it. In this case event_deprecated.h is included into
event.h and they both define an identical struct called PointerCoordinate.

Pull the definition out and share it. This does not add new API due to the
scoping rule mentioned previously.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Iain Lane (laney) wrote :

On Mon, Aug 18, 2014 at 11:40:35AM -0000, PS Jenkins bot wrote:
> […]
> FAILURE: http://jenkins.qa.ubuntu.com/job/platform-api-utopic-armhf-ci/86/console
> […]

No details. Did I break this?

--
Iain Lane [ <email address hidden> ]
Debian Developer [ <email address hidden> ]
Ubuntu Developer [ <email address hidden> ]

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Thomas Voß (thomas-voss) wrote :

LGTM.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'include/ubuntu/application/ui/input/event.h'
2--- include/ubuntu/application/ui/input/event.h 2014-07-15 12:41:35 +0000
3+++ include/ubuntu/application/ui/input/event.h 2014-08-18 11:11:21 +0000
4@@ -142,6 +142,18 @@
5 int is_system_key; ///< \deprecated Do not use.
6 } KeyEvent;
7
8+struct PointerCoordinate
9+{
10+ int id; ///< Unique id of the pointer
11+ float x, raw_x; ///< Processed and raw x coordinates
12+ float y, raw_y; ///< Processed and raw y coordinates
13+ float touch_major; ///< Touch major coordinate
14+ float touch_minor; ///< Touch minor coordinate
15+ float size; ///< Size of the pointer/touch
16+ float pressure; ///< Pressure of the touch
17+ float orientation; ///< Orientation
18+};
19+
20 /** Information describing an event originating from a
21 * "moving" device, e.g., a mouse, a mouse-wheel, a finger
22 * on a touchpad.
23@@ -165,17 +177,7 @@
24 nsecs_t down_time; ///< Timestamp that marks the down event
25 nsecs_t event_time; ///< Timestamp that marks when this event happened
26 size_t pointer_count; ///< Number of pointers reported in this event
27- struct PointerCoordinate
28- {
29- int id; ///< Unique id of the pointer
30- float x, raw_x; ///< Processed and raw x coordinates
31- float y, raw_y; ///< Processed and raw y coordinates
32- float touch_major; ///< Touch major coordinate
33- float touch_minor; ///< Touch minor coordinate
34- float size; ///< Size of the pointer/touch
35- float pressure; ///< Pressure of the touch
36- float orientation; ///< Orientation
37- } pointer_coordinates[UBUNTU_APPLICATION_UI_INPUT_EVENT_MAX_POINTER_COUNT]; ///< Pointer information, valid from [0,pointer_count).
38+ struct PointerCoordinate pointer_coordinates[UBUNTU_APPLICATION_UI_INPUT_EVENT_MAX_POINTER_COUNT]; ///< Pointer information, valid from [0,pointer_count).
39 } MotionEvent;
40
41 typedef struct
42
43=== modified file 'include/ubuntu/application/ui/input/event_deprecated.h'
44--- include/ubuntu/application/ui/input/event_deprecated.h 2014-07-15 12:41:35 +0000
45+++ include/ubuntu/application/ui/input/event_deprecated.h 2014-08-18 11:11:21 +0000
46@@ -76,17 +76,7 @@
47 nsecs_t down_time; ///< Timestamp that marks the down event
48 nsecs_t event_time; ///< Timestamp that marks when this event happened
49 size_t pointer_count; ///< Number of pointers reported in this event
50- struct PointerCoordinate
51- {
52- int id; ///< Unique id of the pointer
53- float x, raw_x; ///< Processed and raw x coordinates
54- float y, raw_y; ///< Processed and raw y coordinates
55- float touch_major; ///< Touch major coordinate
56- float touch_minor; ///< Touch minor coordinate
57- float size; ///< Size of the pointer/touch
58- float pressure; ///< Pressure of the touch
59- float orientation; ///< Orientation
60- } pointer_coordinates[UBUNTU_APPLICATION_UI_INPUT_EVENT_MAX_POINTER_COUNT]; ///< Pointer information, valid from [0,pointer_count).
61+ struct PointerCoordinate pointer_coordinates[UBUNTU_APPLICATION_UI_INPUT_EVENT_MAX_POINTER_COUNT]; ///< Pointer information, valid from [0,pointer_count).
62 } motion;
63 } details;
64 } Event;

Subscribers

People subscribed via source and target branches