Mir

Merge lp:~brandontschaefer/mir/deprecate-input-device-api into lp:mir

Proposed by Brandon Schaefer
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
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_device_state_event_device_pressed_keys for mir_input_device_state_event_device_pressed_keys_for_index

Description of the change

Deprecate

uint32_t const* mir_input_device_state_event_device_pressed_keys

to

uint32_t mir_input_device_state_event_device_pressed_keys_for_index

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.

To post a comment you must log in.
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:3713
https://mir-jenkins.ubuntu.com/job/mir-ci/1790/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/2240/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/2303
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2294
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2294
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2294
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2268/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2268
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2268/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2268
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2268/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2268
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2268/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2268
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2268/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/1790/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3715
https://mir-jenkins.ubuntu.com/job/mir-ci/1792/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/2242
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/2305
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2296
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2296
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2296
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2270
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2270/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2270
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2270/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2270
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2270/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2270
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2270/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2270
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2270/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/1792/rebuild

review: Approve (continuous-integration)
Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

ok..
the old api is not used yet - other than internally.

review: Approve
Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

ok this is breaking the mircommon ABI.. so you would have to have the mircommon7 MP as a prereq.

review: Needs Resubmitting
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3716
https://mir-jenkins.ubuntu.com/job/mir-ci/1803/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/2253
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/2316
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2307
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2307
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2307
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2281
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2281/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2281
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2281/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2281
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2281/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2281
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2281/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2281
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2281/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/1803/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/control'
--- debian/control 2016-09-12 11:49:12 +0000
+++ debian/control 2016-09-23 17:21:20 +0000
@@ -101,7 +101,7 @@
101Architecture: linux-any101Architecture: linux-any
102Multi-Arch: same102Multi-Arch: same
103Pre-Depends: ${misc:Pre-Depends}103Pre-Depends: ${misc:Pre-Depends}
104Depends: libmircommon6 (= ${binary:Version}), 104Depends: libmircommon7 (= ${binary:Version}),
105 libprotobuf-dev (>= 2.4.1),105 libprotobuf-dev (>= 2.4.1),
106 libxkbcommon-dev,106 libxkbcommon-dev,
107 ${misc:Depends},107 ${misc:Depends},
@@ -290,7 +290,7 @@
290 .290 .
291 Contains a tool for checking the graphics components of android devices.291 Contains a tool for checking the graphics components of android devices.
292292
293Package: libmircommon6293Package: libmircommon7
294Section: libs294Section: libs
295Architecture: linux-any295Architecture: linux-any
296Multi-Arch: same296Multi-Arch: same
297297
=== renamed file 'debian/libmircommon6.install' => 'debian/libmircommon7.install'
--- debian/libmircommon6.install 2016-06-27 18:09:48 +0000
+++ debian/libmircommon7.install 2016-09-23 17:21:20 +0000
@@ -1,1 +1,1 @@
1usr/lib/*/libmircommon.so.61usr/lib/*/libmircommon.so.7
22
=== modified file 'include/client/mir_toolkit/events/input_device_state_event.h'
--- include/client/mir_toolkit/events/input_device_state_event.h 2016-06-02 15:07:12 +0000
+++ include/client/mir_toolkit/events/input_device_state_event.h 2016-09-23 17:21:20 +0000
@@ -100,13 +100,27 @@
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.
101 * The keys are encoded as scan codes.101 * The keys are encoded as scan codes.
102 *102 *
103 * \deprecated Use mir_input_device_state_event_device_pressed_keys_for_index() instead
103 * \param[in] ev The input device state event104 * \param[in] ev The input device state event
104 * \param[in] index The index of the input device105 * \param[in] index The index of the input device
105 * \return An array of pressed keys106 * \return a NULL pointer
106 */107 */
108__attribute__ ((deprecated))
107uint32_t const* mir_input_device_state_event_device_pressed_keys(109uint32_t const* mir_input_device_state_event_device_pressed_keys(
108 MirInputDeviceStateEvent const* ev, uint32_t index);110 MirInputDeviceStateEvent const* ev, uint32_t index);
109111
112/*
113 * Retrieve a pressed key on the device identified by the \a index.
114 * The key is encoded as a scan code.
115 *
116 * \param[in] ev The input device state event
117 * \param[in] index The index of the input device
118 * \param[in] pressed_index The index of the pressed key
119 * \return The pressed key at index pressed_index
120 */
121uint32_t mir_input_device_state_event_device_pressed_keys_for_index(
122 MirInputDeviceStateEvent const* ev, uint32_t index, uint32_t pressed_index);
123
110/**124/**
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.
112 *126 *
113127
=== modified file 'include/test/mir/test/event_matchers.h'
--- include/test/mir/test/event_matchers.h 2016-07-04 12:17:44 +0000
+++ include/test/mir/test/event_matchers.h 2016-09-23 17:21:20 +0000
@@ -527,8 +527,14 @@
527 if (num_required_keys != key_count)527 if (num_required_keys != key_count)
528 continue;528 continue;
529529
530 auto pressed_keys = mir_input_device_state_event_device_pressed_keys(device_state, index);530 std::vector<uint32_t> pressed_keys;
531 if (!std::equal(it_keys, end_keys, pressed_keys))531 for (uint32_t i = 0; i < key_count; i++)
532 {
533 pressed_keys.push_back(
534 mir_input_device_state_event_device_pressed_keys_for_index(device_state, index, i));
535 }
536
537 if (!std::equal(it_keys, end_keys, std::begin(pressed_keys)))
532 continue;538 continue;
533 return true;539 return true;
534 }540 }
535541
=== modified file 'src/client/event.cpp'
--- src/client/event.cpp 2016-09-19 04:16:15 +0000
+++ src/client/event.cpp 2016-09-23 17:21:20 +0000
@@ -321,11 +321,19 @@
321 return ev->device_id(index);321 return ev->device_id(index);
322}322}
323323
324uint32_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.
325uint32_t const* mir_input_device_state_event_device_pressed_keys(MirInputDeviceStateEvent const* /*ev*/, uint32_t /*index*/)
326{
327 return nullptr;
328}
329
330uint32_t mir_input_device_state_event_device_pressed_keys_for_index(MirInputDeviceStateEvent const* ev,
331 uint32_t index,
332 uint32_t pressed_index)
325{333{
326 expect_event_type(ev, mir_event_type_input_device_state);334 expect_event_type(ev, mir_event_type_input_device_state);
327 expect_index_in_range(ev->device_count(), index);335 expect_index_in_range(ev->device_count(), index);
328 return ev->device_pressed_keys(index);336 return ev->device_pressed_keys_for_index(index, pressed_index);
329}337}
330338
331uint32_t mir_input_device_state_event_device_pressed_keys_count(MirInputDeviceStateEvent const* ev, uint32_t index)339uint32_t mir_input_device_state_event_device_pressed_keys_count(MirInputDeviceStateEvent const* ev, uint32_t index)
332340
=== modified file 'src/client/event_printer.cpp'
--- src/client/event_printer.cpp 2016-09-19 04:16:15 +0000
+++ src/client/event_printer.cpp 2016-09-23 17:21:20 +0000
@@ -348,11 +348,11 @@
348 out << mir_input_device_state_event_device_id(&event, index) 348 out << mir_input_device_state_event_device_id(&event, index)
349 << " btns=" << mir_input_device_state_event_device_pointer_buttons(&event, index)349 << " btns=" << mir_input_device_state_event_device_pointer_buttons(&event, index)
350 << " pressed=(";350 << " pressed=(";
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);
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++)
353 {353 {
354 out << static_cast<uint32_t>(keys[i]);354 out << mir_input_device_state_event_device_pressed_keys_for_index(&event, index, i);
355 if (i + 1 < count_keys)355 if (i + 1 < key_count)
356 out << ", ";356 out << ", ";
357 }357 }
358 out << ")";358 out << ")";
359359
=== modified file 'src/client/symbols.map'
--- src/client/symbols.map 2016-09-19 09:05:08 +0000
+++ src/client/symbols.map 2016-09-23 17:21:20 +0000
@@ -432,5 +432,6 @@
432 mir_surface_placement_get_relative_position;432 mir_surface_placement_get_relative_position;
433 mir_display_output_type_name;433 mir_display_output_type_name;
434 mir_output_type_name;434 mir_output_type_name;
435 mir_input_device_state_event_device_pressed_keys_for_index;
435} MIR_CLIENT_0.24;436} MIR_CLIENT_0.24;
436437
437438
=== modified file 'src/common/CMakeLists.txt'
--- src/common/CMakeLists.txt 2016-09-19 04:16:15 +0000
+++ src/common/CMakeLists.txt 2016-09-23 17:21:20 +0000
@@ -37,7 +37,7 @@
37 PARENT_SCOPE)37 PARENT_SCOPE)
3838
39# TODO we need a place to manage ABI and related versioning but use this as placeholder39# TODO we need a place to manage ABI and related versioning but use this as placeholder
40set(MIRCOMMON_ABI 6)40set(MIRCOMMON_ABI 7)
41set(symbol_map ${CMAKE_CURRENT_SOURCE_DIR}/symbols.map)41set(symbol_map ${CMAKE_CURRENT_SOURCE_DIR}/symbols.map)
4242
43add_library(mircommon SHARED43add_library(mircommon SHARED
4444
=== modified file 'src/common/events/input_device_state_event.cpp'
--- src/common/events/input_device_state_event.cpp 2016-05-26 20:59:38 +0000
+++ src/common/events/input_device_state_event.cpp 2016-09-23 17:21:20 +0000
@@ -98,9 +98,9 @@
98 return devices[index].id;98 return devices[index].id;
99}99}
100100
101uint32_t const* MirInputDeviceStateEvent::device_pressed_keys(size_t index) const101uint32_t MirInputDeviceStateEvent::device_pressed_keys_for_index(size_t index, size_t pressed_index) const
102{102{
103 return devices[index].pressed_keys.data();103 return devices[index].pressed_keys[pressed_index];
104}104}
105105
106uint32_t MirInputDeviceStateEvent::device_pressed_keys_count(size_t index) const106uint32_t MirInputDeviceStateEvent::device_pressed_keys_count(size_t index) const
107107
=== modified file 'src/common/symbols.map'
--- src/common/symbols.map 2016-09-19 04:16:15 +0000
+++ src/common/symbols.map 2016-09-23 17:21:20 +0000
@@ -1,5 +1,8 @@
1MIR_COMMON_5 {1MIR_COMMON_0.25 {
2 global:2 global:
3 __android_log_assert;
4 __android_log_print;
5 systemTime;
3 extern "C++" {6 extern "C++" {
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:
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
@@ -111,7 +114,6 @@
111 mir::default_server_socket;114 mir::default_server_socket;
112 mir::libraries_for_path*;115 mir::libraries_for_path*;
113 mir::logging::input_timestamp*;116 mir::logging::input_timestamp*;
114 mir::logging::log*;
115 mir::logging::SharedLibraryProberReport::SharedLibraryProberReport*;117 mir::logging::SharedLibraryProberReport::SharedLibraryProberReport*;
116 mir::RecursiveReadLock::?RecursiveReadLock*;118 mir::RecursiveReadLock::?RecursiveReadLock*;
117 mir::RecursiveReadLock::RecursiveReadLock*;119 mir::RecursiveReadLock::RecursiveReadLock*;
@@ -139,16 +141,8 @@
139141
140 mir::SignalBlocker::SignalBlocker*;142 mir::SignalBlocker::SignalBlocker*;
141 mir::SignalBlocker::?SignalBlocker*;143 mir::SignalBlocker::?SignalBlocker*;
142 };
143};
144144
145MIR_COMMON_5.1 { # New functions in Mir 0.16145# New functions in Mir 0.16
146 global:
147 __android_log_assert;
148 __android_log_print;
149 systemTime;
150 toMillisecondTimeoutDelay;
151 extern "C++" {
152 android::InputChannel::InputChannel*;146 android::InputChannel::InputChannel*;
153 android::InputChannel::openInputFdPair*;147 android::InputChannel::openInputFdPair*;
154 android::InputConsumer::consume*;148 android::InputConsumer::consume*;
@@ -170,10 +164,8 @@
170 android::IntSet::remove*;164 android::IntSet::remove*;
171 android::KeyEvent::initialize*;165 android::KeyEvent::initialize*;
172 android::MotionEvent::getAxisValue*;166 android::MotionEvent::getAxisValue*;
173 android::MotionEvent::getAxisValue*;
174 android::MotionEvent::getHistoricalAxisValue*;167 android::MotionEvent::getHistoricalAxisValue*;
175 android::MotionEvent::getRawAxisValue*;168 android::MotionEvent::getRawAxisValue*;
176 android::MotionEvent::getRawAxisValue*;
177 android::PointerCoords::copyFrom*;169 android::PointerCoords::copyFrom*;
178 android::PointerCoords::getAxisValue*;170 android::PointerCoords::getAxisValue*;
179 android::PointerCoords::operator*;171 android::PointerCoords::operator*;
@@ -191,37 +183,21 @@
191 mir::write_to_log;183 mir::write_to_log;
192 typeinfo?for?android::RefBase;184 typeinfo?for?android::RefBase;
193 vtable?for?android::IntSet;185 vtable?for?android::IntSet;
194 mir::dispatch::ReadableFd::ReadableFd*;186 vtable?for?mir::dispatch::ReadableFd;
195 mir::dispatch::ReadableFd::?ReadableFd*;187 mir::dispatch::ReadableFd*;
196 mir::dispatch::ReadableFd::watch_fd*;
197 mir::dispatch::ReadableFd::dispatch*;
198 mir::dispatch::ReadableFd::relevant_events*;
199 mir::logger::Logger::log*;188 mir::logger::Logger::log*;
200 };
201 local: *;
202} MIR_COMMON_5;
203189
204MIR_COMMON_5v19 { # New functions in Mir 0.19.0190# New functions in Mir 0.19.0
205 global:
206 extern "C++" {
207 typeinfo?for?mir::logging::SharedLibraryProberReport;191 typeinfo?for?mir::logging::SharedLibraryProberReport;
208 typeinfo?for?mir::time::SteadyClock;192 typeinfo?for?mir::time::SteadyClock;
209 typeinfo?for?android::InputChannel;193 typeinfo?for?android::InputChannel;
210 typeinfo?for?mir::logging::DumbConsoleLogger;194 typeinfo?for?mir::logging::DumbConsoleLogger;
211 mir::detail::libname_impl*;195 mir::detail::libname_impl*;
212 };
213} MIR_COMMON_5.1;
214196
215MIR_COMMON_0.19.1 { # New functions in Mir 0.19.1197# New functions in Mir 0.19.1
216 global:
217 extern "C++" {
218 mir::select_libraries_for_path*;198 mir::select_libraries_for_path*;
219 };
220} MIR_COMMON_5v19; # <- Note Mir 0.19.0 used the wrong syntax
221199
222MIR_COMMON_0.22 {200# New functions in Mir 0.22
223 global:
224 extern "C++" {
225 MirEvent::to_surface*;201 MirEvent::to_surface*;
226 MirEvent::to_resize*;202 MirEvent::to_resize*;
227 MirEvent::to_orientation*;203 MirEvent::to_orientation*;
@@ -351,12 +327,8 @@
351 MirPromptSessionEvent::MirPromptSessionEvent*;327 MirPromptSessionEvent::MirPromptSessionEvent*;
352 MirPromptSessionEvent::new_state*;328 MirPromptSessionEvent::new_state*;
353 MirPromptSessionEvent::set_new_state*;329 MirPromptSessionEvent::set_new_state*;
354 };
355} MIR_COMMON_0.19.1;
356330
357MIR_COMMON_0.24 {331# New functions in Mir 0.24
358 global:
359 extern "C++" {
360 android::InputPublisher::publishEventBuffer*;332 android::InputPublisher::publishEventBuffer*;
361 MirEvent::to_input_device_state*;333 MirEvent::to_input_device_state*;
362 MirInputDeviceStateEvent::MirInputDeviceStateEvent*;334 MirInputDeviceStateEvent::MirInputDeviceStateEvent*;
@@ -366,7 +338,6 @@
366 MirInputDeviceStateEvent::device_count*;338 MirInputDeviceStateEvent::device_count*;
367 MirInputDeviceStateEvent::device_id*;339 MirInputDeviceStateEvent::device_id*;
368 MirInputDeviceStateEvent::device_pointer_buttons*;340 MirInputDeviceStateEvent::device_pointer_buttons*;
369 MirInputDeviceStateEvent::device_pressed_keys*;
370 MirInputDeviceStateEvent::device_pressed_keys_count*;341 MirInputDeviceStateEvent::device_pressed_keys_count*;
371 MirInputDeviceStateEvent::modifiers*;342 MirInputDeviceStateEvent::modifiers*;
372 MirInputDeviceStateEvent::pointer_axis*;343 MirInputDeviceStateEvent::pointer_axis*;
@@ -382,19 +353,15 @@
382 android::MotionEvent::initialize*;353 android::MotionEvent::initialize*;
383 mir::dispatch::epoll_to_fd_event*;354 mir::dispatch::epoll_to_fd_event*;
384 mir::dispatch::fd_event_to_epoll*;355 mir::dispatch::fd_event_to_epoll*;
385 mir::dispatch::ReadableFd*;
386 vtable?for?mir::dispatch::ReadableFd;
387 };
388} MIR_COMMON_0.22;
389356
390MIR_COMMON_0.25 {357# New functions in Mir 0.25
391 global:
392 extern "C++" {
393 MirSurfacePlacementEvent::MirSurfacePlacementEvent*;358 MirSurfacePlacementEvent::MirSurfacePlacementEvent*;
394 MirSurfacePlacementEvent::id*;359 MirSurfacePlacementEvent::id*;
395 MirSurfacePlacementEvent::set_id*;360 MirSurfacePlacementEvent::set_id*;
396 MirSurfacePlacementEvent::placement*;361 MirSurfacePlacementEvent::placement*;
397 MirSurfacePlacementEvent::set_placement*;362 MirSurfacePlacementEvent::set_placement*;
363 MirInputDeviceStateEvent::device_pressed_keys_for_index*;
398 mir::output_type_name*;364 mir::output_type_name*;
399 };365 };
400} MIR_COMMON_0.24;366 local: *;
367};
401368
=== modified file 'src/include/common/mir/events/input_device_state_event.h'
--- src/include/common/mir/events/input_device_state_event.h 2016-05-26 20:59:38 +0000
+++ src/include/common/mir/events/input_device_state_event.h 2016-09-23 17:21:20 +0000
@@ -43,7 +43,7 @@
43 uint32_t device_count() const;43 uint32_t device_count() const;
44 MirInputDeviceId device_id(size_t index) const;44 MirInputDeviceId device_id(size_t index) const;
45 MirPointerButtons device_pointer_buttons(size_t index) const;45 MirPointerButtons device_pointer_buttons(size_t index) const;
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;
47 uint32_t device_pressed_keys_count(size_t index) const;47 uint32_t device_pressed_keys_count(size_t index) const;
4848
49 static mir::EventUPtr deserialize(std::string const& bytes);49 static mir::EventUPtr deserialize(std::string const& bytes);
5050
=== modified file 'src/server/graphics/nested/input_platform.cpp'
--- src/server/graphics/nested/input_platform.cpp 2016-09-01 12:28:46 +0000
+++ src/server/graphics/nested/input_platform.cpp 2016-09-23 17:21:20 +0000
@@ -247,9 +247,13 @@
247 {247 {
248 auto dest = it->second->destination;248 auto dest = it->second->destination;
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);
250 auto const* scan_codes = mir_input_device_state_event_device_pressed_keys(device_state, index);250 std::vector<uint32_t> scan_codes;
251 for (uint32_t i = 0; i < key_count; i++)
252 {
253 scan_codes.push_back(mir_input_device_state_event_device_pressed_keys_for_index(device_state, index, i));
254 }
251255
252 dest->key_state({scan_codes, scan_codes + key_count});256 dest->key_state(scan_codes);
253 dest->pointer_state(257 dest->pointer_state(
254 mir_input_device_state_event_device_pointer_buttons(device_state, index));258 mir_input_device_state_event_device_pointer_buttons(device_state, index));
255 }259 }
256260
=== modified file 'tests/unit-tests/input/android/test_android_input_sender.cpp'
--- tests/unit-tests/input/android/test_android_input_sender.cpp 2016-06-07 21:10:34 +0000
+++ tests/unit-tests/input/android/test_android_input_sender.cpp 2016-09-23 17:21:20 +0000
@@ -503,7 +503,8 @@
503 const auto timestamp = std::chrono::nanoseconds(10);503 const auto timestamp = std::chrono::nanoseconds(10);
504 register_surface();504 register_surface();
505 std::vector<mir::events::InputDeviceState> states;505 std::vector<mir::events::InputDeviceState> states;
506 states.push_back({MirInputDeviceId{23}, {50, 60, 80}, 0});506 std::vector<uint32_t> const pressed_keys = {50, 60, 80};
507 states.push_back({MirInputDeviceId{23}, pressed_keys, 0});
507 states.push_back({MirInputDeviceId{21}, {}, mir_pointer_button_primary});508 states.push_back({MirInputDeviceId{21}, {}, mir_pointer_button_primary});
508509
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,
@@ -520,12 +521,13 @@
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()));
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));
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));
523
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}));
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);
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));
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++)
528 EXPECT_THAT(mir_input_device_state_event_device_pressed_keys(input_device_state, 0)[2], Eq(80));528 {
529 EXPECT_THAT(mir_input_device_state_event_device_pressed_keys_for_index(input_device_state, 0, i), Eq(pressed_keys[i]));
530 }
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);
530532
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}));
532534
=== modified file 'tests/unit-tests/input/test_event_builders.cpp'
--- tests/unit-tests/input/test_event_builders.cpp 2016-05-26 20:59:38 +0000
+++ tests/unit-tests/input/test_event_builders.cpp 2016-09-23 17:21:20 +0000
@@ -189,12 +189,13 @@
189 auto const pos_y = 53.2f;189 auto const pos_y = 53.2f;
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;
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;
192 std::vector<uint32_t> const pressed_keys = {KEY_LEFTALT, KEY_M};
192 auto ev = mev::make_event(timestamp,193 auto ev = mev::make_event(timestamp,
193 button_state,194 button_state,
194 modifiers,195 modifiers,
195 pos_x,196 pos_x,
196 pos_y,197 pos_y,
197 {mev::InputDeviceState{MirInputDeviceId{3}, {KEY_LEFTALT, KEY_M}, 0},198 {mev::InputDeviceState{MirInputDeviceId{3}, pressed_keys, 0},
198 mev::InputDeviceState{MirInputDeviceId{2}, {}, button_state}});199 mev::InputDeviceState{MirInputDeviceId{2}, {}, button_state}});
199200
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));
@@ -208,9 +209,12 @@
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));
209210
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}));
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);
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));
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++)
215 {
216 EXPECT_THAT(mir_input_device_state_event_device_pressed_keys_for_index(ids_event, 0, i), Eq(pressed_keys[i]));
217 }
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));
215219
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}));
@@ -252,6 +256,7 @@
252 auto const pos_y = 0.0f;256 auto const pos_y = 0.0f;
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;
254 auto const modifiers = mir_input_event_modifier_none;258 auto const modifiers = mir_input_event_modifier_none;
259 std::vector<uint32_t> const pressed_keys = {KEY_RIGHTALT, KEY_LEFTSHIFT, KEY_Q};
255 auto ev = mev::make_event(timestamp,260 auto ev = mev::make_event(timestamp,
256 button_state,261 button_state,
257 modifiers,262 modifiers,
@@ -259,7 +264,7 @@
259 pos_y,264 pos_y,
260 {mev::InputDeviceState{MirInputDeviceId{0}, {}, mir_pointer_button_primary},265 {mev::InputDeviceState{MirInputDeviceId{0}, {}, mir_pointer_button_primary},
261 mev::InputDeviceState{MirInputDeviceId{2}, {}, mir_pointer_button_secondary},266 mev::InputDeviceState{MirInputDeviceId{2}, {}, mir_pointer_button_secondary},
262 mev::InputDeviceState{MirInputDeviceId{3}, {KEY_RIGHTALT, KEY_LEFTSHIFT, KEY_Q}, 0}});267 mev::InputDeviceState{MirInputDeviceId{3}, pressed_keys, 0}});
263268
264 auto encoded = MirEvent::serialize(ev.get());269 auto encoded = MirEvent::serialize(ev.get());
265270
@@ -269,8 +274,10 @@
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());
270275
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));
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);
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));
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++)
275 EXPECT_THAT(mir_input_device_state_event_device_pressed_keys(ids_event, 2)[2], Eq(KEY_Q));280 {
281 EXPECT_THAT(mir_input_device_state_event_device_pressed_keys_for_index(ids_event, 2, i), Eq(pressed_keys[i]));
282 }
276}283}

Subscribers

People subscribed via source and target branches