Merge lp:~alan-griffiths/mir/discussion-migrate-demo-shell into lp:mir
- discussion-migrate-demo-shell
- Merge into development-branch
Status: | Rejected |
---|---|
Rejected by: | Alan Griffiths |
Proposed branch: | lp:~alan-griffiths/mir/discussion-migrate-demo-shell |
Merge into: | lp:mir |
Prerequisite: | lp:~alan-griffiths/mir/migrate-render_surfaces |
Diff against target: |
559 lines (+97/-244) 15 files modified
CMakeLists.txt (+0/-1) examples/CMakeLists.txt (+2/-0) examples/demo-shell/CMakeLists.txt (+4/-1) examples/demo-shell/demo_shell.cpp (+53/-90) include/server/mir/default_server_configuration.h (+2/-1) include/server/mir/server.h (+26/-3) playground/CMakeLists.txt (+0/-16) playground/README (+0/-6) playground/server_configuration.cpp (+0/-72) playground/server_configuration.h (+0/-50) server-ABI-sha1sums (+2/-2) src/server/server.cpp (+3/-0) src/server/symbols.map (+3/-0) tests/unit-tests/examples/test_demo_compositor.cpp (+1/-1) tests/unit-tests/examples/test_demo_renderer.cpp (+1/-1) |
To merge this branch: | bzr merge lp:~alan-griffiths/mir/discussion-migrate-demo-shell |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel van Vugt | Needs Fixing | ||
Alan Griffiths | Needs Information | ||
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Kevin DuBois (community) | Disapprove | ||
Review via email: mp+244152@code.launchpad.net |
Commit message
examples: update the demo-shell example to use the mir::Server API
Description of the change
examples: update the demo-shell example to use the mir::Server API
This involves exposing stuff that had been "privatized" and this might not be the best way to expose the functionality needed. Hence I'd like some discussion about whether this is justified.
- 2139. By Alan Griffiths
-
merge lp:mir
- 2140. By Alan Griffiths
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:2140
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Daniel van Vugt (vanvugt) wrote : | # |
I'm pretty sure playground/ can access a superset of what examples/ can. That's why it exists.
So there's no reason to republish all those headers just yet, is there?
Alan Griffiths (alan-griffiths) wrote : | # |
Quoting the README:
The Playground
These are mir demos that excercise private in-flux mir functionality.
As such functionality matures, related headers become public and the playground
code may become an example of how to use such feature.
The reason for this MP is to drive a discussion of what is preventing users of our supported API doing what we do in the mir_demo_
As I see it the only real problem highlighted by this MP is that the DemoRenderer class that has been implemented using some of our private gl tools. That is I don't see that access to the_compositor_
So the question is: how do we serve our current and potential users better?
1. Provide an example of shell decorations etc that doesn't use Mir internals
2. Design a way for users to implement shell decorations that we're happy to publish
3. Ignore the issue
Using our private gl tools isn't the only implementation option and (as Kevin says) our existing downstreams haven't found a need for this approach. It would be good to have an example that is more like what we expect users to do.
Daniel van Vugt (vanvugt) wrote : | # |
Definitely this migration is something that will have to happen in future. I was leaning toward keeping things as private as possible for as long as possible. That means I expected to keep much of this private (so we can freely change interfaces) until such time as some new shell developer asks us to expose parts. Putting things in the public API prematurely and then having to change them is a painful issue we keep encountering. So I'd prefer to keep as much as possible private for as long as possible to minimize the problem. We all share the goal of wanting releases in future that don't bump the server ABI, so letting it stabilize privately still feels like a good idea to me...
On a more practical note:
(1) Needs Fixing: mir_demo_
Alan Griffiths (alan-griffiths) wrote : | # |
OK, I didn't really think this would land in this form - I was more interested in highlighting the gaps between what we our supported API allows and what we believe reasonable Mir users would want to do.
Unmerged revisions
- 2140. By Alan Griffiths
- 2139. By Alan Griffiths
-
merge lp:mir
- 2138. By Alan Griffiths
- 2137. By Alan Griffiths
-
Move demo-shell to examples
- 2136. By Alan Griffiths
-
Publish headers referenced by demo shell
- 2135. By Alan Griffiths
-
Tidy up demo code
- 2134. By Alan Griffiths
-
Delete dead code
- 2133. By Alan Griffiths
-
BFI migration of demo shell away from legacy API
- 2132. By Alan Griffiths
Preview Diff
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2014-12-05 03:26:03 +0000 | |||
3 | +++ CMakeLists.txt 2014-12-10 12:04:19 +0000 | |||
4 | @@ -191,7 +191,6 @@ | |||
5 | 191 | add_subdirectory(benchmarks/) | 191 | add_subdirectory(benchmarks/) |
6 | 192 | add_subdirectory(tools/) | 192 | add_subdirectory(tools/) |
7 | 193 | add_subdirectory(examples/) | 193 | add_subdirectory(examples/) |
8 | 194 | add_subdirectory(playground/) | ||
9 | 195 | add_subdirectory(guides/) | 194 | add_subdirectory(guides/) |
10 | 196 | add_subdirectory(cmake/) | 195 | add_subdirectory(cmake/) |
11 | 197 | 196 | ||
12 | 198 | 197 | ||
13 | === modified file 'examples/CMakeLists.txt' | |||
14 | --- examples/CMakeLists.txt 2014-12-10 12:04:19 +0000 | |||
15 | +++ examples/CMakeLists.txt 2014-12-10 12:04:19 +0000 | |||
16 | @@ -193,3 +193,5 @@ | |||
17 | 193 | install(TARGETS mir_demo_standalone_render_overlays | 193 | install(TARGETS mir_demo_standalone_render_overlays |
18 | 194 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | 194 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} |
19 | 195 | ) | 195 | ) |
20 | 196 | |||
21 | 197 | add_subdirectory(demo-shell/) | ||
22 | 196 | 198 | ||
23 | === renamed directory 'playground/demo-shell' => 'examples/demo-shell' | |||
24 | === modified file 'examples/demo-shell/CMakeLists.txt' | |||
25 | --- playground/demo-shell/CMakeLists.txt 2014-12-09 17:26:28 +0000 | |||
26 | +++ examples/demo-shell/CMakeLists.txt 2014-12-10 12:04:19 +0000 | |||
27 | @@ -1,3 +1,7 @@ | |||
28 | 1 | include_directories( | ||
29 | 2 | ${PROJECT_SOURCE_DIR}/examples/ | ||
30 | 3 | ) | ||
31 | 4 | |||
32 | 1 | add_library(demo-shell STATIC | 5 | add_library(demo-shell STATIC |
33 | 2 | demo_compositor.cpp | 6 | demo_compositor.cpp |
34 | 3 | demo_renderer.cpp | 7 | demo_renderer.cpp |
35 | @@ -11,7 +15,6 @@ | |||
36 | 11 | target_link_libraries(mir_demo_server_shell | 15 | target_link_libraries(mir_demo_server_shell |
37 | 12 | demo-shell | 16 | demo-shell |
38 | 13 | mirserver | 17 | mirserver |
39 | 14 | playgroundserverconfig | ||
40 | 15 | exampleserverconfig | 18 | exampleserverconfig |
41 | 16 | ) | 19 | ) |
42 | 17 | 20 | ||
43 | 18 | 21 | ||
44 | === modified file 'examples/demo-shell/demo_shell.cpp' | |||
45 | --- playground/demo-shell/demo_shell.cpp 2014-12-09 17:26:28 +0000 | |||
46 | +++ examples/demo-shell/demo_shell.cpp 2014-12-10 12:04:19 +0000 | |||
47 | @@ -21,10 +21,11 @@ | |||
48 | 21 | #include "demo_compositor.h" | 21 | #include "demo_compositor.h" |
49 | 22 | #include "window_manager.h" | 22 | #include "window_manager.h" |
50 | 23 | #include "server_example_fullscreen_placement_strategy.h" | 23 | #include "server_example_fullscreen_placement_strategy.h" |
52 | 24 | #include "../server_configuration.h" | 24 | #include "server_example_input_event_filter.h" |
53 | 25 | #include "server_example_display_configuration_policy.h" | ||
54 | 25 | 26 | ||
57 | 26 | #include "mir/options/default_configuration.h" | 27 | #include "mir/server.h" |
58 | 27 | #include "mir/run_mir.h" | 28 | #include "mir/options/option.h" |
59 | 28 | #include "mir/report_exception.h" | 29 | #include "mir/report_exception.h" |
60 | 29 | #include "mir/graphics/display.h" | 30 | #include "mir/graphics/display.h" |
61 | 30 | #include "mir/input/composite_event_filter.h" | 31 | #include "mir/input/composite_event_filter.h" |
62 | @@ -48,6 +49,14 @@ | |||
63 | 48 | { | 49 | { |
64 | 49 | namespace examples | 50 | namespace examples |
65 | 50 | { | 51 | { |
66 | 52 | class NestedLifecycleEventListener : public msh::HostLifecycleEventListener | ||
67 | 53 | { | ||
68 | 54 | public: | ||
69 | 55 | virtual void lifecycle_event_occurred(MirLifecycleState state) override | ||
70 | 56 | { | ||
71 | 57 | printf("Lifecycle event occurred : state = %d\n", state); | ||
72 | 58 | } | ||
73 | 59 | }; | ||
74 | 51 | 60 | ||
75 | 52 | class DisplayBufferCompositorFactory : public mc::DisplayBufferCompositorFactory | 61 | class DisplayBufferCompositorFactory : public mc::DisplayBufferCompositorFactory |
76 | 53 | { | 62 | { |
77 | @@ -72,103 +81,57 @@ | |||
78 | 72 | std::shared_ptr<mc::CompositorReport> const report; | 81 | std::shared_ptr<mc::CompositorReport> const report; |
79 | 73 | }; | 82 | }; |
80 | 74 | 83 | ||
82 | 75 | class DemoServerConfiguration : public mir::examples::ServerConfiguration | 84 | auto make_window_manager_for(Server& server) |
83 | 85 | -> std::shared_ptr<mir::input::EventFilter> | ||
84 | 76 | { | 86 | { |
158 | 77 | public: | 87 | auto const wm = std::make_shared<me::WindowManager>(); |
159 | 78 | DemoServerConfiguration(int argc, char const* argv[], | 88 | // We use this strange two stage initialization to avoid a circular dependency between the EventFilters |
160 | 79 | std::initializer_list<std::shared_ptr<mi::EventFilter>> const& filter_list) | 89 | // and the SessionStore |
161 | 80 | : ServerConfiguration([argc, argv] | 90 | server.add_init_callback([&] |
162 | 81 | { | 91 | { |
163 | 82 | auto result = std::make_shared<mo::DefaultConfiguration>(argc, argv); | 92 | server.the_composite_event_filter()->append(wm); |
164 | 83 | 93 | ||
165 | 84 | namespace po = boost::program_options; | 94 | wm->set_focus_controller(server.the_focus_controller()); |
166 | 85 | 95 | wm->set_display(server.the_display()); | |
167 | 86 | result->add_options() | 96 | wm->set_compositor(server.the_compositor()); |
168 | 87 | ("fullscreen-surfaces", "Make all surfaces fullscreen"); | 97 | wm->set_input_scene(server.the_input_scene()); |
169 | 88 | 98 | }); | |
170 | 89 | return result; | 99 | |
171 | 90 | }()), | 100 | return wm; |
172 | 91 | filter_list(filter_list) | 101 | } |
100 | 92 | { | ||
101 | 93 | } | ||
102 | 94 | |||
103 | 95 | |||
104 | 96 | std::shared_ptr<compositor::DisplayBufferCompositorFactory> the_display_buffer_compositor_factory() override | ||
105 | 97 | { | ||
106 | 98 | return display_buffer_compositor_factory( | ||
107 | 99 | [this]() | ||
108 | 100 | { | ||
109 | 101 | return std::make_shared<me::DisplayBufferCompositorFactory>( | ||
110 | 102 | the_gl_program_factory(), | ||
111 | 103 | the_compositor_report()); | ||
112 | 104 | }); | ||
113 | 105 | } | ||
114 | 106 | |||
115 | 107 | std::shared_ptr<ms::PlacementStrategy> the_placement_strategy() override | ||
116 | 108 | { | ||
117 | 109 | return shell_placement_strategy( | ||
118 | 110 | [this]() -> std::shared_ptr<ms::PlacementStrategy> | ||
119 | 111 | { | ||
120 | 112 | if (the_options()->is_set("fullscreen-surfaces")) | ||
121 | 113 | return std::make_shared<me::FullscreenPlacementStrategy>(the_shell_display_layout()); | ||
122 | 114 | else | ||
123 | 115 | return DefaultServerConfiguration::the_placement_strategy(); | ||
124 | 116 | }); | ||
125 | 117 | } | ||
126 | 118 | |||
127 | 119 | std::shared_ptr<mi::CompositeEventFilter> the_composite_event_filter() override | ||
128 | 120 | { | ||
129 | 121 | auto composite_filter = ServerConfiguration::the_composite_event_filter(); | ||
130 | 122 | for (auto const& filter : filter_list) | ||
131 | 123 | composite_filter->append(filter); | ||
132 | 124 | |||
133 | 125 | return composite_filter; | ||
134 | 126 | } | ||
135 | 127 | |||
136 | 128 | class NestedLifecycleEventListener : public msh::HostLifecycleEventListener | ||
137 | 129 | { | ||
138 | 130 | public: | ||
139 | 131 | virtual void lifecycle_event_occurred(MirLifecycleState state) override | ||
140 | 132 | { | ||
141 | 133 | printf("Lifecycle event occurred : state = %d\n", state); | ||
142 | 134 | } | ||
143 | 135 | }; | ||
144 | 136 | |||
145 | 137 | std::shared_ptr<msh::HostLifecycleEventListener> the_host_lifecycle_event_listener() override | ||
146 | 138 | { | ||
147 | 139 | return host_lifecycle_event_listener( | ||
148 | 140 | []() | ||
149 | 141 | { | ||
150 | 142 | return std::make_shared<NestedLifecycleEventListener>(); | ||
151 | 143 | }); | ||
152 | 144 | } | ||
153 | 145 | |||
154 | 146 | private: | ||
155 | 147 | std::vector<std::shared_ptr<mi::EventFilter>> const filter_list; | ||
156 | 148 | }; | ||
157 | 149 | |||
173 | 150 | } | 102 | } |
174 | 151 | } | 103 | } |
175 | 152 | 104 | ||
176 | 153 | int main(int argc, char const* argv[]) | 105 | int main(int argc, char const* argv[]) |
177 | 154 | try | 106 | try |
178 | 155 | { | 107 | { |
183 | 156 | auto wm = std::make_shared<me::WindowManager>(); | 108 | mir::Server server; |
184 | 157 | me::DemoServerConfiguration config(argc, argv, {wm}); | 109 | |
185 | 158 | 110 | auto const quit_filter = me::make_quit_filter_for(server); | |
186 | 159 | mir::run_mir(config, [&config, &wm](mir::DisplayServer&) | 111 | auto const wm = me::make_window_manager_for(server); |
187 | 112 | |||
188 | 113 | me::add_display_configuration_options_to(server); | ||
189 | 114 | me::add_fullscreen_option_to(server); | ||
190 | 115 | |||
191 | 116 | server.override_the_host_lifecycle_event_listener([] | ||
192 | 117 | { | ||
193 | 118 | return std::make_shared<me::NestedLifecycleEventListener>(); | ||
194 | 119 | }); | ||
195 | 120 | |||
196 | 121 | server.override_the_display_buffer_compositor_factory([&] | ||
197 | 160 | { | 122 | { |
204 | 161 | // We use this strange two stage initialization to avoid a circular dependency between the EventFilters | 123 | return std::make_shared<me::DisplayBufferCompositorFactory>( |
205 | 162 | // and the SessionStore | 124 | server.the_gl_program_factory(), |
206 | 163 | wm->set_focus_controller(config.the_focus_controller()); | 125 | server.the_compositor_report()); |
201 | 164 | wm->set_display(config.the_display()); | ||
202 | 165 | wm->set_compositor(config.the_compositor()); | ||
203 | 166 | wm->set_input_scene(config.the_input_scene()); | ||
207 | 167 | }); | 126 | }); |
209 | 168 | return 0; | 127 | |
210 | 128 | server.set_command_line(argc, argv); | ||
211 | 129 | server.apply_settings(); | ||
212 | 130 | server.run(); | ||
213 | 131 | return server.exited_normally() ? EXIT_SUCCESS : EXIT_FAILURE; | ||
214 | 169 | } | 132 | } |
215 | 170 | catch (...) | 133 | catch (...) |
216 | 171 | { | 134 | { |
219 | 172 | mir::report_exception(std::cerr); | 135 | mir::report_exception(); |
220 | 173 | return 1; | 136 | return EXIT_FAILURE; |
221 | 174 | } | 137 | } |
222 | 175 | 138 | ||
223 | === renamed file 'src/include/platform/mir/graphics/gl_primitive.h' => 'include/platform/mir/graphics/gl_primitive.h' | |||
224 | === renamed file 'src/include/platform/mir/graphics/gl_program.h' => 'include/platform/mir/graphics/gl_program.h' | |||
225 | === renamed file 'src/include/platform/mir/graphics/gl_program_factory.h' => 'include/platform/mir/graphics/gl_program_factory.h' | |||
226 | === renamed file 'src/include/platform/mir/graphics/gl_texture.h' => 'include/platform/mir/graphics/gl_texture.h' | |||
227 | === renamed file 'src/include/platform/mir/graphics/gl_texture_cache.h' => 'include/platform/mir/graphics/gl_texture_cache.h' | |||
228 | === renamed file 'src/include/server/mir/compositor/compositor_report.h' => 'include/server/mir/compositor/compositor_report.h' | |||
229 | === renamed file 'src/include/server/mir/compositor/destination_alpha.h' => 'include/server/mir/compositor/destination_alpha.h' | |||
230 | === renamed file 'src/include/server/mir/compositor/gl_renderer.h' => 'include/server/mir/compositor/gl_renderer.h' | |||
231 | === renamed file 'src/include/server/mir/compositor/recently_used_cache.h' => 'include/server/mir/compositor/recently_used_cache.h' | |||
232 | === renamed file 'src/include/server/mir/compositor/renderer.h' => 'include/server/mir/compositor/renderer.h' | |||
233 | === renamed file 'src/include/server/mir/compositor/renderer_factory.h' => 'include/server/mir/compositor/renderer_factory.h' | |||
234 | === modified file 'include/server/mir/default_server_configuration.h' | |||
235 | --- include/server/mir/default_server_configuration.h 2014-12-10 12:04:19 +0000 | |||
236 | +++ include/server/mir/default_server_configuration.h 2014-12-10 12:04:19 +0000 | |||
237 | @@ -320,10 +320,11 @@ | |||
238 | 320 | virtual std::shared_ptr<time::Clock> the_clock(); | 320 | virtual std::shared_ptr<time::Clock> the_clock(); |
239 | 321 | virtual std::shared_ptr<ServerActionQueue> the_server_action_queue(); | 321 | virtual std::shared_ptr<ServerActionQueue> the_server_action_queue(); |
240 | 322 | 322 | ||
241 | 323 | virtual std::shared_ptr<graphics::GLProgramFactory> the_gl_program_factory(); | ||
242 | 324 | |||
243 | 323 | protected: | 325 | protected: |
244 | 324 | std::shared_ptr<options::Option> the_options() const; | 326 | std::shared_ptr<options::Option> the_options() const; |
245 | 325 | 327 | ||
246 | 326 | virtual std::shared_ptr<graphics::GLProgramFactory> the_gl_program_factory(); | ||
247 | 327 | virtual std::shared_ptr<input::InputChannelFactory> the_input_channel_factory(); | 328 | virtual std::shared_ptr<input::InputChannelFactory> the_input_channel_factory(); |
248 | 328 | virtual std::shared_ptr<scene::MediatingDisplayChanger> the_mediating_display_changer(); | 329 | virtual std::shared_ptr<scene::MediatingDisplayChanger> the_mediating_display_changer(); |
249 | 329 | virtual std::shared_ptr<frontend::ProtobufIpcFactory> new_ipc_factory( | 330 | virtual std::shared_ptr<frontend::ProtobufIpcFactory> new_ipc_factory( |
250 | 330 | 331 | ||
251 | === renamed file 'src/include/server/mir/input/input_channel_factory.h' => 'include/server/mir/input/input_channel_factory.h' | |||
252 | === renamed file 'src/include/server/mir/input/scene.h' => 'include/server/mir/input/scene.h' | |||
253 | === modified file 'include/server/mir/server.h' | |||
254 | --- include/server/mir/server.h 2014-12-10 12:04:19 +0000 | |||
255 | +++ include/server/mir/server.h 2014-12-10 12:04:19 +0000 | |||
256 | @@ -27,10 +27,24 @@ | |||
257 | 27 | 27 | ||
258 | 28 | namespace mir | 28 | namespace mir |
259 | 29 | { | 29 | { |
261 | 30 | namespace compositor { class Compositor; class DisplayBufferCompositorFactory; } | 30 | namespace compositor { class Compositor; class CompositorReport; class DisplayBufferCompositorFactory; } |
262 | 31 | namespace frontend { class SessionAuthorizer; class Session; class SessionMediatorReport; } | 31 | namespace frontend { class SessionAuthorizer; class Session; class SessionMediatorReport; } |
265 | 32 | namespace graphics { class Platform; class Display; class GLConfig; class DisplayConfigurationPolicy; } | 32 | namespace graphics |
266 | 33 | namespace input { class CompositeEventFilter; class InputDispatcher; class CursorListener; class TouchVisualizer; } | 33 | { |
267 | 34 | class Platform; | ||
268 | 35 | class Display; | ||
269 | 36 | class GLConfig; | ||
270 | 37 | class GLProgramFactory; | ||
271 | 38 | class DisplayConfigurationPolicy; | ||
272 | 39 | } | ||
273 | 40 | namespace input | ||
274 | 41 | { | ||
275 | 42 | class CompositeEventFilter; | ||
276 | 43 | class CursorListener; | ||
277 | 44 | class InputDispatcher; | ||
278 | 45 | class Scene; | ||
279 | 46 | class TouchVisualizer; | ||
280 | 47 | } | ||
281 | 34 | namespace logging { class Logger; } | 48 | namespace logging { class Logger; } |
282 | 35 | namespace options { class Option; } | 49 | namespace options { class Option; } |
283 | 36 | namespace shell { class FocusController; class FocusSetter; class DisplayLayout; class HostLifecycleEventListener; } | 50 | namespace shell { class FocusController; class FocusSetter; class DisplayLayout; class HostLifecycleEventListener; } |
284 | @@ -279,6 +293,9 @@ | |||
285 | 279 | /// \return the composite event filter. | 293 | /// \return the composite event filter. |
286 | 280 | auto the_composite_event_filter() const -> std::shared_ptr<input::CompositeEventFilter>; | 294 | auto the_composite_event_filter() const -> std::shared_ptr<input::CompositeEventFilter>; |
287 | 281 | 295 | ||
288 | 296 | /// \return the compositor report. | ||
289 | 297 | auto the_compositor_report() const -> std::shared_ptr<compositor::CompositorReport>; | ||
290 | 298 | |||
291 | 282 | /// \return the cursor listener. | 299 | /// \return the cursor listener. |
292 | 283 | auto the_cursor_listener() const -> std::shared_ptr<input::CursorListener>; | 300 | auto the_cursor_listener() const -> std::shared_ptr<input::CursorListener>; |
293 | 284 | 301 | ||
294 | @@ -291,9 +308,15 @@ | |||
295 | 291 | /// \return the GL config. | 308 | /// \return the GL config. |
296 | 292 | auto the_gl_config() const -> std::shared_ptr<graphics::GLConfig>; | 309 | auto the_gl_config() const -> std::shared_ptr<graphics::GLConfig>; |
297 | 293 | 310 | ||
298 | 311 | /// \return the GL program factory. | ||
299 | 312 | auto the_gl_program_factory() const -> std::shared_ptr<graphics::GLProgramFactory>; | ||
300 | 313 | |||
301 | 294 | /// \return the graphics platform. | 314 | /// \return the graphics platform. |
302 | 295 | auto the_graphics_platform() const -> std::shared_ptr<graphics::Platform>; | 315 | auto the_graphics_platform() const -> std::shared_ptr<graphics::Platform>; |
303 | 296 | 316 | ||
304 | 317 | /// \return the input scene | ||
305 | 318 | auto the_input_scene() const -> std::shared_ptr<input::Scene>; | ||
306 | 319 | |||
307 | 297 | /// \return the main loop. | 320 | /// \return the main loop. |
308 | 298 | auto the_main_loop() const -> std::shared_ptr<MainLoop>; | 321 | auto the_main_loop() const -> std::shared_ptr<MainLoop>; |
309 | 299 | 322 | ||
310 | 300 | 323 | ||
311 | === removed directory 'playground' | |||
312 | === removed file 'playground/CMakeLists.txt' | |||
313 | --- playground/CMakeLists.txt 2014-12-10 12:04:19 +0000 | |||
314 | +++ playground/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
315 | @@ -1,16 +0,0 @@ | |||
316 | 1 | |||
317 | 2 | include_directories( | ||
318 | 3 | ${PROJECT_SOURCE_DIR}/src/include/server | ||
319 | 4 | ${PROJECT_SOURCE_DIR}/src/include/platform | ||
320 | 5 | ${PROJECT_SOURCE_DIR}/src/include/common | ||
321 | 6 | ${PROJECT_SOURCE_DIR}/include/client | ||
322 | 7 | ${PROJECT_SOURCE_DIR}/include/server | ||
323 | 8 | ${PROJECT_SOURCE_DIR}/include/platform | ||
324 | 9 | ${PROJECT_SOURCE_DIR}/examples/ | ||
325 | 10 | ) | ||
326 | 11 | |||
327 | 12 | add_library(playgroundserverconfig STATIC | ||
328 | 13 | server_configuration.cpp | ||
329 | 14 | ) | ||
330 | 15 | |||
331 | 16 | add_subdirectory(demo-shell/) | ||
332 | 17 | 0 | ||
333 | === removed file 'playground/README' | |||
334 | --- playground/README 2014-09-10 01:45:14 +0000 | |||
335 | +++ playground/README 1970-01-01 00:00:00 +0000 | |||
336 | @@ -1,6 +0,0 @@ | |||
337 | 1 | The Playground | ||
338 | 2 | |||
339 | 3 | These are mir demos that excercise private in-flux mir functionality. | ||
340 | 4 | As such functionality matures, related headers become public and the playground | ||
341 | 5 | code may become an example of how to use such feature. | ||
342 | 6 | |||
343 | 7 | 0 | ||
344 | === removed file 'playground/server_configuration.cpp' | |||
345 | --- playground/server_configuration.cpp 2014-12-08 17:10:25 +0000 | |||
346 | +++ playground/server_configuration.cpp 1970-01-01 00:00:00 +0000 | |||
347 | @@ -1,72 +0,0 @@ | |||
348 | 1 | /* | ||
349 | 2 | * Copyright © 2013-2014 Canonical Ltd. | ||
350 | 3 | * | ||
351 | 4 | * This program is free software: you can redistribute it and/or modify | ||
352 | 5 | * it under the terms of the GNU General Public License version 3 as | ||
353 | 6 | * published by the Free Software Foundation. | ||
354 | 7 | * | ||
355 | 8 | * This program is distributed in the hope that it will be useful, | ||
356 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
357 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
358 | 11 | * GNU General Public License for more details. | ||
359 | 12 | * | ||
360 | 13 | * You should have received a copy of the GNU General Public License | ||
361 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
362 | 15 | * | ||
363 | 16 | * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com> | ||
364 | 17 | */ | ||
365 | 18 | |||
366 | 19 | #include "server_configuration.h" | ||
367 | 20 | #include "mir/options/default_configuration.h" | ||
368 | 21 | #include "mir/input/composite_event_filter.h" | ||
369 | 22 | #include "mir/main_loop.h" | ||
370 | 23 | |||
371 | 24 | #include "server_example_display_configuration_policy.h" | ||
372 | 25 | #include "server_example_input_event_filter.h" | ||
373 | 26 | |||
374 | 27 | namespace me = mir::examples; | ||
375 | 28 | namespace mg = mir::graphics; | ||
376 | 29 | |||
377 | 30 | me::ServerConfiguration::ServerConfiguration(std::shared_ptr<options::DefaultConfiguration> const& configuration_options) : | ||
378 | 31 | DefaultServerConfiguration(configuration_options) | ||
379 | 32 | { | ||
380 | 33 | namespace po = boost::program_options; | ||
381 | 34 | |||
382 | 35 | configuration_options->add_options() | ||
383 | 36 | (me::display_config_opt, po::value<std::string>()->default_value(me::clone_opt_val), | ||
384 | 37 | me::display_config_descr); | ||
385 | 38 | } | ||
386 | 39 | |||
387 | 40 | me::ServerConfiguration::ServerConfiguration(int argc, char const** argv) : | ||
388 | 41 | ServerConfiguration(std::make_shared<options::DefaultConfiguration>(argc, argv)) | ||
389 | 42 | { | ||
390 | 43 | } | ||
391 | 44 | |||
392 | 45 | std::shared_ptr<mg::DisplayConfigurationPolicy> | ||
393 | 46 | me::ServerConfiguration::the_display_configuration_policy() | ||
394 | 47 | { | ||
395 | 48 | return display_configuration_policy( | ||
396 | 49 | [this]() -> std::shared_ptr<mg::DisplayConfigurationPolicy> | ||
397 | 50 | { | ||
398 | 51 | auto display_config = the_options()->get<std::string>(me::display_config_opt); | ||
399 | 52 | |||
400 | 53 | if (display_config == me::sidebyside_opt_val) | ||
401 | 54 | return std::make_shared<SideBySideDisplayConfigurationPolicy>(); | ||
402 | 55 | else if (display_config == me::single_opt_val) | ||
403 | 56 | return std::make_shared<SingleDisplayConfigurationPolicy>(); | ||
404 | 57 | else | ||
405 | 58 | return DefaultServerConfiguration::the_display_configuration_policy(); | ||
406 | 59 | }); | ||
407 | 60 | } | ||
408 | 61 | |||
409 | 62 | std::shared_ptr<mir::input::CompositeEventFilter> | ||
410 | 63 | me::ServerConfiguration::the_composite_event_filter() | ||
411 | 64 | { | ||
412 | 65 | if (!quit_filter) | ||
413 | 66 | quit_filter = std::make_shared<me::QuitFilter>([this] { the_main_loop()->stop(); }); | ||
414 | 67 | |||
415 | 68 | auto composite_filter = DefaultServerConfiguration::the_composite_event_filter(); | ||
416 | 69 | composite_filter->append(quit_filter); | ||
417 | 70 | |||
418 | 71 | return composite_filter; | ||
419 | 72 | } | ||
420 | 73 | 0 | ||
421 | === removed file 'playground/server_configuration.h' | |||
422 | --- playground/server_configuration.h 2014-10-15 11:15:21 +0000 | |||
423 | +++ playground/server_configuration.h 1970-01-01 00:00:00 +0000 | |||
424 | @@ -1,50 +0,0 @@ | |||
425 | 1 | /* | ||
426 | 2 | * Copyright © 2013-2014 Canonical Ltd. | ||
427 | 3 | * | ||
428 | 4 | * This program is free software: you can redistribute it and/or modify | ||
429 | 5 | * it under the terms of the GNU General Public License version 3 as | ||
430 | 6 | * published by the Free Software Foundation. | ||
431 | 7 | * | ||
432 | 8 | * This program is distributed in the hope that it will be useful, | ||
433 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
434 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
435 | 11 | * GNU General Public License for more details. | ||
436 | 12 | * | ||
437 | 13 | * You should have received a copy of the GNU General Public License | ||
438 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
439 | 15 | * | ||
440 | 16 | * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com> | ||
441 | 17 | */ | ||
442 | 18 | |||
443 | 19 | #ifndef MIR_EXAMPLES_SERVER_CONFIGURATION_H_ | ||
444 | 20 | #define MIR_EXAMPLES_SERVER_CONFIGURATION_H_ | ||
445 | 21 | |||
446 | 22 | #include "mir/default_server_configuration.h" | ||
447 | 23 | |||
448 | 24 | namespace mir | ||
449 | 25 | { | ||
450 | 26 | namespace options | ||
451 | 27 | { | ||
452 | 28 | class DefaultConfiguration; | ||
453 | 29 | } | ||
454 | 30 | |||
455 | 31 | namespace examples | ||
456 | 32 | { | ||
457 | 33 | |||
458 | 34 | class ServerConfiguration : public DefaultServerConfiguration | ||
459 | 35 | { | ||
460 | 36 | public: | ||
461 | 37 | ServerConfiguration(int argc, char const** argv); | ||
462 | 38 | explicit ServerConfiguration(std::shared_ptr<options::DefaultConfiguration> const& configuration_options); | ||
463 | 39 | |||
464 | 40 | std::shared_ptr<graphics::DisplayConfigurationPolicy> the_display_configuration_policy() override; | ||
465 | 41 | std::shared_ptr<input::CompositeEventFilter> the_composite_event_filter() override; | ||
466 | 42 | |||
467 | 43 | private: | ||
468 | 44 | std::shared_ptr<input::EventFilter> quit_filter; | ||
469 | 45 | }; | ||
470 | 46 | |||
471 | 47 | } | ||
472 | 48 | } | ||
473 | 49 | |||
474 | 50 | #endif /* MIR_EXAMPLES_SERVER_CONFIGURATION_H_ */ | ||
475 | 51 | 0 | ||
476 | === modified file 'server-ABI-sha1sums' | |||
477 | --- server-ABI-sha1sums 2014-12-10 12:04:19 +0000 | |||
478 | +++ server-ABI-sha1sums 2014-12-10 12:04:19 +0000 | |||
479 | @@ -55,7 +55,7 @@ | |||
480 | 55 | d49eae4f986645b32e29ce2c1f99f524703ba3c0 include/server/mir/compositor/display_buffer_compositor.h | 55 | d49eae4f986645b32e29ce2c1f99f524703ba3c0 include/server/mir/compositor/display_buffer_compositor.h |
481 | 56 | 878ab5c4007d16dac213a3eb0105421d8ffad206 include/server/mir/compositor/scene_element.h | 56 | 878ab5c4007d16dac213a3eb0105421d8ffad206 include/server/mir/compositor/scene_element.h |
482 | 57 | 4fcf34e424128b87ddc76733594e32e09ebbd486 include/server/mir/compositor/scene.h | 57 | 4fcf34e424128b87ddc76733594e32e09ebbd486 include/server/mir/compositor/scene.h |
484 | 58 | 27a9e95846f83126b6aed4f910188c6d2491c47c include/server/mir/default_server_configuration.h | 58 | 81572766d104d97c29d41d03657190b7af114525 include/server/mir/default_server_configuration.h |
485 | 59 | af1ff0714be973ac76d56006a2e5991f68cd1dec include/server/mir/display_server.h | 59 | af1ff0714be973ac76d56006a2e5991f68cd1dec include/server/mir/display_server.h |
486 | 60 | a35c5495d8fd28fc0e375b17495fc5caab51b329 include/server/mir/emergency_cleanup.h | 60 | a35c5495d8fd28fc0e375b17495fc5caab51b329 include/server/mir/emergency_cleanup.h |
487 | 61 | 938de641cb0e01e1098b007b39b151a7dfe4adc1 include/server/mir/frontend/display_changer.h | 61 | 938de641cb0e01e1098b007b39b151a7dfe4adc1 include/server/mir/frontend/display_changer.h |
488 | @@ -104,7 +104,7 @@ | |||
489 | 104 | 587e22d751656ce2d9536afdf5659276ff9bbc46 include/server/mir/scene/surface_observer.h | 104 | 587e22d751656ce2d9536afdf5659276ff9bbc46 include/server/mir/scene/surface_observer.h |
490 | 105 | 7ef3e99901168cda296d74d05a979f47bf9c3ff1 include/server/mir/server_action_queue.h | 105 | 7ef3e99901168cda296d74d05a979f47bf9c3ff1 include/server/mir/server_action_queue.h |
491 | 106 | 8d83a51c278b8b71866d2178d9b6387c1f91a7d0 include/server/mir/server_configuration.h | 106 | 8d83a51c278b8b71866d2178d9b6387c1f91a7d0 include/server/mir/server_configuration.h |
493 | 107 | e56a255135af4099001b7e31f76530b40d3bd7fa include/server/mir/server.h | 107 | 7861509c90830bd7127c74f83f92c1da77543eac include/server/mir/server.h |
494 | 108 | 86098b500339bfccd07a9bed8298f75a68b18f5c include/server/mir/server_status_listener.h | 108 | 86098b500339bfccd07a9bed8298f75a68b18f5c include/server/mir/server_status_listener.h |
495 | 109 | 860c04f32b60e680140148dc9dc2295de145b9c1 include/server/mir/shell/display_layout.h | 109 | 860c04f32b60e680140148dc9dc2295de145b9c1 include/server/mir/shell/display_layout.h |
496 | 110 | 6a2107b01feae13060d5c305804906e53c52e0be include/server/mir/shell/focus_controller.h | 110 | 6a2107b01feae13060d5c305804906e53c52e0be include/server/mir/shell/focus_controller.h |
497 | 111 | 111 | ||
498 | === modified file 'src/server/server.cpp' | |||
499 | --- src/server/server.cpp 2014-12-10 12:04:19 +0000 | |||
500 | +++ src/server/server.cpp 2014-12-10 12:04:19 +0000 | |||
501 | @@ -67,10 +67,13 @@ | |||
502 | 67 | #define FOREACH_ACCESSOR(MACRO)\ | 67 | #define FOREACH_ACCESSOR(MACRO)\ |
503 | 68 | MACRO(the_compositor)\ | 68 | MACRO(the_compositor)\ |
504 | 69 | MACRO(the_composite_event_filter)\ | 69 | MACRO(the_composite_event_filter)\ |
505 | 70 | MACRO(the_compositor_report)\ | ||
506 | 70 | MACRO(the_display)\ | 71 | MACRO(the_display)\ |
507 | 71 | MACRO(the_focus_controller)\ | 72 | MACRO(the_focus_controller)\ |
508 | 72 | MACRO(the_gl_config)\ | 73 | MACRO(the_gl_config)\ |
509 | 74 | MACRO(the_gl_program_factory)\ | ||
510 | 73 | MACRO(the_graphics_platform)\ | 75 | MACRO(the_graphics_platform)\ |
511 | 76 | MACRO(the_input_scene)\ | ||
512 | 74 | MACRO(the_main_loop)\ | 77 | MACRO(the_main_loop)\ |
513 | 75 | MACRO(the_prompt_session_listener)\ | 78 | MACRO(the_prompt_session_listener)\ |
514 | 76 | MACRO(the_session_authorizer)\ | 79 | MACRO(the_session_authorizer)\ |
515 | 77 | 80 | ||
516 | === modified file 'src/server/symbols.map' | |||
517 | --- src/server/symbols.map 2014-12-10 12:04:19 +0000 | |||
518 | +++ src/server/symbols.map 2014-12-10 12:04:19 +0000 | |||
519 | @@ -443,11 +443,14 @@ | |||
520 | 443 | mir::Server::supported_pixel_formats*; | 443 | mir::Server::supported_pixel_formats*; |
521 | 444 | mir::Server::the_composite_event_filter*; | 444 | mir::Server::the_composite_event_filter*; |
522 | 445 | mir::Server::the_compositor*; | 445 | mir::Server::the_compositor*; |
523 | 446 | mir::Server::the_compositor_report*; | ||
524 | 446 | mir::Server::the_cursor_listener*; | 447 | mir::Server::the_cursor_listener*; |
525 | 447 | mir::Server::the_display*; | 448 | mir::Server::the_display*; |
526 | 448 | mir::Server::the_focus_controller*; | 449 | mir::Server::the_focus_controller*; |
527 | 449 | mir::Server::the_gl_config*; | 450 | mir::Server::the_gl_config*; |
528 | 451 | mir::Server::the_gl_program_factory*; | ||
529 | 450 | mir::Server::the_graphics_platform*; | 452 | mir::Server::the_graphics_platform*; |
530 | 453 | mir::Server::the_input_scene*; | ||
531 | 451 | mir::Server::the_main_loop*; | 454 | mir::Server::the_main_loop*; |
532 | 452 | mir::Server::the_prompt_session_listener*; | 455 | mir::Server::the_prompt_session_listener*; |
533 | 453 | mir::Server::the_prompt_session_manager*; | 456 | mir::Server::the_prompt_session_manager*; |
534 | 454 | 457 | ||
535 | === modified file 'tests/unit-tests/examples/test_demo_compositor.cpp' | |||
536 | --- tests/unit-tests/examples/test_demo_compositor.cpp 2014-12-05 03:26:03 +0000 | |||
537 | +++ tests/unit-tests/examples/test_demo_compositor.cpp 2014-12-10 12:04:19 +0000 | |||
538 | @@ -16,7 +16,7 @@ | |||
539 | 16 | * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com> | 16 | * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com> |
540 | 17 | */ | 17 | */ |
541 | 18 | 18 | ||
543 | 19 | #include "playground/demo-shell/demo_compositor.h" | 19 | #include "examples/demo-shell/demo_compositor.h" |
544 | 20 | 20 | ||
545 | 21 | #include "mir/geometry/rectangle.h" | 21 | #include "mir/geometry/rectangle.h" |
546 | 22 | #include "mir/compositor/scene_element.h" | 22 | #include "mir/compositor/scene_element.h" |
547 | 23 | 23 | ||
548 | === modified file 'tests/unit-tests/examples/test_demo_renderer.cpp' | |||
549 | --- tests/unit-tests/examples/test_demo_renderer.cpp 2014-12-05 03:26:03 +0000 | |||
550 | +++ tests/unit-tests/examples/test_demo_renderer.cpp 2014-12-10 12:04:19 +0000 | |||
551 | @@ -21,7 +21,7 @@ | |||
552 | 21 | #include "mir_test_doubles/fake_renderable.h" | 21 | #include "mir_test_doubles/fake_renderable.h" |
553 | 22 | #include "mir_test_doubles/stub_gl_program_factory.h" | 22 | #include "mir_test_doubles/stub_gl_program_factory.h" |
554 | 23 | #include "mir_test_doubles/mock_gl.h" | 23 | #include "mir_test_doubles/mock_gl.h" |
556 | 24 | #include "playground/demo-shell/demo_renderer.h" | 24 | #include "examples/demo-shell/demo_renderer.h" |
557 | 25 | #include <gtest/gtest.h> | 25 | #include <gtest/gtest.h> |
558 | 26 | 26 | ||
559 | 27 | namespace mtd = mir::test::doubles; | 27 | namespace mtd = mir::test::doubles; |
Our downstreams have been able to get along without our utility classes ( suggestion to others as to how they should use GLES.
gl_program, gl_texture, gl_primitive, gl_renderer, etc) to this point, and re-exposing them exposes a lot of ABI that has been hidden and is not used. These classes are more utility classes of the way we've used GLES internally than a recommendation/
I think its possible to transition the demo shell from playground to examples with a bit of more in-depth "surgery" to have it target reimplementing our already-exposed /interfaces/ instead of overriding different components of utility classes.