Mir

Merge lp:~brandontschaefer/mir/usr-mir-window-placement into lp:mir

Proposed by Brandon Schaefer
Status: Superseded
Proposed branch: lp:~brandontschaefer/mir/usr-mir-window-placement
Merge into: lp:mir
Diff against target: 4936 lines (+1124/-660)
124 files modified
examples/client_touch_validator.cpp (+1/-1)
examples/eglapp.c (+16/-16)
examples/fingerpaint.c (+1/-1)
examples/server_example_basic_window_manager.cpp (+2/-2)
examples/server_example_basic_window_manager.h (+1/-1)
examples/server_example_canonical_window_manager.cpp (+5/-5)
examples/server_example_window_management_info.cpp (+35/-35)
examples/server_example_window_management_info.h (+3/-3)
examples/target.c (+1/-1)
include/client/mir/event_printer.h (+7/-3)
include/client/mir/events/event_builders.h (+3/-0)
include/client/mir_toolkit/events/event.h (+59/-9)
include/client/mir_toolkit/events/surface_event.h (+2/-0)
include/client/mir_toolkit/events/window_event.h (+53/-0)
include/client/mir_toolkit/events/window_output_event.h (+83/-0)
include/client/mir_toolkit/events/window_placement.h (+47/-0)
include/client/mir_toolkit/mir_surface.h (+10/-7)
include/core/mir_toolkit/common.h (+36/-2)
include/server/mir/scene/null_surface_observer.h (+1/-1)
include/server/mir/scene/surface.h (+3/-3)
include/server/mir/scene/surface_creation_parameters.h (+2/-2)
include/server/mir/scene/surface_observer.h (+1/-1)
include/server/mir/shell/abstract_shell.h (+2/-2)
include/server/mir/shell/shell.h (+2/-2)
include/server/mir/shell/shell_report.h (+1/-1)
include/server/mir/shell/shell_wrapper.h (+2/-2)
include/server/mir/shell/surface_specification.h (+1/-1)
include/server/mir/shell/system_compositor_window_manager.h (+1/-1)
include/server/mir/shell/window_manager.h (+1/-1)
include/test/mir/test/doubles/mock_window_manager.h (+1/-1)
include/test/mir/test/doubles/stub_surface.h (+3/-3)
include/test/mir/test/event_matchers.h (+8/-7)
src/client/buffer_stream.cpp (+3/-3)
src/client/buffer_stream.h (+1/-1)
src/client/event.cpp (+90/-15)
src/client/event_printer.cpp (+52/-18)
src/client/events/event_builders.cpp (+11/-0)
src/client/mir_surface.cpp (+17/-17)
src/client/mir_surface.h (+5/-5)
src/client/mir_surface_api.cpp (+34/-29)
src/client/rpc/mir_protobuf_rpc_channel.cpp (+4/-4)
src/client/screencast_stream.cpp (+1/-1)
src/client/screencast_stream.h (+1/-1)
src/client/symbols.map (+12/-0)
src/common/events/event.cpp (+8/-8)
src/common/events/surface_event.cpp (+3/-3)
src/include/client/mir/egl_native_surface.h (+1/-1)
src/include/common/mir/events/event.h (+2/-2)
src/include/common/mir/events/surface_event.h (+2/-2)
src/include/common/mir/events/surface_output_event.h (+0/-2)
src/include/server/mir/frontend/shell.h (+2/-2)
src/include/server/mir/scene/surface_event_source.h (+1/-1)
src/include/server/mir/scene/surface_observers.h (+1/-1)
src/include/server/mir/shell/basic_window_manager.h (+1/-1)
src/include/server/mir/shell/window_management_info.h (+3/-3)
src/platforms/android/client/egl_native_surface_interpreter.cpp (+1/-1)
src/platforms/mesa/client/native_surface.cpp (+1/-1)
src/server/frontend/session_mediator.cpp (+4/-4)
src/server/frontend/shell_wrapper.cpp (+2/-2)
src/server/frontend/shell_wrapper.h (+2/-2)
src/server/input/cursor_controller.cpp (+1/-1)
src/server/report/logging/shell_report.cpp (+1/-1)
src/server/report/logging/shell_report.h (+1/-1)
src/server/report/null/shell_report.cpp (+1/-1)
src/server/report/null/shell_report.h (+1/-1)
src/server/scene/application_session.cpp (+12/-12)
src/server/scene/basic_surface.cpp (+28/-28)
src/server/scene/basic_surface.h (+5/-5)
src/server/scene/legacy_surface_change_notification.cpp (+1/-1)
src/server/scene/legacy_surface_change_notification.h (+1/-1)
src/server/scene/null_surface_observer.cpp (+1/-1)
src/server/scene/rendering_tracker.cpp (+1/-1)
src/server/scene/surface_creation_parameters.cpp (+1/-1)
src/server/scene/surface_event_source.cpp (+1/-1)
src/server/scene/surface_stack.cpp (+1/-1)
src/server/shell/abstract_shell.cpp (+4/-4)
src/server/shell/basic_window_manager.cpp (+2/-2)
src/server/shell/canonical_window_manager.cpp (+10/-10)
src/server/shell/frontend_shell.cpp (+4/-4)
src/server/shell/frontend_shell.h (+2/-2)
src/server/shell/shell_wrapper.cpp (+2/-2)
src/server/shell/system_compositor_window_manager.cpp (+1/-1)
src/server/shell/window_management_info.cpp (+35/-35)
src/utils/vanity.c (+6/-6)
tests/acceptance-tests/test_client_cookie.cpp (+6/-6)
tests/acceptance-tests/test_client_focus_notification.cpp (+5/-4)
tests/acceptance-tests/test_client_input.cpp (+8/-8)
tests/acceptance-tests/test_client_library.cpp (+2/-2)
tests/acceptance-tests/test_client_surface_events.cpp (+74/-29)
tests/acceptance-tests/test_client_surface_visibility.cpp (+5/-4)
tests/acceptance-tests/test_client_surfaces.cpp (+5/-5)
tests/acceptance-tests/test_confined_pointer.cpp (+7/-7)
tests/acceptance-tests/test_custom_window_management.cpp (+8/-7)
tests/acceptance-tests/test_nested_input.cpp (+8/-8)
tests/acceptance-tests/test_nested_mir.cpp (+6/-6)
tests/acceptance-tests/test_new_display_configuration.cpp (+5/-5)
tests/acceptance-tests/test_surface_morphing.cpp (+22/-22)
tests/acceptance-tests/test_surface_placement.cpp (+12/-12)
tests/acceptance-tests/test_surface_raise.cpp (+6/-6)
tests/acceptance-tests/test_surface_specification.cpp (+19/-19)
tests/acceptance-tests/test_system_compositor_window_manager.cpp (+5/-5)
tests/acceptance-tests/throwback/test_shell_control_of_surface_configuration.cpp (+6/-6)
tests/include/mir/test/doubles/mock_egl_native_surface.h (+1/-1)
tests/include/mir/test/doubles/mock_frontend_surface.h (+2/-2)
tests/include/mir/test/doubles/mock_scene_session.h (+1/-1)
tests/include/mir/test/doubles/mock_shell.h (+2/-2)
tests/include/mir/test/doubles/mock_surface.h (+1/-1)
tests/include/mir/test/doubles/stub_scene_surface.h (+3/-3)
tests/integration-tests/client/test_mirsurface.cpp (+4/-4)
tests/integration-tests/session_management.cpp (+1/-1)
tests/integration-tests/test_session.cpp (+1/-1)
tests/mir_test_framework/stub_surface.cpp (+4/-4)
tests/mir_test_framework/visible_surface.cpp (+4/-3)
tests/unit-tests/client/test_client_mir_surface.cpp (+10/-10)
tests/unit-tests/frontend/test_event_sender.cpp (+1/-1)
tests/unit-tests/platforms/android/client/test_egl_native_surface_interpreter.cpp (+3/-3)
tests/unit-tests/platforms/mesa/client/test_native_surface.cpp (+2/-2)
tests/unit-tests/scene/test_abstract_shell.cpp (+6/-6)
tests/unit-tests/scene/test_application_session.cpp (+15/-15)
tests/unit-tests/scene/test_basic_surface.cpp (+17/-17)
tests/unit-tests/scene/test_rendering_tracker.cpp (+6/-6)
tests/unit-tests/scene/test_surface.cpp (+1/-1)
tests/unit-tests/scene/test_surface_impl.cpp (+35/-35)
tests/unit-tests/scene/test_surface_stack.cpp (+13/-13)
To merge this branch: bzr merge lp:~brandontschaefer/mir/usr-mir-window-placement
Reviewer Review Type Date Requested Status
Mir development team Pending
Review via email: mp+314476@code.launchpad.net

This proposal has been superseded by a proposal from 2017-01-10.

Commit message

Use MirWindowPlacementEvent vs MirSurfacePlacement

Description of the change

