Mir
|
Runner for applying initialization options to Mir. More...
#include <runner.h>
Public Member Functions | |
MirRunner (int argc, char const *argv[]) | |
MirRunner (int argc, char const *argv[], char const *config_file) | |
~MirRunner () | |
void | add_start_callback (std::function< void()> const &start_callback) |
Add a callback to be invoked when the server has started, If multiple callbacks are added they will be invoked in the sequence added. More... | |
void | add_stop_callback (std::function< void()> const &stop_callback) |
Add a callback to be invoked when the server is about to stop, If multiple callbacks are added they will be invoked in the reverse sequence added. More... | |
void | register_signal_handler (std::initializer_list< int > signals, std::function< void(int)> const &handler) |
Add signal handler to the server's main loop. More... | |
auto | register_fd_handler (mir::Fd fd, std::function< void(int)> const &handler) -> std::unique_ptr< miral::FdHandle > |
Add a watch on a file descriptor. The handler will be triggered when there is data to read on the Fd. More... | |
void | set_exception_handler (std::function< void()> const &handler) |
Set a handler for exceptions caught in run_with(). run_with() invokes handler() in catch (...) blocks before returning EXIT_FAILURE. Hence the exception can be re-thrown to retrieve type information. The default action is to call mir::report_exception(std::cerr) More... | |
auto | run_with (std::initializer_list< std::function< void(::mir::Server &)> > options) -> int |
Apply the supplied initialization options and run the Mir server. More... | |
void | stop () |
Tell the Mir server to exit. More... | |
auto | config_file () const -> std::string |
Name of the .config file. The .config file is located via the XDG Base Directory Specification: $XDG_CONFIG_HOME or $HOME/.config followed by $XDG_CONFIG_DIRS Config file entries are long form (e.g. "x11-output=1200x720") More... | |
auto | display_config_file () const -> std::string |
Name of the .display configuration file. The .display file is located via the XDG Base Directory Specification: $XDG_CONFIG_HOME or $HOME/.config followed by $XDG_CONFIG_DIRS Config file entries are long form (e.g. "x11-output=1200x720") More... | |
auto | wayland_display () const -> mir::optional_value< std::string > |
Get the Wayland endpoint name (if any) usable as a $WAYLAND_DISPLAY value. More... | |
auto | x11_display () const -> mir::optional_value< std::string > |
Get the X11 socket name (if any) usable as a $DISPLAY value. More... | |
Runner for applying initialization options to Mir.
miral::MirRunner::MirRunner | ( | int | argc, |
char const * | argv[] | ||
) |
miral::MirRunner::MirRunner | ( | int | argc, |
char const * | argv[], | ||
char const * | config_file | ||
) |
miral::MirRunner::~MirRunner | ( | ) |
void miral::MirRunner::add_start_callback | ( | std::function< void()> const & | start_callback | ) |
Add a callback to be invoked when the server has started, If multiple callbacks are added they will be invoked in the sequence added.
void miral::MirRunner::add_stop_callback | ( | std::function< void()> const & | stop_callback | ) |
Add a callback to be invoked when the server is about to stop, If multiple callbacks are added they will be invoked in the reverse sequence added.
auto miral::MirRunner::config_file | ( | ) | const -> std::string |
Name of the .config file. The .config file is located via the XDG Base Directory Specification: $XDG_CONFIG_HOME or $HOME/.config followed by $XDG_CONFIG_DIRS Config file entries are long form (e.g. "x11-output=1200x720")
auto miral::MirRunner::display_config_file | ( | ) | const -> std::string |
Name of the .display configuration file. The .display file is located via the XDG Base Directory Specification: $XDG_CONFIG_HOME or $HOME/.config followed by $XDG_CONFIG_DIRS Config file entries are long form (e.g. "x11-output=1200x720")
auto miral::MirRunner::register_fd_handler | ( | mir::Fd | fd, |
std::function< void(int)> const & | handler | ||
) | -> std::unique_ptr< miral::FdHandle > |
Add a watch on a file descriptor. The handler will be triggered when there is data to read on the Fd.
void miral::MirRunner::register_signal_handler | ( | std::initializer_list< int > | signals, |
std::function< void(int)> const & | handler | ||
) |
Add signal handler to the server's main loop.
auto miral::MirRunner::run_with | ( | std::initializer_list< std::function< void(::mir::Server &)> > | options | ) | -> int |
Apply the supplied initialization options and run the Mir server.
void miral::MirRunner::set_exception_handler | ( | std::function< void()> const & | handler | ) |
Set a handler for exceptions caught in run_with(). run_with() invokes handler() in catch (...) blocks before returning EXIT_FAILURE. Hence the exception can be re-thrown to retrieve type information. The default action is to call mir::report_exception(std::cerr)
void miral::MirRunner::stop | ( | ) |
Tell the Mir server to exit.
auto miral::MirRunner::wayland_display | ( | ) | const -> mir::optional_value< std::string > |
Get the Wayland endpoint name (if any) usable as a $WAYLAND_DISPLAY value.
auto miral::MirRunner::x11_display | ( | ) | const -> mir::optional_value< std::string > |
Get the X11 socket name (if any) usable as a $DISPLAY value.
Copyright © 2012-2023
Canonical Ltd.
Generated on Tue 2 May 10:01:24 UTC 2023
This documentation is licensed under the GPL version 2 or 3.