Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
default_server_configuration.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2012 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Alan Griffiths <alan@octopull.co.uk>
17  */
18 #ifndef MIR_DEFAULT_SERVER_CONFIGURATION_H_
19 #define MIR_DEFAULT_SERVER_CONFIGURATION_H_
20 
21 #include "mir/cached_ptr.h"
24 
25 #include <memory>
26 #include <string>
27 
28 namespace mir
29 {
30 namespace compositor
31 {
32 class Renderer;
33 class BufferStreamFactory;
34 class Scene;
35 class Drawer;
36 class DisplayBufferCompositorFactory;
37 class Compositor;
38 class OverlayRenderer;
39 class RendererFactory;
40 }
41 namespace frontend
42 {
43 class Shell;
44 class Connector;
45 class ConnectorReport;
46 class ProtobufIpcFactory;
47 class SessionCreator;
48 class SessionMediatorReport;
49 class MessageProcessorReport;
50 class SessionAuthorizer;
51 class EventSink;
52 class DisplayChanger;
53 }
54 
55 namespace shell
56 {
57 class SurfaceFactory;
58 class SurfaceBuilder;
59 class SurfaceController;
60 class InputTargeter;
61 class SessionContainer;
62 class FocusSetter;
63 class FocusSequence;
64 class PlacementStrategy;
65 class SessionListener;
66 class FocusController;
67 class SessionManager;
68 class PixelBuffer;
69 class SnapshotStrategy;
70 class DisplayLayout;
71 class SurfaceConfigurator;
72 class MediatingDisplayChanger;
73 class SessionEventSink;
74 class SessionEventHandlerRegister;
75 class BroadcastingSessionEventSink;
76 }
77 namespace time
78 {
79 class TimeSource;
80 }
81 namespace surfaces
82 {
83 class BufferStreamFactory;
84 class SurfaceStackModel;
85 class SurfaceStack;
86 class SurfaceController;
87 class InputRegistrar;
88 }
89 namespace graphics
90 {
91 class Platform;
92 class Display;
93 class BufferInitializer;
94 class DisplayReport;
95 class GraphicBufferAllocator;
96 namespace nested { class HostConnection; }
97 }
98 namespace input
99 {
100 class InputReport;
101 class InputManager;
102 class CompositeEventFilter;
103 class InputChannelFactory;
104 class InputConfiguration;
105 class CursorListener;
106 class InputRegion;
107 class NestedInputRelay;
108 }
109 
110 namespace logging
111 {
112 class Logger;
113 }
114 
116 {
117 public:
118  DefaultServerConfiguration(int argc, char const* argv[]);
119 
123  virtual std::shared_ptr<frontend::Connector> the_connector();
124  virtual std::shared_ptr<graphics::Display> the_display();
125  virtual std::shared_ptr<compositor::Compositor> the_compositor();
126  virtual std::shared_ptr<input::InputManager> the_input_manager();
127  virtual std::shared_ptr<MainLoop> the_main_loop();
128  virtual std::shared_ptr<PauseResumeListener> the_pause_resume_listener();
129  virtual std::shared_ptr<DisplayChanger> the_display_changer();
130  virtual std::shared_ptr<graphics::Platform> the_graphics_platform();
131  virtual std::shared_ptr<input::InputConfiguration> the_input_configuration();
137  virtual std::shared_ptr<graphics::BufferInitializer> the_buffer_initializer();
138  virtual std::shared_ptr<compositor::RendererFactory> the_renderer_factory();
139  virtual std::shared_ptr<graphics::DisplayConfigurationPolicy> the_display_configuration_policy();
140  virtual std::shared_ptr<graphics::nested::HostConnection> the_host_connection();
141  virtual std::shared_ptr<input::NestedInputRelay> the_nested_input_relay();
147  virtual std::shared_ptr<graphics::DisplayReport> the_display_report();
153  virtual std::shared_ptr<compositor::DisplayBufferCompositorFactory> the_display_buffer_compositor_factory();
154  virtual std::shared_ptr<compositor::OverlayRenderer> the_overlay_renderer();
160  virtual std::shared_ptr<graphics::GraphicBufferAllocator> the_buffer_allocator();
161  virtual std::shared_ptr<compositor::Scene> the_scene();
167  virtual std::shared_ptr<frontend::SessionMediatorReport> the_session_mediator_report();
168  virtual std::shared_ptr<frontend::MessageProcessorReport> the_message_processor_report();
169  virtual std::shared_ptr<frontend::SessionAuthorizer> the_session_authorizer();
170  virtual std::shared_ptr<frontend::Shell> the_frontend_shell();
171  virtual std::shared_ptr<frontend::EventSink> the_global_event_sink();
172  virtual std::shared_ptr<frontend::DisplayChanger> the_frontend_display_changer();
176  virtual std::shared_ptr<frontend::SessionCreator> the_session_creator();
177  virtual std::shared_ptr<frontend::ConnectorReport> the_connector_report();
181  virtual std::shared_ptr<shell::FocusController> the_focus_controller();
182 
186  virtual std::shared_ptr<shell::SurfaceFactory> the_shell_surface_factory();
187  virtual std::shared_ptr<shell::SessionContainer> the_shell_session_container();
188  virtual std::shared_ptr<shell::FocusSetter> the_shell_focus_setter();
189  virtual std::shared_ptr<shell::FocusSequence> the_shell_focus_sequence();
190  virtual std::shared_ptr<shell::PlacementStrategy> the_shell_placement_strategy();
191  virtual std::shared_ptr<shell::SessionListener> the_shell_session_listener();
192  virtual std::shared_ptr<shell::PixelBuffer> the_shell_pixel_buffer();
193  virtual std::shared_ptr<shell::SnapshotStrategy> the_shell_snapshot_strategy();
194  virtual std::shared_ptr<shell::DisplayLayout> the_shell_display_layout();
195  virtual std::shared_ptr<shell::SurfaceConfigurator> the_shell_surface_configurator();
196  virtual std::shared_ptr<shell::SessionEventSink> the_shell_session_event_sink();
197  virtual std::shared_ptr<shell::SessionEventHandlerRegister> the_shell_session_event_handler_register();
203  virtual std::shared_ptr<shell::SurfaceBuilder> the_surface_builder();
204  virtual std::shared_ptr<surfaces::SurfaceController> the_surface_controller();
205 
212  virtual std::shared_ptr<surfaces::SurfaceStackModel> the_surface_stack_model();
218  virtual std::shared_ptr<surfaces::BufferStreamFactory> the_buffer_stream_factory();
224  virtual std::shared_ptr<input::InputReport> the_input_report();
225  virtual std::shared_ptr<input::CompositeEventFilter> the_composite_event_filter();
226  virtual std::shared_ptr<surfaces::InputRegistrar> the_input_registrar();
227  virtual std::shared_ptr<shell::InputTargeter> the_input_targeter();
228  virtual std::shared_ptr<input::CursorListener> the_cursor_listener();
229  virtual std::shared_ptr<input::InputRegion> the_input_region();
235  virtual std::shared_ptr<logging::Logger> the_logger();
238  virtual std::shared_ptr<time::TimeSource> the_time_source();
239 
240  virtual std::shared_ptr<shell::SessionManager> the_session_manager();
241 
242 protected:
243  // add_options() allows configuration specializations to add their
244  // own options. This MUST be called before the first invocation of
245  // the_options() - typically during construction.
246  boost::program_options::options_description_easy_init add_options();
247  virtual void parse_options(boost::program_options::options_description& options_description, options::ProgramOption& options) const;
248  virtual std::shared_ptr<options::Option> the_options() const;
249 
250  virtual std::shared_ptr<input::InputChannelFactory> the_input_channel_factory();
251  virtual std::shared_ptr<shell::MediatingDisplayChanger> the_mediating_display_changer();
252  virtual std::shared_ptr<shell::BroadcastingSessionEventSink> the_broadcasting_session_event_sink();
253 
256 
257 
259 
271 
306 
308 
309 private:
310  int const argc;
311  char const** const argv;
312  std::shared_ptr<boost::program_options::options_description> const program_options;
313  std::shared_ptr<input::EventFilter> const default_filter;
314  std::shared_ptr<options::Option> mutable options;
315 
316  // the communications interface to use
317  virtual std::shared_ptr<frontend::ProtobufIpcFactory> the_ipc_factory(
318  std::shared_ptr<frontend::Shell> const& shell,
319  std::shared_ptr<graphics::GraphicBufferAllocator> const& allocator);
320 
321  virtual std::string the_socket_file() const;
322 };
323 }
324 
325 
326 #endif /* MIR_DEFAULT_SERVER_CONFIGURATION_H_ */

Copyright © 2012,2013 Canonical Ltd.
Generated on Tue Oct 15 00:23:28 UTC 2013