Mir

Merge lp:~cemil-azizoglu/mir/remove-deprecations-1 into lp:mir

Proposed by Cemil Azizoglu
Status: Work in progress
Proposed branch: lp:~cemil-azizoglu/mir/remove-deprecations-1
Merge into: lp:mir
Diff against target: 2878 lines (+29/-2073)
36 files modified
include/client/mir/event_printer.h (+0/-10)
include/client/mir/events/event_builders.h (+0/-55)
include/client/mir_toolkit/debug/surface.h (+0/-31)
include/client/mir_toolkit/events/event.h (+1/-55)
include/client/mir_toolkit/events/input_configuration_event.h (+0/-27)
include/client/mir_toolkit/events/keymap_event.h (+0/-13)
include/client/mir_toolkit/events/surface_event.h (+0/-22)
include/client/mir_toolkit/events/surface_output_event.h (+0/-55)
include/client/mir_toolkit/events/surface_placement.h (+0/-9)
include/client/mir_toolkit/mir_blob.h (+0/-20)
include/client/mir_toolkit/mir_client_library.h (+0/-1)
include/client/mir_toolkit/mir_connection.h (+0/-39)
include/client/mir_toolkit/mir_display_configuration.h (+0/-9)
include/client/mir_toolkit/mir_persistent_id.h (+0/-79)
include/client/mir_toolkit/mir_surface.h (+0/-251)
include/client/mir_toolkit/mir_window.h (+1/-1)
src/client/display_configuration_api.cpp (+0/-5)
src/client/event.cpp (+0/-102)
src/client/event_printer.cpp (+0/-78)
src/client/events/event_builders.cpp (+0/-106)
src/client/mir_blob.cpp (+0/-143)
src/client/mir_connection_api.cpp (+0/-36)
src/client/mir_debug_api.cpp (+0/-22)
src/client/mir_surface.cpp (+2/-2)
src/client/mir_surface_api.cpp (+1/-399)
src/client/symbols-debug.map (+1/-1)
src/client/symbols.map (+4/-91)
tests/acceptance-tests/CMakeLists.txt (+0/-1)
tests/acceptance-tests/test_client_library.cpp (+9/-32)
tests/acceptance-tests/test_client_library_callbacks.cpp (+0/-48)
tests/acceptance-tests/test_client_library_errors.cpp (+5/-9)
tests/acceptance-tests/test_client_platform_operation.cpp (+0/-198)
tests/acceptance-tests/test_client_surfaces.cpp (+2/-5)
tests/acceptance-tests/test_debug_api.cpp (+0/-82)
tests/acceptance-tests/test_mirblob.cpp (+0/-30)
tests/acceptance-tests/test_persistent_surface_store.cpp (+3/-6)
To merge this branch: bzr merge lp:~cemil-azizoglu/mir/remove-deprecations-1
Reviewer Review Type Date Requested Status
Alan Griffiths Needs Resubmitting
Cemil Azizoglu (community) Needs Fixing
Mir CI Bot continuous-integration Needs Fixing
Review via email: mp+316515@code.launchpad.net

Commit message

Remove some low-hanging deprecations. More to come.

Description of the change

There are more deprecations to be removed, low-hanging, or otherwise.

- The symbol stanza will later be collapsed into a new stanza. For now, I've deleted each removed function from its own stanza (though I went ahead and renamed the stanza for mir_debug to 1.0)
- Only tests that either don't make sense or have other coverage has been removed.

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

FAILED: Continuous integration, rev:4018
https://mir-jenkins.ubuntu.com/job/mir-ci/2946/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/3904/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/3990
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/3980
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/3980
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/3980
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/3931/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/3931
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/3931/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/3931
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/3931/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/3931/console
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/3931/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/3931
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/3931/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/3931
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/3931/artifact/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

00:55:52 Saving GLMark2 detailed results to: /tmp/GLMark2Test_fullscreen_default.log
00:55:52 glmark2-es2-mir: relocation error: glmark2-es2-mir: symbol mir_connection_create_spec_for_normal_surface, version MIR_CLIENT_9 not defined in file libmirclient.so.9 with link time reference
00:55:52 ../../../tests/performance-tests/test_glmark2-es2-mir.cpp:100: Failure
00:55:52 Value of: run_glmark2("--fullscreen")
00:55:52 Expected: is >= 56
00:55:52 Actual: -1 (of type int)
00:55:52 [2017-02-07 00:55:52.264989] mirserver: Stopping
00:55:52 [ FAILED ] GLMark2Test.fullscreen_default (853 ms)
00:55:52 [----------] 1 test from GLMark2Test (853 ms total)
00:55:52
00:55:52 [----------] Global test environment tear-down
00:55:52 [==========] 1 test from 1 test case ran. (853 ms total)
00:55:52 [ PASSED ] 0 tests.
00:55:52 [ FAILED ] 1 test, listed below:
00:55:52 [ FAILED ] GLMark2Test.fullscreen_default
00:55:52
00:55:52 1 FAILED TEST
00:55:52  YOU HAVE 5 DISABLED TESTS

Hmm we'll have to exclude GLMark2 for the time being.

review: Needs Fixing
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

I think we should get downstreams rebuilt using the non-deprecated APIs before deleting the deprecated ones. (Not exclude them.)

review: Needs Resubmitting

Unmerged revisions

4018. By Cemil Azizoglu

One more persistent id rename

4017. By Cemil Azizoglu

Remove more deprecations

4016. By Cemil Azizoglu

