Merge lp:~brandontschaefer/mir/deprecate-input-device-api into lp:mir
- deprecate-input-device-api
- Merge into development-branch
Status: | Superseded |
---|---|
Proposed branch: | lp:~brandontschaefer/mir/deprecate-input-device-api |
Merge into: | lp:mir |
Diff against target: |
441 lines (+90/-81) 14 files modified
debian/control (+2/-2) debian/libmircommon7.install (+1/-1) include/client/mir_toolkit/events/input_device_state_event.h (+15/-1) include/test/mir/test/event_matchers.h (+8/-2) src/client/event.cpp (+10/-2) src/client/event_printer.cpp (+4/-4) src/client/symbols.map (+1/-0) src/common/CMakeLists.txt (+1/-1) src/common/events/input_device_state_event.cpp (+2/-2) src/common/symbols.map (+15/-48) src/include/common/mir/events/input_device_state_event.h (+1/-1) src/server/graphics/nested/input_platform.cpp (+6/-2) tests/unit-tests/input/android/test_android_input_sender.cpp (+8/-6) tests/unit-tests/input/test_event_builders.cpp (+16/-9) |
To merge this branch: | bzr merge lp:~brandontschaefer/mir/deprecate-input-device-api |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mir CI Bot | continuous-integration | Approve | |
Andreas Pokorny (community) | Needs Resubmitting | ||
Review via email: mp+306532@code.launchpad.net |
This proposal has been superseded by a proposal from 2016-09-23.
Commit message
Deprecate mir_input_
Description of the change
Deprecate
uint32_t const* mir_input_
to
uint32_t mir_input_
Issue:
The original one would return a non opaque pointer to a memory location in MirEvent* making it harder to change the underlying structure.
For example moving to capntproto it doesnt allow returning raw pointers from its memory pool. This means we cannot return the uint32_t* required with out extra hacking.
This function was just released in 0.24, and talking with anpok it has not been used. He would be the one using it for qt/gtk.
Since it has not been used, it'll just be easier to return a nullptr vs maintain behaviour that would require extra hacks in capnproto to preserve a uint32_t* for the lifetime of the MirEvent.
Mir CI Bot (mir-ci-bot) wrote : | # |
Mir CI Bot (mir-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:3715
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Andreas Pokorny (andreas-pokorny) wrote : | # |
ok..
the old api is not used yet - other than internally.
Andreas Pokorny (andreas-pokorny) wrote : | # |
ok this is breaking the mircommon ABI.. so you would have to have the mircommon7 MP as a prereq.
Mir CI Bot (mir-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:3716
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Preview Diff
1 | === modified file 'debian/control' | |||
2 | --- debian/control 2016-09-12 11:49:12 +0000 | |||
3 | +++ debian/control 2016-09-23 17:21:20 +0000 | |||
4 | @@ -101,7 +101,7 @@ | |||
5 | 101 | Architecture: linux-any | 101 | Architecture: linux-any |
6 | 102 | Multi-Arch: same | 102 | Multi-Arch: same |
7 | 103 | Pre-Depends: ${misc:Pre-Depends} | 103 | Pre-Depends: ${misc:Pre-Depends} |
9 | 104 | Depends: libmircommon6 (= ${binary:Version}), | 104 | Depends: libmircommon7 (= ${binary:Version}), |
10 | 105 | libprotobuf-dev (>= 2.4.1), | 105 | libprotobuf-dev (>= 2.4.1), |
11 | 106 | libxkbcommon-dev, | 106 | libxkbcommon-dev, |
12 | 107 | ${misc:Depends}, | 107 | ${misc:Depends}, |
13 | @@ -290,7 +290,7 @@ | |||
14 | 290 | . | 290 | . |
15 | 291 | Contains a tool for checking the graphics components of android devices. | 291 | Contains a tool for checking the graphics components of android devices. |
16 | 292 | 292 | ||
18 | 293 | Package: libmircommon6 | 293 | Package: libmircommon7 |
19 | 294 | Section: libs | 294 | Section: libs |
20 | 295 | Architecture: linux-any | 295 | Architecture: linux-any |
21 | 296 | Multi-Arch: same | 296 | Multi-Arch: same |
22 | 297 | 297 | ||
23 | === renamed file 'debian/libmircommon6.install' => 'debian/libmircommon7.install' | |||
24 | --- debian/libmircommon6.install 2016-06-27 18:09:48 +0000 | |||
25 | +++ debian/libmircommon7.install 2016-09-23 17:21:20 +0000 | |||
26 | @@ -1,1 +1,1 @@ | |||
28 | 1 | usr/lib/*/libmircommon.so.6 | 1 | usr/lib/*/libmircommon.so.7 |
29 | 2 | 2 | ||
30 | === modified file 'include/client/mir_toolkit/events/input_device_state_event.h' | |||
31 | --- include/client/mir_toolkit/events/input_device_state_event.h 2016-06-02 15:07:12 +0000 | |||
32 | +++ include/client/mir_toolkit/events/input_device_state_event.h 2016-09-23 17:21:20 +0000 | |||
33 | @@ -100,13 +100,27 @@ | |||
34 | 100 | * Retrieve an array of pressed keys on the device identified by the \a index. | 100 | * Retrieve an array of pressed keys on the device identified by the \a index. |
35 | 101 | * The keys are encoded as scan codes. | 101 | * The keys are encoded as scan codes. |
36 | 102 | * | 102 | * |
37 | 103 | * \deprecated Use mir_input_device_state_event_device_pressed_keys_for_index() instead | ||
38 | 103 | * \param[in] ev The input device state event | 104 | * \param[in] ev The input device state event |
39 | 104 | * \param[in] index The index of the input device | 105 | * \param[in] index The index of the input device |
41 | 105 | * \return An array of pressed keys | 106 | * \return a NULL pointer |
42 | 106 | */ | 107 | */ |
43 | 108 | __attribute__ ((deprecated)) | ||
44 | 107 | uint32_t const* mir_input_device_state_event_device_pressed_keys( | 109 | uint32_t const* mir_input_device_state_event_device_pressed_keys( |
45 | 108 | MirInputDeviceStateEvent const* ev, uint32_t index); | 110 | MirInputDeviceStateEvent const* ev, uint32_t index); |
46 | 109 | 111 | ||
47 | 112 | /* | ||
48 | 113 | * Retrieve a pressed key on the device identified by the \a index. | ||
49 | 114 | * The key is encoded as a scan code. | ||
50 | 115 | * | ||
51 | 116 | * \param[in] ev The input device state event | ||
52 | 117 | * \param[in] index The index of the input device | ||
53 | 118 | * \param[in] pressed_index The index of the pressed key | ||
54 | 119 | * \return The pressed key at index pressed_index | ||
55 | 120 | */ | ||
56 | 121 | uint32_t mir_input_device_state_event_device_pressed_keys_for_index( | ||
57 | 122 | MirInputDeviceStateEvent const* ev, uint32_t index, uint32_t pressed_index); | ||
58 | 123 | |||
59 | 110 | /** | 124 | /** |
60 | 111 | * Retrieve the size of scan code array of the device identified by the \a index. | 125 | * Retrieve the size of scan code array of the device identified by the \a index. |
61 | 112 | * | 126 | * |
62 | 113 | 127 | ||
63 | === modified file 'include/test/mir/test/event_matchers.h' | |||
64 | --- include/test/mir/test/event_matchers.h 2016-07-04 12:17:44 +0000 | |||
65 | +++ include/test/mir/test/event_matchers.h 2016-09-23 17:21:20 +0000 | |||
66 | @@ -527,8 +527,14 @@ | |||
67 | 527 | if (num_required_keys != key_count) | 527 | if (num_required_keys != key_count) |
68 | 528 | continue; | 528 | continue; |
69 | 529 | 529 | ||
72 | 530 | auto pressed_keys = mir_input_device_state_event_device_pressed_keys(device_state, index); | 530 | std::vector<uint32_t> pressed_keys; |
73 | 531 | if (!std::equal(it_keys, end_keys, pressed_keys)) | 531 | for (uint32_t i = 0; i < key_count; i++) |
74 | 532 | { | ||
75 | 533 | pressed_keys.push_back( | ||
76 | 534 | mir_input_device_state_event_device_pressed_keys_for_index(device_state, index, i)); | ||
77 | 535 | } | ||
78 | 536 | |||
79 | 537 | if (!std::equal(it_keys, end_keys, std::begin(pressed_keys))) | ||
80 | 532 | continue; | 538 | continue; |
81 | 533 | return true; | 539 | return true; |
82 | 534 | } | 540 | } |
83 | 535 | 541 | ||
84 | === modified file 'src/client/event.cpp' | |||
85 | --- src/client/event.cpp 2016-09-19 04:16:15 +0000 | |||
86 | +++ src/client/event.cpp 2016-09-23 17:21:20 +0000 | |||
87 | @@ -321,11 +321,19 @@ | |||
88 | 321 | return ev->device_id(index); | 321 | return ev->device_id(index); |
89 | 322 | } | 322 | } |
90 | 323 | 323 | ||
92 | 324 | uint32_t const* mir_input_device_state_event_device_pressed_keys(MirInputDeviceStateEvent const* ev, uint32_t index) | 324 | // Function is deprecated, and no one is currently using it. |
93 | 325 | uint32_t const* mir_input_device_state_event_device_pressed_keys(MirInputDeviceStateEvent const* /*ev*/, uint32_t /*index*/) | ||
94 | 326 | { | ||
95 | 327 | return nullptr; | ||
96 | 328 | } | ||
97 | 329 | |||
98 | 330 | uint32_t mir_input_device_state_event_device_pressed_keys_for_index(MirInputDeviceStateEvent const* ev, | ||
99 | 331 | uint32_t index, | ||
100 | 332 | uint32_t pressed_index) | ||
101 | 325 | { | 333 | { |
102 | 326 | expect_event_type(ev, mir_event_type_input_device_state); | 334 | expect_event_type(ev, mir_event_type_input_device_state); |
103 | 327 | expect_index_in_range(ev->device_count(), index); | 335 | expect_index_in_range(ev->device_count(), index); |
105 | 328 | return ev->device_pressed_keys(index); | 336 | return ev->device_pressed_keys_for_index(index, pressed_index); |
106 | 329 | } | 337 | } |
107 | 330 | 338 | ||
108 | 331 | uint32_t mir_input_device_state_event_device_pressed_keys_count(MirInputDeviceStateEvent const* ev, uint32_t index) | 339 | uint32_t mir_input_device_state_event_device_pressed_keys_count(MirInputDeviceStateEvent const* ev, uint32_t index) |
109 | 332 | 340 | ||
110 | === modified file 'src/client/event_printer.cpp' | |||
111 | --- src/client/event_printer.cpp 2016-09-19 04:16:15 +0000 | |||
112 | +++ src/client/event_printer.cpp 2016-09-23 17:21:20 +0000 | |||
113 | @@ -348,11 +348,11 @@ | |||
114 | 348 | out << mir_input_device_state_event_device_id(&event, index) | 348 | out << mir_input_device_state_event_device_id(&event, index) |
115 | 349 | << " btns=" << mir_input_device_state_event_device_pointer_buttons(&event, index) | 349 | << " btns=" << mir_input_device_state_event_device_pointer_buttons(&event, index) |
116 | 350 | << " pressed=("; | 350 | << " pressed=("; |
119 | 351 | auto keys = mir_input_device_state_event_device_pressed_keys(&event, index); | 351 | auto key_count = mir_input_device_state_event_device_pressed_keys_count(&event, index); |
120 | 352 | for (size_t count_keys = mir_input_device_state_event_device_pressed_keys_count(&event, index), i = 0; i != count_keys; ++i) | 352 | for (uint32_t i = 0; i < key_count; i++) |
121 | 353 | { | 353 | { |
124 | 354 | out << static_cast<uint32_t>(keys[i]); | 354 | out << mir_input_device_state_event_device_pressed_keys_for_index(&event, index, i); |
125 | 355 | if (i + 1 < count_keys) | 355 | if (i + 1 < key_count) |
126 | 356 | out << ", "; | 356 | out << ", "; |
127 | 357 | } | 357 | } |
128 | 358 | out << ")"; | 358 | out << ")"; |
129 | 359 | 359 | ||
130 | === modified file 'src/client/symbols.map' | |||
131 | --- src/client/symbols.map 2016-09-19 09:05:08 +0000 | |||
132 | +++ src/client/symbols.map 2016-09-23 17:21:20 +0000 | |||
133 | @@ -432,5 +432,6 @@ | |||
134 | 432 | mir_surface_placement_get_relative_position; | 432 | mir_surface_placement_get_relative_position; |
135 | 433 | mir_display_output_type_name; | 433 | mir_display_output_type_name; |
136 | 434 | mir_output_type_name; | 434 | mir_output_type_name; |
137 | 435 | mir_input_device_state_event_device_pressed_keys_for_index; | ||
138 | 435 | } MIR_CLIENT_0.24; | 436 | } MIR_CLIENT_0.24; |
139 | 436 | 437 | ||
140 | 437 | 438 | ||
141 | === modified file 'src/common/CMakeLists.txt' | |||
142 | --- src/common/CMakeLists.txt 2016-09-19 04:16:15 +0000 | |||
143 | +++ src/common/CMakeLists.txt 2016-09-23 17:21:20 +0000 | |||
144 | @@ -37,7 +37,7 @@ | |||
145 | 37 | PARENT_SCOPE) | 37 | PARENT_SCOPE) |
146 | 38 | 38 | ||
147 | 39 | # TODO we need a place to manage ABI and related versioning but use this as placeholder | 39 | # TODO we need a place to manage ABI and related versioning but use this as placeholder |
149 | 40 | set(MIRCOMMON_ABI 6) | 40 | set(MIRCOMMON_ABI 7) |
150 | 41 | set(symbol_map ${CMAKE_CURRENT_SOURCE_DIR}/symbols.map) | 41 | set(symbol_map ${CMAKE_CURRENT_SOURCE_DIR}/symbols.map) |
151 | 42 | 42 | ||
152 | 43 | add_library(mircommon SHARED | 43 | add_library(mircommon SHARED |
153 | 44 | 44 | ||
154 | === modified file 'src/common/events/input_device_state_event.cpp' | |||
155 | --- src/common/events/input_device_state_event.cpp 2016-05-26 20:59:38 +0000 | |||
156 | +++ src/common/events/input_device_state_event.cpp 2016-09-23 17:21:20 +0000 | |||
157 | @@ -98,9 +98,9 @@ | |||
158 | 98 | return devices[index].id; | 98 | return devices[index].id; |
159 | 99 | } | 99 | } |
160 | 100 | 100 | ||
162 | 101 | uint32_t const* MirInputDeviceStateEvent::device_pressed_keys(size_t index) const | 101 | uint32_t MirInputDeviceStateEvent::device_pressed_keys_for_index(size_t index, size_t pressed_index) const |
163 | 102 | { | 102 | { |
165 | 103 | return devices[index].pressed_keys.data(); | 103 | return devices[index].pressed_keys[pressed_index]; |
166 | 104 | } | 104 | } |
167 | 105 | 105 | ||
168 | 106 | uint32_t MirInputDeviceStateEvent::device_pressed_keys_count(size_t index) const | 106 | uint32_t MirInputDeviceStateEvent::device_pressed_keys_count(size_t index) const |
169 | 107 | 107 | ||
170 | === modified file 'src/common/symbols.map' | |||
171 | --- src/common/symbols.map 2016-09-19 04:16:15 +0000 | |||
172 | +++ src/common/symbols.map 2016-09-23 17:21:20 +0000 | |||
173 | @@ -1,5 +1,8 @@ | |||
175 | 1 | MIR_COMMON_5 { | 1 | MIR_COMMON_0.25 { |
176 | 2 | global: | 2 | global: |
177 | 3 | __android_log_assert; | ||
178 | 4 | __android_log_print; | ||
179 | 5 | systemTime; | ||
180 | 3 | extern "C++" { | 6 | extern "C++" { |
181 | 4 | # The following symbols come from running a script over the generated docs. Vis: | 7 | # The following symbols come from running a script over the generated docs. Vis: |
182 | 5 | # ../tools/process_doxygen_xml.py doc/xml/*.xml | grep "^mircommon public" | sed "s/mircommon public: / /" | sort | 8 | # ../tools/process_doxygen_xml.py doc/xml/*.xml | grep "^mircommon public" | sed "s/mircommon public: / /" | sort |
183 | @@ -111,7 +114,6 @@ | |||
184 | 111 | mir::default_server_socket; | 114 | mir::default_server_socket; |
185 | 112 | mir::libraries_for_path*; | 115 | mir::libraries_for_path*; |
186 | 113 | mir::logging::input_timestamp*; | 116 | mir::logging::input_timestamp*; |
187 | 114 | mir::logging::log*; | ||
188 | 115 | mir::logging::SharedLibraryProberReport::SharedLibraryProberReport*; | 117 | mir::logging::SharedLibraryProberReport::SharedLibraryProberReport*; |
189 | 116 | mir::RecursiveReadLock::?RecursiveReadLock*; | 118 | mir::RecursiveReadLock::?RecursiveReadLock*; |
190 | 117 | mir::RecursiveReadLock::RecursiveReadLock*; | 119 | mir::RecursiveReadLock::RecursiveReadLock*; |
191 | @@ -139,16 +141,8 @@ | |||
192 | 139 | 141 | ||
193 | 140 | mir::SignalBlocker::SignalBlocker*; | 142 | mir::SignalBlocker::SignalBlocker*; |
194 | 141 | mir::SignalBlocker::?SignalBlocker*; | 143 | mir::SignalBlocker::?SignalBlocker*; |
195 | 142 | }; | ||
196 | 143 | }; | ||
197 | 144 | 144 | ||
205 | 145 | MIR_COMMON_5.1 { # New functions in Mir 0.16 | 145 | # New functions in Mir 0.16 |
199 | 146 | global: | ||
200 | 147 | __android_log_assert; | ||
201 | 148 | __android_log_print; | ||
202 | 149 | systemTime; | ||
203 | 150 | toMillisecondTimeoutDelay; | ||
204 | 151 | extern "C++" { | ||
206 | 152 | android::InputChannel::InputChannel*; | 146 | android::InputChannel::InputChannel*; |
207 | 153 | android::InputChannel::openInputFdPair*; | 147 | android::InputChannel::openInputFdPair*; |
208 | 154 | android::InputConsumer::consume*; | 148 | android::InputConsumer::consume*; |
209 | @@ -170,10 +164,8 @@ | |||
210 | 170 | android::IntSet::remove*; | 164 | android::IntSet::remove*; |
211 | 171 | android::KeyEvent::initialize*; | 165 | android::KeyEvent::initialize*; |
212 | 172 | android::MotionEvent::getAxisValue*; | 166 | android::MotionEvent::getAxisValue*; |
213 | 173 | android::MotionEvent::getAxisValue*; | ||
214 | 174 | android::MotionEvent::getHistoricalAxisValue*; | 167 | android::MotionEvent::getHistoricalAxisValue*; |
215 | 175 | android::MotionEvent::getRawAxisValue*; | 168 | android::MotionEvent::getRawAxisValue*; |
216 | 176 | android::MotionEvent::getRawAxisValue*; | ||
217 | 177 | android::PointerCoords::copyFrom*; | 169 | android::PointerCoords::copyFrom*; |
218 | 178 | android::PointerCoords::getAxisValue*; | 170 | android::PointerCoords::getAxisValue*; |
219 | 179 | android::PointerCoords::operator*; | 171 | android::PointerCoords::operator*; |
220 | @@ -191,37 +183,21 @@ | |||
221 | 191 | mir::write_to_log; | 183 | mir::write_to_log; |
222 | 192 | typeinfo?for?android::RefBase; | 184 | typeinfo?for?android::RefBase; |
223 | 193 | vtable?for?android::IntSet; | 185 | vtable?for?android::IntSet; |
229 | 194 | mir::dispatch::ReadableFd::ReadableFd*; | 186 | vtable?for?mir::dispatch::ReadableFd; |
230 | 195 | mir::dispatch::ReadableFd::?ReadableFd*; | 187 | mir::dispatch::ReadableFd*; |
226 | 196 | mir::dispatch::ReadableFd::watch_fd*; | ||
227 | 197 | mir::dispatch::ReadableFd::dispatch*; | ||
228 | 198 | mir::dispatch::ReadableFd::relevant_events*; | ||
231 | 199 | mir::logger::Logger::log*; | 188 | mir::logger::Logger::log*; |
232 | 200 | }; | ||
233 | 201 | local: *; | ||
234 | 202 | } MIR_COMMON_5; | ||
235 | 203 | 189 | ||
239 | 204 | MIR_COMMON_5v19 { # New functions in Mir 0.19.0 | 190 | # New functions in Mir 0.19.0 |
237 | 205 | global: | ||
238 | 206 | extern "C++" { | ||
240 | 207 | typeinfo?for?mir::logging::SharedLibraryProberReport; | 191 | typeinfo?for?mir::logging::SharedLibraryProberReport; |
241 | 208 | typeinfo?for?mir::time::SteadyClock; | 192 | typeinfo?for?mir::time::SteadyClock; |
242 | 209 | typeinfo?for?android::InputChannel; | 193 | typeinfo?for?android::InputChannel; |
243 | 210 | typeinfo?for?mir::logging::DumbConsoleLogger; | 194 | typeinfo?for?mir::logging::DumbConsoleLogger; |
244 | 211 | mir::detail::libname_impl*; | 195 | mir::detail::libname_impl*; |
245 | 212 | }; | ||
246 | 213 | } MIR_COMMON_5.1; | ||
247 | 214 | 196 | ||
251 | 215 | MIR_COMMON_0.19.1 { # New functions in Mir 0.19.1 | 197 | # New functions in Mir 0.19.1 |
249 | 216 | global: | ||
250 | 217 | extern "C++" { | ||
252 | 218 | mir::select_libraries_for_path*; | 198 | mir::select_libraries_for_path*; |
253 | 219 | }; | ||
254 | 220 | } MIR_COMMON_5v19; # <- Note Mir 0.19.0 used the wrong syntax | ||
255 | 221 | 199 | ||
259 | 222 | MIR_COMMON_0.22 { | 200 | # New functions in Mir 0.22 |
257 | 223 | global: | ||
258 | 224 | extern "C++" { | ||
260 | 225 | MirEvent::to_surface*; | 201 | MirEvent::to_surface*; |
261 | 226 | MirEvent::to_resize*; | 202 | MirEvent::to_resize*; |
262 | 227 | MirEvent::to_orientation*; | 203 | MirEvent::to_orientation*; |
263 | @@ -351,12 +327,8 @@ | |||
264 | 351 | MirPromptSessionEvent::MirPromptSessionEvent*; | 327 | MirPromptSessionEvent::MirPromptSessionEvent*; |
265 | 352 | MirPromptSessionEvent::new_state*; | 328 | MirPromptSessionEvent::new_state*; |
266 | 353 | MirPromptSessionEvent::set_new_state*; | 329 | MirPromptSessionEvent::set_new_state*; |
267 | 354 | }; | ||
268 | 355 | } MIR_COMMON_0.19.1; | ||
269 | 356 | 330 | ||
273 | 357 | MIR_COMMON_0.24 { | 331 | # New functions in Mir 0.24 |
271 | 358 | global: | ||
272 | 359 | extern "C++" { | ||
274 | 360 | android::InputPublisher::publishEventBuffer*; | 332 | android::InputPublisher::publishEventBuffer*; |
275 | 361 | MirEvent::to_input_device_state*; | 333 | MirEvent::to_input_device_state*; |
276 | 362 | MirInputDeviceStateEvent::MirInputDeviceStateEvent*; | 334 | MirInputDeviceStateEvent::MirInputDeviceStateEvent*; |
277 | @@ -366,7 +338,6 @@ | |||
278 | 366 | MirInputDeviceStateEvent::device_count*; | 338 | MirInputDeviceStateEvent::device_count*; |
279 | 367 | MirInputDeviceStateEvent::device_id*; | 339 | MirInputDeviceStateEvent::device_id*; |
280 | 368 | MirInputDeviceStateEvent::device_pointer_buttons*; | 340 | MirInputDeviceStateEvent::device_pointer_buttons*; |
281 | 369 | MirInputDeviceStateEvent::device_pressed_keys*; | ||
282 | 370 | MirInputDeviceStateEvent::device_pressed_keys_count*; | 341 | MirInputDeviceStateEvent::device_pressed_keys_count*; |
283 | 371 | MirInputDeviceStateEvent::modifiers*; | 342 | MirInputDeviceStateEvent::modifiers*; |
284 | 372 | MirInputDeviceStateEvent::pointer_axis*; | 343 | MirInputDeviceStateEvent::pointer_axis*; |
285 | @@ -382,19 +353,15 @@ | |||
286 | 382 | android::MotionEvent::initialize*; | 353 | android::MotionEvent::initialize*; |
287 | 383 | mir::dispatch::epoll_to_fd_event*; | 354 | mir::dispatch::epoll_to_fd_event*; |
288 | 384 | mir::dispatch::fd_event_to_epoll*; | 355 | mir::dispatch::fd_event_to_epoll*; |
289 | 385 | mir::dispatch::ReadableFd*; | ||
290 | 386 | vtable?for?mir::dispatch::ReadableFd; | ||
291 | 387 | }; | ||
292 | 388 | } MIR_COMMON_0.22; | ||
293 | 389 | 356 | ||
297 | 390 | MIR_COMMON_0.25 { | 357 | # New functions in Mir 0.25 |
295 | 391 | global: | ||
296 | 392 | extern "C++" { | ||
298 | 393 | MirSurfacePlacementEvent::MirSurfacePlacementEvent*; | 358 | MirSurfacePlacementEvent::MirSurfacePlacementEvent*; |
299 | 394 | MirSurfacePlacementEvent::id*; | 359 | MirSurfacePlacementEvent::id*; |
300 | 395 | MirSurfacePlacementEvent::set_id*; | 360 | MirSurfacePlacementEvent::set_id*; |
301 | 396 | MirSurfacePlacementEvent::placement*; | 361 | MirSurfacePlacementEvent::placement*; |
302 | 397 | MirSurfacePlacementEvent::set_placement*; | 362 | MirSurfacePlacementEvent::set_placement*; |
303 | 363 | MirInputDeviceStateEvent::device_pressed_keys_for_index*; | ||
304 | 398 | mir::output_type_name*; | 364 | mir::output_type_name*; |
305 | 399 | }; | 365 | }; |
307 | 400 | } MIR_COMMON_0.24; | 366 | local: *; |
308 | 367 | }; | ||
309 | 401 | 368 | ||
310 | === modified file 'src/include/common/mir/events/input_device_state_event.h' | |||
311 | --- src/include/common/mir/events/input_device_state_event.h 2016-05-26 20:59:38 +0000 | |||
312 | +++ src/include/common/mir/events/input_device_state_event.h 2016-09-23 17:21:20 +0000 | |||
313 | @@ -43,7 +43,7 @@ | |||
314 | 43 | uint32_t device_count() const; | 43 | uint32_t device_count() const; |
315 | 44 | MirInputDeviceId device_id(size_t index) const; | 44 | MirInputDeviceId device_id(size_t index) const; |
316 | 45 | MirPointerButtons device_pointer_buttons(size_t index) const; | 45 | MirPointerButtons device_pointer_buttons(size_t index) const; |
318 | 46 | uint32_t const* device_pressed_keys(size_t index) const; | 46 | uint32_t device_pressed_keys_for_index(size_t index, size_t pressed_index) const; |
319 | 47 | uint32_t device_pressed_keys_count(size_t index) const; | 47 | uint32_t device_pressed_keys_count(size_t index) const; |
320 | 48 | 48 | ||
321 | 49 | static mir::EventUPtr deserialize(std::string const& bytes); | 49 | static mir::EventUPtr deserialize(std::string const& bytes); |
322 | 50 | 50 | ||
323 | === modified file 'src/server/graphics/nested/input_platform.cpp' | |||
324 | --- src/server/graphics/nested/input_platform.cpp 2016-09-01 12:28:46 +0000 | |||
325 | +++ src/server/graphics/nested/input_platform.cpp 2016-09-23 17:21:20 +0000 | |||
326 | @@ -247,9 +247,13 @@ | |||
327 | 247 | { | 247 | { |
328 | 248 | auto dest = it->second->destination; | 248 | auto dest = it->second->destination; |
329 | 249 | auto key_count = mir_input_device_state_event_device_pressed_keys_count(device_state, index); | 249 | auto key_count = mir_input_device_state_event_device_pressed_keys_count(device_state, index); |
331 | 250 | auto const* scan_codes = mir_input_device_state_event_device_pressed_keys(device_state, index); | 250 | std::vector<uint32_t> scan_codes; |
332 | 251 | for (uint32_t i = 0; i < key_count; i++) | ||
333 | 252 | { | ||
334 | 253 | scan_codes.push_back(mir_input_device_state_event_device_pressed_keys_for_index(device_state, index, i)); | ||
335 | 254 | } | ||
336 | 251 | 255 | ||
338 | 252 | dest->key_state({scan_codes, scan_codes + key_count}); | 256 | dest->key_state(scan_codes); |
339 | 253 | dest->pointer_state( | 257 | dest->pointer_state( |
340 | 254 | mir_input_device_state_event_device_pointer_buttons(device_state, index)); | 258 | mir_input_device_state_event_device_pointer_buttons(device_state, index)); |
341 | 255 | } | 259 | } |
342 | 256 | 260 | ||
343 | === modified file 'tests/unit-tests/input/android/test_android_input_sender.cpp' | |||
344 | --- tests/unit-tests/input/android/test_android_input_sender.cpp 2016-06-07 21:10:34 +0000 | |||
345 | +++ tests/unit-tests/input/android/test_android_input_sender.cpp 2016-09-23 17:21:20 +0000 | |||
346 | @@ -503,7 +503,8 @@ | |||
347 | 503 | const auto timestamp = std::chrono::nanoseconds(10); | 503 | const auto timestamp = std::chrono::nanoseconds(10); |
348 | 504 | register_surface(); | 504 | register_surface(); |
349 | 505 | std::vector<mir::events::InputDeviceState> states; | 505 | std::vector<mir::events::InputDeviceState> states; |
351 | 506 | states.push_back({MirInputDeviceId{23}, {50, 60, 80}, 0}); | 506 | std::vector<uint32_t> const pressed_keys = {50, 60, 80}; |
352 | 507 | states.push_back({MirInputDeviceId{23}, pressed_keys, 0}); | ||
353 | 507 | states.push_back({MirInputDeviceId{21}, {}, mir_pointer_button_primary}); | 508 | states.push_back({MirInputDeviceId{21}, {}, mir_pointer_button_primary}); |
354 | 508 | 509 | ||
355 | 509 | auto device_state = mir::events::make_event(timestamp, mir_pointer_button_primary, mir_input_event_modifier_caps_lock, | 510 | auto device_state = mir::events::make_event(timestamp, mir_pointer_button_primary, mir_input_event_modifier_caps_lock, |
356 | @@ -520,12 +521,13 @@ | |||
357 | 520 | EXPECT_THAT(mir_input_device_state_event_time(input_device_state), Eq(timestamp.count())); | 521 | EXPECT_THAT(mir_input_device_state_event_time(input_device_state), Eq(timestamp.count())); |
358 | 521 | EXPECT_THAT(mir_input_device_state_event_modifiers(input_device_state), Eq(mir_input_event_modifier_caps_lock)); | 522 | EXPECT_THAT(mir_input_device_state_event_modifiers(input_device_state), Eq(mir_input_event_modifier_caps_lock)); |
359 | 522 | EXPECT_THAT(mir_input_device_state_event_device_count(input_device_state), Eq(2)); | 523 | EXPECT_THAT(mir_input_device_state_event_device_count(input_device_state), Eq(2)); |
360 | 523 | |||
361 | 524 | EXPECT_THAT(mir_input_device_state_event_device_id(input_device_state, 0), Eq(MirInputDeviceId{23})); | 524 | EXPECT_THAT(mir_input_device_state_event_device_id(input_device_state, 0), Eq(MirInputDeviceId{23})); |
366 | 525 | EXPECT_THAT(mir_input_device_state_event_device_pressed_keys_count(input_device_state, 0), Eq(3)); | 525 | auto keys_count = mir_input_device_state_event_device_pressed_keys_count(input_device_state, 0); |
367 | 526 | EXPECT_THAT(mir_input_device_state_event_device_pressed_keys(input_device_state, 0)[0], Eq(50)); | 526 | EXPECT_THAT(keys_count, Eq(3)); |
368 | 527 | EXPECT_THAT(mir_input_device_state_event_device_pressed_keys(input_device_state, 0)[1], Eq(60)); | 527 | for (uint32_t i = 0; i < keys_count; i++) |
369 | 528 | EXPECT_THAT(mir_input_device_state_event_device_pressed_keys(input_device_state, 0)[2], Eq(80)); | 528 | { |
370 | 529 | EXPECT_THAT(mir_input_device_state_event_device_pressed_keys_for_index(input_device_state, 0, i), Eq(pressed_keys[i])); | ||
371 | 530 | } | ||
372 | 529 | EXPECT_THAT(mir_input_device_state_event_device_pointer_buttons(input_device_state, 0), 0); | 531 | EXPECT_THAT(mir_input_device_state_event_device_pointer_buttons(input_device_state, 0), 0); |
373 | 530 | 532 | ||
374 | 531 | EXPECT_THAT(mir_input_device_state_event_device_id(input_device_state, 1), Eq(MirInputDeviceId{21})); | 533 | EXPECT_THAT(mir_input_device_state_event_device_id(input_device_state, 1), Eq(MirInputDeviceId{21})); |
375 | 532 | 534 | ||
376 | === modified file 'tests/unit-tests/input/test_event_builders.cpp' | |||
377 | --- tests/unit-tests/input/test_event_builders.cpp 2016-05-26 20:59:38 +0000 | |||
378 | +++ tests/unit-tests/input/test_event_builders.cpp 2016-09-23 17:21:20 +0000 | |||
379 | @@ -189,12 +189,13 @@ | |||
380 | 189 | auto const pos_y = 53.2f; | 189 | auto const pos_y = 53.2f; |
381 | 190 | auto const button_state = mir_pointer_button_primary|mir_pointer_button_secondary; | 190 | auto const button_state = mir_pointer_button_primary|mir_pointer_button_secondary; |
382 | 191 | auto const modifiers = mir_input_event_modifier_ctrl_right | mir_input_event_modifier_ctrl; | 191 | auto const modifiers = mir_input_event_modifier_ctrl_right | mir_input_event_modifier_ctrl; |
383 | 192 | std::vector<uint32_t> const pressed_keys = {KEY_LEFTALT, KEY_M}; | ||
384 | 192 | auto ev = mev::make_event(timestamp, | 193 | auto ev = mev::make_event(timestamp, |
385 | 193 | button_state, | 194 | button_state, |
386 | 194 | modifiers, | 195 | modifiers, |
387 | 195 | pos_x, | 196 | pos_x, |
388 | 196 | pos_y, | 197 | pos_y, |
390 | 197 | {mev::InputDeviceState{MirInputDeviceId{3}, {KEY_LEFTALT, KEY_M}, 0}, | 198 | {mev::InputDeviceState{MirInputDeviceId{3}, pressed_keys, 0}, |
391 | 198 | mev::InputDeviceState{MirInputDeviceId{2}, {}, button_state}}); | 199 | mev::InputDeviceState{MirInputDeviceId{2}, {}, button_state}}); |
392 | 199 | 200 | ||
393 | 200 | EXPECT_THAT(mir_event_get_type(ev.get()), Eq(mir_event_type_input_device_state)); | 201 | EXPECT_THAT(mir_event_get_type(ev.get()), Eq(mir_event_type_input_device_state)); |
394 | @@ -208,9 +209,12 @@ | |||
395 | 208 | EXPECT_THAT(mir_input_device_state_event_device_count(ids_event), Eq(2)); | 209 | EXPECT_THAT(mir_input_device_state_event_device_count(ids_event), Eq(2)); |
396 | 209 | 210 | ||
397 | 210 | EXPECT_THAT(mir_input_device_state_event_device_id(ids_event, 0), Eq(MirInputDeviceId{3})); | 211 | EXPECT_THAT(mir_input_device_state_event_device_id(ids_event, 0), Eq(MirInputDeviceId{3})); |
401 | 211 | EXPECT_THAT(mir_input_device_state_event_device_pressed_keys_count(ids_event, 0), Eq(2)); | 212 | auto const pressed_keys_count = mir_input_device_state_event_device_pressed_keys_count(ids_event, 0); |
402 | 212 | EXPECT_THAT(mir_input_device_state_event_device_pressed_keys(ids_event, 0)[0], Eq(KEY_LEFTALT)); | 213 | EXPECT_THAT(pressed_keys_count, Eq(2)); |
403 | 213 | EXPECT_THAT(mir_input_device_state_event_device_pressed_keys(ids_event, 0)[1], Eq(KEY_M)); | 214 | for (uint32_t i = 0; i < pressed_keys_count; i++) |
404 | 215 | { | ||
405 | 216 | EXPECT_THAT(mir_input_device_state_event_device_pressed_keys_for_index(ids_event, 0, i), Eq(pressed_keys[i])); | ||
406 | 217 | } | ||
407 | 214 | EXPECT_THAT(mir_input_device_state_event_device_pointer_buttons(ids_event, 0), Eq(0)); | 218 | EXPECT_THAT(mir_input_device_state_event_device_pointer_buttons(ids_event, 0), Eq(0)); |
408 | 215 | 219 | ||
409 | 216 | EXPECT_THAT(mir_input_device_state_event_device_id(ids_event, 1), Eq(MirInputDeviceId{2})); | 220 | EXPECT_THAT(mir_input_device_state_event_device_id(ids_event, 1), Eq(MirInputDeviceId{2})); |
410 | @@ -252,6 +256,7 @@ | |||
411 | 252 | auto const pos_y = 0.0f; | 256 | auto const pos_y = 0.0f; |
412 | 253 | auto const button_state = mir_pointer_button_primary | mir_pointer_button_secondary; | 257 | auto const button_state = mir_pointer_button_primary | mir_pointer_button_secondary; |
413 | 254 | auto const modifiers = mir_input_event_modifier_none; | 258 | auto const modifiers = mir_input_event_modifier_none; |
414 | 259 | std::vector<uint32_t> const pressed_keys = {KEY_RIGHTALT, KEY_LEFTSHIFT, KEY_Q}; | ||
415 | 255 | auto ev = mev::make_event(timestamp, | 260 | auto ev = mev::make_event(timestamp, |
416 | 256 | button_state, | 261 | button_state, |
417 | 257 | modifiers, | 262 | modifiers, |
418 | @@ -259,7 +264,7 @@ | |||
419 | 259 | pos_y, | 264 | pos_y, |
420 | 260 | {mev::InputDeviceState{MirInputDeviceId{0}, {}, mir_pointer_button_primary}, | 265 | {mev::InputDeviceState{MirInputDeviceId{0}, {}, mir_pointer_button_primary}, |
421 | 261 | mev::InputDeviceState{MirInputDeviceId{2}, {}, mir_pointer_button_secondary}, | 266 | mev::InputDeviceState{MirInputDeviceId{2}, {}, mir_pointer_button_secondary}, |
423 | 262 | mev::InputDeviceState{MirInputDeviceId{3}, {KEY_RIGHTALT, KEY_LEFTSHIFT, KEY_Q}, 0}}); | 267 | mev::InputDeviceState{MirInputDeviceId{3}, pressed_keys, 0}}); |
424 | 263 | 268 | ||
425 | 264 | auto encoded = MirEvent::serialize(ev.get()); | 269 | auto encoded = MirEvent::serialize(ev.get()); |
426 | 265 | 270 | ||
427 | @@ -269,8 +274,10 @@ | |||
428 | 269 | auto ids_event = mir_event_get_input_device_state_event(deserialzed_event.get()); | 274 | auto ids_event = mir_event_get_input_device_state_event(deserialzed_event.get()); |
429 | 270 | 275 | ||
430 | 271 | EXPECT_THAT(mir_input_device_state_event_device_count(ids_event), Eq(3)); | 276 | EXPECT_THAT(mir_input_device_state_event_device_count(ids_event), Eq(3)); |
435 | 272 | EXPECT_THAT(mir_input_device_state_event_device_pressed_keys_count(ids_event, 2), Eq(3)); | 277 | auto pressed_keys_count = mir_input_device_state_event_device_pressed_keys_count(ids_event, 2); |
436 | 273 | EXPECT_THAT(mir_input_device_state_event_device_pressed_keys(ids_event, 2)[0], Eq(KEY_RIGHTALT)); | 278 | EXPECT_THAT(pressed_keys_count, Eq(3)); |
437 | 274 | EXPECT_THAT(mir_input_device_state_event_device_pressed_keys(ids_event, 2)[1], Eq(KEY_LEFTSHIFT)); | 279 | for (uint32_t i = 0; i < pressed_keys_count; i++) |
438 | 275 | EXPECT_THAT(mir_input_device_state_event_device_pressed_keys(ids_event, 2)[2], Eq(KEY_Q)); | 280 | { |
439 | 281 | EXPECT_THAT(mir_input_device_state_event_device_pressed_keys_for_index(ids_event, 2, i), Eq(pressed_keys[i])); | ||
440 | 282 | } | ||
441 | 276 | } | 283 | } |
FAILED: Continuous integration, rev:3713 /mir-jenkins. ubuntu. com/job/ mir-ci/ 1790/ /mir-jenkins. ubuntu. com/job/ build-mir/ 2240/console /mir-jenkins. ubuntu. com/job/ build-0- fetch/2303 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= vivid+overlay/ 2294 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= xenial+ overlay/ 2294 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= yakkety/ 2294 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= clang,platform= mesa,release= yakkety/ 2268/console /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= xenial+ overlay/ 2268 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= xenial+ overlay/ 2268/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= yakkety/ 2268 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= yakkety/ 2268/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= android, release= vivid+overlay/ 2268 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= android, release= vivid+overlay/ 2268/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= mesa,release= xenial+ overlay/ 2268 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= mesa,release= xenial+ overlay/ 2268/artifact/ output/ *zip*/output. zip
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild: /mir-jenkins. ubuntu. com/job/ mir-ci/ 1790/rebuild
https:/