Use MirWindowPlacementEvent vs MirSurfacePlacement

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'examples/client_touch_validator.cpp'
--- examples/client_touch_validator.cpp 2017-01-09 06:48:47 +0000
+++ examples/client_touch_validator.cpp 2017-01-10 20:52:04 +0000
@@ -143,7 +143,7 @@
143 case mir_event_type_input:143 case mir_event_type_input:
144 on_input_event(state, mir_event_get_input_event(event));144 on_input_event(state, mir_event_get_input_event(event));
145 break;145 break;
146 case mir_event_type_close_surface:146 case mir_event_type_close_window:
147 abort();147 abort();
148 break;148 break;
149 default:149 default:
150150
=== modified file 'examples/eglapp.c'
--- examples/eglapp.c 2017-01-09 06:48:47 +0000
+++ examples/eglapp.c 2017-01-10 20:52:04 +0000
@@ -110,18 +110,18 @@
110 running = 0;110 running = 0;
111}111}
112112
113static void mir_eglapp_handle_surface_event(MirSurfaceEvent const* sev)113static void mir_eglapp_handle_window_event(MirWindowEvent const* sev)
114{114{
115 MirSurfaceAttrib attrib = mir_surface_event_get_attribute(sev);115 MirWindowAttrib attrib = mir_window_event_get_attribute(sev);
116 int value = mir_surface_event_get_attribute_value(sev);116 int value = mir_window_event_get_attribute_value(sev);
117117
118 switch (attrib)118 switch (attrib)
119 {119 {
120 case mir_surface_attrib_visibility:120 case mir_window_attrib_visibility:
121 printf("Window %s\n", value == mir_surface_visibility_exposed ?121 printf("Window %s\n", value == mir_surface_visibility_exposed ?
122 "exposed" : "occluded");122 "exposed" : "occluded");
123 break;123 break;
124 case mir_surface_attrib_dpi:124 case mir_window_attrib_dpi:
125 // value is still zero - never implemented. Deprecate? (LP: #1559831)125 // value is still zero - never implemented. Deprecate? (LP: #1559831)
126 break;126 break;
127 default:127 default:
@@ -129,19 +129,19 @@
129 }129 }
130}130}
131131
132static void handle_surface_output_event(MirSurfaceOutputEvent const* out)132static void handle_window_output_event(MirWindowOutputEvent const* out)
133{133{
134 static char const* const form_factor_name[6] =134 static char const* const form_factor_name[6] =
135 {"unknown", "phone", "tablet", "monitor", "TV", "projector"};135 {"unknown", "phone", "tablet", "monitor", "TV", "projector"};
136 unsigned ff = mir_surface_output_event_get_form_factor(out);136 unsigned ff = mir_window_output_event_get_form_factor(out);
137 char const* form_factor = (ff < 6) ? form_factor_name[ff] : "out-of-range";137 char const* form_factor = (ff < 6) ? form_factor_name[ff] : "out-of-range";
138138
139 refresh_rate = mir_surface_output_event_get_refresh_rate(out);139 refresh_rate = mir_window_output_event_get_refresh_rate(out);
140140
141 printf("Window is on output %u: %d DPI, scale %.1fx, %s form factor, %.2fHz\n",141 printf("Window is on output %u: %d DPI, scale %.1fx, %s form factor, %.2fHz\n",
142 mir_surface_output_event_get_output_id(out),142 mir_window_output_event_get_output_id(out),
143 mir_surface_output_event_get_dpi(out),143 mir_window_output_event_get_dpi(out),
144 mir_surface_output_event_get_scale(out),144 mir_window_output_event_get_scale(out),
145 form_factor,145 form_factor,
146 refresh_rate);146 refresh_rate);
147}147}
@@ -161,11 +161,11 @@
161 case mir_event_type_input:161 case mir_event_type_input:
162 mir_eglapp_handle_input_event(mir_event_get_input_event(ev));162 mir_eglapp_handle_input_event(mir_event_get_input_event(ev));
163 break;163 break;
164 case mir_event_type_surface:164 case mir_event_type_window:
165 mir_eglapp_handle_surface_event(mir_event_get_surface_event(ev));165 mir_eglapp_handle_window_event(mir_event_get_window_event(ev));
166 break;166 break;
167 case mir_event_type_surface_output:167 case mir_event_type_window_output:
168 handle_surface_output_event(mir_event_get_surface_output_event(ev));168 handle_window_output_event(mir_event_get_window_output_event(ev));
169 break;169 break;
170 case mir_event_type_resize:170 case mir_event_type_resize:
171 /*171 /*
@@ -182,7 +182,7 @@
182 mir_resize_event_get_height(resize));182 mir_resize_event_get_height(resize));
183 }183 }
184 break;184 break;
185 case mir_event_type_close_surface:185 case mir_event_type_close_window:
186 printf("Received close event from server.\n");186 printf("Received close event from server.\n");
187 running = 0;187 running = 0;
188 break;188 break;
189189
=== modified file 'examples/fingerpaint.c'
--- examples/fingerpaint.c 2017-01-09 06:48:47 +0000
+++ examples/fingerpaint.c 2017-01-10 20:52:04 +0000
@@ -301,7 +301,7 @@
301 changed = true;301 changed = true;
302 }302 }
303 }303 }
304 else if (event_type == mir_event_type_close_surface)304 else if (event_type == mir_event_type_close_window)
305 {305 {
306 static int closing = 0;306 static int closing = 0;
307307
308308
=== modified file 'examples/server_example_basic_window_manager.cpp'
--- examples/server_example_basic_window_manager.cpp 2016-07-18 07:38:38 +0000
+++ examples/server_example_basic_window_manager.cpp 2017-01-10 20:52:04 +0000
@@ -139,13 +139,13 @@
139int me::BasicWindowManager::set_surface_attribute(139int me::BasicWindowManager::set_surface_attribute(
140 std::shared_ptr<scene::Session> const& /*session*/,140 std::shared_ptr<scene::Session> const& /*session*/,
141 std::shared_ptr<scene::Surface> const& surface,141 std::shared_ptr<scene::Surface> const& surface,
142 MirSurfaceAttrib attrib,142 MirWindowAttrib attrib,
143 int value)143 int value)
144{144{
145 std::lock_guard<decltype(mutex)> lock(mutex);145 std::lock_guard<decltype(mutex)> lock(mutex);
146 switch (attrib)146 switch (attrib)
147 {147 {
148 case mir_surface_attrib_state:148 case mir_window_attrib_state:
149 {149 {
150 auto const state = policy->handle_set_state(surface, MirSurfaceState(value));150 auto const state = policy->handle_set_state(surface, MirSurfaceState(value));
151 return surface->configure(attrib, state);151 return surface->configure(attrib, state);
152152
=== modified file 'examples/server_example_basic_window_manager.h'
--- examples/server_example_basic_window_manager.h 2016-07-18 07:38:38 +0000
+++ examples/server_example_basic_window_manager.h 2017-01-10 20:52:04 +0000
@@ -177,7 +177,7 @@
177 int set_surface_attribute(177 int set_surface_attribute(
178 std::shared_ptr<scene::Session> const& /*session*/,178 std::shared_ptr<scene::Session> const& /*session*/,
179 std::shared_ptr<scene::Surface> const& surface,179 std::shared_ptr<scene::Surface> const& surface,
180 MirSurfaceAttrib attrib,180 MirWindowAttrib attrib,
181 int value) override;181 int value) override;
182182
183 auto find_session(std::function<bool(SessionInfo const& info)> const& predicate)183 auto find_session(std::function<bool(SessionInfo const& info)> const& predicate)
184184
=== modified file 'examples/server_example_canonical_window_manager.cpp'
--- examples/server_example_canonical_window_manager.cpp 2016-12-09 02:54:31 +0000
+++ examples/server_example_canonical_window_manager.cpp 2017-01-10 20:52:04 +0000
@@ -100,7 +100,7 @@
100-> ms::SurfaceCreationParameters100-> ms::SurfaceCreationParameters
101{101{
102 auto parameters = request_parameters;102 auto parameters = request_parameters;
103 auto surf_type = parameters.type.is_set() ? parameters.type.value() : mir_surface_type_normal;103 auto surf_type = parameters.type.is_set() ? parameters.type.value() : mir_window_type_normal;
104 bool const needs_titlebar = SurfaceInfo::needs_titlebar(surf_type);104 bool const needs_titlebar = SurfaceInfo::needs_titlebar(surf_type);
105105
106 if (needs_titlebar)106 if (needs_titlebar)
@@ -260,7 +260,7 @@
260 .of_pixel_format(format)260 .of_pixel_format(format)
261 .of_buffer_usage(mir::graphics::BufferUsage::software)261 .of_buffer_usage(mir::graphics::BufferUsage::software)
262 .of_position(titlebar_position_for_window(surface->top_left()))262 .of_position(titlebar_position_for_window(surface->top_left()))
263 .of_type(mir_surface_type_gloss)263 .of_type(mir_window_type_gloss)
264 .with_buffer_stream(stream_id);264 .with_buffer_stream(stream_id);
265 auto id = build(session, params);265 auto id = build(session, params);
266 auto titlebar = session->surface(id);266 auto titlebar = session->surface(id);
@@ -342,7 +342,7 @@
342 throw std::runtime_error("Target surface type requires parent");342 throw std::runtime_error("Target surface type requires parent");
343 }343 }
344344
345 surface->configure(mir_surface_attrib_type, new_type);345 surface->configure(mir_window_attrib_type, new_type);
346 }346 }
347347
348 #define COPY_IF_SET(field)\348 #define COPY_IF_SET(field)\
@@ -414,7 +414,7 @@
414 if (modifications.state.is_set())414 if (modifications.state.is_set())
415 {415 {
416 auto const state = handle_set_state(surface, modifications.state.value());416 auto const state = handle_set_state(surface, modifications.state.value());
417 surface->configure(mir_surface_attrib_state, state);417 surface->configure(mir_window_attrib_state, state);
418 }418 }
419419
420 if (modifications.confine_pointer.is_set())420 if (modifications.confine_pointer.is_set())
@@ -823,7 +823,7 @@
823 state = mir_surface_state_restored;823 state = mir_surface_state_restored;
824824
825 auto const value = handle_set_state(surface, MirSurfaceState(state));825 auto const value = handle_set_state(surface, MirSurfaceState(state));
826 surface->configure(mir_surface_attrib_state, value);826 surface->configure(mir_window_attrib_state, value);
827 }827 }
828}828}
829829
830830
=== modified file 'examples/server_example_window_management_info.cpp'
--- examples/server_example_window_management_info.cpp 2016-11-04 17:12:59 +0000
+++ examples/server_example_window_management_info.cpp 2017-01-10 20:52:04 +0000
@@ -59,17 +59,17 @@
59{59{
60 switch (type)60 switch (type)
61 {61 {
62 case mir_surface_type_normal: /**< AKA "regular" */62 case mir_window_type_normal: /**< AKA "regular" */
63 case mir_surface_type_utility: /**< AKA "floating" */63 case mir_window_type_utility: /**< AKA "floating" */
64 case mir_surface_type_dialog:64 case mir_window_type_dialog:
65 case mir_surface_type_satellite: /**< AKA "toolbox"/"toolbar" */65 case mir_window_type_satellite: /**< AKA "toolbox"/"toolbar" */
66 case mir_surface_type_freestyle:66 case mir_window_type_freestyle:
67 case mir_surface_type_menu:67 case mir_window_type_menu:
68 case mir_surface_type_inputmethod: /**< AKA "OSK" or handwriting etc. */68 case mir_window_type_inputmethod: /**< AKA "OSK" or handwriting etc. */
69 return true;69 return true;
7070
71 case mir_surface_type_gloss:71 case mir_window_type_gloss:
72 case mir_surface_type_tip: /**< AKA "tooltip" */72 case mir_window_type_tip: /**< AKA "tooltip" */
73 default:73 default:
74 // Cannot have input focus74 // Cannot have input focus
75 return false;75 return false;
@@ -80,10 +80,10 @@
80{80{
81 switch (type)81 switch (type)
82 {82 {
83 case mir_surface_type_overlay:;83 case mir_window_type_gloss:;
84 case mir_surface_type_inputmethod:84 case mir_window_type_inputmethod:
85 case mir_surface_type_satellite:85 case mir_window_type_satellite:
86 case mir_surface_type_tip:86 case mir_window_type_tip:
87 return true;87 return true;
8888
89 default:89 default:
@@ -91,19 +91,19 @@
91 }91 }
92}92}
9393
94bool me::SurfaceInfo::can_morph_to(MirSurfaceType new_type) const94bool me::SurfaceInfo::can_morph_to(MirWindowType new_type) const
95{95{
96 switch (new_type)96 switch (new_type)
97 {97 {
98 case mir_surface_type_normal:98 case mir_window_type_normal:
99 case mir_surface_type_utility:99 case mir_window_type_utility:
100 case mir_surface_type_satellite:100 case mir_window_type_satellite:
101 switch (type)101 switch (type)
102 {102 {
103 case mir_surface_type_normal:103 case mir_window_type_normal:
104 case mir_surface_type_utility:104 case mir_window_type_utility:
105 case mir_surface_type_dialog:105 case mir_window_type_dialog:
106 case mir_surface_type_satellite:106 case mir_window_type_satellite:
107 return true;107 return true;
108108
109 default:109 default:
@@ -111,14 +111,14 @@
111 }111 }
112 break;112 break;
113113
114 case mir_surface_type_dialog:114 case mir_window_type_dialog:
115 switch (type)115 switch (type)
116 {116 {
117 case mir_surface_type_normal:117 case mir_window_type_normal:
118 case mir_surface_type_utility:118 case mir_window_type_utility:
119 case mir_surface_type_dialog:119 case mir_window_type_dialog:
120 case mir_surface_type_popover:120 case mir_window_type_popover:
121 case mir_surface_type_satellite:121 case mir_window_type_satellite:
122 return true;122 return true;
123123
124 default:124 default:
@@ -137,8 +137,8 @@
137{137{
138 switch (type)138 switch (type)
139 {139 {
140 case mir_surface_type_normal:140 case mir_window_type_normal:
141 case mir_surface_type_utility:141 case mir_window_type_utility:
142 return true;142 return true;
143143
144 default:144 default:
@@ -356,15 +356,15 @@
356 requested_size = new_size;356 requested_size = new_size;
357}357}
358358
359bool me::SurfaceInfo::needs_titlebar(MirSurfaceType type)359bool me::SurfaceInfo::needs_titlebar(MirWindowType type)
360{360{
361 switch (type)361 switch (type)
362 {362 {
363 case mir_surface_type_freestyle:363 case mir_window_type_freestyle:
364 case mir_surface_type_menu:364 case mir_window_type_menu:
365 case mir_surface_type_inputmethod:365 case mir_window_type_inputmethod:
366 case mir_surface_type_gloss:366 case mir_window_type_gloss:
367 case mir_surface_type_tip:367 case mir_window_type_tip:
368 // No decorations for these surface types368 // No decorations for these surface types
369 return false;369 return false;
370 default:370 default:
371371
=== modified file 'examples/server_example_window_management_info.h'
--- examples/server_example_window_management_info.h 2016-11-04 17:12:59 +0000
+++ examples/server_example_window_management_info.h 2017-01-10 20:52:04 +0000
@@ -39,7 +39,7 @@
3939
40 bool can_be_active() const;40 bool can_be_active() const;
4141
42 bool can_morph_to(MirSurfaceType new_type) const;42 bool can_morph_to(MirWindowType new_type) const;
4343
44 bool must_have_parent() const;44 bool must_have_parent() const;
4545
@@ -47,7 +47,7 @@
4747
48 bool is_visible() const;48 bool is_visible() const;
4949
50 static bool needs_titlebar(MirSurfaceType type);50 static bool needs_titlebar(MirWindowType type);
5151
52 void constrain_resize(52 void constrain_resize(
53 std::shared_ptr <scene::Surface> const& surface,53 std::shared_ptr <scene::Surface> const& surface,
@@ -57,7 +57,7 @@
57 const bool top_resize,57 const bool top_resize,
58 geometry::Rectangle const& bounds) const;58 geometry::Rectangle const& bounds) const;
5959
60 MirSurfaceType type;60 MirWindowType type;
61 MirSurfaceState state;61 MirSurfaceState state;
62 geometry::Rectangle restore_rect;62 geometry::Rectangle restore_rect;
63 std::weak_ptr <scene::Session> session;63 std::weak_ptr <scene::Session> session;
6464
=== modified file 'examples/target.c'
--- examples/target.c 2017-01-09 06:48:47 +0000
+++ examples/target.c 2017-01-10 20:52:04 +0000
@@ -199,7 +199,7 @@
199 case mir_event_type_resize:199 case mir_event_type_resize:
200 state->resized = true;200 state->resized = true;
201 break;201 break;
202 case mir_event_type_close_surface:202 case mir_event_type_close_window:
203 state->running = false;203 state->running = false;
204 break;204 break;
205 default:205 default:
206206
=== modified file 'include/client/mir/event_printer.h'
--- include/client/mir/event_printer.h 2016-10-31 02:37:31 +0000
+++ include/client/mir/event_printer.h 2017-01-10 20:52:04 +0000
@@ -35,20 +35,24 @@
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);37std::ostream& operator<<(std::ostream& out, MirSurfaceAttrib attribute);
38/* __attribute__ ((deprecated("use << with MirWindowAttribute instead")); */
39std::ostream& operator<<(std::ostream& out, MirWindowAttrib attribute);
38std::ostream& operator<<(std::ostream& out, MirSurfaceFocusState state);40std::ostream& operator<<(std::ostream& out, MirSurfaceFocusState state);
39std::ostream& operator<<(std::ostream& out, MirSurfaceVisibility state);41std::ostream& operator<<(std::ostream& out, MirSurfaceVisibility state);
40std::ostream& operator<<(std::ostream& out, MirSurfaceType type);42std::ostream& operator<<(std::ostream& out, MirSurfaceType type);
43/* __attribute__ ((deprecated("use << with MirWindowType instead")); */
44std::ostream& operator<<(std::ostream& out, MirWindowType type);
41std::ostream& operator<<(std::ostream& out, MirSurfaceState state);45std::ostream& operator<<(std::ostream& out, MirSurfaceState state);
4246
43std::ostream& operator<<(std::ostream& out, MirPromptSessionEvent const& event);47std::ostream& operator<<(std::ostream& out, MirPromptSessionEvent const& event);
44std::ostream& operator<<(std::ostream& out, MirResizeEvent const& event);48std::ostream& operator<<(std::ostream& out, MirResizeEvent const& event);
45std::ostream& operator<<(std::ostream& out, MirOrientationEvent const& event);49std::ostream& operator<<(std::ostream& out, MirOrientationEvent const& event);
46std::ostream& operator<<(std::ostream& out, MirInputEvent const& event);50std::ostream& operator<<(std::ostream& out, MirInputEvent const& event);
47std::ostream& operator<<(std::ostream& out, MirCloseSurfaceEvent const& event);51std::ostream& operator<<(std::ostream& out, MirCloseWindowEvent const& event);
48std::ostream& operator<<(std::ostream& out, MirKeymapEvent const& event);52std::ostream& operator<<(std::ostream& out, MirKeymapEvent const& event);
49std::ostream& operator<<(std::ostream& out, MirSurfaceEvent const& event);53std::ostream& operator<<(std::ostream& out, MirWindowEvent const& event);
50std::ostream& operator<<(std::ostream& out, MirInputDeviceStateEvent const& event);54std::ostream& operator<<(std::ostream& out, MirInputDeviceStateEvent const& event);
51std::ostream& operator<<(std::ostream& out, MirSurfacePlacementEvent const& event);55std::ostream& operator<<(std::ostream& out, MirWindowPlacementEvent const& event);
52std::ostream& operator<<(std::ostream& out, MirEvent const& event);56std::ostream& operator<<(std::ostream& out, MirEvent const& event);
5357
54}58}
5559
=== modified file 'include/client/mir/events/event_builders.h'
--- include/client/mir/events/event_builders.h 2016-11-11 07:56:09 +0000
+++ include/client/mir/events/event_builders.h 2017-01-10 20:52:04 +0000
@@ -48,6 +48,9 @@
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 event49// Surface configure event
50EventUPtr make_event(frontend::SurfaceId const& surface_id, MirSurfaceAttrib attribute, int value);50EventUPtr make_event(frontend::SurfaceId const& surface_id, MirSurfaceAttrib attribute, int value);
51/* __attribute__ ((deprecated("use make_event with MirWindowAttribute instead")); */
52// Window configure event
53EventUPtr make_event(frontend::SurfaceId const& surface_id, MirWindowAttrib attribute, int value);
51// Close surface event54// Close surface event
52EventUPtr make_event(frontend::SurfaceId const& surface_id);55EventUPtr make_event(frontend::SurfaceId const& surface_id);
53// Keymap event56// Keymap event
5457
=== modified file 'include/client/mir_toolkit/events/event.h'
--- include/client/mir_toolkit/events/event.h 2016-11-11 07:56:09 +0000
+++ include/client/mir_toolkit/events/event.h 2017-01-10 20:52:04 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright © 2014-2016 Canonical Ltd.2 * Copyright © 2014-2017 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * 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,5 * under the terms of the GNU Lesser General Public License version 3,
@@ -31,36 +31,47 @@
31extern "C" {31extern "C" {
32#endif32#endif
3333
34#pragma GCC diagnostic push
35#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
34typedef enum36typedef enum
35{37{
36 mir_event_type_key,38 mir_event_type_key,
37 mir_event_type_motion,39 mir_event_type_motion,
38 mir_event_type_surface,40 mir_event_type_surface, /* __attribute__ ((deprecated("use mir_event_type_window instead"))), */
41 mir_event_type_window = mir_event_type_surface,
39 mir_event_type_resize,42 mir_event_type_resize,
40 mir_event_type_prompt_session_state_change,43 mir_event_type_prompt_session_state_change,
41 mir_event_type_orientation,44 mir_event_type_orientation,
42 mir_event_type_close_surface,45 mir_event_type_close_surface, /*__attribute__ ((deprecated("use mir_event_type_close_window instead"))), */
46 mir_event_type_close_window = mir_event_type_close_surface,
43 /* Type for new style input event will be returned from mir_event_get_type47 /* Type for new style input event will be returned from mir_event_get_type
44 when old style event type was mir_event_type_key or mir_event_type_motion */48 when old style event type was mir_event_type_key or mir_event_type_motion */
45 mir_event_type_input,49 mir_event_type_input,
46 mir_event_type_keymap,50 mir_event_type_keymap,
47 mir_event_type_input_configuration,51 mir_event_type_input_configuration,
48 mir_event_type_surface_output,52 mir_event_type_surface_output, /* __attribute__ ((deprecated("use mir_event_type_window_output instead"))), */
53 mir_event_type_window_output = mir_event_type_surface_output,
49 mir_event_type_input_device_state,54 mir_event_type_input_device_state,
50 mir_event_type_surface_placement,55 mir_event_type_surface_placement, /*__attribute__ ((deprecated("use mir_event_type_window_placement instead"))), */
56 mir_event_type_window_placement = mir_event_type_surface_placement,
51} MirEventType;57} MirEventType;
58#pragma GCC diagnostic pop
5259
53typedef struct MirSurfaceEvent MirSurfaceEvent;60typedef struct MirSurfaceEvent MirSurfaceEvent; /* __attribute__ ((deprecated("use MirWindowEvent instead"))); */
61typedef struct MirSurfaceEvent MirWindowEvent;
54typedef struct MirResizeEvent MirResizeEvent;62typedef struct MirResizeEvent MirResizeEvent;
55typedef struct MirPromptSessionEvent MirPromptSessionEvent;63typedef struct MirPromptSessionEvent MirPromptSessionEvent;
56typedef struct MirOrientationEvent MirOrientationEvent;64typedef struct MirOrientationEvent MirOrientationEvent;
57typedef struct MirCloseSurfaceEvent MirCloseSurfaceEvent;65typedef struct MirCloseSurfaceEvent MirCloseSurfaceEvent; /* __attribute__ ((deprecated("use MirCloseWindowEvent instead"))); */
66typedef struct MirCloseSurfaceEvent MirCloseWindowEvent;
58typedef struct MirInputEvent MirInputEvent;67typedef struct MirInputEvent MirInputEvent;
59typedef struct MirKeymapEvent MirKeymapEvent;68typedef struct MirKeymapEvent MirKeymapEvent;
60typedef struct MirInputConfigurationEvent MirInputConfigurationEvent;69typedef struct MirInputConfigurationEvent MirInputConfigurationEvent;
61typedef struct MirSurfaceOutputEvent MirSurfaceOutputEvent;70typedef struct MirSurfaceOutputEvent MirSurfaceOutputEvent; /* __attribute__ ((deprecated("use MirWindowOutputEvent instead"))); */
71typedef struct MirSurfaceOutputEvent MirWindowOutputEvent;
62typedef struct MirInputDeviceStateEvent MirInputDeviceStateEvent;72typedef struct MirInputDeviceStateEvent MirInputDeviceStateEvent;
63typedef struct MirSurfacePlacementEvent MirSurfacePlacementEvent;73typedef struct MirSurfacePlacementEvent MirSurfacePlacementEvent; /* __attribute__ ((deprecated("use MirWindowPlacementEvent instead"))); */
74typedef struct MirSurfacePlacementEvent MirWindowPlacementEvent;
6475
65typedef struct MirCookie MirCookie;76typedef struct MirCookie MirCookie;
6677
@@ -74,11 +85,13 @@
74#include "mir_toolkit/events/input/input_event.h"85#include "mir_toolkit/events/input/input_event.h"
75#include "mir_toolkit/events/resize_event.h"86#include "mir_toolkit/events/resize_event.h"
76#include "mir_toolkit/events/surface_event.h"87#include "mir_toolkit/events/surface_event.h"
88#include "mir_toolkit/events/window_event.h"
77#include "mir_toolkit/events/orientation_event.h"89#include "mir_toolkit/events/orientation_event.h"
78#include "mir_toolkit/events/prompt_session_event.h"90#include "mir_toolkit/events/prompt_session_event.h"
79#include "mir_toolkit/events/keymap_event.h"91#include "mir_toolkit/events/keymap_event.h"
80#include "mir_toolkit/events/input_configuration_event.h"92#include "mir_toolkit/events/input_configuration_event.h"
81#include "mir_toolkit/events/surface_output_event.h"93#include "mir_toolkit/events/surface_output_event.h"
94#include "mir_toolkit/events/window_output_event.h"
82#include "mir_toolkit/events/input_device_state_event.h"95#include "mir_toolkit/events/input_device_state_event.h"
8396
84#ifdef __cplusplus97#ifdef __cplusplus
@@ -118,6 +131,17 @@
118 * \return The associated MirSurfaceEvent131 * \return The associated MirSurfaceEvent
119 */132 */
120MirSurfaceEvent const* mir_event_get_surface_event(MirEvent const* event);133MirSurfaceEvent const* mir_event_get_surface_event(MirEvent const* event);
134/* __attribute__ ((deprecated("use mir_event_get_window_event instead"))); */
135
136/**
137 * Retrieve the MirWindowEvent associated with a MirEvent of
138 * type mir_event_type_window. See <mir_toolkit/events/surface_event.h>
139 * for accessors.
140 *
141 * \param [in] event The event
142 * \return The associated MirWindowEvent
143 */
144MirWindowEvent const* mir_event_get_window_event(MirEvent const* event);
121145
122/**146/**
123 * Retrieve the MirResizeEvent associated with a MirEvent of147 * Retrieve the MirResizeEvent associated with a MirEvent of
@@ -206,6 +230,22 @@
206 * \return The associated MirSurfaceOutputEvent230 * \return The associated MirSurfaceOutputEvent
207 */231 */
208MirSurfaceOutputEvent const* mir_event_get_surface_output_event(MirEvent const* event);232MirSurfaceOutputEvent const* mir_event_get_surface_output_event(MirEvent const* event);
233/* __attribute__((deprecated("use mir_event_get_window_output_event))) */
234
235/**
236 * Retrieve the MirWindowOutputEvent associated with a MirEvent of type
237 * mir_event_type_window_output. The event signifies that the properties
238 * of the output the window is displayed upon have changed.
239 *
240 * A MirWindowOutputEvent is generated either when the properties of the
241 * output the window is primarily on change (for example: by user configuration
242 * of resolution) or when the output the window is primarily on changes
243 * (for example: when a user moves the window from one monitor to another).
244 *
245 * \param [in] event The event
246 * \return The associated MirWindowOutputEvent
247 */
248MirWindowOutputEvent const* mir_event_get_window_output_event(MirEvent const* event);
209249
210/**250/**
211 * Retrieve the MirInputDeviceStateEvent associated with a MirEvent of251 * Retrieve the MirInputDeviceStateEvent associated with a MirEvent of
@@ -228,6 +268,16 @@
228 */268 */
229MirSurfacePlacementEvent const* mir_event_get_surface_placement_event(MirEvent const* event);269MirSurfacePlacementEvent const* mir_event_get_surface_placement_event(MirEvent const* event);
230270
271/**
272 * Retrieve the MirWindowPlacementEvent associated with a MirEvent of
273 * type mir_event_type_window_placement. The event signifies that the
274 * the server has fulfilled a request for relative window placement.
275 *
276 * \param [in] event The event
277 * \return The associated MirWindowPlacementEvent
278 */
279MirWindowPlacementEvent const* mir_event_get_window_placement_event(MirEvent const* event);
280
231/*281/*
232 * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!282 * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
233 * _________________________283 * _________________________
234284
=== modified file 'include/client/mir_toolkit/events/surface_event.h'
--- include/client/mir_toolkit/events/surface_event.h 2016-10-12 06:03:15 +0000
+++ include/client/mir_toolkit/events/surface_event.h 2017-01-10 20:52:04 +0000
@@ -36,6 +36,7 @@
36 * \return The associated attribute36 * \return The associated attribute
37 */37 */
38MirSurfaceAttrib mir_surface_event_get_attribute(MirSurfaceEvent const* event);38MirSurfaceAttrib mir_surface_event_get_attribute(MirSurfaceEvent const* event);
39/* __attribute__ ((deprecated("use make_event with mir_window_event_get_attribute instead"))); */
3940
40/**41/**
41 * Retrieve the new value of the associated attribute for a given MirSurfaceEvent42 * Retrieve the new value of the associated attribute for a given MirSurfaceEvent
@@ -44,6 +45,7 @@
44 * \return The associated attribute value45 * \return The associated attribute value
45 */46 */
46int mir_surface_event_get_attribute_value(MirSurfaceEvent const* event);47int mir_surface_event_get_attribute_value(MirSurfaceEvent const* event);
48/* __attribute__ ((deprecated("use make_event with mir_window_event_get_attribute_value instead"))); */
4749
48#ifdef __cplusplus50#ifdef __cplusplus
49}51}
5052
=== added file 'include/client/mir_toolkit/events/window_event.h'
--- include/client/mir_toolkit/events/window_event.h 1970-01-01 00:00:00 +0000
+++ include/client/mir_toolkit/events/window_event.h 2017-01-10 20:52:04 +0000
@@ -0,0 +1,53 @@
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 * Authored by: Brandon Schaefer <brandon.schaefer@canonical.com>
17 */
18
19#ifndef MIR_TOOLKIT_EVENTS_WINDOW_EVENT_H_
20#define MIR_TOOLKIT_EVENTS_WINDOW_EVENT_H_
21
22#include <mir_toolkit/events/event.h>
23
24#ifdef __cplusplus
25/**
26 * \addtogroup mir_toolkit
27 * @{
28 */
29extern "C" {
30#endif
31
32/**
33 * Retrieve the attribute index configured with a given MirWindowEvent
34 *
35 * \param [in] event The event
36 * \return The associated attribute
37 */
38MirWindowAttrib mir_window_event_get_attribute(MirWindowEvent const* event);
39
40/**
41 * Retrieve the new value of the associated attribute for a given MirWindowEvent
42 *
43 * \param [in] event The event
44 * \return The associated attribute value
45 */
46int mir_window_event_get_attribute_value(MirWindowEvent const* event);
47
48#ifdef __cplusplus
49}
50/**@}*/
51#endif
52
53#endif /* MIR_TOOLKIT_WINDOW_EVENT_H_ */
054
=== added file 'include/client/mir_toolkit/events/window_output_event.h'
--- include/client/mir_toolkit/events/window_output_event.h 1970-01-01 00:00:00 +0000
+++ include/client/mir_toolkit/events/window_output_event.h 2017-01-10 20:52:04 +0000
@@ -0,0 +1,83 @@
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 * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
17 *
18 */
19
20#ifndef MIR_TOOLKIT_WINDOW_OUTPUT_EVENT_H_
21#define MIR_TOOLKIT_WINDOW_OUTPUT_EVENT_H_
22
23#include <mir_toolkit/events/event.h>
24
25#ifdef __cplusplus
26/**
27 * \addtogroup mir_toolkit
28 * @{
29 */
30extern "C" {
31#endif
32
33/**
34 * Retrieve the DPI of the new output configuration of a MirWindowOutputEvent
35 *
36 * \param [in] ev The event
37 * \return The new DPI value for the window is primarily on.
38 */
39int mir_window_output_event_get_dpi(MirWindowOutputEvent const* ev);
40
41/**
42 * Retrieve the form factor of the new output configuration of a MirWindowOutputEvent
43 *
44 * \param [in] ev The event
45 * \return The new form factor of the output the window is primarily on.
46 */
47MirFormFactor mir_window_output_event_get_form_factor(MirWindowOutputEvent const* ev);
48
49/**
50 * Retrieve the suggested scaling factor of the new output configuration of a
51 * MirWindowOutputEvent.
52 *
53 * \param [in] ev The event
54 * \return The new scaling factor of the output the window is primarily on.
55 */
56float mir_window_output_event_get_scale(MirWindowOutputEvent const* ev);
57
58/**
59 * Retrieve the maximum refresh rate of the output(s) associated with a
60 * MirWindowOutputEvent. For variable refresh rate displays this represents
61 * the maximum refresh rate of the display to aim for, rather than a measurement
62 * of recent performance.
63 *
64 * \param [in] ev The event
65 * \return The refresh rate in Hz
66 */
67double mir_window_output_event_get_refresh_rate(MirWindowOutputEvent const* ev);
68
69/**
70 * Retrieve the ID of the output this window is on from a MirWindowOutputEvent
71 *
72 * \param [in] ev The event
73 * \return The ID of the output the window is currently considered to be on.
74 * (From MirDisplayOutput::output_id)
75 */
76uint32_t mir_window_output_event_get_output_id(MirWindowOutputEvent const *ev);
77
78#ifdef __cplusplus
79}
80/**@}*/
81#endif
82
83#endif //MIR_TOOLKIT_WINDOW_OUTPUT_EVENT_H_
084
=== added file 'include/client/mir_toolkit/events/window_placement.h'
--- include/client/mir_toolkit/events/window_placement.h 1970-01-01 00:00:00 +0000
+++ include/client/mir_toolkit/events/window_placement.h 2017-01-10 20:52:04 +0000
@@ -0,0 +1,47 @@
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 * Authored by: Alan Griffiths <alan@octopull.co.uk>
17 */
18
19#ifndef MIR_TOOLKIT_WINDOW_PLACEMENT_H_
20#define MIR_TOOLKIT_WINDOW_PLACEMENT_H_
21
22#include <mir_toolkit/client_types.h>
23
24#ifdef __cplusplus
25/**
26 * \addtogroup mir_toolkit
27 * @{
28 */
29extern "C" {
30#endif
31
32typedef struct MirSurfacePlacementEvent MirWindowPlacementEvent;
33
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 window
39 */
40MirRectangle mir_window_placement_get_relative_position(MirWindowPlacementEvent const* event);
41
42#ifdef __cplusplus
43}
44/**@}*/
45#endif
46
47#endif //MIR_TOOLKIT_WINDOW_PLACEMENT_H_
048
=== modified file 'include/client/mir_toolkit/mir_surface.h'
--- include/client/mir_toolkit/mir_surface.h 2017-01-09 06:48:47 +0000
+++ include/client/mir_toolkit/mir_surface.h 2017-01-10 20:52:04 +0000
@@ -208,7 +208,7 @@
208 * \param [in] spec Specification to mutate208 * \param [in] spec Specification to mutate
209 * \param [in] type the target type of the window209 * \param [in] type the target type of the window
210 */210 */
211void mir_window_spec_set_type(MirWindowSpec* spec, MirSurfaceType type);211void mir_window_spec_set_type(MirWindowSpec* spec, MirWindowType type);
212212
213/**213/**
214 * Set the requested name.214 * Set the requested name.
@@ -667,6 +667,13 @@
667 */667 */
668void mir_window_raise(MirWindow* window, MirCookie const* cookie);668void mir_window_raise(MirWindow* window, MirCookie const* cookie);
669669
670/**
671 * Get the type (purpose) of a window.
672 * \param [in] window The window to query
673 * \return The type of the window
674 */
675MirWindowType mir_window_get_type(MirWindow* window);
676
670// Functions in this pragma section are to be deprecated677// Functions in this pragma section are to be deprecated
671//#pragma GCC diagnostic push678//#pragma GCC diagnostic push
672//#pragma GCC diagnostic ignored "-Wdeprecated-declarations"679//#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
@@ -870,12 +877,8 @@
870void mir_surface_get_parameters(MirSurface *surface, MirSurfaceParameters *parameters);877void mir_surface_get_parameters(MirSurface *surface, MirSurfaceParameters *parameters);
871//__attribute__((deprecated("use mir_window_get_parameters() instead")));878//__attribute__((deprecated("use mir_window_get_parameters() instead")));
872879
873/**880MirSurfaceType mir_surface_get_type(MirSurface* surface);
874 * Get the type (purpose) of a surface.881//__attribute__((deprecated("use mir_window_get_type() instead")));
875 * \param [in] surface The surface to query
876 * \return The type of the surface
877 */
878MirSurfaceType mir_surface_get_type(MirSurface *surface);
879882
880/**883/**
881 * Change the state of a surface.884 * Change the state of a surface.
882885
=== modified file 'include/core/mir_toolkit/common.h'
--- include/core/mir_toolkit/common.h 2016-11-11 07:56:09 +0000
+++ include/core/mir_toolkit/common.h 2017-01-10 20:52:04 +0000
@@ -43,7 +43,25 @@
43 mir_surface_attrib_preferred_orientation,43 mir_surface_attrib_preferred_orientation,
44 /* Must be last */44 /* Must be last */
45 mir_surface_attribs45 mir_surface_attribs
46} MirSurfaceAttrib;46} MirSurfaceAttrib; /* __attribute__ ((deprecated("use MirWindowAttrib"))); */
47
48/**
49 * Attributes of a window that the client and server/shell may wish to
50 * get or set over the wire.
51 */
52typedef enum MirWindowAttrib
53{
54 /* Do not specify values...code relies on 0...N ordering. */
55 mir_window_attrib_type,
56 mir_window_attrib_state,
57 mir_window_attrib_swapinterval,
58 mir_window_attrib_focus,
59 mir_window_attrib_dpi,
60 mir_window_attrib_visibility,
61 mir_window_attrib_preferred_orientation,
62 /* Must be last */
63 mir_window_attribs
64} MirWindowAttrib;
4765
48typedef enum MirSurfaceType66typedef enum MirSurfaceType
49{67{
@@ -59,7 +77,23 @@
59 mir_surface_type_satellite, /**< AKA "toolbox"/"toolbar" */77 mir_surface_type_satellite, /**< AKA "toolbox"/"toolbar" */
60 mir_surface_type_tip, /**< AKA "tooltip" */78 mir_surface_type_tip, /**< AKA "tooltip" */
61 mir_surface_types79 mir_surface_types
62} MirSurfaceType;80} MirSurfaceType; /* __attribute__ ((deprecated("use MirWindowType"))); */
81
82typedef enum MirWindowType
83{
84 mir_window_type_normal, /**< AKA "regular" */
85 mir_window_type_utility, /**< AKA "floating" */
86 mir_window_type_dialog,
87 mir_window_type_overlay, /**< \deprecated Use "gloss" instead. */
88 mir_window_type_gloss = mir_window_type_overlay,
89 mir_window_type_freestyle,
90 mir_window_type_popover, /**< \deprecated Choose "menu" or "tip" */
91 mir_window_type_menu = mir_window_type_popover,
92 mir_window_type_inputmethod, /**< AKA "OSK" or handwriting etc. */
93 mir_window_type_satellite, /**< AKA "toolbox"/"toolbar" */
94 mir_window_type_tip, /**< AKA "tooltip" */
95 mir_window_types
96} MirWindowType;
6397
64typedef enum MirSurfaceState98typedef enum MirSurfaceState
65{99{
66100
=== modified file 'include/server/mir/scene/null_surface_observer.h'
--- include/server/mir/scene/null_surface_observer.h 2016-10-31 02:37:31 +0000
+++ include/server/mir/scene/null_surface_observer.h 2017-01-10 20:52:04 +0000
@@ -31,7 +31,7 @@
31 NullSurfaceObserver() = default;31 NullSurfaceObserver() = default;
32 virtual ~NullSurfaceObserver() = default;32 virtual ~NullSurfaceObserver() = default;
3333
34 void attrib_changed(MirSurfaceAttrib attrib, int value) override;34 void attrib_changed(MirWindowAttrib attrib, int value) override;
35 void resized_to(geometry::Size const& size) override;35 void resized_to(geometry::Size const& size) override;
36 void moved_to(geometry::Point const& top_left) override;36 void moved_to(geometry::Point const& top_left) override;
37 void hidden_set_to(bool hide) override;37 void hidden_set_to(bool hide) override;
3838
=== modified file 'include/server/mir/scene/surface.h'
--- include/server/mir/scene/surface.h 2016-11-11 07:56:09 +0000
+++ include/server/mir/scene/surface.h 2017-01-10 20:52:04 +0000
@@ -68,7 +68,7 @@
68 virtual int buffers_ready_for_compositor(void const* compositor_id) const = 0;68 virtual int buffers_ready_for_compositor(void const* compositor_id) const = 0;
6969
70 virtual float alpha() const = 0; //only used in examples/70 virtual float alpha() const = 0; //only used in examples/
71 virtual MirSurfaceType type() const = 0;71 virtual MirWindowType type() const = 0;
72 virtual MirSurfaceState state() const = 0;72 virtual MirSurfaceState state() const = 0;
73 virtual void hide() = 0;73 virtual void hide() = 0;
74 virtual void show() = 0;74 virtual void show() = 0;
@@ -107,9 +107,9 @@
107 virtual std::shared_ptr<Surface> parent() const = 0;107 virtual std::shared_ptr<Surface> parent() const = 0;
108108
109 // TODO a legacy of old interactions and needs removing109 // TODO a legacy of old interactions and needs removing
110 virtual int configure(MirSurfaceAttrib attrib, int value) = 0;110 virtual int configure(MirWindowAttrib attrib, int value) = 0;
111 // TODO a legacy of old interactions and needs removing111 // TODO a legacy of old interactions and needs removing
112 virtual int query(MirSurfaceAttrib attrib) const = 0;112 virtual int query(MirWindowAttrib attrib) const = 0;
113113
114 virtual void set_keymap(MirInputDeviceId id, std::string const& model, std::string const& layout,114 virtual void set_keymap(MirInputDeviceId id, std::string const& model, std::string const& layout,
115 std::string const& variant, std::string const& options) = 0;115 std::string const& variant, std::string const& options) = 0;
116116
=== modified file 'include/server/mir/scene/surface_creation_parameters.h'
--- include/server/mir/scene/surface_creation_parameters.h 2016-10-12 06:03:15 +0000
+++ include/server/mir/scene/surface_creation_parameters.h 2017-01-10 20:52:04 +0000
@@ -58,7 +58,7 @@
5858
59 SurfaceCreationParameters& with_output_id(graphics::DisplayConfigurationOutputId const& output_id);59 SurfaceCreationParameters& with_output_id(graphics::DisplayConfigurationOutputId const& output_id);
6060
61 SurfaceCreationParameters& of_type(MirSurfaceType type);61 SurfaceCreationParameters& of_type(MirWindowType type);
6262
63 SurfaceCreationParameters& with_state(MirSurfaceState state);63 SurfaceCreationParameters& with_state(MirSurfaceState state);
6464
@@ -81,7 +81,7 @@
81 graphics::DisplayConfigurationOutputId output_id;81 graphics::DisplayConfigurationOutputId output_id;
8282
83 mir::optional_value<MirSurfaceState> state;83 mir::optional_value<MirSurfaceState> state;
84 mir::optional_value<MirSurfaceType> type;84 mir::optional_value<MirWindowType> type;
85 mir::optional_value<MirOrientationMode> preferred_orientation;85 mir::optional_value<MirOrientationMode> preferred_orientation;
86 mir::optional_value<frontend::SurfaceId> parent_id;86 mir::optional_value<frontend::SurfaceId> parent_id;
87 mir::optional_value<frontend::BufferStreamId> content_id;87 mir::optional_value<frontend::BufferStreamId> content_id;
8888
=== modified file 'include/server/mir/scene/surface_observer.h'
--- include/server/mir/scene/surface_observer.h 2016-10-31 02:37:31 +0000
+++ include/server/mir/scene/surface_observer.h 2017-01-10 20:52:04 +0000
@@ -45,7 +45,7 @@
45class SurfaceObserver45class SurfaceObserver
46{46{
47public:47public:
48 virtual void attrib_changed(MirSurfaceAttrib attrib, int value) = 0;48 virtual void attrib_changed(MirWindowAttrib attrib, int value) = 0;
49 virtual void resized_to(geometry::Size const& size) = 0;49 virtual void resized_to(geometry::Size const& size) = 0;
50 virtual void moved_to(geometry::Point const& top_left) = 0;50 virtual void moved_to(geometry::Point const& top_left) = 0;
51 virtual void hidden_set_to(bool hide) = 0;51 virtual void hidden_set_to(bool hide) = 0;
5252
=== modified file 'include/server/mir/shell/abstract_shell.h'
--- include/server/mir/shell/abstract_shell.h 2016-08-02 19:44:59 +0000
+++ include/server/mir/shell/abstract_shell.h 2017-01-10 20:52:04 +0000
@@ -70,12 +70,12 @@
70 int set_surface_attribute(70 int set_surface_attribute(
71 std::shared_ptr<scene::Session> const& session,71 std::shared_ptr<scene::Session> const& session,
72 std::shared_ptr<scene::Surface> const& surface,72 std::shared_ptr<scene::Surface> const& surface,
73 MirSurfaceAttrib attrib,73 MirWindowAttrib attrib,
74 int value) override;74 int value) override;
7575
76 int get_surface_attribute(76 int get_surface_attribute(
77 std::shared_ptr<scene::Surface> const& surface,77 std::shared_ptr<scene::Surface> const& surface,
78 MirSurfaceAttrib attrib) override;78 MirWindowAttrib attrib) override;
7979
80 void raise_surface(80 void raise_surface(
81 std::shared_ptr<scene::Session> const& session,81 std::shared_ptr<scene::Session> const& session,
8282
=== modified file 'include/server/mir/shell/shell.h'
--- include/server/mir/shell/shell.h 2016-01-29 08:18:22 +0000
+++ include/server/mir/shell/shell.h 2017-01-10 20:52:04 +0000
@@ -88,12 +88,12 @@
88 virtual int set_surface_attribute(88 virtual int set_surface_attribute(
89 std::shared_ptr<scene::Session> const& session,89 std::shared_ptr<scene::Session> const& session,
90 std::shared_ptr<scene::Surface> const& surface,90 std::shared_ptr<scene::Surface> const& surface,
91 MirSurfaceAttrib attrib,91 MirWindowAttrib attrib,
92 int value) = 0;92 int value) = 0;
9393
94 virtual int get_surface_attribute(94 virtual int get_surface_attribute(
95 std::shared_ptr<scene::Surface> const& surface,95 std::shared_ptr<scene::Surface> const& surface,
96 MirSurfaceAttrib attrib) = 0;96 MirWindowAttrib attrib) = 0;
9797
98 virtual void raise_surface(98 virtual void raise_surface(
99 std::shared_ptr<scene::Session> const& session,99 std::shared_ptr<scene::Session> const& session,
100100
=== modified file 'include/server/mir/shell/shell_report.h'
--- include/server/mir/shell/shell_report.h 2016-09-08 02:58:56 +0000
+++ include/server/mir/shell/shell_report.h 2017-01-10 20:52:04 +0000
@@ -54,7 +54,7 @@
5454
55 virtual void update_surface(55 virtual void update_surface(
56 scene::Session const& session, scene::Surface const& surface,56 scene::Session const& session, scene::Surface const& surface,
57 MirSurfaceAttrib attrib, int value) = 0;57 MirWindowAttrib attrib, int value) = 0;
5858
59 virtual void destroying_surface(59 virtual void destroying_surface(
60 scene::Session const& session, frontend::SurfaceId surface) = 0;60 scene::Session const& session, frontend::SurfaceId surface) = 0;
6161
=== modified file 'include/server/mir/shell/shell_wrapper.h'
--- include/server/mir/shell/shell_wrapper.h 2016-01-29 08:18:22 +0000
+++ include/server/mir/shell/shell_wrapper.h 2017-01-10 20:52:04 +0000
@@ -73,12 +73,12 @@
73 int set_surface_attribute(73 int set_surface_attribute(
74 std::shared_ptr<scene::Session> const& session,74 std::shared_ptr<scene::Session> const& session,
75 std::shared_ptr<scene::Surface> const& surface,75 std::shared_ptr<scene::Surface> const& surface,
76 MirSurfaceAttrib attrib,76 MirWindowAttrib attrib,
77 int value) override;77 int value) override;
7878
79 int get_surface_attribute(79 int get_surface_attribute(
80 std::shared_ptr<scene::Surface> const& surface,80 std::shared_ptr<scene::Surface> const& surface,
81 MirSurfaceAttrib attrib) override;81 MirWindowAttrib attrib) override;
8282
83 void raise_surface(83 void raise_surface(
84 std::shared_ptr<scene::Session> const& session,84 std::shared_ptr<scene::Session> const& session,
8585
=== modified file 'include/server/mir/shell/surface_specification.h'
--- include/server/mir/shell/surface_specification.h 2016-12-09 02:54:31 +0000
+++ include/server/mir/shell/surface_specification.h 2017-01-10 20:52:04 +0000
@@ -64,7 +64,7 @@
64 optional_value<graphics::BufferUsage> buffer_usage;64 optional_value<graphics::BufferUsage> buffer_usage;
65 optional_value<std::string> name;65 optional_value<std::string> name;
66 optional_value<graphics::DisplayConfigurationOutputId> output_id;66 optional_value<graphics::DisplayConfigurationOutputId> output_id;
67 optional_value<MirSurfaceType> type;67 optional_value<MirWindowType> type;
68 optional_value<MirSurfaceState> state;68 optional_value<MirSurfaceState> state;
69 optional_value<MirOrientationMode> preferred_orientation;69 optional_value<MirOrientationMode> preferred_orientation;
70 optional_value<frontend::SurfaceId> parent_id;70 optional_value<frontend::SurfaceId> parent_id;
7171
=== modified file 'include/server/mir/shell/system_compositor_window_manager.h'
--- include/server/mir/shell/system_compositor_window_manager.h 2016-01-29 08:18:22 +0000
+++ include/server/mir/shell/system_compositor_window_manager.h 2017-01-10 20:52:04 +0000
@@ -98,7 +98,7 @@
98 int set_surface_attribute(98 int set_surface_attribute(
99 std::shared_ptr<scene::Session> const& session,99 std::shared_ptr<scene::Session> const& session,
100 std::shared_ptr<scene::Surface> const& surface,100 std::shared_ptr<scene::Surface> const& surface,
101 MirSurfaceAttrib attrib,101 MirWindowAttrib attrib,
102 int value) override;102 int value) override;
103103
104 using OutputMap = std::map<std::weak_ptr<scene::Surface>, graphics::DisplayConfigurationOutputId, std::owner_less<std::weak_ptr<scene::Surface>>>;104 using OutputMap = std::map<std::weak_ptr<scene::Surface>, graphics::DisplayConfigurationOutputId, std::owner_less<std::weak_ptr<scene::Surface>>>;
105105
=== modified file 'include/server/mir/shell/window_manager.h'
--- include/server/mir/shell/window_manager.h 2016-01-29 08:18:22 +0000
+++ include/server/mir/shell/window_manager.h 2017-01-10 20:52:04 +0000
@@ -68,7 +68,7 @@
68 virtual int set_surface_attribute(68 virtual int set_surface_attribute(
69 std::shared_ptr<scene::Session> const& session,69 std::shared_ptr<scene::Session> const& session,
70 std::shared_ptr<scene::Surface> const& surface,70 std::shared_ptr<scene::Surface> const& surface,
71 MirSurfaceAttrib attrib,71 MirWindowAttrib attrib,
72 int value) = 0;72 int value) = 0;
7373
74 virtual void handle_raise_surface(74 virtual void handle_raise_surface(
7575
=== modified file 'include/test/mir/test/doubles/mock_window_manager.h'
--- include/test/mir/test/doubles/mock_window_manager.h 2016-01-29 08:18:22 +0000
+++ include/test/mir/test/doubles/mock_window_manager.h 2017-01-10 20:52:04 +0000
@@ -62,7 +62,7 @@
62 MOCK_METHOD4(set_surface_attribute,62 MOCK_METHOD4(set_surface_attribute,
63 int(std::shared_ptr<scene::Session> const& session,63 int(std::shared_ptr<scene::Session> const& session,
64 std::shared_ptr<scene::Surface> const& surface,64 std::shared_ptr<scene::Surface> const& surface,
65 MirSurfaceAttrib attrib,65 MirWindowAttrib attrib,
66 int value));66 int value));
6767
68 static frontend::SurfaceId add_surface_default(68 static frontend::SurfaceId add_surface_default(
6969
=== modified file 'include/test/mir/test/doubles/stub_surface.h'
--- include/test/mir/test/doubles/stub_surface.h 2016-10-31 02:37:31 +0000
+++ include/test/mir/test/doubles/stub_surface.h 2017-01-10 20:52:04 +0000
@@ -54,10 +54,10 @@
54 bool visible() const override;54 bool visible() const override;
55 graphics::RenderableList generate_renderables(compositor::CompositorID id) const override;55 graphics::RenderableList generate_renderables(compositor::CompositorID id) const override;
56 int buffers_ready_for_compositor(void const* compositor_id) const override;56 int buffers_ready_for_compositor(void const* compositor_id) const override;
57 MirSurfaceType type() const override;57 MirWindowType type() const override;
58 MirSurfaceState state() const override;58 MirSurfaceState state() const override;
59 int configure(MirSurfaceAttrib attrib, int value) override;59 int configure(MirWindowAttrib attrib, int value) override;
60 int query(MirSurfaceAttrib attrib) const override;60 int query(MirWindowAttrib attrib) const override;
61 void hide() override;61 void hide() override;
62 void show() override;62 void show() override;
63 void set_cursor_image(std::shared_ptr<graphics::CursorImage> const& image) override;63 void set_cursor_image(std::shared_ptr<graphics::CursorImage> const& image) override;
6464
=== modified file 'include/test/mir/test/event_matchers.h'
--- include/test/mir/test/event_matchers.h 2017-01-06 03:31:04 +0000
+++ include/test/mir/test/event_matchers.h 2017-01-10 20:52:04 +0000
@@ -488,15 +488,16 @@
488 return true;488 return true;
489}489}
490490
491MATCHER_P2(SurfaceEvent, attrib, value, "")491MATCHER_P2(WindowEvent, attrib, value, "")
492{492{
493 auto as_address = to_address(arg);493 auto as_address = to_address(arg);
494 if (mir_event_get_type(as_address) != mir_event_type_surface)494 if (mir_event_get_type(as_address) != mir_event_type_window)
495 return false;495 return false;
496 auto surface_ev = mir_event_get_surface_event(as_address);496 auto surface_ev = mir_event_get_window_event(as_address);
497 if (mir_surface_event_get_attribute(surface_ev) != attrib)497 auto window_attrib = mir_window_event_get_attribute(surface_ev);
498 return false;498 if (window_attrib != attrib)
499 if (mir_surface_event_get_attribute_value(surface_ev) != value)499 return false;
500 if (mir_window_event_get_attribute_value(surface_ev) != value)
500 return false;501 return false;
501 return true;502 return true;
502}503}
503504
=== modified file 'src/client/buffer_stream.cpp'
--- src/client/buffer_stream.cpp 2017-01-09 06:48:47 +0000
+++ src/client/buffer_stream.cpp 2017-01-10 20:52:04 +0000
@@ -411,12 +411,12 @@
411 swap_buffers([](){})->wait_for_all();411 swap_buffers([](){})->wait_for_all();
412}412}
413413
414void mcl::BufferStream::request_and_wait_for_configure(MirSurfaceAttrib attrib, int interval)414void mcl::BufferStream::request_and_wait_for_configure(MirWindowAttrib attrib, int interval)
415{415{
416 if (attrib != mir_surface_attrib_swapinterval)416 if (attrib != mir_window_attrib_swapinterval)
417 {417 {
418 BOOST_THROW_EXCEPTION(std::logic_error("Attempt to configure surface attribute " + std::to_string(attrib) +418 BOOST_THROW_EXCEPTION(std::logic_error("Attempt to configure surface attribute " + std::to_string(attrib) +
419 " on BufferStream but only mir_surface_attrib_swapinterval is supported")); 419 " on BufferStream but only mir_window_attrib_swapinterval is supported"));
420 }420 }
421 mir_wait_for(set_swap_interval(interval));421 mir_wait_for(set_swap_interval(interval));
422}422}
423423
=== modified file 'src/client/buffer_stream.h'
--- src/client/buffer_stream.h 2017-01-09 06:48:47 +0000
+++ src/client/buffer_stream.h 2017-01-10 20:52:04 +0000
@@ -106,7 +106,7 @@
106 MirWindowParameters get_parameters() const override;106 MirWindowParameters get_parameters() const override;
107 void swap_buffers_sync() override;107 void swap_buffers_sync() override;
108108
109 void request_and_wait_for_configure(MirSurfaceAttrib attrib, int) override;109 void request_and_wait_for_configure(MirWindowAttrib attrib, int) override;
110110
111 MirNativeBuffer* get_current_buffer_package() override;111 MirNativeBuffer* get_current_buffer_package() override;
112112
113113
=== modified file 'src/client/event.cpp'
--- src/client/event.cpp 2016-11-11 07:56:09 +0000
+++ src/client/event.cpp 2017-01-10 20:52:04 +0000
@@ -33,6 +33,7 @@
33#include "mir_toolkit/events/orientation_event.h"33#include "mir_toolkit/events/orientation_event.h"
34#include "mir_toolkit/events/input_device_state_event.h"34#include "mir_toolkit/events/input_device_state_event.h"
35#include "mir_toolkit/events/surface_placement.h"35#include "mir_toolkit/events/surface_placement.h"
36#include "mir_toolkit/events/window_placement.h"
3637
37#include <cstdlib>38#include <cstdlib>
38#include <cstring>39#include <cstring>
@@ -71,20 +72,22 @@
71 return "mir_event_type_key";72 return "mir_event_type_key";
72 case mir_event_type_motion:73 case mir_event_type_motion:
73 return "mir_event_type_motion";74 return "mir_event_type_motion";
74 case mir_event_type_surface:75 case mir_event_type_window:
75 return "mir_event_type_surface";76 return "mir_event_type_window";
76 case mir_event_type_resize:77 case mir_event_type_resize:
77 return "mir_event_type_resize";78 return "mir_event_type_resize";
78 case mir_event_type_prompt_session_state_change:79 case mir_event_type_prompt_session_state_change:
79 return "mir_event_type_prompt_session_state_change";80 return "mir_event_type_prompt_session_state_change";
80 case mir_event_type_orientation:81 case mir_event_type_orientation:
81 return "mir_event_type_orientation";82 return "mir_event_type_orientation";
82 case mir_event_type_close_surface:83 case mir_event_type_close_window:
83 return "mir_event_type_close_surface";84 return "mir_event_type_close_window";
84 case mir_event_type_input:85 case mir_event_type_input:
85 return "mir_event_type_input";86 return "mir_event_type_input";
86 case mir_event_type_input_device_state:87 case mir_event_type_input_device_state:
87 return "mir_event_type_input_device_state";88 return "mir_event_type_input_device_state";
89 case mir_event_type_window_output:
90 return "mir_event_type_window_output";
88 default:91 default:
89 abort();92 abort();
90 }93 }
@@ -111,7 +114,14 @@
111114
112MirSurfaceEvent const* mir_event_get_surface_event(MirEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(115MirSurfaceEvent const* mir_event_get_surface_event(MirEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
113{116{
114 expect_event_type(ev, mir_event_type_surface);117 expect_event_type(ev, mir_event_type_window);
118
119 return ev->to_surface();
120})
121
122MirWindowEvent const* mir_event_get_window_event(MirEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
123{
124 expect_event_type(ev, mir_event_type_window);
115125
116 return ev->to_surface();126 return ev->to_surface();
117})127})
@@ -139,7 +149,7 @@
139149
140MirCloseSurfaceEvent const* mir_event_get_close_surface_event(MirEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(150MirCloseSurfaceEvent const* mir_event_get_close_surface_event(MirEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
141{151{
142 expect_event_type(ev, mir_event_type_close_surface);152 expect_event_type(ev, mir_event_type_close_window);
143153
144 return ev->to_close_surface();154 return ev->to_close_surface();
145})155})
@@ -163,7 +173,14 @@
163173
164MirSurfaceOutputEvent const* mir_event_get_surface_output_event(MirEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(174MirSurfaceOutputEvent const* mir_event_get_surface_output_event(MirEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
165{175{
166 expect_event_type(ev, mir_event_type_surface_output);176 expect_event_type(ev, mir_event_type_window_output);
177
178 return ev->to_surface_output();
179})
180
181MirWindowOutputEvent const* mir_event_get_window_output_event(MirEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
182{
183 expect_event_type(ev, mir_event_type_window_output);
167184
168 return ev->to_surface_output();185 return ev->to_surface_output();
169})186})
@@ -179,14 +196,30 @@
179196
180MirSurfaceAttrib mir_surface_event_get_attribute(MirSurfaceEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(197MirSurfaceAttrib mir_surface_event_get_attribute(MirSurfaceEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
181{198{
182 expect_event_type(ev, mir_event_type_surface);199 expect_event_type(ev, mir_event_type_window);
200
201 return static_cast<MirSurfaceAttrib>(ev->attrib());
202})
203
204int mir_surface_event_get_attribute_value(MirSurfaceEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
205{
206 expect_event_type(ev, mir_event_type_window);
207
208 return ev->value();
209})
210
211/* Window event accessors */
212
213MirWindowAttrib mir_window_event_get_attribute(MirWindowEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
214{
215 expect_event_type(ev, mir_event_type_window);
183216
184 return ev->attrib();217 return ev->attrib();
185})218})
186219
187int mir_surface_event_get_attribute_value(MirSurfaceEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(220int mir_window_event_get_attribute_value(MirWindowEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
188{221{
189 expect_event_type(ev, mir_event_type_surface);222 expect_event_type(ev, mir_event_type_window);
190223
191 return ev->value();224 return ev->value();
192})225})
@@ -264,31 +297,63 @@
264297
265int mir_surface_output_event_get_dpi(MirSurfaceOutputEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(298int mir_surface_output_event_get_dpi(MirSurfaceOutputEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
266{299{
267 expect_event_type(ev, mir_event_type_surface_output);300 expect_event_type(ev, mir_event_type_window_output);
268 return ev->dpi();301 return ev->dpi();
269})302})
270303
271MirFormFactor mir_surface_output_event_get_form_factor(MirSurfaceOutputEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(304MirFormFactor mir_surface_output_event_get_form_factor(MirSurfaceOutputEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
272{305{
273 expect_event_type(ev, mir_event_type_surface_output);306 expect_event_type(ev, mir_event_type_window_output);
274 return ev->form_factor();307 return ev->form_factor();
275})308})
276309
277float mir_surface_output_event_get_scale(MirSurfaceOutputEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(310float mir_surface_output_event_get_scale(MirSurfaceOutputEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
278{311{
279 expect_event_type(ev, mir_event_type_surface_output);312 expect_event_type(ev, mir_event_type_window_output);
280 return ev->scale();313 return ev->scale();
281})314})
282315
283double mir_surface_output_event_get_refresh_rate(MirSurfaceOutputEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(316double mir_surface_output_event_get_refresh_rate(MirSurfaceOutputEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
284{317{
285 expect_event_type(ev, mir_event_type_surface_output);318 expect_event_type(ev, mir_event_type_window_output);
286 return ev->refresh_rate();319 return ev->refresh_rate();
287})320})
288321
289uint32_t mir_surface_output_event_get_output_id(MirSurfaceOutputEvent const *ev) MIR_HANDLE_EVENT_EXCEPTION(322uint32_t mir_surface_output_event_get_output_id(MirSurfaceOutputEvent const *ev) MIR_HANDLE_EVENT_EXCEPTION(
290{323{
291 expect_event_type(ev, mir_event_type_surface_output);324 expect_event_type(ev, mir_event_type_window_output);
325 return ev->output_id();
326})
327
328/* Window output event accessors */
329
330int mir_window_output_event_get_dpi(MirWindowOutputEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
331{
332 expect_event_type(ev, mir_event_type_window_output);
333 return ev->dpi();
334})
335
336MirFormFactor mir_window_output_event_get_form_factor(MirWindowOutputEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
337{
338 expect_event_type(ev, mir_event_type_window_output);
339 return ev->form_factor();
340})
341
342float mir_window_output_event_get_scale(MirWindowOutputEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
343{
344 expect_event_type(ev, mir_event_type_window_output);
345 return ev->scale();
346})
347
348double mir_window_output_event_get_refresh_rate(MirWindowOutputEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
349{
350 expect_event_type(ev, mir_event_type_window_output);
351 return ev->refresh_rate();
352})
353
354uint32_t mir_window_output_event_get_output_id(MirWindowOutputEvent const *ev) MIR_HANDLE_EVENT_EXCEPTION(
355{
356 expect_event_type(ev, mir_event_type_window_output);
292 return ev->output_id();357 return ev->output_id();
293})358})
294359
@@ -362,6 +427,16 @@
362 return event->placement();427 return event->placement();
363})428})
364429
430MirWindowPlacementEvent const* mir_event_get_window_placement_event(MirEvent const* event) MIR_HANDLE_EVENT_EXCEPTION(
431{
432 return event->to_surface_placement();
433})
434
435MirRectangle mir_window_placement_get_relative_position(MirWindowPlacementEvent const* event) MIR_HANDLE_EVENT_EXCEPTION(
436{
437 return event->placement();
438})
439
365// TODO: Until we opaquify the MirEvent structure and add440// TODO: Until we opaquify the MirEvent structure and add
366// a ref count ref is implemented as copy.441// a ref count ref is implemented as copy.
367MirEvent const* mir_event_ref(MirEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(442MirEvent const* mir_event_ref(MirEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION(
368443
=== modified file 'src/client/event_printer.cpp'
--- src/client/event_printer.cpp 2016-12-09 02:54:31 +0000
+++ src/client/event_printer.cpp 2017-01-10 20:52:04 +0000
@@ -146,6 +146,22 @@
146 }146 }
147}147}
148148
149std::ostream& mir::operator<<(std::ostream& out, MirWindowAttrib attribute)
150{
151 switch (attribute)
152 {
153 PRINT(mir_window_attrib,type);
154 PRINT(mir_window_attrib,dpi);
155 PRINT(mir_window_attrib,focus);
156 PRINT(mir_window_attrib,state);
157 PRINT(mir_window_attrib,visibility);
158 PRINT(mir_window_attrib,swapinterval);
159 PRINT(mir_window_attrib,preferred_orientation);
160 default:
161 return out << static_cast<int>(attribute) << "<INVALID>";
162 }
163}
164
149std::ostream& mir::operator<<(std::ostream& out, MirSurfaceFocusState state)165std::ostream& mir::operator<<(std::ostream& out, MirSurfaceFocusState state)
150{166{
151 switch (state)167 switch (state)
@@ -186,6 +202,24 @@
186 }202 }
187}203}
188204
205std::ostream& mir::operator<<(std::ostream& out, MirWindowType type)
206{
207 switch (type)
208 {
209 PRINT(mir_window_type,normal);
210 PRINT(mir_window_type,utility);
211 PRINT(mir_window_type,dialog);
212 PRINT(mir_window_type,gloss);
213 PRINT(mir_window_type,freestyle);
214 PRINT(mir_window_type,menu);
215 PRINT(mir_window_type,inputmethod);
216 PRINT(mir_window_type,satellite);
217 PRINT(mir_window_type,tip);
218 default:
219 return out << static_cast<int>(type) << "<INVALID>";
220 }
221}
222
189std::ostream& mir::operator<<(std::ostream& out, MirSurfaceState state)223std::ostream& mir::operator<<(std::ostream& out, MirSurfaceState state)
190{224{
191 switch (state)225 switch (state)
@@ -283,37 +317,37 @@
283 return out << "keymap_event(blob, device_id=" << mir_keymap_event_get_device_id(&event) << ")";317 return out << "keymap_event(blob, device_id=" << mir_keymap_event_get_device_id(&event) << ")";
284}318}
285319
286std::ostream& mir::operator<<(std::ostream& out, MirCloseSurfaceEvent const&)320std::ostream& mir::operator<<(std::ostream& out, MirCloseWindowEvent const&)
287{321{
288 return out << "close_surface_event()";322 return out << "close_surface_event()";
289}323}
290324
291std::ostream& mir::operator<<(std::ostream& out, MirSurfaceEvent const& event)325std::ostream& mir::operator<<(std::ostream& out, MirWindowEvent const& event)
292{326{
293 out << "surface_event("327 out << "window_event("
294 << mir_surface_event_get_attribute(&event)<< '=';328 << mir_window_event_get_attribute(&event)<< '=';
295 auto value = mir_surface_event_get_attribute_value(&event);329 auto value = mir_window_event_get_attribute_value(&event);
296 switch (mir_surface_event_get_attribute(&event))330 switch (mir_window_event_get_attribute(&event))
297 {331 {
298 case mir_surface_attrib_type:332 case mir_window_attrib_type:
299 out << static_cast<MirSurfaceType>(value);333 out << static_cast<MirWindowType>(value);
300 break;334 break;
301 case mir_surface_attrib_state:335 case mir_window_attrib_state:
302 out << static_cast<MirSurfaceState>(value);336 out << static_cast<MirSurfaceState>(value);
303 break;337 break;
304 case mir_surface_attrib_swapinterval:338 case mir_window_attrib_swapinterval:
305 out << value;339 out << value;
306 break;340 break;
307 case mir_surface_attrib_focus:341 case mir_window_attrib_focus:
308 out << static_cast<MirSurfaceFocusState>(value);342 out << static_cast<MirSurfaceFocusState>(value);
309 break;343 break;
310 case mir_surface_attrib_dpi:344 case mir_window_attrib_dpi:
311 out << value;345 out << value;
312 break;346 break;
313 case mir_surface_attrib_visibility:347 case mir_window_attrib_visibility:
314 out << static_cast<MirSurfaceVisibility>(value);348 out << static_cast<MirSurfaceVisibility>(value);
315 break;349 break;
316 case mir_surface_attrib_preferred_orientation:350 case mir_window_attrib_preferred_orientation:
317 out << value;351 out << value;
318 break;352 break;
319 default:353 default:
@@ -323,7 +357,7 @@
323 return out << ')';357 return out << ')';
324}358}
325359
326std::ostream& mir::operator<<(std::ostream& out, MirSurfacePlacementEvent const& event)360std::ostream& mir::operator<<(std::ostream& out, MirWindowPlacementEvent const& event)
327{361{
328 auto const& placement = event.placement();362 auto const& placement = event.placement();
329 return out << "surface_placement_event({"363 return out << "surface_placement_event({"
@@ -366,16 +400,15 @@
366400
367std::ostream& mir::operator<<(std::ostream& out, MirEvent const& event)401std::ostream& mir::operator<<(std::ostream& out, MirEvent const& event)
368{402{
403#pragma GCC diagnostic push
404#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
369 auto type = mir_event_get_type(&event);405 auto type = mir_event_get_type(&event);
370 switch (type)406 switch (type)
371 {407 {
372 PRINT_EVENT(surface);408 PRINT_EVENT(surface);
373 PRINT_EVENT(resize);409 PRINT_EVENT(resize);
374 PRINT_EVENT(orientation);410 PRINT_EVENT(orientation);
375#pragma GCC diagnostic push
376#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
377 PRINT_EVENT(close_surface);411 PRINT_EVENT(close_surface);
378#pragma GCC diagnostic pop
379 PRINT_EVENT(input);412 PRINT_EVENT(input);
380 PRINT_EVENT(input_device_state);413 PRINT_EVENT(input_device_state);
381 PRINT_EVENT(keymap);414 PRINT_EVENT(keymap);
@@ -385,5 +418,6 @@
385 default:418 default:
386 return out << static_cast<int>(type) << "<INVALID>";419 return out << static_cast<int>(type) << "<INVALID>";
387 }420 }
421#pragma GCC diagnostic pop
388}422}
389423
390424
=== modified file 'src/client/events/event_builders.cpp'
--- src/client/events/event_builders.cpp 2016-11-11 06:59:42 +0000
+++ src/client/events/event_builders.cpp 2017-01-10 20:52:04 +0000
@@ -90,6 +90,17 @@
90 auto e = new_event<MirSurfaceEvent>();90 auto e = new_event<MirSurfaceEvent>();
9191
92 e->set_id(surface_id.as_value());92 e->set_id(surface_id.as_value());
93 e->set_attrib(static_cast<MirWindowAttrib>(attribute));
94 e->set_value(value);
95
96 return make_uptr_event(e);
97}
98
99mir::EventUPtr mev::make_event(mf::SurfaceId const& surface_id, MirWindowAttrib attribute, int value)
100{
101 auto e = new_event<MirSurfaceEvent>();
102
103 e->set_id(surface_id.as_value());
93 e->set_attrib(attribute);104 e->set_attrib(attribute);
94 e->set_value(value);105 e->set_value(value);
95106
96107
=== modified file 'src/client/mir_surface.cpp'
--- src/client/mir_surface.cpp 2017-01-09 20:01:45 +0000
+++ src/client/mir_surface.cpp 2017-01-10 20:52:04 +0000
@@ -69,7 +69,7 @@
69 pixel_format{params.pixel_format},69 pixel_format{params.pixel_format},
70 buffer_usage{params.buffer_usage}70 buffer_usage{params.buffer_usage}
71{71{
72 type = mir_surface_type_normal;72 type = mir_window_type_normal;
73 if (params.output_id != mir_display_output_id_invalid)73 if (params.output_id != mir_display_output_id_invalid)
74 {74 {
75 output_id = params.output_id;75 output_id = params.output_id;
@@ -279,13 +279,13 @@
279 return &configure_cursor_wait_handle;279 return &configure_cursor_wait_handle;
280}280}
281281
282MirWaitHandle* MirSurface::configure(MirSurfaceAttrib at, int value)282MirWaitHandle* MirSurface::configure(MirWindowAttrib at, int value)
283{283{
284 // TODO: This is obviously strange. It should be284 // TODO: This is obviously strange. It should be
285 // possible to eliminate it in the second phase of buffer285 // possible to eliminate it in the second phase of buffer
286 // stream where the existing MirSurface swap interval functions286 // stream where the existing MirSurface swap interval functions
287 // may be deprecated in terms of mir_buffer_stream_ alternatives287 // may be deprecated in terms of mir_buffer_stream_ alternatives
288 if ((at == mir_surface_attrib_swapinterval) && default_stream)288 if ((at == mir_window_attrib_swapinterval) && default_stream)
289 {289 {
290 default_stream->set_swap_interval(value);290 default_stream->set_swap_interval(value);
291 return &configure_wait_handle;291 return &configure_wait_handle;
@@ -360,11 +360,11 @@
360360
361 switch (a)361 switch (a)
362 {362 {
363 case mir_surface_attrib_type:363 case mir_window_attrib_type:
364 case mir_surface_attrib_state:364 case mir_window_attrib_state:
365 case mir_surface_attrib_focus:365 case mir_window_attrib_focus:
366 case mir_surface_attrib_dpi:366 case mir_window_attrib_dpi:
367 case mir_surface_attrib_preferred_orientation:367 case mir_window_attrib_preferred_orientation:
368 if (configure_result->has_ivalue())368 if (configure_result->has_ivalue())
369 attrib_cache[a] = configure_result->ivalue();369 attrib_cache[a] = configure_result->ivalue();
370 else370 else
@@ -385,11 +385,11 @@
385}385}
386386
387387
388int MirSurface::attrib(MirSurfaceAttrib at) const388int MirSurface::attrib(MirWindowAttrib at) const
389{389{
390 std::lock_guard<decltype(mutex)> lock(mutex);390 std::lock_guard<decltype(mutex)> lock(mutex);
391391
392 if (at == mir_surface_attrib_swapinterval)392 if (at == mir_window_attrib_swapinterval)
393 {393 {
394 if (default_stream)394 if (default_stream)
395 return default_stream->swap_interval();395 return default_stream->swap_interval();
@@ -430,12 +430,12 @@
430430
431 switch (mir_event_get_type(&e))431 switch (mir_event_get_type(&e))
432 {432 {
433 case mir_event_type_surface:433 case mir_event_type_window:
434 {434 {
435 auto sev = mir_event_get_surface_event(&e);435 auto sev = mir_event_get_window_event(&e);
436 auto a = mir_surface_event_get_attribute(sev);436 auto a = mir_window_event_get_attribute(sev);
437 if (a < mir_surface_attribs)437 if (a < mir_window_attribs)
438 attrib_cache[a] = mir_surface_event_get_attribute_value(sev);438 attrib_cache[a] = mir_window_event_get_attribute_value(sev);
439 break;439 break;
440 }440 }
441 case mir_event_type_orientation:441 case mir_event_type_orientation:
@@ -470,7 +470,7 @@
470 }470 }
471}471}
472472
473void MirSurface::request_and_wait_for_configure(MirSurfaceAttrib a, int value)473void MirSurface::request_and_wait_for_configure(MirWindowAttrib a, int value)
474{474{
475 configure(a, value)->wait_for_all();475 configure(a, value)->wait_for_all();
476}476}
@@ -484,7 +484,7 @@
484484
485MirWaitHandle* MirSurface::set_preferred_orientation(MirOrientationMode mode)485MirWaitHandle* MirSurface::set_preferred_orientation(MirOrientationMode mode)
486{486{
487 return configure(mir_surface_attrib_preferred_orientation, mode);487 return configure(mir_window_attrib_preferred_orientation, mode);
488}488}
489489
490void MirSurface::raise_surface(MirCookie const* cookie)490void MirSurface::raise_surface(MirCookie const* cookie)
491491
=== modified file 'src/client/mir_surface.h'
--- src/client/mir_surface.h 2017-01-09 06:48:47 +0000
+++ src/client/mir_surface.h 2017-01-10 20:52:04 +0000
@@ -102,7 +102,7 @@
102 mir::optional_value<std::string> surface_name;102 mir::optional_value<std::string> surface_name;
103 mir::optional_value<uint32_t> output_id;103 mir::optional_value<uint32_t> output_id;
104104
105 mir::optional_value<MirSurfaceType> type;105 mir::optional_value<MirWindowType> type;
106 mir::optional_value<MirSurfaceState> state;106 mir::optional_value<MirSurfaceState> state;
107 mir::optional_value<MirOrientationMode> pref_orientation;107 mir::optional_value<MirOrientationMode> pref_orientation;
108108
@@ -183,7 +183,7 @@
183 char const * get_error_message();183 char const * get_error_message();
184 int id() const;184 int id() const;
185185
186 MirWaitHandle* configure(MirSurfaceAttrib a, int value);186 MirWaitHandle* configure(MirWindowAttrib a, int value);
187187
188 // TODO: Some sort of extension mechanism so that this can be moved188 // TODO: Some sort of extension mechanism so that this can be moved
189 // out into a separate class in the libmirclient-debug DSO.189 // out into a separate class in the libmirclient-debug DSO.
@@ -191,7 +191,7 @@
191 int* screen_x, int* screen_y);191 int* screen_x, int* screen_y);
192 192
193 // Non-blocking193 // Non-blocking
194 int attrib(MirSurfaceAttrib a) const;194 int attrib(MirWindowAttrib a) const;
195195
196 MirOrientation get_orientation() const;196 MirOrientation get_orientation() const;
197 MirWaitHandle* set_preferred_orientation(MirOrientationMode mode);197 MirWaitHandle* set_preferred_orientation(MirOrientationMode mode);
@@ -204,7 +204,7 @@
204 void* context);204 void* context);
205 void handle_event(MirEvent const& e);205 void handle_event(MirEvent const& e);
206206
207 void request_and_wait_for_configure(MirSurfaceAttrib a, int value);207 void request_and_wait_for_configure(MirWindowAttrib a, int value);
208208
209 MirBufferStream* get_buffer_stream();209 MirBufferStream* get_buffer_stream();
210210
@@ -248,7 +248,7 @@
248 std::unique_ptr<mir::protobuf::SurfaceSetting> const configure_result;248 std::unique_ptr<mir::protobuf::SurfaceSetting> const configure_result;
249249
250 // Cache of latest SurfaceSettings returned from the server250 // Cache of latest SurfaceSettings returned from the server
251 int attrib_cache[mir_surface_attribs];251 int attrib_cache[mir_window_attribs];
252 MirOrientation orientation = mir_orientation_normal;252 MirOrientation orientation = mir_orientation_normal;
253253
254 std::function<void(MirEvent const*)> handle_event_callback;254 std::function<void(MirEvent const*)> handle_event_callback;
255255
=== modified file 'src/client/mir_surface_api.cpp'
--- src/client/mir_surface_api.cpp 2017-01-09 06:48:47 +0000
+++ src/client/mir_surface_api.cpp 2017-01-10 20:52:04 +0000
@@ -42,7 +42,7 @@
42 int width, int height)42 int width, int height)
43{43{
44 auto spec = new MirWindowSpec{connection, width, height, mir_pixel_format_invalid};44 auto spec = new MirWindowSpec{connection, width, height, mir_pixel_format_invalid};
45 spec->type = mir_surface_type_normal;45 spec->type = mir_window_type_normal;
46 return spec;46 return spec;
47}47}
4848
@@ -57,7 +57,7 @@
57 mir::require(rect != nullptr);57 mir::require(rect != nullptr);
5858
59 auto spec = new MirWindowSpec{connection, width, height, mir_pixel_format_invalid};59 auto spec = new MirWindowSpec{connection, width, height, mir_pixel_format_invalid};
60 spec->type = mir_surface_type_menu;60 spec->type = mir_window_type_menu;
61 spec->parent = parent;61 spec->parent = parent;
62 spec->aux_rect = *rect;62 spec->aux_rect = *rect;
63 spec->edge_attachment = edge;63 spec->edge_attachment = edge;
@@ -74,7 +74,7 @@
74 mir::require(rect != nullptr);74 mir::require(rect != nullptr);
7575
76 auto spec = new MirWindowSpec{connection, width, height, mir_pixel_format_invalid};76 auto spec = new MirWindowSpec{connection, width, height, mir_pixel_format_invalid};
77 spec->type = mir_surface_type_tip;77 spec->type = mir_window_type_tip;
78 spec->parent = parent;78 spec->parent = parent;
79 spec->aux_rect = *rect;79 spec->aux_rect = *rect;
80 spec->edge_attachment = edge;80 spec->edge_attachment = edge;
@@ -88,7 +88,7 @@
88 mir::require(mir_window_is_valid(parent));88 mir::require(mir_window_is_valid(parent));
8989
90 auto spec = new MirWindowSpec{connection, width, height, mir_pixel_format_invalid};90 auto spec = new MirWindowSpec{connection, width, height, mir_pixel_format_invalid};
91 spec->type = mir_surface_type_dialog;91 spec->type = mir_window_type_dialog;
92 spec->parent = parent;92 spec->parent = parent;
9393
94 return spec;94 return spec;
@@ -99,7 +99,7 @@
99 int width, int height)99 int width, int height)
100{100{
101 auto spec = new MirWindowSpec{connection, width, height, mir_pixel_format_invalid};101 auto spec = new MirWindowSpec{connection, width, height, mir_pixel_format_invalid};
102 spec->type = mir_surface_type_dialog;102 spec->type = mir_window_type_dialog;
103 return spec;103 return spec;
104}104}
105105
@@ -108,7 +108,7 @@
108 int width, int height)108 int width, int height)
109{109{
110 auto spec = new MirWindowSpec{connection, width, height, mir_pixel_format_invalid};110 auto spec = new MirWindowSpec{connection, width, height, mir_pixel_format_invalid};
111 spec->type = mir_surface_type_inputmethod;111 spec->type = mir_window_type_inputmethod;
112 return spec;112 return spec;
113}113}
114114
@@ -137,7 +137,7 @@
137 MIR_LOG_UNCAUGHT_EXCEPTION(ex);137 MIR_LOG_UNCAUGHT_EXCEPTION(ex);
138}138}
139139
140void mir_window_spec_set_type(MirWindowSpec* spec, MirSurfaceType type)140void mir_window_spec_set_type(MirWindowSpec* spec, MirWindowType type)
141try141try
142{142{
143 mir::require(spec);143 mir::require(spec);
@@ -301,7 +301,7 @@
301 mir::require(attachment_rect != nullptr);301 mir::require(attachment_rect != nullptr);
302302
303 if (!spec->type.is_set() ||303 if (!spec->type.is_set() ||
304 spec->type.value() != mir_surface_type_inputmethod)304 spec->type.value() != mir_window_type_inputmethod)
305 {305 {
306 return false;306 return false;
307 }307 }
@@ -624,6 +624,22 @@
624 }624 }
625}625}
626626
627MirWindowType mir_window_get_type(MirWindow* window)
628{
629 MirWindowType type = mir_window_type_normal;
630
631 if (window)
632 {
633 // Only the client will ever change the type of a window so it is
634 // safe to get the type from a local cache surf->attrib().
635
636 int t = window->attrib(mir_window_attrib_type);
637 type = static_cast<MirWindowType>(t);
638 }
639
640 return type;
641}
642
627// These functions will be deprecated soon643// These functions will be deprecated soon
628//#pragma GCC diagnostic push644//#pragma GCC diagnostic push
629//#pragma GCC diagnostic ignored "-Wdeprecated-declarations"645//#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
@@ -887,7 +903,7 @@
887903
888void mir_surface_spec_set_type(MirSurfaceSpec* spec, MirSurfaceType type)904void mir_surface_spec_set_type(MirSurfaceSpec* spec, MirSurfaceType type)
889{905{
890 mir_window_spec_set_type(spec, type);906 mir_window_spec_set_type(spec, static_cast<MirWindowType>(type));
891}907}
892908
893void mir_surface_spec_set_width_increment(MirSurfaceSpec* spec, unsigned width_inc)909void mir_surface_spec_set_width_increment(MirSurfaceSpec* spec, unsigned width_inc)
@@ -976,25 +992,14 @@
976992
977MirSurfaceType mir_surface_get_type(MirSurface* surf)993MirSurfaceType mir_surface_get_type(MirSurface* surf)
978{994{
979 MirSurfaceType type = mir_surface_type_normal;995 return static_cast<MirSurfaceType>(mir_window_get_type(surf));
980
981 if (surf)
982 {
983 // Only the client will ever change the type of a surface so it is
984 // safe to get the type from a local cache surf->attrib().
985
986 int t = surf->attrib(mir_surface_attrib_type);
987 type = static_cast<MirSurfaceType>(t);
988 }
989
990 return type;
991}996}
992997
993MirWaitHandle* mir_surface_set_state(MirSurface* surf, MirSurfaceState state)998MirWaitHandle* mir_surface_set_state(MirSurface* surf, MirSurfaceState state)
994{999{
995 try1000 try
996 {1001 {
997 return surf ? surf->configure(mir_surface_attrib_state, state) : nullptr;1002 return surf ? surf->configure(mir_window_attrib_state, state) : nullptr;
998 }1003 }
999 catch (std::exception const& ex)1004 catch (std::exception const& ex)
1000 {1005 {
@@ -1011,13 +1016,13 @@
1011 {1016 {
1012 if (surf)1017 if (surf)
1013 {1018 {
1014 int s = surf->attrib(mir_surface_attrib_state);1019 int s = surf->attrib(mir_window_attrib_state);
10151020
1016 if (s == mir_surface_state_unknown)1021 if (s == mir_surface_state_unknown)
1017 {1022 {
1018 surf->configure(mir_surface_attrib_state,1023 surf->configure(mir_window_attrib_state,
1019 mir_surface_state_unknown)->wait_for_all();1024 mir_surface_state_unknown)->wait_for_all();
1020 s = surf->attrib(mir_surface_attrib_state);1025 s = surf->attrib(mir_window_attrib_state);
1021 }1026 }
10221027
1023 state = static_cast<MirSurfaceState>(s);1028 state = static_cast<MirSurfaceState>(s);
@@ -1085,7 +1090,7 @@
1085 {1090 {
1086 if (surf)1091 if (surf)
1087 {1092 {
1088 dpi = surf->attrib(mir_surface_attrib_dpi);1093 dpi = surf->attrib(mir_window_attrib_dpi);
1089 }1094 }
1090 }1095 }
1091 catch (std::exception const& ex)1096 catch (std::exception const& ex)
@@ -1104,7 +1109,7 @@
1104 {1109 {
1105 if (surf)1110 if (surf)
1106 {1111 {
1107 state = static_cast<MirSurfaceFocusState>(surf->attrib(mir_surface_attrib_focus));1112 state = static_cast<MirSurfaceFocusState>(surf->attrib(mir_window_attrib_focus));
1108 }1113 }
1109 }1114 }
1110 catch (std::exception const& ex)1115 catch (std::exception const& ex)
@@ -1123,7 +1128,7 @@
1123 {1128 {
1124 if (surf)1129 if (surf)
1125 {1130 {
1126 state = static_cast<MirSurfaceVisibility>(surf->attrib(mir_surface_attrib_visibility));1131 state = static_cast<MirSurfaceVisibility>(surf->attrib(mir_window_attrib_visibility));
1127 }1132 }
1128 }1133 }
1129 catch (std::exception const& ex)1134 catch (std::exception const& ex)
@@ -1159,7 +1164,7 @@
11591164
1160 try1165 try
1161 {1166 {
1162 mode = static_cast<MirOrientationMode>(surf->attrib(mir_surface_attrib_preferred_orientation));1167 mode = static_cast<MirOrientationMode>(surf->attrib(mir_window_attrib_preferred_orientation));
1163 }1168 }
1164 catch (std::exception const& ex)1169 catch (std::exception const& ex)
1165 {1170 {
11661171
=== modified file 'src/client/rpc/mir_protobuf_rpc_channel.cpp'
--- src/client/rpc/mir_protobuf_rpc_channel.cpp 2017-01-06 05:29:00 +0000
+++ src/client/rpc/mir_protobuf_rpc_channel.cpp 2017-01-10 20:52:04 +0000
@@ -400,7 +400,7 @@
400400
401 switch (e->type())401 switch (e->type())
402 {402 {
403 case mir_event_type_surface:403 case mir_event_type_window:
404 surface_id = e->to_surface()->id();404 surface_id = e->to_surface()->id();
405 break;405 break;
406 case mir_event_type_resize:406 case mir_event_type_resize:
@@ -409,16 +409,16 @@
409 case mir_event_type_orientation:409 case mir_event_type_orientation:
410 surface_id = e->to_orientation()->surface_id();410 surface_id = e->to_orientation()->surface_id();
411 break;411 break;
412 case mir_event_type_close_surface:412 case mir_event_type_close_window:
413 surface_id = e->to_close_surface()->surface_id();413 surface_id = e->to_close_surface()->surface_id();
414 break;414 break;
415 case mir_event_type_keymap:415 case mir_event_type_keymap:
416 surface_id = e->to_keymap()->surface_id();416 surface_id = e->to_keymap()->surface_id();
417 break;417 break;
418 case mir_event_type_surface_output:418 case mir_event_type_window_output:
419 surface_id = e->to_surface_output()->surface_id();419 surface_id = e->to_surface_output()->surface_id();
420 break;420 break;
421 case mir_event_type_surface_placement:421 case mir_event_type_window_placement:
422 surface_id = e->to_surface_placement()->id();422 surface_id = e->to_surface_placement()->id();
423 break;423 break;
424 default:424 default:
425425
=== modified file 'src/client/screencast_stream.cpp'
--- src/client/screencast_stream.cpp 2017-01-09 06:48:47 +0000
+++ src/client/screencast_stream.cpp 2017-01-10 20:52:04 +0000
@@ -254,7 +254,7 @@
254 BOOST_THROW_EXCEPTION(std::logic_error("Attempt to set cache size on screencast is invalid"));254 BOOST_THROW_EXCEPTION(std::logic_error("Attempt to set cache size on screencast is invalid"));
255}255}
256256
257void mcl::ScreencastStream::request_and_wait_for_configure(MirSurfaceAttrib, int)257void mcl::ScreencastStream::request_and_wait_for_configure(MirWindowAttrib, int)
258{258{
259 BOOST_THROW_EXCEPTION(std::logic_error("Attempt to set attrib on screencast is invalid"));259 BOOST_THROW_EXCEPTION(std::logic_error("Attempt to set attrib on screencast is invalid"));
260}260}
261261
=== modified file 'src/client/screencast_stream.h'
--- src/client/screencast_stream.h 2017-01-09 06:48:47 +0000
+++ src/client/screencast_stream.h 2017-01-10 20:52:04 +0000
@@ -84,7 +84,7 @@
84 std::shared_ptr<MemoryRegion> secure_for_cpu_write() override;84 std::shared_ptr<MemoryRegion> secure_for_cpu_write() override;
8585
86 void swap_buffers_sync() override;86 void swap_buffers_sync() override;
87 void request_and_wait_for_configure(MirSurfaceAttrib attrib, int) override;87 void request_and_wait_for_configure(MirWindowAttrib attrib, int) override;
88 MirNativeBuffer* get_current_buffer_package() override;88 MirNativeBuffer* get_current_buffer_package() override;
89 MirPlatformType platform_type() override;89 MirPlatformType platform_type() override;
9090
9191
=== modified file 'src/client/symbols.map'
--- src/client/symbols.map 2017-01-09 06:48:47 +0000
+++ src/client/symbols.map 2017-01-10 20:52:04 +0000
@@ -550,4 +550,16 @@
550 mir_window_get_parameters;550 mir_window_get_parameters;
551 mir_window_get_orientation;551 mir_window_get_orientation;
552 mir_window_raise;552 mir_window_raise;
553 mir_event_get_window_event;
554 mir_window_event_get_attribute;
555 mir_window_event_get_attribute_value;
556 mir_window_get_type;
557 mir_event_get_window_output_event;
558 mir_window_output_event_get_dpi;
559 mir_window_output_event_get_form_factor;
560 mir_window_output_event_get_scale;
561 mir_window_output_event_get_output_id;
562 mir_window_output_event_get_refresh_rate;
563 mir_event_get_window_placement_event;
564 mir_window_placement_get_relative_position;
553} MIR_CLIENT_0.25;565} MIR_CLIENT_0.25;
554566
=== modified file 'src/common/events/event.cpp'
--- src/common/events/event.cpp 2016-11-11 07:56:09 +0000
+++ src/common/events/event.cpp 2017-01-10 20:52:04 +0000
@@ -82,7 +82,7 @@
82 case mir::capnp::Event::Which::INPUT:82 case mir::capnp::Event::Which::INPUT:
83 return mir_event_type_input;83 return mir_event_type_input;
84 case mir::capnp::Event::Which::SURFACE:84 case mir::capnp::Event::Which::SURFACE:
85 return mir_event_type_surface;85 return mir_event_type_window;
86 case mir::capnp::Event::Which::RESIZE:86 case mir::capnp::Event::Which::RESIZE:
87 return mir_event_type_resize;87 return mir_event_type_resize;
88 case mir::capnp::Event::Which::PROMPT_SESSION:88 case mir::capnp::Event::Which::PROMPT_SESSION:
@@ -90,7 +90,7 @@
90 case mir::capnp::Event::Which::ORIENTATION:90 case mir::capnp::Event::Which::ORIENTATION:
91 return mir_event_type_orientation;91 return mir_event_type_orientation;
92 case mir::capnp::Event::Which::CLOSE_SURFACE:92 case mir::capnp::Event::Which::CLOSE_SURFACE:
93 return mir_event_type_close_surface;93 return mir_event_type_close_window;
94 case mir::capnp::Event::Which::KEYMAP:94 case mir::capnp::Event::Which::KEYMAP:
95 return mir_event_type_keymap;95 return mir_event_type_keymap;
96#pragma GCC diagnostic push96#pragma GCC diagnostic push
@@ -99,11 +99,11 @@
99 return mir_event_type_input_configuration;99 return mir_event_type_input_configuration;
100#pragma GCC diagnostic pop100#pragma GCC diagnostic pop
101 case mir::capnp::Event::Which::SURFACE_OUTPUT:101 case mir::capnp::Event::Which::SURFACE_OUTPUT:
102 return mir_event_type_surface_output;102 return mir_event_type_window_output;
103 case mir::capnp::Event::Which::INPUT_DEVICE:103 case mir::capnp::Event::Which::INPUT_DEVICE:
104 return mir_event_type_input_device_state;104 return mir_event_type_input_device_state;
105 case mir::capnp::Event::Which::SURFACE_PLACEMENT:105 case mir::capnp::Event::Which::SURFACE_PLACEMENT:
106 return mir_event_type_surface_placement;106 return mir_event_type_window_placement;
107 default:107 default:
108 mir::log_critical("unknown event type.");108 mir::log_critical("unknown event type.");
109 abort();109 abort();
@@ -133,14 +133,14 @@
133}133}
134#pragma GCC diagnostic pop134#pragma GCC diagnostic pop
135135
136MirSurfaceEvent* MirEvent::to_surface()136MirWindowEvent* MirEvent::to_surface()
137{137{
138 return static_cast<MirSurfaceEvent*>(this);138 return static_cast<MirWindowEvent*>(this);
139}139}
140140
141MirSurfaceEvent const* MirEvent::to_surface() const141MirWindowEvent const* MirEvent::to_surface() const
142{142{
143 return static_cast<MirSurfaceEvent const*>(this);143 return static_cast<MirWindowEvent const*>(this);
144}144}
145145
146MirResizeEvent* MirEvent::to_resize()146MirResizeEvent* MirEvent::to_resize()
147147
=== modified file 'src/common/events/surface_event.cpp'
--- src/common/events/surface_event.cpp 2016-10-31 02:37:31 +0000
+++ src/common/events/surface_event.cpp 2017-01-10 20:52:04 +0000
@@ -33,12 +33,12 @@
33 event.getSurface().setId(id);33 event.getSurface().setId(id);
34}34}
3535
36MirSurfaceAttrib MirSurfaceEvent::attrib() const36MirWindowAttrib MirSurfaceEvent::attrib() const
37{37{
38 return static_cast<MirSurfaceAttrib>(event.asReader().getSurface().getAttrib());38 return static_cast<MirWindowAttrib>(event.asReader().getSurface().getAttrib());
39}39}
4040
41void MirSurfaceEvent::set_attrib(MirSurfaceAttrib attrib)41void MirSurfaceEvent::set_attrib(MirWindowAttrib attrib)
42{42{
43 event.getSurface().setAttrib(static_cast<mir::capnp::SurfaceEvent::Attrib>(attrib));43 event.getSurface().setAttrib(static_cast<mir::capnp::SurfaceEvent::Attrib>(attrib));
44}44}
4545
=== modified file 'src/include/client/mir/egl_native_surface.h'
--- src/include/client/mir/egl_native_surface.h 2017-01-09 06:48:47 +0000
+++ src/include/client/mir/egl_native_surface.h 2017-01-10 20:52:04 +0000
@@ -34,7 +34,7 @@
34 virtual MirWindowParameters get_parameters() const = 0;34 virtual MirWindowParameters get_parameters() const = 0;
35 virtual std::shared_ptr<ClientBuffer> get_current_buffer() = 0;35 virtual std::shared_ptr<ClientBuffer> get_current_buffer() = 0;
36 virtual void swap_buffers_sync() = 0;36 virtual void swap_buffers_sync() = 0;
37 virtual void request_and_wait_for_configure(MirSurfaceAttrib a, int value) = 0;37 virtual void request_and_wait_for_configure(MirWindowAttrib a, int value) = 0;
38 virtual void set_buffer_cache_size(unsigned int) = 0;38 virtual void set_buffer_cache_size(unsigned int) = 0;
3939
40 protected:40 protected:
4141
=== modified file 'src/include/common/mir/events/event.h'
--- src/include/common/mir/events/event.h 2016-11-11 06:59:42 +0000
+++ src/include/common/mir/events/event.h 2017-01-10 20:52:04 +0000
@@ -40,8 +40,8 @@
40 MirInputConfigurationEvent* to_input_configuration();40 MirInputConfigurationEvent* to_input_configuration();
41 MirInputConfigurationEvent const* to_input_configuration() const;41 MirInputConfigurationEvent const* to_input_configuration() const;
4242
43 MirSurfaceEvent* to_surface();43 MirWindowEvent* to_surface();
44 MirSurfaceEvent const* to_surface() const;44 MirWindowEvent const* to_surface() const;
4545
46 MirResizeEvent* to_resize();46 MirResizeEvent* to_resize();
47 MirResizeEvent const* to_resize() const;47 MirResizeEvent const* to_resize() const;
4848
=== modified file 'src/include/common/mir/events/surface_event.h'
--- src/include/common/mir/events/surface_event.h 2016-10-31 02:37:31 +0000
+++ src/include/common/mir/events/surface_event.h 2017-01-10 20:52:04 +0000
@@ -28,8 +28,8 @@
28 int id() const;28 int id() const;
29 void set_id(int id);29 void set_id(int id);
3030
31 MirSurfaceAttrib attrib() const;31 MirWindowAttrib attrib() const;
32 void set_attrib(MirSurfaceAttrib attrib);32 void set_attrib(MirWindowAttrib attrib);
3333
34 int value() const;34 int value() const;
35 void set_value(int value);35 void set_value(int value);
3636
=== modified file 'src/include/common/mir/events/surface_output_event.h'
--- src/include/common/mir/events/surface_output_event.h 2016-11-11 06:59:42 +0000
+++ src/include/common/mir/events/surface_output_event.h 2017-01-10 20:52:04 +0000
@@ -23,8 +23,6 @@
2323
24#include "mir/events/event.h"24#include "mir/events/event.h"
2525
26// XXX This is a private structure so why are its members kept private?
27// What's the point in having all the getters and setters?
28struct MirSurfaceOutputEvent : MirEvent26struct MirSurfaceOutputEvent : MirEvent
29{27{
30 MirSurfaceOutputEvent();28 MirSurfaceOutputEvent();
3129
=== modified file 'src/include/server/mir/frontend/shell.h'
--- src/include/server/mir/frontend/shell.h 2016-01-29 08:18:22 +0000
+++ src/include/server/mir/frontend/shell.h 2017-01-10 20:52:04 +0000
@@ -74,13 +74,13 @@
74 virtual int set_surface_attribute(74 virtual int set_surface_attribute(
75 std::shared_ptr<Session> const& session,75 std::shared_ptr<Session> const& session,
76 SurfaceId surface_id,76 SurfaceId surface_id,
77 MirSurfaceAttrib attrib,77 MirWindowAttrib attrib,
78 int value) = 0;78 int value) = 0;
7979
80 virtual int get_surface_attribute(80 virtual int get_surface_attribute(
81 std::shared_ptr<Session> const& session,81 std::shared_ptr<Session> const& session,
82 SurfaceId surface_id,82 SurfaceId surface_id,
83 MirSurfaceAttrib attrib) = 0;83 MirWindowAttrib attrib) = 0;
8484
85 virtual void raise_surface(85 virtual void raise_surface(
86 std::shared_ptr<Session> const& session,86 std::shared_ptr<Session> const& session,
8787
=== modified file 'src/include/server/mir/scene/surface_event_source.h'
--- src/include/server/mir/scene/surface_event_source.h 2016-10-31 02:37:31 +0000
+++ src/include/server/mir/scene/surface_event_source.h 2017-01-10 20:52:04 +0000
@@ -42,7 +42,7 @@
42 OutputPropertiesCache const& outputs,42 OutputPropertiesCache const& outputs,
43 std::shared_ptr<frontend::EventSink> const& event_sink);43 std::shared_ptr<frontend::EventSink> const& event_sink);
4444
45 void attrib_changed(MirSurfaceAttrib attrib, int value) override;45 void attrib_changed(MirWindowAttrib attrib, int value) override;
46 void resized_to(geometry::Size const& size) override;46 void resized_to(geometry::Size const& size) override;
47 void moved_to(geometry::Point const& top_left) override;47 void moved_to(geometry::Point const& top_left) override;
48 void orientation_set_to(MirOrientation orientation) override;48 void orientation_set_to(MirOrientation orientation) override;
4949
=== modified file 'src/include/server/mir/scene/surface_observers.h'
--- src/include/server/mir/scene/surface_observers.h 2016-10-31 02:37:31 +0000
+++ src/include/server/mir/scene/surface_observers.h 2017-01-10 20:52:04 +0000
@@ -34,7 +34,7 @@
34 using BasicObservers<SurfaceObserver>::remove;34 using BasicObservers<SurfaceObserver>::remove;
35 using BasicObservers<SurfaceObserver>::for_each;35 using BasicObservers<SurfaceObserver>::for_each;
3636
37 void attrib_changed(MirSurfaceAttrib attrib, int value) override;37 void attrib_changed(MirWindowAttrib attrib, int value) override;
38 void resized_to(geometry::Size const& size) override;38 void resized_to(geometry::Size const& size) override;
39 void moved_to(geometry::Point const& top_left) override;39 void moved_to(geometry::Point const& top_left) override;
40 void hidden_set_to(bool hide) override;40 void hidden_set_to(bool hide) override;
4141
=== modified file 'src/include/server/mir/shell/basic_window_manager.h'
--- src/include/server/mir/shell/basic_window_manager.h 2016-07-18 07:38:38 +0000
+++ src/include/server/mir/shell/basic_window_manager.h 2017-01-10 20:52:04 +0000
@@ -166,7 +166,7 @@
166 int set_surface_attribute(166 int set_surface_attribute(
167 std::shared_ptr<scene::Session> const& /*session*/,167 std::shared_ptr<scene::Session> const& /*session*/,
168 std::shared_ptr<scene::Surface> const& surface,168 std::shared_ptr<scene::Surface> const& surface,
169 MirSurfaceAttrib attrib,169 MirWindowAttrib attrib,
170 int value) override;170 int value) override;
171171
172 auto find_session(std::function<bool(SessionInfo const& info)> const& predicate)172 auto find_session(std::function<bool(SessionInfo const& info)> const& predicate)
173173
=== modified file 'src/include/server/mir/shell/window_management_info.h'
--- src/include/server/mir/shell/window_management_info.h 2016-06-20 17:10:33 +0000
+++ src/include/server/mir/shell/window_management_info.h 2017-01-10 20:52:04 +0000
@@ -39,7 +39,7 @@
3939
40 bool can_be_active() const;40 bool can_be_active() const;
4141
42 bool can_morph_to(MirSurfaceType new_type) const;42 bool can_morph_to(MirWindowType new_type) const;
4343
44 bool must_have_parent() const;44 bool must_have_parent() const;
4545
@@ -47,7 +47,7 @@
4747
48 bool is_visible() const;48 bool is_visible() const;
4949
50 static bool needs_titlebar(MirSurfaceType type);50 static bool needs_titlebar(MirWindowType type);
5151
52 void constrain_resize(52 void constrain_resize(
53 std::shared_ptr <scene::Surface> const& surface,53 std::shared_ptr <scene::Surface> const& surface,
@@ -57,7 +57,7 @@
57 const bool top_resize,57 const bool top_resize,
58 geometry::Rectangle const& bounds) const;58 geometry::Rectangle const& bounds) const;
5959
60 MirSurfaceType type;60 MirWindowType type;
61 MirSurfaceState state;61 MirSurfaceState state;
62 geometry::Rectangle restore_rect;62 geometry::Rectangle restore_rect;
63 std::weak_ptr <scene::Session> session;63 std::weak_ptr <scene::Session> session;
6464
=== modified file 'src/platforms/android/client/egl_native_surface_interpreter.cpp'
--- src/platforms/android/client/egl_native_surface_interpreter.cpp 2016-12-09 02:54:31 +0000
+++ src/platforms/android/client/egl_native_surface_interpreter.cpp 2017-01-10 20:52:04 +0000
@@ -92,7 +92,7 @@
9292
93void mcla::EGLNativeSurfaceInterpreter::sync_to_display(bool should_sync)93void mcla::EGLNativeSurfaceInterpreter::sync_to_display(bool should_sync)
94{ 94{
95 surface.request_and_wait_for_configure(mir_surface_attrib_swapinterval, should_sync);95 surface.request_and_wait_for_configure(mir_window_attrib_swapinterval, should_sync);
96}96}
9797
98void mcla::EGLNativeSurfaceInterpreter::dispatch_driver_request_buffer_count(unsigned int count)98void mcla::EGLNativeSurfaceInterpreter::dispatch_driver_request_buffer_count(unsigned int count)
9999
=== modified file 'src/platforms/mesa/client/native_surface.cpp'
--- src/platforms/mesa/client/native_surface.cpp 2017-01-09 06:48:47 +0000
+++ src/platforms/mesa/client/native_surface.cpp 2017-01-10 20:52:04 +0000
@@ -116,7 +116,7 @@
116 if ((interval < 0) || (interval > 1))116 if ((interval < 0) || (interval > 1))
117 return MIR_MESA_FALSE;117 return MIR_MESA_FALSE;
118118
119 surface->request_and_wait_for_configure(mir_surface_attrib_swapinterval, interval);119 surface->request_and_wait_for_configure(mir_window_attrib_swapinterval, interval);
120 return MIR_MESA_TRUE;120 return MIR_MESA_TRUE;
121}121}
122catch (std::exception const& e)122catch (std::exception const& e)
123123
=== modified file 'src/server/frontend/session_mediator.cpp'
--- src/server/frontend/session_mediator.cpp 2016-12-23 15:33:03 +0000
+++ src/server/frontend/session_mediator.cpp 2017-01-10 20:52:04 +0000
@@ -241,7 +241,7 @@
241 params.with_output_id(graphics::DisplayConfigurationOutputId(request->output_id()));241 params.with_output_id(graphics::DisplayConfigurationOutputId(request->output_id()));
242242
243 if (request->has_type())243 if (request->has_type())
244 params.of_type(static_cast<MirSurfaceType>(request->type()));244 params.of_type(static_cast<MirWindowType>(request->type()));
245245
246 if (request->has_state())246 if (request->has_state())
247 params.with_state(static_cast<MirSurfaceState>(request->state()));247 params.with_state(static_cast<MirSurfaceState>(request->state()));
@@ -350,13 +350,13 @@
350 if (surface->supports_input())350 if (surface->supports_input())
351 response->add_fd(surface->client_input_fd());351 response->add_fd(surface->client_input_fd());
352 352
353 for (unsigned int i = 0; i < mir_surface_attribs; i++)353 for (unsigned int i = 0; i < mir_window_attribs; i++)
354 {354 {
355 auto setting = response->add_attributes();355 auto setting = response->add_attributes();
356 356
357 setting->mutable_surfaceid()->set_value(surf_id.as_value());357 setting->mutable_surfaceid()->set_value(surf_id.as_value());
358 setting->set_attrib(i);358 setting->set_attrib(i);
359 setting->set_ivalue(shell->get_surface_attribute(session, surf_id, static_cast<MirSurfaceAttrib>(i)));359 setting->set_ivalue(shell->get_surface_attribute(session, surf_id, static_cast<MirWindowAttrib>(i)));
360 }360 }
361361
362 if (legacy_stream)362 if (legacy_stream)
@@ -508,7 +508,7 @@
508 mir::protobuf::SurfaceSetting* response,508 mir::protobuf::SurfaceSetting* response,
509 google::protobuf::Closure* done)509 google::protobuf::Closure* done)
510{510{
511 MirSurfaceAttrib attrib = static_cast<MirSurfaceAttrib>(request->attrib());511 auto attrib = static_cast<MirWindowAttrib>(request->attrib());
512512
513 // Required response fields:513 // Required response fields:
514 response->mutable_surfaceid()->CopyFrom(request->surfaceid());514 response->mutable_surfaceid()->CopyFrom(request->surfaceid());
515515
=== modified file 'src/server/frontend/shell_wrapper.cpp'
--- src/server/frontend/shell_wrapper.cpp 2016-01-29 08:18:22 +0000
+++ src/server/frontend/shell_wrapper.cpp 2017-01-10 20:52:04 +0000
@@ -85,7 +85,7 @@
85int mf::ShellWrapper::set_surface_attribute(85int mf::ShellWrapper::set_surface_attribute(
86 std::shared_ptr<Session> const& session,86 std::shared_ptr<Session> const& session,
87 SurfaceId surface_id,87 SurfaceId surface_id,
88 MirSurfaceAttrib attrib,88 MirWindowAttrib attrib,
89 int value)89 int value)
90{90{
91 return wrapped->set_surface_attribute(session, surface_id, attrib, value);91 return wrapped->set_surface_attribute(session, surface_id, attrib, value);
@@ -94,7 +94,7 @@
94int mf::ShellWrapper::get_surface_attribute(94int mf::ShellWrapper::get_surface_attribute(
95 std::shared_ptr<Session> const& session,95 std::shared_ptr<Session> const& session,
96 SurfaceId surface_id,96 SurfaceId surface_id,
97 MirSurfaceAttrib attrib)97 MirWindowAttrib attrib)
98{98{
99 return wrapped->get_surface_attribute(session, surface_id, attrib);99 return wrapped->get_surface_attribute(session, surface_id, attrib);
100}100}
101101
=== modified file 'src/server/frontend/shell_wrapper.h'
--- src/server/frontend/shell_wrapper.h 2016-01-29 08:18:22 +0000
+++ src/server/frontend/shell_wrapper.h 2017-01-10 20:52:04 +0000
@@ -67,13 +67,13 @@
67 int set_surface_attribute(67 int set_surface_attribute(
68 std::shared_ptr<Session> const& session,68 std::shared_ptr<Session> const& session,
69 SurfaceId surface_id,69 SurfaceId surface_id,
70 MirSurfaceAttrib attrib,70 MirWindowAttrib attrib,
71 int value) override;71 int value) override;
7272
73 int get_surface_attribute(73 int get_surface_attribute(
74 std::shared_ptr<Session> const& session,74 std::shared_ptr<Session> const& session,
75 SurfaceId surface_id,75 SurfaceId surface_id,
76 MirSurfaceAttrib attrib) override;76 MirWindowAttrib attrib) override;
7777
78 void raise_surface(78 void raise_surface(
79 std::shared_ptr<Session> const& session,79 std::shared_ptr<Session> const& session,
8080
=== modified file 'src/server/input/cursor_controller.cpp'
--- src/server/input/cursor_controller.cpp 2016-01-29 08:18:22 +0000
+++ src/server/input/cursor_controller.cpp 2017-01-10 20:52:04 +0000
@@ -44,7 +44,7 @@
44 {44 {
45 }45 }
4646
47 void attrib_changed(MirSurfaceAttrib, int) override47 void attrib_changed(MirWindowAttrib, int) override
48 {48 {
49 // Attribute changing alone wont trigger a cursor update49 // Attribute changing alone wont trigger a cursor update
50 }50 }
5151
=== modified file 'src/server/report/logging/shell_report.cpp'
--- src/server/report/logging/shell_report.cpp 2016-07-18 07:38:38 +0000
+++ src/server/report/logging/shell_report.cpp 2017-01-10 20:52:04 +0000
@@ -86,7 +86,7 @@
86void mrl::ShellReport::update_surface(86void mrl::ShellReport::update_surface(
87 Session const& session,87 Session const& session,
88 Surface const& surface,88 Surface const& surface,
89 MirSurfaceAttrib /*attrib*/, int /*value*/)89 MirWindowAttrib /*attrib*/, int /*value*/)
90{90{
91 std::ostringstream out;91 std::ostringstream out;
92 log_basics(out, session, surface, "update");92 log_basics(out, session, surface, "update");
9393
=== modified file 'src/server/report/logging/shell_report.h'
--- src/server/report/logging/shell_report.h 2016-07-18 07:38:38 +0000
+++ src/server/report/logging/shell_report.h 2017-01-10 20:52:04 +0000
@@ -48,7 +48,7 @@
48 void update_surface(48 void update_surface(
49 scene::Session const& session,49 scene::Session const& session,
50 scene::Surface const& surface,50 scene::Surface const& surface,
51 MirSurfaceAttrib attrib, int value) override;51 MirWindowAttrib attrib, int value) override;
5252
53 void destroying_surface(53 void destroying_surface(
54 scene::Session const& session,54 scene::Session const& session,
5555
=== modified file 'src/server/report/null/shell_report.cpp'
--- src/server/report/null/shell_report.cpp 2015-10-29 15:30:35 +0000
+++ src/server/report/null/shell_report.cpp 2017-01-10 20:52:04 +0000
@@ -44,7 +44,7 @@
44void mrn::ShellReport::update_surface(44void mrn::ShellReport::update_surface(
45 scene::Session const& /*session*/,45 scene::Session const& /*session*/,
46 scene::Surface const& /*surface*/,46 scene::Surface const& /*surface*/,
47 MirSurfaceAttrib /*attrib*/, int /*value*/)47 MirWindowAttrib /*attrib*/, int /*value*/)
48{48{
49}49}
5050
5151
=== modified file 'src/server/report/null/shell_report.h'
--- src/server/report/null/shell_report.h 2015-10-29 15:30:35 +0000
+++ src/server/report/null/shell_report.h 2017-01-10 20:52:04 +0000
@@ -45,7 +45,7 @@
45 void update_surface(45 void update_surface(
46 scene::Session const& /*session*/,46 scene::Session const& /*session*/,
47 scene::Surface const& /*surface*/,47 scene::Surface const& /*surface*/,
48 MirSurfaceAttrib /*attrib*/, int /*value*/) override;48 MirWindowAttrib /*attrib*/, int /*value*/) override;
4949
50 void destroying_surface(50 void destroying_surface(
51 scene::Session const& /*session*/,51 scene::Session const& /*session*/,
5252
=== modified file 'src/server/scene/application_session.cpp'
--- src/server/scene/application_session.cpp 2016-11-09 02:30:14 +0000
+++ src/server/scene/application_session.cpp 2017-01-10 20:52:04 +0000
@@ -140,11 +140,11 @@
140 surface_stack->add_surface(surface, params.input_mode);140 surface_stack->add_surface(surface, params.input_mode);
141141
142 if (params.state.is_set())142 if (params.state.is_set())
143 surface->configure(mir_surface_attrib_state, params.state.value());143 surface->configure(mir_window_attrib_state, params.state.value());
144 if (params.type.is_set())144 if (params.type.is_set())
145 surface->configure(mir_surface_attrib_type, params.type.value());145 surface->configure(mir_window_attrib_type, params.type.value());
146 if (params.preferred_orientation.is_set())146 if (params.preferred_orientation.is_set())
147 surface->configure(mir_surface_attrib_preferred_orientation, params.preferred_orientation.value());147 surface->configure(mir_window_attrib_preferred_orientation, params.preferred_orientation.value());
148 if (params.input_shape.is_set())148 if (params.input_shape.is_set())
149 surface->set_input_region(params.input_shape.value());149 surface->set_input_region(params.input_shape.value());
150150
@@ -211,17 +211,17 @@
211 {211 {
212 switch (s.second->type())212 switch (s.second->type())
213 {213 {
214 case mir_surface_type_normal: /**< AKA "regular" */214 case mir_window_type_normal: /**< AKA "regular" */
215 case mir_surface_type_utility: /**< AKA "floating" */215 case mir_window_type_utility: /**< AKA "floating" */
216 case mir_surface_type_dialog:216 case mir_window_type_dialog:
217 case mir_surface_type_satellite: /**< AKA "toolbox"/"toolbar" */217 case mir_window_type_satellite: /**< AKA "toolbox"/"toolbar" */
218 case mir_surface_type_freestyle:218 case mir_window_type_freestyle:
219 case mir_surface_type_menu:219 case mir_window_type_menu:
220 case mir_surface_type_inputmethod: /**< AKA "OSK" or handwriting etc. */220 case mir_window_type_inputmethod: /**< AKA "OSK" or handwriting etc. */
221 return true;221 return true;
222222
223 case mir_surface_type_gloss:223 case mir_window_type_gloss:
224 case mir_surface_type_tip: /**< AKA "tooltip" */224 case mir_window_type_tip: /**< AKA "tooltip" */
225 default:225 default:
226 // Cannot have input focus - skip it226 // Cannot have input focus - skip it
227 return false;227 return false;
228228
=== modified file 'src/server/scene/basic_surface.cpp'
--- src/server/scene/basic_surface.cpp 2016-12-09 02:54:31 +0000
+++ src/server/scene/basic_surface.cpp 2017-01-10 20:52:04 +0000
@@ -49,7 +49,7 @@
49namespace geom = mir::geometry;49namespace geom = mir::geometry;
50namespace mrs = mir::renderer::software;50namespace mrs = mir::renderer::software;
5151
52void ms::SurfaceObservers::attrib_changed(MirSurfaceAttrib attrib, int value)52void ms::SurfaceObservers::attrib_changed(MirWindowAttrib attrib, int value)
53{53{
54 for_each([&](std::shared_ptr<SurfaceObserver> const& observer)54 for_each([&](std::shared_ptr<SurfaceObserver> const& observer)
55 { observer->attrib_changed(attrib, value); });55 { observer->attrib_changed(attrib, value); });
@@ -457,17 +457,17 @@
457 observers.reception_mode_set_to(mode);457 observers.reception_mode_set_to(mode);
458}458}
459459
460MirSurfaceType ms::BasicSurface::type() const460MirWindowType ms::BasicSurface::type() const
461{ 461{
462 std::unique_lock<std::mutex> lg(guard);462 std::unique_lock<std::mutex> lg(guard);
463 return type_;463 return type_;
464}464}
465465
466MirSurfaceType ms::BasicSurface::set_type(MirSurfaceType t)466MirWindowType ms::BasicSurface::set_type(MirWindowType t)
467{467{
468 std::unique_lock<std::mutex> lg(guard);468 std::unique_lock<std::mutex> lg(guard);
469 469
470 if (t < 0 || t > mir_surface_types)470 if (t < 0 || t > mir_window_types)
471 {471 {
472 BOOST_THROW_EXCEPTION(std::logic_error("Invalid surface "472 BOOST_THROW_EXCEPTION(std::logic_error("Invalid surface "
473 "type."));473 "type."));
@@ -478,7 +478,7 @@
478 type_ = t;478 type_ = t;
479 lg.unlock();479 lg.unlock();
480480
481 observers.attrib_changed(mir_surface_attrib_type, type_); 481 observers.attrib_changed(mir_window_attrib_type, type_);
482 }482 }
483483
484 return t;484 return t;
@@ -500,7 +500,7 @@
500 {500 {
501 state_ = s;501 state_ = s;
502 lg.unlock();502 lg.unlock();
503 observers.attrib_changed(mir_surface_attrib_state, s);503 observers.attrib_changed(mir_window_attrib_state, s);
504 }504 }
505505
506 return s;506 return s;
@@ -522,7 +522,7 @@
522 info.stream->allow_framedropping(allow_dropping);522 info.stream->allow_framedropping(allow_dropping);
523523
524 lg.unlock();524 lg.unlock();
525 observers.attrib_changed(mir_surface_attrib_swapinterval, interval);525 observers.attrib_changed(mir_window_attrib_swapinterval, interval);
526 }526 }
527527
528 return interval;528 return interval;
@@ -542,7 +542,7 @@
542 focus_ = new_state;542 focus_ = new_state;
543543
544 lg.unlock();544 lg.unlock();
545 observers.attrib_changed(mir_surface_attrib_focus, new_state);545 observers.attrib_changed(mir_window_attrib_focus, new_state);
546 }546 }
547547
548 return new_state;548 return new_state;
@@ -561,36 +561,36 @@
561 pref_orientation_mode = new_orientation_mode;561 pref_orientation_mode = new_orientation_mode;
562 lg.unlock();562 lg.unlock();
563563
564 observers.attrib_changed(mir_surface_attrib_preferred_orientation, new_orientation_mode);564 observers.attrib_changed(mir_window_attrib_preferred_orientation, new_orientation_mode);
565 }565 }
566566
567 return new_orientation_mode;567 return new_orientation_mode;
568}568}
569569
570int ms::BasicSurface::configure(MirSurfaceAttrib attrib, int value)570int ms::BasicSurface::configure(MirWindowAttrib attrib, int value)
571{571{
572 int result = value;572 int result = value;
573 switch (attrib)573 switch (attrib)
574 {574 {
575 case mir_surface_attrib_type:575 case mir_window_attrib_type:
576 result = set_type(static_cast<MirSurfaceType>(result));576 result = set_type(static_cast<MirWindowType>(result));
577 break;577 break;
578 case mir_surface_attrib_state:578 case mir_window_attrib_state:
579 result = set_state(static_cast<MirSurfaceState>(result));579 result = set_state(static_cast<MirSurfaceState>(result));
580 break;580 break;
581 case mir_surface_attrib_focus:581 case mir_window_attrib_focus:
582 result = set_focus_state(static_cast<MirSurfaceFocusState>(result));582 result = set_focus_state(static_cast<MirSurfaceFocusState>(result));
583 break;583 break;
584 case mir_surface_attrib_swapinterval:584 case mir_window_attrib_swapinterval:
585 result = set_swap_interval(result);585 result = set_swap_interval(result);
586 break;586 break;
587 case mir_surface_attrib_dpi:587 case mir_window_attrib_dpi:
588 result = set_dpi(result);588 result = set_dpi(result);
589 break;589 break;
590 case mir_surface_attrib_visibility:590 case mir_window_attrib_visibility:
591 result = set_visibility(static_cast<MirSurfaceVisibility>(result));591 result = set_visibility(static_cast<MirSurfaceVisibility>(result));
592 break;592 break;
593 case mir_surface_attrib_preferred_orientation:593 case mir_window_attrib_preferred_orientation:
594 result = set_preferred_orientation(static_cast<MirOrientationMode>(result));594 result = set_preferred_orientation(static_cast<MirOrientationMode>(result));
595 break;595 break;
596 default:596 default:
@@ -600,18 +600,18 @@
600 return result;600 return result;
601}601}
602602
603int ms::BasicSurface::query(MirSurfaceAttrib attrib) const603int ms::BasicSurface::query(MirWindowAttrib attrib) const
604{604{
605 std::unique_lock<std::mutex> lg(guard);605 std::unique_lock<std::mutex> lg(guard);
606 switch (attrib)606 switch (attrib)
607 {607 {
608 case mir_surface_attrib_type: return type_;608 case mir_window_attrib_type: return type_;
609 case mir_surface_attrib_state: return state_;609 case mir_window_attrib_state: return state_;
610 case mir_surface_attrib_swapinterval: return swapinterval_;610 case mir_window_attrib_swapinterval: return swapinterval_;
611 case mir_surface_attrib_focus: return focus_;611 case mir_window_attrib_focus: return focus_;
612 case mir_surface_attrib_dpi: return dpi_;612 case mir_window_attrib_dpi: return dpi_;
613 case mir_surface_attrib_visibility: return visibility_;613 case mir_window_attrib_visibility: return visibility_;
614 case mir_surface_attrib_preferred_orientation: return pref_orientation_mode;614 case mir_window_attrib_preferred_orientation: return pref_orientation_mode;
615 default: BOOST_THROW_EXCEPTION(std::logic_error("Invalid surface "615 default: BOOST_THROW_EXCEPTION(std::logic_error("Invalid surface "
616 "attribute."));616 "attribute."));
617 }617 }
@@ -742,7 +742,7 @@
742 {742 {
743 dpi_ = new_dpi;743 dpi_ = new_dpi;
744 lg.unlock();744 lg.unlock();
745 observers.attrib_changed(mir_surface_attrib_dpi, new_dpi);745 observers.attrib_changed(mir_window_attrib_dpi, new_dpi);
746 }746 }
747 747
748 return new_dpi;748 return new_dpi;
@@ -766,7 +766,7 @@
766 for (auto& info : layers)766 for (auto& info : layers)
767 info.stream->drop_old_buffers();767 info.stream->drop_old_buffers();
768 }768 }
769 observers.attrib_changed(mir_surface_attrib_visibility, visibility_);769 observers.attrib_changed(mir_window_attrib_visibility, visibility_);
770 }770 }
771771
772 return new_visibility;772 return new_visibility;
773773
=== modified file 'src/server/scene/basic_surface.h'
--- src/server/scene/basic_surface.h 2016-12-09 02:54:31 +0000
+++ src/server/scene/basic_surface.h 2017-01-10 20:52:04 +0000
@@ -117,10 +117,10 @@
117 graphics::RenderableList generate_renderables(compositor::CompositorID id) const override;117 graphics::RenderableList generate_renderables(compositor::CompositorID id) const override;
118 int buffers_ready_for_compositor(void const* compositor_id) const override;118 int buffers_ready_for_compositor(void const* compositor_id) const override;
119119
120 MirSurfaceType type() const override;120 MirWindowType type() const override;
121 MirSurfaceState state() const override;121 MirSurfaceState state() const override;
122 int configure(MirSurfaceAttrib attrib, int value) override;122 int configure(MirWindowAttrib attrib, int value) override;
123 int query(MirSurfaceAttrib attrib) const override;123 int query(MirWindowAttrib attrib) const override;
124 void hide() override;124 void hide() override;
125 void show() override;125 void show() override;
126 126
@@ -152,7 +152,7 @@
152152
153private:153private:
154 bool visible(std::unique_lock<std::mutex>&) const;154 bool visible(std::unique_lock<std::mutex>&) const;
155 MirSurfaceType set_type(MirSurfaceType t); // Use configure() to make public changes155 MirWindowType set_type(MirWindowType t); // Use configure() to make public changes
156 MirSurfaceState set_state(MirSurfaceState s);156 MirSurfaceState set_state(MirSurfaceState s);
157 int set_dpi(int);157 int set_dpi(int);
158 MirSurfaceVisibility set_visibility(MirSurfaceVisibility v);158 MirSurfaceVisibility set_visibility(MirSurfaceVisibility v);
@@ -178,7 +178,7 @@
178178
179 std::list<StreamInfo> layers;179 std::list<StreamInfo> layers;
180 // Surface attributes:180 // Surface attributes:
181 MirSurfaceType type_ = mir_surface_type_normal;181 MirWindowType type_ = mir_window_type_normal;
182 MirSurfaceState state_ = mir_surface_state_restored;182 MirSurfaceState state_ = mir_surface_state_restored;
183 int swapinterval_ = 1;183 int swapinterval_ = 1;
184 MirSurfaceFocusState focus_ = mir_surface_unfocused;184 MirSurfaceFocusState focus_ = mir_surface_unfocused;
185185
=== modified file 'src/server/scene/legacy_surface_change_notification.cpp'
--- src/server/scene/legacy_surface_change_notification.cpp 2016-10-31 02:37:31 +0000
+++ src/server/scene/legacy_surface_change_notification.cpp 2017-01-10 20:52:04 +0000
@@ -67,7 +67,7 @@
67}67}
6868
69// An attrib change alone is not enough to trigger recomposition.69// An attrib change alone is not enough to trigger recomposition.
70void ms::LegacySurfaceChangeNotification::attrib_changed(MirSurfaceAttrib /* attrib */, int /* value */)70void ms::LegacySurfaceChangeNotification::attrib_changed(MirWindowAttrib /* attrib */, int /* value */)
71{71{
72}72}
7373
7474
=== modified file 'src/server/scene/legacy_surface_change_notification.h'
--- src/server/scene/legacy_surface_change_notification.h 2016-10-31 02:37:31 +0000
+++ src/server/scene/legacy_surface_change_notification.h 2017-01-10 20:52:04 +0000
@@ -41,7 +41,7 @@
41 void alpha_set_to(float /*alpha*/) override;41 void alpha_set_to(float /*alpha*/) override;
42 void orientation_set_to(MirOrientation orientation) override;42 void orientation_set_to(MirOrientation orientation) override;
43 void transformation_set_to(glm::mat4 const& /*t*/) override;43 void transformation_set_to(glm::mat4 const& /*t*/) override;
44 void attrib_changed(MirSurfaceAttrib, int) override;44 void attrib_changed(MirWindowAttrib, int) override;
45 void reception_mode_set_to(input::InputReceptionMode mode) override;45 void reception_mode_set_to(input::InputReceptionMode mode) override;
46 void cursor_image_set_to(graphics::CursorImage const& image) override;46 void cursor_image_set_to(graphics::CursorImage const& image) override;
47 void client_surface_close_requested() override;47 void client_surface_close_requested() override;
4848
=== modified file 'src/server/scene/null_surface_observer.cpp'
--- src/server/scene/null_surface_observer.cpp 2016-10-31 02:37:31 +0000
+++ src/server/scene/null_surface_observer.cpp 2017-01-10 20:52:04 +0000
@@ -21,7 +21,7 @@
21namespace ms = mir::scene;21namespace ms = mir::scene;
22namespace mg = mir::graphics;22namespace mg = mir::graphics;
2323
24void ms::NullSurfaceObserver::attrib_changed(MirSurfaceAttrib /*attrib*/, int /*value*/) {}24void ms::NullSurfaceObserver::attrib_changed(MirWindowAttrib /*attrib*/, int /*value*/) {}
25void ms::NullSurfaceObserver::resized_to(geometry::Size const& /*size*/) {}25void ms::NullSurfaceObserver::resized_to(geometry::Size const& /*size*/) {}
26void ms::NullSurfaceObserver::moved_to(geometry::Point const& /*top_left*/) {}26void ms::NullSurfaceObserver::moved_to(geometry::Point const& /*top_left*/) {}
27void ms::NullSurfaceObserver::hidden_set_to(bool /*hide*/) {}27void ms::NullSurfaceObserver::hidden_set_to(bool /*hide*/) {}
2828
=== modified file 'src/server/scene/rendering_tracker.cpp'
--- src/server/scene/rendering_tracker.cpp 2016-01-29 08:18:22 +0000
+++ src/server/scene/rendering_tracker.cpp 2017-01-10 20:52:04 +0000
@@ -88,7 +88,7 @@
88void ms::RenderingTracker::configure_visibility(MirSurfaceVisibility visibility)88void ms::RenderingTracker::configure_visibility(MirSurfaceVisibility visibility)
89{89{
90 if (auto const surface = weak_surface.lock())90 if (auto const surface = weak_surface.lock())
91 surface->configure(mir_surface_attrib_visibility, visibility);91 surface->configure(mir_window_attrib_visibility, visibility);
92}92}
9393
94void ms::RenderingTracker::remove_occlusions_for_inactive_compositors()94void ms::RenderingTracker::remove_occlusions_for_inactive_compositors()
9595
=== modified file 'src/server/scene/surface_creation_parameters.cpp'
--- src/server/scene/surface_creation_parameters.cpp 2016-01-29 08:18:22 +0000
+++ src/server/scene/surface_creation_parameters.cpp 2017-01-10 20:52:04 +0000
@@ -92,7 +92,7 @@
92}92}
9393
9494
95ms::SurfaceCreationParameters& ms::SurfaceCreationParameters::of_type(MirSurfaceType the_type)95ms::SurfaceCreationParameters& ms::SurfaceCreationParameters::of_type(MirWindowType the_type)
96{96{
97 type = the_type;97 type = the_type;
98 return *this;98 return *this;
9999
=== modified file 'src/server/scene/surface_event_source.cpp'
--- src/server/scene/surface_event_source.cpp 2016-10-31 02:37:31 +0000
+++ src/server/scene/surface_event_source.cpp 2017-01-10 20:52:04 +0000
@@ -65,7 +65,7 @@
65 }65 }
66}66}
6767
68void ms::SurfaceEventSource::attrib_changed(MirSurfaceAttrib attrib, int value)68void ms::SurfaceEventSource::attrib_changed(MirWindowAttrib attrib, int value)
69{69{
70 event_sink->handle_event(*mev::make_event(id, attrib, value));70 event_sink->handle_event(*mev::make_event(id, attrib, value));
71}71}
7272
=== modified file 'src/server/scene/surface_stack.cpp'
--- src/server/scene/surface_stack.cpp 2016-07-18 07:38:38 +0000
+++ src/server/scene/surface_stack.cpp 2017-01-10 20:52:04 +0000
@@ -309,7 +309,7 @@
309 RecursiveReadLock lg(guard);309 RecursiveReadLock lg(guard);
310 for (auto &surface : surfaces)310 for (auto &surface : surfaces)
311 {311 {
312 if (surface->query(mir_surface_attrib_visibility) ==312 if (surface->query(mir_window_attrib_visibility) ==
313 MirSurfaceVisibility::mir_surface_visibility_exposed)313 MirSurfaceVisibility::mir_surface_visibility_exposed)
314 {314 {
315 callback(surface);315 callback(surface);
316316
=== modified file 'src/server/shell/abstract_shell.cpp'
--- src/server/shell/abstract_shell.cpp 2016-11-09 02:30:14 +0000
+++ src/server/shell/abstract_shell.cpp 2017-01-10 20:52:04 +0000
@@ -209,7 +209,7 @@
209int msh::AbstractShell::set_surface_attribute(209int msh::AbstractShell::set_surface_attribute(
210 std::shared_ptr<ms::Session> const& session,210 std::shared_ptr<ms::Session> const& session,
211 std::shared_ptr<ms::Surface> const& surface,211 std::shared_ptr<ms::Surface> const& surface,
212 MirSurfaceAttrib attrib,212 MirWindowAttrib attrib,
213 int value)213 int value)
214{214{
215 report->update_surface(*session, *surface, attrib, value);215 report->update_surface(*session, *surface, attrib, value);
@@ -218,7 +218,7 @@
218218
219int msh::AbstractShell::get_surface_attribute(219int msh::AbstractShell::get_surface_attribute(
220 std::shared_ptr<ms::Surface> const& surface,220 std::shared_ptr<ms::Surface> const& surface,
221 MirSurfaceAttrib attrib)221 MirWindowAttrib attrib)
222{222{
223 return surface->query(attrib);223 return surface->query(attrib);
224}224}
@@ -289,7 +289,7 @@
289289
290 if (current_focus)290 if (current_focus)
291 {291 {
292 current_focus->configure(mir_surface_attrib_focus, mir_surface_unfocused);292 current_focus->configure(mir_window_attrib_focus, mir_surface_unfocused);
293 current_focus->remove_observer(focus_surface_observer);293 current_focus->remove_observer(focus_surface_observer);
294 }294 }
295295
@@ -303,7 +303,7 @@
303 // Ensure the surface has really taken the focus before notifying it that it is focused303 // Ensure the surface has really taken the focus before notifying it that it is focused
304 input_targeter->set_focus(surface);304 input_targeter->set_focus(surface);
305 surface->consume(seat->create_device_state().get());305 surface->consume(seat->create_device_state().get());
306 surface->configure(mir_surface_attrib_focus, mir_surface_focused);306 surface->configure(mir_window_attrib_focus, mir_surface_focused);
307 surface->add_observer(focus_surface_observer);307 surface->add_observer(focus_surface_observer);
308 }308 }
309 else309 else
310310
=== modified file 'src/server/shell/basic_window_manager.cpp'
--- src/server/shell/basic_window_manager.cpp 2016-02-29 15:25:14 +0000
+++ src/server/shell/basic_window_manager.cpp 2017-01-10 20:52:04 +0000
@@ -138,13 +138,13 @@
138int msh::BasicWindowManager::set_surface_attribute(138int msh::BasicWindowManager::set_surface_attribute(
139 std::shared_ptr<scene::Session> const& /*session*/,139 std::shared_ptr<scene::Session> const& /*session*/,
140 std::shared_ptr<scene::Surface> const& surface,140 std::shared_ptr<scene::Surface> const& surface,
141 MirSurfaceAttrib attrib,141 MirWindowAttrib attrib,
142 int value)142 int value)
143{143{
144 std::lock_guard<decltype(mutex)> lock(mutex);144 std::lock_guard<decltype(mutex)> lock(mutex);
145 switch (attrib)145 switch (attrib)
146 {146 {
147 case mir_surface_attrib_state:147 case mir_window_attrib_state:
148 {148 {
149 auto const state = policy->handle_set_state(surface, MirSurfaceState(value));149 auto const state = policy->handle_set_state(surface, MirSurfaceState(value));
150 return surface->configure(attrib, state);150 return surface->configure(attrib, state);
151151
=== modified file 'src/server/shell/canonical_window_manager.cpp'
--- src/server/shell/canonical_window_manager.cpp 2016-12-09 02:54:31 +0000
+++ src/server/shell/canonical_window_manager.cpp 2017-01-10 20:52:04 +0000
@@ -41,12 +41,12 @@
41// but is currently used when placing the surface before construction.41// but is currently used when placing the surface before construction.
42// Which implies we need some rework so that we can construct metadata42// Which implies we need some rework so that we can construct metadata
43// before the surface.43// before the surface.
44bool must_not_have_parent(MirSurfaceType type)44bool must_not_have_parent(MirWindowType type)
45{45{
46 switch (type)46 switch (type)
47 {47 {
48 case mir_surface_type_normal:48 case mir_window_type_normal:
49 case mir_surface_type_utility:49 case mir_window_type_utility:
50 return true;50 return true;
5151
52 default:52 default:
@@ -58,13 +58,13 @@
58// but is currently used when placing the surface before construction.58// but is currently used when placing the surface before construction.
59// Which implies we need some rework so that we can construct metadata59// Which implies we need some rework so that we can construct metadata
60// before the surface.60// before the surface.
61bool must_have_parent(MirSurfaceType type)61bool must_have_parent(MirWindowType type)
62{62{
63 switch (type)63 switch (type)
64 {64 {
65 case mir_surface_type_overlay:;65 case mir_window_type_gloss:;
66 case mir_surface_type_satellite:66 case mir_window_type_satellite:
67 case mir_surface_type_tip:67 case mir_window_type_tip:
68 return true;68 return true;
6969
70 default:70 default:
@@ -334,7 +334,7 @@
334 throw std::runtime_error("Target surface type requires parent");334 throw std::runtime_error("Target surface type requires parent");
335 }335 }
336336
337 surface->configure(mir_surface_attrib_type, new_type);337 surface->configure(mir_window_attrib_type, new_type);
338 }338 }
339339
340 #define COPY_IF_SET(field)\340 #define COPY_IF_SET(field)\
@@ -406,7 +406,7 @@
406 if (modifications.state.is_set())406 if (modifications.state.is_set())
407 {407 {
408 auto const state = handle_set_state(surface, modifications.state.value());408 auto const state = handle_set_state(surface, modifications.state.value());
409 surface->configure(mir_surface_attrib_state, state);409 surface->configure(mir_window_attrib_state, state);
410 }410 }
411411
412 if (modifications.confine_pointer.is_set())412 if (modifications.confine_pointer.is_set())
@@ -780,7 +780,7 @@
780 state = mir_surface_state_restored;780 state = mir_surface_state_restored;
781781
782 auto const value = handle_set_state(surface, MirSurfaceState(state));782 auto const value = handle_set_state(surface, MirSurfaceState(state));
783 surface->configure(mir_surface_attrib_state, value);783 surface->configure(mir_window_attrib_state, value);
784 }784 }
785}785}
786786
787787
=== modified file 'src/server/shell/frontend_shell.cpp'
--- src/server/shell/frontend_shell.cpp 2016-01-29 08:18:22 +0000
+++ src/server/shell/frontend_shell.cpp 2017-01-10 20:52:04 +0000
@@ -83,9 +83,9 @@
83 // in the surface spec requirements (eg: regular surface has no parent,83 // in the surface spec requirements (eg: regular surface has no parent,
84 // dialog may have a parent, gloss must have a parent).84 // dialog may have a parent, gloss must have a parent).
85 if (populated_params.parent.lock() &&85 if (populated_params.parent.lock() &&
86 populated_params.type.value() != mir_surface_type_inputmethod)86 populated_params.type.value() != mir_window_type_inputmethod)
87 {87 {
88 BOOST_THROW_EXCEPTION(std::invalid_argument("Foreign parents may only be set on surfaces of type mir_surface_type_inputmethod"));88 BOOST_THROW_EXCEPTION(std::invalid_argument("Foreign parents may only be set on surfaces of type mir_window_type_inputmethod"));
89 }89 }
9090
91 if (populated_params.parent_id.is_set())91 if (populated_params.parent_id.is_set())
@@ -130,7 +130,7 @@
130int msh::FrontendShell::set_surface_attribute(130int msh::FrontendShell::set_surface_attribute(
131 std::shared_ptr<mf::Session> const& session,131 std::shared_ptr<mf::Session> const& session,
132 mf::SurfaceId surface_id,132 mf::SurfaceId surface_id,
133 MirSurfaceAttrib attrib,133 MirWindowAttrib attrib,
134 int value)134 int value)
135{135{
136 auto const scene_session = std::dynamic_pointer_cast<ms::Session>(session);136 auto const scene_session = std::dynamic_pointer_cast<ms::Session>(session);
@@ -141,7 +141,7 @@
141int msh::FrontendShell::get_surface_attribute(141int msh::FrontendShell::get_surface_attribute(
142 std::shared_ptr<mf::Session> const& session,142 std::shared_ptr<mf::Session> const& session,
143 mf::SurfaceId surface_id,143 mf::SurfaceId surface_id,
144 MirSurfaceAttrib attrib)144 MirWindowAttrib attrib)
145{145{
146 auto const scene_session = std::dynamic_pointer_cast<ms::Session>(session);146 auto const scene_session = std::dynamic_pointer_cast<ms::Session>(session);
147 auto const surface = scene_session->surface(surface_id);147 auto const surface = scene_session->surface(surface_id);
148148
=== modified file 'src/server/shell/frontend_shell.h'
--- src/server/shell/frontend_shell.h 2016-01-29 08:18:22 +0000
+++ src/server/shell/frontend_shell.h 2017-01-10 20:52:04 +0000
@@ -79,13 +79,13 @@
79 int set_surface_attribute(79 int set_surface_attribute(
80 std::shared_ptr<mf::Session> const& session,80 std::shared_ptr<mf::Session> const& session,
81 mf::SurfaceId surface_id,81 mf::SurfaceId surface_id,
82 MirSurfaceAttrib attrib,82 MirWindowAttrib attrib,
83 int value) override;83 int value) override;
8484
85 int get_surface_attribute(85 int get_surface_attribute(
86 std::shared_ptr<mf::Session> const& session,86 std::shared_ptr<mf::Session> const& session,
87 mf::SurfaceId surface_id,87 mf::SurfaceId surface_id,
88 MirSurfaceAttrib attrib) override;88 MirWindowAttrib attrib) override;
8989
90 void raise_surface(90 void raise_surface(
91 std::shared_ptr<mf::Session> const& session,91 std::shared_ptr<mf::Session> const& session,
9292
=== modified file 'src/server/shell/shell_wrapper.cpp'
--- src/server/shell/shell_wrapper.cpp 2016-01-29 08:18:22 +0000
+++ src/server/shell/shell_wrapper.cpp 2017-01-10 20:52:04 +0000
@@ -99,7 +99,7 @@
99int msh::ShellWrapper::set_surface_attribute(99int msh::ShellWrapper::set_surface_attribute(
100 std::shared_ptr<ms::Session> const& session,100 std::shared_ptr<ms::Session> const& session,
101 std::shared_ptr<ms::Surface> const& surface,101 std::shared_ptr<ms::Surface> const& surface,
102 MirSurfaceAttrib attrib,102 MirWindowAttrib attrib,
103 int value)103 int value)
104{104{
105 return wrapped->set_surface_attribute(session, surface, attrib, value);105 return wrapped->set_surface_attribute(session, surface, attrib, value);
@@ -107,7 +107,7 @@
107107
108int msh::ShellWrapper::get_surface_attribute(108int msh::ShellWrapper::get_surface_attribute(
109 std::shared_ptr<ms::Surface> const& surface,109 std::shared_ptr<ms::Surface> const& surface,
110 MirSurfaceAttrib attrib)110 MirWindowAttrib attrib)
111{111{
112 return wrapped->get_surface_attribute(surface, attrib);112 return wrapped->get_surface_attribute(surface, attrib);
113}113}
114114
=== modified file 'src/server/shell/system_compositor_window_manager.cpp'
--- src/server/shell/system_compositor_window_manager.cpp 2016-07-18 07:38:38 +0000
+++ src/server/shell/system_compositor_window_manager.cpp 2017-01-10 20:52:04 +0000
@@ -168,7 +168,7 @@
168int msh::SystemCompositorWindowManager::set_surface_attribute(168int msh::SystemCompositorWindowManager::set_surface_attribute(
169 std::shared_ptr<ms::Session> const& /*session*/,169 std::shared_ptr<ms::Session> const& /*session*/,
170 std::shared_ptr<ms::Surface> const& surface,170 std::shared_ptr<ms::Surface> const& surface,
171 MirSurfaceAttrib attrib,171 MirWindowAttrib attrib,
172 int value)172 int value)
173{173{
174 return surface->configure(attrib, value);174 return surface->configure(attrib, value);
175175
=== modified file 'src/server/shell/window_management_info.cpp'
--- src/server/shell/window_management_info.cpp 2016-02-29 15:25:14 +0000
+++ src/server/shell/window_management_info.cpp 2017-01-10 20:52:04 +0000
@@ -56,17 +56,17 @@
56{56{
57 switch (type)57 switch (type)
58 {58 {
59 case mir_surface_type_normal: /**< AKA "regular" */59 case mir_window_type_normal: /**< AKA "regular" */
60 case mir_surface_type_utility: /**< AKA "floating" */60 case mir_window_type_utility: /**< AKA "floating" */
61 case mir_surface_type_dialog:61 case mir_window_type_dialog:
62 case mir_surface_type_satellite: /**< AKA "toolbox"/"toolbar" */62 case mir_window_type_satellite: /**< AKA "toolbox"/"toolbar" */
63 case mir_surface_type_freestyle:63 case mir_window_type_freestyle:
64 case mir_surface_type_menu:64 case mir_window_type_menu:
65 case mir_surface_type_inputmethod: /**< AKA "OSK" or handwriting etc. */65 case mir_window_type_inputmethod: /**< AKA "OSK" or handwriting etc. */
66 return true;66 return true;
6767
68 case mir_surface_type_gloss:68 case mir_window_type_gloss:
69 case mir_surface_type_tip: /**< AKA "tooltip" */69 case mir_window_type_tip: /**< AKA "tooltip" */
70 default:70 default:
71 // Cannot have input focus71 // Cannot have input focus
72 return false;72 return false;
@@ -77,10 +77,10 @@
77{77{
78 switch (type)78 switch (type)
79 {79 {
80 case mir_surface_type_overlay:;80 case mir_window_type_gloss:;
81 case mir_surface_type_inputmethod:81 case mir_window_type_inputmethod:
82 case mir_surface_type_satellite:82 case mir_window_type_satellite:
83 case mir_surface_type_tip:83 case mir_window_type_tip:
84 return true;84 return true;
8585
86 default:86 default:
@@ -88,19 +88,19 @@
88 }88 }
89}89}
9090
91bool msh::SurfaceInfo::can_morph_to(MirSurfaceType new_type) const91bool msh::SurfaceInfo::can_morph_to(MirWindowType new_type) const
92{92{
93 switch (new_type)93 switch (new_type)
94 {94 {
95 case mir_surface_type_normal:95 case mir_window_type_normal:
96 case mir_surface_type_utility:96 case mir_window_type_utility:
97 case mir_surface_type_satellite:97 case mir_window_type_satellite:
98 switch (type)98 switch (type)
99 {99 {
100 case mir_surface_type_normal:100 case mir_window_type_normal:
101 case mir_surface_type_utility:101 case mir_window_type_utility:
102 case mir_surface_type_dialog:102 case mir_window_type_dialog:
103 case mir_surface_type_satellite:103 case mir_window_type_satellite:
104 return true;104 return true;
105105
106 default:106 default:
@@ -108,14 +108,14 @@
108 }108 }
109 break;109 break;
110110
111 case mir_surface_type_dialog:111 case mir_window_type_dialog:
112 switch (type)112 switch (type)
113 {113 {
114 case mir_surface_type_normal:114 case mir_window_type_normal:
115 case mir_surface_type_utility:115 case mir_window_type_utility:
116 case mir_surface_type_dialog:116 case mir_window_type_dialog:
117 case mir_surface_type_popover:117 case mir_window_type_popover:
118 case mir_surface_type_satellite:118 case mir_window_type_satellite:
119 return true;119 return true;
120120
121 default:121 default:
@@ -134,8 +134,8 @@
134{134{
135 switch (type)135 switch (type)
136 {136 {
137 case mir_surface_type_normal:137 case mir_window_type_normal:
138 case mir_surface_type_utility:138 case mir_window_type_utility:
139 return true;139 return true;
140140
141 default:141 default:
@@ -284,15 +284,15 @@
284 requested_size = new_size;284 requested_size = new_size;
285}285}
286286
287bool msh::SurfaceInfo::needs_titlebar(MirSurfaceType type)287bool msh::SurfaceInfo::needs_titlebar(MirWindowType type)
288{288{
289 switch (type)289 switch (type)
290 {290 {
291 case mir_surface_type_freestyle:291 case mir_window_type_freestyle:
292 case mir_surface_type_menu:292 case mir_window_type_menu:
293 case mir_surface_type_inputmethod:293 case mir_window_type_inputmethod:
294 case mir_surface_type_gloss:294 case mir_window_type_gloss:
295 case mir_surface_type_tip:295 case mir_window_type_tip:
296 // No decorations for these surface types296 // No decorations for these surface types
297 return false;297 return false;
298 default:298 default:
299299
=== modified file 'src/utils/vanity.c'
--- src/utils/vanity.c 2017-01-09 06:48:47 +0000
+++ src/utils/vanity.c 2017-01-10 20:52:04 +0000
@@ -135,12 +135,12 @@
135 return false;135 return false;
136}136}
137137
138static bool on_surface_event(MirSurfaceEvent const* sevent, State* state)138static bool on_surface_event(MirWindowEvent const* wevent, State* state)
139{139{
140 MirSurfaceAttrib attrib = mir_surface_event_get_attribute(sevent);140 MirWindowAttrib attrib = mir_window_event_get_attribute(wevent);
141 int value = mir_surface_event_get_attribute_value(sevent);141 int value = mir_window_event_get_attribute_value(wevent);
142142
143 if (attrib == mir_surface_attrib_visibility)143 if (attrib == mir_window_attrib_visibility)
144 {144 {
145 if (value == mir_surface_visibility_exposed)145 if (value == mir_surface_visibility_exposed)
146 {146 {
@@ -172,8 +172,8 @@
172 case mir_event_type_input:172 case mir_event_type_input:
173 handled = on_input_event(mir_event_get_input_event(event), state);173 handled = on_input_event(mir_event_get_input_event(event), state);
174 break;174 break;
175 case mir_event_type_surface:175 case mir_event_type_window:
176 handled = on_surface_event(mir_event_get_surface_event(event), state);176 handled = on_surface_event(mir_event_get_window_event(event), state);
177 break;177 break;
178 case mir_event_type_resize:178 case mir_event_type_resize:
179 state->resized = true;179 state->resized = true;
180180
=== modified file 'tests/acceptance-tests/test_client_cookie.cpp'
--- tests/acceptance-tests/test_client_cookie.cpp 2017-01-09 06:48:47 +0000
+++ tests/acceptance-tests/test_client_cookie.cpp 2017-01-10 20:52:04 +0000
@@ -101,20 +101,20 @@
101 auto const event_type = mir_event_get_type(ev);101 auto const event_type = mir_event_get_type(ev);
102 auto client_cookie = static_cast<ClientCookies*>(ctx);102 auto client_cookie = static_cast<ClientCookies*>(ctx);
103103
104 if (event_type == mir_event_type_surface)104 if (event_type == mir_event_type_window)
105 {105 {
106 auto event = mir_event_get_surface_event(ev);106 auto event = mir_event_get_window_event(ev);
107 auto const attrib = mir_surface_event_get_attribute(event);107 auto const attrib = mir_window_event_get_attribute(event);
108 auto const value = mir_surface_event_get_attribute_value(event);108 auto const value = mir_window_event_get_attribute_value(event);
109109
110 std::lock_guard<std::mutex> lk(client_cookie->mutex);110 std::lock_guard<std::mutex> lk(client_cookie->mutex);
111 if (attrib == mir_surface_attrib_visibility &&111 if (attrib == mir_window_attrib_visibility &&
112 value == mir_surface_visibility_exposed)112 value == mir_surface_visibility_exposed)
113 {113 {
114 client_cookie->exposed = true;114 client_cookie->exposed = true;
115 }115 }
116116
117 if (attrib == mir_surface_attrib_focus &&117 if (attrib == mir_window_attrib_focus &&
118 value == mir_surface_focused)118 value == mir_surface_focused)
119 {119 {
120 client_cookie->focused = true;120 client_cookie->focused = true;
121121
=== modified file 'tests/acceptance-tests/test_client_focus_notification.cpp'
--- tests/acceptance-tests/test_client_focus_notification.cpp 2017-01-09 06:48:47 +0000
+++ tests/acceptance-tests/test_client_focus_notification.cpp 2017-01-10 20:52:04 +0000
@@ -57,14 +57,15 @@
5757
58 static void handle_event(MirWindow* window, MirEvent const* ev, void* context)58 static void handle_event(MirWindow* window, MirEvent const* ev, void* context)
59 {59 {
60 if (mir_event_type_surface == mir_event_get_type(ev))60 if (mir_event_type_window == mir_event_get_type(ev))
61 {61 {
62 auto surface_ev = mir_event_get_surface_event(ev);62 auto surface_ev = mir_event_get_window_event(ev);
63 if (mir_surface_attrib_focus == mir_surface_event_get_attribute(surface_ev))63 auto attrib = mir_window_event_get_attribute(surface_ev);
64 if (mir_window_attrib_focus == attrib)
64 {65 {
65 auto self = static_cast<FocusSurface*>(context);66 auto self = static_cast<FocusSurface*>(context);
66 self->log_focus_event(window,67 self->log_focus_event(window,
67 static_cast<MirSurfaceFocusState>(mir_surface_event_get_attribute_value(surface_ev)));68 static_cast<MirSurfaceFocusState>(mir_window_event_get_attribute_value(surface_ev)));
68 }69 }
69 }70 }
70 }71 }
7172
=== modified file 'tests/acceptance-tests/test_client_input.cpp'
--- tests/acceptance-tests/test_client_input.cpp 2017-01-09 06:48:47 +0000
+++ tests/acceptance-tests/test_client_input.cpp 2017-01-10 20:52:04 +0000
@@ -112,16 +112,16 @@
112 BOOST_THROW_EXCEPTION(std::runtime_error("Timeout waiting for window to become focused and exposed"));112 BOOST_THROW_EXCEPTION(std::runtime_error("Timeout waiting for window to become focused and exposed"));
113 }113 }
114114
115 void handle_surface_event(MirSurfaceEvent const* event)115 void handle_window_event(MirWindowEvent const* event)
116 {116 {
117 auto const attrib = mir_surface_event_get_attribute(event);117 auto const attrib = mir_window_event_get_attribute(event);
118 auto const value = mir_surface_event_get_attribute_value(event);118 auto const value = mir_window_event_get_attribute_value(event);
119119
120 if (mir_surface_attrib_visibility == attrib &&120 if (mir_window_attrib_visibility == attrib &&
121 mir_surface_visibility_exposed == value)121 mir_surface_visibility_exposed == value)
122 exposed = true;122 exposed = true;
123123
124 if (mir_surface_attrib_focus == attrib &&124 if (mir_window_attrib_focus == attrib &&
125 mir_surface_focused == value)125 mir_surface_focused == value)
126 focused = true;126 focused = true;
127127
@@ -133,10 +133,10 @@
133 {133 {
134 auto const client = static_cast<Client*>(context);134 auto const client = static_cast<Client*>(context);
135 auto type = mir_event_get_type(ev);135 auto type = mir_event_get_type(ev);
136 if (type == mir_event_type_surface)136 if (type == mir_event_type_window)
137 {137 {
138 auto surface_event = mir_event_get_surface_event(ev);138 auto window_event = mir_event_get_window_event(ev);
139 client->handle_surface_event(surface_event);139 client->handle_window_event(window_event);
140140
141 }141 }
142 if (type == mir_event_type_input)142 if (type == mir_event_type_input)
143143
=== modified file 'tests/acceptance-tests/test_client_library.cpp'
--- tests/acceptance-tests/test_client_library.cpp 2017-01-09 07:03:12 +0000
+++ tests/acceptance-tests/test_client_library.cpp 2017-01-10 20:52:04 +0000
@@ -767,7 +767,7 @@
767767
768 EXPECT_THAT(native_buffer->width, Eq(width));768 EXPECT_THAT(native_buffer->width, Eq(width));
769 EXPECT_THAT(native_buffer->height, Eq(height));769 EXPECT_THAT(native_buffer->height, Eq(height));
770 EXPECT_THAT(mir_surface_get_type(window), Eq(mir_surface_type_normal));770 EXPECT_THAT(mir_window_get_type(window), Eq(mir_window_type_normal));
771771
772 mir_window_release_sync(window);772 mir_window_release_sync(window);
773 mir_connection_release(connection);773 mir_connection_release(connection);
@@ -793,7 +793,7 @@
793793
794 EXPECT_THAT(native_buffer->width, Eq(width));794 EXPECT_THAT(native_buffer->width, Eq(width));
795 EXPECT_THAT(native_buffer->height, Eq(height));795 EXPECT_THAT(native_buffer->height, Eq(height));
796 EXPECT_THAT(mir_surface_get_type(window), Eq(mir_surface_type_normal));796 EXPECT_THAT(mir_window_get_type(window), Eq(mir_window_type_normal));
797797
798 mir_window_release_sync(window);798 mir_window_release_sync(window);
799 mir_connection_release(connection);799 mir_connection_release(connection);
800800
=== modified file 'tests/acceptance-tests/test_client_surface_events.cpp'
--- tests/acceptance-tests/test_client_surface_events.cpp 2017-01-09 06:48:47 +0000
+++ tests/acceptance-tests/test_client_surface_events.cpp 2017-01-10 20:52:04 +0000
@@ -51,12 +51,56 @@
5151
52namespace52namespace
53{53{
54// Assert our MirSurfaceAttrib is 1to1 to MirWindowAttrib
55static_assert(
56 static_cast<int32_t>(mir_surface_attrib_type) ==
57 static_cast<int32_t>(mir_window_attrib_type),
58 "mir_surface_attrib_type != mir_window_attrib_type");
59
60static_assert(
61 static_cast<int32_t>(mir_surface_attrib_state) ==
62 static_cast<int32_t>(mir_window_attrib_state),
63 "mir_surface_attrib_state != mir_window_attrib_state");
64
65static_assert(
66 static_cast<int32_t>(mir_surface_attrib_swapinterval) ==
67 static_cast<int32_t>(mir_window_attrib_swapinterval),
68 "mir_surface_attrib_swapinterval != mir_window_attrib_swapinterval");
69
70static_assert(
71 static_cast<int32_t>(mir_surface_attrib_focus) ==
72 static_cast<int32_t>(mir_window_attrib_focus),
73 "mir_surface_attrib_focus != mir_window_attrib_focus");
74
75static_assert(
76 static_cast<int32_t>(mir_surface_attrib_dpi) ==
77 static_cast<int32_t>(mir_window_attrib_dpi),
78 "mir_surface_attrib_dpi != mir_window_attrib_dpi");
79
80static_assert(
81 static_cast<int32_t>(mir_surface_attrib_visibility) ==
82 static_cast<int32_t>(mir_window_attrib_visibility),
83 "mir_surface_attrib_visibility != mir_window_attrib_visibility");
84
85static_assert(
86 static_cast<int32_t>(mir_surface_attrib_preferred_orientation) ==
87 static_cast<int32_t>(mir_window_attrib_preferred_orientation),
88 "mir_surface_attrib_preferred_orientation != mir_window_attrib_preferred_orientation");
89
90static_assert(
91 static_cast<int32_t>(mir_surface_attribs) ==
92 static_cast<int32_t>(mir_window_attribs),
93 "mir_surface_attribs != mir_window_attribs");
94
95static_assert(sizeof(MirSurfaceAttrib) == sizeof(MirWindowAttrib),
96 "sizeof(MirSurfaceAttrib) != sizeof(MirWindowAttrib)");
97
54struct ClientSurfaceEvents : mtf::ConnectedClientWithASurface98struct ClientSurfaceEvents : mtf::ConnectedClientWithASurface
55{99{
56 MirSurface* other_surface;100 MirSurface* other_surface;
57101
58 std::mutex last_event_mutex;102 std::mutex last_event_mutex;
59 MirEventType event_filter{mir_event_type_surface};103 MirEventType event_filter{mir_event_type_window};
60 std::condition_variable last_event_cv;104 std::condition_variable last_event_cv;
61 MirEvent const* last_event = nullptr;105 MirEvent const* last_event = nullptr;
62 MirSurface* last_event_surface = nullptr;106 MirSurface* last_event_surface = nullptr;
@@ -158,14 +202,14 @@
158202
159 std::lock_guard<decltype(last_event_mutex)> last_event_lock{last_event_mutex};203 std::lock_guard<decltype(last_event_mutex)> last_event_lock{last_event_mutex};
160204
161 EXPECT_THAT(last_event, mt::SurfaceEvent(mir_surface_attrib_state, mir_surface_state_fullscreen));205 EXPECT_THAT(last_event, mt::WindowEvent(mir_window_attrib_state, mir_surface_state_fullscreen));
162 }206 }
163207
164 {208 {
165 mir_wait_for(mir_surface_set_state(window, static_cast<MirSurfaceState>(999)));209 mir_wait_for(mir_surface_set_state(window, static_cast<MirSurfaceState>(999)));
166210
167 std::lock_guard<decltype(last_event_mutex)> last_event_lock{last_event_mutex};211 std::lock_guard<decltype(last_event_mutex)> last_event_lock{last_event_mutex};
168 EXPECT_THAT(last_event, mt::SurfaceEvent(mir_surface_attrib_state, mir_surface_state_fullscreen));212 EXPECT_THAT(last_event, mt::WindowEvent(mir_window_attrib_state, mir_surface_state_fullscreen));
169 }213 }
170214
171 reset_last_event();215 reset_last_event();
@@ -175,7 +219,7 @@
175219
176 std::lock_guard<decltype(last_event_mutex)> last_event_lock{last_event_mutex};220 std::lock_guard<decltype(last_event_mutex)> last_event_lock{last_event_mutex};
177221
178 EXPECT_THAT(last_event, mt::SurfaceEvent(mir_surface_attrib_state, mir_surface_state_vertmaximized));222 EXPECT_THAT(last_event, mt::WindowEvent(mir_window_attrib_state, mir_surface_state_vertmaximized));
179 }223 }
180224
181 reset_last_event();225 reset_last_event();
@@ -232,7 +276,7 @@
232276
233TEST_F(ClientSurfaceEvents, surface_receives_close_event)277TEST_F(ClientSurfaceEvents, surface_receives_close_event)
234{278{
235 set_event_filter(mir_event_type_close_surface);279 set_event_filter(mir_event_type_close_window);
236280
237 scene_surface->request_client_surface_close();281 scene_surface->request_client_surface_close();
238282
@@ -241,7 +285,7 @@
241 std::lock_guard<decltype(last_event_mutex)> last_event_lock{last_event_mutex};285 std::lock_guard<decltype(last_event_mutex)> last_event_lock{last_event_mutex};
242286
243 EXPECT_THAT(last_event_surface, Eq(window));287 EXPECT_THAT(last_event_surface, Eq(window));
244 EXPECT_THAT(mir_event_get_type(last_event), Eq(mir_event_type_close_surface));288 EXPECT_THAT(mir_event_get_type(last_event), Eq(mir_event_type_close_window));
245}289}
246290
247TEST_F(ClientSurfaceEvents, client_can_query_preferred_orientation)291TEST_F(ClientSurfaceEvents, client_can_query_preferred_orientation)
@@ -281,7 +325,7 @@
281325
282 ASSERT_FALSE(current_mode.empty());326 ASSERT_FALSE(current_mode.empty());
283327
284 set_event_filter(mir_event_type_surface_output);328 set_event_filter(mir_event_type_window_output);
285 reset_last_event();329 reset_last_event();
286330
287 auto display_controller = server.the_display_configuration_controller();331 auto display_controller = server.the_display_configuration_controller();
@@ -291,20 +335,20 @@
291335
292 std::lock_guard<decltype(last_event_mutex)> last_event_lock{last_event_mutex};336 std::lock_guard<decltype(last_event_mutex)> last_event_lock{last_event_mutex};
293337
294 EXPECT_THAT(mir_event_get_type(last_event), Eq(mir_event_type_surface_output));338 EXPECT_THAT(mir_event_get_type(last_event), Eq(mir_event_type_window_output));
295 auto output_event = mir_event_get_surface_output_event(last_event);339 auto output_event = mir_event_get_window_output_event(last_event);
296340
297 EXPECT_THAT(mir_surface_output_event_get_form_factor(output_event), Eq(form_factor));341 EXPECT_THAT(mir_window_output_event_get_form_factor(output_event), Eq(form_factor));
298 EXPECT_THAT(mir_surface_output_event_get_scale(output_event), FloatEq(scale));342 EXPECT_THAT(mir_window_output_event_get_scale(output_event), FloatEq(scale));
299343
300 auto id = mir_surface_output_event_get_output_id(output_event);344 auto id = mir_window_output_event_get_output_id(output_event);
301 ASSERT_THAT(current_mode.find(id), Ne(current_mode.end()));345 ASSERT_THAT(current_mode.find(id), Ne(current_mode.end()));
302 EXPECT_THAT(mir_surface_output_event_get_refresh_rate(output_event), Eq(current_mode[id].vrefresh_hz));346 EXPECT_THAT(mir_window_output_event_get_refresh_rate(output_event), Eq(current_mode[id].vrefresh_hz));
303}347}
304348
305TEST_F(ClientSurfaceEvents, can_unset_surface_event_handler)349TEST_F(ClientSurfaceEvents, can_unset_surface_event_handler)
306{350{
307 set_event_filter(mir_event_type_close_surface);351 set_event_filter(mir_event_type_close_window);
308352
309 mir_window_set_event_handler(window, nullptr, nullptr);353 mir_window_set_event_handler(window, nullptr, nullptr);
310 scene_surface->request_client_surface_close();354 scene_surface->request_client_surface_close();
@@ -316,17 +360,18 @@
316{360{
317bool is_focus_event_with_value(MirEvent const* event, MirSurfaceFocusState state)361bool is_focus_event_with_value(MirEvent const* event, MirSurfaceFocusState state)
318{362{
319 if (mir_event_get_type(event) != mir_event_type_surface)363 if (mir_event_get_type(event) != mir_event_type_window)
320 {364 {
321 return false;365 return false;
322 }366 }
323367
324 auto surface_event = mir_event_get_surface_event(event);368 auto window_event = mir_event_get_window_event(event);
325 if (mir_surface_event_get_attribute(surface_event) != mir_surface_attrib_focus)369 auto attrib = mir_window_event_get_attribute(window_event);
370 if (attrib != mir_window_attrib_focus)
326 {371 {
327 return false;372 return false;
328 }373 }
329 return mir_surface_event_get_attribute_value(surface_event) == state;374 return mir_window_event_get_attribute_value(window_event) == state;
330}375}
331376
332bool is_focus_event(MirEvent const* event)377bool is_focus_event(MirEvent const* event)
@@ -467,7 +512,7 @@
467512
468void raise_signal_on_close_event(MirSurface*, MirEvent const* ev, void* ctx)513void raise_signal_on_close_event(MirSurface*, MirEvent const* ev, void* ctx)
469{514{
470 if (mir_event_get_type(ev) == mir_event_type_close_surface)515 if (mir_event_get_type(ev) == mir_event_type_close_window)
471 {516 {
472#pragma GCC diagnostic push517#pragma GCC diagnostic push
473#pragma GCC diagnostic ignored "-Wdeprecated-declarations"518#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
@@ -521,7 +566,7 @@
521566
522void surface_output_capturing_callback(MirSurface*, MirEvent const* ev, void* ctx)567void surface_output_capturing_callback(MirSurface*, MirEvent const* ev, void* ctx)
523{568{
524 if (mir_event_get_type(ev) == mir_event_type_surface_output)569 if (mir_event_get_type(ev) == mir_event_type_window_output)
525 {570 {
526 auto out_event = reinterpret_cast<EventContext*>(ctx);571 auto out_event = reinterpret_cast<EventContext*>(ctx);
527 out_event->event = mir_event_ref(ev);572 out_event->event = mir_event_ref(ev);
@@ -558,7 +603,7 @@
558603
559 ASSERT_FALSE(current_mode.empty());604 ASSERT_FALSE(current_mode.empty());
560605
561 set_event_filter(mir_event_type_surface_output);606 set_event_filter(mir_event_type_window_output);
562 reset_last_event();607 reset_last_event();
563608
564 auto const display_controller = server.the_display_configuration_controller();609 auto const display_controller = server.the_display_configuration_controller();
@@ -581,14 +626,14 @@
581 mir_window_spec_release(spec);626 mir_window_spec_release(spec);
582627
583 ASSERT_TRUE(context.captured.wait_for(10s));628 ASSERT_TRUE(context.captured.wait_for(10s));
584 ASSERT_THAT(mir_event_get_type(context.event), Eq(mir_event_type_surface_output));629 ASSERT_THAT(mir_event_get_type(context.event), Eq(mir_event_type_window_output));
585 auto surface_event = mir_event_get_surface_output_event(context.event);630 auto window_event = mir_event_get_window_output_event(context.event);
586 EXPECT_THAT(mir_surface_output_event_get_form_factor(surface_event), Eq(form_factor));631 EXPECT_THAT(mir_window_output_event_get_form_factor(window_event), Eq(form_factor));
587 EXPECT_THAT(mir_surface_output_event_get_scale(surface_event), Eq(scale));632 EXPECT_THAT(mir_window_output_event_get_scale(window_event), Eq(scale));
588 auto id = mir_surface_output_event_get_output_id(surface_event);633 auto id = mir_window_output_event_get_output_id(window_event);
589 EXPECT_THAT(display_ids, Contains(Eq(id)));634 EXPECT_THAT(display_ids, Contains(Eq(id)));
590 ASSERT_THAT(current_mode.find(id), Ne(current_mode.end()));635 ASSERT_THAT(current_mode.find(id), Ne(current_mode.end()));
591 EXPECT_THAT(mir_surface_output_event_get_refresh_rate(surface_event),636 EXPECT_THAT(mir_window_output_event_get_refresh_rate(window_event),
592 Eq(current_mode[id].vrefresh_hz));637 Eq(current_mode[id].vrefresh_hz));
593638
594 mir_window_release_sync(window);639 mir_window_release_sync(window);
595640
=== modified file 'tests/acceptance-tests/test_client_surface_visibility.cpp'
--- tests/acceptance-tests/test_client_surface_visibility.cpp 2017-01-09 06:48:47 +0000
+++ tests/acceptance-tests/test_client_surface_visibility.cpp 2017-01-10 20:52:04 +0000
@@ -90,17 +90,18 @@
9090
91void event_callback(MirWindow* window, MirEvent const* event, void* ctx)91void event_callback(MirWindow* window, MirEvent const* event, void* ctx)
92{92{
93 if (mir_event_get_type(event) != mir_event_type_surface)93 if (mir_event_get_type(event) != mir_event_type_window)
94 return;94 return;
95 auto sev = mir_event_get_surface_event(event);95 auto sev = mir_event_get_window_event(event);
96 if (mir_surface_event_get_attribute(sev) != mir_surface_attrib_visibility)96 auto attrib = mir_window_event_get_attribute(sev);
97 if (attrib != mir_window_attrib_visibility)
97 return;98 return;
9899
99 auto const mock_callback =100 auto const mock_callback =
100 reinterpret_cast<testing::NiceMock<MockVisibilityCallback>*>(ctx);101 reinterpret_cast<testing::NiceMock<MockVisibilityCallback>*>(ctx);
101 mock_callback->handle(102 mock_callback->handle(
102 window,103 window,
103 static_cast<MirSurfaceVisibility>(mir_surface_event_get_attribute_value(sev)));104 static_cast<MirSurfaceVisibility>(mir_window_event_get_attribute_value(sev)));
104}105}
105106
106MirSurface* create_surface(MirConnection* connection, const char* name, geom::Size size,107MirSurface* create_surface(MirConnection* connection, const char* name, geom::Size size,
107108
=== modified file 'tests/acceptance-tests/test_client_surfaces.cpp'
--- tests/acceptance-tests/test_client_surfaces.cpp 2017-01-09 06:48:47 +0000
+++ tests/acceptance-tests/test_client_surfaces.cpp 2017-01-10 20:52:04 +0000
@@ -176,7 +176,7 @@
176 mir_window_spec_release(spec);176 mir_window_spec_release(spec);
177177
178 ASSERT_THAT(menu, IsValid());178 ASSERT_THAT(menu, IsValid());
179 EXPECT_EQ(mir_surface_get_type(menu), mir_surface_type_menu);179 EXPECT_EQ(mir_window_get_type(menu), mir_window_type_menu);
180180
181 mir_window_release_sync(parent);181 mir_window_release_sync(parent);
182 mir_window_release_sync(menu);182 mir_window_release_sync(menu);
@@ -196,7 +196,7 @@
196 mir_window_spec_release(spec);196 mir_window_spec_release(spec);
197197
198 ASSERT_THAT(tooltip, IsValid());198 ASSERT_THAT(tooltip, IsValid());
199 EXPECT_EQ(mir_surface_get_type(tooltip), mir_surface_type_tip);199 EXPECT_EQ(mir_window_get_type(tooltip), mir_window_type_tip);
200200
201 mir_window_release_sync(parent);201 mir_window_release_sync(parent);
202 mir_window_release_sync(tooltip);202 mir_window_release_sync(tooltip);
@@ -212,7 +212,7 @@
212 mir_window_spec_release(spec);212 mir_window_spec_release(spec);
213213
214 ASSERT_THAT(dialog, IsValid());214 ASSERT_THAT(dialog, IsValid());
215 EXPECT_EQ(mir_surface_get_type(dialog), mir_surface_type_dialog);215 EXPECT_EQ(mir_window_get_type(dialog), mir_window_type_dialog);
216216
217 mir_window_release_sync(dialog);217 mir_window_release_sync(dialog);
218}218}
@@ -228,7 +228,7 @@
228 mir_window_spec_release(spec);228 mir_window_spec_release(spec);
229229
230 ASSERT_THAT(dialog, IsValid());230 ASSERT_THAT(dialog, IsValid());
231 EXPECT_EQ(mir_surface_get_type(dialog), mir_surface_type_dialog);231 EXPECT_EQ(mir_window_get_type(dialog), mir_window_type_dialog);
232232
233 mir_window_release_sync(parent);233 mir_window_release_sync(parent);
234 mir_window_release_sync(dialog);234 mir_window_release_sync(dialog);
@@ -243,7 +243,7 @@
243 auto im = mir_window_create_sync(spec);243 auto im = mir_window_create_sync(spec);
244 mir_window_spec_release(spec);244 mir_window_spec_release(spec);
245245
246 EXPECT_EQ(mir_surface_get_type(im), mir_surface_type_inputmethod);246 EXPECT_EQ(mir_window_get_type(im), mir_window_type_inputmethod);
247247
248 mir_window_release_sync(im);248 mir_window_release_sync(im);
249}249}
250250
=== modified file 'tests/acceptance-tests/test_confined_pointer.cpp'
--- tests/acceptance-tests/test_confined_pointer.cpp 2017-01-09 06:48:47 +0000
+++ tests/acceptance-tests/test_confined_pointer.cpp 2017-01-10 20:52:04 +0000
@@ -110,16 +110,16 @@
110 mir_window_spec_release(spec);110 mir_window_spec_release(spec);
111 }111 }
112112
113 void handle_surface_event(MirSurfaceEvent const* event)113 void handle_window_event(MirSurfaceEvent const* event)
114 {114 {
115 auto const attrib = mir_surface_event_get_attribute(event);115 auto const attrib = mir_window_event_get_attribute(event);
116 auto const value = mir_surface_event_get_attribute_value(event);116 auto const value = mir_window_event_get_attribute_value(event);
117117
118 if (mir_surface_attrib_visibility == attrib &&118 if (mir_window_attrib_visibility == attrib &&
119 mir_surface_visibility_exposed == value)119 mir_surface_visibility_exposed == value)
120 exposed = true;120 exposed = true;
121121
122 if (mir_surface_attrib_focus == attrib &&122 if (mir_window_attrib_focus == attrib &&
123 mir_surface_focused == value)123 mir_surface_focused == value)
124 focused = true;124 focused = true;
125125
@@ -133,8 +133,8 @@
133 auto type = mir_event_get_type(ev);133 auto type = mir_event_get_type(ev);
134 switch (type)134 switch (type)
135 {135 {
136 case mir_event_type_surface:136 case mir_event_type_window:
137 client->handle_surface_event(mir_event_get_surface_event(ev));137 client->handle_window_event(mir_event_get_window_event(ev));
138 break;138 break;
139 case mir_event_type_input:139 case mir_event_type_input:
140 client->handle_input(ev);140 client->handle_input(ev);
141141
=== modified file 'tests/acceptance-tests/test_custom_window_management.cpp'
--- tests/acceptance-tests/test_custom_window_management.cpp 2017-01-09 06:48:47 +0000
+++ tests/acceptance-tests/test_custom_window_management.cpp 2017-01-10 20:52:04 +0000
@@ -19,6 +19,7 @@
19#include "mir/geometry/rectangle.h"19#include "mir/geometry/rectangle.h"
20#include "mir/scene/session.h"20#include "mir/scene/session.h"
21#include "mir_toolkit/events/surface_placement.h"21#include "mir_toolkit/events/surface_placement.h"
22#include "mir_toolkit/events/window_placement.h"
22#include "mir/events/event_builders.h"23#include "mir/events/event_builders.h"
23#include "mir/scene/surface.h"24#include "mir/scene/surface.h"
2425
@@ -279,7 +280,7 @@
279280
280 mt::Signal received;281 mt::Signal received;
281282
282 EXPECT_CALL(window_manager, set_surface_attribute(_, WeakPtrEq(server_surface[i]), mir_surface_attrib_state,_))283 EXPECT_CALL(window_manager, set_surface_attribute(_, WeakPtrEq(server_surface[i]), mir_window_attrib_state,_))
283 .WillOnce(WithArg<3>(Invoke([&](int value) { received.raise(); return value; })));284 .WillOnce(WithArg<3>(Invoke([&](int value) { received.raise(); return value; })));
284285
285 mir_surface_set_state(client_surface[i], mir_surface_state_maximized);286 mir_surface_set_state(client_surface[i], mir_surface_state_maximized);
@@ -529,12 +530,12 @@
529{530{
530 PlacementCheck(MirRectangle const& placement) : expected_rect{placement} {}531 PlacementCheck(MirRectangle const& placement) : expected_rect{placement} {}
531532
532 void check(MirSurfacePlacementEvent const* placement_event)533 void check(MirWindowPlacementEvent const* placement_event)
533 {534 {
534 EXPECT_THAT(mir_surface_placement_get_relative_position(placement_event).top, Eq(expected_rect.top));535 EXPECT_THAT(mir_window_placement_get_relative_position(placement_event).top, Eq(expected_rect.top));
535 EXPECT_THAT(mir_surface_placement_get_relative_position(placement_event).left, Eq(expected_rect.left));536 EXPECT_THAT(mir_window_placement_get_relative_position(placement_event).left, Eq(expected_rect.left));
536 EXPECT_THAT(mir_surface_placement_get_relative_position(placement_event).height, Eq(expected_rect.height));537 EXPECT_THAT(mir_window_placement_get_relative_position(placement_event).height, Eq(expected_rect.height));
537 EXPECT_THAT(mir_surface_placement_get_relative_position(placement_event).width, Eq(expected_rect.width));538 EXPECT_THAT(mir_window_placement_get_relative_position(placement_event).width, Eq(expected_rect.width));
538539
539 received.raise();540 received.raise();
540 }541 }
@@ -551,7 +552,7 @@
551552
552void surface_placement_event_callback(MirSurface* /*window*/, MirEvent const* event, void* context)553void surface_placement_event_callback(MirSurface* /*window*/, MirEvent const* event, void* context)
553{554{
554 if (mir_event_get_type(event) == mir_event_type_surface_placement)555 if (mir_event_get_type(event) == mir_event_type_window_placement)
555 {556 {
556 auto const placement_event = mir_event_get_surface_placement_event(event);557 auto const placement_event = mir_event_get_surface_placement_event(event);
557 static_cast<PlacementCheck*>(context)->check(placement_event);558 static_cast<PlacementCheck*>(context)->check(placement_event);
558559
=== modified file 'tests/acceptance-tests/test_nested_input.cpp'
--- tests/acceptance-tests/test_nested_input.cpp 2017-01-09 06:48:47 +0000
+++ tests/acceptance-tests/test_nested_input.cpp 2017-01-10 20:52:04 +0000
@@ -139,16 +139,16 @@
139139
140 MOCK_METHOD1(handle_input, void(MirEvent const*));140 MOCK_METHOD1(handle_input, void(MirEvent const*));
141141
142 void handle_surface_event(MirSurfaceEvent const* event)142 void handle_window_event(MirWindowEvent const* event)
143 {143 {
144 auto const attrib = mir_surface_event_get_attribute(event);144 auto const attrib = mir_window_event_get_attribute(event);
145 auto const value = mir_surface_event_get_attribute_value(event);145 auto const value = mir_window_event_get_attribute_value(event);
146146
147 if (mir_surface_attrib_visibility == attrib &&147 if (mir_window_attrib_visibility == attrib &&
148 mir_surface_visibility_exposed == value)148 mir_surface_visibility_exposed == value)
149 exposed = true;149 exposed = true;
150150
151 if (mir_surface_attrib_focus == attrib &&151 if (mir_window_attrib_focus == attrib &&
152 mir_surface_focused == value)152 mir_surface_focused == value)
153 focused = true;153 focused = true;
154154
@@ -160,10 +160,10 @@
160 {160 {
161 auto const client = static_cast<ExposedSurface*>(context);161 auto const client = static_cast<ExposedSurface*>(context);
162 auto type = mir_event_get_type(ev);162 auto type = mir_event_get_type(ev);
163 if (type == mir_event_type_surface)163 if (type == mir_event_type_window)
164 {164 {
165 auto surface_event = mir_event_get_surface_event(ev);165 auto window_event = mir_event_get_window_event(ev);
166 client->handle_surface_event(surface_event);166 client->handle_window_event(window_event);
167167
168 }168 }
169 if (type == mir_event_type_input)169 if (type == mir_event_type_input)
170170
=== modified file 'tests/acceptance-tests/test_nested_mir.cpp'
--- tests/acceptance-tests/test_nested_mir.cpp 2017-01-09 06:48:47 +0000
+++ tests/acceptance-tests/test_nested_mir.cpp 2017-01-10 20:52:04 +0000
@@ -364,7 +364,7 @@
364 int set_surface_attribute(364 int set_surface_attribute(
365 std::shared_ptr<msc::Session> const& session,365 std::shared_ptr<msc::Session> const& session,
366 std::shared_ptr<msc::Surface> const& window,366 std::shared_ptr<msc::Surface> const& window,
367 MirSurfaceAttrib attrib,367 MirWindowAttrib attrib,
368 int value) override368 int value) override
369 {369 {
370 return wrapped->set_surface_attribute(session, window, attrib, value);370 return wrapped->set_surface_attribute(session, window, attrib, value);
@@ -372,7 +372,7 @@
372372
373 int get_surface_attribute(373 int get_surface_attribute(
374 std::shared_ptr<msc::Surface> const& window,374 std::shared_ptr<msc::Surface> const& window,
375 MirSurfaceAttrib attrib) override375 MirWindowAttrib attrib) override
376 {376 {
377 return wrapped->get_surface_attribute(window, attrib);377 return wrapped->get_surface_attribute(window, attrib);
378 }378 }
@@ -778,11 +778,11 @@
778 mt::Signal surface_event_received;778 mt::Signal surface_event_received;
779 mir_window_spec_set_event_handler(spec, [](MirSurface*, MirEvent const* event, void* ctx)779 mir_window_spec_set_event_handler(spec, [](MirSurface*, MirEvent const* event, void* ctx)
780 {780 {
781 if (mir_event_get_type(event) == mir_event_type_surface_output)781 if (mir_event_get_type(event) == mir_event_type_window_output)
782 {782 {
783 auto surface_event = mir_event_get_surface_output_event(event);783 auto surface_event = mir_event_get_window_output_event(event);
784 EXPECT_THAT(mir_surface_output_event_get_form_factor(surface_event), Eq(expected_form_factor));784 EXPECT_THAT(mir_window_output_event_get_form_factor(surface_event), Eq(expected_form_factor));
785 EXPECT_THAT(mir_surface_output_event_get_scale(surface_event), Eq(expected_scale));785 EXPECT_THAT(mir_window_output_event_get_scale(surface_event), Eq(expected_scale));
786 auto signal = static_cast<mt::Signal*>(ctx);786 auto signal = static_cast<mt::Signal*>(ctx);
787 signal->raise();787 signal->raise();
788 }788 }
789789
=== modified file 'tests/acceptance-tests/test_new_display_configuration.cpp'
--- tests/acceptance-tests/test_new_display_configuration.cpp 2017-01-09 06:48:47 +0000
+++ tests/acceptance-tests/test_new_display_configuration.cpp 2017-01-10 20:52:04 +0000
@@ -281,14 +281,14 @@
281 {281 {
282 auto const client = static_cast<SimpleClient*>(context);282 auto const client = static_cast<SimpleClient*>(context);
283 auto type = mir_event_get_type(ev);283 auto type = mir_event_get_type(ev);
284 if (type == mir_event_type_surface)284 if (type == mir_event_type_window)
285 {285 {
286 auto surface_event = mir_event_get_surface_event(ev);286 auto window_event = mir_event_get_window_event(ev);
287 auto const attrib = mir_surface_event_get_attribute(surface_event);287 auto const attrib = mir_window_event_get_attribute(window_event);
288 auto const value = mir_surface_event_get_attribute_value(surface_event);288 auto const value = mir_window_event_get_attribute_value(window_event);
289289
290 std::lock_guard<std::mutex> lk(client->mutex);290 std::lock_guard<std::mutex> lk(client->mutex);
291 if (mir_surface_attrib_focus == attrib &&291 if (mir_window_attrib_focus == attrib &&
292 mir_surface_focused == value)292 mir_surface_focused == value)
293 client->ready_to_accept_events.raise();293 client->ready_to_accept_events.raise();
294 }294 }
295295
=== modified file 'tests/acceptance-tests/test_surface_morphing.cpp'
--- tests/acceptance-tests/test_surface_morphing.cpp 2017-01-09 06:48:47 +0000
+++ tests/acceptance-tests/test_surface_morphing.cpp 2017-01-10 20:52:04 +0000
@@ -57,7 +57,7 @@
57{57{
58public:58public:
59 MOCK_METHOD1(renamed, void(char const*));59 MOCK_METHOD1(renamed, void(char const*));
60 MOCK_METHOD2(attrib_changed, void(MirSurfaceAttrib attrib, int value));60 MOCK_METHOD2(attrib_changed, void(MirWindowAttrib attrib, int value));
61};61};
6262
63struct SurfaceMorphing : mtf::ConnectedClientHeadlessServer63struct SurfaceMorphing : mtf::ConnectedClientHeadlessServer
@@ -158,8 +158,8 @@
158158
159struct TypePair159struct TypePair
160{160{
161 MirSurfaceType from;161 MirWindowType from;
162 MirSurfaceType to;162 MirWindowType to;
163163
164 friend std::ostream& operator<<(std::ostream& out, TypePair const& types)164 friend std::ostream& operator<<(std::ostream& out, TypePair const& types)
165 { return out << "from:" << types.from << ", to:" << types.to; }165 { return out << "from:" << types.from << ", to:" << types.to; }
@@ -187,7 +187,7 @@
187187
188 latest_shell_surface()->add_observer(mt::fake_shared(surface_observer));188 latest_shell_surface()->add_observer(mt::fake_shared(surface_observer));
189189
190 EXPECT_CALL(surface_observer, attrib_changed(mir_surface_attrib_type, new_type)).190 EXPECT_CALL(surface_observer, attrib_changed(mir_window_attrib_type, new_type)).
191 WillOnce(InvokeWithoutArgs([&] { change_observed(); }));191 WillOnce(InvokeWithoutArgs([&] { change_observed(); }));
192192
193 change_surface(window, [&](MirWindowSpec* spec)193 change_surface(window, [&](MirWindowSpec* spec)
@@ -203,7 +203,7 @@
203203
204 auto const parent = create_surface([&](MirWindowSpec* spec)204 auto const parent = create_surface([&](MirWindowSpec* spec)
205 {205 {
206 mir_window_spec_set_type(spec, mir_surface_type_normal);206 mir_window_spec_set_type(spec, mir_window_type_normal);
207 mir_window_spec_set_width(spec, width);207 mir_window_spec_set_width(spec, width);
208 mir_window_spec_set_height(spec, height);208 mir_window_spec_set_height(spec, height);
209 mir_window_spec_set_pixel_format(spec, pixel_format);209 mir_window_spec_set_pixel_format(spec, pixel_format);
@@ -221,7 +221,7 @@
221221
222 latest_shell_surface()->add_observer(mt::fake_shared(surface_observer));222 latest_shell_surface()->add_observer(mt::fake_shared(surface_observer));
223223
224 EXPECT_CALL(surface_observer, attrib_changed(mir_surface_attrib_type, new_type)).224 EXPECT_CALL(surface_observer, attrib_changed(mir_window_attrib_type, new_type)).
225 Times(0);225 Times(0);
226226
227 change_surface(window, [&](MirWindowSpec* spec)227 change_surface(window, [&](MirWindowSpec* spec)
@@ -244,7 +244,7 @@
244244
245 auto const parent = create_surface([&](MirWindowSpec* spec)245 auto const parent = create_surface([&](MirWindowSpec* spec)
246 {246 {
247 mir_window_spec_set_type(spec, mir_surface_type_normal);247 mir_window_spec_set_type(spec, mir_window_type_normal);
248 mir_window_spec_set_width(spec, width);248 mir_window_spec_set_width(spec, width);
249 mir_window_spec_set_height(spec, height);249 mir_window_spec_set_height(spec, height);
250 mir_window_spec_set_pixel_format(spec, pixel_format);250 mir_window_spec_set_pixel_format(spec, pixel_format);
@@ -262,7 +262,7 @@
262262
263 latest_shell_surface()->add_observer(mt::fake_shared(surface_observer));263 latest_shell_surface()->add_observer(mt::fake_shared(surface_observer));
264264
265 EXPECT_CALL(surface_observer, attrib_changed(mir_surface_attrib_type, new_type)).265 EXPECT_CALL(surface_observer, attrib_changed(mir_window_attrib_type, new_type)).
266 WillOnce(InvokeWithoutArgs([&] { change_observed(); }));266 WillOnce(InvokeWithoutArgs([&] { change_observed(); }));
267267
268 change_surface(window, [&](MirWindowSpec* spec)268 change_surface(window, [&](MirWindowSpec* spec)
@@ -288,7 +288,7 @@
288288
289 latest_shell_surface()->add_observer(mt::fake_shared(surface_observer));289 latest_shell_surface()->add_observer(mt::fake_shared(surface_observer));
290290
291 EXPECT_CALL(surface_observer, attrib_changed(mir_surface_attrib_type, new_type)).291 EXPECT_CALL(surface_observer, attrib_changed(mir_window_attrib_type, new_type)).
292 Times(0);292 Times(0);
293293
294 change_surface(window, [&](MirWindowSpec* spec)294 change_surface(window, [&](MirWindowSpec* spec)
@@ -310,7 +310,7 @@
310310
311 auto const parent = create_surface([&](MirWindowSpec* spec)311 auto const parent = create_surface([&](MirWindowSpec* spec)
312 {312 {
313 mir_window_spec_set_type(spec, mir_surface_type_normal);313 mir_window_spec_set_type(spec, mir_window_type_normal);
314 mir_window_spec_set_width(spec, width);314 mir_window_spec_set_width(spec, width);
315 mir_window_spec_set_height(spec, height);315 mir_window_spec_set_height(spec, height);
316 mir_window_spec_set_pixel_format(spec, pixel_format);316 mir_window_spec_set_pixel_format(spec, pixel_format);
@@ -328,7 +328,7 @@
328328
329 latest_shell_surface()->add_observer(mt::fake_shared(surface_observer));329 latest_shell_surface()->add_observer(mt::fake_shared(surface_observer));
330330
331 EXPECT_CALL(surface_observer, attrib_changed(mir_surface_attrib_type, new_type)).331 EXPECT_CALL(surface_observer, attrib_changed(mir_window_attrib_type, new_type)).
332 WillOnce(InvokeWithoutArgs([&] { change_observed(); }));332 WillOnce(InvokeWithoutArgs([&] { change_observed(); }));
333333
334 change_surface(window, [&](MirWindowSpec* spec)334 change_surface(window, [&](MirWindowSpec* spec)
@@ -345,7 +345,7 @@
345345
346 auto const parent = create_surface([&](MirWindowSpec* spec)346 auto const parent = create_surface([&](MirWindowSpec* spec)
347 {347 {
348 mir_window_spec_set_type(spec, mir_surface_type_normal);348 mir_window_spec_set_type(spec, mir_window_type_normal);
349 mir_window_spec_set_width(spec, width);349 mir_window_spec_set_width(spec, width);
350 mir_window_spec_set_height(spec, height);350 mir_window_spec_set_height(spec, height);
351 mir_window_spec_set_pixel_format(spec, pixel_format);351 mir_window_spec_set_pixel_format(spec, pixel_format);
@@ -363,7 +363,7 @@
363363
364 latest_shell_surface()->add_observer(mt::fake_shared(surface_observer));364 latest_shell_surface()->add_observer(mt::fake_shared(surface_observer));
365365
366 EXPECT_CALL(surface_observer, attrib_changed(mir_surface_attrib_type, new_type)).366 EXPECT_CALL(surface_observer, attrib_changed(mir_window_attrib_type, new_type)).
367 WillOnce(InvokeWithoutArgs([&] { change_observed(); }));367 WillOnce(InvokeWithoutArgs([&] { change_observed(); }));
368368
369369
@@ -375,21 +375,21 @@
375375
376INSTANTIATE_TEST_CASE_P(SurfaceMorphing, TargetWithoutParent,376INSTANTIATE_TEST_CASE_P(SurfaceMorphing, TargetWithoutParent,
377 Values(377 Values(
378 TypePair{mir_surface_type_normal, mir_surface_type_utility},378 TypePair{mir_window_type_normal, mir_window_type_utility},
379 TypePair{mir_surface_type_utility, mir_surface_type_normal},379 TypePair{mir_window_type_utility, mir_window_type_normal},
380 TypePair{mir_surface_type_dialog, mir_surface_type_utility},380 TypePair{mir_window_type_dialog, mir_window_type_utility},
381 TypePair{mir_surface_type_dialog, mir_surface_type_normal}381 TypePair{mir_window_type_dialog, mir_window_type_normal}
382 ));382 ));
383383
384INSTANTIATE_TEST_CASE_P(SurfaceMorphing, TargetNeedingParent,384INSTANTIATE_TEST_CASE_P(SurfaceMorphing, TargetNeedingParent,
385 Values(385 Values(
386 TypePair{mir_surface_type_normal, mir_surface_type_satellite},386 TypePair{mir_window_type_normal, mir_window_type_satellite},
387 TypePair{mir_surface_type_utility, mir_surface_type_satellite},387 TypePair{mir_window_type_utility, mir_window_type_satellite},
388 TypePair{mir_surface_type_dialog, mir_surface_type_satellite}388 TypePair{mir_window_type_dialog, mir_window_type_satellite}
389 ));389 ));
390390
391INSTANTIATE_TEST_CASE_P(SurfaceMorphing, TargetMayHaveParent,391INSTANTIATE_TEST_CASE_P(SurfaceMorphing, TargetMayHaveParent,
392 Values(392 Values(
393 TypePair{mir_surface_type_normal, mir_surface_type_dialog},393 TypePair{mir_window_type_normal, mir_window_type_dialog},
394 TypePair{mir_surface_type_utility, mir_surface_type_dialog}394 TypePair{mir_window_type_utility, mir_window_type_dialog}
395 ));395 ));
396396
=== modified file 'tests/acceptance-tests/test_surface_placement.cpp'
--- tests/acceptance-tests/test_surface_placement.cpp 2017-01-09 06:48:47 +0000
+++ tests/acceptance-tests/test_surface_placement.cpp 2017-01-10 20:52:04 +0000
@@ -461,7 +461,7 @@
461 mir_window_release_sync(window);461 mir_window_release_sync(window);
462}462}
463463
464struct UnparentedSurface : SurfacePlacement, ::testing::WithParamInterface<MirSurfaceType> {};464struct UnparentedSurface : SurfacePlacement, ::testing::WithParamInterface<MirWindowType> {};
465465
466TEST_P(UnparentedSurface, small_window_is_optically_centered_on_first_display)466TEST_P(UnparentedSurface, small_window_is_optically_centered_on_first_display)
467{467{
@@ -494,10 +494,10 @@
494494
495INSTANTIATE_TEST_CASE_P(SurfacePlacement, UnparentedSurface,495INSTANTIATE_TEST_CASE_P(SurfacePlacement, UnparentedSurface,
496 ::testing::Values(496 ::testing::Values(
497 mir_surface_type_normal,497 mir_window_type_normal,
498 mir_surface_type_utility,498 mir_window_type_utility,
499 mir_surface_type_dialog,499 mir_window_type_dialog,
500 mir_surface_type_freestyle));500 mir_window_type_freestyle));
501501
502// Parented dialog or parented freestyle window502// Parented dialog or parented freestyle window
503//503//
@@ -519,7 +519,7 @@
519// relative to its parent519// relative to its parent
520// TODO tests for this520// TODO tests for this
521521
522struct ParentedSurface : SurfacePlacement, ::testing::WithParamInterface<MirSurfaceType> {};522struct ParentedSurface : SurfacePlacement, ::testing::WithParamInterface<MirWindowType> {};
523523
524TEST_P(ParentedSurface, small_window_is_optically_centered_on_parent)524TEST_P(ParentedSurface, small_window_is_optically_centered_on_parent)
525{525{
@@ -557,9 +557,9 @@
557557
558INSTANTIATE_TEST_CASE_P(SurfacePlacement, ParentedSurface,558INSTANTIATE_TEST_CASE_P(SurfacePlacement, ParentedSurface,
559 ::testing::Values(559 ::testing::Values(
560 mir_surface_type_dialog,560 mir_window_type_dialog,
561 mir_surface_type_satellite,561 mir_window_type_satellite,
562 mir_surface_type_popover,562 mir_window_type_popover,
563 mir_surface_type_gloss,563 mir_window_type_gloss,
564 mir_surface_type_tip,564 mir_window_type_tip,
565 mir_surface_type_freestyle));565 mir_window_type_freestyle));
566566
=== modified file 'tests/acceptance-tests/test_surface_raise.cpp'
--- tests/acceptance-tests/test_surface_raise.cpp 2017-01-09 20:01:45 +0000
+++ tests/acceptance-tests/test_surface_raise.cpp 2017-01-10 20:52:04 +0000
@@ -112,21 +112,21 @@
112 auto const event_type = mir_event_get_type(ev);112 auto const event_type = mir_event_get_type(ev);
113 auto raise_surfaces = static_cast<RaiseSurfaces*>(ctx);113 auto raise_surfaces = static_cast<RaiseSurfaces*>(ctx);
114114
115 if (event_type == mir_event_type_surface)115 if (event_type == mir_event_type_window)
116 {116 {
117 auto event = mir_event_get_surface_event(ev);117 auto event = mir_event_get_window_event(ev);
118 auto const attrib = mir_surface_event_get_attribute(event);118 auto const attrib = mir_window_event_get_attribute(event);
119 auto const value = mir_surface_event_get_attribute_value(event);119 auto const value = mir_window_event_get_attribute_value(event);
120120
121 std::lock_guard<std::mutex> lk(raise_surfaces->mutex);121 std::lock_guard<std::mutex> lk(raise_surfaces->mutex);
122122
123 if (attrib == mir_surface_attrib_visibility &&123 if (attrib == mir_window_attrib_visibility &&
124 value == mir_surface_visibility_exposed)124 value == mir_surface_visibility_exposed)
125 {125 {
126 raise_surfaces->exposed = true;126 raise_surfaces->exposed = true;
127 }127 }
128128
129 if (attrib == mir_surface_attrib_focus &&129 if (attrib == mir_window_attrib_focus &&
130 value == mir_surface_focused)130 value == mir_surface_focused)
131 {131 {
132 raise_surfaces->focused = true;132 raise_surfaces->focused = true;
133133
=== modified file 'tests/acceptance-tests/test_surface_specification.cpp'
--- tests/acceptance-tests/test_surface_specification.cpp 2017-01-09 06:48:47 +0000
+++ tests/acceptance-tests/test_surface_specification.cpp 2017-01-10 20:52:04 +0000
@@ -48,7 +48,7 @@
48{48{
49public:49public:
50 MOCK_METHOD1(renamed, void(char const*));50 MOCK_METHOD1(renamed, void(char const*));
51 MOCK_METHOD2(attrib_changed, void(MirSurfaceAttrib attrib, int value));51 MOCK_METHOD2(attrib_changed, void(MirWindowAttrib attrib, int value));
52 MOCK_METHOD1(resized_to, void(Size const& size));52 MOCK_METHOD1(resized_to, void(Size const& size));
53};53};
5454
@@ -179,7 +179,7 @@
179 }179 }
180};180};
181181
182struct SurfaceSpecificationCase : SurfaceSpecification, ::testing::WithParamInterface<MirSurfaceType> {};182struct SurfaceSpecificationCase : SurfaceSpecification, ::testing::WithParamInterface<MirWindowType> {};
183using SurfaceWithoutParent = SurfaceSpecificationCase;183using SurfaceWithoutParent = SurfaceSpecificationCase;
184using SurfaceNeedingParent = SurfaceSpecificationCase;184using SurfaceNeedingParent = SurfaceSpecificationCase;
185using SurfaceMayHaveParent = SurfaceSpecificationCase;185using SurfaceMayHaveParent = SurfaceSpecificationCase;
@@ -210,7 +210,7 @@
210210
211 auto const surface = create_surface([&](MirWindowSpec* spec)211 auto const surface = create_surface([&](MirWindowSpec* spec)
212 {212 {
213 mir_window_spec_set_type(spec, mir_surface_type_normal);213 mir_window_spec_set_type(spec, mir_window_type_normal);
214 mir_window_spec_set_width(spec, width);214 mir_window_spec_set_width(spec, width);
215 mir_window_spec_set_height(spec, height);215 mir_window_spec_set_height(spec, height);
216 mir_window_spec_set_pixel_format(spec, pixel_format);216 mir_window_spec_set_pixel_format(spec, pixel_format);
@@ -235,7 +235,7 @@
235235
236 auto const surface = create_surface([&](MirWindowSpec* spec)236 auto const surface = create_surface([&](MirWindowSpec* spec)
237 {237 {
238 mir_window_spec_set_type(spec, mir_surface_type_normal);238 mir_window_spec_set_type(spec, mir_window_type_normal);
239 mir_window_spec_set_width(spec, width);239 mir_window_spec_set_width(spec, width);
240 mir_window_spec_set_height(spec, height);240 mir_window_spec_set_height(spec, height);
241 mir_window_spec_set_pixel_format(spec, pixel_format);241 mir_window_spec_set_pixel_format(spec, pixel_format);
@@ -260,7 +260,7 @@
260260
261 auto const surface = create_surface([&](MirWindowSpec* spec)261 auto const surface = create_surface([&](MirWindowSpec* spec)
262 {262 {
263 mir_window_spec_set_type(spec, mir_surface_type_normal);263 mir_window_spec_set_type(spec, mir_window_type_normal);
264 mir_window_spec_set_width(spec, width);264 mir_window_spec_set_width(spec, width);
265 mir_window_spec_set_height(spec, height);265 mir_window_spec_set_height(spec, height);
266 mir_window_spec_set_pixel_format(spec, pixel_format);266 mir_window_spec_set_pixel_format(spec, pixel_format);
@@ -285,7 +285,7 @@
285285
286 auto const surface = create_surface([&](MirWindowSpec* spec)286 auto const surface = create_surface([&](MirWindowSpec* spec)
287 {287 {
288 mir_window_spec_set_type(spec, mir_surface_type_normal);288 mir_window_spec_set_type(spec, mir_window_type_normal);
289 mir_window_spec_set_width(spec, width);289 mir_window_spec_set_width(spec, width);
290 mir_window_spec_set_height(spec, height);290 mir_window_spec_set_height(spec, height);
291 mir_window_spec_set_pixel_format(spec, pixel_format);291 mir_window_spec_set_pixel_format(spec, pixel_format);
@@ -310,7 +310,7 @@
310310
311 auto const surface = create_surface([&](MirWindowSpec* spec)311 auto const surface = create_surface([&](MirWindowSpec* spec)
312 {312 {
313 mir_window_spec_set_type(spec, mir_surface_type_normal);313 mir_window_spec_set_type(spec, mir_window_type_normal);
314 mir_window_spec_set_width(spec, width);314 mir_window_spec_set_width(spec, width);
315 mir_window_spec_set_height(spec, height);315 mir_window_spec_set_height(spec, height);
316 mir_window_spec_set_pixel_format(spec, pixel_format);316 mir_window_spec_set_pixel_format(spec, pixel_format);
@@ -339,7 +339,7 @@
339339
340 auto const surface = create_surface([&](MirWindowSpec* spec)340 auto const surface = create_surface([&](MirWindowSpec* spec)
341 {341 {
342 mir_window_spec_set_type(spec, mir_surface_type_normal);342 mir_window_spec_set_type(spec, mir_window_type_normal);
343 mir_window_spec_set_width(spec, width);343 mir_window_spec_set_width(spec, width);
344 mir_window_spec_set_height(spec, height);344 mir_window_spec_set_height(spec, height);
345 mir_window_spec_set_pixel_format(spec, pixel_format);345 mir_window_spec_set_pixel_format(spec, pixel_format);
@@ -368,7 +368,7 @@
368368
369 auto const surface = create_surface([&](MirWindowSpec* spec)369 auto const surface = create_surface([&](MirWindowSpec* spec)
370 {370 {
371 mir_window_spec_set_type(spec, mir_surface_type_normal);371 mir_window_spec_set_type(spec, mir_window_type_normal);
372 mir_window_spec_set_width(spec, width);372 mir_window_spec_set_width(spec, width);
373 mir_window_spec_set_height(spec, height);373 mir_window_spec_set_height(spec, height);
374 mir_window_spec_set_pixel_format(spec, pixel_format);374 mir_window_spec_set_pixel_format(spec, pixel_format);
@@ -397,7 +397,7 @@
397397
398 auto const surface = create_surface([&](MirWindowSpec* spec)398 auto const surface = create_surface([&](MirWindowSpec* spec)
399 {399 {
400 mir_window_spec_set_type(spec, mir_surface_type_normal);400 mir_window_spec_set_type(spec, mir_window_type_normal);
401 mir_window_spec_set_width(spec, width);401 mir_window_spec_set_width(spec, width);
402 mir_window_spec_set_height(spec, height);402 mir_window_spec_set_height(spec, height);
403 mir_window_spec_set_pixel_format(spec, pixel_format);403 mir_window_spec_set_pixel_format(spec, pixel_format);
@@ -427,7 +427,7 @@
427427
428 auto const surface = create_surface([&](MirWindowSpec* spec)428 auto const surface = create_surface([&](MirWindowSpec* spec)
429 {429 {
430 mir_window_spec_set_type(spec, mir_surface_type_normal);430 mir_window_spec_set_type(spec, mir_window_type_normal);
431 mir_window_spec_set_width(spec, width);431 mir_window_spec_set_width(spec, width);
432 mir_window_spec_set_height(spec, height);432 mir_window_spec_set_height(spec, height);
433 mir_window_spec_set_pixel_format(spec, pixel_format);433 mir_window_spec_set_pixel_format(spec, pixel_format);
@@ -457,7 +457,7 @@
457457
458 auto const surface = create_surface([&](MirWindowSpec* spec)458 auto const surface = create_surface([&](MirWindowSpec* spec)
459 {459 {
460 mir_window_spec_set_type(spec, mir_surface_type_normal);460 mir_window_spec_set_type(spec, mir_window_type_normal);
461 mir_window_spec_set_width(spec, width);461 mir_window_spec_set_width(spec, width);
462 mir_window_spec_set_height(spec, height);462 mir_window_spec_set_height(spec, height);
463 mir_window_spec_set_pixel_format(spec, pixel_format);463 mir_window_spec_set_pixel_format(spec, pixel_format);
@@ -494,7 +494,7 @@
494494
495 auto const surface = create_surface([&](MirWindowSpec* spec)495 auto const surface = create_surface([&](MirWindowSpec* spec)
496 {496 {
497 mir_window_spec_set_type(spec, mir_surface_type_normal);497 mir_window_spec_set_type(spec, mir_window_type_normal);
498 mir_window_spec_set_width(spec, width);498 mir_window_spec_set_width(spec, width);
499 mir_window_spec_set_height(spec, height);499 mir_window_spec_set_height(spec, height);
500 mir_window_spec_set_pixel_format(spec, pixel_format);500 mir_window_spec_set_pixel_format(spec, pixel_format);
@@ -564,7 +564,7 @@
564564
565 auto const parent = create_surface([&](MirWindowSpec* spec)565 auto const parent = create_surface([&](MirWindowSpec* spec)
566 {566 {
567 mir_window_spec_set_type(spec, mir_surface_type_normal);567 mir_window_spec_set_type(spec, mir_window_type_normal);
568 mir_window_spec_set_width(spec, width);568 mir_window_spec_set_width(spec, width);
569 mir_window_spec_set_height(spec, height);569 mir_window_spec_set_height(spec, height);
570 mir_window_spec_set_pixel_format(spec, pixel_format);570 mir_window_spec_set_pixel_format(spec, pixel_format);
@@ -590,7 +590,7 @@
590590
591 auto const parent = create_surface([&](MirWindowSpec* spec)591 auto const parent = create_surface([&](MirWindowSpec* spec)
592 {592 {
593 mir_window_spec_set_type(spec, mir_surface_type_normal);593 mir_window_spec_set_type(spec, mir_window_type_normal);
594 mir_window_spec_set_width(spec, width);594 mir_window_spec_set_width(spec, width);
595 mir_window_spec_set_height(spec, height);595 mir_window_spec_set_height(spec, height);
596 mir_window_spec_set_pixel_format(spec, pixel_format);596 mir_window_spec_set_pixel_format(spec, pixel_format);
@@ -632,7 +632,7 @@
632632
633 auto const parent = create_surface([&](MirWindowSpec* spec)633 auto const parent = create_surface([&](MirWindowSpec* spec)
634 {634 {
635 mir_window_spec_set_type(spec, mir_surface_type_normal);635 mir_window_spec_set_type(spec, mir_window_type_normal);
636 mir_window_spec_set_width(spec, width);636 mir_window_spec_set_width(spec, width);
637 mir_window_spec_set_height(spec, height);637 mir_window_spec_set_height(spec, height);
638 mir_window_spec_set_pixel_format(spec, pixel_format);638 mir_window_spec_set_pixel_format(spec, pixel_format);
@@ -669,10 +669,10 @@
669}669}
670670
671INSTANTIATE_TEST_CASE_P(SurfaceSpecification, SurfaceWithoutParent,671INSTANTIATE_TEST_CASE_P(SurfaceSpecification, SurfaceWithoutParent,
672 Values(mir_surface_type_utility, mir_surface_type_normal));672 Values(mir_window_type_utility, mir_window_type_normal));
673673
674INSTANTIATE_TEST_CASE_P(SurfaceSpecification, SurfaceNeedingParent,674INSTANTIATE_TEST_CASE_P(SurfaceSpecification, SurfaceNeedingParent,
675 Values(mir_surface_type_satellite, mir_surface_type_gloss, mir_surface_type_tip));675 Values(mir_window_type_satellite, mir_window_type_gloss, mir_window_type_tip));
676676
677INSTANTIATE_TEST_CASE_P(SurfaceSpecification, SurfaceMayHaveParent,677INSTANTIATE_TEST_CASE_P(SurfaceSpecification, SurfaceMayHaveParent,
678 Values(mir_surface_type_dialog, mir_surface_type_freestyle));678 Values(mir_window_type_dialog, mir_window_type_freestyle));
679679
=== modified file 'tests/acceptance-tests/test_system_compositor_window_manager.cpp'
--- tests/acceptance-tests/test_system_compositor_window_manager.cpp 2017-01-09 06:48:47 +0000
+++ tests/acceptance-tests/test_system_compositor_window_manager.cpp 2017-01-10 20:52:04 +0000
@@ -174,14 +174,14 @@
174174
175MATCHER_P(MirFocusEvent, expected, "")175MATCHER_P(MirFocusEvent, expected, "")
176{176{
177 if (mir_event_get_type(arg) != mir_event_type_surface)177 if (mir_event_get_type(arg) != mir_event_type_window)
178 return false;178 return false;
179179
180 auto surface_event = mir_event_get_surface_event(arg);180 auto window_event = mir_event_get_window_event(arg);
181 auto attrib = mir_surface_event_get_attribute(surface_event);181 auto attrib = mir_window_event_get_attribute(window_event);
182 auto value = mir_surface_event_get_attribute_value(surface_event);182 auto value = mir_window_event_get_attribute_value(window_event);
183183
184 return (attrib == mir_surface_attrib_focus)184 return (attrib == mir_window_attrib_focus)
185 && (value == expected);185 && (value == expected);
186}186}
187}187}
188188
=== modified file 'tests/acceptance-tests/throwback/test_shell_control_of_surface_configuration.cpp'
--- tests/acceptance-tests/throwback/test_shell_control_of_surface_configuration.cpp 2017-01-09 06:48:47 +0000
+++ tests/acceptance-tests/throwback/test_shell_control_of_surface_configuration.cpp 2017-01-10 20:52:04 +0000
@@ -42,12 +42,12 @@
42 MOCK_METHOD4(set_surface_attribute,42 MOCK_METHOD4(set_surface_attribute,
43 int(std::shared_ptr<ms::Session> const& session,43 int(std::shared_ptr<ms::Session> const& session,
44 std::shared_ptr<ms::Surface> const& surface,44 std::shared_ptr<ms::Surface> const& surface,
45 MirSurfaceAttrib attrib,45 MirWindowAttrib attrib,
46 int value));46 int value));
4747
48 int real_set_surface_attribute(std::shared_ptr<ms::Session> const& session,48 int real_set_surface_attribute(std::shared_ptr<ms::Session> const& session,
49 std::shared_ptr<ms::Surface> const& surface,49 std::shared_ptr<ms::Surface> const& surface,
50 MirSurfaceAttrib attrib,50 MirWindowAttrib attrib,
51 int value)51 int value)
52 {52 {
53 return msh::CanonicalWindowManager::set_surface_attribute(session, surface, attrib, value);53 return msh::CanonicalWindowManager::set_surface_attribute(session, surface, attrib, value);
@@ -70,7 +70,7 @@
70 mock_window_manager.get(), &MockWindowManager::real_set_surface_attribute));70 mock_window_manager.get(), &MockWindowManager::real_set_surface_attribute));
7171
72 EXPECT_CALL(*mock_window_manager,72 EXPECT_CALL(*mock_window_manager,
73 set_surface_attribute(_, _, Ne(mir_surface_attrib_state), _))73 set_surface_attribute(_, _, Ne(mir_window_attrib_state), _))
74 .Times(AnyNumber());74 .Times(AnyNumber());
7575
76 return mock_window_manager;76 return mock_window_manager;
@@ -86,7 +86,7 @@
86TEST_F(ShellSurfaceConfiguration, the_window_manager_is_notified_of_attribute_changes)86TEST_F(ShellSurfaceConfiguration, the_window_manager_is_notified_of_attribute_changes)
87{87{
88 EXPECT_CALL(*mock_window_manager,88 EXPECT_CALL(*mock_window_manager,
89 set_surface_attribute(_, _, mir_surface_attrib_state, Eq(mir_surface_state_maximized)));89 set_surface_attribute(_, _, mir_window_attrib_state, Eq(mir_surface_state_maximized)));
9090
91 mir_wait_for(mir_surface_set_state(window, mir_surface_state_maximized));91 mir_wait_for(mir_surface_set_state(window, mir_surface_state_maximized));
9292
@@ -98,7 +98,7 @@
98 auto const set_to_vertmax = [this](98 auto const set_to_vertmax = [this](
99 std::shared_ptr<ms::Session> const& session,99 std::shared_ptr<ms::Session> const& session,
100 std::shared_ptr<ms::Surface> const& surface,100 std::shared_ptr<ms::Surface> const& surface,
101 MirSurfaceAttrib attrib,101 MirWindowAttrib attrib,
102 int /*value*/)102 int /*value*/)
103 {103 {
104 return mock_window_manager->real_set_surface_attribute(104 return mock_window_manager->real_set_surface_attribute(
@@ -106,7 +106,7 @@
106 };106 };
107107
108 EXPECT_CALL(*mock_window_manager,108 EXPECT_CALL(*mock_window_manager,
109 set_surface_attribute(_, _, mir_surface_attrib_state, Eq(mir_surface_state_maximized)))109 set_surface_attribute(_, _, mir_window_attrib_state, Eq(mir_surface_state_maximized)))
110 .WillOnce(Invoke(set_to_vertmax));110 .WillOnce(Invoke(set_to_vertmax));
111111
112 mir_wait_for(mir_surface_set_state(window, mir_surface_state_maximized));112 mir_wait_for(mir_surface_set_state(window, mir_surface_state_maximized));
113113
=== modified file 'tests/include/mir/test/doubles/mock_egl_native_surface.h'
--- tests/include/mir/test/doubles/mock_egl_native_surface.h 2017-01-09 06:48:47 +0000
+++ tests/include/mir/test/doubles/mock_egl_native_surface.h 2017-01-10 20:52:04 +0000
@@ -35,7 +35,7 @@
35 MOCK_CONST_METHOD0(get_parameters, MirWindowParameters());35 MOCK_CONST_METHOD0(get_parameters, MirWindowParameters());
36 MOCK_METHOD0(get_current_buffer, std::shared_ptr<client::ClientBuffer>());36 MOCK_METHOD0(get_current_buffer, std::shared_ptr<client::ClientBuffer>());
37 MOCK_METHOD0(swap_buffers_sync, void());37 MOCK_METHOD0(swap_buffers_sync, void());
38 MOCK_METHOD2(request_and_wait_for_configure, void(MirSurfaceAttrib,int));38 MOCK_METHOD2(request_and_wait_for_configure, void(MirWindowAttrib,int));
39 MOCK_METHOD1(set_buffer_cache_size, void(unsigned int));39 MOCK_METHOD1(set_buffer_cache_size, void(unsigned int));
40};40};
4141
4242
=== modified file 'tests/include/mir/test/doubles/mock_frontend_surface.h'
--- tests/include/mir/test/doubles/mock_frontend_surface.h 2015-06-18 02:46:16 +0000
+++ tests/include/mir/test/doubles/mock_frontend_surface.h 2017-01-10 20:52:04 +0000
@@ -63,9 +63,9 @@
63 MOCK_METHOD1(set_cursor_image, void(std::shared_ptr<graphics::CursorImage> const&));63 MOCK_METHOD1(set_cursor_image, void(std::shared_ptr<graphics::CursorImage> const&));
64 MOCK_METHOD2(set_cursor_stream, void(std::shared_ptr<frontend::BufferStream> const&, geometry::Displacement const&));64 MOCK_METHOD2(set_cursor_stream, void(std::shared_ptr<frontend::BufferStream> const&, geometry::Displacement const&));
6565
66 MOCK_METHOD2(configure, int(MirSurfaceAttrib, int));66 MOCK_METHOD2(configure, int(MirWindowAttrib, int));
6767
68 MOCK_CONST_METHOD1(query, int(MirSurfaceAttrib));68 MOCK_CONST_METHOD1(query, int(MirWindowAttrib));
6969
70 MOCK_METHOD1(add_observer, void(std::shared_ptr<scene::SurfaceObserver> const&));70 MOCK_METHOD1(add_observer, void(std::shared_ptr<scene::SurfaceObserver> const&));
71 MOCK_METHOD1(remove_observer, void(std::weak_ptr<scene::SurfaceObserver> const&));71 MOCK_METHOD1(remove_observer, void(std::weak_ptr<scene::SurfaceObserver> const&));
7272
=== modified file 'tests/include/mir/test/doubles/mock_scene_session.h'
--- tests/include/mir/test/doubles/mock_scene_session.h 2016-09-29 03:56:21 +0000
+++ tests/include/mir/test/doubles/mock_scene_session.h 2017-01-10 20:52:04 +0000
@@ -59,7 +59,7 @@
59 MOCK_METHOD1(send_display_config, void(graphics::DisplayConfiguration const&));59 MOCK_METHOD1(send_display_config, void(graphics::DisplayConfiguration const&));
60 MOCK_METHOD1(send_error, void(ClientVisibleError const&));60 MOCK_METHOD1(send_error, void(ClientVisibleError const&));
61 MOCK_METHOD1(send_input_device_change, void(std::vector<std::shared_ptr<mir::input::Device>> const&));61 MOCK_METHOD1(send_input_device_change, void(std::vector<std::shared_ptr<mir::input::Device>> const&));
62 MOCK_METHOD3(configure_surface, int(frontend::SurfaceId, MirSurfaceAttrib, int));62 MOCK_METHOD3(configure_surface, int(frontend::SurfaceId, MirWindowAttrib, int));
6363
64 MOCK_METHOD1(set_lifecycle_state, void(MirLifecycleState state));64 MOCK_METHOD1(set_lifecycle_state, void(MirLifecycleState state));
6565
6666
=== modified file 'tests/include/mir/test/doubles/mock_shell.h'
--- tests/include/mir/test/doubles/mock_shell.h 2016-01-29 08:18:22 +0000
+++ tests/include/mir/test/doubles/mock_shell.h 2017-01-10 20:52:04 +0000
@@ -65,10 +65,10 @@
6565
66 MOCK_METHOD4(set_surface_attribute, int(66 MOCK_METHOD4(set_surface_attribute, int(
67 std::shared_ptr<frontend::Session> const& session, frontend::SurfaceId surface_id,67 std::shared_ptr<frontend::Session> const& session, frontend::SurfaceId surface_id,
68 MirSurfaceAttrib attrib, int value));68 MirWindowAttrib attrib, int value));
6969
70 MOCK_METHOD3(get_surface_attribute, int(std::shared_ptr<frontend::Session> const& session,70 MOCK_METHOD3(get_surface_attribute, int(std::shared_ptr<frontend::Session> const& session,
71 frontend::SurfaceId surface_id, MirSurfaceAttrib attrib));71 frontend::SurfaceId surface_id, MirWindowAttrib attrib));
7272
73 MOCK_METHOD3(raise_surface, void(std::shared_ptr<frontend::Session> const& session,73 MOCK_METHOD3(raise_surface, void(std::shared_ptr<frontend::Session> const& session,
74 frontend::SurfaceId surface_id, uint64_t timestamp));74 frontend::SurfaceId surface_id, uint64_t timestamp));
7575
=== modified file 'tests/include/mir/test/doubles/mock_surface.h'
--- tests/include/mir/test/doubles/mock_surface.h 2016-08-25 08:16:10 +0000
+++ tests/include/mir/test/doubles/mock_surface.h 2017-01-10 20:52:04 +0000
@@ -69,7 +69,7 @@
69 MOCK_CONST_METHOD0(supports_input, bool());69 MOCK_CONST_METHOD0(supports_input, bool());
70 MOCK_CONST_METHOD0(client_input_fd, int());70 MOCK_CONST_METHOD0(client_input_fd, int());
7171
72 MOCK_METHOD2(configure, int(MirSurfaceAttrib, int));72 MOCK_METHOD2(configure, int(MirWindowAttrib, int));
73 MOCK_METHOD1(add_observer, void(std::shared_ptr<scene::SurfaceObserver> const&));73 MOCK_METHOD1(add_observer, void(std::shared_ptr<scene::SurfaceObserver> const&));
74 MOCK_METHOD1(remove_observer, void(std::weak_ptr<scene::SurfaceObserver> const&));74 MOCK_METHOD1(remove_observer, void(std::weak_ptr<scene::SurfaceObserver> const&));
75 MOCK_METHOD1(consume, void(MirEvent const*));75 MOCK_METHOD1(consume, void(MirEvent const*));
7676
=== modified file 'tests/include/mir/test/doubles/stub_scene_surface.h'
--- tests/include/mir/test/doubles/stub_scene_surface.h 2016-10-31 02:37:31 +0000
+++ tests/include/mir/test/doubles/stub_scene_surface.h 2017-01-10 20:52:04 +0000
@@ -67,7 +67,7 @@
67 int buffers_ready_for_compositor(void const*) const override { return 0; }67 int buffers_ready_for_compositor(void const*) const override { return 0; }
6868
69 float alpha() const override { return 0.0f;}69 float alpha() const override { return 0.0f;}
70 MirSurfaceType type() const override { return mir_surface_type_normal; }70 MirWindowType type() const override { return mir_window_type_normal; }
71 MirSurfaceState state() const override { return mir_surface_state_unknown; }71 MirSurfaceState state() const override { return mir_surface_state_unknown; }
7272
73 void hide() override {}73 void hide() override {}
@@ -93,8 +93,8 @@
9393
94 bool supports_input() const override { return true;}94 bool supports_input() const override { return true;}
95 int client_input_fd() const override { return fd;}95 int client_input_fd() const override { return fd;}
96 int configure(MirSurfaceAttrib, int) override { return 0; }96 int configure(MirWindowAttrib, int) override { return 0; }
97 int query(MirSurfaceAttrib) const override { return 0; }97 int query(MirWindowAttrib) const override { return 0; }
98 void with_most_recent_buffer_do(std::function<void(graphics::Buffer&)> const&) {}98 void with_most_recent_buffer_do(std::function<void(graphics::Buffer&)> const&) {}
9999
100 std::shared_ptr<mir::scene::Surface> parent() const override { return nullptr; }100 std::shared_ptr<mir::scene::Surface> parent() const override { return nullptr; }
101101
=== modified file 'tests/integration-tests/client/test_mirsurface.cpp'
--- tests/integration-tests/client/test_mirsurface.cpp 2017-01-09 06:48:47 +0000
+++ tests/integration-tests/client/test_mirsurface.cpp 2017-01-10 20:52:04 +0000
@@ -80,17 +80,17 @@
8080
81MATCHER(IsAMenu, "")81MATCHER(IsAMenu, "")
82{82{
83 return arg.type == mir_surface_type_menu;83 return arg.type == mir_window_type_menu;
84}84}
8585
86MATCHER(IsATooltip, "")86MATCHER(IsATooltip, "")
87{87{
88 return arg.type == mir_surface_type_tip;88 return arg.type == mir_window_type_tip;
89}89}
9090
91MATCHER(IsADialog, "")91MATCHER(IsADialog, "")
92{92{
93 return arg.type == mir_surface_type_dialog;93 return arg.type == mir_window_type_dialog;
94}94}
9595
96MATCHER_P(HasParent, parent, "")96MATCHER_P(HasParent, parent, "")
@@ -143,7 +143,7 @@
143 spec.buffer_usage = mir_buffer_usage_software;143 spec.buffer_usage = mir_buffer_usage_software;
144 spec.surface_name = "test_surface";144 spec.surface_name = "test_surface";
145 spec.output_id = mir_display_output_id_invalid;145 spec.output_id = mir_display_output_id_invalid;
146 spec.type = mir_surface_type_dialog;146 spec.type = mir_window_type_dialog;
147 spec.state = mir_surface_state_minimized;147 spec.state = mir_surface_state_minimized;
148 spec.pref_orientation = mir_orientation_mode_landscape;148 spec.pref_orientation = mir_orientation_mode_landscape;
149 }149 }
150150
=== modified file 'tests/integration-tests/session_management.cpp'
--- tests/integration-tests/session_management.cpp 2016-05-27 07:54:00 +0000
+++ tests/integration-tests/session_management.cpp 2017-01-10 20:52:04 +0000
@@ -131,7 +131,7 @@
131 mir::geometry::Size{1,1}, mir_pixel_format_abgr_8888, mir::graphics::BufferUsage::software);131 mir::geometry::Size{1,1}, mir_pixel_format_abgr_8888, mir::graphics::BufferUsage::software);
132 ms::SurfaceCreationParameters const params = ms::SurfaceCreationParameters()132 ms::SurfaceCreationParameters const params = ms::SurfaceCreationParameters()
133 .of_size(100,100)133 .of_size(100,100)
134 .of_type(mir_surface_type_normal)134 .of_type(mir_window_type_normal)
135 .with_buffer_stream(session->create_buffer_stream(properties));135 .with_buffer_stream(session->create_buffer_stream(properties));
136136
137 EXPECT_CALL(*test_surface_stack, add_surface(_,_)).Times(1);137 EXPECT_CALL(*test_surface_stack, add_surface(_,_)).Times(1);
138138
=== modified file 'tests/integration-tests/test_session.cpp'
--- tests/integration-tests/test_session.cpp 2016-11-04 17:12:59 +0000
+++ tests/integration-tests/test_session.cpp 2017-01-10 20:52:04 +0000
@@ -117,7 +117,7 @@
117 auto compositor = conf.the_compositor();117 auto compositor = conf.the_compositor();
118118
119 compositor->start();119 compositor->start();
120 session.default_surface()->configure(mir_surface_attrib_swapinterval, 0);120 session.default_surface()->configure(mir_window_attrib_swapinterval, 0);
121121
122 std::thread client_thread{122 std::thread client_thread{
123 [&session, stream_id]123 [&session, stream_id]
124124
=== modified file 'tests/mir_test_framework/stub_surface.cpp'
--- tests/mir_test_framework/stub_surface.cpp 2016-10-31 02:37:31 +0000
+++ tests/mir_test_framework/stub_surface.cpp 2017-01-10 20:52:04 +0000
@@ -131,9 +131,9 @@
131 return 0;131 return 0;
132}132}
133133
134MirSurfaceType mtd::StubSurface::type() const134MirWindowType mtd::StubSurface::type() const
135{135{
136 return MirSurfaceType::mir_surface_type_normal;136 return MirWindowType::mir_window_type_normal;
137}137}
138138
139MirSurfaceState mtd::StubSurface::state() const139MirSurfaceState mtd::StubSurface::state() const
@@ -141,12 +141,12 @@
141 return MirSurfaceState::mir_surface_state_fullscreen;141 return MirSurfaceState::mir_surface_state_fullscreen;
142}142}
143143
144int mtd::StubSurface::configure(MirSurfaceAttrib /*attrib*/, int value)144int mtd::StubSurface::configure(MirWindowAttrib /*attrib*/, int value)
145{145{
146 return value;146 return value;
147}147}
148148
149int mtd::StubSurface::query(MirSurfaceAttrib /*attrib*/) const149int mtd::StubSurface::query(MirWindowAttrib /*attrib*/) const
150{150{
151 return 0;151 return 0;
152}152}
153153
=== modified file 'tests/mir_test_framework/visible_surface.cpp'
--- tests/mir_test_framework/visible_surface.cpp 2017-01-09 06:48:47 +0000
+++ tests/mir_test_framework/visible_surface.cpp 2017-01-10 20:52:04 +0000
@@ -42,12 +42,13 @@
4242
43void mtf::VisibleSurface::event_callback(MirSurface* surf, MirEvent const* ev, void* context)43void mtf::VisibleSurface::event_callback(MirSurface* surf, MirEvent const* ev, void* context)
44{44{
45 if (mir_event_get_type(ev) == mir_event_type_surface)45 if (mir_event_get_type(ev) == mir_event_type_window)
46 {46 {
47 if (mir_surface_event_get_attribute(mir_event_get_surface_event(ev)) == mir_surface_attrib_visibility)47 auto attrib = mir_window_event_get_attribute(mir_event_get_window_event(ev));
48 if (attrib == mir_window_attrib_visibility)
48 {49 {
49 auto ctx = reinterpret_cast<VisibleSurface*>(context);50 auto ctx = reinterpret_cast<VisibleSurface*>(context);
50 ctx->set_visibility(surf, mir_surface_event_get_attribute_value(mir_event_get_surface_event(ev)));51 ctx->set_visibility(surf, mir_window_event_get_attribute_value(mir_event_get_window_event(ev)));
51 }52 }
52 }53 }
53}54}
5455
=== modified file 'tests/unit-tests/client/test_client_mir_surface.cpp'
--- tests/unit-tests/client/test_client_mir_surface.cpp 2017-01-09 06:48:47 +0000
+++ tests/unit-tests/client/test_client_mir_surface.cpp 2017-01-10 20:52:04 +0000
@@ -210,13 +210,13 @@
210};210};
211211
212std::map<int, int> MockServerPackageGenerator::sent_surface_attributes = {212std::map<int, int> MockServerPackageGenerator::sent_surface_attributes = {
213 { mir_surface_attrib_type, mir_surface_type_normal },213 { mir_window_attrib_type, mir_window_type_normal },
214 { mir_surface_attrib_state, mir_surface_state_restored },214 { mir_window_attrib_state, mir_surface_state_restored },
215 { mir_surface_attrib_swapinterval, 1 },215 { mir_window_attrib_swapinterval, 1 },
216 { mir_surface_attrib_focus, mir_surface_focused },216 { mir_window_attrib_focus, mir_surface_focused },
217 { mir_surface_attrib_dpi, 19 },217 { mir_window_attrib_dpi, 19 },
218 { mir_surface_attrib_visibility, mir_surface_visibility_exposed },218 { mir_window_attrib_visibility, mir_surface_visibility_exposed },
219 { mir_surface_attrib_preferred_orientation, mir_orientation_mode_any }219 { mir_window_attrib_preferred_orientation, mir_orientation_mode_any }
220};220};
221221
222struct StubClientInputPlatform : public mircv::InputPlatform222struct StubClientInputPlatform : public mircv::InputPlatform
@@ -389,9 +389,9 @@
389389
390 auto surface = create_and_wait_for_surface_with(*client_comm_channel);390 auto surface = create_and_wait_for_surface_with(*client_comm_channel);
391 391
392 for (int i = 0; i < mir_surface_attribs; i++)392 for (int i = 0; i < mir_window_attribs; i++)
393 {393 {
394 EXPECT_EQ(MockServerPackageGenerator::sent_surface_attributes[i], surface->attrib(static_cast<MirSurfaceAttrib>(i)));394 EXPECT_EQ(MockServerPackageGenerator::sent_surface_attributes[i], surface->attrib(static_cast<MirWindowAttrib>(i)));
395 }395 }
396}396}
397397
@@ -492,7 +492,7 @@
492492
493 auto const surface = create_surface_with(unresponsive_server);493 auto const surface = create_surface_with(unresponsive_server);
494494
495 auto configure_wait_handle = surface->configure(mir_surface_attrib_dpi, 100);495 auto configure_wait_handle = surface->configure(mir_window_attrib_dpi, 100);
496496
497 auto expected_end = std::chrono::steady_clock::now() + pause_time;497 auto expected_end = std::chrono::steady_clock::now() + pause_time;
498 configure_wait_handle->wait_for_pending(pause_time);498 configure_wait_handle->wait_for_pending(pause_time);
499499
=== modified file 'tests/unit-tests/frontend/test_event_sender.cpp'
--- tests/unit-tests/frontend/test_event_sender.cpp 2016-12-20 15:01:43 +0000
+++ tests/unit-tests/frontend/test_event_sender.cpp 2017-01-10 20:52:04 +0000
@@ -156,7 +156,7 @@
156{156{
157 using namespace testing;157 using namespace testing;
158158
159 auto surface_ev = mev::make_event(mf::SurfaceId{1}, mir_surface_attrib_focus, mir_surface_focused);159 auto surface_ev = mev::make_event(mf::SurfaceId{1}, mir_window_attrib_focus, mir_surface_focused);
160 auto resize_ev = mev::make_event(mf::SurfaceId{1}, {10, 10});160 auto resize_ev = mev::make_event(mf::SurfaceId{1}, {10, 10});
161161
162 EXPECT_CALL(mock_msg_sender, send(_, _, _))162 EXPECT_CALL(mock_msg_sender, send(_, _, _))
163163
=== modified file 'tests/unit-tests/platforms/android/client/test_egl_native_surface_interpreter.cpp'
--- tests/unit-tests/platforms/android/client/test_egl_native_surface_interpreter.cpp 2017-01-09 06:48:47 +0000
+++ tests/unit-tests/platforms/android/client/test_egl_native_surface_interpreter.cpp 2017-01-10 20:52:04 +0000
@@ -57,7 +57,7 @@
57 MOCK_CONST_METHOD0(get_parameters, MirWindowParameters());57 MOCK_CONST_METHOD0(get_parameters, MirWindowParameters());
58 MOCK_METHOD0(get_current_buffer, std::shared_ptr<mcl::ClientBuffer>());58 MOCK_METHOD0(get_current_buffer, std::shared_ptr<mcl::ClientBuffer>());
59 MOCK_METHOD0(swap_buffers_sync, void());59 MOCK_METHOD0(swap_buffers_sync, void());
60 MOCK_METHOD2(request_and_wait_for_configure, void(MirSurfaceAttrib, int));60 MOCK_METHOD2(request_and_wait_for_configure, void(MirWindowAttrib, int));
61 MOCK_METHOD1(set_buffer_cache_size, void(unsigned int));61 MOCK_METHOD1(set_buffer_cache_size, void(unsigned int));
62 MirWindowParameters params;62 MirWindowParameters params;
63 std::shared_ptr<mtd::MockClientBuffer> client_buffer;63 std::shared_ptr<mtd::MockClientBuffer> client_buffer;
@@ -223,8 +223,8 @@
223{223{
224 testing::NiceMock<MockMirSurface> mock_surface{surf_params};224 testing::NiceMock<MockMirSurface> mock_surface{surf_params};
225 testing::InSequence seq;225 testing::InSequence seq;
226 EXPECT_CALL(mock_surface, request_and_wait_for_configure(mir_surface_attrib_swapinterval, 1));226 EXPECT_CALL(mock_surface, request_and_wait_for_configure(mir_window_attrib_swapinterval, 1));
227 EXPECT_CALL(mock_surface, request_and_wait_for_configure(mir_surface_attrib_swapinterval, 0));227 EXPECT_CALL(mock_surface, request_and_wait_for_configure(mir_window_attrib_swapinterval, 0));
228228
229 mcla::EGLNativeSurfaceInterpreter interpreter(mock_surface);229 mcla::EGLNativeSurfaceInterpreter interpreter(mock_surface);
230 interpreter.sync_to_display(true); 230 interpreter.sync_to_display(true);
231231
=== modified file 'tests/unit-tests/platforms/mesa/client/test_native_surface.cpp'
--- tests/unit-tests/platforms/mesa/client/test_native_surface.cpp 2017-01-09 06:48:47 +0000
+++ tests/unit-tests/platforms/mesa/client/test_native_surface.cpp 2017-01-10 20:52:04 +0000
@@ -105,9 +105,9 @@
105 using namespace testing;105 using namespace testing;
106106
107 Sequence seq;107 Sequence seq;
108 EXPECT_CALL(mock_surface, request_and_wait_for_configure(mir_surface_attrib_swapinterval,0))108 EXPECT_CALL(mock_surface, request_and_wait_for_configure(mir_window_attrib_swapinterval,0))
109 .InSequence(seq);109 .InSequence(seq);
110 EXPECT_CALL(mock_surface, request_and_wait_for_configure(mir_surface_attrib_swapinterval,1))110 EXPECT_CALL(mock_surface, request_and_wait_for_configure(mir_window_attrib_swapinterval,1))
111 .InSequence(seq);111 .InSequence(seq);
112112
113 EXPECT_EQ(MIR_MESA_TRUE, native_surface.set_swapinterval(0));113 EXPECT_EQ(MIR_MESA_TRUE, native_surface.set_swapinterval(0));
114114
=== modified file 'tests/unit-tests/scene/test_abstract_shell.cpp'
--- tests/unit-tests/scene/test_abstract_shell.cpp 2016-11-09 02:30:14 +0000
+++ tests/unit-tests/scene/test_abstract_shell.cpp 2017-01-10 20:52:04 +0000
@@ -384,13 +384,13 @@
384384
385 MirSurfaceState const state{mir_surface_state_fullscreen};385 MirSurfaceState const state{mir_surface_state_fullscreen};
386386
387 EXPECT_CALL(*wm, set_surface_attribute(session, surface, mir_surface_attrib_state, state))387 EXPECT_CALL(*wm, set_surface_attribute(session, surface, mir_window_attrib_state, state))
388 .WillOnce(WithArg<1>(Invoke([](std::shared_ptr<ms::Surface> const& surface)388 .WillOnce(WithArg<1>(Invoke([](std::shared_ptr<ms::Surface> const& surface)
389 { surface->configure(mir_surface_attrib_state, mir_surface_state_maximized); return mir_surface_state_maximized; })));389 { surface->configure(mir_window_attrib_state, mir_surface_state_maximized); return mir_surface_state_maximized; })));
390390
391 EXPECT_CALL(mock_surface, configure(mir_surface_attrib_state, mir_surface_state_maximized));391 EXPECT_CALL(mock_surface, configure(mir_window_attrib_state, mir_surface_state_maximized));
392392
393 shell.set_surface_attribute(session, surface, mir_surface_attrib_state, mir_surface_state_fullscreen);393 shell.set_surface_attribute(session, surface, mir_window_attrib_state, mir_surface_state_fullscreen);
394}394}
395395
396TEST_F(AbstractShell, as_focus_controller_set_focus_to_notifies_session_event_sink)396TEST_F(AbstractShell, as_focus_controller_set_focus_to_notifies_session_event_sink)
397397
=== modified file 'tests/unit-tests/scene/test_application_session.cpp'
--- tests/unit-tests/scene/test_application_session.cpp 2016-11-11 07:56:09 +0000
+++ tests/unit-tests/scene/test_application_session.cpp 2017-01-10 20:52:04 +0000
@@ -114,7 +114,7 @@
114114
115MATCHER(IsSurfaceOutputEvent, "")115MATCHER(IsSurfaceOutputEvent, "")
116{116{
117 return mir_event_get_type(&arg) == mir_event_type_surface_output;117 return mir_event_get_type(&arg) == mir_event_type_window_output;
118}118}
119119
120struct StubSurfaceStack : public msh::SurfaceStack120struct StubSurfaceStack : public msh::SurfaceStack
@@ -696,7 +696,7 @@
696696
697 ms::SurfaceCreationParameters params = ms::SurfaceCreationParameters{}697 ms::SurfaceCreationParameters params = ms::SurfaceCreationParameters{}
698 .of_name("Aardavks")698 .of_name("Aardavks")
699 .of_type(mir_surface_type_normal)699 .of_type(mir_window_type_normal)
700 .with_buffer_stream(id);700 .with_buffer_stream(id);
701701
702 session->create_surface(params, event_sink);702 session->create_surface(params, event_sink);
@@ -895,13 +895,13 @@
895{895{
896 using namespace testing;896 using namespace testing;
897897
898 if (mir_event_get_type(arg) != mir_event_type_surface_output)898 if (mir_event_get_type(arg) != mir_event_type_window_output)
899 {899 {
900 *result_listener << "Event is not a MirSurfaceOutputEvent";900 *result_listener << "Event is not a MirWindowOutputEvent";
901 return 0;901 return 0;
902 }902 }
903903
904 auto const event = mir_event_get_surface_output_event(arg);904 auto const event = mir_event_get_window_output_event(arg);
905905
906 if (output.output.current_mode_index >= output.output.modes.size())906 if (output.output.current_mode_index >= output.output.modes.size())
907 return false;907 return false;
@@ -911,23 +911,23 @@
911 return911 return
912 ExplainMatchResult(912 ExplainMatchResult(
913 Eq(output.dpi),913 Eq(output.dpi),
914 mir_surface_output_event_get_dpi(event),914 mir_window_output_event_get_dpi(event),
915 result_listener) &&915 result_listener) &&
916 ExplainMatchResult(916 ExplainMatchResult(
917 Eq(output.form_factor),917 Eq(output.form_factor),
918 mir_surface_output_event_get_form_factor(event),918 mir_window_output_event_get_form_factor(event),
919 result_listener) &&919 result_listener) &&
920 ExplainMatchResult(920 ExplainMatchResult(
921 Eq(output.scale),921 Eq(output.scale),
922 mir_surface_output_event_get_scale(event),922 mir_window_output_event_get_scale(event),
923 result_listener) &&923 result_listener) &&
924 ExplainMatchResult(924 ExplainMatchResult(
925 Eq(mode.vrefresh_hz),925 Eq(mode.vrefresh_hz),
926 mir_surface_output_event_get_refresh_rate(event),926 mir_window_output_event_get_refresh_rate(event),
927 result_listener) &&927 result_listener) &&
928 ExplainMatchResult(928 ExplainMatchResult(
929 Eq(output.id),929 Eq(output.id),
930 mir_surface_output_event_get_output_id(event),930 mir_window_output_event_get_output_id(event),
931 result_listener);931 result_listener);
932}932}
933}933}
@@ -942,7 +942,7 @@
942 EXPECT_CALL(*sender, handle_event(IsSurfaceOutputEvent()))942 EXPECT_CALL(*sender, handle_event(IsSurfaceOutputEvent()))
943 .WillOnce(Invoke([&event, &event_received](MirEvent const& ev)943 .WillOnce(Invoke([&event, &event_received](MirEvent const& ev)
944 {944 {
945 if (event.type() == mir_event_type_surface_output)945 if (event.type() == mir_event_type_window_output)
946 {946 {
947 event = *ev.to_surface_output();947 event = *ev.to_surface_output();
948 }948 }
@@ -978,7 +978,7 @@
978 ON_CALL(*sender, handle_event(IsSurfaceOutputEvent()))978 ON_CALL(*sender, handle_event(IsSurfaceOutputEvent()))
979 .WillByDefault(Invoke([&event, &events_received](MirEvent const& ev)979 .WillByDefault(Invoke([&event, &events_received](MirEvent const& ev)
980 {980 {
981 if (ev.type() == mir_event_type_surface_output)981 if (ev.type() == mir_event_type_window_output)
982 {982 {
983 event[events_received] = *ev.to_surface_output();983 event[events_received] = *ev.to_surface_output();
984 }984 }
@@ -1035,7 +1035,7 @@
1035 ON_CALL(*sender, handle_event(IsSurfaceOutputEvent()))1035 ON_CALL(*sender, handle_event(IsSurfaceOutputEvent()))
1036 .WillByDefault(Invoke([&event, &event_received](MirEvent const& ev)1036 .WillByDefault(Invoke([&event, &event_received](MirEvent const& ev)
1037 {1037 {
1038 if (ev.type() == mir_event_type_surface_output)1038 if (ev.type() == mir_event_type_window_output)
1039 {1039 {
1040 event = *ev.to_surface_output();1040 event = *ev.to_surface_output();
1041 }1041 }
@@ -1083,7 +1083,7 @@
1083 ON_CALL(*sender, handle_event(IsSurfaceOutputEvent()))1083 ON_CALL(*sender, handle_event(IsSurfaceOutputEvent()))
1084 .WillByDefault(Invoke([&event, &event_received](MirEvent const& ev)1084 .WillByDefault(Invoke([&event, &event_received](MirEvent const& ev)
1085 {1085 {
1086 if (ev.type() == mir_event_type_surface_output)1086 if (ev.type() == mir_event_type_window_output)
1087 {1087 {
1088 event = *ev.to_surface_output();1088 event = *ev.to_surface_output();
1089 }1089 }
@@ -1144,7 +1144,7 @@
1144 ON_CALL(*sender, handle_event(IsSurfaceOutputEvent()))1144 ON_CALL(*sender, handle_event(IsSurfaceOutputEvent()))
1145 .WillByDefault(Invoke([&event, &events_received](MirEvent const& ev)1145 .WillByDefault(Invoke([&event, &events_received](MirEvent const& ev)
1146 {1146 {
1147 if (ev.type() == mir_event_type_surface_output)1147 if (ev.type() == mir_event_type_window_output)
1148 {1148 {
1149 event = *ev.to_surface_output();1149 event = *ev.to_surface_output();
1150 }1150 }
11511151
=== modified file 'tests/unit-tests/scene/test_basic_surface.cpp'
--- tests/unit-tests/scene/test_basic_surface.cpp 2016-11-09 02:30:14 +0000
+++ tests/unit-tests/scene/test_basic_surface.cpp 2017-01-10 20:52:04 +0000
@@ -64,7 +64,7 @@
64class MockSurfaceObserver : public ms::NullSurfaceObserver64class MockSurfaceObserver : public ms::NullSurfaceObserver
65{65{
66public:66public:
67 MOCK_METHOD2(attrib_changed, void(MirSurfaceAttrib, int));67 MOCK_METHOD2(attrib_changed, void(MirWindowAttrib, int));
68 MOCK_METHOD1(hidden_set_to, void(bool));68 MOCK_METHOD1(hidden_set_to, void(bool));
69 MOCK_METHOD1(renamed, void(char const*));69 MOCK_METHOD1(renamed, void(char const*));
70 MOCK_METHOD0(client_surface_close_requested, void());70 MOCK_METHOD0(client_surface_close_requested, void());
@@ -508,7 +508,7 @@
508508
509struct AttributeTestParameters509struct AttributeTestParameters
510{510{
511 MirSurfaceAttrib attribute;511 MirWindowAttrib attribute;
512 int default_value;512 int default_value;
513 int a_valid_value;513 int a_valid_value;
514 int an_invalid_value;514 int an_invalid_value;
@@ -520,42 +520,42 @@
520};520};
521521
522AttributeTestParameters const surface_visibility_test_parameters{522AttributeTestParameters const surface_visibility_test_parameters{
523 mir_surface_attrib_visibility,523 mir_window_attrib_visibility,
524 mir_surface_visibility_occluded,524 mir_surface_visibility_occluded,
525 mir_surface_visibility_exposed,525 mir_surface_visibility_exposed,
526 -1526 -1
527};527};
528528
529AttributeTestParameters const surface_type_test_parameters{529AttributeTestParameters const surface_type_test_parameters{
530 mir_surface_attrib_type,530 mir_window_attrib_type,
531 mir_surface_type_normal,531 mir_window_type_normal,
532 mir_surface_type_freestyle,532 mir_window_type_freestyle,
533 -1533 -1
534};534};
535535
536AttributeTestParameters const surface_state_test_parameters{536AttributeTestParameters const surface_state_test_parameters{
537 mir_surface_attrib_state,537 mir_window_attrib_state,
538 mir_surface_state_restored,538 mir_surface_state_restored,
539 mir_surface_state_fullscreen,539 mir_surface_state_fullscreen,
540 1178312540 1178312
541};541};
542542
543AttributeTestParameters const surface_swapinterval_test_parameters{543AttributeTestParameters const surface_swapinterval_test_parameters{
544 mir_surface_attrib_swapinterval,544 mir_window_attrib_swapinterval,
545 1,545 1,
546 0,546 0,
547 -1547 -1
548};548};
549549
550AttributeTestParameters const surface_dpi_test_parameters{550AttributeTestParameters const surface_dpi_test_parameters{
551 mir_surface_attrib_dpi,551 mir_window_attrib_dpi,
552 0,552 0,
553 90,553 90,
554 -1554 -1
555};555};
556556
557AttributeTestParameters const surface_focus_test_parameters{557AttributeTestParameters const surface_focus_test_parameters{
558 mir_surface_attrib_focus,558 mir_window_attrib_focus,
559 mir_surface_unfocused,559 mir_surface_unfocused,
560 mir_surface_focused,560 mir_surface_focused,
561 -1561 -1
@@ -920,9 +920,9 @@
920 EXPECT_CALL(*buffer_stream, drop_old_buffers()).Times(Exactly(1));920 EXPECT_CALL(*buffer_stream, drop_old_buffers()).Times(Exactly(1));
921 EXPECT_CALL(*mock_buffer_stream, drop_old_buffers()).Times(Exactly(1));921 EXPECT_CALL(*mock_buffer_stream, drop_old_buffers()).Times(Exactly(1));
922922
923 surface.configure(mir_surface_attrib_visibility, mir_surface_visibility_occluded);923 surface.configure(mir_window_attrib_visibility, mir_surface_visibility_occluded);
924 surface.configure(mir_surface_attrib_visibility, mir_surface_visibility_exposed);924 surface.configure(mir_window_attrib_visibility, mir_surface_visibility_exposed);
925 surface.configure(mir_surface_attrib_visibility, mir_surface_visibility_exposed);925 surface.configure(mir_window_attrib_visibility, mir_surface_visibility_exposed);
926}926}
927927
928//TODO: per-stream alpha and swapinterval seems useful928//TODO: per-stream alpha and swapinterval seems useful
@@ -988,7 +988,7 @@
988 EXPECT_CALL(*buffer_stream, allow_framedropping(true));988 EXPECT_CALL(*buffer_stream, allow_framedropping(true));
989989
990 surface.set_streams(streams);990 surface.set_streams(streams);
991 surface.configure(mir_surface_attrib_swapinterval, 0);991 surface.configure(mir_window_attrib_swapinterval, 0);
992}992}
993993
994TEST_F(BasicSurfaceTest, visibility_matches_produced_list)994TEST_F(BasicSurfaceTest, visibility_matches_produced_list)
@@ -1102,9 +1102,9 @@
1102{1102{
1103struct VisibilityObserver : ms::NullSurfaceObserver1103struct VisibilityObserver : ms::NullSurfaceObserver
1104{1104{
1105 void attrib_changed(MirSurfaceAttrib attrib, int value) override1105 void attrib_changed(MirWindowAttrib attrib, int value) override
1106 {1106 {
1107 if (attrib == mir_surface_attrib_visibility)1107 if (attrib == mir_window_attrib_visibility)
1108 {1108 {
1109 if (value == mir_surface_visibility_occluded)1109 if (value == mir_surface_visibility_occluded)
1110 hides_++;1110 hides_++;
@@ -1134,7 +1134,7 @@
11341134
1135 EXPECT_THAT(observer->exposes(), Eq(0));1135 EXPECT_THAT(observer->exposes(), Eq(0));
1136 EXPECT_THAT(observer->hides(), Eq(0));1136 EXPECT_THAT(observer->hides(), Eq(0));
1137 surface.configure(mir_surface_attrib_visibility, mir_surface_visibility_exposed);1137 surface.configure(mir_window_attrib_visibility, mir_surface_visibility_exposed);
11381138
1139 EXPECT_THAT(observer->exposes(), Eq(1));1139 EXPECT_THAT(observer->exposes(), Eq(1));
1140 EXPECT_THAT(observer->hides(), Eq(0));1140 EXPECT_THAT(observer->hides(), Eq(0));
11411141
=== modified file 'tests/unit-tests/scene/test_rendering_tracker.cpp'
--- tests/unit-tests/scene/test_rendering_tracker.cpp 2015-06-25 03:00:08 +0000
+++ tests/unit-tests/scene/test_rendering_tracker.cpp 2017-01-10 20:52:04 +0000
@@ -48,7 +48,7 @@
4848
49 EXPECT_CALL(49 EXPECT_CALL(
50 *mock_surface,50 *mock_surface,
51 configure(mir_surface_attrib_visibility, mir_surface_visibility_occluded));51 configure(mir_window_attrib_visibility, mir_surface_visibility_occluded));
5252
53 tracker.active_compositors(compositors);53 tracker.active_compositors(compositors);
5454
@@ -63,7 +63,7 @@
6363
64 EXPECT_CALL(64 EXPECT_CALL(
65 *mock_surface,65 *mock_surface,
66 configure(mir_surface_attrib_visibility, mir_surface_visibility_exposed));66 configure(mir_window_attrib_visibility, mir_surface_visibility_exposed));
6767
68 tracker.active_compositors(compositors);68 tracker.active_compositors(compositors);
6969
@@ -78,7 +78,7 @@
7878
79 EXPECT_CALL(79 EXPECT_CALL(
80 *mock_surface,80 *mock_surface,
81 configure(mir_surface_attrib_visibility, mir_surface_visibility_exposed));81 configure(mir_window_attrib_visibility, mir_surface_visibility_exposed));
8282
83 tracker.active_compositors(compositors);83 tracker.active_compositors(compositors);
8484
@@ -94,7 +94,7 @@
9494
95 EXPECT_CALL(95 EXPECT_CALL(
96 *mock_surface,96 *mock_surface,
97 configure(mir_surface_attrib_visibility, mir_surface_visibility_occluded))97 configure(mir_window_attrib_visibility, mir_surface_visibility_occluded))
98 .Times(0);98 .Times(0);
9999
100 tracker.active_compositors(compositors);100 tracker.active_compositors(compositors);
@@ -111,7 +111,7 @@
111111
112 EXPECT_CALL(112 EXPECT_CALL(
113 *mock_surface,113 *mock_surface,
114 configure(mir_surface_attrib_visibility, mir_surface_visibility_occluded));114 configure(mir_window_attrib_visibility, mir_surface_visibility_occluded));
115115
116 tracker.active_compositors(compositors);116 tracker.active_compositors(compositors);
117117
@@ -136,7 +136,7 @@
136136
137 EXPECT_CALL(137 EXPECT_CALL(
138 *mock_surface,138 *mock_surface,
139 configure(mir_surface_attrib_visibility, mir_surface_visibility_occluded));139 configure(mir_window_attrib_visibility, mir_surface_visibility_occluded));
140140
141 compositors.erase(compositor_id3);141 compositors.erase(compositor_id3);
142 tracker.active_compositors(compositors);142 tracker.active_compositors(compositors);
143143
=== modified file 'tests/unit-tests/scene/test_surface.cpp'
--- tests/unit-tests/scene/test_surface.cpp 2016-11-11 06:59:42 +0000
+++ tests/unit-tests/scene/test_surface.cpp 2017-01-10 20:52:04 +0000
@@ -93,7 +93,7 @@
93 MirPixelFormat const format{mir_pixel_format_abgr_8888};93 MirPixelFormat const format{mir_pixel_format_abgr_8888};
94 std::string name{"surface"};94 std::string name{"surface"};
95 MirSurfaceState state{mir_surface_state_fullscreen};95 MirSurfaceState state{mir_surface_state_fullscreen};
96 MirSurfaceType type{mir_surface_type_dialog};96 MirWindowType type{mir_window_type_dialog};
97 MirOrientationMode mode{mir_orientation_mode_landscape};97 MirOrientationMode mode{mir_orientation_mode_landscape};
98 mf::SurfaceId surf_id{1000};98 mf::SurfaceId surf_id{1000};
9999
100100
=== modified file 'tests/unit-tests/scene/test_surface_impl.cpp'
--- tests/unit-tests/scene/test_surface_impl.cpp 2016-11-11 06:59:42 +0000
+++ tests/unit-tests/scene/test_surface_impl.cpp 2017-01-10 20:52:04 +0000
@@ -102,7 +102,7 @@
102 using namespace testing;102 using namespace testing;
103103
104 EXPECT_THROW({104 EXPECT_THROW({
105 surface->configure(static_cast<MirSurfaceAttrib>(111), 222);105 surface->configure(static_cast<MirWindowAttrib>(111), 222);
106 }, std::logic_error);106 }, std::logic_error);
107}107}
108108
@@ -110,30 +110,30 @@
110{110{
111 using namespace testing;111 using namespace testing;
112112
113 EXPECT_EQ(mir_surface_type_normal, surface->type());113 EXPECT_EQ(mir_window_type_normal, surface->type());
114114
115 EXPECT_EQ(mir_surface_type_utility,115 EXPECT_EQ(mir_window_type_utility,
116 surface->configure(mir_surface_attrib_type,116 surface->configure(mir_window_attrib_type,
117 mir_surface_type_utility));117 mir_window_type_utility));
118 EXPECT_EQ(mir_surface_type_utility, surface->type());118 EXPECT_EQ(mir_window_type_utility, surface->type());
119119
120 EXPECT_THROW({120 EXPECT_THROW({
121 surface->configure(mir_surface_attrib_type, 999);121 surface->configure(mir_window_attrib_type, 999);
122 }, std::logic_error);122 }, std::logic_error);
123 EXPECT_THROW({123 EXPECT_THROW({
124 surface->configure(mir_surface_attrib_type, -1);124 surface->configure(mir_window_attrib_type, -1);
125 }, std::logic_error);125 }, std::logic_error);
126 EXPECT_EQ(mir_surface_type_utility, surface->type());126 EXPECT_EQ(mir_window_type_utility, surface->type());
127127
128 EXPECT_EQ(mir_surface_type_dialog,128 EXPECT_EQ(mir_window_type_dialog,
129 surface->configure(mir_surface_attrib_type,129 surface->configure(mir_window_attrib_type,
130 mir_surface_type_dialog));130 mir_window_type_dialog));
131 EXPECT_EQ(mir_surface_type_dialog, surface->type());131 EXPECT_EQ(mir_window_type_dialog, surface->type());
132132
133 EXPECT_EQ(mir_surface_type_freestyle,133 EXPECT_EQ(mir_window_type_freestyle,
134 surface->configure(mir_surface_attrib_type,134 surface->configure(mir_window_attrib_type,
135 mir_surface_type_freestyle));135 mir_window_type_freestyle));
136 EXPECT_EQ(mir_surface_type_freestyle, surface->type());136 EXPECT_EQ(mir_window_type_freestyle, surface->type());
137}137}
138138
139TEST_F(Surface, states)139TEST_F(Surface, states)
@@ -143,25 +143,25 @@
143 EXPECT_EQ(mir_surface_state_restored, surface->state());143 EXPECT_EQ(mir_surface_state_restored, surface->state());
144144
145 EXPECT_EQ(mir_surface_state_vertmaximized,145 EXPECT_EQ(mir_surface_state_vertmaximized,
146 surface->configure(mir_surface_attrib_state,146 surface->configure(mir_window_attrib_state,
147 mir_surface_state_vertmaximized));147 mir_surface_state_vertmaximized));
148 EXPECT_EQ(mir_surface_state_vertmaximized, surface->state());148 EXPECT_EQ(mir_surface_state_vertmaximized, surface->state());
149149
150 EXPECT_THROW({150 EXPECT_THROW({
151 surface->configure(mir_surface_attrib_state, 999);151 surface->configure(mir_window_attrib_state, 999);
152 }, std::logic_error);152 }, std::logic_error);
153 EXPECT_THROW({153 EXPECT_THROW({
154 surface->configure(mir_surface_attrib_state, -1);154 surface->configure(mir_window_attrib_state, -1);
155 }, std::logic_error);155 }, std::logic_error);
156 EXPECT_EQ(mir_surface_state_vertmaximized, surface->state());156 EXPECT_EQ(mir_surface_state_vertmaximized, surface->state());
157157
158 EXPECT_EQ(mir_surface_state_minimized,158 EXPECT_EQ(mir_surface_state_minimized,
159 surface->configure(mir_surface_attrib_state,159 surface->configure(mir_window_attrib_state,
160 mir_surface_state_minimized));160 mir_surface_state_minimized));
161 EXPECT_EQ(mir_surface_state_minimized, surface->state());161 EXPECT_EQ(mir_surface_state_minimized, surface->state());
162162
163 EXPECT_EQ(mir_surface_state_fullscreen,163 EXPECT_EQ(mir_surface_state_fullscreen,
164 surface->configure(mir_surface_attrib_state,164 surface->configure(mir_window_attrib_state,
165 mir_surface_state_fullscreen));165 mir_surface_state_fullscreen));
166 EXPECT_EQ(mir_surface_state_fullscreen, surface->state());166 EXPECT_EQ(mir_surface_state_fullscreen, surface->state());
167}167}
@@ -235,9 +235,9 @@
235235
236 {236 {
237 InSequence seq;237 InSequence seq;
238 EXPECT_CALL(sink, handle_event(mt::SurfaceEvent(mir_surface_attrib_focus, mir_surface_focused)))238 EXPECT_CALL(sink, handle_event(mt::WindowEvent(mir_window_attrib_focus, mir_surface_focused)))
239 .Times(1);239 .Times(1);
240 EXPECT_CALL(sink, handle_event(mt::SurfaceEvent(mir_surface_attrib_focus, mir_surface_unfocused)))240 EXPECT_CALL(sink, handle_event(mt::WindowEvent(mir_window_attrib_focus, mir_surface_unfocused)))
241 .Times(1);241 .Times(1);
242 }242 }
243243
@@ -246,8 +246,8 @@
246246
247 surface->add_observer(observer);247 surface->add_observer(observer);
248248
249 surface->configure(mir_surface_attrib_focus, mir_surface_focused);249 surface->configure(mir_window_attrib_focus, mir_surface_focused);
250 surface->configure(mir_surface_attrib_focus, mir_surface_unfocused);250 surface->configure(mir_window_attrib_focus, mir_surface_unfocused);
251}251}
252MATCHER_P(MirCloseSurfaceEventMatches, event, "")252MATCHER_P(MirCloseSurfaceEventMatches, event, "")
253{253{
@@ -286,5 +286,5 @@
286 std::shared_ptr<mg::CursorImage>(),286 std::shared_ptr<mg::CursorImage>(),
287 report);287 report);
288288
289 EXPECT_EQ(mir_orientation_mode_any, surf.query(mir_surface_attrib_preferred_orientation));289 EXPECT_EQ(mir_orientation_mode_any, surf.query(mir_window_attrib_preferred_orientation));
290}290}
291291
=== modified file 'tests/unit-tests/scene/test_surface_stack.cpp'
--- tests/unit-tests/scene/test_surface_stack.cpp 2016-11-16 13:08:55 +0000
+++ tests/unit-tests/scene/test_surface_stack.cpp 2017-01-10 20:52:04 +0000
@@ -281,7 +281,7 @@
281 std::shared_ptr<mg::CursorImage>(),281 std::shared_ptr<mg::CursorImage>(),
282 report);282 report);
283 stack.add_surface(surface, default_params.input_mode);283 stack.add_surface(surface, default_params.input_mode);
284 surface->configure(mir_surface_attrib_visibility,284 surface->configure(mir_window_attrib_visibility,
285 mir_surface_visibility_exposed);285 mir_surface_visibility_exposed);
286 286
287 auto elements = stack.scene_elements_for(compositor_id);287 auto elements = stack.scene_elements_for(compositor_id);
@@ -310,7 +310,7 @@
310 std::shared_ptr<mg::CursorImage>(),310 std::shared_ptr<mg::CursorImage>(),
311 report);311 report);
312 stack.add_surface(surface, default_params.input_mode);312 stack.add_surface(surface, default_params.input_mode);
313 surface->configure(mir_surface_attrib_visibility,313 surface->configure(mir_window_attrib_visibility,
314 mir_surface_visibility_exposed);314 mir_surface_visibility_exposed);
315 315
316 // (change directory in shell app)316 // (change directory in shell app)
@@ -356,7 +356,7 @@
356 std::shared_ptr<mg::CursorImage>(),356 std::shared_ptr<mg::CursorImage>(),
357 report);357 report);
358 stack.add_surface(surface, default_params.input_mode);358 stack.add_surface(surface, default_params.input_mode);
359 surface->configure(mir_surface_attrib_visibility,359 surface->configure(mir_window_attrib_visibility,
360 mir_surface_visibility_exposed);360 mir_surface_visibility_exposed);
361361
362 EXPECT_EQ(0, stack.frames_pending(this));362 EXPECT_EQ(0, stack.frames_pending(this));
@@ -811,7 +811,7 @@
811 mir::report::null_scene_report())811 mir::report::null_scene_report())
812 {812 {
813 }813 }
814 MOCK_METHOD2(configure, int(MirSurfaceAttrib, int));814 MOCK_METHOD2(configure, int(MirWindowAttrib, int));
815};815};
816}816}
817817
@@ -834,7 +834,7 @@
834 auto const elements2 = stack.scene_elements_for(compositor_id2);834 auto const elements2 = stack.scene_elements_for(compositor_id2);
835 ASSERT_THAT(elements2.size(), Eq(1u));835 ASSERT_THAT(elements2.size(), Eq(1u));
836836
837 EXPECT_CALL(*mock_surface, configure(mir_surface_attrib_visibility, mir_surface_visibility_occluded));837 EXPECT_CALL(*mock_surface, configure(mir_window_attrib_visibility, mir_surface_visibility_occluded));
838838
839 elements.back()->occluded();839 elements.back()->occluded();
840 elements2.back()->occluded();840 elements2.back()->occluded();
@@ -857,7 +857,7 @@
857 auto const elements2 = stack.scene_elements_for(compositor_id2);857 auto const elements2 = stack.scene_elements_for(compositor_id2);
858 ASSERT_THAT(elements2.size(), Eq(1u));858 ASSERT_THAT(elements2.size(), Eq(1u));
859859
860 EXPECT_CALL(*mock_surface, configure(mir_surface_attrib_visibility, mir_surface_visibility_exposed));860 EXPECT_CALL(*mock_surface, configure(mir_window_attrib_visibility, mir_surface_visibility_exposed));
861861
862 elements.back()->occluded();862 elements.back()->occluded();
863 elements2.back()->rendered();863 elements2.back()->rendered();
@@ -884,7 +884,7 @@
884 auto const elements3 = stack.scene_elements_for(compositor_id3);884 auto const elements3 = stack.scene_elements_for(compositor_id3);
885 ASSERT_THAT(elements3.size(), Eq(1u));885 ASSERT_THAT(elements3.size(), Eq(1u));
886886
887 EXPECT_CALL(*mock_surface, configure(mir_surface_attrib_visibility, mir_surface_visibility_exposed))887 EXPECT_CALL(*mock_surface, configure(mir_window_attrib_visibility, mir_surface_visibility_exposed))
888 .Times(2);888 .Times(2);
889889
890 elements.back()->occluded();890 elements.back()->occluded();
@@ -893,7 +893,7 @@
893893
894 Mock::VerifyAndClearExpectations(mock_surface.get());894 Mock::VerifyAndClearExpectations(mock_surface.get());
895895
896 EXPECT_CALL(*mock_surface, configure(mir_surface_attrib_visibility, mir_surface_visibility_occluded));896 EXPECT_CALL(*mock_surface, configure(mir_window_attrib_visibility, mir_surface_visibility_occluded));
897897
898 stack.unregister_compositor(compositor_id2);898 stack.unregister_compositor(compositor_id2);
899 stack.unregister_compositor(compositor_id3);899 stack.unregister_compositor(compositor_id3);
@@ -978,8 +978,8 @@
978 stack.add_surface(stub_surface2, default_params.input_mode);978 stack.add_surface(stub_surface2, default_params.input_mode);
979979
980 // Configure surface1 and surface2 to appear in input enumeration.980 // Configure surface1 and surface2 to appear in input enumeration.
981 stub_surface1->configure(mir_surface_attrib_visibility, MirSurfaceVisibility::mir_surface_visibility_exposed);981 stub_surface1->configure(mir_window_attrib_visibility, MirSurfaceVisibility::mir_surface_visibility_exposed);
982 stub_surface2->configure(mir_surface_attrib_visibility, MirSurfaceVisibility::mir_surface_visibility_exposed);982 stub_surface2->configure(mir_window_attrib_visibility, MirSurfaceVisibility::mir_surface_visibility_exposed);
983983
984 stack.add_input_visualization(mt::fake_shared(r));984 stack.add_input_visualization(mt::fake_shared(r));
985985
@@ -1056,9 +1056,9 @@
1056 stack.add_surface(stub_surface2, default_params.input_mode);1056 stack.add_surface(stub_surface2, default_params.input_mode);
1057 stack.add_surface(stub_surface3, default_params.input_mode);1057 stack.add_surface(stub_surface3, default_params.input_mode);
10581058
1059 stub_surface1->configure(mir_surface_attrib_visibility, MirSurfaceVisibility::mir_surface_visibility_exposed);1059 stub_surface1->configure(mir_window_attrib_visibility, MirSurfaceVisibility::mir_surface_visibility_exposed);
1060 stub_surface2->configure(mir_surface_attrib_visibility, MirSurfaceVisibility::mir_surface_visibility_occluded);1060 stub_surface2->configure(mir_window_attrib_visibility, MirSurfaceVisibility::mir_surface_visibility_occluded);
1061 stub_surface3->configure(mir_surface_attrib_visibility, MirSurfaceVisibility::mir_surface_visibility_occluded);1061 stub_surface3->configure(mir_window_attrib_visibility, MirSurfaceVisibility::mir_surface_visibility_occluded);
10621062
1063 int num_exposed_surfaces = 0;1063 int num_exposed_surfaces = 0;
1064 auto const count_exposed_surfaces = [&num_exposed_surfaces](std::shared_ptr<mi::Surface> const&){1064 auto const count_exposed_surfaces = [&num_exposed_surfaces](std::shared_ptr<mi::Surface> const&){

Subscribers

People subscribed via source and target branches