Merge lp:~brandontschaefer/mir/usr-mir-window-placement into lp:mir
- usr-mir-window-placement
- Merge into development-branch
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 |
Related bugs: |
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 MirWindowPlacem
Description of the change
Use MirWindowPlacem
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
1 | === modified file 'examples/client_touch_validator.cpp' |
2 | --- examples/client_touch_validator.cpp 2017-01-09 06:48:47 +0000 |
3 | +++ examples/client_touch_validator.cpp 2017-01-10 20:52:04 +0000 |
4 | @@ -143,7 +143,7 @@ |
5 | case mir_event_type_input: |
6 | on_input_event(state, mir_event_get_input_event(event)); |
7 | break; |
8 | - case mir_event_type_close_surface: |
9 | + case mir_event_type_close_window: |
10 | abort(); |
11 | break; |
12 | default: |
13 | |
14 | === modified file 'examples/eglapp.c' |
15 | --- examples/eglapp.c 2017-01-09 06:48:47 +0000 |
16 | +++ examples/eglapp.c 2017-01-10 20:52:04 +0000 |
17 | @@ -110,18 +110,18 @@ |
18 | running = 0; |
19 | } |
20 | |
21 | -static void mir_eglapp_handle_surface_event(MirSurfaceEvent const* sev) |
22 | +static void mir_eglapp_handle_window_event(MirWindowEvent const* sev) |
23 | { |
24 | - MirSurfaceAttrib attrib = mir_surface_event_get_attribute(sev); |
25 | - int value = mir_surface_event_get_attribute_value(sev); |
26 | + MirWindowAttrib attrib = mir_window_event_get_attribute(sev); |
27 | + int value = mir_window_event_get_attribute_value(sev); |
28 | |
29 | switch (attrib) |
30 | { |
31 | - case mir_surface_attrib_visibility: |
32 | + case mir_window_attrib_visibility: |
33 | printf("Window %s\n", value == mir_surface_visibility_exposed ? |
34 | "exposed" : "occluded"); |
35 | break; |
36 | - case mir_surface_attrib_dpi: |
37 | + case mir_window_attrib_dpi: |
38 | // value is still zero - never implemented. Deprecate? (LP: #1559831) |
39 | break; |
40 | default: |
41 | @@ -129,19 +129,19 @@ |
42 | } |
43 | } |
44 | |
45 | -static void handle_surface_output_event(MirSurfaceOutputEvent const* out) |
46 | +static void handle_window_output_event(MirWindowOutputEvent const* out) |
47 | { |
48 | static char const* const form_factor_name[6] = |
49 | {"unknown", "phone", "tablet", "monitor", "TV", "projector"}; |
50 | - unsigned ff = mir_surface_output_event_get_form_factor(out); |
51 | + unsigned ff = mir_window_output_event_get_form_factor(out); |
52 | char const* form_factor = (ff < 6) ? form_factor_name[ff] : "out-of-range"; |
53 | |
54 | - refresh_rate = mir_surface_output_event_get_refresh_rate(out); |
55 | + refresh_rate = mir_window_output_event_get_refresh_rate(out); |
56 | |
57 | printf("Window is on output %u: %d DPI, scale %.1fx, %s form factor, %.2fHz\n", |
58 | - mir_surface_output_event_get_output_id(out), |
59 | - mir_surface_output_event_get_dpi(out), |
60 | - mir_surface_output_event_get_scale(out), |
61 | + mir_window_output_event_get_output_id(out), |
62 | + mir_window_output_event_get_dpi(out), |
63 | + mir_window_output_event_get_scale(out), |
64 | form_factor, |
65 | refresh_rate); |
66 | } |
67 | @@ -161,11 +161,11 @@ |
68 | case mir_event_type_input: |
69 | mir_eglapp_handle_input_event(mir_event_get_input_event(ev)); |
70 | break; |
71 | - case mir_event_type_surface: |
72 | - mir_eglapp_handle_surface_event(mir_event_get_surface_event(ev)); |
73 | + case mir_event_type_window: |
74 | + mir_eglapp_handle_window_event(mir_event_get_window_event(ev)); |
75 | break; |
76 | - case mir_event_type_surface_output: |
77 | - handle_surface_output_event(mir_event_get_surface_output_event(ev)); |
78 | + case mir_event_type_window_output: |
79 | + handle_window_output_event(mir_event_get_window_output_event(ev)); |
80 | break; |
81 | case mir_event_type_resize: |
82 | /* |
83 | @@ -182,7 +182,7 @@ |
84 | mir_resize_event_get_height(resize)); |
85 | } |
86 | break; |
87 | - case mir_event_type_close_surface: |
88 | + case mir_event_type_close_window: |
89 | printf("Received close event from server.\n"); |
90 | running = 0; |
91 | break; |
92 | |
93 | === modified file 'examples/fingerpaint.c' |
94 | --- examples/fingerpaint.c 2017-01-09 06:48:47 +0000 |
95 | +++ examples/fingerpaint.c 2017-01-10 20:52:04 +0000 |
96 | @@ -301,7 +301,7 @@ |
97 | changed = true; |
98 | } |
99 | } |
100 | - else if (event_type == mir_event_type_close_surface) |
101 | + else if (event_type == mir_event_type_close_window) |
102 | { |
103 | static int closing = 0; |
104 | |
105 | |
106 | === modified file 'examples/server_example_basic_window_manager.cpp' |
107 | --- examples/server_example_basic_window_manager.cpp 2016-07-18 07:38:38 +0000 |
108 | +++ examples/server_example_basic_window_manager.cpp 2017-01-10 20:52:04 +0000 |
109 | @@ -139,13 +139,13 @@ |
110 | int me::BasicWindowManager::set_surface_attribute( |
111 | std::shared_ptr<scene::Session> const& /*session*/, |
112 | std::shared_ptr<scene::Surface> const& surface, |
113 | - MirSurfaceAttrib attrib, |
114 | + MirWindowAttrib attrib, |
115 | int value) |
116 | { |
117 | std::lock_guard<decltype(mutex)> lock(mutex); |
118 | switch (attrib) |
119 | { |
120 | - case mir_surface_attrib_state: |
121 | + case mir_window_attrib_state: |
122 | { |
123 | auto const state = policy->handle_set_state(surface, MirSurfaceState(value)); |
124 | return surface->configure(attrib, state); |
125 | |
126 | === modified file 'examples/server_example_basic_window_manager.h' |
127 | --- examples/server_example_basic_window_manager.h 2016-07-18 07:38:38 +0000 |
128 | +++ examples/server_example_basic_window_manager.h 2017-01-10 20:52:04 +0000 |
129 | @@ -177,7 +177,7 @@ |
130 | int set_surface_attribute( |
131 | std::shared_ptr<scene::Session> const& /*session*/, |
132 | std::shared_ptr<scene::Surface> const& surface, |
133 | - MirSurfaceAttrib attrib, |
134 | + MirWindowAttrib attrib, |
135 | int value) override; |
136 | |
137 | auto find_session(std::function<bool(SessionInfo const& info)> const& predicate) |
138 | |
139 | === modified file 'examples/server_example_canonical_window_manager.cpp' |
140 | --- examples/server_example_canonical_window_manager.cpp 2016-12-09 02:54:31 +0000 |
141 | +++ examples/server_example_canonical_window_manager.cpp 2017-01-10 20:52:04 +0000 |
142 | @@ -100,7 +100,7 @@ |
143 | -> ms::SurfaceCreationParameters |
144 | { |
145 | auto parameters = request_parameters; |
146 | - auto surf_type = parameters.type.is_set() ? parameters.type.value() : mir_surface_type_normal; |
147 | + auto surf_type = parameters.type.is_set() ? parameters.type.value() : mir_window_type_normal; |
148 | bool const needs_titlebar = SurfaceInfo::needs_titlebar(surf_type); |
149 | |
150 | if (needs_titlebar) |
151 | @@ -260,7 +260,7 @@ |
152 | .of_pixel_format(format) |
153 | .of_buffer_usage(mir::graphics::BufferUsage::software) |
154 | .of_position(titlebar_position_for_window(surface->top_left())) |
155 | - .of_type(mir_surface_type_gloss) |
156 | + .of_type(mir_window_type_gloss) |
157 | .with_buffer_stream(stream_id); |
158 | auto id = build(session, params); |
159 | auto titlebar = session->surface(id); |
160 | @@ -342,7 +342,7 @@ |
161 | throw std::runtime_error("Target surface type requires parent"); |
162 | } |
163 | |
164 | - surface->configure(mir_surface_attrib_type, new_type); |
165 | + surface->configure(mir_window_attrib_type, new_type); |
166 | } |
167 | |
168 | #define COPY_IF_SET(field)\ |
169 | @@ -414,7 +414,7 @@ |
170 | if (modifications.state.is_set()) |
171 | { |
172 | auto const state = handle_set_state(surface, modifications.state.value()); |
173 | - surface->configure(mir_surface_attrib_state, state); |
174 | + surface->configure(mir_window_attrib_state, state); |
175 | } |
176 | |
177 | if (modifications.confine_pointer.is_set()) |
178 | @@ -823,7 +823,7 @@ |
179 | state = mir_surface_state_restored; |
180 | |
181 | auto const value = handle_set_state(surface, MirSurfaceState(state)); |
182 | - surface->configure(mir_surface_attrib_state, value); |
183 | + surface->configure(mir_window_attrib_state, value); |
184 | } |
185 | } |
186 | |
187 | |
188 | === modified file 'examples/server_example_window_management_info.cpp' |
189 | --- examples/server_example_window_management_info.cpp 2016-11-04 17:12:59 +0000 |
190 | +++ examples/server_example_window_management_info.cpp 2017-01-10 20:52:04 +0000 |
191 | @@ -59,17 +59,17 @@ |
192 | { |
193 | switch (type) |
194 | { |
195 | - case mir_surface_type_normal: /**< AKA "regular" */ |
196 | - case mir_surface_type_utility: /**< AKA "floating" */ |
197 | - case mir_surface_type_dialog: |
198 | - case mir_surface_type_satellite: /**< AKA "toolbox"/"toolbar" */ |
199 | - case mir_surface_type_freestyle: |
200 | - case mir_surface_type_menu: |
201 | - case mir_surface_type_inputmethod: /**< AKA "OSK" or handwriting etc. */ |
202 | + case mir_window_type_normal: /**< AKA "regular" */ |
203 | + case mir_window_type_utility: /**< AKA "floating" */ |
204 | + case mir_window_type_dialog: |
205 | + case mir_window_type_satellite: /**< AKA "toolbox"/"toolbar" */ |
206 | + case mir_window_type_freestyle: |
207 | + case mir_window_type_menu: |
208 | + case mir_window_type_inputmethod: /**< AKA "OSK" or handwriting etc. */ |
209 | return true; |
210 | |
211 | - case mir_surface_type_gloss: |
212 | - case mir_surface_type_tip: /**< AKA "tooltip" */ |
213 | + case mir_window_type_gloss: |
214 | + case mir_window_type_tip: /**< AKA "tooltip" */ |
215 | default: |
216 | // Cannot have input focus |
217 | return false; |
218 | @@ -80,10 +80,10 @@ |
219 | { |
220 | switch (type) |
221 | { |
222 | - case mir_surface_type_overlay:; |
223 | - case mir_surface_type_inputmethod: |
224 | - case mir_surface_type_satellite: |
225 | - case mir_surface_type_tip: |
226 | + case mir_window_type_gloss:; |
227 | + case mir_window_type_inputmethod: |
228 | + case mir_window_type_satellite: |
229 | + case mir_window_type_tip: |
230 | return true; |
231 | |
232 | default: |
233 | @@ -91,19 +91,19 @@ |
234 | } |
235 | } |
236 | |
237 | -bool me::SurfaceInfo::can_morph_to(MirSurfaceType new_type) const |
238 | +bool me::SurfaceInfo::can_morph_to(MirWindowType new_type) const |
239 | { |
240 | switch (new_type) |
241 | { |
242 | - case mir_surface_type_normal: |
243 | - case mir_surface_type_utility: |
244 | - case mir_surface_type_satellite: |
245 | + case mir_window_type_normal: |
246 | + case mir_window_type_utility: |
247 | + case mir_window_type_satellite: |
248 | switch (type) |
249 | { |
250 | - case mir_surface_type_normal: |
251 | - case mir_surface_type_utility: |
252 | - case mir_surface_type_dialog: |
253 | - case mir_surface_type_satellite: |
254 | + case mir_window_type_normal: |
255 | + case mir_window_type_utility: |
256 | + case mir_window_type_dialog: |
257 | + case mir_window_type_satellite: |
258 | return true; |
259 | |
260 | default: |
261 | @@ -111,14 +111,14 @@ |
262 | } |
263 | break; |
264 | |
265 | - case mir_surface_type_dialog: |
266 | + case mir_window_type_dialog: |
267 | switch (type) |
268 | { |
269 | - case mir_surface_type_normal: |
270 | - case mir_surface_type_utility: |
271 | - case mir_surface_type_dialog: |
272 | - case mir_surface_type_popover: |
273 | - case mir_surface_type_satellite: |
274 | + case mir_window_type_normal: |
275 | + case mir_window_type_utility: |
276 | + case mir_window_type_dialog: |
277 | + case mir_window_type_popover: |
278 | + case mir_window_type_satellite: |
279 | return true; |
280 | |
281 | default: |
282 | @@ -137,8 +137,8 @@ |
283 | { |
284 | switch (type) |
285 | { |
286 | - case mir_surface_type_normal: |
287 | - case mir_surface_type_utility: |
288 | + case mir_window_type_normal: |
289 | + case mir_window_type_utility: |
290 | return true; |
291 | |
292 | default: |
293 | @@ -356,15 +356,15 @@ |
294 | requested_size = new_size; |
295 | } |
296 | |
297 | -bool me::SurfaceInfo::needs_titlebar(MirSurfaceType type) |
298 | +bool me::SurfaceInfo::needs_titlebar(MirWindowType type) |
299 | { |
300 | switch (type) |
301 | { |
302 | - case mir_surface_type_freestyle: |
303 | - case mir_surface_type_menu: |
304 | - case mir_surface_type_inputmethod: |
305 | - case mir_surface_type_gloss: |
306 | - case mir_surface_type_tip: |
307 | + case mir_window_type_freestyle: |
308 | + case mir_window_type_menu: |
309 | + case mir_window_type_inputmethod: |
310 | + case mir_window_type_gloss: |
311 | + case mir_window_type_tip: |
312 | // No decorations for these surface types |
313 | return false; |
314 | default: |
315 | |
316 | === modified file 'examples/server_example_window_management_info.h' |
317 | --- examples/server_example_window_management_info.h 2016-11-04 17:12:59 +0000 |
318 | +++ examples/server_example_window_management_info.h 2017-01-10 20:52:04 +0000 |
319 | @@ -39,7 +39,7 @@ |
320 | |
321 | bool can_be_active() const; |
322 | |
323 | - bool can_morph_to(MirSurfaceType new_type) const; |
324 | + bool can_morph_to(MirWindowType new_type) const; |
325 | |
326 | bool must_have_parent() const; |
327 | |
328 | @@ -47,7 +47,7 @@ |
329 | |
330 | bool is_visible() const; |
331 | |
332 | - static bool needs_titlebar(MirSurfaceType type); |
333 | + static bool needs_titlebar(MirWindowType type); |
334 | |
335 | void constrain_resize( |
336 | std::shared_ptr <scene::Surface> const& surface, |
337 | @@ -57,7 +57,7 @@ |
338 | const bool top_resize, |
339 | geometry::Rectangle const& bounds) const; |
340 | |
341 | - MirSurfaceType type; |
342 | + MirWindowType type; |
343 | MirSurfaceState state; |
344 | geometry::Rectangle restore_rect; |
345 | std::weak_ptr <scene::Session> session; |
346 | |
347 | === modified file 'examples/target.c' |
348 | --- examples/target.c 2017-01-09 06:48:47 +0000 |
349 | +++ examples/target.c 2017-01-10 20:52:04 +0000 |
350 | @@ -199,7 +199,7 @@ |
351 | case mir_event_type_resize: |
352 | state->resized = true; |
353 | break; |
354 | - case mir_event_type_close_surface: |
355 | + case mir_event_type_close_window: |
356 | state->running = false; |
357 | break; |
358 | default: |
359 | |
360 | === modified file 'include/client/mir/event_printer.h' |
361 | --- include/client/mir/event_printer.h 2016-10-31 02:37:31 +0000 |
362 | +++ include/client/mir/event_printer.h 2017-01-10 20:52:04 +0000 |
363 | @@ -35,20 +35,24 @@ |
364 | std::ostream& operator<<(std::ostream& out, MirOrientation orientation); |
365 | |
366 | std::ostream& operator<<(std::ostream& out, MirSurfaceAttrib attribute); |
367 | +/* __attribute__ ((deprecated("use << with MirWindowAttribute instead")); */ |
368 | +std::ostream& operator<<(std::ostream& out, MirWindowAttrib attribute); |
369 | std::ostream& operator<<(std::ostream& out, MirSurfaceFocusState state); |
370 | std::ostream& operator<<(std::ostream& out, MirSurfaceVisibility state); |
371 | std::ostream& operator<<(std::ostream& out, MirSurfaceType type); |
372 | +/* __attribute__ ((deprecated("use << with MirWindowType instead")); */ |
373 | +std::ostream& operator<<(std::ostream& out, MirWindowType type); |
374 | std::ostream& operator<<(std::ostream& out, MirSurfaceState state); |
375 | |
376 | std::ostream& operator<<(std::ostream& out, MirPromptSessionEvent const& event); |
377 | std::ostream& operator<<(std::ostream& out, MirResizeEvent const& event); |
378 | std::ostream& operator<<(std::ostream& out, MirOrientationEvent const& event); |
379 | std::ostream& operator<<(std::ostream& out, MirInputEvent const& event); |
380 | -std::ostream& operator<<(std::ostream& out, MirCloseSurfaceEvent const& event); |
381 | +std::ostream& operator<<(std::ostream& out, MirCloseWindowEvent const& event); |
382 | std::ostream& operator<<(std::ostream& out, MirKeymapEvent const& event); |
383 | -std::ostream& operator<<(std::ostream& out, MirSurfaceEvent const& event); |
384 | +std::ostream& operator<<(std::ostream& out, MirWindowEvent const& event); |
385 | std::ostream& operator<<(std::ostream& out, MirInputDeviceStateEvent const& event); |
386 | -std::ostream& operator<<(std::ostream& out, MirSurfacePlacementEvent const& event); |
387 | +std::ostream& operator<<(std::ostream& out, MirWindowPlacementEvent const& event); |
388 | std::ostream& operator<<(std::ostream& out, MirEvent const& event); |
389 | |
390 | } |
391 | |
392 | === modified file 'include/client/mir/events/event_builders.h' |
393 | --- include/client/mir/events/event_builders.h 2016-11-11 07:56:09 +0000 |
394 | +++ include/client/mir/events/event_builders.h 2017-01-10 20:52:04 +0000 |
395 | @@ -48,6 +48,9 @@ |
396 | EventUPtr make_event(frontend::SurfaceId const& surface_id, geometry::Size const& size); |
397 | // Surface configure event |
398 | EventUPtr make_event(frontend::SurfaceId const& surface_id, MirSurfaceAttrib attribute, int value); |
399 | +/* __attribute__ ((deprecated("use make_event with MirWindowAttribute instead")); */ |
400 | +// Window configure event |
401 | +EventUPtr make_event(frontend::SurfaceId const& surface_id, MirWindowAttrib attribute, int value); |
402 | // Close surface event |
403 | EventUPtr make_event(frontend::SurfaceId const& surface_id); |
404 | // Keymap event |
405 | |
406 | === modified file 'include/client/mir_toolkit/events/event.h' |
407 | --- include/client/mir_toolkit/events/event.h 2016-11-11 07:56:09 +0000 |
408 | +++ include/client/mir_toolkit/events/event.h 2017-01-10 20:52:04 +0000 |
409 | @@ -1,5 +1,5 @@ |
410 | /* |
411 | - * Copyright © 2014-2016 Canonical Ltd. |
412 | + * Copyright © 2014-2017 Canonical Ltd. |
413 | * |
414 | * This program is free software: you can redistribute it and/or modify it |
415 | * under the terms of the GNU Lesser General Public License version 3, |
416 | @@ -31,36 +31,47 @@ |
417 | extern "C" { |
418 | #endif |
419 | |
420 | +#pragma GCC diagnostic push |
421 | +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
422 | typedef enum |
423 | { |
424 | mir_event_type_key, |
425 | mir_event_type_motion, |
426 | - mir_event_type_surface, |
427 | + mir_event_type_surface, /* __attribute__ ((deprecated("use mir_event_type_window instead"))), */ |
428 | + mir_event_type_window = mir_event_type_surface, |
429 | mir_event_type_resize, |
430 | mir_event_type_prompt_session_state_change, |
431 | mir_event_type_orientation, |
432 | - mir_event_type_close_surface, |
433 | + mir_event_type_close_surface, /*__attribute__ ((deprecated("use mir_event_type_close_window instead"))), */ |
434 | + mir_event_type_close_window = mir_event_type_close_surface, |
435 | /* Type for new style input event will be returned from mir_event_get_type |
436 | when old style event type was mir_event_type_key or mir_event_type_motion */ |
437 | mir_event_type_input, |
438 | mir_event_type_keymap, |
439 | mir_event_type_input_configuration, |
440 | - mir_event_type_surface_output, |
441 | + mir_event_type_surface_output, /* __attribute__ ((deprecated("use mir_event_type_window_output instead"))), */ |
442 | + mir_event_type_window_output = mir_event_type_surface_output, |
443 | mir_event_type_input_device_state, |
444 | - mir_event_type_surface_placement, |
445 | + mir_event_type_surface_placement, /*__attribute__ ((deprecated("use mir_event_type_window_placement instead"))), */ |
446 | + mir_event_type_window_placement = mir_event_type_surface_placement, |
447 | } MirEventType; |
448 | +#pragma GCC diagnostic pop |
449 | |
450 | -typedef struct MirSurfaceEvent MirSurfaceEvent; |
451 | +typedef struct MirSurfaceEvent MirSurfaceEvent; /* __attribute__ ((deprecated("use MirWindowEvent instead"))); */ |
452 | +typedef struct MirSurfaceEvent MirWindowEvent; |
453 | typedef struct MirResizeEvent MirResizeEvent; |
454 | typedef struct MirPromptSessionEvent MirPromptSessionEvent; |
455 | typedef struct MirOrientationEvent MirOrientationEvent; |
456 | -typedef struct MirCloseSurfaceEvent MirCloseSurfaceEvent; |
457 | +typedef struct MirCloseSurfaceEvent MirCloseSurfaceEvent; /* __attribute__ ((deprecated("use MirCloseWindowEvent instead"))); */ |
458 | +typedef struct MirCloseSurfaceEvent MirCloseWindowEvent; |
459 | typedef struct MirInputEvent MirInputEvent; |
460 | typedef struct MirKeymapEvent MirKeymapEvent; |
461 | typedef struct MirInputConfigurationEvent MirInputConfigurationEvent; |
462 | -typedef struct MirSurfaceOutputEvent MirSurfaceOutputEvent; |
463 | +typedef struct MirSurfaceOutputEvent MirSurfaceOutputEvent; /* __attribute__ ((deprecated("use MirWindowOutputEvent instead"))); */ |
464 | +typedef struct MirSurfaceOutputEvent MirWindowOutputEvent; |
465 | typedef struct MirInputDeviceStateEvent MirInputDeviceStateEvent; |
466 | -typedef struct MirSurfacePlacementEvent MirSurfacePlacementEvent; |
467 | +typedef struct MirSurfacePlacementEvent MirSurfacePlacementEvent; /* __attribute__ ((deprecated("use MirWindowPlacementEvent instead"))); */ |
468 | +typedef struct MirSurfacePlacementEvent MirWindowPlacementEvent; |
469 | |
470 | typedef struct MirCookie MirCookie; |
471 | |
472 | @@ -74,11 +85,13 @@ |
473 | #include "mir_toolkit/events/input/input_event.h" |
474 | #include "mir_toolkit/events/resize_event.h" |
475 | #include "mir_toolkit/events/surface_event.h" |
476 | +#include "mir_toolkit/events/window_event.h" |
477 | #include "mir_toolkit/events/orientation_event.h" |
478 | #include "mir_toolkit/events/prompt_session_event.h" |
479 | #include "mir_toolkit/events/keymap_event.h" |
480 | #include "mir_toolkit/events/input_configuration_event.h" |
481 | #include "mir_toolkit/events/surface_output_event.h" |
482 | +#include "mir_toolkit/events/window_output_event.h" |
483 | #include "mir_toolkit/events/input_device_state_event.h" |
484 | |
485 | #ifdef __cplusplus |
486 | @@ -118,6 +131,17 @@ |
487 | * \return The associated MirSurfaceEvent |
488 | */ |
489 | MirSurfaceEvent const* mir_event_get_surface_event(MirEvent const* event); |
490 | +/* __attribute__ ((deprecated("use mir_event_get_window_event instead"))); */ |
491 | + |
492 | +/** |
493 | + * Retrieve the MirWindowEvent associated with a MirEvent of |
494 | + * type mir_event_type_window. See <mir_toolkit/events/surface_event.h> |
495 | + * for accessors. |
496 | + * |
497 | + * \param [in] event The event |
498 | + * \return The associated MirWindowEvent |
499 | + */ |
500 | +MirWindowEvent const* mir_event_get_window_event(MirEvent const* event); |
501 | |
502 | /** |
503 | * Retrieve the MirResizeEvent associated with a MirEvent of |
504 | @@ -206,6 +230,22 @@ |
505 | * \return The associated MirSurfaceOutputEvent |
506 | */ |
507 | MirSurfaceOutputEvent const* mir_event_get_surface_output_event(MirEvent const* event); |
508 | +/* __attribute__((deprecated("use mir_event_get_window_output_event))) */ |
509 | + |
510 | +/** |
511 | + * Retrieve the MirWindowOutputEvent associated with a MirEvent of type |
512 | + * mir_event_type_window_output. The event signifies that the properties |
513 | + * of the output the window is displayed upon have changed. |
514 | + * |
515 | + * A MirWindowOutputEvent is generated either when the properties of the |
516 | + * output the window is primarily on change (for example: by user configuration |
517 | + * of resolution) or when the output the window is primarily on changes |
518 | + * (for example: when a user moves the window from one monitor to another). |
519 | + * |
520 | + * \param [in] event The event |
521 | + * \return The associated MirWindowOutputEvent |
522 | + */ |
523 | +MirWindowOutputEvent const* mir_event_get_window_output_event(MirEvent const* event); |
524 | |
525 | /** |
526 | * Retrieve the MirInputDeviceStateEvent associated with a MirEvent of |
527 | @@ -228,6 +268,16 @@ |
528 | */ |
529 | MirSurfacePlacementEvent const* mir_event_get_surface_placement_event(MirEvent const* event); |
530 | |
531 | +/** |
532 | + * Retrieve the MirWindowPlacementEvent associated with a MirEvent of |
533 | + * type mir_event_type_window_placement. The event signifies that the |
534 | + * the server has fulfilled a request for relative window placement. |
535 | + * |
536 | + * \param [in] event The event |
537 | + * \return The associated MirWindowPlacementEvent |
538 | + */ |
539 | +MirWindowPlacementEvent const* mir_event_get_window_placement_event(MirEvent const* event); |
540 | + |
541 | /* |
542 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
543 | * _________________________ |
544 | |
545 | === modified file 'include/client/mir_toolkit/events/surface_event.h' |
546 | --- include/client/mir_toolkit/events/surface_event.h 2016-10-12 06:03:15 +0000 |
547 | +++ include/client/mir_toolkit/events/surface_event.h 2017-01-10 20:52:04 +0000 |
548 | @@ -36,6 +36,7 @@ |
549 | * \return The associated attribute |
550 | */ |
551 | MirSurfaceAttrib mir_surface_event_get_attribute(MirSurfaceEvent const* event); |
552 | +/* __attribute__ ((deprecated("use make_event with mir_window_event_get_attribute instead"))); */ |
553 | |
554 | /** |
555 | * Retrieve the new value of the associated attribute for a given MirSurfaceEvent |
556 | @@ -44,6 +45,7 @@ |
557 | * \return The associated attribute value |
558 | */ |
559 | int mir_surface_event_get_attribute_value(MirSurfaceEvent const* event); |
560 | +/* __attribute__ ((deprecated("use make_event with mir_window_event_get_attribute_value instead"))); */ |
561 | |
562 | #ifdef __cplusplus |
563 | } |
564 | |
565 | === added file 'include/client/mir_toolkit/events/window_event.h' |
566 | --- include/client/mir_toolkit/events/window_event.h 1970-01-01 00:00:00 +0000 |
567 | +++ include/client/mir_toolkit/events/window_event.h 2017-01-10 20:52:04 +0000 |
568 | @@ -0,0 +1,53 @@ |
569 | +/* |
570 | + * Copyright © 2017 Canonical Ltd. |
571 | + * |
572 | + * This program is free software: you can redistribute it and/or modify it |
573 | + * under the terms of the GNU Lesser General Public License version 3, |
574 | + * as published by the Free Software Foundation. |
575 | + * |
576 | + * This program is distributed in the hope that it will be useful, |
577 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
578 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
579 | + * GNU Lesser General Public License for more details. |
580 | + * |
581 | + * You should have received a copy of the GNU Lesser General Public License |
582 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
583 | + * |
584 | + * Authored by: Brandon Schaefer <brandon.schaefer@canonical.com> |
585 | + */ |
586 | + |
587 | +#ifndef MIR_TOOLKIT_EVENTS_WINDOW_EVENT_H_ |
588 | +#define MIR_TOOLKIT_EVENTS_WINDOW_EVENT_H_ |
589 | + |
590 | +#include <mir_toolkit/events/event.h> |
591 | + |
592 | +#ifdef __cplusplus |
593 | +/** |
594 | + * \addtogroup mir_toolkit |
595 | + * @{ |
596 | + */ |
597 | +extern "C" { |
598 | +#endif |
599 | + |
600 | +/** |
601 | + * Retrieve the attribute index configured with a given MirWindowEvent |
602 | + * |
603 | + * \param [in] event The event |
604 | + * \return The associated attribute |
605 | + */ |
606 | +MirWindowAttrib mir_window_event_get_attribute(MirWindowEvent const* event); |
607 | + |
608 | +/** |
609 | + * Retrieve the new value of the associated attribute for a given MirWindowEvent |
610 | + * |
611 | + * \param [in] event The event |
612 | + * \return The associated attribute value |
613 | + */ |
614 | +int mir_window_event_get_attribute_value(MirWindowEvent const* event); |
615 | + |
616 | +#ifdef __cplusplus |
617 | +} |
618 | +/**@}*/ |
619 | +#endif |
620 | + |
621 | +#endif /* MIR_TOOLKIT_WINDOW_EVENT_H_ */ |
622 | |
623 | === added file 'include/client/mir_toolkit/events/window_output_event.h' |
624 | --- include/client/mir_toolkit/events/window_output_event.h 1970-01-01 00:00:00 +0000 |
625 | +++ include/client/mir_toolkit/events/window_output_event.h 2017-01-10 20:52:04 +0000 |
626 | @@ -0,0 +1,83 @@ |
627 | +/* |
628 | + * Copyright © 2017 Canonical Ltd. |
629 | + * |
630 | + * This program is free software: you can redistribute it and/or modify it |
631 | + * under the terms of the GNU Lesser General Public License version 3, |
632 | + * as published by the Free Software Foundation. |
633 | + * |
634 | + * This program is distributed in the hope that it will be useful, |
635 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
636 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
637 | + * GNU Lesser General Public License for more details. |
638 | + * |
639 | + * You should have received a copy of the GNU Lesser General Public License |
640 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
641 | + * |
642 | + * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
643 | + * |
644 | + */ |
645 | + |
646 | +#ifndef MIR_TOOLKIT_WINDOW_OUTPUT_EVENT_H_ |
647 | +#define MIR_TOOLKIT_WINDOW_OUTPUT_EVENT_H_ |
648 | + |
649 | +#include <mir_toolkit/events/event.h> |
650 | + |
651 | +#ifdef __cplusplus |
652 | +/** |
653 | + * \addtogroup mir_toolkit |
654 | + * @{ |
655 | + */ |
656 | +extern "C" { |
657 | +#endif |
658 | + |
659 | +/** |
660 | + * Retrieve the DPI of the new output configuration of a MirWindowOutputEvent |
661 | + * |
662 | + * \param [in] ev The event |
663 | + * \return The new DPI value for the window is primarily on. |
664 | + */ |
665 | +int mir_window_output_event_get_dpi(MirWindowOutputEvent const* ev); |
666 | + |
667 | +/** |
668 | + * Retrieve the form factor of the new output configuration of a MirWindowOutputEvent |
669 | + * |
670 | + * \param [in] ev The event |
671 | + * \return The new form factor of the output the window is primarily on. |
672 | + */ |
673 | +MirFormFactor mir_window_output_event_get_form_factor(MirWindowOutputEvent const* ev); |
674 | + |
675 | +/** |
676 | + * Retrieve the suggested scaling factor of the new output configuration of a |
677 | + * MirWindowOutputEvent. |
678 | + * |
679 | + * \param [in] ev The event |
680 | + * \return The new scaling factor of the output the window is primarily on. |
681 | + */ |
682 | +float mir_window_output_event_get_scale(MirWindowOutputEvent const* ev); |
683 | + |
684 | +/** |
685 | + * Retrieve the maximum refresh rate of the output(s) associated with a |
686 | + * MirWindowOutputEvent. For variable refresh rate displays this represents |
687 | + * the maximum refresh rate of the display to aim for, rather than a measurement |
688 | + * of recent performance. |
689 | + * |
690 | + * \param [in] ev The event |
691 | + * \return The refresh rate in Hz |
692 | + */ |
693 | +double mir_window_output_event_get_refresh_rate(MirWindowOutputEvent const* ev); |
694 | + |
695 | +/** |
696 | + * Retrieve the ID of the output this window is on from a MirWindowOutputEvent |
697 | + * |
698 | + * \param [in] ev The event |
699 | + * \return The ID of the output the window is currently considered to be on. |
700 | + * (From MirDisplayOutput::output_id) |
701 | + */ |
702 | +uint32_t mir_window_output_event_get_output_id(MirWindowOutputEvent const *ev); |
703 | + |
704 | +#ifdef __cplusplus |
705 | +} |
706 | +/**@}*/ |
707 | +#endif |
708 | + |
709 | +#endif //MIR_TOOLKIT_WINDOW_OUTPUT_EVENT_H_ |
710 | |
711 | === added file 'include/client/mir_toolkit/events/window_placement.h' |
712 | --- include/client/mir_toolkit/events/window_placement.h 1970-01-01 00:00:00 +0000 |
713 | +++ include/client/mir_toolkit/events/window_placement.h 2017-01-10 20:52:04 +0000 |
714 | @@ -0,0 +1,47 @@ |
715 | +/* |
716 | + * Copyright © 2017 Canonical Ltd. |
717 | + * |
718 | + * This program is free software: you can redistribute it and/or modify it |
719 | + * under the terms of the GNU Lesser General Public License version 3, |
720 | + * as published by the Free Software Foundation. |
721 | + * |
722 | + * This program is distributed in the hope that it will be useful, |
723 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
724 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
725 | + * GNU Lesser General Public License for more details. |
726 | + * |
727 | + * You should have received a copy of the GNU Lesser General Public License |
728 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
729 | + * |
730 | + * Authored by: Alan Griffiths <alan@octopull.co.uk> |
731 | + */ |
732 | + |
733 | +#ifndef MIR_TOOLKIT_WINDOW_PLACEMENT_H_ |
734 | +#define MIR_TOOLKIT_WINDOW_PLACEMENT_H_ |
735 | + |
736 | +#include <mir_toolkit/client_types.h> |
737 | + |
738 | +#ifdef __cplusplus |
739 | +/** |
740 | + * \addtogroup mir_toolkit |
741 | + * @{ |
742 | + */ |
743 | +extern "C" { |
744 | +#endif |
745 | + |
746 | +typedef struct MirSurfacePlacementEvent MirWindowPlacementEvent; |
747 | + |
748 | +/** |
749 | + * Retrieve the relative position from a placement notification |
750 | + * |
751 | + * \param [in] event The placement event |
752 | + * \return The position relative to the parent window |
753 | + */ |
754 | +MirRectangle mir_window_placement_get_relative_position(MirWindowPlacementEvent const* event); |
755 | + |
756 | +#ifdef __cplusplus |
757 | +} |
758 | +/**@}*/ |
759 | +#endif |
760 | + |
761 | +#endif //MIR_TOOLKIT_WINDOW_PLACEMENT_H_ |
762 | |
763 | === modified file 'include/client/mir_toolkit/mir_surface.h' |
764 | --- include/client/mir_toolkit/mir_surface.h 2017-01-09 06:48:47 +0000 |
765 | +++ include/client/mir_toolkit/mir_surface.h 2017-01-10 20:52:04 +0000 |
766 | @@ -208,7 +208,7 @@ |
767 | * \param [in] spec Specification to mutate |
768 | * \param [in] type the target type of the window |
769 | */ |
770 | -void mir_window_spec_set_type(MirWindowSpec* spec, MirSurfaceType type); |
771 | +void mir_window_spec_set_type(MirWindowSpec* spec, MirWindowType type); |
772 | |
773 | /** |
774 | * Set the requested name. |
775 | @@ -667,6 +667,13 @@ |
776 | */ |
777 | void mir_window_raise(MirWindow* window, MirCookie const* cookie); |
778 | |
779 | +/** |
780 | + * Get the type (purpose) of a window. |
781 | + * \param [in] window The window to query |
782 | + * \return The type of the window |
783 | + */ |
784 | +MirWindowType mir_window_get_type(MirWindow* window); |
785 | + |
786 | // Functions in this pragma section are to be deprecated |
787 | //#pragma GCC diagnostic push |
788 | //#pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
789 | @@ -870,12 +877,8 @@ |
790 | void mir_surface_get_parameters(MirSurface *surface, MirSurfaceParameters *parameters); |
791 | //__attribute__((deprecated("use mir_window_get_parameters() instead"))); |
792 | |
793 | -/** |
794 | - * Get the type (purpose) of a surface. |
795 | - * \param [in] surface The surface to query |
796 | - * \return The type of the surface |
797 | - */ |
798 | -MirSurfaceType mir_surface_get_type(MirSurface *surface); |
799 | +MirSurfaceType mir_surface_get_type(MirSurface* surface); |
800 | +//__attribute__((deprecated("use mir_window_get_type() instead"))); |
801 | |
802 | /** |
803 | * Change the state of a surface. |
804 | |
805 | === modified file 'include/core/mir_toolkit/common.h' |
806 | --- include/core/mir_toolkit/common.h 2016-11-11 07:56:09 +0000 |
807 | +++ include/core/mir_toolkit/common.h 2017-01-10 20:52:04 +0000 |
808 | @@ -43,7 +43,25 @@ |
809 | mir_surface_attrib_preferred_orientation, |
810 | /* Must be last */ |
811 | mir_surface_attribs |
812 | -} MirSurfaceAttrib; |
813 | +} MirSurfaceAttrib; /* __attribute__ ((deprecated("use MirWindowAttrib"))); */ |
814 | + |
815 | +/** |
816 | + * Attributes of a window that the client and server/shell may wish to |
817 | + * get or set over the wire. |
818 | + */ |
819 | +typedef enum MirWindowAttrib |
820 | +{ |
821 | + /* Do not specify values...code relies on 0...N ordering. */ |
822 | + mir_window_attrib_type, |
823 | + mir_window_attrib_state, |
824 | + mir_window_attrib_swapinterval, |
825 | + mir_window_attrib_focus, |
826 | + mir_window_attrib_dpi, |
827 | + mir_window_attrib_visibility, |
828 | + mir_window_attrib_preferred_orientation, |
829 | + /* Must be last */ |
830 | + mir_window_attribs |
831 | +} MirWindowAttrib; |
832 | |
833 | typedef enum MirSurfaceType |
834 | { |
835 | @@ -59,7 +77,23 @@ |
836 | mir_surface_type_satellite, /**< AKA "toolbox"/"toolbar" */ |
837 | mir_surface_type_tip, /**< AKA "tooltip" */ |
838 | mir_surface_types |
839 | -} MirSurfaceType; |
840 | +} MirSurfaceType; /* __attribute__ ((deprecated("use MirWindowType"))); */ |
841 | + |
842 | +typedef enum MirWindowType |
843 | +{ |
844 | + mir_window_type_normal, /**< AKA "regular" */ |
845 | + mir_window_type_utility, /**< AKA "floating" */ |
846 | + mir_window_type_dialog, |
847 | + mir_window_type_overlay, /**< \deprecated Use "gloss" instead. */ |
848 | + mir_window_type_gloss = mir_window_type_overlay, |
849 | + mir_window_type_freestyle, |
850 | + mir_window_type_popover, /**< \deprecated Choose "menu" or "tip" */ |
851 | + mir_window_type_menu = mir_window_type_popover, |
852 | + mir_window_type_inputmethod, /**< AKA "OSK" or handwriting etc. */ |
853 | + mir_window_type_satellite, /**< AKA "toolbox"/"toolbar" */ |
854 | + mir_window_type_tip, /**< AKA "tooltip" */ |
855 | + mir_window_types |
856 | +} MirWindowType; |
857 | |
858 | typedef enum MirSurfaceState |
859 | { |
860 | |
861 | === modified file 'include/server/mir/scene/null_surface_observer.h' |
862 | --- include/server/mir/scene/null_surface_observer.h 2016-10-31 02:37:31 +0000 |
863 | +++ include/server/mir/scene/null_surface_observer.h 2017-01-10 20:52:04 +0000 |
864 | @@ -31,7 +31,7 @@ |
865 | NullSurfaceObserver() = default; |
866 | virtual ~NullSurfaceObserver() = default; |
867 | |
868 | - void attrib_changed(MirSurfaceAttrib attrib, int value) override; |
869 | + void attrib_changed(MirWindowAttrib attrib, int value) override; |
870 | void resized_to(geometry::Size const& size) override; |
871 | void moved_to(geometry::Point const& top_left) override; |
872 | void hidden_set_to(bool hide) override; |
873 | |
874 | === modified file 'include/server/mir/scene/surface.h' |
875 | --- include/server/mir/scene/surface.h 2016-11-11 07:56:09 +0000 |
876 | +++ include/server/mir/scene/surface.h 2017-01-10 20:52:04 +0000 |
877 | @@ -68,7 +68,7 @@ |
878 | virtual int buffers_ready_for_compositor(void const* compositor_id) const = 0; |
879 | |
880 | virtual float alpha() const = 0; //only used in examples/ |
881 | - virtual MirSurfaceType type() const = 0; |
882 | + virtual MirWindowType type() const = 0; |
883 | virtual MirSurfaceState state() const = 0; |
884 | virtual void hide() = 0; |
885 | virtual void show() = 0; |
886 | @@ -107,9 +107,9 @@ |
887 | virtual std::shared_ptr<Surface> parent() const = 0; |
888 | |
889 | // TODO a legacy of old interactions and needs removing |
890 | - virtual int configure(MirSurfaceAttrib attrib, int value) = 0; |
891 | + virtual int configure(MirWindowAttrib attrib, int value) = 0; |
892 | // TODO a legacy of old interactions and needs removing |
893 | - virtual int query(MirSurfaceAttrib attrib) const = 0; |
894 | + virtual int query(MirWindowAttrib attrib) const = 0; |
895 | |
896 | virtual void set_keymap(MirInputDeviceId id, std::string const& model, std::string const& layout, |
897 | std::string const& variant, std::string const& options) = 0; |
898 | |
899 | === modified file 'include/server/mir/scene/surface_creation_parameters.h' |
900 | --- include/server/mir/scene/surface_creation_parameters.h 2016-10-12 06:03:15 +0000 |
901 | +++ include/server/mir/scene/surface_creation_parameters.h 2017-01-10 20:52:04 +0000 |
902 | @@ -58,7 +58,7 @@ |
903 | |
904 | SurfaceCreationParameters& with_output_id(graphics::DisplayConfigurationOutputId const& output_id); |
905 | |
906 | - SurfaceCreationParameters& of_type(MirSurfaceType type); |
907 | + SurfaceCreationParameters& of_type(MirWindowType type); |
908 | |
909 | SurfaceCreationParameters& with_state(MirSurfaceState state); |
910 | |
911 | @@ -81,7 +81,7 @@ |
912 | graphics::DisplayConfigurationOutputId output_id; |
913 | |
914 | mir::optional_value<MirSurfaceState> state; |
915 | - mir::optional_value<MirSurfaceType> type; |
916 | + mir::optional_value<MirWindowType> type; |
917 | mir::optional_value<MirOrientationMode> preferred_orientation; |
918 | mir::optional_value<frontend::SurfaceId> parent_id; |
919 | mir::optional_value<frontend::BufferStreamId> content_id; |
920 | |
921 | === modified file 'include/server/mir/scene/surface_observer.h' |
922 | --- include/server/mir/scene/surface_observer.h 2016-10-31 02:37:31 +0000 |
923 | +++ include/server/mir/scene/surface_observer.h 2017-01-10 20:52:04 +0000 |
924 | @@ -45,7 +45,7 @@ |
925 | class SurfaceObserver |
926 | { |
927 | public: |
928 | - virtual void attrib_changed(MirSurfaceAttrib attrib, int value) = 0; |
929 | + virtual void attrib_changed(MirWindowAttrib attrib, int value) = 0; |
930 | virtual void resized_to(geometry::Size const& size) = 0; |
931 | virtual void moved_to(geometry::Point const& top_left) = 0; |
932 | virtual void hidden_set_to(bool hide) = 0; |
933 | |
934 | === modified file 'include/server/mir/shell/abstract_shell.h' |
935 | --- include/server/mir/shell/abstract_shell.h 2016-08-02 19:44:59 +0000 |
936 | +++ include/server/mir/shell/abstract_shell.h 2017-01-10 20:52:04 +0000 |
937 | @@ -70,12 +70,12 @@ |
938 | int set_surface_attribute( |
939 | std::shared_ptr<scene::Session> const& session, |
940 | std::shared_ptr<scene::Surface> const& surface, |
941 | - MirSurfaceAttrib attrib, |
942 | + MirWindowAttrib attrib, |
943 | int value) override; |
944 | |
945 | int get_surface_attribute( |
946 | std::shared_ptr<scene::Surface> const& surface, |
947 | - MirSurfaceAttrib attrib) override; |
948 | + MirWindowAttrib attrib) override; |
949 | |
950 | void raise_surface( |
951 | std::shared_ptr<scene::Session> const& session, |
952 | |
953 | === modified file 'include/server/mir/shell/shell.h' |
954 | --- include/server/mir/shell/shell.h 2016-01-29 08:18:22 +0000 |
955 | +++ include/server/mir/shell/shell.h 2017-01-10 20:52:04 +0000 |
956 | @@ -88,12 +88,12 @@ |
957 | virtual int set_surface_attribute( |
958 | std::shared_ptr<scene::Session> const& session, |
959 | std::shared_ptr<scene::Surface> const& surface, |
960 | - MirSurfaceAttrib attrib, |
961 | + MirWindowAttrib attrib, |
962 | int value) = 0; |
963 | |
964 | virtual int get_surface_attribute( |
965 | std::shared_ptr<scene::Surface> const& surface, |
966 | - MirSurfaceAttrib attrib) = 0; |
967 | + MirWindowAttrib attrib) = 0; |
968 | |
969 | virtual void raise_surface( |
970 | std::shared_ptr<scene::Session> const& session, |
971 | |
972 | === modified file 'include/server/mir/shell/shell_report.h' |
973 | --- include/server/mir/shell/shell_report.h 2016-09-08 02:58:56 +0000 |
974 | +++ include/server/mir/shell/shell_report.h 2017-01-10 20:52:04 +0000 |
975 | @@ -54,7 +54,7 @@ |
976 | |
977 | virtual void update_surface( |
978 | scene::Session const& session, scene::Surface const& surface, |
979 | - MirSurfaceAttrib attrib, int value) = 0; |
980 | + MirWindowAttrib attrib, int value) = 0; |
981 | |
982 | virtual void destroying_surface( |
983 | scene::Session const& session, frontend::SurfaceId surface) = 0; |
984 | |
985 | === modified file 'include/server/mir/shell/shell_wrapper.h' |
986 | --- include/server/mir/shell/shell_wrapper.h 2016-01-29 08:18:22 +0000 |
987 | +++ include/server/mir/shell/shell_wrapper.h 2017-01-10 20:52:04 +0000 |
988 | @@ -73,12 +73,12 @@ |
989 | int set_surface_attribute( |
990 | std::shared_ptr<scene::Session> const& session, |
991 | std::shared_ptr<scene::Surface> const& surface, |
992 | - MirSurfaceAttrib attrib, |
993 | + MirWindowAttrib attrib, |
994 | int value) override; |
995 | |
996 | int get_surface_attribute( |
997 | std::shared_ptr<scene::Surface> const& surface, |
998 | - MirSurfaceAttrib attrib) override; |
999 | + MirWindowAttrib attrib) override; |
1000 | |
1001 | void raise_surface( |
1002 | std::shared_ptr<scene::Session> const& session, |
1003 | |
1004 | === modified file 'include/server/mir/shell/surface_specification.h' |
1005 | --- include/server/mir/shell/surface_specification.h 2016-12-09 02:54:31 +0000 |
1006 | +++ include/server/mir/shell/surface_specification.h 2017-01-10 20:52:04 +0000 |
1007 | @@ -64,7 +64,7 @@ |
1008 | optional_value<graphics::BufferUsage> buffer_usage; |
1009 | optional_value<std::string> name; |
1010 | optional_value<graphics::DisplayConfigurationOutputId> output_id; |
1011 | - optional_value<MirSurfaceType> type; |
1012 | + optional_value<MirWindowType> type; |
1013 | optional_value<MirSurfaceState> state; |
1014 | optional_value<MirOrientationMode> preferred_orientation; |
1015 | optional_value<frontend::SurfaceId> parent_id; |
1016 | |
1017 | === modified file 'include/server/mir/shell/system_compositor_window_manager.h' |
1018 | --- include/server/mir/shell/system_compositor_window_manager.h 2016-01-29 08:18:22 +0000 |
1019 | +++ include/server/mir/shell/system_compositor_window_manager.h 2017-01-10 20:52:04 +0000 |
1020 | @@ -98,7 +98,7 @@ |
1021 | int set_surface_attribute( |
1022 | std::shared_ptr<scene::Session> const& session, |
1023 | std::shared_ptr<scene::Surface> const& surface, |
1024 | - MirSurfaceAttrib attrib, |
1025 | + MirWindowAttrib attrib, |
1026 | int value) override; |
1027 | |
1028 | using OutputMap = std::map<std::weak_ptr<scene::Surface>, graphics::DisplayConfigurationOutputId, std::owner_less<std::weak_ptr<scene::Surface>>>; |
1029 | |
1030 | === modified file 'include/server/mir/shell/window_manager.h' |
1031 | --- include/server/mir/shell/window_manager.h 2016-01-29 08:18:22 +0000 |
1032 | +++ include/server/mir/shell/window_manager.h 2017-01-10 20:52:04 +0000 |
1033 | @@ -68,7 +68,7 @@ |
1034 | virtual int set_surface_attribute( |
1035 | std::shared_ptr<scene::Session> const& session, |
1036 | std::shared_ptr<scene::Surface> const& surface, |
1037 | - MirSurfaceAttrib attrib, |
1038 | + MirWindowAttrib attrib, |
1039 | int value) = 0; |
1040 | |
1041 | virtual void handle_raise_surface( |
1042 | |
1043 | === modified file 'include/test/mir/test/doubles/mock_window_manager.h' |
1044 | --- include/test/mir/test/doubles/mock_window_manager.h 2016-01-29 08:18:22 +0000 |
1045 | +++ include/test/mir/test/doubles/mock_window_manager.h 2017-01-10 20:52:04 +0000 |
1046 | @@ -62,7 +62,7 @@ |
1047 | MOCK_METHOD4(set_surface_attribute, |
1048 | int(std::shared_ptr<scene::Session> const& session, |
1049 | std::shared_ptr<scene::Surface> const& surface, |
1050 | - MirSurfaceAttrib attrib, |
1051 | + MirWindowAttrib attrib, |
1052 | int value)); |
1053 | |
1054 | static frontend::SurfaceId add_surface_default( |
1055 | |
1056 | === modified file 'include/test/mir/test/doubles/stub_surface.h' |
1057 | --- include/test/mir/test/doubles/stub_surface.h 2016-10-31 02:37:31 +0000 |
1058 | +++ include/test/mir/test/doubles/stub_surface.h 2017-01-10 20:52:04 +0000 |
1059 | @@ -54,10 +54,10 @@ |
1060 | bool visible() const override; |
1061 | graphics::RenderableList generate_renderables(compositor::CompositorID id) const override; |
1062 | int buffers_ready_for_compositor(void const* compositor_id) const override; |
1063 | - MirSurfaceType type() const override; |
1064 | + MirWindowType type() const override; |
1065 | MirSurfaceState state() const override; |
1066 | - int configure(MirSurfaceAttrib attrib, int value) override; |
1067 | - int query(MirSurfaceAttrib attrib) const override; |
1068 | + int configure(MirWindowAttrib attrib, int value) override; |
1069 | + int query(MirWindowAttrib attrib) const override; |
1070 | void hide() override; |
1071 | void show() override; |
1072 | void set_cursor_image(std::shared_ptr<graphics::CursorImage> const& image) override; |
1073 | |
1074 | === modified file 'include/test/mir/test/event_matchers.h' |
1075 | --- include/test/mir/test/event_matchers.h 2017-01-06 03:31:04 +0000 |
1076 | +++ include/test/mir/test/event_matchers.h 2017-01-10 20:52:04 +0000 |
1077 | @@ -488,15 +488,16 @@ |
1078 | return true; |
1079 | } |
1080 | |
1081 | -MATCHER_P2(SurfaceEvent, attrib, value, "") |
1082 | +MATCHER_P2(WindowEvent, attrib, value, "") |
1083 | { |
1084 | auto as_address = to_address(arg); |
1085 | - if (mir_event_get_type(as_address) != mir_event_type_surface) |
1086 | - return false; |
1087 | - auto surface_ev = mir_event_get_surface_event(as_address); |
1088 | - if (mir_surface_event_get_attribute(surface_ev) != attrib) |
1089 | - return false; |
1090 | - if (mir_surface_event_get_attribute_value(surface_ev) != value) |
1091 | + if (mir_event_get_type(as_address) != mir_event_type_window) |
1092 | + return false; |
1093 | + auto surface_ev = mir_event_get_window_event(as_address); |
1094 | + auto window_attrib = mir_window_event_get_attribute(surface_ev); |
1095 | + if (window_attrib != attrib) |
1096 | + return false; |
1097 | + if (mir_window_event_get_attribute_value(surface_ev) != value) |
1098 | return false; |
1099 | return true; |
1100 | } |
1101 | |
1102 | === modified file 'src/client/buffer_stream.cpp' |
1103 | --- src/client/buffer_stream.cpp 2017-01-09 06:48:47 +0000 |
1104 | +++ src/client/buffer_stream.cpp 2017-01-10 20:52:04 +0000 |
1105 | @@ -411,12 +411,12 @@ |
1106 | swap_buffers([](){})->wait_for_all(); |
1107 | } |
1108 | |
1109 | -void mcl::BufferStream::request_and_wait_for_configure(MirSurfaceAttrib attrib, int interval) |
1110 | +void mcl::BufferStream::request_and_wait_for_configure(MirWindowAttrib attrib, int interval) |
1111 | { |
1112 | - if (attrib != mir_surface_attrib_swapinterval) |
1113 | + if (attrib != mir_window_attrib_swapinterval) |
1114 | { |
1115 | BOOST_THROW_EXCEPTION(std::logic_error("Attempt to configure surface attribute " + std::to_string(attrib) + |
1116 | - " on BufferStream but only mir_surface_attrib_swapinterval is supported")); |
1117 | + " on BufferStream but only mir_window_attrib_swapinterval is supported")); |
1118 | } |
1119 | mir_wait_for(set_swap_interval(interval)); |
1120 | } |
1121 | |
1122 | === modified file 'src/client/buffer_stream.h' |
1123 | --- src/client/buffer_stream.h 2017-01-09 06:48:47 +0000 |
1124 | +++ src/client/buffer_stream.h 2017-01-10 20:52:04 +0000 |
1125 | @@ -106,7 +106,7 @@ |
1126 | MirWindowParameters get_parameters() const override; |
1127 | void swap_buffers_sync() override; |
1128 | |
1129 | - void request_and_wait_for_configure(MirSurfaceAttrib attrib, int) override; |
1130 | + void request_and_wait_for_configure(MirWindowAttrib attrib, int) override; |
1131 | |
1132 | MirNativeBuffer* get_current_buffer_package() override; |
1133 | |
1134 | |
1135 | === modified file 'src/client/event.cpp' |
1136 | --- src/client/event.cpp 2016-11-11 07:56:09 +0000 |
1137 | +++ src/client/event.cpp 2017-01-10 20:52:04 +0000 |
1138 | @@ -33,6 +33,7 @@ |
1139 | #include "mir_toolkit/events/orientation_event.h" |
1140 | #include "mir_toolkit/events/input_device_state_event.h" |
1141 | #include "mir_toolkit/events/surface_placement.h" |
1142 | +#include "mir_toolkit/events/window_placement.h" |
1143 | |
1144 | #include <cstdlib> |
1145 | #include <cstring> |
1146 | @@ -71,20 +72,22 @@ |
1147 | return "mir_event_type_key"; |
1148 | case mir_event_type_motion: |
1149 | return "mir_event_type_motion"; |
1150 | - case mir_event_type_surface: |
1151 | - return "mir_event_type_surface"; |
1152 | + case mir_event_type_window: |
1153 | + return "mir_event_type_window"; |
1154 | case mir_event_type_resize: |
1155 | return "mir_event_type_resize"; |
1156 | case mir_event_type_prompt_session_state_change: |
1157 | return "mir_event_type_prompt_session_state_change"; |
1158 | case mir_event_type_orientation: |
1159 | return "mir_event_type_orientation"; |
1160 | - case mir_event_type_close_surface: |
1161 | - return "mir_event_type_close_surface"; |
1162 | + case mir_event_type_close_window: |
1163 | + return "mir_event_type_close_window"; |
1164 | case mir_event_type_input: |
1165 | return "mir_event_type_input"; |
1166 | case mir_event_type_input_device_state: |
1167 | return "mir_event_type_input_device_state"; |
1168 | + case mir_event_type_window_output: |
1169 | + return "mir_event_type_window_output"; |
1170 | default: |
1171 | abort(); |
1172 | } |
1173 | @@ -111,7 +114,14 @@ |
1174 | |
1175 | MirSurfaceEvent const* mir_event_get_surface_event(MirEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION( |
1176 | { |
1177 | - expect_event_type(ev, mir_event_type_surface); |
1178 | + expect_event_type(ev, mir_event_type_window); |
1179 | + |
1180 | + return ev->to_surface(); |
1181 | +}) |
1182 | + |
1183 | +MirWindowEvent const* mir_event_get_window_event(MirEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION( |
1184 | +{ |
1185 | + expect_event_type(ev, mir_event_type_window); |
1186 | |
1187 | return ev->to_surface(); |
1188 | }) |
1189 | @@ -139,7 +149,7 @@ |
1190 | |
1191 | MirCloseSurfaceEvent const* mir_event_get_close_surface_event(MirEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION( |
1192 | { |
1193 | - expect_event_type(ev, mir_event_type_close_surface); |
1194 | + expect_event_type(ev, mir_event_type_close_window); |
1195 | |
1196 | return ev->to_close_surface(); |
1197 | }) |
1198 | @@ -163,7 +173,14 @@ |
1199 | |
1200 | MirSurfaceOutputEvent const* mir_event_get_surface_output_event(MirEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION( |
1201 | { |
1202 | - expect_event_type(ev, mir_event_type_surface_output); |
1203 | + expect_event_type(ev, mir_event_type_window_output); |
1204 | + |
1205 | + return ev->to_surface_output(); |
1206 | +}) |
1207 | + |
1208 | +MirWindowOutputEvent const* mir_event_get_window_output_event(MirEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION( |
1209 | +{ |
1210 | + expect_event_type(ev, mir_event_type_window_output); |
1211 | |
1212 | return ev->to_surface_output(); |
1213 | }) |
1214 | @@ -179,14 +196,30 @@ |
1215 | |
1216 | MirSurfaceAttrib mir_surface_event_get_attribute(MirSurfaceEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION( |
1217 | { |
1218 | - expect_event_type(ev, mir_event_type_surface); |
1219 | + expect_event_type(ev, mir_event_type_window); |
1220 | + |
1221 | + return static_cast<MirSurfaceAttrib>(ev->attrib()); |
1222 | +}) |
1223 | + |
1224 | +int mir_surface_event_get_attribute_value(MirSurfaceEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION( |
1225 | +{ |
1226 | + expect_event_type(ev, mir_event_type_window); |
1227 | + |
1228 | + return ev->value(); |
1229 | +}) |
1230 | + |
1231 | +/* Window event accessors */ |
1232 | + |
1233 | +MirWindowAttrib mir_window_event_get_attribute(MirWindowEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION( |
1234 | +{ |
1235 | + expect_event_type(ev, mir_event_type_window); |
1236 | |
1237 | return ev->attrib(); |
1238 | }) |
1239 | |
1240 | -int mir_surface_event_get_attribute_value(MirSurfaceEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION( |
1241 | +int mir_window_event_get_attribute_value(MirWindowEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION( |
1242 | { |
1243 | - expect_event_type(ev, mir_event_type_surface); |
1244 | + expect_event_type(ev, mir_event_type_window); |
1245 | |
1246 | return ev->value(); |
1247 | }) |
1248 | @@ -264,31 +297,63 @@ |
1249 | |
1250 | int mir_surface_output_event_get_dpi(MirSurfaceOutputEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION( |
1251 | { |
1252 | - expect_event_type(ev, mir_event_type_surface_output); |
1253 | + expect_event_type(ev, mir_event_type_window_output); |
1254 | return ev->dpi(); |
1255 | }) |
1256 | |
1257 | MirFormFactor mir_surface_output_event_get_form_factor(MirSurfaceOutputEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION( |
1258 | { |
1259 | - expect_event_type(ev, mir_event_type_surface_output); |
1260 | + expect_event_type(ev, mir_event_type_window_output); |
1261 | return ev->form_factor(); |
1262 | }) |
1263 | |
1264 | float mir_surface_output_event_get_scale(MirSurfaceOutputEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION( |
1265 | { |
1266 | - expect_event_type(ev, mir_event_type_surface_output); |
1267 | + expect_event_type(ev, mir_event_type_window_output); |
1268 | return ev->scale(); |
1269 | }) |
1270 | |
1271 | double mir_surface_output_event_get_refresh_rate(MirSurfaceOutputEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION( |
1272 | { |
1273 | - expect_event_type(ev, mir_event_type_surface_output); |
1274 | + expect_event_type(ev, mir_event_type_window_output); |
1275 | return ev->refresh_rate(); |
1276 | }) |
1277 | |
1278 | uint32_t mir_surface_output_event_get_output_id(MirSurfaceOutputEvent const *ev) MIR_HANDLE_EVENT_EXCEPTION( |
1279 | { |
1280 | - expect_event_type(ev, mir_event_type_surface_output); |
1281 | + expect_event_type(ev, mir_event_type_window_output); |
1282 | + return ev->output_id(); |
1283 | +}) |
1284 | + |
1285 | +/* Window output event accessors */ |
1286 | + |
1287 | +int mir_window_output_event_get_dpi(MirWindowOutputEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION( |
1288 | +{ |
1289 | + expect_event_type(ev, mir_event_type_window_output); |
1290 | + return ev->dpi(); |
1291 | +}) |
1292 | + |
1293 | +MirFormFactor mir_window_output_event_get_form_factor(MirWindowOutputEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION( |
1294 | +{ |
1295 | + expect_event_type(ev, mir_event_type_window_output); |
1296 | + return ev->form_factor(); |
1297 | +}) |
1298 | + |
1299 | +float mir_window_output_event_get_scale(MirWindowOutputEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION( |
1300 | +{ |
1301 | + expect_event_type(ev, mir_event_type_window_output); |
1302 | + return ev->scale(); |
1303 | +}) |
1304 | + |
1305 | +double mir_window_output_event_get_refresh_rate(MirWindowOutputEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION( |
1306 | +{ |
1307 | + expect_event_type(ev, mir_event_type_window_output); |
1308 | + return ev->refresh_rate(); |
1309 | +}) |
1310 | + |
1311 | +uint32_t mir_window_output_event_get_output_id(MirWindowOutputEvent const *ev) MIR_HANDLE_EVENT_EXCEPTION( |
1312 | +{ |
1313 | + expect_event_type(ev, mir_event_type_window_output); |
1314 | return ev->output_id(); |
1315 | }) |
1316 | |
1317 | @@ -362,6 +427,16 @@ |
1318 | return event->placement(); |
1319 | }) |
1320 | |
1321 | +MirWindowPlacementEvent const* mir_event_get_window_placement_event(MirEvent const* event) MIR_HANDLE_EVENT_EXCEPTION( |
1322 | +{ |
1323 | + return event->to_surface_placement(); |
1324 | +}) |
1325 | + |
1326 | +MirRectangle mir_window_placement_get_relative_position(MirWindowPlacementEvent const* event) MIR_HANDLE_EVENT_EXCEPTION( |
1327 | +{ |
1328 | + return event->placement(); |
1329 | +}) |
1330 | + |
1331 | // TODO: Until we opaquify the MirEvent structure and add |
1332 | // a ref count ref is implemented as copy. |
1333 | MirEvent const* mir_event_ref(MirEvent const* ev) MIR_HANDLE_EVENT_EXCEPTION( |
1334 | |
1335 | === modified file 'src/client/event_printer.cpp' |
1336 | --- src/client/event_printer.cpp 2016-12-09 02:54:31 +0000 |
1337 | +++ src/client/event_printer.cpp 2017-01-10 20:52:04 +0000 |
1338 | @@ -146,6 +146,22 @@ |
1339 | } |
1340 | } |
1341 | |
1342 | +std::ostream& mir::operator<<(std::ostream& out, MirWindowAttrib attribute) |
1343 | +{ |
1344 | + switch (attribute) |
1345 | + { |
1346 | + PRINT(mir_window_attrib,type); |
1347 | + PRINT(mir_window_attrib,dpi); |
1348 | + PRINT(mir_window_attrib,focus); |
1349 | + PRINT(mir_window_attrib,state); |
1350 | + PRINT(mir_window_attrib,visibility); |
1351 | + PRINT(mir_window_attrib,swapinterval); |
1352 | + PRINT(mir_window_attrib,preferred_orientation); |
1353 | + default: |
1354 | + return out << static_cast<int>(attribute) << "<INVALID>"; |
1355 | + } |
1356 | +} |
1357 | + |
1358 | std::ostream& mir::operator<<(std::ostream& out, MirSurfaceFocusState state) |
1359 | { |
1360 | switch (state) |
1361 | @@ -186,6 +202,24 @@ |
1362 | } |
1363 | } |
1364 | |
1365 | +std::ostream& mir::operator<<(std::ostream& out, MirWindowType type) |
1366 | +{ |
1367 | + switch (type) |
1368 | + { |
1369 | + PRINT(mir_window_type,normal); |
1370 | + PRINT(mir_window_type,utility); |
1371 | + PRINT(mir_window_type,dialog); |
1372 | + PRINT(mir_window_type,gloss); |
1373 | + PRINT(mir_window_type,freestyle); |
1374 | + PRINT(mir_window_type,menu); |
1375 | + PRINT(mir_window_type,inputmethod); |
1376 | + PRINT(mir_window_type,satellite); |
1377 | + PRINT(mir_window_type,tip); |
1378 | + default: |
1379 | + return out << static_cast<int>(type) << "<INVALID>"; |
1380 | + } |
1381 | +} |
1382 | + |
1383 | std::ostream& mir::operator<<(std::ostream& out, MirSurfaceState state) |
1384 | { |
1385 | switch (state) |
1386 | @@ -283,37 +317,37 @@ |
1387 | return out << "keymap_event(blob, device_id=" << mir_keymap_event_get_device_id(&event) << ")"; |
1388 | } |
1389 | |
1390 | -std::ostream& mir::operator<<(std::ostream& out, MirCloseSurfaceEvent const&) |
1391 | +std::ostream& mir::operator<<(std::ostream& out, MirCloseWindowEvent const&) |
1392 | { |
1393 | return out << "close_surface_event()"; |
1394 | } |
1395 | |
1396 | -std::ostream& mir::operator<<(std::ostream& out, MirSurfaceEvent const& event) |
1397 | +std::ostream& mir::operator<<(std::ostream& out, MirWindowEvent const& event) |
1398 | { |
1399 | - out << "surface_event(" |
1400 | - << mir_surface_event_get_attribute(&event)<< '='; |
1401 | - auto value = mir_surface_event_get_attribute_value(&event); |
1402 | - switch (mir_surface_event_get_attribute(&event)) |
1403 | + out << "window_event(" |
1404 | + << mir_window_event_get_attribute(&event)<< '='; |
1405 | + auto value = mir_window_event_get_attribute_value(&event); |
1406 | + switch (mir_window_event_get_attribute(&event)) |
1407 | { |
1408 | - case mir_surface_attrib_type: |
1409 | - out << static_cast<MirSurfaceType>(value); |
1410 | + case mir_window_attrib_type: |
1411 | + out << static_cast<MirWindowType>(value); |
1412 | break; |
1413 | - case mir_surface_attrib_state: |
1414 | + case mir_window_attrib_state: |
1415 | out << static_cast<MirSurfaceState>(value); |
1416 | break; |
1417 | - case mir_surface_attrib_swapinterval: |
1418 | + case mir_window_attrib_swapinterval: |
1419 | out << value; |
1420 | break; |
1421 | - case mir_surface_attrib_focus: |
1422 | + case mir_window_attrib_focus: |
1423 | out << static_cast<MirSurfaceFocusState>(value); |
1424 | break; |
1425 | - case mir_surface_attrib_dpi: |
1426 | + case mir_window_attrib_dpi: |
1427 | out << value; |
1428 | break; |
1429 | - case mir_surface_attrib_visibility: |
1430 | + case mir_window_attrib_visibility: |
1431 | out << static_cast<MirSurfaceVisibility>(value); |
1432 | break; |
1433 | - case mir_surface_attrib_preferred_orientation: |
1434 | + case mir_window_attrib_preferred_orientation: |
1435 | out << value; |
1436 | break; |
1437 | default: |
1438 | @@ -323,7 +357,7 @@ |
1439 | return out << ')'; |
1440 | } |
1441 | |
1442 | -std::ostream& mir::operator<<(std::ostream& out, MirSurfacePlacementEvent const& event) |
1443 | +std::ostream& mir::operator<<(std::ostream& out, MirWindowPlacementEvent const& event) |
1444 | { |
1445 | auto const& placement = event.placement(); |
1446 | return out << "surface_placement_event({" |
1447 | @@ -366,16 +400,15 @@ |
1448 | |
1449 | std::ostream& mir::operator<<(std::ostream& out, MirEvent const& event) |
1450 | { |
1451 | +#pragma GCC diagnostic push |
1452 | +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
1453 | auto type = mir_event_get_type(&event); |
1454 | switch (type) |
1455 | { |
1456 | PRINT_EVENT(surface); |
1457 | PRINT_EVENT(resize); |
1458 | PRINT_EVENT(orientation); |
1459 | -#pragma GCC diagnostic push |
1460 | -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
1461 | PRINT_EVENT(close_surface); |
1462 | -#pragma GCC diagnostic pop |
1463 | PRINT_EVENT(input); |
1464 | PRINT_EVENT(input_device_state); |
1465 | PRINT_EVENT(keymap); |
1466 | @@ -385,5 +418,6 @@ |
1467 | default: |
1468 | return out << static_cast<int>(type) << "<INVALID>"; |
1469 | } |
1470 | +#pragma GCC diagnostic pop |
1471 | } |
1472 | |
1473 | |
1474 | === modified file 'src/client/events/event_builders.cpp' |
1475 | --- src/client/events/event_builders.cpp 2016-11-11 06:59:42 +0000 |
1476 | +++ src/client/events/event_builders.cpp 2017-01-10 20:52:04 +0000 |
1477 | @@ -90,6 +90,17 @@ |
1478 | auto e = new_event<MirSurfaceEvent>(); |
1479 | |
1480 | e->set_id(surface_id.as_value()); |
1481 | + e->set_attrib(static_cast<MirWindowAttrib>(attribute)); |
1482 | + e->set_value(value); |
1483 | + |
1484 | + return make_uptr_event(e); |
1485 | +} |
1486 | + |
1487 | +mir::EventUPtr mev::make_event(mf::SurfaceId const& surface_id, MirWindowAttrib attribute, int value) |
1488 | +{ |
1489 | + auto e = new_event<MirSurfaceEvent>(); |
1490 | + |
1491 | + e->set_id(surface_id.as_value()); |
1492 | e->set_attrib(attribute); |
1493 | e->set_value(value); |
1494 | |
1495 | |
1496 | === modified file 'src/client/mir_surface.cpp' |
1497 | --- src/client/mir_surface.cpp 2017-01-09 20:01:45 +0000 |
1498 | +++ src/client/mir_surface.cpp 2017-01-10 20:52:04 +0000 |
1499 | @@ -69,7 +69,7 @@ |
1500 | pixel_format{params.pixel_format}, |
1501 | buffer_usage{params.buffer_usage} |
1502 | { |
1503 | - type = mir_surface_type_normal; |
1504 | + type = mir_window_type_normal; |
1505 | if (params.output_id != mir_display_output_id_invalid) |
1506 | { |
1507 | output_id = params.output_id; |
1508 | @@ -279,13 +279,13 @@ |
1509 | return &configure_cursor_wait_handle; |
1510 | } |
1511 | |
1512 | -MirWaitHandle* MirSurface::configure(MirSurfaceAttrib at, int value) |
1513 | +MirWaitHandle* MirSurface::configure(MirWindowAttrib at, int value) |
1514 | { |
1515 | // TODO: This is obviously strange. It should be |
1516 | // possible to eliminate it in the second phase of buffer |
1517 | // stream where the existing MirSurface swap interval functions |
1518 | // may be deprecated in terms of mir_buffer_stream_ alternatives |
1519 | - if ((at == mir_surface_attrib_swapinterval) && default_stream) |
1520 | + if ((at == mir_window_attrib_swapinterval) && default_stream) |
1521 | { |
1522 | default_stream->set_swap_interval(value); |
1523 | return &configure_wait_handle; |
1524 | @@ -360,11 +360,11 @@ |
1525 | |
1526 | switch (a) |
1527 | { |
1528 | - case mir_surface_attrib_type: |
1529 | - case mir_surface_attrib_state: |
1530 | - case mir_surface_attrib_focus: |
1531 | - case mir_surface_attrib_dpi: |
1532 | - case mir_surface_attrib_preferred_orientation: |
1533 | + case mir_window_attrib_type: |
1534 | + case mir_window_attrib_state: |
1535 | + case mir_window_attrib_focus: |
1536 | + case mir_window_attrib_dpi: |
1537 | + case mir_window_attrib_preferred_orientation: |
1538 | if (configure_result->has_ivalue()) |
1539 | attrib_cache[a] = configure_result->ivalue(); |
1540 | else |
1541 | @@ -385,11 +385,11 @@ |
1542 | } |
1543 | |
1544 | |
1545 | -int MirSurface::attrib(MirSurfaceAttrib at) const |
1546 | +int MirSurface::attrib(MirWindowAttrib at) const |
1547 | { |
1548 | std::lock_guard<decltype(mutex)> lock(mutex); |
1549 | |
1550 | - if (at == mir_surface_attrib_swapinterval) |
1551 | + if (at == mir_window_attrib_swapinterval) |
1552 | { |
1553 | if (default_stream) |
1554 | return default_stream->swap_interval(); |
1555 | @@ -430,12 +430,12 @@ |
1556 | |
1557 | switch (mir_event_get_type(&e)) |
1558 | { |
1559 | - case mir_event_type_surface: |
1560 | + case mir_event_type_window: |
1561 | { |
1562 | - auto sev = mir_event_get_surface_event(&e); |
1563 | - auto a = mir_surface_event_get_attribute(sev); |
1564 | - if (a < mir_surface_attribs) |
1565 | - attrib_cache[a] = mir_surface_event_get_attribute_value(sev); |
1566 | + auto sev = mir_event_get_window_event(&e); |
1567 | + auto a = mir_window_event_get_attribute(sev); |
1568 | + if (a < mir_window_attribs) |
1569 | + attrib_cache[a] = mir_window_event_get_attribute_value(sev); |
1570 | break; |
1571 | } |
1572 | case mir_event_type_orientation: |
1573 | @@ -470,7 +470,7 @@ |
1574 | } |
1575 | } |
1576 | |
1577 | -void MirSurface::request_and_wait_for_configure(MirSurfaceAttrib a, int value) |
1578 | +void MirSurface::request_and_wait_for_configure(MirWindowAttrib a, int value) |
1579 | { |
1580 | configure(a, value)->wait_for_all(); |
1581 | } |
1582 | @@ -484,7 +484,7 @@ |
1583 | |
1584 | MirWaitHandle* MirSurface::set_preferred_orientation(MirOrientationMode mode) |
1585 | { |
1586 | - return configure(mir_surface_attrib_preferred_orientation, mode); |
1587 | + return configure(mir_window_attrib_preferred_orientation, mode); |
1588 | } |
1589 | |
1590 | void MirSurface::raise_surface(MirCookie const* cookie) |
1591 | |
1592 | === modified file 'src/client/mir_surface.h' |
1593 | --- src/client/mir_surface.h 2017-01-09 06:48:47 +0000 |
1594 | +++ src/client/mir_surface.h 2017-01-10 20:52:04 +0000 |
1595 | @@ -102,7 +102,7 @@ |
1596 | mir::optional_value<std::string> surface_name; |
1597 | mir::optional_value<uint32_t> output_id; |
1598 | |
1599 | - mir::optional_value<MirSurfaceType> type; |
1600 | + mir::optional_value<MirWindowType> type; |
1601 | mir::optional_value<MirSurfaceState> state; |
1602 | mir::optional_value<MirOrientationMode> pref_orientation; |
1603 | |
1604 | @@ -183,7 +183,7 @@ |
1605 | char const * get_error_message(); |
1606 | int id() const; |
1607 | |
1608 | - MirWaitHandle* configure(MirSurfaceAttrib a, int value); |
1609 | + MirWaitHandle* configure(MirWindowAttrib a, int value); |
1610 | |
1611 | // TODO: Some sort of extension mechanism so that this can be moved |
1612 | // out into a separate class in the libmirclient-debug DSO. |
1613 | @@ -191,7 +191,7 @@ |
1614 | int* screen_x, int* screen_y); |
1615 | |
1616 | // Non-blocking |
1617 | - int attrib(MirSurfaceAttrib a) const; |
1618 | + int attrib(MirWindowAttrib a) const; |
1619 | |
1620 | MirOrientation get_orientation() const; |
1621 | MirWaitHandle* set_preferred_orientation(MirOrientationMode mode); |
1622 | @@ -204,7 +204,7 @@ |
1623 | void* context); |
1624 | void handle_event(MirEvent const& e); |
1625 | |
1626 | - void request_and_wait_for_configure(MirSurfaceAttrib a, int value); |
1627 | + void request_and_wait_for_configure(MirWindowAttrib a, int value); |
1628 | |
1629 | MirBufferStream* get_buffer_stream(); |
1630 | |
1631 | @@ -248,7 +248,7 @@ |
1632 | std::unique_ptr<mir::protobuf::SurfaceSetting> const configure_result; |
1633 | |
1634 | // Cache of latest SurfaceSettings returned from the server |
1635 | - int attrib_cache[mir_surface_attribs]; |
1636 | + int attrib_cache[mir_window_attribs]; |
1637 | MirOrientation orientation = mir_orientation_normal; |
1638 | |
1639 | std::function<void(MirEvent const*)> handle_event_callback; |
1640 | |
1641 | === modified file 'src/client/mir_surface_api.cpp' |
1642 | --- src/client/mir_surface_api.cpp 2017-01-09 06:48:47 +0000 |
1643 | +++ src/client/mir_surface_api.cpp 2017-01-10 20:52:04 +0000 |
1644 | @@ -42,7 +42,7 @@ |
1645 | int width, int height) |
1646 | { |
1647 | auto spec = new MirWindowSpec{connection, width, height, mir_pixel_format_invalid}; |
1648 | - spec->type = mir_surface_type_normal; |
1649 | + spec->type = mir_window_type_normal; |
1650 | return spec; |
1651 | } |
1652 | |
1653 | @@ -57,7 +57,7 @@ |
1654 | mir::require(rect != nullptr); |
1655 | |
1656 | auto spec = new MirWindowSpec{connection, width, height, mir_pixel_format_invalid}; |
1657 | - spec->type = mir_surface_type_menu; |
1658 | + spec->type = mir_window_type_menu; |
1659 | spec->parent = parent; |
1660 | spec->aux_rect = *rect; |
1661 | spec->edge_attachment = edge; |
1662 | @@ -74,7 +74,7 @@ |
1663 | mir::require(rect != nullptr); |
1664 | |
1665 | auto spec = new MirWindowSpec{connection, width, height, mir_pixel_format_invalid}; |
1666 | - spec->type = mir_surface_type_tip; |
1667 | + spec->type = mir_window_type_tip; |
1668 | spec->parent = parent; |
1669 | spec->aux_rect = *rect; |
1670 | spec->edge_attachment = edge; |
1671 | @@ -88,7 +88,7 @@ |
1672 | mir::require(mir_window_is_valid(parent)); |
1673 | |
1674 | auto spec = new MirWindowSpec{connection, width, height, mir_pixel_format_invalid}; |
1675 | - spec->type = mir_surface_type_dialog; |
1676 | + spec->type = mir_window_type_dialog; |
1677 | spec->parent = parent; |
1678 | |
1679 | return spec; |
1680 | @@ -99,7 +99,7 @@ |
1681 | int width, int height) |
1682 | { |
1683 | auto spec = new MirWindowSpec{connection, width, height, mir_pixel_format_invalid}; |
1684 | - spec->type = mir_surface_type_dialog; |
1685 | + spec->type = mir_window_type_dialog; |
1686 | return spec; |
1687 | } |
1688 | |
1689 | @@ -108,7 +108,7 @@ |
1690 | int width, int height) |
1691 | { |
1692 | auto spec = new MirWindowSpec{connection, width, height, mir_pixel_format_invalid}; |
1693 | - spec->type = mir_surface_type_inputmethod; |
1694 | + spec->type = mir_window_type_inputmethod; |
1695 | return spec; |
1696 | } |
1697 | |
1698 | @@ -137,7 +137,7 @@ |
1699 | MIR_LOG_UNCAUGHT_EXCEPTION(ex); |
1700 | } |
1701 | |
1702 | -void mir_window_spec_set_type(MirWindowSpec* spec, MirSurfaceType type) |
1703 | +void mir_window_spec_set_type(MirWindowSpec* spec, MirWindowType type) |
1704 | try |
1705 | { |
1706 | mir::require(spec); |
1707 | @@ -301,7 +301,7 @@ |
1708 | mir::require(attachment_rect != nullptr); |
1709 | |
1710 | if (!spec->type.is_set() || |
1711 | - spec->type.value() != mir_surface_type_inputmethod) |
1712 | + spec->type.value() != mir_window_type_inputmethod) |
1713 | { |
1714 | return false; |
1715 | } |
1716 | @@ -624,6 +624,22 @@ |
1717 | } |
1718 | } |
1719 | |
1720 | +MirWindowType mir_window_get_type(MirWindow* window) |
1721 | +{ |
1722 | + MirWindowType type = mir_window_type_normal; |
1723 | + |
1724 | + if (window) |
1725 | + { |
1726 | + // Only the client will ever change the type of a window so it is |
1727 | + // safe to get the type from a local cache surf->attrib(). |
1728 | + |
1729 | + int t = window->attrib(mir_window_attrib_type); |
1730 | + type = static_cast<MirWindowType>(t); |
1731 | + } |
1732 | + |
1733 | + return type; |
1734 | +} |
1735 | + |
1736 | // These functions will be deprecated soon |
1737 | //#pragma GCC diagnostic push |
1738 | //#pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
1739 | @@ -887,7 +903,7 @@ |
1740 | |
1741 | void mir_surface_spec_set_type(MirSurfaceSpec* spec, MirSurfaceType type) |
1742 | { |
1743 | - mir_window_spec_set_type(spec, type); |
1744 | + mir_window_spec_set_type(spec, static_cast<MirWindowType>(type)); |
1745 | } |
1746 | |
1747 | void mir_surface_spec_set_width_increment(MirSurfaceSpec* spec, unsigned width_inc) |
1748 | @@ -976,25 +992,14 @@ |
1749 | |
1750 | MirSurfaceType mir_surface_get_type(MirSurface* surf) |
1751 | { |
1752 | - MirSurfaceType type = mir_surface_type_normal; |
1753 | - |
1754 | - if (surf) |
1755 | - { |
1756 | - // Only the client will ever change the type of a surface so it is |
1757 | - // safe to get the type from a local cache surf->attrib(). |
1758 | - |
1759 | - int t = surf->attrib(mir_surface_attrib_type); |
1760 | - type = static_cast<MirSurfaceType>(t); |
1761 | - } |
1762 | - |
1763 | - return type; |
1764 | + return static_cast<MirSurfaceType>(mir_window_get_type(surf)); |
1765 | } |
1766 | |
1767 | MirWaitHandle* mir_surface_set_state(MirSurface* surf, MirSurfaceState state) |
1768 | { |
1769 | try |
1770 | { |
1771 | - return surf ? surf->configure(mir_surface_attrib_state, state) : nullptr; |
1772 | + return surf ? surf->configure(mir_window_attrib_state, state) : nullptr; |
1773 | } |
1774 | catch (std::exception const& ex) |
1775 | { |
1776 | @@ -1011,13 +1016,13 @@ |
1777 | { |
1778 | if (surf) |
1779 | { |
1780 | - int s = surf->attrib(mir_surface_attrib_state); |
1781 | + int s = surf->attrib(mir_window_attrib_state); |
1782 | |
1783 | if (s == mir_surface_state_unknown) |
1784 | { |
1785 | - surf->configure(mir_surface_attrib_state, |
1786 | + surf->configure(mir_window_attrib_state, |
1787 | mir_surface_state_unknown)->wait_for_all(); |
1788 | - s = surf->attrib(mir_surface_attrib_state); |
1789 | + s = surf->attrib(mir_window_attrib_state); |
1790 | } |
1791 | |
1792 | state = static_cast<MirSurfaceState>(s); |
1793 | @@ -1085,7 +1090,7 @@ |
1794 | { |
1795 | if (surf) |
1796 | { |
1797 | - dpi = surf->attrib(mir_surface_attrib_dpi); |
1798 | + dpi = surf->attrib(mir_window_attrib_dpi); |
1799 | } |
1800 | } |
1801 | catch (std::exception const& ex) |
1802 | @@ -1104,7 +1109,7 @@ |
1803 | { |
1804 | if (surf) |
1805 | { |
1806 | - state = static_cast<MirSurfaceFocusState>(surf->attrib(mir_surface_attrib_focus)); |
1807 | + state = static_cast<MirSurfaceFocusState>(surf->attrib(mir_window_attrib_focus)); |
1808 | } |
1809 | } |
1810 | catch (std::exception const& ex) |
1811 | @@ -1123,7 +1128,7 @@ |
1812 | { |
1813 | if (surf) |
1814 | { |
1815 | - state = static_cast<MirSurfaceVisibility>(surf->attrib(mir_surface_attrib_visibility)); |
1816 | + state = static_cast<MirSurfaceVisibility>(surf->attrib(mir_window_attrib_visibility)); |
1817 | } |
1818 | } |
1819 | catch (std::exception const& ex) |
1820 | @@ -1159,7 +1164,7 @@ |
1821 | |
1822 | try |
1823 | { |
1824 | - mode = static_cast<MirOrientationMode>(surf->attrib(mir_surface_attrib_preferred_orientation)); |
1825 | + mode = static_cast<MirOrientationMode>(surf->attrib(mir_window_attrib_preferred_orientation)); |
1826 | } |
1827 | catch (std::exception const& ex) |
1828 | { |
1829 | |
1830 | === modified file 'src/client/rpc/mir_protobuf_rpc_channel.cpp' |
1831 | --- src/client/rpc/mir_protobuf_rpc_channel.cpp 2017-01-06 05:29:00 +0000 |
1832 | +++ src/client/rpc/mir_protobuf_rpc_channel.cpp 2017-01-10 20:52:04 +0000 |
1833 | @@ -400,7 +400,7 @@ |
1834 | |
1835 | switch (e->type()) |
1836 | { |
1837 | - case mir_event_type_surface: |
1838 | + case mir_event_type_window: |
1839 | surface_id = e->to_surface()->id(); |
1840 | break; |
1841 | case mir_event_type_resize: |
1842 | @@ -409,16 +409,16 @@ |
1843 | case mir_event_type_orientation: |
1844 | surface_id = e->to_orientation()->surface_id(); |
1845 | break; |
1846 | - case mir_event_type_close_surface: |
1847 | + case mir_event_type_close_window: |
1848 | surface_id = e->to_close_surface()->surface_id(); |
1849 | break; |
1850 | case mir_event_type_keymap: |
1851 | surface_id = e->to_keymap()->surface_id(); |
1852 | break; |
1853 | - case mir_event_type_surface_output: |
1854 | + case mir_event_type_window_output: |
1855 | surface_id = e->to_surface_output()->surface_id(); |
1856 | break; |
1857 | - case mir_event_type_surface_placement: |
1858 | + case mir_event_type_window_placement: |
1859 | surface_id = e->to_surface_placement()->id(); |
1860 | break; |
1861 | default: |
1862 | |
1863 | === modified file 'src/client/screencast_stream.cpp' |
1864 | --- src/client/screencast_stream.cpp 2017-01-09 06:48:47 +0000 |
1865 | +++ src/client/screencast_stream.cpp 2017-01-10 20:52:04 +0000 |
1866 | @@ -254,7 +254,7 @@ |
1867 | BOOST_THROW_EXCEPTION(std::logic_error("Attempt to set cache size on screencast is invalid")); |
1868 | } |
1869 | |
1870 | -void mcl::ScreencastStream::request_and_wait_for_configure(MirSurfaceAttrib, int) |
1871 | +void mcl::ScreencastStream::request_and_wait_for_configure(MirWindowAttrib, int) |
1872 | { |
1873 | BOOST_THROW_EXCEPTION(std::logic_error("Attempt to set attrib on screencast is invalid")); |
1874 | } |
1875 | |
1876 | === modified file 'src/client/screencast_stream.h' |
1877 | --- src/client/screencast_stream.h 2017-01-09 06:48:47 +0000 |
1878 | +++ src/client/screencast_stream.h 2017-01-10 20:52:04 +0000 |
1879 | @@ -84,7 +84,7 @@ |
1880 | std::shared_ptr<MemoryRegion> secure_for_cpu_write() override; |
1881 | |
1882 | void swap_buffers_sync() override; |
1883 | - void request_and_wait_for_configure(MirSurfaceAttrib attrib, int) override; |
1884 | + void request_and_wait_for_configure(MirWindowAttrib attrib, int) override; |
1885 | MirNativeBuffer* get_current_buffer_package() override; |
1886 | MirPlatformType platform_type() override; |
1887 | |
1888 | |
1889 | === modified file 'src/client/symbols.map' |
1890 | --- src/client/symbols.map 2017-01-09 06:48:47 +0000 |
1891 | +++ src/client/symbols.map 2017-01-10 20:52:04 +0000 |
1892 | @@ -550,4 +550,16 @@ |
1893 | mir_window_get_parameters; |
1894 | mir_window_get_orientation; |
1895 | mir_window_raise; |
1896 | + mir_event_get_window_event; |
1897 | + mir_window_event_get_attribute; |
1898 | + mir_window_event_get_attribute_value; |
1899 | + mir_window_get_type; |
1900 | + mir_event_get_window_output_event; |
1901 | + mir_window_output_event_get_dpi; |
1902 | + mir_window_output_event_get_form_factor; |
1903 | + mir_window_output_event_get_scale; |
1904 | + mir_window_output_event_get_output_id; |
1905 | + mir_window_output_event_get_refresh_rate; |
1906 | + mir_event_get_window_placement_event; |
1907 | + mir_window_placement_get_relative_position; |
1908 | } MIR_CLIENT_0.25; |
1909 | |
1910 | === modified file 'src/common/events/event.cpp' |
1911 | --- src/common/events/event.cpp 2016-11-11 07:56:09 +0000 |
1912 | +++ src/common/events/event.cpp 2017-01-10 20:52:04 +0000 |
1913 | @@ -82,7 +82,7 @@ |
1914 | case mir::capnp::Event::Which::INPUT: |
1915 | return mir_event_type_input; |
1916 | case mir::capnp::Event::Which::SURFACE: |
1917 | - return mir_event_type_surface; |
1918 | + return mir_event_type_window; |
1919 | case mir::capnp::Event::Which::RESIZE: |
1920 | return mir_event_type_resize; |
1921 | case mir::capnp::Event::Which::PROMPT_SESSION: |
1922 | @@ -90,7 +90,7 @@ |
1923 | case mir::capnp::Event::Which::ORIENTATION: |
1924 | return mir_event_type_orientation; |
1925 | case mir::capnp::Event::Which::CLOSE_SURFACE: |
1926 | - return mir_event_type_close_surface; |
1927 | + return mir_event_type_close_window; |
1928 | case mir::capnp::Event::Which::KEYMAP: |
1929 | return mir_event_type_keymap; |
1930 | #pragma GCC diagnostic push |
1931 | @@ -99,11 +99,11 @@ |
1932 | return mir_event_type_input_configuration; |
1933 | #pragma GCC diagnostic pop |
1934 | case mir::capnp::Event::Which::SURFACE_OUTPUT: |
1935 | - return mir_event_type_surface_output; |
1936 | + return mir_event_type_window_output; |
1937 | case mir::capnp::Event::Which::INPUT_DEVICE: |
1938 | return mir_event_type_input_device_state; |
1939 | case mir::capnp::Event::Which::SURFACE_PLACEMENT: |
1940 | - return mir_event_type_surface_placement; |
1941 | + return mir_event_type_window_placement; |
1942 | default: |
1943 | mir::log_critical("unknown event type."); |
1944 | abort(); |
1945 | @@ -133,14 +133,14 @@ |
1946 | } |
1947 | #pragma GCC diagnostic pop |
1948 | |
1949 | -MirSurfaceEvent* MirEvent::to_surface() |
1950 | +MirWindowEvent* MirEvent::to_surface() |
1951 | { |
1952 | - return static_cast<MirSurfaceEvent*>(this); |
1953 | + return static_cast<MirWindowEvent*>(this); |
1954 | } |
1955 | |
1956 | -MirSurfaceEvent const* MirEvent::to_surface() const |
1957 | +MirWindowEvent const* MirEvent::to_surface() const |
1958 | { |
1959 | - return static_cast<MirSurfaceEvent const*>(this); |
1960 | + return static_cast<MirWindowEvent const*>(this); |
1961 | } |
1962 | |
1963 | MirResizeEvent* MirEvent::to_resize() |
1964 | |
1965 | === modified file 'src/common/events/surface_event.cpp' |
1966 | --- src/common/events/surface_event.cpp 2016-10-31 02:37:31 +0000 |
1967 | +++ src/common/events/surface_event.cpp 2017-01-10 20:52:04 +0000 |
1968 | @@ -33,12 +33,12 @@ |
1969 | event.getSurface().setId(id); |
1970 | } |
1971 | |
1972 | -MirSurfaceAttrib MirSurfaceEvent::attrib() const |
1973 | +MirWindowAttrib MirSurfaceEvent::attrib() const |
1974 | { |
1975 | - return static_cast<MirSurfaceAttrib>(event.asReader().getSurface().getAttrib()); |
1976 | + return static_cast<MirWindowAttrib>(event.asReader().getSurface().getAttrib()); |
1977 | } |
1978 | |
1979 | -void MirSurfaceEvent::set_attrib(MirSurfaceAttrib attrib) |
1980 | +void MirSurfaceEvent::set_attrib(MirWindowAttrib attrib) |
1981 | { |
1982 | event.getSurface().setAttrib(static_cast<mir::capnp::SurfaceEvent::Attrib>(attrib)); |
1983 | } |
1984 | |
1985 | === modified file 'src/include/client/mir/egl_native_surface.h' |
1986 | --- src/include/client/mir/egl_native_surface.h 2017-01-09 06:48:47 +0000 |
1987 | +++ src/include/client/mir/egl_native_surface.h 2017-01-10 20:52:04 +0000 |
1988 | @@ -34,7 +34,7 @@ |
1989 | virtual MirWindowParameters get_parameters() const = 0; |
1990 | virtual std::shared_ptr<ClientBuffer> get_current_buffer() = 0; |
1991 | virtual void swap_buffers_sync() = 0; |
1992 | - virtual void request_and_wait_for_configure(MirSurfaceAttrib a, int value) = 0; |
1993 | + virtual void request_and_wait_for_configure(MirWindowAttrib a, int value) = 0; |
1994 | virtual void set_buffer_cache_size(unsigned int) = 0; |
1995 | |
1996 | protected: |
1997 | |
1998 | === modified file 'src/include/common/mir/events/event.h' |
1999 | --- src/include/common/mir/events/event.h 2016-11-11 06:59:42 +0000 |
2000 | +++ src/include/common/mir/events/event.h 2017-01-10 20:52:04 +0000 |
2001 | @@ -40,8 +40,8 @@ |
2002 | MirInputConfigurationEvent* to_input_configuration(); |
2003 | MirInputConfigurationEvent const* to_input_configuration() const; |
2004 | |
2005 | - MirSurfaceEvent* to_surface(); |
2006 | - MirSurfaceEvent const* to_surface() const; |
2007 | + MirWindowEvent* to_surface(); |
2008 | + MirWindowEvent const* to_surface() const; |
2009 | |
2010 | MirResizeEvent* to_resize(); |
2011 | MirResizeEvent const* to_resize() const; |
2012 | |
2013 | === modified file 'src/include/common/mir/events/surface_event.h' |
2014 | --- src/include/common/mir/events/surface_event.h 2016-10-31 02:37:31 +0000 |
2015 | +++ src/include/common/mir/events/surface_event.h 2017-01-10 20:52:04 +0000 |
2016 | @@ -28,8 +28,8 @@ |
2017 | int id() const; |
2018 | void set_id(int id); |
2019 | |
2020 | - MirSurfaceAttrib attrib() const; |
2021 | - void set_attrib(MirSurfaceAttrib attrib); |
2022 | + MirWindowAttrib attrib() const; |
2023 | + void set_attrib(MirWindowAttrib attrib); |
2024 | |
2025 | int value() const; |
2026 | void set_value(int value); |
2027 | |
2028 | === modified file 'src/include/common/mir/events/surface_output_event.h' |
2029 | --- src/include/common/mir/events/surface_output_event.h 2016-11-11 06:59:42 +0000 |
2030 | +++ src/include/common/mir/events/surface_output_event.h 2017-01-10 20:52:04 +0000 |
2031 | @@ -23,8 +23,6 @@ |
2032 | |
2033 | #include "mir/events/event.h" |
2034 | |
2035 | -// XXX This is a private structure so why are its members kept private? |
2036 | -// What's the point in having all the getters and setters? |
2037 | struct MirSurfaceOutputEvent : MirEvent |
2038 | { |
2039 | MirSurfaceOutputEvent(); |
2040 | |
2041 | === modified file 'src/include/server/mir/frontend/shell.h' |
2042 | --- src/include/server/mir/frontend/shell.h 2016-01-29 08:18:22 +0000 |
2043 | +++ src/include/server/mir/frontend/shell.h 2017-01-10 20:52:04 +0000 |
2044 | @@ -74,13 +74,13 @@ |
2045 | virtual int set_surface_attribute( |
2046 | std::shared_ptr<Session> const& session, |
2047 | SurfaceId surface_id, |
2048 | - MirSurfaceAttrib attrib, |
2049 | + MirWindowAttrib attrib, |
2050 | int value) = 0; |
2051 | |
2052 | virtual int get_surface_attribute( |
2053 | std::shared_ptr<Session> const& session, |
2054 | SurfaceId surface_id, |
2055 | - MirSurfaceAttrib attrib) = 0; |
2056 | + MirWindowAttrib attrib) = 0; |
2057 | |
2058 | virtual void raise_surface( |
2059 | std::shared_ptr<Session> const& session, |
2060 | |
2061 | === modified file 'src/include/server/mir/scene/surface_event_source.h' |
2062 | --- src/include/server/mir/scene/surface_event_source.h 2016-10-31 02:37:31 +0000 |
2063 | +++ src/include/server/mir/scene/surface_event_source.h 2017-01-10 20:52:04 +0000 |
2064 | @@ -42,7 +42,7 @@ |
2065 | OutputPropertiesCache const& outputs, |
2066 | std::shared_ptr<frontend::EventSink> const& event_sink); |
2067 | |
2068 | - void attrib_changed(MirSurfaceAttrib attrib, int value) override; |
2069 | + void attrib_changed(MirWindowAttrib attrib, int value) override; |
2070 | void resized_to(geometry::Size const& size) override; |
2071 | void moved_to(geometry::Point const& top_left) override; |
2072 | void orientation_set_to(MirOrientation orientation) override; |
2073 | |
2074 | === modified file 'src/include/server/mir/scene/surface_observers.h' |
2075 | --- src/include/server/mir/scene/surface_observers.h 2016-10-31 02:37:31 +0000 |
2076 | +++ src/include/server/mir/scene/surface_observers.h 2017-01-10 20:52:04 +0000 |
2077 | @@ -34,7 +34,7 @@ |
2078 | using BasicObservers<SurfaceObserver>::remove; |
2079 | using BasicObservers<SurfaceObserver>::for_each; |
2080 | |
2081 | - void attrib_changed(MirSurfaceAttrib attrib, int value) override; |
2082 | + void attrib_changed(MirWindowAttrib attrib, int value) override; |
2083 | void resized_to(geometry::Size const& size) override; |
2084 | void moved_to(geometry::Point const& top_left) override; |
2085 | void hidden_set_to(bool hide) override; |
2086 | |
2087 | === modified file 'src/include/server/mir/shell/basic_window_manager.h' |
2088 | --- src/include/server/mir/shell/basic_window_manager.h 2016-07-18 07:38:38 +0000 |
2089 | +++ src/include/server/mir/shell/basic_window_manager.h 2017-01-10 20:52:04 +0000 |
2090 | @@ -166,7 +166,7 @@ |
2091 | int set_surface_attribute( |
2092 | std::shared_ptr<scene::Session> const& /*session*/, |
2093 | std::shared_ptr<scene::Surface> const& surface, |
2094 | - MirSurfaceAttrib attrib, |
2095 | + MirWindowAttrib attrib, |
2096 | int value) override; |
2097 | |
2098 | auto find_session(std::function<bool(SessionInfo const& info)> const& predicate) |
2099 | |
2100 | === modified file 'src/include/server/mir/shell/window_management_info.h' |
2101 | --- src/include/server/mir/shell/window_management_info.h 2016-06-20 17:10:33 +0000 |
2102 | +++ src/include/server/mir/shell/window_management_info.h 2017-01-10 20:52:04 +0000 |
2103 | @@ -39,7 +39,7 @@ |
2104 | |
2105 | bool can_be_active() const; |
2106 | |
2107 | - bool can_morph_to(MirSurfaceType new_type) const; |
2108 | + bool can_morph_to(MirWindowType new_type) const; |
2109 | |
2110 | bool must_have_parent() const; |
2111 | |
2112 | @@ -47,7 +47,7 @@ |
2113 | |
2114 | bool is_visible() const; |
2115 | |
2116 | - static bool needs_titlebar(MirSurfaceType type); |
2117 | + static bool needs_titlebar(MirWindowType type); |
2118 | |
2119 | void constrain_resize( |
2120 | std::shared_ptr <scene::Surface> const& surface, |
2121 | @@ -57,7 +57,7 @@ |
2122 | const bool top_resize, |
2123 | geometry::Rectangle const& bounds) const; |
2124 | |
2125 | - MirSurfaceType type; |
2126 | + MirWindowType type; |
2127 | MirSurfaceState state; |
2128 | geometry::Rectangle restore_rect; |
2129 | std::weak_ptr <scene::Session> session; |
2130 | |
2131 | === modified file 'src/platforms/android/client/egl_native_surface_interpreter.cpp' |
2132 | --- src/platforms/android/client/egl_native_surface_interpreter.cpp 2016-12-09 02:54:31 +0000 |
2133 | +++ src/platforms/android/client/egl_native_surface_interpreter.cpp 2017-01-10 20:52:04 +0000 |
2134 | @@ -92,7 +92,7 @@ |
2135 | |
2136 | void mcla::EGLNativeSurfaceInterpreter::sync_to_display(bool should_sync) |
2137 | { |
2138 | - surface.request_and_wait_for_configure(mir_surface_attrib_swapinterval, should_sync); |
2139 | + surface.request_and_wait_for_configure(mir_window_attrib_swapinterval, should_sync); |
2140 | } |
2141 | |
2142 | void mcla::EGLNativeSurfaceInterpreter::dispatch_driver_request_buffer_count(unsigned int count) |
2143 | |
2144 | === modified file 'src/platforms/mesa/client/native_surface.cpp' |
2145 | --- src/platforms/mesa/client/native_surface.cpp 2017-01-09 06:48:47 +0000 |
2146 | +++ src/platforms/mesa/client/native_surface.cpp 2017-01-10 20:52:04 +0000 |
2147 | @@ -116,7 +116,7 @@ |
2148 | if ((interval < 0) || (interval > 1)) |
2149 | return MIR_MESA_FALSE; |
2150 | |
2151 | - surface->request_and_wait_for_configure(mir_surface_attrib_swapinterval, interval); |
2152 | + surface->request_and_wait_for_configure(mir_window_attrib_swapinterval, interval); |
2153 | return MIR_MESA_TRUE; |
2154 | } |
2155 | catch (std::exception const& e) |
2156 | |
2157 | === modified file 'src/server/frontend/session_mediator.cpp' |
2158 | --- src/server/frontend/session_mediator.cpp 2016-12-23 15:33:03 +0000 |
2159 | +++ src/server/frontend/session_mediator.cpp 2017-01-10 20:52:04 +0000 |
2160 | @@ -241,7 +241,7 @@ |
2161 | params.with_output_id(graphics::DisplayConfigurationOutputId(request->output_id())); |
2162 | |
2163 | if (request->has_type()) |
2164 | - params.of_type(static_cast<MirSurfaceType>(request->type())); |
2165 | + params.of_type(static_cast<MirWindowType>(request->type())); |
2166 | |
2167 | if (request->has_state()) |
2168 | params.with_state(static_cast<MirSurfaceState>(request->state())); |
2169 | @@ -350,13 +350,13 @@ |
2170 | if (surface->supports_input()) |
2171 | response->add_fd(surface->client_input_fd()); |
2172 | |
2173 | - for (unsigned int i = 0; i < mir_surface_attribs; i++) |
2174 | + for (unsigned int i = 0; i < mir_window_attribs; i++) |
2175 | { |
2176 | auto setting = response->add_attributes(); |
2177 | |
2178 | setting->mutable_surfaceid()->set_value(surf_id.as_value()); |
2179 | setting->set_attrib(i); |
2180 | - setting->set_ivalue(shell->get_surface_attribute(session, surf_id, static_cast<MirSurfaceAttrib>(i))); |
2181 | + setting->set_ivalue(shell->get_surface_attribute(session, surf_id, static_cast<MirWindowAttrib>(i))); |
2182 | } |
2183 | |
2184 | if (legacy_stream) |
2185 | @@ -508,7 +508,7 @@ |
2186 | mir::protobuf::SurfaceSetting* response, |
2187 | google::protobuf::Closure* done) |
2188 | { |
2189 | - MirSurfaceAttrib attrib = static_cast<MirSurfaceAttrib>(request->attrib()); |
2190 | + auto attrib = static_cast<MirWindowAttrib>(request->attrib()); |
2191 | |
2192 | // Required response fields: |
2193 | response->mutable_surfaceid()->CopyFrom(request->surfaceid()); |
2194 | |
2195 | === modified file 'src/server/frontend/shell_wrapper.cpp' |
2196 | --- src/server/frontend/shell_wrapper.cpp 2016-01-29 08:18:22 +0000 |
2197 | +++ src/server/frontend/shell_wrapper.cpp 2017-01-10 20:52:04 +0000 |
2198 | @@ -85,7 +85,7 @@ |
2199 | int mf::ShellWrapper::set_surface_attribute( |
2200 | std::shared_ptr<Session> const& session, |
2201 | SurfaceId surface_id, |
2202 | - MirSurfaceAttrib attrib, |
2203 | + MirWindowAttrib attrib, |
2204 | int value) |
2205 | { |
2206 | return wrapped->set_surface_attribute(session, surface_id, attrib, value); |
2207 | @@ -94,7 +94,7 @@ |
2208 | int mf::ShellWrapper::get_surface_attribute( |
2209 | std::shared_ptr<Session> const& session, |
2210 | SurfaceId surface_id, |
2211 | - MirSurfaceAttrib attrib) |
2212 | + MirWindowAttrib attrib) |
2213 | { |
2214 | return wrapped->get_surface_attribute(session, surface_id, attrib); |
2215 | } |
2216 | |
2217 | === modified file 'src/server/frontend/shell_wrapper.h' |
2218 | --- src/server/frontend/shell_wrapper.h 2016-01-29 08:18:22 +0000 |
2219 | +++ src/server/frontend/shell_wrapper.h 2017-01-10 20:52:04 +0000 |
2220 | @@ -67,13 +67,13 @@ |
2221 | int set_surface_attribute( |
2222 | std::shared_ptr<Session> const& session, |
2223 | SurfaceId surface_id, |
2224 | - MirSurfaceAttrib attrib, |
2225 | + MirWindowAttrib attrib, |
2226 | int value) override; |
2227 | |
2228 | int get_surface_attribute( |
2229 | std::shared_ptr<Session> const& session, |
2230 | SurfaceId surface_id, |
2231 | - MirSurfaceAttrib attrib) override; |
2232 | + MirWindowAttrib attrib) override; |
2233 | |
2234 | void raise_surface( |
2235 | std::shared_ptr<Session> const& session, |
2236 | |
2237 | === modified file 'src/server/input/cursor_controller.cpp' |
2238 | --- src/server/input/cursor_controller.cpp 2016-01-29 08:18:22 +0000 |
2239 | +++ src/server/input/cursor_controller.cpp 2017-01-10 20:52:04 +0000 |
2240 | @@ -44,7 +44,7 @@ |
2241 | { |
2242 | } |
2243 | |
2244 | - void attrib_changed(MirSurfaceAttrib, int) override |
2245 | + void attrib_changed(MirWindowAttrib, int) override |
2246 | { |
2247 | // Attribute changing alone wont trigger a cursor update |
2248 | } |
2249 | |
2250 | === modified file 'src/server/report/logging/shell_report.cpp' |
2251 | --- src/server/report/logging/shell_report.cpp 2016-07-18 07:38:38 +0000 |
2252 | +++ src/server/report/logging/shell_report.cpp 2017-01-10 20:52:04 +0000 |
2253 | @@ -86,7 +86,7 @@ |
2254 | void mrl::ShellReport::update_surface( |
2255 | Session const& session, |
2256 | Surface const& surface, |
2257 | - MirSurfaceAttrib /*attrib*/, int /*value*/) |
2258 | + MirWindowAttrib /*attrib*/, int /*value*/) |
2259 | { |
2260 | std::ostringstream out; |
2261 | log_basics(out, session, surface, "update"); |
2262 | |
2263 | === modified file 'src/server/report/logging/shell_report.h' |
2264 | --- src/server/report/logging/shell_report.h 2016-07-18 07:38:38 +0000 |
2265 | +++ src/server/report/logging/shell_report.h 2017-01-10 20:52:04 +0000 |
2266 | @@ -48,7 +48,7 @@ |
2267 | void update_surface( |
2268 | scene::Session const& session, |
2269 | scene::Surface const& surface, |
2270 | - MirSurfaceAttrib attrib, int value) override; |
2271 | + MirWindowAttrib attrib, int value) override; |
2272 | |
2273 | void destroying_surface( |
2274 | scene::Session const& session, |
2275 | |
2276 | === modified file 'src/server/report/null/shell_report.cpp' |
2277 | --- src/server/report/null/shell_report.cpp 2015-10-29 15:30:35 +0000 |
2278 | +++ src/server/report/null/shell_report.cpp 2017-01-10 20:52:04 +0000 |
2279 | @@ -44,7 +44,7 @@ |
2280 | void mrn::ShellReport::update_surface( |
2281 | scene::Session const& /*session*/, |
2282 | scene::Surface const& /*surface*/, |
2283 | - MirSurfaceAttrib /*attrib*/, int /*value*/) |
2284 | + MirWindowAttrib /*attrib*/, int /*value*/) |
2285 | { |
2286 | } |
2287 | |
2288 | |
2289 | === modified file 'src/server/report/null/shell_report.h' |
2290 | --- src/server/report/null/shell_report.h 2015-10-29 15:30:35 +0000 |
2291 | +++ src/server/report/null/shell_report.h 2017-01-10 20:52:04 +0000 |
2292 | @@ -45,7 +45,7 @@ |
2293 | void update_surface( |
2294 | scene::Session const& /*session*/, |
2295 | scene::Surface const& /*surface*/, |
2296 | - MirSurfaceAttrib /*attrib*/, int /*value*/) override; |
2297 | + MirWindowAttrib /*attrib*/, int /*value*/) override; |
2298 | |
2299 | void destroying_surface( |
2300 | scene::Session const& /*session*/, |
2301 | |
2302 | === modified file 'src/server/scene/application_session.cpp' |
2303 | --- src/server/scene/application_session.cpp 2016-11-09 02:30:14 +0000 |
2304 | +++ src/server/scene/application_session.cpp 2017-01-10 20:52:04 +0000 |
2305 | @@ -140,11 +140,11 @@ |
2306 | surface_stack->add_surface(surface, params.input_mode); |
2307 | |
2308 | if (params.state.is_set()) |
2309 | - surface->configure(mir_surface_attrib_state, params.state.value()); |
2310 | + surface->configure(mir_window_attrib_state, params.state.value()); |
2311 | if (params.type.is_set()) |
2312 | - surface->configure(mir_surface_attrib_type, params.type.value()); |
2313 | + surface->configure(mir_window_attrib_type, params.type.value()); |
2314 | if (params.preferred_orientation.is_set()) |
2315 | - surface->configure(mir_surface_attrib_preferred_orientation, params.preferred_orientation.value()); |
2316 | + surface->configure(mir_window_attrib_preferred_orientation, params.preferred_orientation.value()); |
2317 | if (params.input_shape.is_set()) |
2318 | surface->set_input_region(params.input_shape.value()); |
2319 | |
2320 | @@ -211,17 +211,17 @@ |
2321 | { |
2322 | switch (s.second->type()) |
2323 | { |
2324 | - case mir_surface_type_normal: /**< AKA "regular" */ |
2325 | - case mir_surface_type_utility: /**< AKA "floating" */ |
2326 | - case mir_surface_type_dialog: |
2327 | - case mir_surface_type_satellite: /**< AKA "toolbox"/"toolbar" */ |
2328 | - case mir_surface_type_freestyle: |
2329 | - case mir_surface_type_menu: |
2330 | - case mir_surface_type_inputmethod: /**< AKA "OSK" or handwriting etc. */ |
2331 | + case mir_window_type_normal: /**< AKA "regular" */ |
2332 | + case mir_window_type_utility: /**< AKA "floating" */ |
2333 | + case mir_window_type_dialog: |
2334 | + case mir_window_type_satellite: /**< AKA "toolbox"/"toolbar" */ |
2335 | + case mir_window_type_freestyle: |
2336 | + case mir_window_type_menu: |
2337 | + case mir_window_type_inputmethod: /**< AKA "OSK" or handwriting etc. */ |
2338 | return true; |
2339 | |
2340 | - case mir_surface_type_gloss: |
2341 | - case mir_surface_type_tip: /**< AKA "tooltip" */ |
2342 | + case mir_window_type_gloss: |
2343 | + case mir_window_type_tip: /**< AKA "tooltip" */ |
2344 | default: |
2345 | // Cannot have input focus - skip it |
2346 | return false; |
2347 | |
2348 | === modified file 'src/server/scene/basic_surface.cpp' |
2349 | --- src/server/scene/basic_surface.cpp 2016-12-09 02:54:31 +0000 |
2350 | +++ src/server/scene/basic_surface.cpp 2017-01-10 20:52:04 +0000 |
2351 | @@ -49,7 +49,7 @@ |
2352 | namespace geom = mir::geometry; |
2353 | namespace mrs = mir::renderer::software; |
2354 | |
2355 | -void ms::SurfaceObservers::attrib_changed(MirSurfaceAttrib attrib, int value) |
2356 | +void ms::SurfaceObservers::attrib_changed(MirWindowAttrib attrib, int value) |
2357 | { |
2358 | for_each([&](std::shared_ptr<SurfaceObserver> const& observer) |
2359 | { observer->attrib_changed(attrib, value); }); |
2360 | @@ -457,17 +457,17 @@ |
2361 | observers.reception_mode_set_to(mode); |
2362 | } |
2363 | |
2364 | -MirSurfaceType ms::BasicSurface::type() const |
2365 | +MirWindowType ms::BasicSurface::type() const |
2366 | { |
2367 | std::unique_lock<std::mutex> lg(guard); |
2368 | return type_; |
2369 | } |
2370 | |
2371 | -MirSurfaceType ms::BasicSurface::set_type(MirSurfaceType t) |
2372 | +MirWindowType ms::BasicSurface::set_type(MirWindowType t) |
2373 | { |
2374 | std::unique_lock<std::mutex> lg(guard); |
2375 | |
2376 | - if (t < 0 || t > mir_surface_types) |
2377 | + if (t < 0 || t > mir_window_types) |
2378 | { |
2379 | BOOST_THROW_EXCEPTION(std::logic_error("Invalid surface " |
2380 | "type.")); |
2381 | @@ -478,7 +478,7 @@ |
2382 | type_ = t; |
2383 | lg.unlock(); |
2384 | |
2385 | - observers.attrib_changed(mir_surface_attrib_type, type_); |
2386 | + observers.attrib_changed(mir_window_attrib_type, type_); |
2387 | } |
2388 | |
2389 | return t; |
2390 | @@ -500,7 +500,7 @@ |
2391 | { |
2392 | state_ = s; |
2393 | lg.unlock(); |
2394 | - observers.attrib_changed(mir_surface_attrib_state, s); |
2395 | + observers.attrib_changed(mir_window_attrib_state, s); |
2396 | } |
2397 | |
2398 | return s; |
2399 | @@ -522,7 +522,7 @@ |
2400 | info.stream->allow_framedropping(allow_dropping); |
2401 | |
2402 | lg.unlock(); |
2403 | - observers.attrib_changed(mir_surface_attrib_swapinterval, interval); |
2404 | + observers.attrib_changed(mir_window_attrib_swapinterval, interval); |
2405 | } |
2406 | |
2407 | return interval; |
2408 | @@ -542,7 +542,7 @@ |
2409 | focus_ = new_state; |
2410 | |
2411 | lg.unlock(); |
2412 | - observers.attrib_changed(mir_surface_attrib_focus, new_state); |
2413 | + observers.attrib_changed(mir_window_attrib_focus, new_state); |
2414 | } |
2415 | |
2416 | return new_state; |
2417 | @@ -561,36 +561,36 @@ |
2418 | pref_orientation_mode = new_orientation_mode; |
2419 | lg.unlock(); |
2420 | |
2421 | - observers.attrib_changed(mir_surface_attrib_preferred_orientation, new_orientation_mode); |
2422 | + observers.attrib_changed(mir_window_attrib_preferred_orientation, new_orientation_mode); |
2423 | } |
2424 | |
2425 | return new_orientation_mode; |
2426 | } |
2427 | |
2428 | -int ms::BasicSurface::configure(MirSurfaceAttrib attrib, int value) |
2429 | +int ms::BasicSurface::configure(MirWindowAttrib attrib, int value) |
2430 | { |
2431 | int result = value; |
2432 | switch (attrib) |
2433 | { |
2434 | - case mir_surface_attrib_type: |
2435 | - result = set_type(static_cast<MirSurfaceType>(result)); |
2436 | + case mir_window_attrib_type: |
2437 | + result = set_type(static_cast<MirWindowType>(result)); |
2438 | break; |
2439 | - case mir_surface_attrib_state: |
2440 | + case mir_window_attrib_state: |
2441 | result = set_state(static_cast<MirSurfaceState>(result)); |
2442 | break; |
2443 | - case mir_surface_attrib_focus: |
2444 | + case mir_window_attrib_focus: |
2445 | result = set_focus_state(static_cast<MirSurfaceFocusState>(result)); |
2446 | break; |
2447 | - case mir_surface_attrib_swapinterval: |
2448 | + case mir_window_attrib_swapinterval: |
2449 | result = set_swap_interval(result); |
2450 | break; |
2451 | - case mir_surface_attrib_dpi: |
2452 | + case mir_window_attrib_dpi: |
2453 | result = set_dpi(result); |
2454 | break; |
2455 | - case mir_surface_attrib_visibility: |
2456 | + case mir_window_attrib_visibility: |
2457 | result = set_visibility(static_cast<MirSurfaceVisibility>(result)); |
2458 | break; |
2459 | - case mir_surface_attrib_preferred_orientation: |
2460 | + case mir_window_attrib_preferred_orientation: |
2461 | result = set_preferred_orientation(static_cast<MirOrientationMode>(result)); |
2462 | break; |
2463 | default: |
2464 | @@ -600,18 +600,18 @@ |
2465 | return result; |
2466 | } |
2467 | |
2468 | -int ms::BasicSurface::query(MirSurfaceAttrib attrib) const |
2469 | +int ms::BasicSurface::query(MirWindowAttrib attrib) const |
2470 | { |
2471 | std::unique_lock<std::mutex> lg(guard); |
2472 | switch (attrib) |
2473 | { |
2474 | - case mir_surface_attrib_type: return type_; |
2475 | - case mir_surface_attrib_state: return state_; |
2476 | - case mir_surface_attrib_swapinterval: return swapinterval_; |
2477 | - case mir_surface_attrib_focus: return focus_; |
2478 | - case mir_surface_attrib_dpi: return dpi_; |
2479 | - case mir_surface_attrib_visibility: return visibility_; |
2480 | - case mir_surface_attrib_preferred_orientation: return pref_orientation_mode; |
2481 | + case mir_window_attrib_type: return type_; |
2482 | + case mir_window_attrib_state: return state_; |
2483 | + case mir_window_attrib_swapinterval: return swapinterval_; |
2484 | + case mir_window_attrib_focus: return focus_; |
2485 | + case mir_window_attrib_dpi: return dpi_; |
2486 | + case mir_window_attrib_visibility: return visibility_; |
2487 | + case mir_window_attrib_preferred_orientation: return pref_orientation_mode; |
2488 | default: BOOST_THROW_EXCEPTION(std::logic_error("Invalid surface " |
2489 | "attribute.")); |
2490 | } |
2491 | @@ -742,7 +742,7 @@ |
2492 | { |
2493 | dpi_ = new_dpi; |
2494 | lg.unlock(); |
2495 | - observers.attrib_changed(mir_surface_attrib_dpi, new_dpi); |
2496 | + observers.attrib_changed(mir_window_attrib_dpi, new_dpi); |
2497 | } |
2498 | |
2499 | return new_dpi; |
2500 | @@ -766,7 +766,7 @@ |
2501 | for (auto& info : layers) |
2502 | info.stream->drop_old_buffers(); |
2503 | } |
2504 | - observers.attrib_changed(mir_surface_attrib_visibility, visibility_); |
2505 | + observers.attrib_changed(mir_window_attrib_visibility, visibility_); |
2506 | } |
2507 | |
2508 | return new_visibility; |
2509 | |
2510 | === modified file 'src/server/scene/basic_surface.h' |
2511 | --- src/server/scene/basic_surface.h 2016-12-09 02:54:31 +0000 |
2512 | +++ src/server/scene/basic_surface.h 2017-01-10 20:52:04 +0000 |
2513 | @@ -117,10 +117,10 @@ |
2514 | graphics::RenderableList generate_renderables(compositor::CompositorID id) const override; |
2515 | int buffers_ready_for_compositor(void const* compositor_id) const override; |
2516 | |
2517 | - MirSurfaceType type() const override; |
2518 | + MirWindowType type() const override; |
2519 | MirSurfaceState state() const override; |
2520 | - int configure(MirSurfaceAttrib attrib, int value) override; |
2521 | - int query(MirSurfaceAttrib attrib) const override; |
2522 | + int configure(MirWindowAttrib attrib, int value) override; |
2523 | + int query(MirWindowAttrib attrib) const override; |
2524 | void hide() override; |
2525 | void show() override; |
2526 | |
2527 | @@ -152,7 +152,7 @@ |
2528 | |
2529 | private: |
2530 | bool visible(std::unique_lock<std::mutex>&) const; |
2531 | - MirSurfaceType set_type(MirSurfaceType t); // Use configure() to make public changes |
2532 | + MirWindowType set_type(MirWindowType t); // Use configure() to make public changes |
2533 | MirSurfaceState set_state(MirSurfaceState s); |
2534 | int set_dpi(int); |
2535 | MirSurfaceVisibility set_visibility(MirSurfaceVisibility v); |
2536 | @@ -178,7 +178,7 @@ |
2537 | |
2538 | std::list<StreamInfo> layers; |
2539 | // Surface attributes: |
2540 | - MirSurfaceType type_ = mir_surface_type_normal; |
2541 | + MirWindowType type_ = mir_window_type_normal; |
2542 | MirSurfaceState state_ = mir_surface_state_restored; |
2543 | int swapinterval_ = 1; |
2544 | MirSurfaceFocusState focus_ = mir_surface_unfocused; |
2545 | |
2546 | === modified file 'src/server/scene/legacy_surface_change_notification.cpp' |
2547 | --- src/server/scene/legacy_surface_change_notification.cpp 2016-10-31 02:37:31 +0000 |
2548 | +++ src/server/scene/legacy_surface_change_notification.cpp 2017-01-10 20:52:04 +0000 |
2549 | @@ -67,7 +67,7 @@ |
2550 | } |
2551 | |
2552 | // An attrib change alone is not enough to trigger recomposition. |
2553 | -void ms::LegacySurfaceChangeNotification::attrib_changed(MirSurfaceAttrib /* attrib */, int /* value */) |
2554 | +void ms::LegacySurfaceChangeNotification::attrib_changed(MirWindowAttrib /* attrib */, int /* value */) |
2555 | { |
2556 | } |
2557 | |
2558 | |
2559 | === modified file 'src/server/scene/legacy_surface_change_notification.h' |
2560 | --- src/server/scene/legacy_surface_change_notification.h 2016-10-31 02:37:31 +0000 |
2561 | +++ src/server/scene/legacy_surface_change_notification.h 2017-01-10 20:52:04 +0000 |
2562 | @@ -41,7 +41,7 @@ |
2563 | void alpha_set_to(float /*alpha*/) override; |
2564 | void orientation_set_to(MirOrientation orientation) override; |
2565 | void transformation_set_to(glm::mat4 const& /*t*/) override; |
2566 | - void attrib_changed(MirSurfaceAttrib, int) override; |
2567 | + void attrib_changed(MirWindowAttrib, int) override; |
2568 | void reception_mode_set_to(input::InputReceptionMode mode) override; |
2569 | void cursor_image_set_to(graphics::CursorImage const& image) override; |
2570 | void client_surface_close_requested() override; |
2571 | |
2572 | === modified file 'src/server/scene/null_surface_observer.cpp' |
2573 | --- src/server/scene/null_surface_observer.cpp 2016-10-31 02:37:31 +0000 |
2574 | +++ src/server/scene/null_surface_observer.cpp 2017-01-10 20:52:04 +0000 |
2575 | @@ -21,7 +21,7 @@ |
2576 | namespace ms = mir::scene; |
2577 | namespace mg = mir::graphics; |
2578 | |
2579 | -void ms::NullSurfaceObserver::attrib_changed(MirSurfaceAttrib /*attrib*/, int /*value*/) {} |
2580 | +void ms::NullSurfaceObserver::attrib_changed(MirWindowAttrib /*attrib*/, int /*value*/) {} |
2581 | void ms::NullSurfaceObserver::resized_to(geometry::Size const& /*size*/) {} |
2582 | void ms::NullSurfaceObserver::moved_to(geometry::Point const& /*top_left*/) {} |
2583 | void ms::NullSurfaceObserver::hidden_set_to(bool /*hide*/) {} |
2584 | |
2585 | === modified file 'src/server/scene/rendering_tracker.cpp' |
2586 | --- src/server/scene/rendering_tracker.cpp 2016-01-29 08:18:22 +0000 |
2587 | +++ src/server/scene/rendering_tracker.cpp 2017-01-10 20:52:04 +0000 |
2588 | @@ -88,7 +88,7 @@ |
2589 | void ms::RenderingTracker::configure_visibility(MirSurfaceVisibility visibility) |
2590 | { |
2591 | if (auto const surface = weak_surface.lock()) |
2592 | - surface->configure(mir_surface_attrib_visibility, visibility); |
2593 | + surface->configure(mir_window_attrib_visibility, visibility); |
2594 | } |
2595 | |
2596 | void ms::RenderingTracker::remove_occlusions_for_inactive_compositors() |
2597 | |
2598 | === modified file 'src/server/scene/surface_creation_parameters.cpp' |
2599 | --- src/server/scene/surface_creation_parameters.cpp 2016-01-29 08:18:22 +0000 |
2600 | +++ src/server/scene/surface_creation_parameters.cpp 2017-01-10 20:52:04 +0000 |
2601 | @@ -92,7 +92,7 @@ |
2602 | } |
2603 | |
2604 | |
2605 | -ms::SurfaceCreationParameters& ms::SurfaceCreationParameters::of_type(MirSurfaceType the_type) |
2606 | +ms::SurfaceCreationParameters& ms::SurfaceCreationParameters::of_type(MirWindowType the_type) |
2607 | { |
2608 | type = the_type; |
2609 | return *this; |
2610 | |
2611 | === modified file 'src/server/scene/surface_event_source.cpp' |
2612 | --- src/server/scene/surface_event_source.cpp 2016-10-31 02:37:31 +0000 |
2613 | +++ src/server/scene/surface_event_source.cpp 2017-01-10 20:52:04 +0000 |
2614 | @@ -65,7 +65,7 @@ |
2615 | } |
2616 | } |
2617 | |
2618 | -void ms::SurfaceEventSource::attrib_changed(MirSurfaceAttrib attrib, int value) |
2619 | +void ms::SurfaceEventSource::attrib_changed(MirWindowAttrib attrib, int value) |
2620 | { |
2621 | event_sink->handle_event(*mev::make_event(id, attrib, value)); |
2622 | } |
2623 | |
2624 | === modified file 'src/server/scene/surface_stack.cpp' |
2625 | --- src/server/scene/surface_stack.cpp 2016-07-18 07:38:38 +0000 |
2626 | +++ src/server/scene/surface_stack.cpp 2017-01-10 20:52:04 +0000 |
2627 | @@ -309,7 +309,7 @@ |
2628 | RecursiveReadLock lg(guard); |
2629 | for (auto &surface : surfaces) |
2630 | { |
2631 | - if (surface->query(mir_surface_attrib_visibility) == |
2632 | + if (surface->query(mir_window_attrib_visibility) == |
2633 | MirSurfaceVisibility::mir_surface_visibility_exposed) |
2634 | { |
2635 | callback(surface); |
2636 | |
2637 | === modified file 'src/server/shell/abstract_shell.cpp' |
2638 | --- src/server/shell/abstract_shell.cpp 2016-11-09 02:30:14 +0000 |
2639 | +++ src/server/shell/abstract_shell.cpp 2017-01-10 20:52:04 +0000 |
2640 | @@ -209,7 +209,7 @@ |
2641 | int msh::AbstractShell::set_surface_attribute( |
2642 | std::shared_ptr<ms::Session> const& session, |
2643 | std::shared_ptr<ms::Surface> const& surface, |
2644 | - MirSurfaceAttrib attrib, |
2645 | + MirWindowAttrib attrib, |
2646 | int value) |
2647 | { |
2648 | report->update_surface(*session, *surface, attrib, value); |
2649 | @@ -218,7 +218,7 @@ |
2650 | |
2651 | int msh::AbstractShell::get_surface_attribute( |
2652 | std::shared_ptr<ms::Surface> const& surface, |
2653 | - MirSurfaceAttrib attrib) |
2654 | + MirWindowAttrib attrib) |
2655 | { |
2656 | return surface->query(attrib); |
2657 | } |
2658 | @@ -289,7 +289,7 @@ |
2659 | |
2660 | if (current_focus) |
2661 | { |
2662 | - current_focus->configure(mir_surface_attrib_focus, mir_surface_unfocused); |
2663 | + current_focus->configure(mir_window_attrib_focus, mir_surface_unfocused); |
2664 | current_focus->remove_observer(focus_surface_observer); |
2665 | } |
2666 | |
2667 | @@ -303,7 +303,7 @@ |
2668 | // Ensure the surface has really taken the focus before notifying it that it is focused |
2669 | input_targeter->set_focus(surface); |
2670 | surface->consume(seat->create_device_state().get()); |
2671 | - surface->configure(mir_surface_attrib_focus, mir_surface_focused); |
2672 | + surface->configure(mir_window_attrib_focus, mir_surface_focused); |
2673 | surface->add_observer(focus_surface_observer); |
2674 | } |
2675 | else |
2676 | |
2677 | === modified file 'src/server/shell/basic_window_manager.cpp' |
2678 | --- src/server/shell/basic_window_manager.cpp 2016-02-29 15:25:14 +0000 |
2679 | +++ src/server/shell/basic_window_manager.cpp 2017-01-10 20:52:04 +0000 |
2680 | @@ -138,13 +138,13 @@ |
2681 | int msh::BasicWindowManager::set_surface_attribute( |
2682 | std::shared_ptr<scene::Session> const& /*session*/, |
2683 | std::shared_ptr<scene::Surface> const& surface, |
2684 | - MirSurfaceAttrib attrib, |
2685 | + MirWindowAttrib attrib, |
2686 | int value) |
2687 | { |
2688 | std::lock_guard<decltype(mutex)> lock(mutex); |
2689 | switch (attrib) |
2690 | { |
2691 | - case mir_surface_attrib_state: |
2692 | + case mir_window_attrib_state: |
2693 | { |
2694 | auto const state = policy->handle_set_state(surface, MirSurfaceState(value)); |
2695 | return surface->configure(attrib, state); |
2696 | |
2697 | === modified file 'src/server/shell/canonical_window_manager.cpp' |
2698 | --- src/server/shell/canonical_window_manager.cpp 2016-12-09 02:54:31 +0000 |
2699 | +++ src/server/shell/canonical_window_manager.cpp 2017-01-10 20:52:04 +0000 |
2700 | @@ -41,12 +41,12 @@ |
2701 | // but is currently used when placing the surface before construction. |
2702 | // Which implies we need some rework so that we can construct metadata |
2703 | // before the surface. |
2704 | -bool must_not_have_parent(MirSurfaceType type) |
2705 | +bool must_not_have_parent(MirWindowType type) |
2706 | { |
2707 | switch (type) |
2708 | { |
2709 | - case mir_surface_type_normal: |
2710 | - case mir_surface_type_utility: |
2711 | + case mir_window_type_normal: |
2712 | + case mir_window_type_utility: |
2713 | return true; |
2714 | |
2715 | default: |
2716 | @@ -58,13 +58,13 @@ |
2717 | // but is currently used when placing the surface before construction. |
2718 | // Which implies we need some rework so that we can construct metadata |
2719 | // before the surface. |
2720 | -bool must_have_parent(MirSurfaceType type) |
2721 | +bool must_have_parent(MirWindowType type) |
2722 | { |
2723 | switch (type) |
2724 | { |
2725 | - case mir_surface_type_overlay:; |
2726 | - case mir_surface_type_satellite: |
2727 | - case mir_surface_type_tip: |
2728 | + case mir_window_type_gloss:; |
2729 | + case mir_window_type_satellite: |
2730 | + case mir_window_type_tip: |
2731 | return true; |
2732 | |
2733 | default: |
2734 | @@ -334,7 +334,7 @@ |
2735 | throw std::runtime_error("Target surface type requires parent"); |
2736 | } |
2737 | |
2738 | - surface->configure(mir_surface_attrib_type, new_type); |
2739 | + surface->configure(mir_window_attrib_type, new_type); |
2740 | } |
2741 | |
2742 | #define COPY_IF_SET(field)\ |
2743 | @@ -406,7 +406,7 @@ |
2744 | if (modifications.state.is_set()) |
2745 | { |
2746 | auto const state = handle_set_state(surface, modifications.state.value()); |
2747 | - surface->configure(mir_surface_attrib_state, state); |
2748 | + surface->configure(mir_window_attrib_state, state); |
2749 | } |
2750 | |
2751 | if (modifications.confine_pointer.is_set()) |
2752 | @@ -780,7 +780,7 @@ |
2753 | state = mir_surface_state_restored; |
2754 | |
2755 | auto const value = handle_set_state(surface, MirSurfaceState(state)); |
2756 | - surface->configure(mir_surface_attrib_state, value); |
2757 | + surface->configure(mir_window_attrib_state, value); |
2758 | } |
2759 | } |
2760 | |
2761 | |
2762 | === modified file 'src/server/shell/frontend_shell.cpp' |
2763 | --- src/server/shell/frontend_shell.cpp 2016-01-29 08:18:22 +0000 |
2764 | +++ src/server/shell/frontend_shell.cpp 2017-01-10 20:52:04 +0000 |
2765 | @@ -83,9 +83,9 @@ |
2766 | // in the surface spec requirements (eg: regular surface has no parent, |
2767 | // dialog may have a parent, gloss must have a parent). |
2768 | if (populated_params.parent.lock() && |
2769 | - populated_params.type.value() != mir_surface_type_inputmethod) |
2770 | + populated_params.type.value() != mir_window_type_inputmethod) |
2771 | { |
2772 | - BOOST_THROW_EXCEPTION(std::invalid_argument("Foreign parents may only be set on surfaces of type mir_surface_type_inputmethod")); |
2773 | + BOOST_THROW_EXCEPTION(std::invalid_argument("Foreign parents may only be set on surfaces of type mir_window_type_inputmethod")); |
2774 | } |
2775 | |
2776 | if (populated_params.parent_id.is_set()) |
2777 | @@ -130,7 +130,7 @@ |
2778 | int msh::FrontendShell::set_surface_attribute( |
2779 | std::shared_ptr<mf::Session> const& session, |
2780 | mf::SurfaceId surface_id, |
2781 | - MirSurfaceAttrib attrib, |
2782 | + MirWindowAttrib attrib, |
2783 | int value) |
2784 | { |
2785 | auto const scene_session = std::dynamic_pointer_cast<ms::Session>(session); |
2786 | @@ -141,7 +141,7 @@ |
2787 | int msh::FrontendShell::get_surface_attribute( |
2788 | std::shared_ptr<mf::Session> const& session, |
2789 | mf::SurfaceId surface_id, |
2790 | - MirSurfaceAttrib attrib) |
2791 | + MirWindowAttrib attrib) |
2792 | { |
2793 | auto const scene_session = std::dynamic_pointer_cast<ms::Session>(session); |
2794 | auto const surface = scene_session->surface(surface_id); |
2795 | |
2796 | === modified file 'src/server/shell/frontend_shell.h' |
2797 | --- src/server/shell/frontend_shell.h 2016-01-29 08:18:22 +0000 |
2798 | +++ src/server/shell/frontend_shell.h 2017-01-10 20:52:04 +0000 |
2799 | @@ -79,13 +79,13 @@ |
2800 | int set_surface_attribute( |
2801 | std::shared_ptr<mf::Session> const& session, |
2802 | mf::SurfaceId surface_id, |
2803 | - MirSurfaceAttrib attrib, |
2804 | + MirWindowAttrib attrib, |
2805 | int value) override; |
2806 | |
2807 | int get_surface_attribute( |
2808 | std::shared_ptr<mf::Session> const& session, |
2809 | mf::SurfaceId surface_id, |
2810 | - MirSurfaceAttrib attrib) override; |
2811 | + MirWindowAttrib attrib) override; |
2812 | |
2813 | void raise_surface( |
2814 | std::shared_ptr<mf::Session> const& session, |
2815 | |
2816 | === modified file 'src/server/shell/shell_wrapper.cpp' |
2817 | --- src/server/shell/shell_wrapper.cpp 2016-01-29 08:18:22 +0000 |
2818 | +++ src/server/shell/shell_wrapper.cpp 2017-01-10 20:52:04 +0000 |
2819 | @@ -99,7 +99,7 @@ |
2820 | int msh::ShellWrapper::set_surface_attribute( |
2821 | std::shared_ptr<ms::Session> const& session, |
2822 | std::shared_ptr<ms::Surface> const& surface, |
2823 | - MirSurfaceAttrib attrib, |
2824 | + MirWindowAttrib attrib, |
2825 | int value) |
2826 | { |
2827 | return wrapped->set_surface_attribute(session, surface, attrib, value); |
2828 | @@ -107,7 +107,7 @@ |
2829 | |
2830 | int msh::ShellWrapper::get_surface_attribute( |
2831 | std::shared_ptr<ms::Surface> const& surface, |
2832 | - MirSurfaceAttrib attrib) |
2833 | + MirWindowAttrib attrib) |
2834 | { |
2835 | return wrapped->get_surface_attribute(surface, attrib); |
2836 | } |
2837 | |
2838 | === modified file 'src/server/shell/system_compositor_window_manager.cpp' |
2839 | --- src/server/shell/system_compositor_window_manager.cpp 2016-07-18 07:38:38 +0000 |
2840 | +++ src/server/shell/system_compositor_window_manager.cpp 2017-01-10 20:52:04 +0000 |
2841 | @@ -168,7 +168,7 @@ |
2842 | int msh::SystemCompositorWindowManager::set_surface_attribute( |
2843 | std::shared_ptr<ms::Session> const& /*session*/, |
2844 | std::shared_ptr<ms::Surface> const& surface, |
2845 | - MirSurfaceAttrib attrib, |
2846 | + MirWindowAttrib attrib, |
2847 | int value) |
2848 | { |
2849 | return surface->configure(attrib, value); |
2850 | |
2851 | === modified file 'src/server/shell/window_management_info.cpp' |
2852 | --- src/server/shell/window_management_info.cpp 2016-02-29 15:25:14 +0000 |
2853 | +++ src/server/shell/window_management_info.cpp 2017-01-10 20:52:04 +0000 |
2854 | @@ -56,17 +56,17 @@ |
2855 | { |
2856 | switch (type) |
2857 | { |
2858 | - case mir_surface_type_normal: /**< AKA "regular" */ |
2859 | - case mir_surface_type_utility: /**< AKA "floating" */ |
2860 | - case mir_surface_type_dialog: |
2861 | - case mir_surface_type_satellite: /**< AKA "toolbox"/"toolbar" */ |
2862 | - case mir_surface_type_freestyle: |
2863 | - case mir_surface_type_menu: |
2864 | - case mir_surface_type_inputmethod: /**< AKA "OSK" or handwriting etc. */ |
2865 | + case mir_window_type_normal: /**< AKA "regular" */ |
2866 | + case mir_window_type_utility: /**< AKA "floating" */ |
2867 | + case mir_window_type_dialog: |
2868 | + case mir_window_type_satellite: /**< AKA "toolbox"/"toolbar" */ |
2869 | + case mir_window_type_freestyle: |
2870 | + case mir_window_type_menu: |
2871 | + case mir_window_type_inputmethod: /**< AKA "OSK" or handwriting etc. */ |
2872 | return true; |
2873 | |
2874 | - case mir_surface_type_gloss: |
2875 | - case mir_surface_type_tip: /**< AKA "tooltip" */ |
2876 | + case mir_window_type_gloss: |
2877 | + case mir_window_type_tip: /**< AKA "tooltip" */ |
2878 | default: |
2879 | // Cannot have input focus |
2880 | return false; |
2881 | @@ -77,10 +77,10 @@ |
2882 | { |
2883 | switch (type) |
2884 | { |
2885 | - case mir_surface_type_overlay:; |
2886 | - case mir_surface_type_inputmethod: |
2887 | - case mir_surface_type_satellite: |
2888 | - case mir_surface_type_tip: |
2889 | + case mir_window_type_gloss:; |
2890 | + case mir_window_type_inputmethod: |
2891 | + case mir_window_type_satellite: |
2892 | + case mir_window_type_tip: |
2893 | return true; |
2894 | |
2895 | default: |
2896 | @@ -88,19 +88,19 @@ |
2897 | } |
2898 | } |
2899 | |
2900 | -bool msh::SurfaceInfo::can_morph_to(MirSurfaceType new_type) const |
2901 | +bool msh::SurfaceInfo::can_morph_to(MirWindowType new_type) const |
2902 | { |
2903 | switch (new_type) |
2904 | { |
2905 | - case mir_surface_type_normal: |
2906 | - case mir_surface_type_utility: |
2907 | - case mir_surface_type_satellite: |
2908 | + case mir_window_type_normal: |
2909 | + case mir_window_type_utility: |
2910 | + case mir_window_type_satellite: |
2911 | switch (type) |
2912 | { |
2913 | - case mir_surface_type_normal: |
2914 | - case mir_surface_type_utility: |
2915 | - case mir_surface_type_dialog: |
2916 | - case mir_surface_type_satellite: |
2917 | + case mir_window_type_normal: |
2918 | + case mir_window_type_utility: |
2919 | + case mir_window_type_dialog: |
2920 | + case mir_window_type_satellite: |
2921 | return true; |
2922 | |
2923 | default: |
2924 | @@ -108,14 +108,14 @@ |
2925 | } |
2926 | break; |
2927 | |
2928 | - case mir_surface_type_dialog: |
2929 | + case mir_window_type_dialog: |
2930 | switch (type) |
2931 | { |
2932 | - case mir_surface_type_normal: |
2933 | - case mir_surface_type_utility: |
2934 | - case mir_surface_type_dialog: |
2935 | - case mir_surface_type_popover: |
2936 | - case mir_surface_type_satellite: |
2937 | + case mir_window_type_normal: |
2938 | + case mir_window_type_utility: |
2939 | + case mir_window_type_dialog: |
2940 | + case mir_window_type_popover: |
2941 | + case mir_window_type_satellite: |
2942 | return true; |
2943 | |
2944 | default: |
2945 | @@ -134,8 +134,8 @@ |
2946 | { |
2947 | switch (type) |
2948 | { |
2949 | - case mir_surface_type_normal: |
2950 | - case mir_surface_type_utility: |
2951 | + case mir_window_type_normal: |
2952 | + case mir_window_type_utility: |
2953 | return true; |
2954 | |
2955 | default: |
2956 | @@ -284,15 +284,15 @@ |
2957 | requested_size = new_size; |
2958 | } |
2959 | |
2960 | -bool msh::SurfaceInfo::needs_titlebar(MirSurfaceType type) |
2961 | +bool msh::SurfaceInfo::needs_titlebar(MirWindowType type) |
2962 | { |
2963 | switch (type) |
2964 | { |
2965 | - case mir_surface_type_freestyle: |
2966 | - case mir_surface_type_menu: |
2967 | - case mir_surface_type_inputmethod: |
2968 | - case mir_surface_type_gloss: |
2969 | - case mir_surface_type_tip: |
2970 | + case mir_window_type_freestyle: |
2971 | + case mir_window_type_menu: |
2972 | + case mir_window_type_inputmethod: |
2973 | + case mir_window_type_gloss: |
2974 | + case mir_window_type_tip: |
2975 | // No decorations for these surface types |
2976 | return false; |
2977 | default: |
2978 | |
2979 | === modified file 'src/utils/vanity.c' |
2980 | --- src/utils/vanity.c 2017-01-09 06:48:47 +0000 |
2981 | +++ src/utils/vanity.c 2017-01-10 20:52:04 +0000 |
2982 | @@ -135,12 +135,12 @@ |
2983 | return false; |
2984 | } |
2985 | |
2986 | -static bool on_surface_event(MirSurfaceEvent const* sevent, State* state) |
2987 | +static bool on_surface_event(MirWindowEvent const* wevent, State* state) |
2988 | { |
2989 | - MirSurfaceAttrib attrib = mir_surface_event_get_attribute(sevent); |
2990 | - int value = mir_surface_event_get_attribute_value(sevent); |
2991 | + MirWindowAttrib attrib = mir_window_event_get_attribute(wevent); |
2992 | + int value = mir_window_event_get_attribute_value(wevent); |
2993 | |
2994 | - if (attrib == mir_surface_attrib_visibility) |
2995 | + if (attrib == mir_window_attrib_visibility) |
2996 | { |
2997 | if (value == mir_surface_visibility_exposed) |
2998 | { |
2999 | @@ -172,8 +172,8 @@ |
3000 | case mir_event_type_input: |
3001 | handled = on_input_event(mir_event_get_input_event(event), state); |
3002 | break; |
3003 | - case mir_event_type_surface: |
3004 | - handled = on_surface_event(mir_event_get_surface_event(event), state); |
3005 | + case mir_event_type_window: |
3006 | + handled = on_surface_event(mir_event_get_window_event(event), state); |
3007 | break; |
3008 | case mir_event_type_resize: |
3009 | state->resized = true; |
3010 | |
3011 | === modified file 'tests/acceptance-tests/test_client_cookie.cpp' |
3012 | --- tests/acceptance-tests/test_client_cookie.cpp 2017-01-09 06:48:47 +0000 |
3013 | +++ tests/acceptance-tests/test_client_cookie.cpp 2017-01-10 20:52:04 +0000 |
3014 | @@ -101,20 +101,20 @@ |
3015 | auto const event_type = mir_event_get_type(ev); |
3016 | auto client_cookie = static_cast<ClientCookies*>(ctx); |
3017 | |
3018 | - if (event_type == mir_event_type_surface) |
3019 | + if (event_type == mir_event_type_window) |
3020 | { |
3021 | - auto event = mir_event_get_surface_event(ev); |
3022 | - auto const attrib = mir_surface_event_get_attribute(event); |
3023 | - auto const value = mir_surface_event_get_attribute_value(event); |
3024 | + auto event = mir_event_get_window_event(ev); |
3025 | + auto const attrib = mir_window_event_get_attribute(event); |
3026 | + auto const value = mir_window_event_get_attribute_value(event); |
3027 | |
3028 | std::lock_guard<std::mutex> lk(client_cookie->mutex); |
3029 | - if (attrib == mir_surface_attrib_visibility && |
3030 | + if (attrib == mir_window_attrib_visibility && |
3031 | value == mir_surface_visibility_exposed) |
3032 | { |
3033 | client_cookie->exposed = true; |
3034 | } |
3035 | |
3036 | - if (attrib == mir_surface_attrib_focus && |
3037 | + if (attrib == mir_window_attrib_focus && |
3038 | value == mir_surface_focused) |
3039 | { |
3040 | client_cookie->focused = true; |
3041 | |
3042 | === modified file 'tests/acceptance-tests/test_client_focus_notification.cpp' |
3043 | --- tests/acceptance-tests/test_client_focus_notification.cpp 2017-01-09 06:48:47 +0000 |
3044 | +++ tests/acceptance-tests/test_client_focus_notification.cpp 2017-01-10 20:52:04 +0000 |
3045 | @@ -57,14 +57,15 @@ |
3046 | |
3047 | static void handle_event(MirWindow* window, MirEvent const* ev, void* context) |
3048 | { |
3049 | - if (mir_event_type_surface == mir_event_get_type(ev)) |
3050 | + if (mir_event_type_window == mir_event_get_type(ev)) |
3051 | { |
3052 | - auto surface_ev = mir_event_get_surface_event(ev); |
3053 | - if (mir_surface_attrib_focus == mir_surface_event_get_attribute(surface_ev)) |
3054 | + auto surface_ev = mir_event_get_window_event(ev); |
3055 | + auto attrib = mir_window_event_get_attribute(surface_ev); |
3056 | + if (mir_window_attrib_focus == attrib) |
3057 | { |
3058 | auto self = static_cast<FocusSurface*>(context); |
3059 | self->log_focus_event(window, |
3060 | - static_cast<MirSurfaceFocusState>(mir_surface_event_get_attribute_value(surface_ev))); |
3061 | + static_cast<MirSurfaceFocusState>(mir_window_event_get_attribute_value(surface_ev))); |
3062 | } |
3063 | } |
3064 | } |
3065 | |
3066 | === modified file 'tests/acceptance-tests/test_client_input.cpp' |
3067 | --- tests/acceptance-tests/test_client_input.cpp 2017-01-09 06:48:47 +0000 |
3068 | +++ tests/acceptance-tests/test_client_input.cpp 2017-01-10 20:52:04 +0000 |
3069 | @@ -112,16 +112,16 @@ |
3070 | BOOST_THROW_EXCEPTION(std::runtime_error("Timeout waiting for window to become focused and exposed")); |
3071 | } |
3072 | |
3073 | - void handle_surface_event(MirSurfaceEvent const* event) |
3074 | + void handle_window_event(MirWindowEvent const* event) |
3075 | { |
3076 | - auto const attrib = mir_surface_event_get_attribute(event); |
3077 | - auto const value = mir_surface_event_get_attribute_value(event); |
3078 | + auto const attrib = mir_window_event_get_attribute(event); |
3079 | + auto const value = mir_window_event_get_attribute_value(event); |
3080 | |
3081 | - if (mir_surface_attrib_visibility == attrib && |
3082 | + if (mir_window_attrib_visibility == attrib && |
3083 | mir_surface_visibility_exposed == value) |
3084 | exposed = true; |
3085 | |
3086 | - if (mir_surface_attrib_focus == attrib && |
3087 | + if (mir_window_attrib_focus == attrib && |
3088 | mir_surface_focused == value) |
3089 | focused = true; |
3090 | |
3091 | @@ -133,10 +133,10 @@ |
3092 | { |
3093 | auto const client = static_cast<Client*>(context); |
3094 | auto type = mir_event_get_type(ev); |
3095 | - if (type == mir_event_type_surface) |
3096 | + if (type == mir_event_type_window) |
3097 | { |
3098 | - auto surface_event = mir_event_get_surface_event(ev); |
3099 | - client->handle_surface_event(surface_event); |
3100 | + auto window_event = mir_event_get_window_event(ev); |
3101 | + client->handle_window_event(window_event); |
3102 | |
3103 | } |
3104 | if (type == mir_event_type_input) |
3105 | |
3106 | === modified file 'tests/acceptance-tests/test_client_library.cpp' |
3107 | --- tests/acceptance-tests/test_client_library.cpp 2017-01-09 07:03:12 +0000 |
3108 | +++ tests/acceptance-tests/test_client_library.cpp 2017-01-10 20:52:04 +0000 |
3109 | @@ -767,7 +767,7 @@ |
3110 | |
3111 | EXPECT_THAT(native_buffer->width, Eq(width)); |
3112 | EXPECT_THAT(native_buffer->height, Eq(height)); |
3113 | - EXPECT_THAT(mir_surface_get_type(window), Eq(mir_surface_type_normal)); |
3114 | + EXPECT_THAT(mir_window_get_type(window), Eq(mir_window_type_normal)); |
3115 | |
3116 | mir_window_release_sync(window); |
3117 | mir_connection_release(connection); |
3118 | @@ -793,7 +793,7 @@ |
3119 | |
3120 | EXPECT_THAT(native_buffer->width, Eq(width)); |
3121 | EXPECT_THAT(native_buffer->height, Eq(height)); |
3122 | - EXPECT_THAT(mir_surface_get_type(window), Eq(mir_surface_type_normal)); |
3123 | + EXPECT_THAT(mir_window_get_type(window), Eq(mir_window_type_normal)); |
3124 | |
3125 | mir_window_release_sync(window); |
3126 | mir_connection_release(connection); |
3127 | |
3128 | === modified file 'tests/acceptance-tests/test_client_surface_events.cpp' |
3129 | --- tests/acceptance-tests/test_client_surface_events.cpp 2017-01-09 06:48:47 +0000 |
3130 | +++ tests/acceptance-tests/test_client_surface_events.cpp 2017-01-10 20:52:04 +0000 |
3131 | @@ -51,12 +51,56 @@ |
3132 | |
3133 | namespace |
3134 | { |
3135 | +// Assert our MirSurfaceAttrib is 1to1 to MirWindowAttrib |
3136 | +static_assert( |
3137 | + static_cast<int32_t>(mir_surface_attrib_type) == |
3138 | + static_cast<int32_t>(mir_window_attrib_type), |
3139 | + "mir_surface_attrib_type != mir_window_attrib_type"); |
3140 | + |
3141 | +static_assert( |
3142 | + static_cast<int32_t>(mir_surface_attrib_state) == |
3143 | + static_cast<int32_t>(mir_window_attrib_state), |
3144 | + "mir_surface_attrib_state != mir_window_attrib_state"); |
3145 | + |
3146 | +static_assert( |
3147 | + static_cast<int32_t>(mir_surface_attrib_swapinterval) == |
3148 | + static_cast<int32_t>(mir_window_attrib_swapinterval), |
3149 | + "mir_surface_attrib_swapinterval != mir_window_attrib_swapinterval"); |
3150 | + |
3151 | +static_assert( |
3152 | + static_cast<int32_t>(mir_surface_attrib_focus) == |
3153 | + static_cast<int32_t>(mir_window_attrib_focus), |
3154 | + "mir_surface_attrib_focus != mir_window_attrib_focus"); |
3155 | + |
3156 | +static_assert( |
3157 | + static_cast<int32_t>(mir_surface_attrib_dpi) == |
3158 | + static_cast<int32_t>(mir_window_attrib_dpi), |
3159 | + "mir_surface_attrib_dpi != mir_window_attrib_dpi"); |
3160 | + |
3161 | +static_assert( |
3162 | + static_cast<int32_t>(mir_surface_attrib_visibility) == |
3163 | + static_cast<int32_t>(mir_window_attrib_visibility), |
3164 | + "mir_surface_attrib_visibility != mir_window_attrib_visibility"); |
3165 | + |
3166 | +static_assert( |
3167 | + static_cast<int32_t>(mir_surface_attrib_preferred_orientation) == |
3168 | + static_cast<int32_t>(mir_window_attrib_preferred_orientation), |
3169 | + "mir_surface_attrib_preferred_orientation != mir_window_attrib_preferred_orientation"); |
3170 | + |
3171 | +static_assert( |
3172 | + static_cast<int32_t>(mir_surface_attribs) == |
3173 | + static_cast<int32_t>(mir_window_attribs), |
3174 | + "mir_surface_attribs != mir_window_attribs"); |
3175 | + |
3176 | +static_assert(sizeof(MirSurfaceAttrib) == sizeof(MirWindowAttrib), |
3177 | + "sizeof(MirSurfaceAttrib) != sizeof(MirWindowAttrib)"); |
3178 | + |
3179 | struct ClientSurfaceEvents : mtf::ConnectedClientWithASurface |
3180 | { |
3181 | MirSurface* other_surface; |
3182 | |
3183 | std::mutex last_event_mutex; |
3184 | - MirEventType event_filter{mir_event_type_surface}; |
3185 | + MirEventType event_filter{mir_event_type_window}; |
3186 | std::condition_variable last_event_cv; |
3187 | MirEvent const* last_event = nullptr; |
3188 | MirSurface* last_event_surface = nullptr; |
3189 | @@ -158,14 +202,14 @@ |
3190 | |
3191 | std::lock_guard<decltype(last_event_mutex)> last_event_lock{last_event_mutex}; |
3192 | |
3193 | - EXPECT_THAT(last_event, mt::SurfaceEvent(mir_surface_attrib_state, mir_surface_state_fullscreen)); |
3194 | + EXPECT_THAT(last_event, mt::WindowEvent(mir_window_attrib_state, mir_surface_state_fullscreen)); |
3195 | } |
3196 | |
3197 | { |
3198 | mir_wait_for(mir_surface_set_state(window, static_cast<MirSurfaceState>(999))); |
3199 | |
3200 | std::lock_guard<decltype(last_event_mutex)> last_event_lock{last_event_mutex}; |
3201 | - EXPECT_THAT(last_event, mt::SurfaceEvent(mir_surface_attrib_state, mir_surface_state_fullscreen)); |
3202 | + EXPECT_THAT(last_event, mt::WindowEvent(mir_window_attrib_state, mir_surface_state_fullscreen)); |
3203 | } |
3204 | |
3205 | reset_last_event(); |
3206 | @@ -175,7 +219,7 @@ |
3207 | |
3208 | std::lock_guard<decltype(last_event_mutex)> last_event_lock{last_event_mutex}; |
3209 | |
3210 | - EXPECT_THAT(last_event, mt::SurfaceEvent(mir_surface_attrib_state, mir_surface_state_vertmaximized)); |
3211 | + EXPECT_THAT(last_event, mt::WindowEvent(mir_window_attrib_state, mir_surface_state_vertmaximized)); |
3212 | } |
3213 | |
3214 | reset_last_event(); |
3215 | @@ -232,7 +276,7 @@ |
3216 | |
3217 | TEST_F(ClientSurfaceEvents, surface_receives_close_event) |
3218 | { |
3219 | - set_event_filter(mir_event_type_close_surface); |
3220 | + set_event_filter(mir_event_type_close_window); |
3221 | |
3222 | scene_surface->request_client_surface_close(); |
3223 | |
3224 | @@ -241,7 +285,7 @@ |
3225 | std::lock_guard<decltype(last_event_mutex)> last_event_lock{last_event_mutex}; |
3226 | |
3227 | EXPECT_THAT(last_event_surface, Eq(window)); |
3228 | - EXPECT_THAT(mir_event_get_type(last_event), Eq(mir_event_type_close_surface)); |
3229 | + EXPECT_THAT(mir_event_get_type(last_event), Eq(mir_event_type_close_window)); |
3230 | } |
3231 | |
3232 | TEST_F(ClientSurfaceEvents, client_can_query_preferred_orientation) |
3233 | @@ -281,7 +325,7 @@ |
3234 | |
3235 | ASSERT_FALSE(current_mode.empty()); |
3236 | |
3237 | - set_event_filter(mir_event_type_surface_output); |
3238 | + set_event_filter(mir_event_type_window_output); |
3239 | reset_last_event(); |
3240 | |
3241 | auto display_controller = server.the_display_configuration_controller(); |
3242 | @@ -291,20 +335,20 @@ |
3243 | |
3244 | std::lock_guard<decltype(last_event_mutex)> last_event_lock{last_event_mutex}; |
3245 | |
3246 | - EXPECT_THAT(mir_event_get_type(last_event), Eq(mir_event_type_surface_output)); |
3247 | - auto output_event = mir_event_get_surface_output_event(last_event); |
3248 | - |
3249 | - EXPECT_THAT(mir_surface_output_event_get_form_factor(output_event), Eq(form_factor)); |
3250 | - EXPECT_THAT(mir_surface_output_event_get_scale(output_event), FloatEq(scale)); |
3251 | - |
3252 | - auto id = mir_surface_output_event_get_output_id(output_event); |
3253 | + EXPECT_THAT(mir_event_get_type(last_event), Eq(mir_event_type_window_output)); |
3254 | + auto output_event = mir_event_get_window_output_event(last_event); |
3255 | + |
3256 | + EXPECT_THAT(mir_window_output_event_get_form_factor(output_event), Eq(form_factor)); |
3257 | + EXPECT_THAT(mir_window_output_event_get_scale(output_event), FloatEq(scale)); |
3258 | + |
3259 | + auto id = mir_window_output_event_get_output_id(output_event); |
3260 | ASSERT_THAT(current_mode.find(id), Ne(current_mode.end())); |
3261 | - EXPECT_THAT(mir_surface_output_event_get_refresh_rate(output_event), Eq(current_mode[id].vrefresh_hz)); |
3262 | + EXPECT_THAT(mir_window_output_event_get_refresh_rate(output_event), Eq(current_mode[id].vrefresh_hz)); |
3263 | } |
3264 | |
3265 | TEST_F(ClientSurfaceEvents, can_unset_surface_event_handler) |
3266 | { |
3267 | - set_event_filter(mir_event_type_close_surface); |
3268 | + set_event_filter(mir_event_type_close_window); |
3269 | |
3270 | mir_window_set_event_handler(window, nullptr, nullptr); |
3271 | scene_surface->request_client_surface_close(); |
3272 | @@ -316,17 +360,18 @@ |
3273 | { |
3274 | bool is_focus_event_with_value(MirEvent const* event, MirSurfaceFocusState state) |
3275 | { |
3276 | - if (mir_event_get_type(event) != mir_event_type_surface) |
3277 | + if (mir_event_get_type(event) != mir_event_type_window) |
3278 | { |
3279 | return false; |
3280 | } |
3281 | |
3282 | - auto surface_event = mir_event_get_surface_event(event); |
3283 | - if (mir_surface_event_get_attribute(surface_event) != mir_surface_attrib_focus) |
3284 | + auto window_event = mir_event_get_window_event(event); |
3285 | + auto attrib = mir_window_event_get_attribute(window_event); |
3286 | + if (attrib != mir_window_attrib_focus) |
3287 | { |
3288 | return false; |
3289 | } |
3290 | - return mir_surface_event_get_attribute_value(surface_event) == state; |
3291 | + return mir_window_event_get_attribute_value(window_event) == state; |
3292 | } |
3293 | |
3294 | bool is_focus_event(MirEvent const* event) |
3295 | @@ -467,7 +512,7 @@ |
3296 | |
3297 | void raise_signal_on_close_event(MirSurface*, MirEvent const* ev, void* ctx) |
3298 | { |
3299 | - if (mir_event_get_type(ev) == mir_event_type_close_surface) |
3300 | + if (mir_event_get_type(ev) == mir_event_type_close_window) |
3301 | { |
3302 | #pragma GCC diagnostic push |
3303 | #pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
3304 | @@ -521,7 +566,7 @@ |
3305 | |
3306 | void surface_output_capturing_callback(MirSurface*, MirEvent const* ev, void* ctx) |
3307 | { |
3308 | - if (mir_event_get_type(ev) == mir_event_type_surface_output) |
3309 | + if (mir_event_get_type(ev) == mir_event_type_window_output) |
3310 | { |
3311 | auto out_event = reinterpret_cast<EventContext*>(ctx); |
3312 | out_event->event = mir_event_ref(ev); |
3313 | @@ -558,7 +603,7 @@ |
3314 | |
3315 | ASSERT_FALSE(current_mode.empty()); |
3316 | |
3317 | - set_event_filter(mir_event_type_surface_output); |
3318 | + set_event_filter(mir_event_type_window_output); |
3319 | reset_last_event(); |
3320 | |
3321 | auto const display_controller = server.the_display_configuration_controller(); |
3322 | @@ -581,14 +626,14 @@ |
3323 | mir_window_spec_release(spec); |
3324 | |
3325 | ASSERT_TRUE(context.captured.wait_for(10s)); |
3326 | - ASSERT_THAT(mir_event_get_type(context.event), Eq(mir_event_type_surface_output)); |
3327 | - auto surface_event = mir_event_get_surface_output_event(context.event); |
3328 | - EXPECT_THAT(mir_surface_output_event_get_form_factor(surface_event), Eq(form_factor)); |
3329 | - EXPECT_THAT(mir_surface_output_event_get_scale(surface_event), Eq(scale)); |
3330 | - auto id = mir_surface_output_event_get_output_id(surface_event); |
3331 | + ASSERT_THAT(mir_event_get_type(context.event), Eq(mir_event_type_window_output)); |
3332 | + auto window_event = mir_event_get_window_output_event(context.event); |
3333 | + EXPECT_THAT(mir_window_output_event_get_form_factor(window_event), Eq(form_factor)); |
3334 | + EXPECT_THAT(mir_window_output_event_get_scale(window_event), Eq(scale)); |
3335 | + auto id = mir_window_output_event_get_output_id(window_event); |
3336 | EXPECT_THAT(display_ids, Contains(Eq(id))); |
3337 | ASSERT_THAT(current_mode.find(id), Ne(current_mode.end())); |
3338 | - EXPECT_THAT(mir_surface_output_event_get_refresh_rate(surface_event), |
3339 | + EXPECT_THAT(mir_window_output_event_get_refresh_rate(window_event), |
3340 | Eq(current_mode[id].vrefresh_hz)); |
3341 | |
3342 | mir_window_release_sync(window); |
3343 | |
3344 | === modified file 'tests/acceptance-tests/test_client_surface_visibility.cpp' |
3345 | --- tests/acceptance-tests/test_client_surface_visibility.cpp 2017-01-09 06:48:47 +0000 |
3346 | +++ tests/acceptance-tests/test_client_surface_visibility.cpp 2017-01-10 20:52:04 +0000 |
3347 | @@ -90,17 +90,18 @@ |
3348 | |
3349 | void event_callback(MirWindow* window, MirEvent const* event, void* ctx) |
3350 | { |
3351 | - if (mir_event_get_type(event) != mir_event_type_surface) |
3352 | + if (mir_event_get_type(event) != mir_event_type_window) |
3353 | return; |
3354 | - auto sev = mir_event_get_surface_event(event); |
3355 | - if (mir_surface_event_get_attribute(sev) != mir_surface_attrib_visibility) |
3356 | + auto sev = mir_event_get_window_event(event); |
3357 | + auto attrib = mir_window_event_get_attribute(sev); |
3358 | + if (attrib != mir_window_attrib_visibility) |
3359 | return; |
3360 | |
3361 | auto const mock_callback = |
3362 | reinterpret_cast<testing::NiceMock<MockVisibilityCallback>*>(ctx); |
3363 | mock_callback->handle( |
3364 | window, |
3365 | - static_cast<MirSurfaceVisibility>(mir_surface_event_get_attribute_value(sev))); |
3366 | + static_cast<MirSurfaceVisibility>(mir_window_event_get_attribute_value(sev))); |
3367 | } |
3368 | |
3369 | MirSurface* create_surface(MirConnection* connection, const char* name, geom::Size size, |
3370 | |
3371 | === modified file 'tests/acceptance-tests/test_client_surfaces.cpp' |
3372 | --- tests/acceptance-tests/test_client_surfaces.cpp 2017-01-09 06:48:47 +0000 |
3373 | +++ tests/acceptance-tests/test_client_surfaces.cpp 2017-01-10 20:52:04 +0000 |
3374 | @@ -176,7 +176,7 @@ |
3375 | mir_window_spec_release(spec); |
3376 | |
3377 | ASSERT_THAT(menu, IsValid()); |
3378 | - EXPECT_EQ(mir_surface_get_type(menu), mir_surface_type_menu); |
3379 | + EXPECT_EQ(mir_window_get_type(menu), mir_window_type_menu); |
3380 | |
3381 | mir_window_release_sync(parent); |
3382 | mir_window_release_sync(menu); |
3383 | @@ -196,7 +196,7 @@ |
3384 | mir_window_spec_release(spec); |
3385 | |
3386 | ASSERT_THAT(tooltip, IsValid()); |
3387 | - EXPECT_EQ(mir_surface_get_type(tooltip), mir_surface_type_tip); |
3388 | + EXPECT_EQ(mir_window_get_type(tooltip), mir_window_type_tip); |
3389 | |
3390 | mir_window_release_sync(parent); |
3391 | mir_window_release_sync(tooltip); |
3392 | @@ -212,7 +212,7 @@ |
3393 | mir_window_spec_release(spec); |
3394 | |
3395 | ASSERT_THAT(dialog, IsValid()); |
3396 | - EXPECT_EQ(mir_surface_get_type(dialog), mir_surface_type_dialog); |
3397 | + EXPECT_EQ(mir_window_get_type(dialog), mir_window_type_dialog); |
3398 | |
3399 | mir_window_release_sync(dialog); |
3400 | } |
3401 | @@ -228,7 +228,7 @@ |
3402 | mir_window_spec_release(spec); |
3403 | |
3404 | ASSERT_THAT(dialog, IsValid()); |
3405 | - EXPECT_EQ(mir_surface_get_type(dialog), mir_surface_type_dialog); |
3406 | + EXPECT_EQ(mir_window_get_type(dialog), mir_window_type_dialog); |
3407 | |
3408 | mir_window_release_sync(parent); |
3409 | mir_window_release_sync(dialog); |
3410 | @@ -243,7 +243,7 @@ |
3411 | auto im = mir_window_create_sync(spec); |
3412 | mir_window_spec_release(spec); |
3413 | |
3414 | - EXPECT_EQ(mir_surface_get_type(im), mir_surface_type_inputmethod); |
3415 | + EXPECT_EQ(mir_window_get_type(im), mir_window_type_inputmethod); |
3416 | |
3417 | mir_window_release_sync(im); |
3418 | } |
3419 | |
3420 | === modified file 'tests/acceptance-tests/test_confined_pointer.cpp' |
3421 | --- tests/acceptance-tests/test_confined_pointer.cpp 2017-01-09 06:48:47 +0000 |
3422 | +++ tests/acceptance-tests/test_confined_pointer.cpp 2017-01-10 20:52:04 +0000 |
3423 | @@ -110,16 +110,16 @@ |
3424 | mir_window_spec_release(spec); |
3425 | } |
3426 | |
3427 | - void handle_surface_event(MirSurfaceEvent const* event) |
3428 | + void handle_window_event(MirSurfaceEvent const* event) |
3429 | { |
3430 | - auto const attrib = mir_surface_event_get_attribute(event); |
3431 | - auto const value = mir_surface_event_get_attribute_value(event); |
3432 | + auto const attrib = mir_window_event_get_attribute(event); |
3433 | + auto const value = mir_window_event_get_attribute_value(event); |
3434 | |
3435 | - if (mir_surface_attrib_visibility == attrib && |
3436 | + if (mir_window_attrib_visibility == attrib && |
3437 | mir_surface_visibility_exposed == value) |
3438 | exposed = true; |
3439 | |
3440 | - if (mir_surface_attrib_focus == attrib && |
3441 | + if (mir_window_attrib_focus == attrib && |
3442 | mir_surface_focused == value) |
3443 | focused = true; |
3444 | |
3445 | @@ -133,8 +133,8 @@ |
3446 | auto type = mir_event_get_type(ev); |
3447 | switch (type) |
3448 | { |
3449 | - case mir_event_type_surface: |
3450 | - client->handle_surface_event(mir_event_get_surface_event(ev)); |
3451 | + case mir_event_type_window: |
3452 | + client->handle_window_event(mir_event_get_window_event(ev)); |
3453 | break; |
3454 | case mir_event_type_input: |
3455 | client->handle_input(ev); |
3456 | |
3457 | === modified file 'tests/acceptance-tests/test_custom_window_management.cpp' |
3458 | --- tests/acceptance-tests/test_custom_window_management.cpp 2017-01-09 06:48:47 +0000 |
3459 | +++ tests/acceptance-tests/test_custom_window_management.cpp 2017-01-10 20:52:04 +0000 |
3460 | @@ -19,6 +19,7 @@ |
3461 | #include "mir/geometry/rectangle.h" |
3462 | #include "mir/scene/session.h" |
3463 | #include "mir_toolkit/events/surface_placement.h" |
3464 | +#include "mir_toolkit/events/window_placement.h" |
3465 | #include "mir/events/event_builders.h" |
3466 | #include "mir/scene/surface.h" |
3467 | |
3468 | @@ -279,7 +280,7 @@ |
3469 | |
3470 | mt::Signal received; |
3471 | |
3472 | - EXPECT_CALL(window_manager, set_surface_attribute(_, WeakPtrEq(server_surface[i]), mir_surface_attrib_state,_)) |
3473 | + EXPECT_CALL(window_manager, set_surface_attribute(_, WeakPtrEq(server_surface[i]), mir_window_attrib_state,_)) |
3474 | .WillOnce(WithArg<3>(Invoke([&](int value) { received.raise(); return value; }))); |
3475 | |
3476 | mir_surface_set_state(client_surface[i], mir_surface_state_maximized); |
3477 | @@ -529,12 +530,12 @@ |
3478 | { |
3479 | PlacementCheck(MirRectangle const& placement) : expected_rect{placement} {} |
3480 | |
3481 | - void check(MirSurfacePlacementEvent const* placement_event) |
3482 | + void check(MirWindowPlacementEvent const* placement_event) |
3483 | { |
3484 | - EXPECT_THAT(mir_surface_placement_get_relative_position(placement_event).top, Eq(expected_rect.top)); |
3485 | - EXPECT_THAT(mir_surface_placement_get_relative_position(placement_event).left, Eq(expected_rect.left)); |
3486 | - EXPECT_THAT(mir_surface_placement_get_relative_position(placement_event).height, Eq(expected_rect.height)); |
3487 | - EXPECT_THAT(mir_surface_placement_get_relative_position(placement_event).width, Eq(expected_rect.width)); |
3488 | + EXPECT_THAT(mir_window_placement_get_relative_position(placement_event).top, Eq(expected_rect.top)); |
3489 | + EXPECT_THAT(mir_window_placement_get_relative_position(placement_event).left, Eq(expected_rect.left)); |
3490 | + EXPECT_THAT(mir_window_placement_get_relative_position(placement_event).height, Eq(expected_rect.height)); |
3491 | + EXPECT_THAT(mir_window_placement_get_relative_position(placement_event).width, Eq(expected_rect.width)); |
3492 | |
3493 | received.raise(); |
3494 | } |
3495 | @@ -551,7 +552,7 @@ |
3496 | |
3497 | void surface_placement_event_callback(MirSurface* /*window*/, MirEvent const* event, void* context) |
3498 | { |
3499 | - if (mir_event_get_type(event) == mir_event_type_surface_placement) |
3500 | + if (mir_event_get_type(event) == mir_event_type_window_placement) |
3501 | { |
3502 | auto const placement_event = mir_event_get_surface_placement_event(event); |
3503 | static_cast<PlacementCheck*>(context)->check(placement_event); |
3504 | |
3505 | === modified file 'tests/acceptance-tests/test_nested_input.cpp' |
3506 | --- tests/acceptance-tests/test_nested_input.cpp 2017-01-09 06:48:47 +0000 |
3507 | +++ tests/acceptance-tests/test_nested_input.cpp 2017-01-10 20:52:04 +0000 |
3508 | @@ -139,16 +139,16 @@ |
3509 | |
3510 | MOCK_METHOD1(handle_input, void(MirEvent const*)); |
3511 | |
3512 | - void handle_surface_event(MirSurfaceEvent const* event) |
3513 | + void handle_window_event(MirWindowEvent const* event) |
3514 | { |
3515 | - auto const attrib = mir_surface_event_get_attribute(event); |
3516 | - auto const value = mir_surface_event_get_attribute_value(event); |
3517 | + auto const attrib = mir_window_event_get_attribute(event); |
3518 | + auto const value = mir_window_event_get_attribute_value(event); |
3519 | |
3520 | - if (mir_surface_attrib_visibility == attrib && |
3521 | + if (mir_window_attrib_visibility == attrib && |
3522 | mir_surface_visibility_exposed == value) |
3523 | exposed = true; |
3524 | |
3525 | - if (mir_surface_attrib_focus == attrib && |
3526 | + if (mir_window_attrib_focus == attrib && |
3527 | mir_surface_focused == value) |
3528 | focused = true; |
3529 | |
3530 | @@ -160,10 +160,10 @@ |
3531 | { |
3532 | auto const client = static_cast<ExposedSurface*>(context); |
3533 | auto type = mir_event_get_type(ev); |
3534 | - if (type == mir_event_type_surface) |
3535 | + if (type == mir_event_type_window) |
3536 | { |
3537 | - auto surface_event = mir_event_get_surface_event(ev); |
3538 | - client->handle_surface_event(surface_event); |
3539 | + auto window_event = mir_event_get_window_event(ev); |
3540 | + client->handle_window_event(window_event); |
3541 | |
3542 | } |
3543 | if (type == mir_event_type_input) |
3544 | |
3545 | === modified file 'tests/acceptance-tests/test_nested_mir.cpp' |
3546 | --- tests/acceptance-tests/test_nested_mir.cpp 2017-01-09 06:48:47 +0000 |
3547 | +++ tests/acceptance-tests/test_nested_mir.cpp 2017-01-10 20:52:04 +0000 |
3548 | @@ -364,7 +364,7 @@ |
3549 | int set_surface_attribute( |
3550 | std::shared_ptr<msc::Session> const& session, |
3551 | std::shared_ptr<msc::Surface> const& window, |
3552 | - MirSurfaceAttrib attrib, |
3553 | + MirWindowAttrib attrib, |
3554 | int value) override |
3555 | { |
3556 | return wrapped->set_surface_attribute(session, window, attrib, value); |
3557 | @@ -372,7 +372,7 @@ |
3558 | |
3559 | int get_surface_attribute( |
3560 | std::shared_ptr<msc::Surface> const& window, |
3561 | - MirSurfaceAttrib attrib) override |
3562 | + MirWindowAttrib attrib) override |
3563 | { |
3564 | return wrapped->get_surface_attribute(window, attrib); |
3565 | } |
3566 | @@ -778,11 +778,11 @@ |
3567 | mt::Signal surface_event_received; |
3568 | mir_window_spec_set_event_handler(spec, [](MirSurface*, MirEvent const* event, void* ctx) |
3569 | { |
3570 | - if (mir_event_get_type(event) == mir_event_type_surface_output) |
3571 | + if (mir_event_get_type(event) == mir_event_type_window_output) |
3572 | { |
3573 | - auto surface_event = mir_event_get_surface_output_event(event); |
3574 | - EXPECT_THAT(mir_surface_output_event_get_form_factor(surface_event), Eq(expected_form_factor)); |
3575 | - EXPECT_THAT(mir_surface_output_event_get_scale(surface_event), Eq(expected_scale)); |
3576 | + auto surface_event = mir_event_get_window_output_event(event); |
3577 | + EXPECT_THAT(mir_window_output_event_get_form_factor(surface_event), Eq(expected_form_factor)); |
3578 | + EXPECT_THAT(mir_window_output_event_get_scale(surface_event), Eq(expected_scale)); |
3579 | auto signal = static_cast<mt::Signal*>(ctx); |
3580 | signal->raise(); |
3581 | } |
3582 | |
3583 | === modified file 'tests/acceptance-tests/test_new_display_configuration.cpp' |
3584 | --- tests/acceptance-tests/test_new_display_configuration.cpp 2017-01-09 06:48:47 +0000 |
3585 | +++ tests/acceptance-tests/test_new_display_configuration.cpp 2017-01-10 20:52:04 +0000 |
3586 | @@ -281,14 +281,14 @@ |
3587 | { |
3588 | auto const client = static_cast<SimpleClient*>(context); |
3589 | auto type = mir_event_get_type(ev); |
3590 | - if (type == mir_event_type_surface) |
3591 | + if (type == mir_event_type_window) |
3592 | { |
3593 | - auto surface_event = mir_event_get_surface_event(ev); |
3594 | - auto const attrib = mir_surface_event_get_attribute(surface_event); |
3595 | - auto const value = mir_surface_event_get_attribute_value(surface_event); |
3596 | + auto window_event = mir_event_get_window_event(ev); |
3597 | + auto const attrib = mir_window_event_get_attribute(window_event); |
3598 | + auto const value = mir_window_event_get_attribute_value(window_event); |
3599 | |
3600 | std::lock_guard<std::mutex> lk(client->mutex); |
3601 | - if (mir_surface_attrib_focus == attrib && |
3602 | + if (mir_window_attrib_focus == attrib && |
3603 | mir_surface_focused == value) |
3604 | client->ready_to_accept_events.raise(); |
3605 | } |
3606 | |
3607 | === modified file 'tests/acceptance-tests/test_surface_morphing.cpp' |
3608 | --- tests/acceptance-tests/test_surface_morphing.cpp 2017-01-09 06:48:47 +0000 |
3609 | +++ tests/acceptance-tests/test_surface_morphing.cpp 2017-01-10 20:52:04 +0000 |
3610 | @@ -57,7 +57,7 @@ |
3611 | { |
3612 | public: |
3613 | MOCK_METHOD1(renamed, void(char const*)); |
3614 | - MOCK_METHOD2(attrib_changed, void(MirSurfaceAttrib attrib, int value)); |
3615 | + MOCK_METHOD2(attrib_changed, void(MirWindowAttrib attrib, int value)); |
3616 | }; |
3617 | |
3618 | struct SurfaceMorphing : mtf::ConnectedClientHeadlessServer |
3619 | @@ -158,8 +158,8 @@ |
3620 | |
3621 | struct TypePair |
3622 | { |
3623 | - MirSurfaceType from; |
3624 | - MirSurfaceType to; |
3625 | + MirWindowType from; |
3626 | + MirWindowType to; |
3627 | |
3628 | friend std::ostream& operator<<(std::ostream& out, TypePair const& types) |
3629 | { return out << "from:" << types.from << ", to:" << types.to; } |
3630 | @@ -187,7 +187,7 @@ |
3631 | |
3632 | latest_shell_surface()->add_observer(mt::fake_shared(surface_observer)); |
3633 | |
3634 | - EXPECT_CALL(surface_observer, attrib_changed(mir_surface_attrib_type, new_type)). |
3635 | + EXPECT_CALL(surface_observer, attrib_changed(mir_window_attrib_type, new_type)). |
3636 | WillOnce(InvokeWithoutArgs([&] { change_observed(); })); |
3637 | |
3638 | change_surface(window, [&](MirWindowSpec* spec) |
3639 | @@ -203,7 +203,7 @@ |
3640 | |
3641 | auto const parent = create_surface([&](MirWindowSpec* spec) |
3642 | { |
3643 | - mir_window_spec_set_type(spec, mir_surface_type_normal); |
3644 | + mir_window_spec_set_type(spec, mir_window_type_normal); |
3645 | mir_window_spec_set_width(spec, width); |
3646 | mir_window_spec_set_height(spec, height); |
3647 | mir_window_spec_set_pixel_format(spec, pixel_format); |
3648 | @@ -221,7 +221,7 @@ |
3649 | |
3650 | latest_shell_surface()->add_observer(mt::fake_shared(surface_observer)); |
3651 | |
3652 | - EXPECT_CALL(surface_observer, attrib_changed(mir_surface_attrib_type, new_type)). |
3653 | + EXPECT_CALL(surface_observer, attrib_changed(mir_window_attrib_type, new_type)). |
3654 | Times(0); |
3655 | |
3656 | change_surface(window, [&](MirWindowSpec* spec) |
3657 | @@ -244,7 +244,7 @@ |
3658 | |
3659 | auto const parent = create_surface([&](MirWindowSpec* spec) |
3660 | { |
3661 | - mir_window_spec_set_type(spec, mir_surface_type_normal); |
3662 | + mir_window_spec_set_type(spec, mir_window_type_normal); |
3663 | mir_window_spec_set_width(spec, width); |
3664 | mir_window_spec_set_height(spec, height); |
3665 | mir_window_spec_set_pixel_format(spec, pixel_format); |
3666 | @@ -262,7 +262,7 @@ |
3667 | |
3668 | latest_shell_surface()->add_observer(mt::fake_shared(surface_observer)); |
3669 | |
3670 | - EXPECT_CALL(surface_observer, attrib_changed(mir_surface_attrib_type, new_type)). |
3671 | + EXPECT_CALL(surface_observer, attrib_changed(mir_window_attrib_type, new_type)). |
3672 | WillOnce(InvokeWithoutArgs([&] { change_observed(); })); |
3673 | |
3674 | change_surface(window, [&](MirWindowSpec* spec) |
3675 | @@ -288,7 +288,7 @@ |
3676 | |
3677 | latest_shell_surface()->add_observer(mt::fake_shared(surface_observer)); |
3678 | |
3679 | - EXPECT_CALL(surface_observer, attrib_changed(mir_surface_attrib_type, new_type)). |
3680 | + EXPECT_CALL(surface_observer, attrib_changed(mir_window_attrib_type, new_type)). |
3681 | Times(0); |
3682 | |
3683 | change_surface(window, [&](MirWindowSpec* spec) |
3684 | @@ -310,7 +310,7 @@ |
3685 | |
3686 | auto const parent = create_surface([&](MirWindowSpec* spec) |
3687 | { |
3688 | - mir_window_spec_set_type(spec, mir_surface_type_normal); |
3689 | + mir_window_spec_set_type(spec, mir_window_type_normal); |
3690 | mir_window_spec_set_width(spec, width); |
3691 | mir_window_spec_set_height(spec, height); |
3692 | mir_window_spec_set_pixel_format(spec, pixel_format); |
3693 | @@ -328,7 +328,7 @@ |
3694 | |
3695 | latest_shell_surface()->add_observer(mt::fake_shared(surface_observer)); |
3696 | |
3697 | - EXPECT_CALL(surface_observer, attrib_changed(mir_surface_attrib_type, new_type)). |
3698 | + EXPECT_CALL(surface_observer, attrib_changed(mir_window_attrib_type, new_type)). |
3699 | WillOnce(InvokeWithoutArgs([&] { change_observed(); })); |
3700 | |
3701 | change_surface(window, [&](MirWindowSpec* spec) |
3702 | @@ -345,7 +345,7 @@ |
3703 | |
3704 | auto const parent = create_surface([&](MirWindowSpec* spec) |
3705 | { |
3706 | - mir_window_spec_set_type(spec, mir_surface_type_normal); |
3707 | + mir_window_spec_set_type(spec, mir_window_type_normal); |
3708 | mir_window_spec_set_width(spec, width); |
3709 | mir_window_spec_set_height(spec, height); |
3710 | mir_window_spec_set_pixel_format(spec, pixel_format); |
3711 | @@ -363,7 +363,7 @@ |
3712 | |
3713 | latest_shell_surface()->add_observer(mt::fake_shared(surface_observer)); |
3714 | |
3715 | - EXPECT_CALL(surface_observer, attrib_changed(mir_surface_attrib_type, new_type)). |
3716 | + EXPECT_CALL(surface_observer, attrib_changed(mir_window_attrib_type, new_type)). |
3717 | WillOnce(InvokeWithoutArgs([&] { change_observed(); })); |
3718 | |
3719 | |
3720 | @@ -375,21 +375,21 @@ |
3721 | |
3722 | INSTANTIATE_TEST_CASE_P(SurfaceMorphing, TargetWithoutParent, |
3723 | Values( |
3724 | - TypePair{mir_surface_type_normal, mir_surface_type_utility}, |
3725 | - TypePair{mir_surface_type_utility, mir_surface_type_normal}, |
3726 | - TypePair{mir_surface_type_dialog, mir_surface_type_utility}, |
3727 | - TypePair{mir_surface_type_dialog, mir_surface_type_normal} |
3728 | + TypePair{mir_window_type_normal, mir_window_type_utility}, |
3729 | + TypePair{mir_window_type_utility, mir_window_type_normal}, |
3730 | + TypePair{mir_window_type_dialog, mir_window_type_utility}, |
3731 | + TypePair{mir_window_type_dialog, mir_window_type_normal} |
3732 | )); |
3733 | |
3734 | INSTANTIATE_TEST_CASE_P(SurfaceMorphing, TargetNeedingParent, |
3735 | Values( |
3736 | - TypePair{mir_surface_type_normal, mir_surface_type_satellite}, |
3737 | - TypePair{mir_surface_type_utility, mir_surface_type_satellite}, |
3738 | - TypePair{mir_surface_type_dialog, mir_surface_type_satellite} |
3739 | + TypePair{mir_window_type_normal, mir_window_type_satellite}, |
3740 | + TypePair{mir_window_type_utility, mir_window_type_satellite}, |
3741 | + TypePair{mir_window_type_dialog, mir_window_type_satellite} |
3742 | )); |
3743 | |
3744 | INSTANTIATE_TEST_CASE_P(SurfaceMorphing, TargetMayHaveParent, |
3745 | Values( |
3746 | - TypePair{mir_surface_type_normal, mir_surface_type_dialog}, |
3747 | - TypePair{mir_surface_type_utility, mir_surface_type_dialog} |
3748 | + TypePair{mir_window_type_normal, mir_window_type_dialog}, |
3749 | + TypePair{mir_window_type_utility, mir_window_type_dialog} |
3750 | )); |
3751 | |
3752 | === modified file 'tests/acceptance-tests/test_surface_placement.cpp' |
3753 | --- tests/acceptance-tests/test_surface_placement.cpp 2017-01-09 06:48:47 +0000 |
3754 | +++ tests/acceptance-tests/test_surface_placement.cpp 2017-01-10 20:52:04 +0000 |
3755 | @@ -461,7 +461,7 @@ |
3756 | mir_window_release_sync(window); |
3757 | } |
3758 | |
3759 | -struct UnparentedSurface : SurfacePlacement, ::testing::WithParamInterface<MirSurfaceType> {}; |
3760 | +struct UnparentedSurface : SurfacePlacement, ::testing::WithParamInterface<MirWindowType> {}; |
3761 | |
3762 | TEST_P(UnparentedSurface, small_window_is_optically_centered_on_first_display) |
3763 | { |
3764 | @@ -494,10 +494,10 @@ |
3765 | |
3766 | INSTANTIATE_TEST_CASE_P(SurfacePlacement, UnparentedSurface, |
3767 | ::testing::Values( |
3768 | - mir_surface_type_normal, |
3769 | - mir_surface_type_utility, |
3770 | - mir_surface_type_dialog, |
3771 | - mir_surface_type_freestyle)); |
3772 | + mir_window_type_normal, |
3773 | + mir_window_type_utility, |
3774 | + mir_window_type_dialog, |
3775 | + mir_window_type_freestyle)); |
3776 | |
3777 | // Parented dialog or parented freestyle window |
3778 | // |
3779 | @@ -519,7 +519,7 @@ |
3780 | // relative to its parent |
3781 | // TODO tests for this |
3782 | |
3783 | -struct ParentedSurface : SurfacePlacement, ::testing::WithParamInterface<MirSurfaceType> {}; |
3784 | +struct ParentedSurface : SurfacePlacement, ::testing::WithParamInterface<MirWindowType> {}; |
3785 | |
3786 | TEST_P(ParentedSurface, small_window_is_optically_centered_on_parent) |
3787 | { |
3788 | @@ -557,9 +557,9 @@ |
3789 | |
3790 | INSTANTIATE_TEST_CASE_P(SurfacePlacement, ParentedSurface, |
3791 | ::testing::Values( |
3792 | - mir_surface_type_dialog, |
3793 | - mir_surface_type_satellite, |
3794 | - mir_surface_type_popover, |
3795 | - mir_surface_type_gloss, |
3796 | - mir_surface_type_tip, |
3797 | - mir_surface_type_freestyle)); |
3798 | + mir_window_type_dialog, |
3799 | + mir_window_type_satellite, |
3800 | + mir_window_type_popover, |
3801 | + mir_window_type_gloss, |
3802 | + mir_window_type_tip, |
3803 | + mir_window_type_freestyle)); |
3804 | |
3805 | === modified file 'tests/acceptance-tests/test_surface_raise.cpp' |
3806 | --- tests/acceptance-tests/test_surface_raise.cpp 2017-01-09 20:01:45 +0000 |
3807 | +++ tests/acceptance-tests/test_surface_raise.cpp 2017-01-10 20:52:04 +0000 |
3808 | @@ -112,21 +112,21 @@ |
3809 | auto const event_type = mir_event_get_type(ev); |
3810 | auto raise_surfaces = static_cast<RaiseSurfaces*>(ctx); |
3811 | |
3812 | - if (event_type == mir_event_type_surface) |
3813 | + if (event_type == mir_event_type_window) |
3814 | { |
3815 | - auto event = mir_event_get_surface_event(ev); |
3816 | - auto const attrib = mir_surface_event_get_attribute(event); |
3817 | - auto const value = mir_surface_event_get_attribute_value(event); |
3818 | + auto event = mir_event_get_window_event(ev); |
3819 | + auto const attrib = mir_window_event_get_attribute(event); |
3820 | + auto const value = mir_window_event_get_attribute_value(event); |
3821 | |
3822 | std::lock_guard<std::mutex> lk(raise_surfaces->mutex); |
3823 | |
3824 | - if (attrib == mir_surface_attrib_visibility && |
3825 | + if (attrib == mir_window_attrib_visibility && |
3826 | value == mir_surface_visibility_exposed) |
3827 | { |
3828 | raise_surfaces->exposed = true; |
3829 | } |
3830 | |
3831 | - if (attrib == mir_surface_attrib_focus && |
3832 | + if (attrib == mir_window_attrib_focus && |
3833 | value == mir_surface_focused) |
3834 | { |
3835 | raise_surfaces->focused = true; |
3836 | |
3837 | === modified file 'tests/acceptance-tests/test_surface_specification.cpp' |
3838 | --- tests/acceptance-tests/test_surface_specification.cpp 2017-01-09 06:48:47 +0000 |
3839 | +++ tests/acceptance-tests/test_surface_specification.cpp 2017-01-10 20:52:04 +0000 |
3840 | @@ -48,7 +48,7 @@ |
3841 | { |
3842 | public: |
3843 | MOCK_METHOD1(renamed, void(char const*)); |
3844 | - MOCK_METHOD2(attrib_changed, void(MirSurfaceAttrib attrib, int value)); |
3845 | + MOCK_METHOD2(attrib_changed, void(MirWindowAttrib attrib, int value)); |
3846 | MOCK_METHOD1(resized_to, void(Size const& size)); |
3847 | }; |
3848 | |
3849 | @@ -179,7 +179,7 @@ |
3850 | } |
3851 | }; |
3852 | |
3853 | -struct SurfaceSpecificationCase : SurfaceSpecification, ::testing::WithParamInterface<MirSurfaceType> {}; |
3854 | +struct SurfaceSpecificationCase : SurfaceSpecification, ::testing::WithParamInterface<MirWindowType> {}; |
3855 | using SurfaceWithoutParent = SurfaceSpecificationCase; |
3856 | using SurfaceNeedingParent = SurfaceSpecificationCase; |
3857 | using SurfaceMayHaveParent = SurfaceSpecificationCase; |
3858 | @@ -210,7 +210,7 @@ |
3859 | |
3860 | auto const surface = create_surface([&](MirWindowSpec* spec) |
3861 | { |
3862 | - mir_window_spec_set_type(spec, mir_surface_type_normal); |
3863 | + mir_window_spec_set_type(spec, mir_window_type_normal); |
3864 | mir_window_spec_set_width(spec, width); |
3865 | mir_window_spec_set_height(spec, height); |
3866 | mir_window_spec_set_pixel_format(spec, pixel_format); |
3867 | @@ -235,7 +235,7 @@ |
3868 | |
3869 | auto const surface = create_surface([&](MirWindowSpec* spec) |
3870 | { |
3871 | - mir_window_spec_set_type(spec, mir_surface_type_normal); |
3872 | + mir_window_spec_set_type(spec, mir_window_type_normal); |
3873 | mir_window_spec_set_width(spec, width); |
3874 | mir_window_spec_set_height(spec, height); |
3875 | mir_window_spec_set_pixel_format(spec, pixel_format); |
3876 | @@ -260,7 +260,7 @@ |
3877 | |
3878 | auto const surface = create_surface([&](MirWindowSpec* spec) |
3879 | { |
3880 | - mir_window_spec_set_type(spec, mir_surface_type_normal); |
3881 | + mir_window_spec_set_type(spec, mir_window_type_normal); |
3882 | mir_window_spec_set_width(spec, width); |
3883 | mir_window_spec_set_height(spec, height); |
3884 | mir_window_spec_set_pixel_format(spec, pixel_format); |
3885 | @@ -285,7 +285,7 @@ |
3886 | |
3887 | auto const surface = create_surface([&](MirWindowSpec* spec) |
3888 | { |
3889 | - mir_window_spec_set_type(spec, mir_surface_type_normal); |
3890 | + mir_window_spec_set_type(spec, mir_window_type_normal); |
3891 | mir_window_spec_set_width(spec, width); |
3892 | mir_window_spec_set_height(spec, height); |
3893 | mir_window_spec_set_pixel_format(spec, pixel_format); |
3894 | @@ -310,7 +310,7 @@ |
3895 | |
3896 | auto const surface = create_surface([&](MirWindowSpec* spec) |
3897 | { |
3898 | - mir_window_spec_set_type(spec, mir_surface_type_normal); |
3899 | + mir_window_spec_set_type(spec, mir_window_type_normal); |
3900 | mir_window_spec_set_width(spec, width); |
3901 | mir_window_spec_set_height(spec, height); |
3902 | mir_window_spec_set_pixel_format(spec, pixel_format); |
3903 | @@ -339,7 +339,7 @@ |
3904 | |
3905 | auto const surface = create_surface([&](MirWindowSpec* spec) |
3906 | { |
3907 | - mir_window_spec_set_type(spec, mir_surface_type_normal); |
3908 | + mir_window_spec_set_type(spec, mir_window_type_normal); |
3909 | mir_window_spec_set_width(spec, width); |
3910 | mir_window_spec_set_height(spec, height); |
3911 | mir_window_spec_set_pixel_format(spec, pixel_format); |
3912 | @@ -368,7 +368,7 @@ |
3913 | |
3914 | auto const surface = create_surface([&](MirWindowSpec* spec) |
3915 | { |
3916 | - mir_window_spec_set_type(spec, mir_surface_type_normal); |
3917 | + mir_window_spec_set_type(spec, mir_window_type_normal); |
3918 | mir_window_spec_set_width(spec, width); |
3919 | mir_window_spec_set_height(spec, height); |
3920 | mir_window_spec_set_pixel_format(spec, pixel_format); |
3921 | @@ -397,7 +397,7 @@ |
3922 | |
3923 | auto const surface = create_surface([&](MirWindowSpec* spec) |
3924 | { |
3925 | - mir_window_spec_set_type(spec, mir_surface_type_normal); |
3926 | + mir_window_spec_set_type(spec, mir_window_type_normal); |
3927 | mir_window_spec_set_width(spec, width); |
3928 | mir_window_spec_set_height(spec, height); |
3929 | mir_window_spec_set_pixel_format(spec, pixel_format); |
3930 | @@ -427,7 +427,7 @@ |
3931 | |
3932 | auto const surface = create_surface([&](MirWindowSpec* spec) |
3933 | { |
3934 | - mir_window_spec_set_type(spec, mir_surface_type_normal); |
3935 | + mir_window_spec_set_type(spec, mir_window_type_normal); |
3936 | mir_window_spec_set_width(spec, width); |
3937 | mir_window_spec_set_height(spec, height); |
3938 | mir_window_spec_set_pixel_format(spec, pixel_format); |
3939 | @@ -457,7 +457,7 @@ |
3940 | |
3941 | auto const surface = create_surface([&](MirWindowSpec* spec) |
3942 | { |
3943 | - mir_window_spec_set_type(spec, mir_surface_type_normal); |
3944 | + mir_window_spec_set_type(spec, mir_window_type_normal); |
3945 | mir_window_spec_set_width(spec, width); |
3946 | mir_window_spec_set_height(spec, height); |
3947 | mir_window_spec_set_pixel_format(spec, pixel_format); |
3948 | @@ -494,7 +494,7 @@ |
3949 | |
3950 | auto const surface = create_surface([&](MirWindowSpec* spec) |
3951 | { |
3952 | - mir_window_spec_set_type(spec, mir_surface_type_normal); |
3953 | + mir_window_spec_set_type(spec, mir_window_type_normal); |
3954 | mir_window_spec_set_width(spec, width); |
3955 | mir_window_spec_set_height(spec, height); |
3956 | mir_window_spec_set_pixel_format(spec, pixel_format); |
3957 | @@ -564,7 +564,7 @@ |
3958 | |
3959 | auto const parent = create_surface([&](MirWindowSpec* spec) |
3960 | { |
3961 | - mir_window_spec_set_type(spec, mir_surface_type_normal); |
3962 | + mir_window_spec_set_type(spec, mir_window_type_normal); |
3963 | mir_window_spec_set_width(spec, width); |
3964 | mir_window_spec_set_height(spec, height); |
3965 | mir_window_spec_set_pixel_format(spec, pixel_format); |
3966 | @@ -590,7 +590,7 @@ |
3967 | |
3968 | auto const parent = create_surface([&](MirWindowSpec* spec) |
3969 | { |
3970 | - mir_window_spec_set_type(spec, mir_surface_type_normal); |
3971 | + mir_window_spec_set_type(spec, mir_window_type_normal); |
3972 | mir_window_spec_set_width(spec, width); |
3973 | mir_window_spec_set_height(spec, height); |
3974 | mir_window_spec_set_pixel_format(spec, pixel_format); |
3975 | @@ -632,7 +632,7 @@ |
3976 | |
3977 | auto const parent = create_surface([&](MirWindowSpec* spec) |
3978 | { |
3979 | - mir_window_spec_set_type(spec, mir_surface_type_normal); |
3980 | + mir_window_spec_set_type(spec, mir_window_type_normal); |
3981 | mir_window_spec_set_width(spec, width); |
3982 | mir_window_spec_set_height(spec, height); |
3983 | mir_window_spec_set_pixel_format(spec, pixel_format); |
3984 | @@ -669,10 +669,10 @@ |
3985 | } |
3986 | |
3987 | INSTANTIATE_TEST_CASE_P(SurfaceSpecification, SurfaceWithoutParent, |
3988 | - Values(mir_surface_type_utility, mir_surface_type_normal)); |
3989 | + Values(mir_window_type_utility, mir_window_type_normal)); |
3990 | |
3991 | INSTANTIATE_TEST_CASE_P(SurfaceSpecification, SurfaceNeedingParent, |
3992 | - Values(mir_surface_type_satellite, mir_surface_type_gloss, mir_surface_type_tip)); |
3993 | + Values(mir_window_type_satellite, mir_window_type_gloss, mir_window_type_tip)); |
3994 | |
3995 | INSTANTIATE_TEST_CASE_P(SurfaceSpecification, SurfaceMayHaveParent, |
3996 | - Values(mir_surface_type_dialog, mir_surface_type_freestyle)); |
3997 | + Values(mir_window_type_dialog, mir_window_type_freestyle)); |
3998 | |
3999 | === modified file 'tests/acceptance-tests/test_system_compositor_window_manager.cpp' |
4000 | --- tests/acceptance-tests/test_system_compositor_window_manager.cpp 2017-01-09 06:48:47 +0000 |
4001 | +++ tests/acceptance-tests/test_system_compositor_window_manager.cpp 2017-01-10 20:52:04 +0000 |
4002 | @@ -174,14 +174,14 @@ |
4003 | |
4004 | MATCHER_P(MirFocusEvent, expected, "") |
4005 | { |
4006 | - if (mir_event_get_type(arg) != mir_event_type_surface) |
4007 | + if (mir_event_get_type(arg) != mir_event_type_window) |
4008 | return false; |
4009 | |
4010 | - auto surface_event = mir_event_get_surface_event(arg); |
4011 | - auto attrib = mir_surface_event_get_attribute(surface_event); |
4012 | - auto value = mir_surface_event_get_attribute_value(surface_event); |
4013 | + auto window_event = mir_event_get_window_event(arg); |
4014 | + auto attrib = mir_window_event_get_attribute(window_event); |
4015 | + auto value = mir_window_event_get_attribute_value(window_event); |
4016 | |
4017 | - return (attrib == mir_surface_attrib_focus) |
4018 | + return (attrib == mir_window_attrib_focus) |
4019 | && (value == expected); |
4020 | } |
4021 | } |
4022 | |
4023 | === modified file 'tests/acceptance-tests/throwback/test_shell_control_of_surface_configuration.cpp' |
4024 | --- tests/acceptance-tests/throwback/test_shell_control_of_surface_configuration.cpp 2017-01-09 06:48:47 +0000 |
4025 | +++ tests/acceptance-tests/throwback/test_shell_control_of_surface_configuration.cpp 2017-01-10 20:52:04 +0000 |
4026 | @@ -42,12 +42,12 @@ |
4027 | MOCK_METHOD4(set_surface_attribute, |
4028 | int(std::shared_ptr<ms::Session> const& session, |
4029 | std::shared_ptr<ms::Surface> const& surface, |
4030 | - MirSurfaceAttrib attrib, |
4031 | + MirWindowAttrib attrib, |
4032 | int value)); |
4033 | |
4034 | int real_set_surface_attribute(std::shared_ptr<ms::Session> const& session, |
4035 | std::shared_ptr<ms::Surface> const& surface, |
4036 | - MirSurfaceAttrib attrib, |
4037 | + MirWindowAttrib attrib, |
4038 | int value) |
4039 | { |
4040 | return msh::CanonicalWindowManager::set_surface_attribute(session, surface, attrib, value); |
4041 | @@ -70,7 +70,7 @@ |
4042 | mock_window_manager.get(), &MockWindowManager::real_set_surface_attribute)); |
4043 | |
4044 | EXPECT_CALL(*mock_window_manager, |
4045 | - set_surface_attribute(_, _, Ne(mir_surface_attrib_state), _)) |
4046 | + set_surface_attribute(_, _, Ne(mir_window_attrib_state), _)) |
4047 | .Times(AnyNumber()); |
4048 | |
4049 | return mock_window_manager; |
4050 | @@ -86,7 +86,7 @@ |
4051 | TEST_F(ShellSurfaceConfiguration, the_window_manager_is_notified_of_attribute_changes) |
4052 | { |
4053 | EXPECT_CALL(*mock_window_manager, |
4054 | - set_surface_attribute(_, _, mir_surface_attrib_state, Eq(mir_surface_state_maximized))); |
4055 | + set_surface_attribute(_, _, mir_window_attrib_state, Eq(mir_surface_state_maximized))); |
4056 | |
4057 | mir_wait_for(mir_surface_set_state(window, mir_surface_state_maximized)); |
4058 | |
4059 | @@ -98,7 +98,7 @@ |
4060 | auto const set_to_vertmax = [this]( |
4061 | std::shared_ptr<ms::Session> const& session, |
4062 | std::shared_ptr<ms::Surface> const& surface, |
4063 | - MirSurfaceAttrib attrib, |
4064 | + MirWindowAttrib attrib, |
4065 | int /*value*/) |
4066 | { |
4067 | return mock_window_manager->real_set_surface_attribute( |
4068 | @@ -106,7 +106,7 @@ |
4069 | }; |
4070 | |
4071 | EXPECT_CALL(*mock_window_manager, |
4072 | - set_surface_attribute(_, _, mir_surface_attrib_state, Eq(mir_surface_state_maximized))) |
4073 | + set_surface_attribute(_, _, mir_window_attrib_state, Eq(mir_surface_state_maximized))) |
4074 | .WillOnce(Invoke(set_to_vertmax)); |
4075 | |
4076 | mir_wait_for(mir_surface_set_state(window, mir_surface_state_maximized)); |
4077 | |
4078 | === modified file 'tests/include/mir/test/doubles/mock_egl_native_surface.h' |
4079 | --- tests/include/mir/test/doubles/mock_egl_native_surface.h 2017-01-09 06:48:47 +0000 |
4080 | +++ tests/include/mir/test/doubles/mock_egl_native_surface.h 2017-01-10 20:52:04 +0000 |
4081 | @@ -35,7 +35,7 @@ |
4082 | MOCK_CONST_METHOD0(get_parameters, MirWindowParameters()); |
4083 | MOCK_METHOD0(get_current_buffer, std::shared_ptr<client::ClientBuffer>()); |
4084 | MOCK_METHOD0(swap_buffers_sync, void()); |
4085 | - MOCK_METHOD2(request_and_wait_for_configure, void(MirSurfaceAttrib,int)); |
4086 | + MOCK_METHOD2(request_and_wait_for_configure, void(MirWindowAttrib,int)); |
4087 | MOCK_METHOD1(set_buffer_cache_size, void(unsigned int)); |
4088 | }; |
4089 | |
4090 | |
4091 | === modified file 'tests/include/mir/test/doubles/mock_frontend_surface.h' |
4092 | --- tests/include/mir/test/doubles/mock_frontend_surface.h 2015-06-18 02:46:16 +0000 |
4093 | +++ tests/include/mir/test/doubles/mock_frontend_surface.h 2017-01-10 20:52:04 +0000 |
4094 | @@ -63,9 +63,9 @@ |
4095 | MOCK_METHOD1(set_cursor_image, void(std::shared_ptr<graphics::CursorImage> const&)); |
4096 | MOCK_METHOD2(set_cursor_stream, void(std::shared_ptr<frontend::BufferStream> const&, geometry::Displacement const&)); |
4097 | |
4098 | - MOCK_METHOD2(configure, int(MirSurfaceAttrib, int)); |
4099 | + MOCK_METHOD2(configure, int(MirWindowAttrib, int)); |
4100 | |
4101 | - MOCK_CONST_METHOD1(query, int(MirSurfaceAttrib)); |
4102 | + MOCK_CONST_METHOD1(query, int(MirWindowAttrib)); |
4103 | |
4104 | MOCK_METHOD1(add_observer, void(std::shared_ptr<scene::SurfaceObserver> const&)); |
4105 | MOCK_METHOD1(remove_observer, void(std::weak_ptr<scene::SurfaceObserver> const&)); |
4106 | |
4107 | === modified file 'tests/include/mir/test/doubles/mock_scene_session.h' |
4108 | --- tests/include/mir/test/doubles/mock_scene_session.h 2016-09-29 03:56:21 +0000 |
4109 | +++ tests/include/mir/test/doubles/mock_scene_session.h 2017-01-10 20:52:04 +0000 |
4110 | @@ -59,7 +59,7 @@ |
4111 | MOCK_METHOD1(send_display_config, void(graphics::DisplayConfiguration const&)); |
4112 | MOCK_METHOD1(send_error, void(ClientVisibleError const&)); |
4113 | MOCK_METHOD1(send_input_device_change, void(std::vector<std::shared_ptr<mir::input::Device>> const&)); |
4114 | - MOCK_METHOD3(configure_surface, int(frontend::SurfaceId, MirSurfaceAttrib, int)); |
4115 | + MOCK_METHOD3(configure_surface, int(frontend::SurfaceId, MirWindowAttrib, int)); |
4116 | |
4117 | MOCK_METHOD1(set_lifecycle_state, void(MirLifecycleState state)); |
4118 | |
4119 | |
4120 | === modified file 'tests/include/mir/test/doubles/mock_shell.h' |
4121 | --- tests/include/mir/test/doubles/mock_shell.h 2016-01-29 08:18:22 +0000 |
4122 | +++ tests/include/mir/test/doubles/mock_shell.h 2017-01-10 20:52:04 +0000 |
4123 | @@ -65,10 +65,10 @@ |
4124 | |
4125 | MOCK_METHOD4(set_surface_attribute, int( |
4126 | std::shared_ptr<frontend::Session> const& session, frontend::SurfaceId surface_id, |
4127 | - MirSurfaceAttrib attrib, int value)); |
4128 | + MirWindowAttrib attrib, int value)); |
4129 | |
4130 | MOCK_METHOD3(get_surface_attribute, int(std::shared_ptr<frontend::Session> const& session, |
4131 | - frontend::SurfaceId surface_id, MirSurfaceAttrib attrib)); |
4132 | + frontend::SurfaceId surface_id, MirWindowAttrib attrib)); |
4133 | |
4134 | MOCK_METHOD3(raise_surface, void(std::shared_ptr<frontend::Session> const& session, |
4135 | frontend::SurfaceId surface_id, uint64_t timestamp)); |
4136 | |
4137 | === modified file 'tests/include/mir/test/doubles/mock_surface.h' |
4138 | --- tests/include/mir/test/doubles/mock_surface.h 2016-08-25 08:16:10 +0000 |
4139 | +++ tests/include/mir/test/doubles/mock_surface.h 2017-01-10 20:52:04 +0000 |
4140 | @@ -69,7 +69,7 @@ |
4141 | MOCK_CONST_METHOD0(supports_input, bool()); |
4142 | MOCK_CONST_METHOD0(client_input_fd, int()); |
4143 | |
4144 | - MOCK_METHOD2(configure, int(MirSurfaceAttrib, int)); |
4145 | + MOCK_METHOD2(configure, int(MirWindowAttrib, int)); |
4146 | MOCK_METHOD1(add_observer, void(std::shared_ptr<scene::SurfaceObserver> const&)); |
4147 | MOCK_METHOD1(remove_observer, void(std::weak_ptr<scene::SurfaceObserver> const&)); |
4148 | MOCK_METHOD1(consume, void(MirEvent const*)); |
4149 | |
4150 | === modified file 'tests/include/mir/test/doubles/stub_scene_surface.h' |
4151 | --- tests/include/mir/test/doubles/stub_scene_surface.h 2016-10-31 02:37:31 +0000 |
4152 | +++ tests/include/mir/test/doubles/stub_scene_surface.h 2017-01-10 20:52:04 +0000 |
4153 | @@ -67,7 +67,7 @@ |
4154 | int buffers_ready_for_compositor(void const*) const override { return 0; } |
4155 | |
4156 | float alpha() const override { return 0.0f;} |
4157 | - MirSurfaceType type() const override { return mir_surface_type_normal; } |
4158 | + MirWindowType type() const override { return mir_window_type_normal; } |
4159 | MirSurfaceState state() const override { return mir_surface_state_unknown; } |
4160 | |
4161 | void hide() override {} |
4162 | @@ -93,8 +93,8 @@ |
4163 | |
4164 | bool supports_input() const override { return true;} |
4165 | int client_input_fd() const override { return fd;} |
4166 | - int configure(MirSurfaceAttrib, int) override { return 0; } |
4167 | - int query(MirSurfaceAttrib) const override { return 0; } |
4168 | + int configure(MirWindowAttrib, int) override { return 0; } |
4169 | + int query(MirWindowAttrib) const override { return 0; } |
4170 | void with_most_recent_buffer_do(std::function<void(graphics::Buffer&)> const&) {} |
4171 | |
4172 | std::shared_ptr<mir::scene::Surface> parent() const override { return nullptr; } |
4173 | |
4174 | === modified file 'tests/integration-tests/client/test_mirsurface.cpp' |
4175 | --- tests/integration-tests/client/test_mirsurface.cpp 2017-01-09 06:48:47 +0000 |
4176 | +++ tests/integration-tests/client/test_mirsurface.cpp 2017-01-10 20:52:04 +0000 |
4177 | @@ -80,17 +80,17 @@ |
4178 | |
4179 | MATCHER(IsAMenu, "") |
4180 | { |
4181 | - return arg.type == mir_surface_type_menu; |
4182 | + return arg.type == mir_window_type_menu; |
4183 | } |
4184 | |
4185 | MATCHER(IsATooltip, "") |
4186 | { |
4187 | - return arg.type == mir_surface_type_tip; |
4188 | + return arg.type == mir_window_type_tip; |
4189 | } |
4190 | |
4191 | MATCHER(IsADialog, "") |
4192 | { |
4193 | - return arg.type == mir_surface_type_dialog; |
4194 | + return arg.type == mir_window_type_dialog; |
4195 | } |
4196 | |
4197 | MATCHER_P(HasParent, parent, "") |
4198 | @@ -143,7 +143,7 @@ |
4199 | spec.buffer_usage = mir_buffer_usage_software; |
4200 | spec.surface_name = "test_surface"; |
4201 | spec.output_id = mir_display_output_id_invalid; |
4202 | - spec.type = mir_surface_type_dialog; |
4203 | + spec.type = mir_window_type_dialog; |
4204 | spec.state = mir_surface_state_minimized; |
4205 | spec.pref_orientation = mir_orientation_mode_landscape; |
4206 | } |
4207 | |
4208 | === modified file 'tests/integration-tests/session_management.cpp' |
4209 | --- tests/integration-tests/session_management.cpp 2016-05-27 07:54:00 +0000 |
4210 | +++ tests/integration-tests/session_management.cpp 2017-01-10 20:52:04 +0000 |
4211 | @@ -131,7 +131,7 @@ |
4212 | mir::geometry::Size{1,1}, mir_pixel_format_abgr_8888, mir::graphics::BufferUsage::software); |
4213 | ms::SurfaceCreationParameters const params = ms::SurfaceCreationParameters() |
4214 | .of_size(100,100) |
4215 | - .of_type(mir_surface_type_normal) |
4216 | + .of_type(mir_window_type_normal) |
4217 | .with_buffer_stream(session->create_buffer_stream(properties)); |
4218 | |
4219 | EXPECT_CALL(*test_surface_stack, add_surface(_,_)).Times(1); |
4220 | |
4221 | === modified file 'tests/integration-tests/test_session.cpp' |
4222 | --- tests/integration-tests/test_session.cpp 2016-11-04 17:12:59 +0000 |
4223 | +++ tests/integration-tests/test_session.cpp 2017-01-10 20:52:04 +0000 |
4224 | @@ -117,7 +117,7 @@ |
4225 | auto compositor = conf.the_compositor(); |
4226 | |
4227 | compositor->start(); |
4228 | - session.default_surface()->configure(mir_surface_attrib_swapinterval, 0); |
4229 | + session.default_surface()->configure(mir_window_attrib_swapinterval, 0); |
4230 | |
4231 | std::thread client_thread{ |
4232 | [&session, stream_id] |
4233 | |
4234 | === modified file 'tests/mir_test_framework/stub_surface.cpp' |
4235 | --- tests/mir_test_framework/stub_surface.cpp 2016-10-31 02:37:31 +0000 |
4236 | +++ tests/mir_test_framework/stub_surface.cpp 2017-01-10 20:52:04 +0000 |
4237 | @@ -131,9 +131,9 @@ |
4238 | return 0; |
4239 | } |
4240 | |
4241 | -MirSurfaceType mtd::StubSurface::type() const |
4242 | +MirWindowType mtd::StubSurface::type() const |
4243 | { |
4244 | - return MirSurfaceType::mir_surface_type_normal; |
4245 | + return MirWindowType::mir_window_type_normal; |
4246 | } |
4247 | |
4248 | MirSurfaceState mtd::StubSurface::state() const |
4249 | @@ -141,12 +141,12 @@ |
4250 | return MirSurfaceState::mir_surface_state_fullscreen; |
4251 | } |
4252 | |
4253 | -int mtd::StubSurface::configure(MirSurfaceAttrib /*attrib*/, int value) |
4254 | +int mtd::StubSurface::configure(MirWindowAttrib /*attrib*/, int value) |
4255 | { |
4256 | return value; |
4257 | } |
4258 | |
4259 | -int mtd::StubSurface::query(MirSurfaceAttrib /*attrib*/) const |
4260 | +int mtd::StubSurface::query(MirWindowAttrib /*attrib*/) const |
4261 | { |
4262 | return 0; |
4263 | } |
4264 | |
4265 | === modified file 'tests/mir_test_framework/visible_surface.cpp' |
4266 | --- tests/mir_test_framework/visible_surface.cpp 2017-01-09 06:48:47 +0000 |
4267 | +++ tests/mir_test_framework/visible_surface.cpp 2017-01-10 20:52:04 +0000 |
4268 | @@ -42,12 +42,13 @@ |
4269 | |
4270 | void mtf::VisibleSurface::event_callback(MirSurface* surf, MirEvent const* ev, void* context) |
4271 | { |
4272 | - if (mir_event_get_type(ev) == mir_event_type_surface) |
4273 | + if (mir_event_get_type(ev) == mir_event_type_window) |
4274 | { |
4275 | - if (mir_surface_event_get_attribute(mir_event_get_surface_event(ev)) == mir_surface_attrib_visibility) |
4276 | + auto attrib = mir_window_event_get_attribute(mir_event_get_window_event(ev)); |
4277 | + if (attrib == mir_window_attrib_visibility) |
4278 | { |
4279 | auto ctx = reinterpret_cast<VisibleSurface*>(context); |
4280 | - ctx->set_visibility(surf, mir_surface_event_get_attribute_value(mir_event_get_surface_event(ev))); |
4281 | + ctx->set_visibility(surf, mir_window_event_get_attribute_value(mir_event_get_window_event(ev))); |
4282 | } |
4283 | } |
4284 | } |
4285 | |
4286 | === modified file 'tests/unit-tests/client/test_client_mir_surface.cpp' |
4287 | --- tests/unit-tests/client/test_client_mir_surface.cpp 2017-01-09 06:48:47 +0000 |
4288 | +++ tests/unit-tests/client/test_client_mir_surface.cpp 2017-01-10 20:52:04 +0000 |
4289 | @@ -210,13 +210,13 @@ |
4290 | }; |
4291 | |
4292 | std::map<int, int> MockServerPackageGenerator::sent_surface_attributes = { |
4293 | - { mir_surface_attrib_type, mir_surface_type_normal }, |
4294 | - { mir_surface_attrib_state, mir_surface_state_restored }, |
4295 | - { mir_surface_attrib_swapinterval, 1 }, |
4296 | - { mir_surface_attrib_focus, mir_surface_focused }, |
4297 | - { mir_surface_attrib_dpi, 19 }, |
4298 | - { mir_surface_attrib_visibility, mir_surface_visibility_exposed }, |
4299 | - { mir_surface_attrib_preferred_orientation, mir_orientation_mode_any } |
4300 | + { mir_window_attrib_type, mir_window_type_normal }, |
4301 | + { mir_window_attrib_state, mir_surface_state_restored }, |
4302 | + { mir_window_attrib_swapinterval, 1 }, |
4303 | + { mir_window_attrib_focus, mir_surface_focused }, |
4304 | + { mir_window_attrib_dpi, 19 }, |
4305 | + { mir_window_attrib_visibility, mir_surface_visibility_exposed }, |
4306 | + { mir_window_attrib_preferred_orientation, mir_orientation_mode_any } |
4307 | }; |
4308 | |
4309 | struct StubClientInputPlatform : public mircv::InputPlatform |
4310 | @@ -389,9 +389,9 @@ |
4311 | |
4312 | auto surface = create_and_wait_for_surface_with(*client_comm_channel); |
4313 | |
4314 | - for (int i = 0; i < mir_surface_attribs; i++) |
4315 | + for (int i = 0; i < mir_window_attribs; i++) |
4316 | { |
4317 | - EXPECT_EQ(MockServerPackageGenerator::sent_surface_attributes[i], surface->attrib(static_cast<MirSurfaceAttrib>(i))); |
4318 | + EXPECT_EQ(MockServerPackageGenerator::sent_surface_attributes[i], surface->attrib(static_cast<MirWindowAttrib>(i))); |
4319 | } |
4320 | } |
4321 | |
4322 | @@ -492,7 +492,7 @@ |
4323 | |
4324 | auto const surface = create_surface_with(unresponsive_server); |
4325 | |
4326 | - auto configure_wait_handle = surface->configure(mir_surface_attrib_dpi, 100); |
4327 | + auto configure_wait_handle = surface->configure(mir_window_attrib_dpi, 100); |
4328 | |
4329 | auto expected_end = std::chrono::steady_clock::now() + pause_time; |
4330 | configure_wait_handle->wait_for_pending(pause_time); |
4331 | |
4332 | === modified file 'tests/unit-tests/frontend/test_event_sender.cpp' |
4333 | --- tests/unit-tests/frontend/test_event_sender.cpp 2016-12-20 15:01:43 +0000 |
4334 | +++ tests/unit-tests/frontend/test_event_sender.cpp 2017-01-10 20:52:04 +0000 |
4335 | @@ -156,7 +156,7 @@ |
4336 | { |
4337 | using namespace testing; |
4338 | |
4339 | - auto surface_ev = mev::make_event(mf::SurfaceId{1}, mir_surface_attrib_focus, mir_surface_focused); |
4340 | + auto surface_ev = mev::make_event(mf::SurfaceId{1}, mir_window_attrib_focus, mir_surface_focused); |
4341 | auto resize_ev = mev::make_event(mf::SurfaceId{1}, {10, 10}); |
4342 | |
4343 | EXPECT_CALL(mock_msg_sender, send(_, _, _)) |
4344 | |
4345 | === modified file 'tests/unit-tests/platforms/android/client/test_egl_native_surface_interpreter.cpp' |
4346 | --- tests/unit-tests/platforms/android/client/test_egl_native_surface_interpreter.cpp 2017-01-09 06:48:47 +0000 |
4347 | +++ tests/unit-tests/platforms/android/client/test_egl_native_surface_interpreter.cpp 2017-01-10 20:52:04 +0000 |
4348 | @@ -57,7 +57,7 @@ |
4349 | MOCK_CONST_METHOD0(get_parameters, MirWindowParameters()); |
4350 | MOCK_METHOD0(get_current_buffer, std::shared_ptr<mcl::ClientBuffer>()); |
4351 | MOCK_METHOD0(swap_buffers_sync, void()); |
4352 | - MOCK_METHOD2(request_and_wait_for_configure, void(MirSurfaceAttrib, int)); |
4353 | + MOCK_METHOD2(request_and_wait_for_configure, void(MirWindowAttrib, int)); |
4354 | MOCK_METHOD1(set_buffer_cache_size, void(unsigned int)); |
4355 | MirWindowParameters params; |
4356 | std::shared_ptr<mtd::MockClientBuffer> client_buffer; |
4357 | @@ -223,8 +223,8 @@ |
4358 | { |
4359 | testing::NiceMock<MockMirSurface> mock_surface{surf_params}; |
4360 | testing::InSequence seq; |
4361 | - EXPECT_CALL(mock_surface, request_and_wait_for_configure(mir_surface_attrib_swapinterval, 1)); |
4362 | - EXPECT_CALL(mock_surface, request_and_wait_for_configure(mir_surface_attrib_swapinterval, 0)); |
4363 | + EXPECT_CALL(mock_surface, request_and_wait_for_configure(mir_window_attrib_swapinterval, 1)); |
4364 | + EXPECT_CALL(mock_surface, request_and_wait_for_configure(mir_window_attrib_swapinterval, 0)); |
4365 | |
4366 | mcla::EGLNativeSurfaceInterpreter interpreter(mock_surface); |
4367 | interpreter.sync_to_display(true); |
4368 | |
4369 | === modified file 'tests/unit-tests/platforms/mesa/client/test_native_surface.cpp' |
4370 | --- tests/unit-tests/platforms/mesa/client/test_native_surface.cpp 2017-01-09 06:48:47 +0000 |
4371 | +++ tests/unit-tests/platforms/mesa/client/test_native_surface.cpp 2017-01-10 20:52:04 +0000 |
4372 | @@ -105,9 +105,9 @@ |
4373 | using namespace testing; |
4374 | |
4375 | Sequence seq; |
4376 | - EXPECT_CALL(mock_surface, request_and_wait_for_configure(mir_surface_attrib_swapinterval,0)) |
4377 | + EXPECT_CALL(mock_surface, request_and_wait_for_configure(mir_window_attrib_swapinterval,0)) |
4378 | .InSequence(seq); |
4379 | - EXPECT_CALL(mock_surface, request_and_wait_for_configure(mir_surface_attrib_swapinterval,1)) |
4380 | + EXPECT_CALL(mock_surface, request_and_wait_for_configure(mir_window_attrib_swapinterval,1)) |
4381 | .InSequence(seq); |
4382 | |
4383 | EXPECT_EQ(MIR_MESA_TRUE, native_surface.set_swapinterval(0)); |
4384 | |
4385 | === modified file 'tests/unit-tests/scene/test_abstract_shell.cpp' |
4386 | --- tests/unit-tests/scene/test_abstract_shell.cpp 2016-11-09 02:30:14 +0000 |
4387 | +++ tests/unit-tests/scene/test_abstract_shell.cpp 2017-01-10 20:52:04 +0000 |
4388 | @@ -384,13 +384,13 @@ |
4389 | |
4390 | MirSurfaceState const state{mir_surface_state_fullscreen}; |
4391 | |
4392 | - EXPECT_CALL(*wm, set_surface_attribute(session, surface, mir_surface_attrib_state, state)) |
4393 | + EXPECT_CALL(*wm, set_surface_attribute(session, surface, mir_window_attrib_state, state)) |
4394 | .WillOnce(WithArg<1>(Invoke([](std::shared_ptr<ms::Surface> const& surface) |
4395 | - { surface->configure(mir_surface_attrib_state, mir_surface_state_maximized); return mir_surface_state_maximized; }))); |
4396 | - |
4397 | - EXPECT_CALL(mock_surface, configure(mir_surface_attrib_state, mir_surface_state_maximized)); |
4398 | - |
4399 | - shell.set_surface_attribute(session, surface, mir_surface_attrib_state, mir_surface_state_fullscreen); |
4400 | + { surface->configure(mir_window_attrib_state, mir_surface_state_maximized); return mir_surface_state_maximized; }))); |
4401 | + |
4402 | + EXPECT_CALL(mock_surface, configure(mir_window_attrib_state, mir_surface_state_maximized)); |
4403 | + |
4404 | + shell.set_surface_attribute(session, surface, mir_window_attrib_state, mir_surface_state_fullscreen); |
4405 | } |
4406 | |
4407 | TEST_F(AbstractShell, as_focus_controller_set_focus_to_notifies_session_event_sink) |
4408 | |
4409 | === modified file 'tests/unit-tests/scene/test_application_session.cpp' |
4410 | --- tests/unit-tests/scene/test_application_session.cpp 2016-11-11 07:56:09 +0000 |
4411 | +++ tests/unit-tests/scene/test_application_session.cpp 2017-01-10 20:52:04 +0000 |
4412 | @@ -114,7 +114,7 @@ |
4413 | |
4414 | MATCHER(IsSurfaceOutputEvent, "") |
4415 | { |
4416 | - return mir_event_get_type(&arg) == mir_event_type_surface_output; |
4417 | + return mir_event_get_type(&arg) == mir_event_type_window_output; |
4418 | } |
4419 | |
4420 | struct StubSurfaceStack : public msh::SurfaceStack |
4421 | @@ -696,7 +696,7 @@ |
4422 | |
4423 | ms::SurfaceCreationParameters params = ms::SurfaceCreationParameters{} |
4424 | .of_name("Aardavks") |
4425 | - .of_type(mir_surface_type_normal) |
4426 | + .of_type(mir_window_type_normal) |
4427 | .with_buffer_stream(id); |
4428 | |
4429 | session->create_surface(params, event_sink); |
4430 | @@ -895,13 +895,13 @@ |
4431 | { |
4432 | using namespace testing; |
4433 | |
4434 | - if (mir_event_get_type(arg) != mir_event_type_surface_output) |
4435 | + if (mir_event_get_type(arg) != mir_event_type_window_output) |
4436 | { |
4437 | - *result_listener << "Event is not a MirSurfaceOutputEvent"; |
4438 | + *result_listener << "Event is not a MirWindowOutputEvent"; |
4439 | return 0; |
4440 | } |
4441 | |
4442 | - auto const event = mir_event_get_surface_output_event(arg); |
4443 | + auto const event = mir_event_get_window_output_event(arg); |
4444 | |
4445 | if (output.output.current_mode_index >= output.output.modes.size()) |
4446 | return false; |
4447 | @@ -911,23 +911,23 @@ |
4448 | return |
4449 | ExplainMatchResult( |
4450 | Eq(output.dpi), |
4451 | - mir_surface_output_event_get_dpi(event), |
4452 | + mir_window_output_event_get_dpi(event), |
4453 | result_listener) && |
4454 | ExplainMatchResult( |
4455 | Eq(output.form_factor), |
4456 | - mir_surface_output_event_get_form_factor(event), |
4457 | + mir_window_output_event_get_form_factor(event), |
4458 | result_listener) && |
4459 | ExplainMatchResult( |
4460 | Eq(output.scale), |
4461 | - mir_surface_output_event_get_scale(event), |
4462 | + mir_window_output_event_get_scale(event), |
4463 | result_listener) && |
4464 | ExplainMatchResult( |
4465 | Eq(mode.vrefresh_hz), |
4466 | - mir_surface_output_event_get_refresh_rate(event), |
4467 | + mir_window_output_event_get_refresh_rate(event), |
4468 | result_listener) && |
4469 | ExplainMatchResult( |
4470 | Eq(output.id), |
4471 | - mir_surface_output_event_get_output_id(event), |
4472 | + mir_window_output_event_get_output_id(event), |
4473 | result_listener); |
4474 | } |
4475 | } |
4476 | @@ -942,7 +942,7 @@ |
4477 | EXPECT_CALL(*sender, handle_event(IsSurfaceOutputEvent())) |
4478 | .WillOnce(Invoke([&event, &event_received](MirEvent const& ev) |
4479 | { |
4480 | - if (event.type() == mir_event_type_surface_output) |
4481 | + if (event.type() == mir_event_type_window_output) |
4482 | { |
4483 | event = *ev.to_surface_output(); |
4484 | } |
4485 | @@ -978,7 +978,7 @@ |
4486 | ON_CALL(*sender, handle_event(IsSurfaceOutputEvent())) |
4487 | .WillByDefault(Invoke([&event, &events_received](MirEvent const& ev) |
4488 | { |
4489 | - if (ev.type() == mir_event_type_surface_output) |
4490 | + if (ev.type() == mir_event_type_window_output) |
4491 | { |
4492 | event[events_received] = *ev.to_surface_output(); |
4493 | } |
4494 | @@ -1035,7 +1035,7 @@ |
4495 | ON_CALL(*sender, handle_event(IsSurfaceOutputEvent())) |
4496 | .WillByDefault(Invoke([&event, &event_received](MirEvent const& ev) |
4497 | { |
4498 | - if (ev.type() == mir_event_type_surface_output) |
4499 | + if (ev.type() == mir_event_type_window_output) |
4500 | { |
4501 | event = *ev.to_surface_output(); |
4502 | } |
4503 | @@ -1083,7 +1083,7 @@ |
4504 | ON_CALL(*sender, handle_event(IsSurfaceOutputEvent())) |
4505 | .WillByDefault(Invoke([&event, &event_received](MirEvent const& ev) |
4506 | { |
4507 | - if (ev.type() == mir_event_type_surface_output) |
4508 | + if (ev.type() == mir_event_type_window_output) |
4509 | { |
4510 | event = *ev.to_surface_output(); |
4511 | } |
4512 | @@ -1144,7 +1144,7 @@ |
4513 | ON_CALL(*sender, handle_event(IsSurfaceOutputEvent())) |
4514 | .WillByDefault(Invoke([&event, &events_received](MirEvent const& ev) |
4515 | { |
4516 | - if (ev.type() == mir_event_type_surface_output) |
4517 | + if (ev.type() == mir_event_type_window_output) |
4518 | { |
4519 | event = *ev.to_surface_output(); |
4520 | } |
4521 | |
4522 | === modified file 'tests/unit-tests/scene/test_basic_surface.cpp' |
4523 | --- tests/unit-tests/scene/test_basic_surface.cpp 2016-11-09 02:30:14 +0000 |
4524 | +++ tests/unit-tests/scene/test_basic_surface.cpp 2017-01-10 20:52:04 +0000 |
4525 | @@ -64,7 +64,7 @@ |
4526 | class MockSurfaceObserver : public ms::NullSurfaceObserver |
4527 | { |
4528 | public: |
4529 | - MOCK_METHOD2(attrib_changed, void(MirSurfaceAttrib, int)); |
4530 | + MOCK_METHOD2(attrib_changed, void(MirWindowAttrib, int)); |
4531 | MOCK_METHOD1(hidden_set_to, void(bool)); |
4532 | MOCK_METHOD1(renamed, void(char const*)); |
4533 | MOCK_METHOD0(client_surface_close_requested, void()); |
4534 | @@ -508,7 +508,7 @@ |
4535 | |
4536 | struct AttributeTestParameters |
4537 | { |
4538 | - MirSurfaceAttrib attribute; |
4539 | + MirWindowAttrib attribute; |
4540 | int default_value; |
4541 | int a_valid_value; |
4542 | int an_invalid_value; |
4543 | @@ -520,42 +520,42 @@ |
4544 | }; |
4545 | |
4546 | AttributeTestParameters const surface_visibility_test_parameters{ |
4547 | - mir_surface_attrib_visibility, |
4548 | + mir_window_attrib_visibility, |
4549 | mir_surface_visibility_occluded, |
4550 | mir_surface_visibility_exposed, |
4551 | -1 |
4552 | }; |
4553 | |
4554 | AttributeTestParameters const surface_type_test_parameters{ |
4555 | - mir_surface_attrib_type, |
4556 | - mir_surface_type_normal, |
4557 | - mir_surface_type_freestyle, |
4558 | + mir_window_attrib_type, |
4559 | + mir_window_type_normal, |
4560 | + mir_window_type_freestyle, |
4561 | -1 |
4562 | }; |
4563 | |
4564 | AttributeTestParameters const surface_state_test_parameters{ |
4565 | - mir_surface_attrib_state, |
4566 | + mir_window_attrib_state, |
4567 | mir_surface_state_restored, |
4568 | mir_surface_state_fullscreen, |
4569 | 1178312 |
4570 | }; |
4571 | |
4572 | AttributeTestParameters const surface_swapinterval_test_parameters{ |
4573 | - mir_surface_attrib_swapinterval, |
4574 | + mir_window_attrib_swapinterval, |
4575 | 1, |
4576 | 0, |
4577 | -1 |
4578 | }; |
4579 | |
4580 | AttributeTestParameters const surface_dpi_test_parameters{ |
4581 | - mir_surface_attrib_dpi, |
4582 | + mir_window_attrib_dpi, |
4583 | 0, |
4584 | 90, |
4585 | -1 |
4586 | }; |
4587 | |
4588 | AttributeTestParameters const surface_focus_test_parameters{ |
4589 | - mir_surface_attrib_focus, |
4590 | + mir_window_attrib_focus, |
4591 | mir_surface_unfocused, |
4592 | mir_surface_focused, |
4593 | -1 |
4594 | @@ -920,9 +920,9 @@ |
4595 | EXPECT_CALL(*buffer_stream, drop_old_buffers()).Times(Exactly(1)); |
4596 | EXPECT_CALL(*mock_buffer_stream, drop_old_buffers()).Times(Exactly(1)); |
4597 | |
4598 | - surface.configure(mir_surface_attrib_visibility, mir_surface_visibility_occluded); |
4599 | - surface.configure(mir_surface_attrib_visibility, mir_surface_visibility_exposed); |
4600 | - surface.configure(mir_surface_attrib_visibility, mir_surface_visibility_exposed); |
4601 | + surface.configure(mir_window_attrib_visibility, mir_surface_visibility_occluded); |
4602 | + surface.configure(mir_window_attrib_visibility, mir_surface_visibility_exposed); |
4603 | + surface.configure(mir_window_attrib_visibility, mir_surface_visibility_exposed); |
4604 | } |
4605 | |
4606 | //TODO: per-stream alpha and swapinterval seems useful |
4607 | @@ -988,7 +988,7 @@ |
4608 | EXPECT_CALL(*buffer_stream, allow_framedropping(true)); |
4609 | |
4610 | surface.set_streams(streams); |
4611 | - surface.configure(mir_surface_attrib_swapinterval, 0); |
4612 | + surface.configure(mir_window_attrib_swapinterval, 0); |
4613 | } |
4614 | |
4615 | TEST_F(BasicSurfaceTest, visibility_matches_produced_list) |
4616 | @@ -1102,9 +1102,9 @@ |
4617 | { |
4618 | struct VisibilityObserver : ms::NullSurfaceObserver |
4619 | { |
4620 | - void attrib_changed(MirSurfaceAttrib attrib, int value) override |
4621 | + void attrib_changed(MirWindowAttrib attrib, int value) override |
4622 | { |
4623 | - if (attrib == mir_surface_attrib_visibility) |
4624 | + if (attrib == mir_window_attrib_visibility) |
4625 | { |
4626 | if (value == mir_surface_visibility_occluded) |
4627 | hides_++; |
4628 | @@ -1134,7 +1134,7 @@ |
4629 | |
4630 | EXPECT_THAT(observer->exposes(), Eq(0)); |
4631 | EXPECT_THAT(observer->hides(), Eq(0)); |
4632 | - surface.configure(mir_surface_attrib_visibility, mir_surface_visibility_exposed); |
4633 | + surface.configure(mir_window_attrib_visibility, mir_surface_visibility_exposed); |
4634 | |
4635 | EXPECT_THAT(observer->exposes(), Eq(1)); |
4636 | EXPECT_THAT(observer->hides(), Eq(0)); |
4637 | |
4638 | === modified file 'tests/unit-tests/scene/test_rendering_tracker.cpp' |
4639 | --- tests/unit-tests/scene/test_rendering_tracker.cpp 2015-06-25 03:00:08 +0000 |
4640 | +++ tests/unit-tests/scene/test_rendering_tracker.cpp 2017-01-10 20:52:04 +0000 |
4641 | @@ -48,7 +48,7 @@ |
4642 | |
4643 | EXPECT_CALL( |
4644 | *mock_surface, |
4645 | - configure(mir_surface_attrib_visibility, mir_surface_visibility_occluded)); |
4646 | + configure(mir_window_attrib_visibility, mir_surface_visibility_occluded)); |
4647 | |
4648 | tracker.active_compositors(compositors); |
4649 | |
4650 | @@ -63,7 +63,7 @@ |
4651 | |
4652 | EXPECT_CALL( |
4653 | *mock_surface, |
4654 | - configure(mir_surface_attrib_visibility, mir_surface_visibility_exposed)); |
4655 | + configure(mir_window_attrib_visibility, mir_surface_visibility_exposed)); |
4656 | |
4657 | tracker.active_compositors(compositors); |
4658 | |
4659 | @@ -78,7 +78,7 @@ |
4660 | |
4661 | EXPECT_CALL( |
4662 | *mock_surface, |
4663 | - configure(mir_surface_attrib_visibility, mir_surface_visibility_exposed)); |
4664 | + configure(mir_window_attrib_visibility, mir_surface_visibility_exposed)); |
4665 | |
4666 | tracker.active_compositors(compositors); |
4667 | |
4668 | @@ -94,7 +94,7 @@ |
4669 | |
4670 | EXPECT_CALL( |
4671 | *mock_surface, |
4672 | - configure(mir_surface_attrib_visibility, mir_surface_visibility_occluded)) |
4673 | + configure(mir_window_attrib_visibility, mir_surface_visibility_occluded)) |
4674 | .Times(0); |
4675 | |
4676 | tracker.active_compositors(compositors); |
4677 | @@ -111,7 +111,7 @@ |
4678 | |
4679 | EXPECT_CALL( |
4680 | *mock_surface, |
4681 | - configure(mir_surface_attrib_visibility, mir_surface_visibility_occluded)); |
4682 | + configure(mir_window_attrib_visibility, mir_surface_visibility_occluded)); |
4683 | |
4684 | tracker.active_compositors(compositors); |
4685 | |
4686 | @@ -136,7 +136,7 @@ |
4687 | |
4688 | EXPECT_CALL( |
4689 | *mock_surface, |
4690 | - configure(mir_surface_attrib_visibility, mir_surface_visibility_occluded)); |
4691 | + configure(mir_window_attrib_visibility, mir_surface_visibility_occluded)); |
4692 | |
4693 | compositors.erase(compositor_id3); |
4694 | tracker.active_compositors(compositors); |
4695 | |
4696 | === modified file 'tests/unit-tests/scene/test_surface.cpp' |
4697 | --- tests/unit-tests/scene/test_surface.cpp 2016-11-11 06:59:42 +0000 |
4698 | +++ tests/unit-tests/scene/test_surface.cpp 2017-01-10 20:52:04 +0000 |
4699 | @@ -93,7 +93,7 @@ |
4700 | MirPixelFormat const format{mir_pixel_format_abgr_8888}; |
4701 | std::string name{"surface"}; |
4702 | MirSurfaceState state{mir_surface_state_fullscreen}; |
4703 | - MirSurfaceType type{mir_surface_type_dialog}; |
4704 | + MirWindowType type{mir_window_type_dialog}; |
4705 | MirOrientationMode mode{mir_orientation_mode_landscape}; |
4706 | mf::SurfaceId surf_id{1000}; |
4707 | |
4708 | |
4709 | === modified file 'tests/unit-tests/scene/test_surface_impl.cpp' |
4710 | --- tests/unit-tests/scene/test_surface_impl.cpp 2016-11-11 06:59:42 +0000 |
4711 | +++ tests/unit-tests/scene/test_surface_impl.cpp 2017-01-10 20:52:04 +0000 |
4712 | @@ -102,7 +102,7 @@ |
4713 | using namespace testing; |
4714 | |
4715 | EXPECT_THROW({ |
4716 | - surface->configure(static_cast<MirSurfaceAttrib>(111), 222); |
4717 | + surface->configure(static_cast<MirWindowAttrib>(111), 222); |
4718 | }, std::logic_error); |
4719 | } |
4720 | |
4721 | @@ -110,30 +110,30 @@ |
4722 | { |
4723 | using namespace testing; |
4724 | |
4725 | - EXPECT_EQ(mir_surface_type_normal, surface->type()); |
4726 | - |
4727 | - EXPECT_EQ(mir_surface_type_utility, |
4728 | - surface->configure(mir_surface_attrib_type, |
4729 | - mir_surface_type_utility)); |
4730 | - EXPECT_EQ(mir_surface_type_utility, surface->type()); |
4731 | - |
4732 | - EXPECT_THROW({ |
4733 | - surface->configure(mir_surface_attrib_type, 999); |
4734 | - }, std::logic_error); |
4735 | - EXPECT_THROW({ |
4736 | - surface->configure(mir_surface_attrib_type, -1); |
4737 | - }, std::logic_error); |
4738 | - EXPECT_EQ(mir_surface_type_utility, surface->type()); |
4739 | - |
4740 | - EXPECT_EQ(mir_surface_type_dialog, |
4741 | - surface->configure(mir_surface_attrib_type, |
4742 | - mir_surface_type_dialog)); |
4743 | - EXPECT_EQ(mir_surface_type_dialog, surface->type()); |
4744 | - |
4745 | - EXPECT_EQ(mir_surface_type_freestyle, |
4746 | - surface->configure(mir_surface_attrib_type, |
4747 | - mir_surface_type_freestyle)); |
4748 | - EXPECT_EQ(mir_surface_type_freestyle, surface->type()); |
4749 | + EXPECT_EQ(mir_window_type_normal, surface->type()); |
4750 | + |
4751 | + EXPECT_EQ(mir_window_type_utility, |
4752 | + surface->configure(mir_window_attrib_type, |
4753 | + mir_window_type_utility)); |
4754 | + EXPECT_EQ(mir_window_type_utility, surface->type()); |
4755 | + |
4756 | + EXPECT_THROW({ |
4757 | + surface->configure(mir_window_attrib_type, 999); |
4758 | + }, std::logic_error); |
4759 | + EXPECT_THROW({ |
4760 | + surface->configure(mir_window_attrib_type, -1); |
4761 | + }, std::logic_error); |
4762 | + EXPECT_EQ(mir_window_type_utility, surface->type()); |
4763 | + |
4764 | + EXPECT_EQ(mir_window_type_dialog, |
4765 | + surface->configure(mir_window_attrib_type, |
4766 | + mir_window_type_dialog)); |
4767 | + EXPECT_EQ(mir_window_type_dialog, surface->type()); |
4768 | + |
4769 | + EXPECT_EQ(mir_window_type_freestyle, |
4770 | + surface->configure(mir_window_attrib_type, |
4771 | + mir_window_type_freestyle)); |
4772 | + EXPECT_EQ(mir_window_type_freestyle, surface->type()); |
4773 | } |
4774 | |
4775 | TEST_F(Surface, states) |
4776 | @@ -143,25 +143,25 @@ |
4777 | EXPECT_EQ(mir_surface_state_restored, surface->state()); |
4778 | |
4779 | EXPECT_EQ(mir_surface_state_vertmaximized, |
4780 | - surface->configure(mir_surface_attrib_state, |
4781 | + surface->configure(mir_window_attrib_state, |
4782 | mir_surface_state_vertmaximized)); |
4783 | EXPECT_EQ(mir_surface_state_vertmaximized, surface->state()); |
4784 | |
4785 | EXPECT_THROW({ |
4786 | - surface->configure(mir_surface_attrib_state, 999); |
4787 | + surface->configure(mir_window_attrib_state, 999); |
4788 | }, std::logic_error); |
4789 | EXPECT_THROW({ |
4790 | - surface->configure(mir_surface_attrib_state, -1); |
4791 | + surface->configure(mir_window_attrib_state, -1); |
4792 | }, std::logic_error); |
4793 | EXPECT_EQ(mir_surface_state_vertmaximized, surface->state()); |
4794 | |
4795 | EXPECT_EQ(mir_surface_state_minimized, |
4796 | - surface->configure(mir_surface_attrib_state, |
4797 | + surface->configure(mir_window_attrib_state, |
4798 | mir_surface_state_minimized)); |
4799 | EXPECT_EQ(mir_surface_state_minimized, surface->state()); |
4800 | |
4801 | EXPECT_EQ(mir_surface_state_fullscreen, |
4802 | - surface->configure(mir_surface_attrib_state, |
4803 | + surface->configure(mir_window_attrib_state, |
4804 | mir_surface_state_fullscreen)); |
4805 | EXPECT_EQ(mir_surface_state_fullscreen, surface->state()); |
4806 | } |
4807 | @@ -235,9 +235,9 @@ |
4808 | |
4809 | { |
4810 | InSequence seq; |
4811 | - EXPECT_CALL(sink, handle_event(mt::SurfaceEvent(mir_surface_attrib_focus, mir_surface_focused))) |
4812 | + EXPECT_CALL(sink, handle_event(mt::WindowEvent(mir_window_attrib_focus, mir_surface_focused))) |
4813 | .Times(1); |
4814 | - EXPECT_CALL(sink, handle_event(mt::SurfaceEvent(mir_surface_attrib_focus, mir_surface_unfocused))) |
4815 | + EXPECT_CALL(sink, handle_event(mt::WindowEvent(mir_window_attrib_focus, mir_surface_unfocused))) |
4816 | .Times(1); |
4817 | } |
4818 | |
4819 | @@ -246,8 +246,8 @@ |
4820 | |
4821 | surface->add_observer(observer); |
4822 | |
4823 | - surface->configure(mir_surface_attrib_focus, mir_surface_focused); |
4824 | - surface->configure(mir_surface_attrib_focus, mir_surface_unfocused); |
4825 | + surface->configure(mir_window_attrib_focus, mir_surface_focused); |
4826 | + surface->configure(mir_window_attrib_focus, mir_surface_unfocused); |
4827 | } |
4828 | MATCHER_P(MirCloseSurfaceEventMatches, event, "") |
4829 | { |
4830 | @@ -286,5 +286,5 @@ |
4831 | std::shared_ptr<mg::CursorImage>(), |
4832 | report); |
4833 | |
4834 | - EXPECT_EQ(mir_orientation_mode_any, surf.query(mir_surface_attrib_preferred_orientation)); |
4835 | + EXPECT_EQ(mir_orientation_mode_any, surf.query(mir_window_attrib_preferred_orientation)); |
4836 | } |
4837 | |
4838 | === modified file 'tests/unit-tests/scene/test_surface_stack.cpp' |
4839 | --- tests/unit-tests/scene/test_surface_stack.cpp 2016-11-16 13:08:55 +0000 |
4840 | +++ tests/unit-tests/scene/test_surface_stack.cpp 2017-01-10 20:52:04 +0000 |
4841 | @@ -281,7 +281,7 @@ |
4842 | std::shared_ptr<mg::CursorImage>(), |
4843 | report); |
4844 | stack.add_surface(surface, default_params.input_mode); |
4845 | - surface->configure(mir_surface_attrib_visibility, |
4846 | + surface->configure(mir_window_attrib_visibility, |
4847 | mir_surface_visibility_exposed); |
4848 | |
4849 | auto elements = stack.scene_elements_for(compositor_id); |
4850 | @@ -310,7 +310,7 @@ |
4851 | std::shared_ptr<mg::CursorImage>(), |
4852 | report); |
4853 | stack.add_surface(surface, default_params.input_mode); |
4854 | - surface->configure(mir_surface_attrib_visibility, |
4855 | + surface->configure(mir_window_attrib_visibility, |
4856 | mir_surface_visibility_exposed); |
4857 | |
4858 | // (change directory in shell app) |
4859 | @@ -356,7 +356,7 @@ |
4860 | std::shared_ptr<mg::CursorImage>(), |
4861 | report); |
4862 | stack.add_surface(surface, default_params.input_mode); |
4863 | - surface->configure(mir_surface_attrib_visibility, |
4864 | + surface->configure(mir_window_attrib_visibility, |
4865 | mir_surface_visibility_exposed); |
4866 | |
4867 | EXPECT_EQ(0, stack.frames_pending(this)); |
4868 | @@ -811,7 +811,7 @@ |
4869 | mir::report::null_scene_report()) |
4870 | { |
4871 | } |
4872 | - MOCK_METHOD2(configure, int(MirSurfaceAttrib, int)); |
4873 | + MOCK_METHOD2(configure, int(MirWindowAttrib, int)); |
4874 | }; |
4875 | } |
4876 | |
4877 | @@ -834,7 +834,7 @@ |
4878 | auto const elements2 = stack.scene_elements_for(compositor_id2); |
4879 | ASSERT_THAT(elements2.size(), Eq(1u)); |
4880 | |
4881 | - EXPECT_CALL(*mock_surface, configure(mir_surface_attrib_visibility, mir_surface_visibility_occluded)); |
4882 | + EXPECT_CALL(*mock_surface, configure(mir_window_attrib_visibility, mir_surface_visibility_occluded)); |
4883 | |
4884 | elements.back()->occluded(); |
4885 | elements2.back()->occluded(); |
4886 | @@ -857,7 +857,7 @@ |
4887 | auto const elements2 = stack.scene_elements_for(compositor_id2); |
4888 | ASSERT_THAT(elements2.size(), Eq(1u)); |
4889 | |
4890 | - EXPECT_CALL(*mock_surface, configure(mir_surface_attrib_visibility, mir_surface_visibility_exposed)); |
4891 | + EXPECT_CALL(*mock_surface, configure(mir_window_attrib_visibility, mir_surface_visibility_exposed)); |
4892 | |
4893 | elements.back()->occluded(); |
4894 | elements2.back()->rendered(); |
4895 | @@ -884,7 +884,7 @@ |
4896 | auto const elements3 = stack.scene_elements_for(compositor_id3); |
4897 | ASSERT_THAT(elements3.size(), Eq(1u)); |
4898 | |
4899 | - EXPECT_CALL(*mock_surface, configure(mir_surface_attrib_visibility, mir_surface_visibility_exposed)) |
4900 | + EXPECT_CALL(*mock_surface, configure(mir_window_attrib_visibility, mir_surface_visibility_exposed)) |
4901 | .Times(2); |
4902 | |
4903 | elements.back()->occluded(); |
4904 | @@ -893,7 +893,7 @@ |
4905 | |
4906 | Mock::VerifyAndClearExpectations(mock_surface.get()); |
4907 | |
4908 | - EXPECT_CALL(*mock_surface, configure(mir_surface_attrib_visibility, mir_surface_visibility_occluded)); |
4909 | + EXPECT_CALL(*mock_surface, configure(mir_window_attrib_visibility, mir_surface_visibility_occluded)); |
4910 | |
4911 | stack.unregister_compositor(compositor_id2); |
4912 | stack.unregister_compositor(compositor_id3); |
4913 | @@ -978,8 +978,8 @@ |
4914 | stack.add_surface(stub_surface2, default_params.input_mode); |
4915 | |
4916 | // Configure surface1 and surface2 to appear in input enumeration. |
4917 | - stub_surface1->configure(mir_surface_attrib_visibility, MirSurfaceVisibility::mir_surface_visibility_exposed); |
4918 | - stub_surface2->configure(mir_surface_attrib_visibility, MirSurfaceVisibility::mir_surface_visibility_exposed); |
4919 | + stub_surface1->configure(mir_window_attrib_visibility, MirSurfaceVisibility::mir_surface_visibility_exposed); |
4920 | + stub_surface2->configure(mir_window_attrib_visibility, MirSurfaceVisibility::mir_surface_visibility_exposed); |
4921 | |
4922 | stack.add_input_visualization(mt::fake_shared(r)); |
4923 | |
4924 | @@ -1056,9 +1056,9 @@ |
4925 | stack.add_surface(stub_surface2, default_params.input_mode); |
4926 | stack.add_surface(stub_surface3, default_params.input_mode); |
4927 | |
4928 | - stub_surface1->configure(mir_surface_attrib_visibility, MirSurfaceVisibility::mir_surface_visibility_exposed); |
4929 | - stub_surface2->configure(mir_surface_attrib_visibility, MirSurfaceVisibility::mir_surface_visibility_occluded); |
4930 | - stub_surface3->configure(mir_surface_attrib_visibility, MirSurfaceVisibility::mir_surface_visibility_occluded); |
4931 | + stub_surface1->configure(mir_window_attrib_visibility, MirSurfaceVisibility::mir_surface_visibility_exposed); |
4932 | + stub_surface2->configure(mir_window_attrib_visibility, MirSurfaceVisibility::mir_surface_visibility_occluded); |
4933 | + stub_surface3->configure(mir_window_attrib_visibility, MirSurfaceVisibility::mir_surface_visibility_occluded); |
4934 | |
4935 | int num_exposed_surfaces = 0; |
4936 | auto const count_exposed_surfaces = [&num_exposed_surfaces](std::shared_ptr<mi::Surface> const&){ |