Merge lp:~mir-team/qtubuntu/track-mir-deprecations into lp:qtubuntu

Proposed by Robert Carr
Status: Merged
Approved by: Alan Griffiths
Approved revision: 261
Merged at revision: 259
Proposed branch: lp:~mir-team/qtubuntu/track-mir-deprecations
Merge into: lp:qtubuntu
Diff against target: 156 lines (+29/-30)
3 files modified
debian/control (+1/-1)
src/ubuntumirclient/input.cpp (+26/-26)
src/ubuntumirclient/window.cpp (+2/-3)
To merge this branch: bzr merge lp:~mir-team/qtubuntu/track-mir-deprecations
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Gerry Boland (community) code Approve
Review via email: mp+260214@code.launchpad.net

Commit message

Track mir deprecations and renames.

Description of the change

Track mir deprecations and renames.

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
Gerry Boland (gerboland) wrote :

Code looks reasonable, would need to test

review: Approve (code)
260. By Alan Griffiths

merge lp:~mir-team/qtubuntu/track-mir-deprecations

261. By Alan Griffiths

Update libmirclient-dev dependency

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2015-03-05 19:54:57 +0000
3+++ debian/control 2015-05-27 16:02:44 +0000
4@@ -17,7 +17,7 @@
5 qtbase5-private-dev,
6 qtdeclarative5-dev,
7 libqt5sensors5-dev,
8- libmirclient-dev (>= 0.11.0),
9+ libmirclient-dev (>= 0.13.0),
10 # if you don't have have commit access to this branch but would like to upload
11 # directly to Ubuntu, don't worry: your changes will be merged back into the
12 # upstream branch
13
14=== modified file 'src/ubuntumirclient/input.cpp'
15--- src/ubuntumirclient/input.cpp 2015-02-17 17:39:47 +0000
16+++ src/ubuntumirclient/input.cpp 2015-05-27 16:02:44 +0000
17@@ -275,7 +275,7 @@
18
19 void UbuntuInput::dispatchTouchEvent(QWindow *window, const MirInputEvent *ev)
20 {
21- const MirTouchInputEvent *tev = mir_input_event_get_touch_input_event(ev);
22+ const MirTouchEvent *tev = mir_input_event_get_touch_event(ev);
23
24 // FIXME(loicm) Max pressure is device specific. That one is for the Samsung Galaxy Nexus. That
25 // needs to be fixed as soon as the compat input lib adds query support.
26@@ -286,30 +286,30 @@
27
28 // TODO: Is it worth setting the Qt::TouchPointStationary ones? Currently they are left
29 // as Qt::TouchPointMoved
30- const unsigned int kPointerCount = mir_touch_input_event_get_touch_count(tev);
31+ const unsigned int kPointerCount = mir_touch_event_point_count(tev);
32 for (unsigned int i = 0; i < kPointerCount; ++i) {
33 QWindowSystemInterface::TouchPoint touchPoint;
34
35- const float kX = mir_touch_input_event_get_touch_axis_value(tev, i, mir_touch_input_axis_x) + kWindowGeometry.x();
36- const float kY = mir_touch_input_event_get_touch_axis_value(tev, i, mir_touch_input_axis_y) + kWindowGeometry.y(); // see bug lp:1346633 workaround comments elsewhere
37- const float kW = mir_touch_input_event_get_touch_axis_value(tev, i, mir_touch_input_axis_touch_major);
38- const float kH = mir_touch_input_event_get_touch_axis_value(tev, i, mir_touch_input_axis_touch_minor);
39- const float kP = mir_touch_input_event_get_touch_axis_value(tev, i, mir_touch_input_axis_pressure);
40- touchPoint.id = mir_touch_input_event_get_touch_id(tev, i);
41+ const float kX = mir_touch_event_axis_value(tev, i, mir_touch_axis_x) + kWindowGeometry.x();
42+ const float kY = mir_touch_event_axis_value(tev, i, mir_touch_axis_y) + kWindowGeometry.y(); // see bug lp:1346633 workaround comments elsewhere
43+ const float kW = mir_touch_event_axis_value(tev, i, mir_touch_axis_touch_major);
44+ const float kH = mir_touch_event_axis_value(tev, i, mir_touch_axis_touch_minor);
45+ const float kP = mir_touch_event_axis_value(tev, i, mir_touch_axis_pressure);
46+ touchPoint.id = mir_touch_event_id(tev, i);
47 touchPoint.normalPosition = QPointF(kX / kWindowGeometry.width(), kY / kWindowGeometry.height());
48 touchPoint.area = QRectF(kX - (kW / 2.0), kY - (kH / 2.0), kW, kH);
49 touchPoint.pressure = kP / kMaxPressure;
50
51- MirTouchInputEventTouchAction touch_action = mir_touch_input_event_get_touch_action(tev, i);
52+ MirTouchAction touch_action = mir_touch_event_action(tev, i);
53 switch (touch_action)
54 {
55- case mir_touch_input_event_action_down:
56+ case mir_touch_action_down:
57 touchPoint.state = Qt::TouchPointPressed;
58 break;
59- case mir_touch_input_event_action_up:
60+ case mir_touch_action_up:
61 touchPoint.state = Qt::TouchPointReleased;
62 break;
63- case mir_touch_input_event_action_change:
64+ case mir_touch_action_change:
65 default:
66 touchPoint.state = Qt::TouchPointMoved;
67 }
68@@ -363,23 +363,23 @@
69
70 void UbuntuInput::dispatchKeyEvent(QWindow *window, const MirInputEvent *event)
71 {
72- const MirKeyInputEvent *key_event = mir_input_event_get_key_input_event(event);
73+ const MirKeyboardEvent *key_event = mir_input_event_get_keyboard_event(event);
74
75 ulong timestamp = mir_input_event_get_event_time(event) / 1000000;
76- xkb_keysym_t xk_sym = mir_key_input_event_get_key_code(key_event);
77+ xkb_keysym_t xk_sym = mir_keyboard_event_key_code(key_event);
78
79 // Key modifier and unicode index mapping.
80- auto modifiers = qt_modifiers_from_mir(mir_key_input_event_get_modifiers(key_event));
81+ auto modifiers = qt_modifiers_from_mir(mir_keyboard_event_modifiers(key_event));
82
83- MirKeyInputEventAction action = mir_key_input_event_get_action(key_event);
84- QEvent::Type keyType = action == mir_key_input_event_action_up
85+ MirKeyboardAction action = mir_keyboard_event_action(key_event);
86+ QEvent::Type keyType = action == mir_keyboard_action_up
87 ? QEvent::KeyRelease : QEvent::KeyPress;
88
89 char s[2];
90 int sym = translateKeysym(xk_sym, s, sizeof(s));
91 QString text = QString::fromLatin1(s);
92
93- bool is_auto_rep = action == mir_key_input_event_action_repeat;
94+ bool is_auto_rep = action == mir_keyboard_action_repeat;
95
96 QPlatformInputContext *context = QGuiApplicationPrivate::platformIntegration()->inputContext();
97 if (context) {
98@@ -396,14 +396,14 @@
99
100 namespace
101 {
102-Qt::MouseButtons extract_buttons(const MirPointerInputEvent *pev)
103+Qt::MouseButtons extract_buttons(const MirPointerEvent *pev)
104 {
105 Qt::MouseButtons buttons = Qt::NoButton;
106- if (mir_pointer_input_event_get_button_state(pev, mir_pointer_input_button_primary))
107+ if (mir_pointer_event_button_state(pev, mir_pointer_button_primary))
108 buttons |= Qt::LeftButton;
109- if (mir_pointer_input_event_get_button_state(pev, mir_pointer_input_button_secondary))
110+ if (mir_pointer_event_button_state(pev, mir_pointer_button_secondary))
111 buttons |= Qt::RightButton;
112- if (mir_pointer_input_event_get_button_state(pev, mir_pointer_input_button_tertiary))
113+ if (mir_pointer_event_button_state(pev, mir_pointer_button_tertiary))
114 buttons |= Qt::MidButton;
115
116 // TODO: Should mir back and forward buttons exist?
117@@ -416,12 +416,12 @@
118 {
119 auto timestamp = mir_input_event_get_event_time(ev) / 1000000;
120
121- auto pev = mir_input_event_get_pointer_input_event(ev);
122- auto modifiers = qt_modifiers_from_mir(mir_pointer_input_event_get_modifiers(pev));
123+ auto pev = mir_input_event_get_pointer_event(ev);
124+ auto modifiers = qt_modifiers_from_mir(mir_pointer_event_modifiers(pev));
125 auto buttons = extract_buttons(pev);
126
127- auto local_point = QPointF(mir_pointer_input_event_get_axis_value(pev, mir_pointer_input_axis_x),
128- mir_pointer_input_event_get_axis_value(pev, mir_pointer_input_axis_y));
129+ auto local_point = QPointF(mir_pointer_event_axis_value(pev, mir_pointer_axis_x),
130+ mir_pointer_event_axis_value(pev, mir_pointer_axis_y));
131
132 QWindowSystemInterface::handleMouseEvent(window, timestamp, local_point, local_point /* Should we omit global point instead? */,
133 buttons, modifiers);
134
135=== modified file 'src/ubuntumirclient/window.cpp'
136--- src/ubuntumirclient/window.cpp 2015-02-23 19:53:45 +0000
137+++ src/ubuntumirclient/window.cpp 2015-05-27 16:02:44 +0000
138@@ -119,8 +119,7 @@
139 UbuntuWindow* platformWindow = static_cast<UbuntuWindow*>(context);
140 platformWindow->priv()->surface = surface;
141
142- MirEventDelegate handler = {eventCallback, context};
143- mir_surface_set_event_handler(surface, &handler);
144+ mir_surface_set_event_handler(surface, eventCallback, context);
145 }
146
147 UbuntuWindow::UbuntuWindow(QWindow* w, QSharedPointer<UbuntuClipboard> clipboard, UbuntuScreen* screen,
148@@ -279,7 +278,7 @@
149 mir_surface_spec_release(spec);
150
151 DASSERT(d->surface != NULL);
152- d->createEGLSurface((EGLNativeWindowType)mir_surface_get_egl_native_window(d->surface));
153+ d->createEGLSurface((EGLNativeWindowType)mir_buffer_stream_get_egl_native_window(mir_surface_get_buffer_stream(d->surface)));
154
155 if (d->state == Qt::WindowFullScreen) {
156 // TODO: We could set this on creation once surface spec supports it (mps already up)

Subscribers

People subscribed via source and target branches