31 template<
class Observer>
32 class ObserverRegistrar;
34 namespace compositor {
class Compositor;
class DisplayBufferCompositorFactory;
class CompositorReport; }
35 namespace frontend {
class SessionAuthorizer;
class Session;
class SessionMediatorObserver; }
36 namespace graphics {
class Cursor;
class Platform;
class Display;
class GLConfig;
class DisplayConfigurationPolicy;
class DisplayConfigurationObserver; }
37 namespace input {
class CompositeEventFilter;
class InputDispatcher;
class CursorListener;
class CursorImages;
class TouchVisualizer;
class InputDeviceHub;}
38 namespace logging {
class Logger; }
39 namespace options {
class Option; }
42 using Secret = std::vector<uint8_t>;
48 class DisplayConfigurationController;
49 class FocusController;
50 class HostLifecycleEventListener;
52 class PersistentSurfaceStore;
58 class ApplicationNotRespondingDetector;
59 class BufferStreamFactory;
60 class PromptSessionListener;
61 class PromptSessionManager;
62 class SessionListener;
63 class SessionCoordinator;
65 class CoordinateTranslator;
74 class ServerStatusListener;
93 void set_command_line(
int argc,
char const* argv[]);
99 void apply_settings();
102 auto supported_pixel_formats()
const -> std::vector<MirPixelFormat>;
111 bool exited_normally();
119 void add_configuration_option(
130 void add_configuration_option(
133 double default_value);
138 void add_configuration_option(
146 void add_configuration_option(
149 char const* default_value);
154 void add_configuration_option(
162 void add_configuration_option(
174 void set_command_line_handler(
175 std::function<
void(
int argc,
char const*
const* argv)>
const& command_line_hander);
181 void set_config_filename(
std::string const& config_file);
186 auto get_options()
const -> std::shared_ptr<options::Option>;
193 void add_pre_init_callback(std::function<
void()>
const& pre_init_callback);
201 void add_init_callback(std::function<
void()>
const& init_callback);
205 void add_stop_callback(std::function<
void()>
const& stop_callback);
210 void set_exception_handler(std::function<
void()>
const& exception_handler);
220 void set_terminator(
Terminator const& terminator);
240 template<
typename T>
using Builder = std::function<std::shared_ptr<T>()>;
251 void override_the_display_buffer_compositor_factory(
263 void override_the_coordinate_translator(
267 void override_the_host_lifecycle_event_listener(
298 void override_the_application_not_responding_detector(
305 template<
typename T>
using Wrapper = std::function<std::shared_ptr<T>(std::shared_ptr<T>
const&)>;
314 void wrap_display_buffer_compositor_factory(
336 auto the_compositor() const ->
std::shared_ptr<compositor::Compositor>;
340 auto the_compositor_report() const ->
std::shared_ptr<compositor::CompositorReport>;
343 auto the_composite_event_filter() const ->
std::shared_ptr<input::CompositeEventFilter>;
346 auto the_cursor_listener() const ->
std::shared_ptr<input::CursorListener>;
349 auto the_cursor() const ->
std::shared_ptr<graphics::Cursor>;
352 auto the_focus_controller() const ->
std::shared_ptr<shell::FocusController>;
355 auto the_display() const ->
std::shared_ptr<graphics::Display>;
357 auto the_display_configuration_controller() const ->
std::shared_ptr<shell::DisplayConfigurationController>;
360 auto the_gl_config() const ->
std::shared_ptr<graphics::GLConfig>;
363 auto the_graphics_platform() const ->
std::shared_ptr<graphics::Platform>;
366 auto the_input_targeter() const ->
std::shared_ptr<shell::InputTargeter>;
369 auto the_logger() const ->
std::shared_ptr<logging::Logger>;
372 auto the_main_loop() const ->
std::shared_ptr<
MainLoop>;
375 auto the_prompt_session_listener() const ->
std::shared_ptr<scene::PromptSessionListener>;
378 auto the_prompt_session_manager() const ->
std::shared_ptr<scene::PromptSessionManager>;
381 auto the_session_authorizer() const ->
std::shared_ptr<frontend::SessionAuthorizer>;
384 auto the_session_coordinator() const ->
std::shared_ptr<scene::SessionCoordinator>;
387 auto the_session_listener() const ->
std::shared_ptr<scene::SessionListener>;
390 auto the_shell() const ->
std::shared_ptr<shell::Shell>;
393 auto the_shell_display_layout() const ->
std::shared_ptr<shell::DisplayLayout>;
396 auto the_buffer_stream_factory() const ->
std::shared_ptr<scene::BufferStreamFactory>;
399 auto the_surface_factory() const ->
std::shared_ptr<scene::SurfaceFactory>;
402 auto the_surface_stack() const ->
std::shared_ptr<shell::SurfaceStack>;
405 auto the_touch_visualizer() const ->
std::shared_ptr<input::TouchVisualizer>;
408 auto the_input_device_hub() const ->
std::shared_ptr<input::InputDeviceHub>;
411 auto the_application_not_responding_detector() const ->
412 std::shared_ptr<scene::ApplicationNotRespondingDetector>;
415 auto the_persistent_surface_store() const ->
std::shared_ptr<shell::PersistentSurfaceStore>;
418 auto the_display_configuration_observer_registrar() const ->
422 auto the_seat_observer_registrar() const ->
426 auto the_session_mediator_observer_registrar() const ->
442 auto open_client_socket() ->
Fd;
448 auto open_client_socket(
ConnectHandler const& connect_handler) -> Fd;
453 auto open_prompt_socket() -> Fd;
457 struct ServerConfiguration;
459 std::shared_ptr<Self> const self;
Definition: as_render_target.h:27
Customise and run a Mir server.
Definition: server.h:85
std::function< std::shared_ptr< T >(std::shared_ptr< T > const &)> Wrapper
Each of the wrap functions takes a wrapper functor of the same form.
Definition: server.h:305
std::function< void()> EmergencyCleanupHandler
Functor for processing fatal signals for any "emergency cleanup". That is: SIGQUIT, SIGABRT, SIGFPE, SIGSEGV & SIGBUS.
Definition: server.h:227
std::function< std::shared_ptr< T >()> Builder
Each of the override functions takes a builder functor of the same form.
Definition: server.h:242
Definition: main_loop.h:30
OptionType
Definition: server.h:76
Register observers for a subsystem.
Definition: observer_registrar.h:34
std::function< void(int signal)> Terminator
Functor for processing SIGTERM or SIGINT This will not be called directly by a signal handler: arbitr...
Definition: server.h:214
std::function< void(std::shared_ptr< frontend::Session > const &session)> ConnectHandler
Definition: server.h:437
std::function< std::shared_ptr< WindowManager >(FocusController *focus_controller)> WindowManagerBuilder
WindowManagers are built while initializing an AbstractShell, so a builder functor is needed...
Definition: window_manager_builder.h:34
std::vector< uint8_t > Secret
Definition: authority.h:33