Low hanging deprecations removed.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'include/client/mir/event_printer.h'
--- include/client/mir/event_printer.h 2017-01-19 05:30:03 +0000
+++ include/client/mir/event_printer.h 2017-02-07 00:07:50 +0000
@@ -34,20 +34,10 @@
34std::ostream& operator<<(std::ostream& out, MirPromptSessionState state);34std::ostream& operator<<(std::ostream& out, MirPromptSessionState state);
35std::ostream& operator<<(std::ostream& out, MirOrientation orientation);35std::ostream& operator<<(std::ostream& out, MirOrientation orientation);
3636
37std::ostream& operator<<(std::ostream& out, MirSurfaceAttrib attribute)
38__attribute__ ((deprecated("use << with MirWindowAttrib instead")));
39std::ostream& operator<<(std::ostream& out, MirWindowAttrib attribute);37std::ostream& operator<<(std::ostream& out, MirWindowAttrib attribute);
40std::ostream& operator<<(std::ostream& out, MirSurfaceFocusState state)
41__attribute__ ((deprecated("use << with MirWindowFocusState instead")));
42std::ostream& operator<<(std::ostream& out, MirWindowFocusState state);38std::ostream& operator<<(std::ostream& out, MirWindowFocusState state);
43std::ostream& operator<<(std::ostream& out, MirSurfaceVisibility state)
44__attribute__ ((deprecated("use << with MirWindowVisibility instead")));
45std::ostream& operator<<(std::ostream& out, MirWindowVisibility state);39std::ostream& operator<<(std::ostream& out, MirWindowVisibility state);
46std::ostream& operator<<(std::ostream& out, MirSurfaceType type)
47__attribute__ ((deprecated("use << with MirWindowType instead")));
48std::ostream& operator<<(std::ostream& out, MirWindowType type);40std::ostream& operator<<(std::ostream& out, MirWindowType type);
49std::ostream& operator<<(std::ostream& out, MirSurfaceState state)
50__attribute__ ((deprecated("use << with MirWindowState instead")));
51std::ostream& operator<<(std::ostream& out, MirWindowState state);41std::ostream& operator<<(std::ostream& out, MirWindowState state);
5242
53std::ostream& operator<<(std::ostream& out, MirPromptSessionEvent const& event);43std::ostream& operator<<(std::ostream& out, MirPromptSessionEvent const& event);
5444
=== modified file 'include/client/mir/events/event_builders.h'
--- include/client/mir/events/event_builders.h 2017-01-19 05:30:03 +0000
+++ include/client/mir/events/event_builders.h 2017-02-07 00:07:50 +0000
@@ -46,9 +46,6 @@
46EventUPtr make_event(MirPromptSessionState state);46EventUPtr make_event(MirPromptSessionState state);
47// Surface resize event47// Surface resize event
48EventUPtr make_event(frontend::SurfaceId const& surface_id, geometry::Size const& size);48EventUPtr make_event(frontend::SurfaceId const& surface_id, geometry::Size const& size);
49// Surface configure event
50EventUPtr make_event(frontend::SurfaceId const& surface_id, MirSurfaceAttrib attribute, int value)
51__attribute__ ((deprecated("use make_event with MirWindowAttribute instead")));
52// Window configure event49// Window configure event
53EventUPtr make_event(frontend::SurfaceId const& surface_id, MirWindowAttrib attribute, int value);50EventUPtr make_event(frontend::SurfaceId const& surface_id, MirWindowAttrib attribute, int value);
54// Close surface event51// Close surface event
@@ -78,47 +75,15 @@
78void set_cursor_position(MirEvent& event, float x, float y);75void set_cursor_position(MirEvent& event, float x, float y);
79void set_button_state(MirEvent& event, MirPointerButtons button_state);76void set_button_state(MirEvent& event, MirPointerButtons button_state);
8077
81// Deprecated version with uint64_t mac
82EventUPtr make_event(MirInputDeviceId device_id, std::chrono::nanoseconds timestamp,
83 uint64_t mac, MirKeyboardAction action, xkb_keysym_t key_code,
84 int scan_code, MirInputEventModifiers modifiers) __attribute__ ((deprecated));
85
86// Deprecated version without mac
87EventUPtr make_event(MirInputDeviceId device_id, std::chrono::nanoseconds timestamp,
88 MirKeyboardAction action, xkb_keysym_t key_code,
89 int scan_code, MirInputEventModifiers modifiers) __attribute__ ((deprecated));
90
91// Touch event78// Touch event
92EventUPtr make_event(MirInputDeviceId device_id, std::chrono::nanoseconds timestamp,79EventUPtr make_event(MirInputDeviceId device_id, std::chrono::nanoseconds timestamp,
93 std::vector<uint8_t> const& mac, MirInputEventModifiers modifiers);80 std::vector<uint8_t> const& mac, MirInputEventModifiers modifiers);
9481
95// Deprecated version with uint64_t mac
96EventUPtr make_event(MirInputDeviceId device_id, std::chrono::nanoseconds timestamp,
97 uint64_t mac, MirInputEventModifiers modifiers) __attribute__ ((deprecated));
98
99// Deprecated version without mac
100EventUPtr make_event(MirInputDeviceId device_id, std::chrono::nanoseconds timestamp,
101 MirInputEventModifiers modifiers) __attribute__ ((deprecated));
102
103void add_touch(MirEvent &event, MirTouchId touch_id, MirTouchAction action,82void add_touch(MirEvent &event, MirTouchId touch_id, MirTouchAction action,
104 MirTouchTooltype tooltype, float x_axis_value, float y_axis_value,83 MirTouchTooltype tooltype, float x_axis_value, float y_axis_value,
105 float pressure_value, float touch_major_value, float touch_minor_value, float size_value);84 float pressure_value, float touch_major_value, float touch_minor_value, float size_value);
10685
107// Pointer event86// Pointer event
108// Deprecated version without relative axis
109EventUPtr make_event(MirInputDeviceId device_id, std::chrono::nanoseconds timestamp,
110 uint64_t mac, MirInputEventModifiers modifiers, MirPointerAction action,
111 MirPointerButtons buttons_pressed,
112 float x_axis_value, float y_axis_value,
113 float hscroll_value, float vscroll_value) __attribute__ ((deprecated));
114
115// Deprecated version without relative axis and mac
116EventUPtr make_event(MirInputDeviceId device_id, std::chrono::nanoseconds timestamp,
117 MirInputEventModifiers modifiers, MirPointerAction action,
118 MirPointerButtons buttons_pressed,
119 float x_axis_value, float y_axis_value,
120 float hscroll_value, float vscroll_value) __attribute__ ((deprecated));
121
122EventUPtr make_event(MirInputDeviceId device_id, std::chrono::nanoseconds timestamp,87EventUPtr make_event(MirInputDeviceId device_id, std::chrono::nanoseconds timestamp,
123 std::vector<uint8_t> const& mac, MirInputEventModifiers modifiers, MirPointerAction action,88 std::vector<uint8_t> const& mac, MirInputEventModifiers modifiers, MirPointerAction action,
124 MirPointerButtons buttons_pressed,89 MirPointerButtons buttons_pressed,
@@ -126,26 +91,6 @@
126 float hscroll_value, float vscroll_value,91 float hscroll_value, float vscroll_value,
127 float relative_x_value, float relative_y_value);92 float relative_x_value, float relative_y_value);
12893
129// Deprecated version with uint64_t mac
130EventUPtr make_event(MirInputDeviceId device_id, std::chrono::nanoseconds timestamp,
131 uint64_t mac, MirInputEventModifiers modifiers, MirPointerAction action,
132 MirPointerButtons buttons_pressed,
133 float x_axis_value, float y_axis_value,
134 float hscroll_value, float vscroll_value,
135 float relative_x_value, float relative_y_value) __attribute__ ((deprecated));
136
137// Deprecated version without mac
138EventUPtr make_event(MirInputDeviceId device_id, std::chrono::nanoseconds timestamp,
139 MirInputEventModifiers modifiers, MirPointerAction action,
140 MirPointerButtons buttons_pressed,
141 float x_axis_value, float y_axis_value,
142 float hscroll_value, float vscroll_value,
143 float relative_x_value, float relative_y_value) __attribute__ ((deprecated));
144
145// Input configuration event
146EventUPtr make_event(MirInputConfigurationAction action,
147 MirInputDeviceId id, std::chrono::nanoseconds time) __attribute__((deprecated));
148
149EventUPtr make_event(std::chrono::nanoseconds timestamp,94EventUPtr make_event(std::chrono::nanoseconds timestamp,
150 MirPointerButtons pointer_buttons,95 MirPointerButtons pointer_buttons,
151 MirInputEventModifiers modifiers,96 MirInputEventModifiers modifiers,
15297
=== modified file 'include/client/mir_toolkit/debug/surface.h'
--- include/client/mir_toolkit/debug/surface.h 2017-01-18 04:43:15 +0000
+++ include/client/mir_toolkit/debug/surface.h 2017-02-07 00:07:50 +0000
@@ -44,37 +44,6 @@
44 */44 */
45uint32_t mir_debug_window_current_buffer_id(MirWindow *window);45uint32_t mir_debug_window_current_buffer_id(MirWindow *window);
4646
47#pragma GCC diagnostic push
48#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
49
50/**
51 * Get the screen coordinates corresponding to a pair of surface coordinates
52 * \pre The surface is valid
53 * \param [in] surface The surface
54 * \param [in] x, y Surface coordinates to map to screen coordinates
55 * \param [out] screen_x, screen_y The screen coordinates corresponding to x, y.
56 * \return True if screen_x and screen_y contain values
57 * \note There are many cases where such a mapping does not exist or would be expensive
58 * to calculate. Only Mir servers started with the --debug option will ever return
59 * values for this call, and even when --debug is enabled servers are free to
60 * return nothing.
61 *
62 * This call will only be interesting for automated testing, where both the client
63 * and shell state is known and constrained.
64 */
65bool mir_debug_surface_coords_to_screen(MirSurface *surface,
66 int x, int y,
67 int* screen_x, int* screen_y)
68__attribute__((deprecated("Use mir_extension_window_coordinate_translation instead")));
69
70int mir_debug_surface_id(MirSurface *surface)
71__attribute__((deprecated("Use mir_debug_window_id() instead")));
72
73uint32_t mir_debug_surface_current_buffer_id(MirSurface *surface)
74__attribute__((deprecated("Use mir_debug_window_current_buffer_id() instead")));
75
76#pragma GCC diagnostic pop
77
78#ifdef __cplusplus47#ifdef __cplusplus
79}48}
80#endif49#endif
8150
=== modified file 'include/client/mir_toolkit/events/event.h'
--- include/client/mir_toolkit/events/event.h 2017-01-27 04:57:53 +0000
+++ include/client/mir_toolkit/events/event.h 2017-02-07 00:07:50 +0000
@@ -89,7 +89,6 @@
8989
90#include "mir_toolkit/events/input/input_event.h"90#include "mir_toolkit/events/input/input_event.h"
91#include "mir_toolkit/events/resize_event.h"91#include "mir_toolkit/events/resize_event.h"
92#include "mir_toolkit/events/surface_event.h"
93#include "mir_toolkit/events/window_event.h"92#include "mir_toolkit/events/window_event.h"
94#include "mir_toolkit/events/orientation_event.h"93#include "mir_toolkit/events/orientation_event.h"
95#include "mir_toolkit/events/prompt_session_event.h"94#include "mir_toolkit/events/prompt_session_event.h"
@@ -128,19 +127,8 @@
128MirInputEvent const* mir_event_get_input_event(MirEvent const* event);127MirInputEvent const* mir_event_get_input_event(MirEvent const* event);
129128
130/**129/**
131 * Retrieve the MirSurfaceEvent associated with a MirEvent of
132 * type mir_event_type_surface. See <mir_toolkit/events/surface_event.h>
133 * for accessors.
134 *
135 * \param [in] event The event
136 * \return The associated MirSurfaceEvent
137 */
138MirSurfaceEvent const* mir_event_get_surface_event(MirEvent const* event)
139__attribute__ ((deprecated("use mir_event_get_window_event instead")));
140
141/**
142 * Retrieve the MirWindowEvent associated with a MirEvent of130 * Retrieve the MirWindowEvent associated with a MirEvent of
143 * type mir_event_type_window. See <mir_toolkit/events/surface_event.h>131 * type mir_event_type_window. See <mir_toolkit/events/window_event.h>
144 * for accessors.132 * for accessors.
145 *133 *
146 * \param [in] event The event134 * \param [in] event The event
@@ -212,37 +200,6 @@
212200
213#pragma GCC diagnostic push201#pragma GCC diagnostic push
214#pragma GCC diagnostic ignored "-Wdeprecated-declarations"202#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
215/**
216 * Retrieve the MirInputConfig associated with a MirEvent of
217 * type mir_event_type_input_configuration. The event signifies that the
218 * input device configuration has changed.
219 *
220 * \deprecated Input devices and changes to the input devices are indicated
221 * via the MirInputConfigCallback
222 * \param [in] event The event
223 * \return The associated MirInputConfigurationEvent
224 */
225/// @cond
226__attribute__((deprecated))
227/// @endcond
228MirInputConfigurationEvent const* mir_event_get_input_configuration_event(MirEvent const* event);
229#pragma GCC diagnostic pop
230
231/**
232 * Retrieve the MirSurfaceOutputEvent associated with a MirEvent of type
233 * mir_event_type_surface_output. The event signifies that the properties
234 * of the output the surface is displayed upon have changed.
235 *
236 * A MirSurfaceOutputEvent is generated either when the properties of the
237 * output the surface is primarily on change (for example: by user configuration
238 * of resolution) or when the output the surface is primarily on changes
239 * (for example: when a user moves the surface from one monitor to another).
240 *
241 * \param [in] event The event
242 * \return The associated MirSurfaceOutputEvent
243 */
244MirSurfaceOutputEvent const* mir_event_get_surface_output_event(MirEvent const* event)
245__attribute__((deprecated("use mir_event_get_window_output_event")));
246203
247/**204/**
248 * Retrieve the MirWindowOutputEvent associated with a MirEvent of type205 * Retrieve the MirWindowOutputEvent associated with a MirEvent of type
@@ -271,17 +228,6 @@
271MirInputDeviceStateEvent const* mir_event_get_input_device_state_event(MirEvent const* event);228MirInputDeviceStateEvent const* mir_event_get_input_device_state_event(MirEvent const* event);
272229
273/**230/**
274 * Retrieve the MirSurfacePlacementEvent associated with a MirEvent of
275 * type mir_event_type_surface_placement. The event signifies that the
276 * the server has fulfilled a request for relative surface placement.
277 *
278 * \param [in] event The event
279 * \return The associated MirSurfacePlacementEvent
280 */
281MirSurfacePlacementEvent const* mir_event_get_surface_placement_event(MirEvent const* event)
282__attribute__((deprecated("use mir_event_get_window_placement_event")));
283
284/**
285 * Retrieve the MirWindowPlacementEvent associated with a MirEvent of231 * Retrieve the MirWindowPlacementEvent associated with a MirEvent of
286 * type mir_event_type_window_placement. The event signifies that the232 * type mir_event_type_window_placement. The event signifies that the
287 * the server has fulfilled a request for relative window placement.233 * the server has fulfilled a request for relative window placement.
288234
=== modified file 'include/client/mir_toolkit/events/input_configuration_event.h'
--- include/client/mir_toolkit/events/input_configuration_event.h 2017-01-27 04:57:53 +0000
+++ include/client/mir_toolkit/events/input_configuration_event.h 2017-02-07 00:07:50 +0000
@@ -47,33 +47,6 @@
47} MirInputConfigurationAction47} MirInputConfigurationAction
48__attribute__((deprecated));48__attribute__((deprecated));
4949
50#pragma GCC diagnostic push
51#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
52/**
53 * Retrieve the input configuration action which occurred.
54 *
55 * \param[in] ev The input configuration event
56 * \return The action
57 */
58MirInputConfigurationAction mir_input_configuration_event_get_action(MirInputConfigurationEvent const* ev) __attribute__((deprecated));
59
60/**
61 * Retreive the time associated with a MirInputConfiguration event
62
63 * \param[in] ev The input configuration event
64 * \return The time in nanoseconds since epoch
65 */
66int64_t mir_input_configuration_event_get_time(MirInputConfigurationEvent const* ev) __attribute__((deprecated));
67
68/**
69 * Retreive the device id associated with a MirInputConfiguration event
70
71 * \param[in] ev The input configuration event
72 * \return The device id or -1 if not applicable to events of this action
73 */
74MirInputDeviceId mir_input_configuration_event_get_device_id(MirInputConfigurationEvent const* ev) __attribute__((deprecated));
75#pragma GCC diagnostic pop
76
77#ifdef __cplusplus50#ifdef __cplusplus
78}51}
79/**@}*/52/**@}*/
8053
=== modified file 'include/client/mir_toolkit/events/keymap_event.h'
--- include/client/mir_toolkit/events/keymap_event.h 2017-01-18 02:29:37 +0000
+++ include/client/mir_toolkit/events/keymap_event.h 2017-02-07 00:07:50 +0000
@@ -34,19 +34,6 @@
34/**34/**
35 * Retrieve the new keymap reported by this MirKeymapEvent35 * Retrieve the new keymap reported by this MirKeymapEvent
36 *36 *
37 * \deprecated keymap credentials are no longer available use
38 * mir_keymap_event_get_keymap_buffer instead.
39 *
40 * \param[in] ev The keymap event
41 * \param[out] rules XKB rules describing the new keymap.
42 */
43void mir_keymap_event_get_rules(MirKeymapEvent const* ev,
44 struct xkb_rule_names* rules)
45 __attribute__ ((deprecated));
46
47/**
48 * Retrieve the new keymap reported by this MirKeymapEvent
49 *
50 * The keymap buffer is only valid while the MirKeymapEvent is valid.37 * The keymap buffer is only valid while the MirKeymapEvent is valid.
51 * The buffer can be used via xkb_keymap_new_from_buffer38 * The buffer can be used via xkb_keymap_new_from_buffer
52 * \param[in] ev The keymap event39 * \param[in] ev The keymap event
5340
=== modified file 'include/client/mir_toolkit/events/surface_event.h'
--- include/client/mir_toolkit/events/surface_event.h 2017-01-23 03:38:33 +0000
+++ include/client/mir_toolkit/events/surface_event.h 2017-02-07 00:07:50 +0000
@@ -29,28 +29,6 @@
29extern "C" {29extern "C" {
30#endif30#endif
3131
32// Ignore use of deprecate MirSurfaceEvent typedef in deprecated functions (for now)
33#pragma GCC diagnostic push
34#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
35/**
36 * Retrieve the attribute index configured with a given MirSurfaceEvent
37 *
38 * \param [in] event The event
39 * \return The associated attribute
40 */
41MirSurfaceAttrib mir_surface_event_get_attribute(MirSurfaceEvent const* event)
42__attribute__ ((deprecated("use mir_window_event_get_attribute instead")));
43
44/**
45 * Retrieve the new value of the associated attribute for a given MirSurfaceEvent
46 *
47 * \param [in] event The event
48 * \return The associated attribute value
49 */
50int mir_surface_event_get_attribute_value(MirSurfaceEvent const* event)
51__attribute__ ((deprecated("use make_event with mir_window_event_get_attribute_value instead")));
52#pragma GCC diagnostic pop
53
54#ifdef __cplusplus32#ifdef __cplusplus
55}33}
56/**@}*/34/**@}*/
5735
=== modified file 'include/client/mir_toolkit/events/surface_output_event.h'
--- include/client/mir_toolkit/events/surface_output_event.h 2017-01-23 03:38:33 +0000
+++ include/client/mir_toolkit/events/surface_output_event.h 2017-02-07 00:07:50 +0000
@@ -29,61 +29,6 @@
29extern "C" {29extern "C" {
30#endif30#endif
3131
32// Ignore use of deprecate MirSurfaceOutputEvent typedef in deprecated functions (for now)
33#pragma GCC diagnostic push
34#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
35/**
36 * Retrieve the DPI of the new output configuration of a MirSurfaceOutputEvent
37 *
38 * \param [in] ev The event
39 * \return The new DPI value for the surface is primarily on.
40 */
41int mir_surface_output_event_get_dpi(MirSurfaceOutputEvent const* ev)
42__attribute__ ((deprecated("use mir_window_output_event_get_dpi instead")));
43
44/**
45 * Retrieve the form factor of the new output configuration of a MirSurfaceOutputEvent
46 *
47 * \param [in] ev The event
48 * \return The new form factor of the output the surface is primarily on.
49 */
50MirFormFactor mir_surface_output_event_get_form_factor(MirSurfaceOutputEvent const* ev)
51__attribute__ ((deprecated("use mir_window_output_event_get_form_factor instead")));
52
53/**
54 * Retrieve the suggested scaling factor of the new output configuration of a
55 * MirSurfaceOutputEvent.
56 *
57 * \param [in] ev The event
58 * \return The new scaling factor of the output the surface is primarily on.
59 */
60float mir_surface_output_event_get_scale(MirSurfaceOutputEvent const* ev)
61__attribute__ ((deprecated("use mir_window_output_event_get_scale instead")));
62
63/**
64 * Retrieve the maximum refresh rate of the output(s) associated with a
65 * MirSurfaceOutputEvent. For variable refresh rate displays this represents
66 * the maximum refresh rate of the display to aim for, rather than a measurement
67 * of recent performance.
68 *
69 * \param [in] ev The event
70 * \return The refresh rate in Hz
71 */
72double mir_surface_output_event_get_refresh_rate(MirSurfaceOutputEvent const* ev)
73__attribute__ ((deprecated("use mir_window_output_event_get_refresh_rate instead")));
74
75/**
76 * Retrieve the ID of the output this surface is on from a MirSurfaceOutputEvent
77 *
78 * \param [in] ev The event
79 * \return The ID of the output the surface is currently considered to be on.
80 * (From MirDisplayOutput::output_id)
81 */
82uint32_t mir_surface_output_event_get_output_id(MirSurfaceOutputEvent const *ev)
83__attribute__ ((deprecated("use mir_window_output_event_get_output_id instead")));
84
85#pragma GCC diagnostic pop
86
87#ifdef __cplusplus32#ifdef __cplusplus
88}33}
89/**@}*/34/**@}*/
9035
=== modified file 'include/client/mir_toolkit/events/surface_placement.h'
--- include/client/mir_toolkit/events/surface_placement.h 2017-01-19 05:30:03 +0000
+++ include/client/mir_toolkit/events/surface_placement.h 2017-02-07 00:07:50 +0000
@@ -31,15 +31,6 @@
3131
32typedef struct MirSurfacePlacementEvent MirSurfacePlacementEvent;32typedef struct MirSurfacePlacementEvent MirSurfacePlacementEvent;
3333
34/**
35 * Retrieve the relative position from a placement notification
36 *
37 * \param [in] event The placement event
38 * \return The position relative to the parent surface
39 */
40MirRectangle mir_surface_placement_get_relative_position(MirSurfacePlacementEvent const* event)
41__attribute__ ((deprecated("use mir_window_placement_get_relative_position instead")));
42
43#ifdef __cplusplus34#ifdef __cplusplus
44}35}
45/**@}*/36/**@}*/
4637
=== modified file 'include/client/mir_toolkit/mir_blob.h'
--- include/client/mir_toolkit/mir_blob.h 2017-01-19 05:30:03 +0000
+++ include/client/mir_toolkit/mir_blob.h 2017-02-07 00:07:50 +0000
@@ -29,15 +29,6 @@
29#endif29#endif
3030
31/**31/**
32 * Create a blob from a display configuration
33 *
34 * \param [in] configuration The display configuration
35 * \return A blob
36 */
37MirBlob* mir_blob_from_display_configuration(MirDisplayConfiguration* configuration)
38__attribute__ ((deprecated("use mir_blob_from_display_config instead")));
39
40/**
41 * Create a blob from a display config32 * Create a blob from a display config
42 *33 *
43 * \param [in] config The display config34 * \param [in] config The display config
@@ -57,17 +48,6 @@
57MirBlob* mir_blob_onto_buffer(void const* buffer, size_t buffer_size);48MirBlob* mir_blob_onto_buffer(void const* buffer, size_t buffer_size);
5849
59/**50/**
60 * Create a blob from a display configuration
61 *
62 * \warning will abort() if the blob doesn't represent a meaningful display configuration
63 *
64 * \param [in] blob The blob
65 * \return A display configuration
66 */
67MirDisplayConfiguration* mir_blob_to_display_configuration(MirBlob* blob)
68__attribute__ ((deprecated("use mir_blob_to_display_config instead")));
69
70/**
71 * Create a blob from a display config51 * Create a blob from a display config
72 *52 *
73 * \warning will abort() if the blob doesn't represent a meaningful display config53 * \warning will abort() if the blob doesn't represent a meaningful display config
7454
=== modified file 'include/client/mir_toolkit/mir_client_library.h'
--- include/client/mir_toolkit/mir_client_library.h 2017-02-02 19:17:46 +0000
+++ include/client/mir_toolkit/mir_client_library.h 2017-02-07 00:07:50 +0000
@@ -33,7 +33,6 @@
33#include <mir_toolkit/mir_display_configuration.h>33#include <mir_toolkit/mir_display_configuration.h>
34#include <mir_toolkit/mir_input_device.h>34#include <mir_toolkit/mir_input_device.h>
35#include <mir_toolkit/mir_error.h>35#include <mir_toolkit/mir_error.h>
36#include <mir_toolkit/mir_persistent_id.h>
37#include <mir_toolkit/mir_window_id.h>36#include <mir_toolkit/mir_window_id.h>
3837
39#endif /* MIR_CLIENT_LIBRARY_H */38#endif /* MIR_CLIENT_LIBRARY_H */
4039
=== modified file 'include/client/mir_toolkit/mir_connection.h'
--- include/client/mir_toolkit/mir_connection.h 2017-01-31 19:33:32 +0000
+++ include/client/mir_toolkit/mir_connection.h 2017-02-07 00:07:50 +0000
@@ -87,27 +87,6 @@
87void mir_connection_release(MirConnection *connection);87void mir_connection_release(MirConnection *connection);
8888
89/**89/**
90 * Query platform-specific data and/or file descriptors that are required to
91 * initialize GL/EGL features.
92 * \param [in] connection The connection
93 * \param [out] platform_package Structure to be populated
94 */
95void mir_connection_get_platform(MirConnection *connection, MirPlatformPackage *platform_package)
96__attribute__((deprecated("use platform extensions instead")));
97
98/**
99 * Query graphics platform module.
100 *
101 * \note The char pointers in MirModuleProperties are owned by the connection and should not be
102 * freed. They remain valid until the connection is released.
103 *
104 * \param [in] connection The connection
105 * \param [out] properties Structure to be populated
106 */
107void mir_connection_get_graphics_module(MirConnection *connection, MirModuleProperties *properties)
108__attribute__((deprecated("use graphics module extension instead")));
109
110/**
111 * Register a callback to be called when a Lifecycle state change occurs.90 * Register a callback to be called when a Lifecycle state change occurs.
112 * \param [in] connection The connection91 * \param [in] connection The connection
113 * \param [in] callback The function to be called when the state change occurs92 * \param [in] callback The function to be called when the state change occurs
@@ -364,24 +343,6 @@
364 unsigned const int formats_size, unsigned int *num_valid_formats);343 unsigned const int formats_size, unsigned int *num_valid_formats);
365344
366/**345/**
367 * Perform a platform specific operation.
368 *
369 * The MirPlatformMessage used for the request needs to remain valid
370 * until this operation finishes.
371 *
372 * \param [in] connection The connection
373 * \param [in] request The message used for this operation
374 * \param [in] callback The callback to call when the operation finishes
375 * \param [in,out] context User data passed to the callback function
376 * \return A handle that can be passed to mir_wait_for
377 */
378MirWaitHandle* mir_connection_platform_operation(
379 MirConnection* connection,
380 MirPlatformMessage const* request,
381 MirPlatformOperationCallback callback, void* context)
382__attribute__ ((deprecated("use platform specific extensions instead")));
383
384/**
385 * Create a snapshot of the attached input devices and device configurations.346 * Create a snapshot of the attached input devices and device configurations.
386 * \warning return value must be destroyed via mir_input_config_release()347 * \warning return value must be destroyed via mir_input_config_release()
387 * \warning may return null if connection is invalid348 * \warning may return null if connection is invalid
388349
=== modified file 'include/client/mir_toolkit/mir_display_configuration.h'
--- include/client/mir_toolkit/mir_display_configuration.h 2017-01-27 04:57:53 +0000
+++ include/client/mir_toolkit/mir_display_configuration.h 2017-02-07 00:07:50 +0000
@@ -263,15 +263,6 @@
263/**263/**
264 * Get the textual name of an output type.264 * Get the textual name of an output type.
265 *265 *
266 * \param [in] type The MirDisplayOutputType to describe.
267 * \returns The name of the output type.
268 */
269char const* mir_display_output_type_name(MirDisplayOutputType type)
270__attribute__((deprecated("use mir_output_type_name instead")));
271
272/**
273 * Get the textual name of an output type.
274 *
275 * \param [in] type The MirOutputType to describe.266 * \param [in] type The MirOutputType to describe.
276 * \returns The name of the output type.267 * \returns The name of the output type.
277 */268 */
278269
=== removed file 'include/client/mir_toolkit/mir_persistent_id.h'
--- include/client/mir_toolkit/mir_persistent_id.h 2017-02-01 19:54:40 +0000
+++ include/client/mir_toolkit/mir_persistent_id.h 1970-01-01 00:00:00 +0000
@@ -1,79 +0,0 @@
1/*
2 * Copyright © 2017 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 */
17
18#ifndef MIR_TOOLKIT_MIR_PERSISTENT_ID_H_
19#define MIR_TOOLKIT_MIR_PERSISTENT_ID_H_
20
21#include <mir_toolkit/client_types.h>
22
23#include <stdbool.h>
24
25#ifdef __cplusplus
26/**
27 * \addtogroup mir_toolkit
28 * @{
29 */
30extern "C" {
31#endif
32#pragma GCC diagnostic push
33#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
34/**
35 * \brief Check the validity of a MirPersistentId
36 * \param [in] id The MirPersistentId
37 * \return True iff the MirPersistentId contains a valid ID value.
38 *
39 * \note This does not guarantee that the ID refers to a currently valid object.
40 */
41bool mir_persistent_id_is_valid(MirPersistentId* id)
42__attribute__((deprecated("Use mir_window_id_is_valid() instead")));
43
44/**
45 * \brief Free a MirPersistentId
46 * \param [in] id The MirPersistentId to free
47 * \note This frees only the client-side representation; it has no effect on the
48 * object referred to by \arg id.
49 */
50void mir_persistent_id_release(MirPersistentId* id)
51__attribute__((deprecated("Use mir_window_id_release() instead")));
52
53/**
54 * \brief Get a string representation of a MirSurfaceId
55 * \param [in] id The ID to serialise
56 * \return A string representation of id. This string is owned by the MirSurfaceId,
57 * and must not be freed by the caller.
58 *
59 * \see mir_surface_id_from_string
60 */
61char const* mir_persistent_id_as_string(MirPersistentId* id)
62__attribute__((deprecated("Use mir_window_id_as_string() instead")));
63
64/**
65 * \brief Deserialise a string representation of a MirSurfaceId
66 * \param [in] string_representation Serialised representation of the ID
67 * \return The deserialised MirSurfaceId
68 */
69MirPersistentId* mir_persistent_id_from_string(char const* string_representation)
70__attribute__((deprecated("Use mir_window_id_from_string() instead")));
71
72#pragma GCC diagnostic pop
73
74#ifdef __cplusplus
75}
76/**@}*/
77#endif
78
79#endif /* MIR_TOOLKIT_MIR_PERSISTENT_ID_H_ */
800
=== modified file 'include/client/mir_toolkit/mir_surface.h'
--- include/client/mir_toolkit/mir_surface.h 2017-01-24 11:06:35 +0000
+++ include/client/mir_toolkit/mir_surface.h 2017-02-07 00:07:50 +0000
@@ -33,212 +33,6 @@
33extern "C" {33extern "C" {
34#endif34#endif
3535
36// Functions in this pragma section are to be deprecated
37#pragma GCC diagnostic push
38#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
39
40MirSurfaceSpec* mir_connection_create_spec_for_normal_surface(MirConnection* connection,
41 int width, int height,
42 MirPixelFormat format)
43__attribute__((deprecated("Use mir_create_normal_window_spec() instead")));
44
45MirSurfaceSpec*
46mir_connection_create_spec_for_menu(MirConnection* connection,
47 int width,
48 int height,
49 MirPixelFormat format,
50 MirSurface* parent,
51 MirRectangle* rect,
52 MirEdgeAttachment edge)
53__attribute__((deprecated("Use mir_specify_menu() instead")));
54
55MirSurfaceSpec*
56mir_connection_create_spec_for_tooltip(MirConnection* connection,
57 int width, int height,
58 MirPixelFormat format,
59 MirSurface* parent,
60 MirRectangle* zone)
61__attribute__((deprecated("Use mir_create_tip_window_spec() instead")));
62
63MirSurfaceSpec*
64mir_connection_create_spec_for_tip(MirConnection* connection,
65 int width, int height,
66 MirPixelFormat format,
67 MirSurface* parent,
68 MirRectangle* rect,
69 MirEdgeAttachment edge)
70__attribute__((deprecated("Use mir_create_tip_window_spec() instead")));
71
72MirSurfaceSpec*
73mir_connection_create_spec_for_modal_dialog(MirConnection* connection,
74 int width, int height,
75 MirPixelFormat format,
76 MirSurface* parent)
77__attribute__((deprecated("Use mir_create_modal_dialog_window_spec() instead")));
78
79MirSurfaceSpec*
80mir_connection_create_spec_for_dialog(MirConnection* connection,
81 int width, int height,
82 MirPixelFormat format)
83__attribute__((deprecated("Use mir_create_dialog_window_spec() instead")));
84
85MirSurfaceSpec* mir_create_surface_spec(MirConnection* connection)
86__attribute__((deprecated("Use mir_create_window_spec() instead")));
87
88MirSurfaceSpec*
89mir_connection_create_spec_for_changes(MirConnection* connection)
90__attribute__((deprecated("Use mir_create_window_spec() instead")));
91
92void mir_surface_spec_set_parent(MirSurfaceSpec* spec, MirSurface* parent)
93__attribute__((deprecated("Use mir_window_spec_set_parent() instead")));
94
95/**
96 *\deprecated This will soon be a property of the backing content.
97 *
98 * Query the swapinterval that the surface is operating with.
99 * The default interval is 1.
100 * \param [in] surface The surface to operate on
101 * \return The swapinterval value that the client is operating with.
102 * Returns -1 if surface is invalid, or if the default stream
103 * was removed by use of mir_window_spec_set_streams().
104 */
105int mir_surface_get_swapinterval(MirSurface* surface)
106__attribute__((deprecated("This will soon be a property of the backing content")));
107
108void mir_surface_spec_set_type(MirSurfaceSpec* spec, MirSurfaceType type)
109__attribute__((deprecated("use mir_window_spec_set_type() instead")));
110
111void mir_surface_spec_set_name(MirSurfaceSpec* spec, char const* name)
112__attribute__((deprecated("use mir_window_spec_set_name() instead")));
113
114void mir_surface_spec_set_width(MirSurfaceSpec* spec, unsigned width)
115__attribute__((deprecated("use mir_window_spec_set_width() instead")));
116
117void mir_surface_spec_set_height(MirSurfaceSpec* spec, unsigned height)
118__attribute__((deprecated("use mir_window_spec_set_height() instead")));
119
120void mir_surface_spec_set_width_increment(MirSurfaceSpec* spec, unsigned width_inc)
121__attribute__((deprecated("use mir_window_spec_set_width_increment() instead")));
122
123void mir_surface_spec_set_height_increment(MirSurfaceSpec* spec, unsigned height_inc)
124__attribute__((deprecated("use mir_window_spec_set_height_increment() instead")));
125
126void mir_surface_spec_set_min_width(MirSurfaceSpec* spec, unsigned min_width)
127__attribute__((deprecated("use mir_window_spec_set_min_width() instead")));
128
129void mir_surface_spec_set_min_height(MirSurfaceSpec* spec, unsigned min_height)
130__attribute__((deprecated("use mir_window_spec_set_min_height() instead")));
131
132void mir_surface_spec_set_max_width(MirSurfaceSpec* spec, unsigned max_width)
133__attribute__((deprecated("use mir_window_spec_set_max_width() instead")));
134
135void mir_surface_spec_set_max_height(MirSurfaceSpec* spec, unsigned max_height)
136__attribute__((deprecated("use mir_window_spec_set_max_height() instead")));
137
138void mir_surface_spec_set_min_aspect_ratio(MirSurfaceSpec* spec, unsigned width, unsigned height)
139__attribute__((deprecated("use mir_window_spec_set_min_aspect_ratio() instead")));
140
141void mir_surface_spec_set_max_aspect_ratio(MirSurfaceSpec* spec, unsigned width, unsigned height)
142__attribute__((deprecated("use mir_window_spec_set_max_aspect_ratio() instead")));
143
144void mir_surface_spec_set_fullscreen_on_output(MirSurfaceSpec* spec, uint32_t output_id)
145__attribute__((deprecated("use mir_window_spec_set_fullscreen_on_output() instead")));
146
147void mir_surface_spec_set_preferred_orientation(MirSurfaceSpec* spec, MirOrientationMode mode)
148__attribute__((deprecated("use mir_window_spec_set_preferred_orientation() instead")));
149
150bool mir_surface_spec_attach_to_foreign_parent(MirSurfaceSpec* spec,
151 MirPersistentId* parent,
152 MirRectangle* attachment_rect,
153 MirEdgeAttachment edge)
154__attribute__((deprecated("use mir_window_spec_attach_to_foreign_parent() instead")));
155
156void mir_surface_spec_set_state(MirSurfaceSpec* spec, MirSurfaceState state)
157__attribute__((deprecated("use mir_window_spec_set_state() instead")));
158
159void mir_surface_spec_release(MirSurfaceSpec* spec)
160__attribute__((deprecated("use mir_window_spec_release() instead")));
161
162void mir_surface_spec_set_input_shape(MirSurfaceSpec* spec,
163 MirRectangle const *rectangles,
164 size_t n_rects)
165__attribute__((deprecated("use mir_window_spec_set_input_shape() instead")));
166
167void mir_surface_spec_set_event_handler(MirSurfaceSpec* spec,
168 mir_surface_event_callback callback,
169 void* context)
170__attribute__((deprecated("use mir_window_spec_set_event_handler() instead")));
171
172void mir_surface_spec_set_shell_chrome(MirSurfaceSpec* spec, MirShellChrome style)
173__attribute__((deprecated("use mir_window_spec_set_shell_chrome() instead")));
174
175void mir_surface_spec_set_pointer_confinement(MirSurfaceSpec* spec, MirPointerConfinementState state)
176__attribute__((deprecated("use mir_window_spec_set_pointer_confinement() instead")));
177
178void mir_surface_spec_set_placement(MirSurfaceSpec* spec,
179 const MirRectangle* rect,
180 MirPlacementGravity rect_gravity,
181 MirPlacementGravity window_gravity,
182 MirPlacementHints placement_hints,
183 int offset_dx,
184 int offset_dy)
185__attribute__((deprecated("use mir_window_spec_set_placement() instead")));
186
187MirSurfaceSpec* mir_connection_create_spec_for_input_method(MirConnection* connection,
188 int width, int height,
189 MirPixelFormat format)
190__attribute__((deprecated("use mir_create_input_method_window_spec() instead")));
191
192void mir_surface_spec_set_pixel_format(MirSurfaceSpec* spec, MirPixelFormat format)
193__attribute__((deprecated("use mir_window_spec_set_pixel_format() instead")));
194
195void mir_surface_spec_set_buffer_usage(MirSurfaceSpec* spec, MirBufferUsage usage)
196__attribute__((deprecated("use mir_window_spec_set_buffer_usage() instead")));
197
198void mir_surface_spec_set_streams(MirSurfaceSpec* spec,
199 MirBufferStreamInfo* streams,
200 unsigned int num_streams)
201__attribute__((deprecated("use mir_window_spec_set_streams() instead")));
202
203void mir_surface_apply_spec(MirSurface* surface, MirSurfaceSpec* spec)
204__attribute__((deprecated("use mir_window_apply_spec() instead")));
205
206bool mir_surface_is_valid(MirSurface *surface)
207__attribute__((deprecated("use mir_window_is_valid() instead")));
208
209MirWaitHandle* mir_surface_create(MirSurfaceSpec* requested_specification,
210 mir_surface_callback callback, void* context)
211__attribute__((deprecated("use mir_create_window() instead")));
212
213MirSurface* mir_surface_create_sync(MirSurfaceSpec* requested_specification)
214__attribute__((deprecated("use mir_create_window_sync() instead")));
215
216MirWaitHandle *mir_surface_release(
217 MirSurface *surface,
218 mir_surface_callback callback,
219 void *context)
220__attribute__((deprecated("use mir_window_release() instead")));
221
222void mir_surface_release_sync(MirSurface *surface)
223__attribute__((deprecated("use mir_window_release_sync() instead")));
224
225void mir_surface_set_event_handler(MirSurface *surface,
226 mir_surface_event_callback callback,
227 void* context)
228__attribute__((deprecated("use mir_window_set_event_handler() instead")));
229
230MirBufferStream* mir_surface_get_buffer_stream(MirSurface *surface)
231__attribute__((deprecated("use mir_window_get_buffer_stream() instead")));
232
233char const* mir_surface_get_error_message(MirSurface *surface)
234__attribute__((deprecated("use mir_window_get_error_message() instead")));
235
236void mir_surface_get_parameters(MirSurface *surface, MirSurfaceParameters *parameters)
237__attribute__((deprecated("use mir_window_get_parameters() instead")));
238
239MirSurfaceType mir_surface_get_type(MirSurface* surface)
240__attribute__((deprecated("use mir_window_get_type() instead")));
241
242MirWaitHandle* mir_surface_set_state(MirSurface *surface,36MirWaitHandle* mir_surface_set_state(MirSurface *surface,
243 MirSurfaceState state)37 MirSurfaceState state)
244__attribute__((deprecated("use mir_window_set_state() instead")));38__attribute__((deprecated("use mir_window_set_state() instead")));
@@ -246,54 +40,9 @@
246MirSurfaceState mir_surface_get_state(MirSurface *surface)40MirSurfaceState mir_surface_get_state(MirSurface *surface)
247__attribute__((deprecated("use mir_window_get_state() instead")));41__attribute__((deprecated("use mir_window_get_state() instead")));
24842
249/**
250 * Set the swapinterval for the default stream.
251 * \warning EGL users should use eglSwapInterval directly.
252 * \warning If the surface was created with, or modified to have a
253 * MirSurfaceSpec containing streams added through
254 * mir_window_spec_set_streams(), the default stream will
255 * be removed, and this function will return NULL.
256 * \param [in] surface The surface to operate on
257 * \param [in] interval The number of vblank signals that
258 * mir_surface_swap_buffers will wait for
259 * \return A wait handle that can be passed to mir_wait_for,
260 * or NULL if the interval could not be supported
261 */
262MirWaitHandle* mir_surface_set_swapinterval(MirSurface* surface, int interval)
263__attribute__((deprecated("Swap interval should be set on the backing content")));
264
265int mir_surface_get_dpi(MirSurface* surface)
266__attribute__((deprecated("use mir_window_get_dpi() instead")));
267
268MirSurfaceFocusState mir_surface_get_focus(MirSurface *surface)
269__attribute__((deprecated("use mir_window_get_focus_state() instead")));
270
271MirSurfaceVisibility mir_surface_get_visibility(MirSurface *surface)
272__attribute__((deprecated("use mir_window_get_visibility() instead")));
273
274MirWaitHandle* mir_surface_configure_cursor(MirSurface *surface, MirCursorConfiguration const* parameters)
275__attribute__((deprecated("use mir_window_configure_cursor() instead")));
276
277MirOrientation mir_surface_get_orientation(MirSurface *surface)
278__attribute__((deprecated("use mir_window_get_orientation() instead")));
279
280MirWaitHandle* mir_surface_set_preferred_orientation(MirSurface *surface, MirOrientationMode orientation)43MirWaitHandle* mir_surface_set_preferred_orientation(MirSurface *surface, MirOrientationMode orientation)
281__attribute__((deprecated("use mir_window_set_preferred_orientation() instead")));44__attribute__((deprecated("use mir_window_set_preferred_orientation() instead")));
28245
283MirOrientationMode mir_surface_get_preferred_orientation(MirSurface *surface)
284__attribute__((deprecated("use mir_window_get_preferred_orientation() instead")));
285
286MirWaitHandle* mir_surface_request_persistent_id(MirSurface* surface, mir_surface_id_callback callback, void* context)
287__attribute__((deprecated("use mir_window_request_persistent_id() instead")));
288
289MirPersistentId* mir_surface_request_persistent_id_sync(MirSurface *surface)
290__attribute__((deprecated("use mir_window_request_persistent_id_sync() instead")));
291
292void mir_surface_raise(MirSurface* surface, MirCookie const* cookie)
293__attribute__((deprecated("use mir_window_raise() instead")));
294
295#pragma GCC diagnostic pop
296
297#ifdef __cplusplus46#ifdef __cplusplus
298}47}
299/**@}*/48/**@}*/
30049
=== modified file 'include/client/mir_toolkit/mir_window.h'
--- include/client/mir_toolkit/mir_window.h 2017-02-03 21:11:55 +0000
+++ include/client/mir_toolkit/mir_window.h 2017-02-07 00:07:50 +0000
@@ -781,7 +781,7 @@
781 * \brief Request a persistent ID for a window and wait for the result781 * \brief Request a persistent ID for a window and wait for the result
782 * \param [in] window The window to acquire a persistent ID for.782 * \param [in] window The window to acquire a persistent ID for.
783 * \return A MirWindowId. This MirWindowId is owned by the calling code, and must783 * \return A MirWindowId. This MirWindowId is owned by the calling code, and must
784 * be freed with a call to mir_persistent_id_release()784 * be freed with a call to mir_window_id_release()
785 */785 */
786MirPersistentId* mir_window_request_persistent_id_sync(MirWindow* window)786MirPersistentId* mir_window_request_persistent_id_sync(MirWindow* window)
787__attribute__((deprecated("Use mir_window_request_window_id_sync")));787__attribute__((deprecated("Use mir_window_request_window_id_sync")));
788788
=== modified file 'src/client/display_configuration_api.cpp'
--- src/client/display_configuration_api.cpp 2017-01-27 04:57:53 +0000
+++ src/client/display_configuration_api.cpp 2017-02-07 00:07:50 +0000
@@ -126,11 +126,6 @@
126 return static_cast<MirOutputType>(output->type());126 return static_cast<MirOutputType>(output->type());
127}127}
128128
129char const* mir_display_output_type_name(MirDisplayOutputType type)
130{
131 return mir::output_type_name(type);
132}
133
134char const* mir_output_type_name(MirOutputType type)129char const* mir_output_type_name(MirOutputType type)
135{130{
136 return mir::output_type_name(type);131 return mir::output_type_name(type);
137132
=== modified file 'src/client/event.cpp'
--- src/client/event.cpp 2017-01-23 03:38:33 +0000
+++ src/client/event.cpp 2017-02-07 00:07:50 +0000
@@ -27,7 +27,6 @@
27#include "mir/events/event_private.h"27#include "mir/events/event_private.h"
28#include "mir/events/surface_placement_event.h"28#include "mir/events/surface_placement_event.h"
2929
30#include "mir_toolkit/events/surface_event.h"
31#include "mir_toolkit/events/resize_event.h"30#include "mir_toolkit/events/resize_event.h"
32#include "mir_toolkit/events/prompt_session_event.h"31#include "mir_toolkit/events/prompt_session_event.h"
33#include "mir_toolkit/events/orientation_event.h"32#include "mir_toolkit/events/orientation_event.h"
@@ -112,11 +111,6 @@
112 return ev->to_input();111 return ev->to_input();
113})112})
114113
115MirWindowEvent const* mir_event_get_surface_event(MirEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
116{
117 return mir_event_get_window_event(ev);
118})
119
120MirWindowEvent const* mir_event_get_window_event(MirEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(114MirWindowEvent const* mir_event_get_window_event(MirEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
121{115{
122 expect_event_type(ev, mir_event_type_window);116 expect_event_type(ev, mir_event_type_window);
@@ -159,23 +153,6 @@
159 return ev->to_keymap();153 return ev->to_keymap();
160})154})
161155
162#pragma GCC diagnostic push
163#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
164MirInputConfigurationEvent const* mir_event_get_input_configuration_event(MirEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
165{
166 expect_event_type(ev, mir_event_type_input_configuration);
167
168 return ev->to_input_configuration();
169})
170#pragma GCC diagnostic pop
171
172MirWindowOutputEvent const* mir_event_get_surface_output_event(MirEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
173{
174 expect_event_type(ev, mir_event_type_window_output);
175
176 return mir_event_get_window_output_event(ev);
177})
178
179MirWindowOutputEvent const* mir_event_get_window_output_event(MirEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(156MirWindowOutputEvent const* mir_event_get_window_output_event(MirEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
180{157{
181 expect_event_type(ev, mir_event_type_window_output);158 expect_event_type(ev, mir_event_type_window_output);
@@ -190,21 +167,6 @@
190 return ev->to_input_device_state();167 return ev->to_input_device_state();
191})168})
192169
193/* Surface event accessors */
194
195#pragma GCC diagnostic push
196#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
197MirSurfaceAttrib mir_surface_event_get_attribute(MirSurfaceEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
198{
199 return static_cast<MirSurfaceAttrib>(mir_window_event_get_attribute(ev));
200})
201#pragma GCC diagnostic pop
202
203int mir_surface_event_get_attribute_value(MirWindowEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
204{
205 return mir_window_event_get_attribute_value(ev);
206})
207
208/* Window event accessors */170/* Window event accessors */
209171
210MirWindowAttrib mir_window_event_get_attribute(MirWindowEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(172MirWindowAttrib mir_window_event_get_attribute(MirWindowEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
@@ -268,60 +230,6 @@
268 return ev->device_id();230 return ev->device_id();
269})231})
270232
271#pragma GCC diagnostic push
272#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
273/* Input configuration event accessors */
274MirInputConfigurationAction mir_input_configuration_event_get_action(MirInputConfigurationEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
275{
276 expect_event_type(ev, mir_event_type_input_configuration);
277 return ev->action();
278})
279
280int64_t mir_input_configuration_event_get_time(MirInputConfigurationEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
281{
282 expect_event_type(ev, mir_event_type_input_configuration);
283 return ev->when().count();
284})
285
286MirInputDeviceId mir_input_configuration_event_get_device_id(MirInputConfigurationEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
287{
288 expect_event_type(ev, mir_event_type_input_configuration);
289 return ev->id();
290})
291#pragma GCC diagnostic pop
292
293/* Surface output event accessors */
294
295int mir_surface_output_event_get_dpi(MirWindowOutputEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
296{
297 expect_event_type(ev, mir_event_type_window_output);
298 return mir_window_output_event_get_dpi(ev);
299})
300
301MirFormFactor mir_surface_output_event_get_form_factor(MirWindowOutputEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
302{
303 expect_event_type(ev, mir_event_type_window_output);
304 return mir_window_output_event_get_form_factor(ev);
305})
306
307float mir_surface_output_event_get_scale(MirWindowOutputEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
308{
309 expect_event_type(ev, mir_event_type_window_output);
310 return mir_window_output_event_get_scale(ev);
311})
312
313double mir_surface_output_event_get_refresh_rate(MirWindowOutputEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
314{
315 expect_event_type(ev, mir_event_type_window_output);
316 return mir_window_output_event_get_refresh_rate(ev);
317})
318
319uint32_t mir_surface_output_event_get_output_id(MirWindowOutputEvent const *ev) MIR_HANDLE_EVENT_EXCEPTION(
320{
321 expect_event_type(ev, mir_event_type_window_output);
322 return mir_window_output_event_get_output_id(ev);
323})
324
325/* Window output event accessors */233/* Window output event accessors */
326234
327int mir_window_output_event_get_dpi(MirWindowOutputEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(235int mir_window_output_event_get_dpi(MirWindowOutputEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
@@ -414,16 +322,6 @@
414 return ev->device_pointer_buttons(index);322 return ev->device_pointer_buttons(index);
415})323})
416324
417MirWindowPlacementEvent const* mir_event_get_surface_placement_event(MirEvent const* event) MIR_HANDLE_EVENT_EXCEPTION(
418{
419 return mir_event_get_window_placement_event(event);
420})
421
422MirRectangle mir_surface_placement_get_relative_position(MirWindowPlacementEvent const* event) MIR_HANDLE_EVENT_EXCEPTION(
423{
424 return mir_window_placement_get_relative_position(event);
425})
426
427MirWindowPlacementEvent const* mir_event_get_window_placement_event(MirEvent const* event) MIR_HANDLE_EVENT_EXCEPTION(325MirWindowPlacementEvent const* mir_event_get_window_placement_event(MirEvent const* event) MIR_HANDLE_EVENT_EXCEPTION(
428{326{
429 return event->to_window_placement();327 return event->to_window_placement();
430328
=== modified file 'src/client/event_printer.cpp'
--- src/client/event_printer.cpp 2017-01-19 05:30:03 +0000
+++ src/client/event_printer.cpp 2017-02-07 00:07:50 +0000
@@ -130,82 +130,6 @@
130 }130 }
131}131}
132132
133#pragma GCC diagnostic push
134#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
135std::ostream& mir::operator<<(std::ostream& out, MirSurfaceAttrib attribute)
136{
137 switch (attribute)
138 {
139 PRINT(mir_surface_attrib,type);
140 PRINT(mir_surface_attrib,dpi);
141 PRINT(mir_surface_attrib,focus);
142 PRINT(mir_surface_attrib,state);
143 PRINT(mir_surface_attrib,visibility);
144 PRINT(mir_surface_attrib,swapinterval);
145 PRINT(mir_surface_attrib,preferred_orientation);
146 default:
147 return out << static_cast<int>(attribute) << "<INVALID>";
148 }
149}
150
151std::ostream& mir::operator<<(std::ostream& out, MirSurfaceFocusState state)
152{
153 switch (state)
154 {
155 PRINT(mir_surface,focused);
156 PRINT(mir_surface,unfocused);
157 default:
158 return out << static_cast<int>(state) << "<INVALID>";
159 }
160}
161
162std::ostream& mir::operator<<(std::ostream& out, MirSurfaceVisibility state)
163{
164 switch (state)
165 {
166 PRINT(mir_surface_visibility,exposed);
167 PRINT(mir_surface_visibility,occluded);
168 default:
169 return out << static_cast<int>(state) << "<INVALID>";
170 }
171}
172
173std::ostream& mir::operator<<(std::ostream& out, MirSurfaceType type)
174{
175 switch (type)
176 {
177 PRINT(mir_surface_type,normal);
178 PRINT(mir_surface_type,utility);
179 PRINT(mir_surface_type,dialog);
180 PRINT(mir_surface_type,gloss);
181 PRINT(mir_surface_type,freestyle);
182 PRINT(mir_surface_type,menu);
183 PRINT(mir_surface_type,inputmethod);
184 PRINT(mir_surface_type,satellite);
185 PRINT(mir_surface_type,tip);
186 default:
187 return out << static_cast<int>(type) << "<INVALID>";
188 }
189}
190
191std::ostream& mir::operator<<(std::ostream& out, MirSurfaceState state)
192{
193 switch (state)
194 {
195 PRINT(mir_surface_state,unknown);
196 PRINT(mir_surface_state,restored);
197 PRINT(mir_surface_state,minimized);
198 PRINT(mir_surface_state,maximized);
199 PRINT(mir_surface_state,vertmaximized);
200 PRINT(mir_surface_state,fullscreen);
201 PRINT(mir_surface_state,horizmaximized);
202 PRINT(mir_surface_state,hidden);
203 default:
204 return out << static_cast<int>(state) << "<INVALID>";
205 }
206}
207#pragma GCC diagnostic pop
208
209std::ostream& mir::operator<<(std::ostream& out, MirWindowAttrib attribute)133std::ostream& mir::operator<<(std::ostream& out, MirWindowAttrib attribute)
210{134{
211 switch (attribute)135 switch (attribute)
@@ -447,14 +371,12 @@
447 auto type = mir_event_get_type(&event);371 auto type = mir_event_get_type(&event);
448 switch (type)372 switch (type)
449 {373 {
450 PRINT_EVENT(surface);
451 PRINT_EVENT(resize);374 PRINT_EVENT(resize);
452 PRINT_EVENT(orientation);375 PRINT_EVENT(orientation);
453 PRINT_EVENT(close_surface);376 PRINT_EVENT(close_surface);
454 PRINT_EVENT(input);377 PRINT_EVENT(input);
455 PRINT_EVENT(input_device_state);378 PRINT_EVENT(input_device_state);
456 PRINT_EVENT(keymap);379 PRINT_EVENT(keymap);
457 PRINT_EVENT(surface_placement);
458 case mir_event_type_prompt_session_state_change:380 case mir_event_type_prompt_session_state_change:
459 return out << *mir_event_get_prompt_session_event(&event);381 return out << *mir_event_get_prompt_session_event(&event);
460 default:382 default:
461383
=== modified file 'src/client/events/event_builders.cpp'
--- src/client/events/event_builders.cpp 2017-01-27 04:57:53 +0000
+++ src/client/events/event_builders.cpp 2017-02-07 00:07:50 +0000
@@ -85,20 +85,6 @@
85 return make_uptr_event(e);85 return make_uptr_event(e);
86}86}
8787
88#pragma GCC diagnostic push
89#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
90mir::EventUPtr mev::make_event(mf::SurfaceId const& surface_id, MirSurfaceAttrib attribute, int value)
91{
92 auto e = new_event<MirSurfaceEvent>();
93
94 e->set_id(surface_id.as_value());
95 e->set_attrib(static_cast<MirWindowAttrib>(attribute));
96 e->set_value(value);
97
98 return make_uptr_event(e);
99}
100#pragma GCC diagnostic pop
101
102mir::EventUPtr mev::make_event(mf::SurfaceId const& surface_id, MirWindowAttrib attribute, int value)88mir::EventUPtr mev::make_event(mf::SurfaceId const& surface_id, MirWindowAttrib attribute, int value)
103{89{
104 auto e = new_event<MirWindowEvent>();90 auto e = new_event<MirWindowEvent>();
@@ -202,22 +188,6 @@
202 event.to_input()->to_pointer()->set_buttons(button_state);188 event.to_input()->to_pointer()->set_buttons(button_state);
203}189}
204190
205// Deprecated version with uint64_t mac
206mir::EventUPtr mev::make_event(MirInputDeviceId device_id, std::chrono::nanoseconds timestamp,
207 uint64_t /*mac*/, MirKeyboardAction action, xkb_keysym_t key_code,
208 int scan_code, MirInputEventModifiers modifiers)
209{
210 return make_event(device_id, timestamp, std::vector<uint8_t>{}, action, key_code, scan_code, modifiers);
211}
212
213// Deprecated version without mac
214mir::EventUPtr mev::make_event(MirInputDeviceId device_id, std::chrono::nanoseconds timestamp,
215 MirKeyboardAction action, xkb_keysym_t key_code,
216 int scan_code, MirInputEventModifiers modifiers)
217{
218 return make_event(device_id, timestamp, std::vector<uint8_t>{}, action, key_code, scan_code, modifiers);
219}
220
221mir::EventUPtr mev::make_event(MirInputDeviceId device_id, std::chrono::nanoseconds timestamp,191mir::EventUPtr mev::make_event(MirInputDeviceId device_id, std::chrono::nanoseconds timestamp,
222 std::vector<uint8_t> const& cookie, MirInputEventModifiers modifiers)192 std::vector<uint8_t> const& cookie, MirInputEventModifiers modifiers)
223{193{
@@ -231,20 +201,6 @@
231 return make_uptr_event(e);201 return make_uptr_event(e);
232}202}
233203
234// Deprecated version with uint64_t mac
235mir::EventUPtr mev::make_event(MirInputDeviceId device_id, std::chrono::nanoseconds timestamp,
236 uint64_t /*mac*/, MirInputEventModifiers modifiers)
237{
238 return make_event(device_id, timestamp, std::vector<uint8_t>{}, modifiers);
239}
240
241// Deprecated version without mac
242mir::EventUPtr mev::make_event(MirInputDeviceId device_id, std::chrono::nanoseconds timestamp,
243 MirInputEventModifiers modifiers)
244{
245 return make_event(device_id, timestamp, std::vector<uint8_t>{}, modifiers);
246}
247
248void mev::add_touch(MirEvent &event, MirTouchId touch_id, MirTouchAction action,204void mev::add_touch(MirEvent &event, MirTouchId touch_id, MirTouchAction action,
249 MirTouchTooltype tooltype, float x_axis_value, float y_axis_value,205 MirTouchTooltype tooltype, float x_axis_value, float y_axis_value,
250 float pressure_value, float touch_major_value, float touch_minor_value, float)206 float pressure_value, float touch_major_value, float touch_minor_value, float)
@@ -275,54 +231,6 @@
275 return make_uptr_event(e);231 return make_uptr_event(e);
276}232}
277233
278// Deprecated version with uint64_t mac
279mir::EventUPtr mev::make_event(MirInputDeviceId device_id, std::chrono::nanoseconds timestamp,
280 uint64_t /*mac*/, MirInputEventModifiers modifiers, MirPointerAction action,
281 MirPointerButtons buttons_pressed,
282 float x_axis_value, float y_axis_value,
283 float hscroll_value, float vscroll_value,
284 float relative_x_value, float relative_y_value)
285{
286 return make_event(device_id, timestamp, std::vector<uint8_t>{}, modifiers, action,
287 buttons_pressed, x_axis_value, y_axis_value, hscroll_value,
288 vscroll_value, relative_x_value, relative_y_value);
289}
290
291// Deprecated version without mac
292mir::EventUPtr mev::make_event(MirInputDeviceId device_id, std::chrono::nanoseconds timestamp,
293 MirInputEventModifiers modifiers, MirPointerAction action,
294 MirPointerButtons buttons_pressed,
295 float x_axis_value, float y_axis_value,
296 float hscroll_value, float vscroll_value,
297 float relative_x_value, float relative_y_value)
298{
299 return make_event(device_id, timestamp, std::vector<uint8_t>{}, modifiers, action,
300 buttons_pressed, x_axis_value, y_axis_value, hscroll_value,
301 vscroll_value, relative_x_value, relative_y_value);
302}
303
304// Deprecated version without relative axis
305mir::EventUPtr mev::make_event(MirInputDeviceId device_id, std::chrono::nanoseconds timestamp,
306 uint64_t /*mac*/, MirInputEventModifiers modifiers, MirPointerAction action,
307 MirPointerButtons buttons_pressed,
308 float x_axis_value, float y_axis_value,
309 float hscroll_value, float vscroll_value)
310{
311 return make_event(device_id, timestamp, std::vector<uint8_t>{}, modifiers, action, buttons_pressed,
312 x_axis_value, y_axis_value, hscroll_value, vscroll_value, 0, 0);
313}
314
315// Deprecated version without relative axis, and mac
316mir::EventUPtr mev::make_event(MirInputDeviceId device_id, std::chrono::nanoseconds timestamp,
317 MirInputEventModifiers modifiers, MirPointerAction action,
318 MirPointerButtons buttons_pressed,
319 float x_axis_value, float y_axis_value,
320 float hscroll_value, float vscroll_value)
321{
322 return make_event(device_id, timestamp, std::vector<uint8_t>{}, modifiers, action, buttons_pressed,
323 x_axis_value, y_axis_value, hscroll_value, vscroll_value, 0, 0);
324}
325
326mir::EventUPtr mev::make_event(mf::SurfaceId const& surface_id, MirInputDeviceId id, std::string const& model,234mir::EventUPtr mev::make_event(mf::SurfaceId const& surface_id, MirInputDeviceId id, std::string const& model,
327 std::string const& layout, std::string const& variant, std::string const& options)235 std::string const& layout, std::string const& variant, std::string const& options)
328{236{
@@ -345,20 +253,6 @@
345 return ep;253 return ep;
346}254}
347255
348#pragma GCC diagnostic push
349#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
350mir::EventUPtr mev::make_event(MirInputConfigurationAction action, MirInputDeviceId id, std::chrono::nanoseconds time)
351{
352 auto e = new_event<MirInputConfigurationEvent>();
353
354 e->set_action(action);
355 e->set_when(time);
356 e->set_id(id);
357
358 return make_uptr_event(e);
359}
360#pragma GCC diagnostic pop
361
362mir::EventUPtr mev::make_event(std::chrono::nanoseconds timestamp,256mir::EventUPtr mev::make_event(std::chrono::nanoseconds timestamp,
363 MirPointerButtons pointer_buttons,257 MirPointerButtons pointer_buttons,
364 MirInputEventModifiers modifiers,258 MirInputEventModifiers modifiers,
365259
=== modified file 'src/client/mir_blob.cpp'
--- src/client/mir_blob.cpp 2017-01-18 02:29:37 +0000
+++ src/client/mir_blob.cpp 2017-02-07 00:07:50 +0000
@@ -61,73 +61,6 @@
61};61};
62}62}
6363
64
65MirBlob* mir_blob_from_display_configuration(MirDisplayConfiguration* configuration)
66try
67{
68 mp::DisplayConfiguration protobuf_config;
69
70 for (auto const* card = configuration->cards; card != configuration->cards+configuration->num_cards; ++card)
71 {
72 auto protobuf_card = protobuf_config.add_display_card();
73 protobuf_card->set_card_id(card->card_id);
74 protobuf_card->set_max_simultaneous_outputs(card->max_simultaneous_outputs);
75 }
76
77 for (auto const* output = configuration->outputs;
78 output != configuration->outputs+configuration->num_outputs;
79 ++output)
80 {
81 auto protobuf_output = protobuf_config.add_display_output();
82
83 protobuf_output->set_output_id(output->output_id);
84 protobuf_output->set_card_id(output->card_id);
85 protobuf_output->set_type(output->type);
86
87 for (auto const* format = output->output_formats;
88 format != output->output_formats+output->num_output_formats;
89 ++format)
90 {
91 protobuf_output->add_pixel_format(*format);
92 }
93
94 for (auto const* mode = output->modes;
95 mode != output->modes+output->num_modes;
96 ++mode)
97 {
98 auto protobuf_output_mode = protobuf_output->add_mode();
99 protobuf_output_mode->set_horizontal_resolution(mode->horizontal_resolution);
100 protobuf_output_mode->set_vertical_resolution(mode->vertical_resolution);
101 protobuf_output_mode->set_refresh_rate(mode->refresh_rate);
102 }
103
104 protobuf_output->set_preferred_mode(output->preferred_mode);
105
106 protobuf_output->set_physical_width_mm(output->physical_width_mm);
107 protobuf_output->set_physical_height_mm(output->physical_height_mm);
108
109 protobuf_output->set_connected(output->connected);
110 protobuf_output->set_used(output->used);
111 protobuf_output->set_position_x(output->position_x);
112 protobuf_output->set_position_y(output->position_y);
113 protobuf_output->set_current_mode(output->current_mode);
114 protobuf_output->set_current_format(output->current_format);
115 protobuf_output->set_power_mode(output->power_mode);
116 protobuf_output->set_orientation(output->orientation);
117 }
118
119 auto blob = std::make_unique<MirManagedBlob>(static_cast<size_t>(protobuf_config.ByteSize()));
120
121 protobuf_config.SerializeWithCachedSizesToArray(blob->data());
122
123 return blob.release();
124}
125catch (std::exception const& x)
126{
127 MIR_LOG_UNCAUGHT_EXCEPTION(x);
128 return nullptr;
129}
130
131MirBlob* mir_blob_from_display_config(MirDisplayConfig* configuration)64MirBlob* mir_blob_from_display_config(MirDisplayConfig* configuration)
132try65try
133{66{
@@ -154,82 +87,6 @@
154 return nullptr;87 return nullptr;
155}88}
15689
157MirDisplayConfiguration* mir_blob_to_display_configuration(MirBlob* blob)
158try
159{
160 mp::DisplayConfiguration protobuf_config;
161
162 protobuf_config.ParseFromArray(mir_blob_data(blob), mir_blob_size(blob));
163
164 auto new_config = new MirDisplayConfiguration;
165
166 new_config->num_cards = protobuf_config.display_card_size();
167 new_config->cards = new MirDisplayCard[new_config->num_cards];
168
169 for (auto i = 0u; i != new_config->num_cards; ++i)
170 {
171 auto const& protobuf_card = protobuf_config.display_card(i);
172 auto& card = new_config->cards[i];
173 card.card_id = protobuf_card.card_id();
174 card.max_simultaneous_outputs = protobuf_card.max_simultaneous_outputs();
175 }
176
177 new_config->num_outputs = protobuf_config.display_output_size();
178 new_config->outputs = new MirDisplayOutput[new_config->num_outputs];
179
180 for (auto i = 0u; i != new_config->num_outputs; ++i)
181 {
182 auto const& protobuf_output = protobuf_config.display_output(i);
183 auto& output = new_config->outputs[i];
184
185 output.output_id = protobuf_output.output_id();
186 output.card_id = protobuf_output.card_id();
187 output.type = static_cast<MirDisplayOutputType>(protobuf_output.type());
188
189 output.num_output_formats = protobuf_output.pixel_format_size();
190 output.output_formats = new MirPixelFormat[output.num_output_formats];
191
192 output.num_modes = protobuf_output.mode_size();
193 output.modes = new MirDisplayMode[output.num_modes];
194
195 for (auto i = 0u; i != output.num_output_formats; ++i)
196 {
197 output.output_formats[i] = static_cast<MirPixelFormat>(protobuf_output.pixel_format(i));
198 }
199
200 for (auto i = 0u; i != output.num_modes; ++i)
201 {
202 auto const& protobuf_mode = protobuf_output.mode(i);
203 auto& mode = output.modes[i];
204
205 mode.horizontal_resolution = protobuf_mode.horizontal_resolution();
206 mode.vertical_resolution = protobuf_mode.vertical_resolution();
207 mode.refresh_rate = protobuf_mode.refresh_rate();
208 }
209
210 output.preferred_mode = protobuf_output.preferred_mode();
211
212 output.physical_width_mm = protobuf_output.physical_width_mm();
213 output.physical_height_mm = protobuf_output.physical_height_mm();
214
215 output.connected = protobuf_output.connected();
216 output.used = protobuf_output.used();
217 output.position_x = protobuf_output.position_x();
218 output.position_y = protobuf_output.position_y();
219 output.current_mode = protobuf_output.current_mode();
220 output.current_format = static_cast<MirPixelFormat>(protobuf_output.current_format());
221 output.orientation = static_cast<MirOrientation>(protobuf_output.orientation());
222 output.power_mode = static_cast<MirPowerMode>(protobuf_output.power_mode());
223 }
224
225 return new_config;
226}
227catch (std::exception const& x)
228{
229 MIR_LOG_UNCAUGHT_EXCEPTION(x);
230 abort();
231}
232
233MirDisplayConfig* mir_blob_to_display_config(MirBlob* blob)90MirDisplayConfig* mir_blob_to_display_config(MirBlob* blob)
234try91try
235{92{
23693
=== modified file 'src/client/mir_connection_api.cpp'
--- src/client/mir_connection_api.cpp 2017-01-24 19:42:48 +0000
+++ src/client/mir_connection_api.cpp 2017-02-07 00:07:50 +0000
@@ -139,26 +139,6 @@
139 MIR_LOG_UNCAUGHT_EXCEPTION(ex);139 MIR_LOG_UNCAUGHT_EXCEPTION(ex);
140}140}
141141
142void mir_connection_get_platform(
143 MirConnection* connection,
144 MirPlatformPackage* platform_package)
145{
146 connection->populate(*platform_package);
147}
148
149void mir_connection_get_graphics_module(MirConnection *connection, MirModuleProperties *properties)
150try
151{
152 mir::require(mir_connection_is_valid(connection));
153 mir::require(properties != nullptr);
154
155 connection->populate_graphics_module(*properties);
156}
157catch (std::exception const& ex)
158{
159 MIR_LOG_UNCAUGHT_EXCEPTION(ex);
160}
161
162void mir_connection_set_lifecycle_event_callback(142void mir_connection_set_lifecycle_event_callback(
163 MirConnection* connection,143 MirConnection* connection,
164 MirLifecycleEventCallback callback,144 MirLifecycleEventCallback callback,
@@ -381,22 +361,6 @@
381 connection->available_surface_formats(formats, format_size, *num_valid_formats);361 connection->available_surface_formats(formats, format_size, *num_valid_formats);
382}362}
383363
384MirWaitHandle* mir_connection_platform_operation(
385 MirConnection* connection,
386 MirPlatformMessage const* request,
387 MirPlatformOperationCallback callback, void* context)
388{
389 try
390 {
391 return connection->platform_operation(request, callback, context);
392 }
393 catch (std::exception const& ex)
394 {
395 MIR_LOG_UNCAUGHT_EXCEPTION(ex);
396 return nullptr;
397 }
398}
399
400void mir_connection_set_error_callback(364void mir_connection_set_error_callback(
401 MirConnection* connection,365 MirConnection* connection,
402 MirErrorCallback callback,366 MirErrorCallback callback,
403367
=== modified file 'src/client/mir_debug_api.cpp'
--- src/client/mir_debug_api.cpp 2017-01-18 04:43:15 +0000
+++ src/client/mir_debug_api.cpp 2017-02-07 00:07:50 +0000
@@ -30,25 +30,3 @@
30{30{
31 return window->get_buffer_stream()->get_current_buffer_id();31 return window->get_buffer_stream()->get_current_buffer_id();
32}32}
33
34#pragma GCC diagnostic push
35#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
36
37bool mir_debug_surface_coords_to_screen(MirSurface* surface,
38 int x, int y,
39 int* screen_x, int* screen_y)
40{
41 return surface->translate_to_screen_coordinates(x, y, screen_x, screen_y);
42}
43
44uint32_t mir_debug_surface_current_buffer_id(MirSurface* surface)
45{
46 return mir_debug_window_current_buffer_id(surface);
47}
48
49int mir_debug_surface_id(MirSurface* surface)
50{
51 return mir_debug_window_id(surface);
52}
53
54#pragma GCC diagnostic pop
5533
=== modified file 'src/client/mir_surface.cpp'
--- src/client/mir_surface.cpp 2017-02-02 22:43:06 +0000
+++ src/client/mir_surface.cpp 2017-02-07 00:07:50 +0000
@@ -525,8 +525,8 @@
525 * mir_window_output_event_get_refresh_rate that tells us the full525 * mir_window_output_event_get_refresh_rate that tells us the full
526 * native speed of the most relevant output...526 * native speed of the most relevant output...
527 */527 */
528 auto soevent = mir_event_get_surface_output_event(&e);528 auto soevent = mir_event_get_window_output_event(&e);
529 auto rate = mir_surface_output_event_get_refresh_rate(soevent);529 auto rate = mir_window_output_event_get_refresh_rate(soevent);
530 if (rate > 10.0) // should be >0, but 10 to workaround LP: #1639725530 if (rate > 10.0) // should be >0, but 10 to workaround LP: #1639725
531 {531 {
532 std::chrono::nanoseconds const ns(532 std::chrono::nanoseconds const ns(
533533
=== modified file 'src/client/mir_surface_api.cpp'
--- src/client/mir_surface_api.cpp 2017-02-03 21:11:55 +0000
+++ src/client/mir_surface_api.cpp 2017-02-07 00:07:50 +0000
@@ -832,6 +832,7 @@
832832
833#pragma GCC diagnostic push833#pragma GCC diagnostic push
834#pragma GCC diagnostic ignored "-Wdeprecated-declarations"834#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
835
835void mir_window_spec_add_render_surface(836void mir_window_spec_add_render_surface(
836 MirWindowSpec* spec,837 MirWindowSpec* spec,
837 MirRenderSurface* render_surface,838 MirRenderSurface* render_surface,
@@ -860,291 +861,6 @@
860 MIR_LOG_UNCAUGHT_EXCEPTION(ex);861 MIR_LOG_UNCAUGHT_EXCEPTION(ex);
861}862}
862863
863MirSurfaceSpec* mir_connection_create_spec_for_normal_surface(MirConnection* connection,
864 int width, int height,
865 MirPixelFormat format)
866{
867 auto spec = mir_create_normal_window_spec(connection, width, height);
868 mir_window_spec_set_pixel_format(spec, format);
869 return spec;
870}
871
872MirSurfaceSpec* mir_connection_create_spec_for_menu(MirConnection* connection,
873 int width, int height,
874 MirPixelFormat format,
875 MirSurface* parent,
876 MirRectangle* rect,
877 MirEdgeAttachment edge)
878{
879 auto spec = mir_create_menu_window_spec(connection, width, height, parent, rect, edge);
880 mir_window_spec_set_pixel_format(spec, format);
881 return spec;
882}
883
884MirSurfaceSpec* mir_connection_create_spec_for_tooltip(MirConnection* connection,
885 int width, int height,
886 MirPixelFormat format,
887 MirSurface* parent,
888 MirRectangle* rect)
889{
890 auto spec = mir_create_tip_window_spec(connection, width, height, parent, rect, mir_edge_attachment_any);
891 mir_window_spec_set_pixel_format(spec, format);
892 return spec;
893}
894
895MirSurfaceSpec* mir_connection_create_spec_for_tip(MirConnection* connection,
896 int width, int height,
897 MirPixelFormat format,
898 MirSurface* parent,
899 MirRectangle* rect,
900 MirEdgeAttachment edge)
901{
902 auto spec = mir_create_tip_window_spec(connection, width, height, parent, rect, edge);
903 mir_window_spec_set_pixel_format(spec, format);
904 return spec;
905}
906
907MirSurfaceSpec* mir_connection_create_spec_for_dialog(MirConnection* connection,
908 int width, int height,
909 MirPixelFormat format)
910{
911 auto spec = mir_create_dialog_window_spec(connection, width, height);
912 mir_window_spec_set_pixel_format(spec, format);
913 return spec;
914}
915
916MirSurfaceSpec* mir_connection_create_spec_for_input_method(MirConnection* connection,
917 int width, int height,
918 MirPixelFormat format)
919{
920 auto spec = mir_create_input_method_window_spec(connection, width, height);
921 mir_window_spec_set_pixel_format(spec, format);
922 return spec;
923}
924
925MirSurfaceSpec* mir_connection_create_spec_for_modal_dialog(MirConnection* connection,
926 int width, int height,
927 MirPixelFormat format,
928 MirSurface* parent)
929{
930 auto spec = mir_create_modal_dialog_window_spec(connection, width, height, parent);
931 mir_window_spec_set_pixel_format(spec, format);
932 return spec;
933}
934
935MirSurface* mir_surface_create_sync(MirSurfaceSpec* requested_specification)
936{
937 return mir_create_window_sync(requested_specification);
938}
939
940MirWaitHandle* mir_surface_create(MirSurfaceSpec* requested_specification,
941 mir_surface_callback callback, void* context)
942{
943 return window_create_helper(requested_specification, callback, context);
944}
945
946void mir_surface_spec_set_name(MirSurfaceSpec* spec, char const* name)
947{
948 mir_window_spec_set_name(spec, name);
949}
950
951void mir_surface_spec_set_width(MirSurfaceSpec* spec, unsigned width)
952{
953 mir_window_spec_set_width(spec, width);
954}
955
956void mir_surface_spec_set_height(MirSurfaceSpec* spec, unsigned height)
957{
958 mir_window_spec_set_height(spec, height);
959}
960
961void mir_surface_spec_set_min_width(MirSurfaceSpec* spec, unsigned min_width)
962{
963 mir_window_spec_set_min_width(spec, min_width);
964}
965
966void mir_surface_spec_set_min_height(MirSurfaceSpec* spec, unsigned min_height)
967{
968 mir_window_spec_set_min_height(spec, min_height);
969}
970
971void mir_surface_spec_set_max_width(MirSurfaceSpec* spec, unsigned max_width)
972{
973 mir_window_spec_set_max_width(spec, max_width);
974}
975
976void mir_surface_spec_set_max_height(MirSurfaceSpec* spec, unsigned max_height)
977{
978 mir_window_spec_set_max_height(spec, max_height);
979}
980
981void mir_surface_spec_set_pixel_format(MirSurfaceSpec* spec, MirPixelFormat format)
982{
983 mir_window_spec_set_pixel_format(spec, format);
984}
985
986void mir_surface_spec_set_buffer_usage(MirSurfaceSpec* spec, MirBufferUsage usage)
987{
988 mir_window_spec_set_buffer_usage(spec, usage);
989}
990
991void mir_surface_spec_set_state(MirSurfaceSpec* spec, MirSurfaceState state)
992{
993 mir_window_spec_set_state(spec, static_cast<MirWindowState>(state));
994}
995
996void mir_surface_spec_set_fullscreen_on_output(MirSurfaceSpec* spec, uint32_t output_id)
997{
998 mir_window_spec_set_fullscreen_on_output(spec, output_id);
999}
1000
1001void mir_surface_spec_set_preferred_orientation(MirSurfaceSpec* spec, MirOrientationMode mode)
1002{
1003 mir_window_spec_set_preferred_orientation(spec, mode);
1004}
1005
1006void mir_surface_spec_set_event_handler(MirSurfaceSpec* spec,
1007 mir_surface_event_callback callback,
1008 void* context)
1009{
1010 mir_window_spec_set_event_handler(spec, callback, context);
1011}
1012
1013void mir_surface_spec_set_shell_chrome(MirSurfaceSpec* spec, MirShellChrome style)
1014{
1015 mir_window_spec_set_shell_chrome(spec, style);
1016}
1017
1018void mir_surface_spec_release(MirSurfaceSpec* spec)
1019{
1020 mir_window_spec_release(spec);
1021}
1022
1023MirSurfaceSpec* mir_create_surface_spec(MirConnection* connection)
1024{
1025 return mir_create_window_spec(connection);
1026}
1027
1028MirSurfaceSpec* mir_connection_create_spec_for_changes(MirConnection* connection)
1029{
1030 return mir_create_window_spec(connection);
1031}
1032
1033void mir_surface_apply_spec(MirSurface* surface, MirSurfaceSpec* spec)
1034{
1035 mir_window_apply_spec(surface, spec);
1036}
1037
1038void mir_surface_spec_set_streams(MirSurfaceSpec* spec, MirBufferStreamInfo* streams, unsigned int size)
1039{
1040 mir_window_spec_set_streams(spec, streams, size);
1041}
1042
1043void mir_surface_spec_set_input_shape(MirSurfaceSpec *spec, MirRectangle const* rectangles,
1044 size_t n_rects)
1045{
1046 mir_window_spec_set_input_shape(spec, rectangles, n_rects);
1047}
1048
1049void mir_surface_spec_set_parent(MirSurfaceSpec* spec, MirSurface* parent)
1050{
1051 mir_window_spec_set_parent(spec, parent);
1052}
1053
1054void mir_surface_spec_set_type(MirSurfaceSpec* spec, MirSurfaceType type)
1055{
1056 mir_window_spec_set_type(spec, static_cast<MirWindowType>(type));
1057}
1058
1059void mir_surface_spec_set_width_increment(MirSurfaceSpec* spec, unsigned width_inc)
1060{
1061 mir_window_spec_set_width_increment(spec, width_inc);
1062}
1063
1064void mir_surface_spec_set_height_increment(MirSurfaceSpec* spec, unsigned height_inc)
1065{
1066 mir_window_spec_set_height_increment(spec, height_inc);
1067}
1068
1069void mir_surface_spec_set_min_aspect_ratio(MirSurfaceSpec* spec, unsigned width, unsigned height)
1070{
1071 mir_window_spec_set_min_aspect_ratio(spec, width, height);
1072}
1073
1074void mir_surface_spec_set_max_aspect_ratio(MirSurfaceSpec* spec, unsigned width, unsigned height)
1075{
1076 mir_window_spec_set_max_aspect_ratio(spec, width, height);
1077}
1078
1079void mir_surface_spec_set_pointer_confinement(MirSurfaceSpec* spec, MirPointerConfinementState state)
1080{
1081 mir_window_spec_set_pointer_confinement(spec, state);
1082}
1083
1084void mir_surface_spec_set_placement(MirSurfaceSpec* spec,
1085 MirRectangle const* rect,
1086 MirPlacementGravity rect_gravity,
1087 MirPlacementGravity window_gravity,
1088 MirPlacementHints placement_hints,
1089 int offset_dx, int offset_dy)
1090{
1091 mir_window_spec_set_placement(spec,
1092 rect,
1093 rect_gravity,
1094 window_gravity,
1095 placement_hints,
1096 offset_dx,
1097 offset_dy);
1098}
1099
1100bool mir_surface_spec_attach_to_foreign_parent(MirSurfaceSpec* spec,
1101 MirWindowId* parent,
1102 MirRectangle* attachment_rect,
1103 MirEdgeAttachment edge)
1104{
1105 return mir_window_spec_attach_to_foreign_parent(spec,
1106 parent,
1107 attachment_rect,
1108 edge);
1109}
1110
1111void mir_surface_set_event_handler(MirSurface* surface, mir_surface_event_callback callback, void* context)
1112{
1113 mir_window_set_event_handler(surface, callback, context);
1114}
1115
1116bool mir_surface_is_valid(MirSurface* surface)
1117{
1118 return mir_window_is_valid(surface);
1119}
1120
1121char const* mir_surface_get_error_message(MirSurface* surface)
1122{
1123 return mir_window_get_error_message(surface);
1124}
1125
1126void mir_surface_get_parameters(MirSurface* surface, MirSurfaceParameters* parameters)
1127{
1128 mir_window_get_parameters(surface, parameters);
1129}
1130
1131MirWaitHandle* mir_surface_release(
1132 MirSurface* surface,
1133 mir_surface_callback callback, void* context)
1134{
1135 return window_release_helper(surface, callback, context);
1136}
1137
1138void mir_surface_release_sync(MirSurface* surface)
1139{
1140 mir_window_release_sync(surface);
1141}
1142
1143MirSurfaceType mir_surface_get_type(MirSurface* surf)
1144{
1145 return static_cast<MirSurfaceType>(mir_window_get_type(surf));
1146}
1147
1148MirWaitHandle* mir_surface_set_state(MirSurface* surf, MirSurfaceState state)864MirWaitHandle* mir_surface_set_state(MirSurface* surf, MirSurfaceState state)
1149try865try
1150{866{
@@ -1162,77 +878,6 @@
1162 return static_cast<MirSurfaceState>(mir_window_get_state(surf));878 return static_cast<MirSurfaceState>(mir_window_get_state(surf));
1163}879}
1164880
1165MirOrientation mir_surface_get_orientation(MirSurface *surface)
1166{
1167 return mir_window_get_orientation(surface);
1168}
1169
1170MirWaitHandle* mir_surface_set_swapinterval(MirSurface* surf, int interval)
1171{
1172 if (interval < 0)
1173 return nullptr;
1174
1175 try
1176 {
1177 if (surf)
1178 {
1179 if (auto stream = surf->get_buffer_stream())
1180 return stream->set_swap_interval(interval);
1181 }
1182 }
1183 catch (std::exception const& ex)
1184 {
1185 MIR_LOG_UNCAUGHT_EXCEPTION(ex);
1186 return nullptr;
1187 }
1188 return nullptr;
1189}
1190
1191int mir_surface_get_swapinterval(MirSurface* surf)
1192{
1193 int swap_interval = -1;
1194
1195 try
1196 {
1197 if (surf)
1198 {
1199 if (auto stream = surf->get_buffer_stream())
1200 swap_interval = stream->swap_interval();
1201 }
1202 }
1203 catch (std::exception const& ex)
1204 {
1205 MIR_LOG_UNCAUGHT_EXCEPTION(ex);
1206 }
1207
1208 return swap_interval;
1209}
1210
1211int mir_surface_get_dpi(MirSurface* surf)
1212{
1213 return mir_window_get_dpi(surf);
1214}
1215
1216MirSurfaceFocusState mir_surface_get_focus(MirSurface* surf)
1217{
1218 return static_cast<MirSurfaceFocusState>(mir_window_get_focus_state(surf));
1219}
1220
1221MirSurfaceVisibility mir_surface_get_visibility(MirSurface* surf)
1222{
1223 return static_cast<MirSurfaceVisibility>(mir_window_get_visibility(surf));
1224}
1225
1226MirWaitHandle* mir_surface_configure_cursor(MirSurface* surface, MirCursorConfiguration const* cursor)
1227{
1228 return mir_configure_cursor_helper(surface, cursor);
1229}
1230
1231MirOrientationMode mir_surface_get_preferred_orientation(MirSurface *surf)
1232{
1233 return mir_window_get_preferred_orientation(surf);
1234}
1235
1236MirWaitHandle* mir_surface_set_preferred_orientation(MirSurface *surf, MirOrientationMode mode)881MirWaitHandle* mir_surface_set_preferred_orientation(MirSurface *surf, MirOrientationMode mode)
1237try882try
1238{883{
@@ -1245,51 +890,8 @@
1245 return nullptr;890 return nullptr;
1246}891}
1247892
1248void mir_surface_raise(MirSurface* surf, MirCookie const* cookie)
1249{
1250 mir_window_raise(surf, cookie);
1251}
1252
1253MirBufferStream* mir_surface_get_buffer_stream(MirSurface *surface)
1254{
1255 return mir_window_get_buffer_stream(surface);
1256}
1257
1258MirWaitHandle* mir_surface_request_persistent_id(MirSurface* surface, MirWindowIdCallback callback, void* context)
1259{
1260 return mir_window_request_persistent_id_helper(surface, callback, context);
1261}
1262
1263MirWindowId* mir_surface_request_persistent_id_sync(MirSurface *surface)
1264{
1265 MirWindowId* result = nullptr;
1266 if (auto wh = mir_window_request_persistent_id_helper(surface, &assign_surface_id_result, &result))
1267 wh->wait_for_all();
1268 return result;
1269}
1270
1271#pragma GCC diagnostic pop893#pragma GCC diagnostic pop
1272894
1273bool mir_persistent_id_is_valid(MirWindowId* id)
1274{
1275 return mir_window_id_is_valid(id);
1276}
1277
1278void mir_persistent_id_release(MirWindowId* id)
1279{
1280 mir_window_id_release(id);
1281}
1282
1283char const* mir_persistent_id_as_string(MirWindowId *id)
1284{
1285 return mir_window_id_as_string(id);
1286}
1287
1288MirWindowId* mir_persistent_id_from_string(char const* id_string)
1289{
1290 return mir_window_id_from_string(id_string);
1291}
1292
1293bool mir_window_id_is_valid(MirWindowId* id)895bool mir_window_id_is_valid(MirWindowId* id)
1294{896{
1295 return id != nullptr;897 return id != nullptr;
1296898
=== modified file 'src/client/symbols-debug.map'
--- src/client/symbols-debug.map 2015-06-17 05:20:42 +0000
+++ src/client/symbols-debug.map 2017-02-07 00:07:50 +0000
@@ -1,4 +1,4 @@
1MIR_CLIENT_DEBUG_9 {1MIR_CLIENT_DEBUG_1_0 {
2 global: 2 global:
3 mir_debug_*;3 mir_debug_*;
4 local: *;4 local: *;
55
=== modified file 'src/client/symbols.map'
--- src/client/symbols.map 2017-02-02 19:17:46 +0000
+++ src/client/symbols.map 2017-02-07 00:07:50 +0000
@@ -21,24 +21,15 @@
21 mir_connection_create_display_config;21 mir_connection_create_display_config;
22 mir_connection_create_prompt_session_sync;22 mir_connection_create_prompt_session_sync;
23 mir_connection_create_screencast_sync;23 mir_connection_create_screencast_sync;
24 mir_connection_create_spec_for_changes;
25 mir_connection_create_spec_for_dialog;
26 mir_connection_create_spec_for_input_method;24 mir_connection_create_spec_for_input_method;
27 mir_connection_create_spec_for_menu;
28 mir_connection_create_spec_for_modal_dialog;
29 mir_connection_create_spec_for_normal_surface;
30 mir_connection_create_spec_for_tooltip;
31 mir_connection_get_available_surface_formats;25 mir_connection_get_available_surface_formats;
32 mir_connection_get_egl_native_display;26 mir_connection_get_egl_native_display;
33 mir_connection_get_error_message;27 mir_connection_get_error_message;
34 mir_connection_get_platform;
35 mir_connection_is_valid;28 mir_connection_is_valid;
36 mir_connection_platform_operation;
37 mir_connection_release;29 mir_connection_release;
38 mir_connection_set_display_config_change_callback;30 mir_connection_set_display_config_change_callback;
39 mir_connection_set_lifecycle_event_callback;31 mir_connection_set_lifecycle_event_callback;
40 mir_connect_sync;32 mir_connect_sync;
41 mir_create_surface_spec;
42 mir_cursor_configuration_destroy;33 mir_cursor_configuration_destroy;
43 mir_cursor_configuration_from_buffer_stream;34 mir_cursor_configuration_from_buffer_stream;
44 mir_cursor_configuration_from_name;35 mir_cursor_configuration_from_name;
@@ -48,21 +39,16 @@
48 mir_disabled_cursor_name;39 mir_disabled_cursor_name;
49 mir_display_config_destroy;40 mir_display_config_destroy;
50 mir_event_get_close_surface_event;41 mir_event_get_close_surface_event;
51 mir_event_get_input_configuration_event;
52 mir_event_get_input_event;42 mir_event_get_input_event;
53 mir_event_get_keymap_event;43 mir_event_get_keymap_event;
54 mir_event_get_orientation_event;44 mir_event_get_orientation_event;
55 mir_event_get_prompt_session_event;45 mir_event_get_prompt_session_event;
56 mir_event_get_resize_event;46 mir_event_get_resize_event;
57 mir_event_get_surface_event;
58 mir_event_get_type;47 mir_event_get_type;
59 mir_event_ref;48 mir_event_ref;
60 mir_event_unref;49 mir_event_unref;
61 mir_horizontal_resize_cursor_name;50 mir_horizontal_resize_cursor_name;
62 mir_hsplit_resize_cursor_name;51 mir_hsplit_resize_cursor_name;
63 mir_input_configuration_event_get_action;
64 mir_input_configuration_event_get_device_id;
65 mir_input_configuration_event_get_time;
66 mir_input_event_get_device_id;52 mir_input_event_get_device_id;
67 mir_input_event_get_event_time;53 mir_input_event_get_event_time;
68 mir_input_event_get_keyboard_event;54 mir_input_event_get_keyboard_event;
@@ -73,12 +59,9 @@
73 mir_keyboard_event_key_code;59 mir_keyboard_event_key_code;
74 mir_keyboard_event_modifiers;60 mir_keyboard_event_modifiers;
75 mir_keyboard_event_scan_code;61 mir_keyboard_event_scan_code;
76 mir_keymap_event_get_rules;
77 mir_omnidirectional_resize_cursor_name;62 mir_omnidirectional_resize_cursor_name;
78 mir_open_hand_cursor_name;63 mir_open_hand_cursor_name;
79 mir_orientation_event_get_direction;64 mir_orientation_event_get_direction;
80 mir_persistent_id_is_valid;
81 mir_persistent_id_release;
82 mir_platform_message_create;65 mir_platform_message_create;
83 mir_platform_message_get_data;66 mir_platform_message_get_data;
84 mir_platform_message_get_fds;67 mir_platform_message_get_fds;
@@ -101,53 +84,6 @@
101 mir_resize_event_get_width;84 mir_resize_event_get_width;
102 mir_screencast_get_buffer_stream;85 mir_screencast_get_buffer_stream;
103 mir_screencast_release_sync;86 mir_screencast_release_sync;
104 mir_surface_apply_spec;
105 mir_surface_configure_cursor;
106 mir_surface_create;
107 mir_surface_create_sync;
108 mir_surface_event_get_attribute;
109 mir_surface_event_get_attribute_value;
110 mir_surface_get_buffer_stream;
111 mir_surface_get_dpi;
112 mir_surface_get_error_message;
113 mir_surface_get_focus;
114 mir_surface_get_orientation;
115 mir_surface_get_parameters;
116 mir_surface_get_preferred_orientation;
117 mir_surface_get_state;
118 mir_surface_get_swapinterval;
119 mir_surface_get_type;
120 mir_surface_get_visibility;
121 mir_surface_is_valid;
122 mir_surface_release;
123 mir_surface_release_sync;
124 mir_surface_request_persistent_id;
125 mir_surface_request_persistent_id_sync;
126 mir_surface_set_event_handler;
127 mir_surface_set_preferred_orientation;
128 mir_surface_set_state;
129 mir_surface_set_swapinterval;
130 mir_surface_spec_release;
131 mir_surface_spec_set_buffer_usage;
132 mir_surface_spec_set_fullscreen_on_output;
133 mir_surface_spec_set_height;
134 mir_surface_spec_set_height_increment;
135 mir_surface_spec_set_max_aspect_ratio;
136 mir_surface_spec_set_max_height;
137 mir_surface_spec_set_max_width;
138 mir_surface_spec_set_min_aspect_ratio;
139 mir_surface_spec_set_min_height;
140 mir_surface_spec_set_min_width;
141 mir_surface_spec_set_name;
142 mir_surface_spec_set_parent;
143 mir_surface_spec_set_pixel_format;
144 mir_surface_spec_set_placement;
145 mir_surface_spec_set_preferred_orientation;
146 mir_surface_spec_set_state;
147 mir_surface_spec_set_streams;
148 mir_surface_spec_set_type;
149 mir_surface_spec_set_width;
150 mir_surface_spec_set_width_increment;
151 mir_touch_event_action;87 mir_touch_event_action;
152 mir_touch_event_axis_value;88 mir_touch_event_axis_value;
153 mir_touch_event_id;89 mir_touch_event_id;
@@ -158,6 +94,9 @@
158 mir_vsplit_resize_cursor_name;94 mir_vsplit_resize_cursor_name;
159 mir_wait_for;95 mir_wait_for;
160 mir_wait_for_one;96 mir_wait_for_one;
97 mir_surface_set_state;
98 mir_surface_get_state;
99 mir_surface_set_preferred_orientation;
161 local: *;100 local: *;
162};101};
163102
@@ -167,42 +106,25 @@
167 mir_connection_set_ping_event_callback;106 mir_connection_set_ping_event_callback;
168 mir_crosshair_cursor_name;107 mir_crosshair_cursor_name;
169 mir_keyboard_event_input_event;108 mir_keyboard_event_input_event;
170 mir_persistent_id_as_string;
171 mir_persistent_id_from_string;
172 mir_pointer_event_input_event;109 mir_pointer_event_input_event;
173 mir_touch_event_input_event;110 mir_touch_event_input_event;
174 mir_surface_spec_attach_to_foreign_parent;
175 mir_surface_spec_set_input_shape;
176 mir_connection_get_egl_pixel_format;111 mir_connection_get_egl_pixel_format;
177 local: *;112 local: *;
178} MIR_CLIENT_9;113} MIR_CLIENT_9;
179114
180MIR_CLIENT_9.2 { # New functions in Mir 0.16
181 global:
182 mir_surface_spec_set_event_handler;
183 local: *;
184} MIR_CLIENT_9.1;
185
186MIR_CLIENT_9v17 {115MIR_CLIENT_9v17 {
187 mir_blob_from_display_configuration;
188 mir_blob_size;116 mir_blob_size;
189 mir_blob_data;117 mir_blob_data;
190 mir_blob_release;118 mir_blob_release;
191 mir_blob_onto_buffer;119 mir_blob_onto_buffer;
192 mir_blob_to_display_configuration;
193 mir_blob_release;120 mir_blob_release;
194 mir_buffer_stream_set_scale;121 mir_buffer_stream_set_scale;
195 mir_buffer_stream_set_scale_sync;122 mir_buffer_stream_set_scale_sync;
196 mir_event_get_surface_output_event;123} MIR_CLIENT_9.1;
197 mir_surface_output_event_get_dpi;
198 mir_surface_output_event_get_form_factor;
199 mir_surface_output_event_get_scale;
200} MIR_CLIENT_9.2;
201124
202MIR_CLIENT_9v18 {125MIR_CLIENT_9v18 {
203 global:126 global:
204 mir_buffer_stream_get_error_message;127 mir_buffer_stream_get_error_message;
205 mir_surface_output_event_get_output_id;
206 mir_connection_set_base_display_config;128 mir_connection_set_base_display_config;
207 local:129 local:
208 *;130 *;
@@ -210,8 +132,6 @@
210132
211MIR_CLIENT_9v19 {133MIR_CLIENT_9v19 {
212 global:134 global:
213 mir_connection_get_graphics_module;
214 mir_surface_raise;
215 mir_input_event_has_cookie;135 mir_input_event_has_cookie;
216 mir_cookie_buffer_size;136 mir_cookie_buffer_size;
217 mir_input_event_get_cookie;137 mir_input_event_get_cookie;
@@ -220,7 +140,6 @@
220 mir_cookie_release;140 mir_cookie_release;
221 mir_keymap_event_get_keymap_buffer;141 mir_keymap_event_get_keymap_buffer;
222 mir_keymap_event_get_device_id;142 mir_keymap_event_get_device_id;
223 mir_surface_spec_set_shell_chrome;
224} MIR_CLIENT_9v18;143} MIR_CLIENT_9v18;
225144
226MIR_CLIENT_0.21 {145MIR_CLIENT_0.21 {
@@ -413,13 +332,10 @@
413 mir_input_device_state_event_pointer_buttons;332 mir_input_device_state_event_pointer_buttons;
414 mir_input_device_state_event_time;333 mir_input_device_state_event_time;
415 mir_input_device_state_event_device_pointer_buttons;334 mir_input_device_state_event_device_pointer_buttons;
416 mir_surface_spec_set_pointer_confinement;
417} MIR_CLIENT_0.22;335} MIR_CLIENT_0.22;
418336
419MIR_CLIENT_0.25 { # New functions in Mir 0.25337MIR_CLIENT_0.25 { # New functions in Mir 0.25
420 global:338 global:
421 mir_connection_create_spec_for_tip;
422 mir_event_get_surface_placement_event;
423 mir_output_get_current_mode_index;339 mir_output_get_current_mode_index;
424 mir_output_get_preferred_mode_index;340 mir_output_get_preferred_mode_index;
425 mir_output_get_subpixel_arrangement;341 mir_output_get_subpixel_arrangement;
@@ -428,10 +344,7 @@
428 mir_output_get_gamma;344 mir_output_get_gamma;
429 mir_output_set_gamma;345 mir_output_set_gamma;
430 mir_connection_cancel_base_display_configuration_preview;346 mir_connection_cancel_base_display_configuration_preview;
431 mir_surface_placement_get_relative_position;
432 mir_display_output_type_name;
433 mir_output_type_name;347 mir_output_type_name;
434 mir_surface_output_event_get_refresh_rate;
435 mir_input_device_state_event_device_pressed_keys_for_index;348 mir_input_device_state_event_device_pressed_keys_for_index;
436 mir_buffer_stream_set_swapinterval;349 mir_buffer_stream_set_swapinterval;
437 mir_buffer_stream_get_swapinterval;350 mir_buffer_stream_get_swapinterval;
438351
=== modified file 'tests/acceptance-tests/CMakeLists.txt'
--- tests/acceptance-tests/CMakeLists.txt 2017-02-01 17:43:59 +0000
+++ tests/acceptance-tests/CMakeLists.txt 2017-02-07 00:07:50 +0000
@@ -42,7 +42,6 @@
42 test_server_startup.cpp42 test_server_startup.cpp
43 test_debug_api.cpp43 test_debug_api.cpp
44 test_unresponsive_client.cpp44 test_unresponsive_client.cpp
45 test_client_platform_operation.cpp
46 test_input_device_hub.cpp45 test_input_device_hub.cpp
47 test_latency.cpp46 test_latency.cpp
48 test_render_override.cpp47 test_render_override.cpp
4948
=== modified file 'tests/acceptance-tests/test_client_library.cpp'
--- tests/acceptance-tests/test_client_library.cpp 2017-02-03 22:37:56 +0000
+++ tests/acceptance-tests/test_client_library.cpp 2017-02-07 00:07:50 +0000
@@ -787,26 +787,6 @@
787 mir_connection_release(connection);787 mir_connection_release(connection);
788}788}
789789
790TEST_F(ClientLibrary, accesses_platform_package)
791{
792 using namespace testing;
793#pragma GCC diagnostic push
794#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
795 mir_wait_for(mir_connect(new_connection().c_str(), __PRETTY_FUNCTION__, connection_callback, this));
796#pragma GCC diagnostic pop
797
798 MirPlatformPackage platform_package;
799 ::memset(&platform_package, -1, sizeof(platform_package));
800
801#pragma GCC diagnostic push
802#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
803 mir_connection_get_platform(connection, &platform_package);
804#pragma GCC diagnostic pop
805 EXPECT_THAT(platform_package, mtf::IsStubPlatformPackage());
806
807 mir_connection_release(connection);
808}
809
810TEST_F(ClientLibrary, accesses_display_info)790TEST_F(ClientLibrary, accesses_display_info)
811{791{
812#pragma GCC diagnostic push792#pragma GCC diagnostic push
@@ -1120,9 +1100,7 @@
1120 mir_connection_release(connection);1100 mir_connection_release(connection);
1121}1101}
11221102
1123#pragma GCC diagnostic push1103TEST_F(ClientLibrary, can_get_window_id)
1124#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
1125TEST_F(ClientLibrary, can_get_persistent_surface_id)
1126{1104{
1127 auto connection = mir_connect_sync(new_connection().c_str(), __PRETTY_FUNCTION__);1105 auto connection = mir_connect_sync(new_connection().c_str(), __PRETTY_FUNCTION__);
11281106
@@ -1133,11 +1111,11 @@
11331111
1134 ASSERT_THAT(window, IsValid());1112 ASSERT_THAT(window, IsValid());
11351113
1136 auto surface_id = mir_window_request_persistent_id_sync(window);1114 auto surface_id = mir_window_request_window_id_sync(window);
1137 EXPECT_TRUE(mir_persistent_id_is_valid(surface_id));1115 EXPECT_TRUE(mir_window_id_is_valid(surface_id));
11381116
1139 mir_window_release_sync(window);1117 mir_window_release_sync(window);
1140 mir_persistent_id_release(surface_id);1118 mir_window_id_release(surface_id);
1141 mir_connection_release(connection);1119 mir_connection_release(connection);
1142}1120}
11431121
@@ -1152,11 +1130,11 @@
11521130
1153 ASSERT_THAT(main_surface, IsValid());1131 ASSERT_THAT(main_surface, IsValid());
11541132
1155 auto main_surface_id = mir_window_request_persistent_id_sync(main_surface);1133 auto main_surface_id = mir_window_request_window_id_sync(main_surface);
1156 ASSERT_TRUE(mir_persistent_id_is_valid(main_surface_id));1134 ASSERT_TRUE(mir_window_id_is_valid(main_surface_id));
11571135
1158 // Serialise & deserialise the ID1136 // Serialise & deserialise the ID
1159 auto im_parent_id = mir_persistent_id_from_string(mir_persistent_id_as_string(main_surface_id));1137 auto im_parent_id = mir_window_id_from_string(mir_window_id_as_string(main_surface_id));
11601138
1161 auto im_client = mir_connect_sync(new_connection().c_str(), "IM Client");1139 auto im_client = mir_connect_sync(new_connection().c_str(), "IM Client");
1162 surface_spec = mir_create_input_method_window_spec(im_client, 200, 20);1140 surface_spec = mir_create_input_method_window_spec(im_client, 200, 20);
@@ -1176,14 +1154,13 @@
1176 EXPECT_THAT(im_surface, IsValid());1154 EXPECT_THAT(im_surface, IsValid());
11771155
1178 mir_window_spec_release(surface_spec);1156 mir_window_spec_release(surface_spec);
1179 mir_persistent_id_release(main_surface_id);1157 mir_window_id_release(main_surface_id);
1180 mir_persistent_id_release(im_parent_id);1158 mir_window_id_release(im_parent_id);
1181 mir_window_release_sync(main_surface);1159 mir_window_release_sync(main_surface);
1182 mir_window_release_sync(im_surface);1160 mir_window_release_sync(im_surface);
1183 mir_connection_release(first_client);1161 mir_connection_release(first_client);
1184 mir_connection_release(im_client);1162 mir_connection_release(im_client);
1185}1163}
1186#pragma GCC diagnostic pop
11871164
1188//lp:16617041165//lp:1661704
1189TEST_F(ClientLibrary, can_get_window_id_more_than_once_in_quick_succession)1166TEST_F(ClientLibrary, can_get_window_id_more_than_once_in_quick_succession)
11901167
=== modified file 'tests/acceptance-tests/test_client_library_callbacks.cpp'
--- tests/acceptance-tests/test_client_library_callbacks.cpp 2017-01-18 16:58:17 +0000
+++ tests/acceptance-tests/test_client_library_callbacks.cpp 2017-02-07 00:07:50 +0000
@@ -125,31 +125,6 @@
125 3s);125 3s);
126}126}
127127
128#pragma GCC diagnostic push
129#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
130TEST_F(ClientLibraryCallbacks, create_surface_callback_is_called_before_wait_handler_has_result)
131{
132 connection = mir_connect_sync(new_connection().c_str(), __PRETTY_FUNCTION__);
133
134 auto const spec = mir_create_normal_window_spec(connection, 100, 100);
135 mir_window_spec_set_pixel_format(spec, mir_pixel_format_argb_8888);
136 auto const wh = mir_surface_create(spec, create_surface_callback, this);
137 mir_window_spec_release(spec);
138#pragma GCC diagnostic push
139#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
140 mir_wait_for(wh);
141#pragma GCC diagnostic pop
142
143 EXPECT_THAT(window.load(), NotNull());
144
145 // Even if the test fails, wait for object to become ready so we can
146 // tear down properly
147 mt::spin_wait_for_condition_or_timeout(
148 [this] { return window != nullptr; },
149 3s);
150}
151#pragma GCC diagnostic pop
152
153TEST_F(ClientLibraryCallbacks, swap_buffers_callback_is_called_before_wait_handler_has_result)128TEST_F(ClientLibraryCallbacks, swap_buffers_callback_is_called_before_wait_handler_has_result)
154{129{
155 connection = mir_connect_sync(new_connection().c_str(), __PRETTY_FUNCTION__);130 connection = mir_connect_sync(new_connection().c_str(), __PRETTY_FUNCTION__);
@@ -170,26 +145,3 @@
170 [this] { return buffers == 1; },145 [this] { return buffers == 1; },
171 3s);146 3s);
172}147}
173
174#pragma GCC diagnostic push
175#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
176TEST_F(ClientLibraryCallbacks, release_surface_callback_is_called_before_wait_handler_has_result)
177{
178 connection = mir_connect_sync(new_connection().c_str(), __PRETTY_FUNCTION__);
179 window = mtf::make_any_surface(connection);
180
181 auto const wh = mir_surface_release(window, release_surface_callback, this);
182#pragma GCC diagnostic push
183#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
184 mir_wait_for(wh);
185#pragma GCC diagnostic pop
186
187 EXPECT_THAT(window.load(), IsNull());
188
189 // Even if the test fails, wait for object to become ready so we can
190 // tear down properly
191 mt::spin_wait_for_condition_or_timeout(
192 [this] { return window == nullptr; },
193 3s);
194}
195#pragma GCC diagnostic pop
196148
=== modified file 'tests/acceptance-tests/test_client_library_errors.cpp'
--- tests/acceptance-tests/test_client_library_errors.cpp 2017-02-01 19:54:40 +0000
+++ tests/acceptance-tests/test_client_library_errors.cpp 2017-02-07 00:07:50 +0000
@@ -206,9 +206,7 @@
206 mir_connection_release(connection);206 mir_connection_release(connection);
207}207}
208208
209#pragma GCC diagnostic push209TEST_F(ClientLibraryErrors, passing_invalid_parent_id_to_window_create)
210#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
211TEST_F(ClientLibraryErrors, passing_invalid_parent_id_to_surface_create)
212{210{
213 using namespace testing;211 using namespace testing;
214212
@@ -217,7 +215,7 @@
217 ASSERT_THAT(connection, IsValid());215 ASSERT_THAT(connection, IsValid());
218216
219 // An ID that parses as valid, but doesn't correspond to any217 // An ID that parses as valid, but doesn't correspond to any
220 auto invalid_id = mir_persistent_id_from_string("05f223a2-39e5-48b9-9416-b0ce837351b6");218 auto invalid_id = mir_window_id_from_string("05f223a2-39e5-48b9-9416-b0ce837351b6");
221219
222 auto spec = mir_create_input_method_window_spec(connection, 200, 200);220 auto spec = mir_create_input_method_window_spec(connection, 200, 200);
223 mir_window_spec_set_pixel_format(spec, mir_pixel_format_argb_8888);221 mir_window_spec_set_pixel_format(spec, mir_pixel_format_argb_8888);
@@ -233,7 +231,7 @@
233 EXPECT_THAT(window, Not(IsValid()));231 EXPECT_THAT(window, Not(IsValid()));
234 EXPECT_THAT(mir_window_get_error_message(window), MatchesRegex(".*Lookup.*failed.*"));232 EXPECT_THAT(mir_window_get_error_message(window), MatchesRegex(".*Lookup.*failed.*"));
235233
236 mir_persistent_id_release(invalid_id);234 mir_window_id_release(invalid_id);
237 mir_window_spec_release(spec);235 mir_window_spec_release(spec);
238 mir_window_release_sync(window);236 mir_window_release_sync(window);
239 mir_connection_release(connection);237 mir_connection_release(connection);
@@ -241,7 +239,6 @@
241239
242using ClientLibraryErrorsDeathTest = ClientLibraryErrors;240using ClientLibraryErrorsDeathTest = ClientLibraryErrors;
243241
244
245TEST_F(ClientLibraryErrorsDeathTest, creating_surface_on_garbage_connection_is_fatal)242TEST_F(ClientLibraryErrorsDeathTest, creating_surface_on_garbage_connection_is_fatal)
246{243{
247 auto connection = mir_connect_sync("garbage", __PRETTY_FUNCTION__);244 auto connection = mir_connect_sync("garbage", __PRETTY_FUNCTION__);
@@ -296,7 +293,7 @@
296 auto spec = mir_create_input_method_window_spec(connection, 100, 100);293 auto spec = mir_create_input_method_window_spec(connection, 100, 100);
297 mir_window_spec_set_pixel_format(spec, mir_pixel_format_argb_8888);294 mir_window_spec_set_pixel_format(spec, mir_pixel_format_argb_8888);
298295
299 auto id = mir_persistent_id_from_string("fa69b2e9-d507-4005-be61-5068f40a5aec");296 auto id = mir_window_id_from_string("fa69b2e9-d507-4005-be61-5068f40a5aec");
300297
301 MIR_EXPECT_DEATH(298 MIR_EXPECT_DEATH(
302 {299 {
@@ -304,11 +301,10 @@
304 mir_edge_attachment_any);301 mir_edge_attachment_any);
305 }, "");302 }, "");
306303
307 mir_persistent_id_release(id);304 mir_window_id_release(id);
308 mir_connection_release(connection);305 mir_connection_release(connection);
309}306}
310307
311#pragma GCC diagnostic pop
312TEST_F(ClientLibraryErrorsDeathTest, creating_screencast_with_invalid_connection)308TEST_F(ClientLibraryErrorsDeathTest, creating_screencast_with_invalid_connection)
313{309{
314 MIR_EXPECT_DEATH(mir_create_screencast_spec(nullptr), "");310 MIR_EXPECT_DEATH(mir_create_screencast_spec(nullptr), "");
315311
=== removed file 'tests/acceptance-tests/test_client_platform_operation.cpp'
--- tests/acceptance-tests/test_client_platform_operation.cpp 2017-01-18 16:58:17 +0000
+++ tests/acceptance-tests/test_client_platform_operation.cpp 1970-01-01 00:00:00 +0000
@@ -1,198 +0,0 @@
1#include "mir_toolkit/mir_client_library.h"
2#include "mir_test_framework/connected_client_headless_server.h"
3#include "mir_test_framework/stub_graphics_platform_operation.h"
4#include "mir/test/pipe.h"
5
6#include <gtest/gtest.h>
7#include <gmock/gmock.h>
8
9#include <cstring>
10#include <unistd.h>
11
12//whole test should be removed once the platform messages are removed
13#pragma GCC diagnostic push
14#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
15namespace mtf = mir_test_framework;
16
17namespace
18{
19
20void assign_reply(MirConnection*, MirPlatformMessage* reply, void* context)
21{
22 auto message = static_cast<MirPlatformMessage**>(context);
23 *message = reply;
24}
25
26struct ClientPlatformOperation : mtf::ConnectedClientHeadlessServer
27{
28 MirPlatformMessage* platform_operation_add(int num1, int num2)
29 {
30 return platform_operation_add({num1,num2});
31 }
32
33 MirPlatformMessage* incorrect_platform_operation_add()
34 {
35 return platform_operation_add({7});
36 }
37
38 MirPlatformMessage* platform_operation_add(std::vector<int> const& nums)
39 {
40 auto const request = mir_platform_message_create(add_opcode);
41 mir_platform_message_set_data(request, nums.data(), sizeof(int) * nums.size());
42 MirPlatformMessage* reply;
43
44 auto const platform_op_done = mir_connection_platform_operation(
45 connection, request, assign_reply, &reply);
46#pragma GCC diagnostic push
47#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
48 mir_wait_for(platform_op_done);
49#pragma GCC diagnostic pop
50
51 mir_platform_message_release(request);
52
53 return reply;
54 }
55
56 MirPlatformMessage* platform_operation_echo_fd(int fd)
57 {
58 unsigned int const echo_fd_opcode =
59 static_cast<unsigned int>(mtf::StubGraphicsPlatformOperation::echo_fd);
60
61 auto const request = mir_platform_message_create(echo_fd_opcode);
62 mir_platform_message_set_fds(request, &fd, 1);
63 MirPlatformMessage* reply;
64
65 auto const platform_op_done = mir_connection_platform_operation(
66 connection, request, assign_reply, &reply);
67#pragma GCC diagnostic push
68#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
69 mir_wait_for(platform_op_done);
70#pragma GCC diagnostic pop
71
72 mir_platform_message_release(request);
73
74 return reply;
75 }
76
77 unsigned int const add_opcode =
78 static_cast<unsigned int>(mtf::StubGraphicsPlatformOperation::add);
79};
80
81MATCHER_P(MessageDataAsIntsEq, v, "")
82{
83 using namespace testing;
84 auto msg_data = mir_platform_message_get_data(arg);
85 if (msg_data.size % sizeof(int) != 0)
86 throw std::runtime_error("Data is not an array of ints");
87
88 std::vector<int> data(msg_data.size / sizeof(int));
89 memcpy(data.data(), msg_data.data, msg_data.size);
90
91 return v == data;
92}
93
94MATCHER(MessageDataIsEmpty, "")
95{
96 auto const msg_data = mir_platform_message_get_data(arg);
97 return msg_data.size == 0 && msg_data.data == nullptr;
98}
99
100MATCHER_P(MessageOpcodeEq, opcode, "")
101{
102 auto const msg_opcode = mir_platform_message_get_opcode(arg);
103 return msg_opcode == opcode;
104}
105
106MATCHER(MessageFdsIsEmpty, "")
107{
108 auto const msg_fds = mir_platform_message_get_fds(arg);
109 return msg_fds.num_fds == 0 && msg_fds.fds == nullptr;
110}
111
112}
113
114TEST_F(ClientPlatformOperation, exchanges_data_items_with_platform)
115{
116 using namespace testing;
117
118 int const num1 = 7;
119 int const num2 = 11;
120
121 auto const reply = platform_operation_add(num1, num2);
122
123 EXPECT_THAT(reply, MessageDataAsIntsEq(std::vector<int>{num1 + num2}));
124
125 mir_platform_message_release(reply);
126}
127
128TEST_F(ClientPlatformOperation, does_not_set_connection_error_message_on_success)
129{
130 using namespace testing;
131
132 auto const reply = platform_operation_add(7, 11);
133
134 EXPECT_THAT(mir_connection_get_error_message(connection), StrEq(""));
135
136 mir_platform_message_release(reply);
137}
138
139TEST_F(ClientPlatformOperation, reply_has_opcode_of_request)
140{
141 using namespace testing;
142
143 auto const reply = platform_operation_add(7, 11);
144
145 EXPECT_THAT(reply, MessageOpcodeEq(add_opcode));
146
147 mir_platform_message_release(reply);
148}
149
150TEST_F(ClientPlatformOperation, returns_empty_reply_on_error)
151{
152 using namespace testing;
153
154 auto const reply = incorrect_platform_operation_add();
155
156 EXPECT_THAT(reply, MessageDataIsEmpty());
157 EXPECT_THAT(reply, MessageFdsIsEmpty());
158
159 mir_platform_message_release(reply);
160}
161
162TEST_F(ClientPlatformOperation, sets_connection_error_message_on_error)
163{
164 using namespace testing;
165
166 auto const reply = incorrect_platform_operation_add();
167
168 EXPECT_THAT(mir_connection_get_error_message(connection), StrNe(""));
169
170 mir_platform_message_release(reply);
171}
172
173TEST_F(ClientPlatformOperation, exchanges_fd_items_with_platform)
174{
175 using namespace testing;
176
177 char const sent_char{'#'};
178
179 mir::test::Pipe pipe;
180 EXPECT_THAT(write(pipe.write_fd(), &sent_char, 1), Eq(1));
181
182 auto const reply = platform_operation_echo_fd(pipe.read_fd());
183 EXPECT_THAT(reply, MessageDataIsEmpty());
184
185 auto const reply_fds = mir_platform_message_get_fds(reply);
186 EXPECT_THAT(reply_fds.num_fds, Eq(1u));
187
188 auto const reply_fd = reply_fds.fds[0];
189 EXPECT_THAT(reply_fd, Ne(pipe.read_fd()));
190
191 char reply_char{0};
192 EXPECT_THAT(read(reply_fd, &reply_char, 1), Eq(1));
193 EXPECT_THAT(reply_char, Eq(sent_char));
194
195 close(reply_fd);
196 mir_platform_message_release(reply);
197}
198#pragma GCC diagnostic pop
1990
=== modified file 'tests/acceptance-tests/test_client_surfaces.cpp'
--- tests/acceptance-tests/test_client_surfaces.cpp 2017-02-01 19:54:40 +0000
+++ tests/acceptance-tests/test_client_surfaces.cpp 2017-02-07 00:07:50 +0000
@@ -281,8 +281,6 @@
281 mir_window_release_sync(window);281 mir_window_release_sync(window);
282}282}
283283
284#pragma GCC diagnostic push
285#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
286TEST_F(ClientSurfaces, input_methods_get_corret_parent_coordinates)284TEST_F(ClientSurfaces, input_methods_get_corret_parent_coordinates)
287{285{
288 using namespace testing;286 using namespace testing;
@@ -313,7 +311,7 @@
313311
314 auto window = mtf::make_any_surface(connection);312 auto window = mtf::make_any_surface(connection);
315313
316 auto parent_id = mir_window_request_persistent_id_sync(window);314 auto parent_id = mir_window_request_window_id_sync(window);
317315
318 auto im_connection = mir_connect_sync(new_connection().c_str(), "Mock IM connection");316 auto im_connection = mir_connect_sync(new_connection().c_str(), "Mock IM connection");
319 ASSERT_THAT(im_connection, IsValid());317 ASSERT_THAT(im_connection, IsValid());
@@ -324,7 +322,7 @@
324322
325 mir_window_spec_attach_to_foreign_parent(spec, parent_id, &client_rect, edge_attachment);323 mir_window_spec_attach_to_foreign_parent(spec, parent_id, &client_rect, edge_attachment);
326324
327 mir_persistent_id_release(parent_id);325 mir_window_id_release(parent_id);
328326
329 auto im = mir_create_window_sync(spec);327 auto im = mir_create_window_sync(spec);
330 mir_window_spec_release(spec);328 mir_window_spec_release(spec);
@@ -334,4 +332,3 @@
334332
335 mir_connection_release(im_connection);333 mir_connection_release(im_connection);
336}334}
337#pragma GCC diagnostic pop
338335
=== modified file 'tests/acceptance-tests/test_debug_api.cpp'
--- tests/acceptance-tests/test_debug_api.cpp 2017-01-18 02:29:37 +0000
+++ tests/acceptance-tests/test_debug_api.cpp 2017-02-07 00:07:50 +0000
@@ -149,88 +149,6 @@
149};149};
150}150}
151151
152TEST_F(DebugAPI, translates_surface_coordinates_to_screen_coordinates_deprecated)
153{
154 start_server_with_debug(true);
155
156 mir::geometry::Rectangle surface_location{{200, 100}, {800, 600}};
157
158 set_surface_placement(surface_location);
159
160 auto window = mtf::make_any_surface(connection);
161 ASSERT_TRUE(mir_window_is_valid(window));
162
163 int screen_x, screen_y, x, y;
164 x = 35, y = 21;
165
166#pragma GCC diagnostic push
167#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
168 ASSERT_TRUE(mir_debug_surface_coords_to_screen(window, x, y, &screen_x, &screen_y));
169#pragma GCC diagnostic pop
170 EXPECT_EQ(x + surface_location.top_left.x.as_int(), screen_x);
171 EXPECT_EQ(y + surface_location.top_left.y.as_int(), screen_y);
172
173 mir_window_release_sync(window);
174
175 surface_location.top_left = {100, 250};
176
177 set_surface_placement(surface_location);
178
179 window = mtf::make_any_surface(connection);
180 ASSERT_TRUE(mir_window_is_valid(window));
181
182#pragma GCC diagnostic push
183#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
184 ASSERT_TRUE(mir_debug_surface_coords_to_screen(window, x, y, &screen_x, &screen_y));
185#pragma GCC diagnostic pop
186 EXPECT_EQ(x + surface_location.top_left.x.as_int(), screen_x);
187 EXPECT_EQ(y + surface_location.top_left.y.as_int(), screen_y);
188
189 mir_window_release_sync(window);
190}
191
192TEST_F(DebugAPI, is_unavailable_when_server_not_started_with_debug_deprecated)
193{
194 start_server_with_debug(false);
195
196 auto window = mtf::make_any_surface(connection);
197 ASSERT_TRUE(mir_window_is_valid(window));
198
199 int screen_x, screen_y;
200
201#pragma GCC diagnostic push
202#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
203 EXPECT_FALSE(mir_debug_surface_coords_to_screen(window, 0, 0, &screen_x, &screen_y));
204#pragma GCC diagnostic pop
205
206 mir_window_release_sync(window);
207}
208
209TEST_F(DebugAPI, is_overrideable_deprecated)
210{
211 server.override_the_coordinate_translator([&]()
212 ->std::shared_ptr<mir::scene::CoordinateTranslator>
213 {
214 return std::make_shared<SimpleCoordinateTranslator>();
215 });
216
217 start_server_with_debug(false);
218
219 auto window = mtf::make_any_surface(connection);
220 ASSERT_TRUE(mir_window_is_valid(window));
221
222 int screen_x, screen_y;
223
224#pragma GCC diagnostic push
225#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
226 EXPECT_TRUE(mir_debug_surface_coords_to_screen(window, 0, 0, &screen_x, &screen_y));
227#pragma GCC diagnostic pop
228 EXPECT_EQ(testpoint.x.as_int(), screen_x);
229 EXPECT_EQ(testpoint.y.as_int(), screen_y);
230
231 mir_window_release_sync(window);
232}
233
234TEST_F(DebugAPI, translates_surface_coordinates_to_screen_coordinates)152TEST_F(DebugAPI, translates_surface_coordinates_to_screen_coordinates)
235{153{
236 start_server_with_debug(true);154 start_server_with_debug(true);
237155
=== modified file 'tests/acceptance-tests/test_mirblob.cpp'
--- tests/acceptance-tests/test_mirblob.cpp 2017-01-18 13:59:18 +0000
+++ tests/acceptance-tests/test_mirblob.cpp 2017-02-07 00:07:50 +0000
@@ -30,36 +30,6 @@
30using MirBlobAPI = mir_test_framework::ConnectedClientWithASurface;30using MirBlobAPI = mir_test_framework::ConnectedClientWithASurface;
31using mir::test::DisplayConfigMatches;31using mir::test::DisplayConfigMatches;
3232
33#pragma GCC diagnostic push
34#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
35TEST_F(MirBlobAPI, can_serialize_display_configuration)
36{
37 std::vector<uint8_t> buffer;
38
39 auto const save_display_config = mir_connection_create_display_config(connection);
40
41 {
42 auto const save_blob = mir_blob_from_display_configuration(save_display_config);
43
44 buffer.resize(mir_blob_size(save_blob));
45 memcpy(buffer.data(), mir_blob_data(save_blob), buffer.size());
46 mir_blob_release(save_blob);
47 }
48
49 MirDisplayConfiguration* restore_display_config;
50 {
51 auto const restore_blob = mir_blob_onto_buffer(buffer.data(), buffer.size());
52 restore_display_config = mir_blob_to_display_configuration(restore_blob);
53 mir_blob_release(restore_blob);
54 }
55
56 EXPECT_THAT(save_display_config, DisplayConfigMatches(restore_display_config));
57
58 mir_display_config_destroy(restore_display_config);
59 mir_display_config_destroy(save_display_config);
60}
61#pragma GCC diagnostic pop
62
63TEST_F(MirBlobAPI, can_serialize_display_config)33TEST_F(MirBlobAPI, can_serialize_display_config)
64{34{
65 std::vector<uint8_t> buffer;35 std::vector<uint8_t> buffer;
6636
=== modified file 'tests/acceptance-tests/test_persistent_surface_store.cpp'
--- tests/acceptance-tests/test_persistent_surface_store.cpp 2017-02-01 19:54:40 +0000
+++ tests/acceptance-tests/test_persistent_surface_store.cpp 2017-02-07 00:07:50 +0000
@@ -68,9 +68,7 @@
68};68};
69}69}
7070
71#pragma GCC diagnostic push71TEST_F(TestPersistentSurfaceStore, server_and_client_window_id_matches)
72#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
73TEST_F(TestPersistentSurfaceStore, server_and_client_persistent_id_matches)
74{72{
75 auto const shell_server_surface = latest_shell_surface();73 auto const shell_server_surface = latest_shell_surface();
76 ASSERT_THAT(shell_server_surface, NotNull());74 ASSERT_THAT(shell_server_surface, NotNull());
@@ -78,10 +76,9 @@
78 MirPersistentId* client_surface_id = mir_window_request_persistent_id_sync(window);76 MirPersistentId* client_surface_id = mir_window_request_persistent_id_sync(window);
79 msh::PersistentSurfaceStore::Id server_surface_id = server.the_persistent_surface_store()->id_for_surface(shell_server_surface);77 msh::PersistentSurfaceStore::Id server_surface_id = server.the_persistent_surface_store()->id_for_surface(shell_server_surface);
8078
81 std::string client_surface_id_string(mir_persistent_id_as_string(client_surface_id));79 std::string client_surface_id_string(mir_window_id_as_string(client_surface_id));
8280
83 ASSERT_THAT(server_surface_id.serialize_to_string(), Eq(client_surface_id_string));81 ASSERT_THAT(server_surface_id.serialize_to_string(), Eq(client_surface_id_string));
8482
85 mir_persistent_id_release(client_surface_id);83 mir_window_id_release(client_surface_id);
86}84}
87#pragma GCC diagnostic pop

Subscribers

People subscribed via source and target branches