Mir
Namespaces | Classes | Typedefs | Functions
miral Namespace Reference

Mir Abstraction Layer. More...

Namespaces

namespace  detail
 
namespace  toolkit
 

Classes

class  AddInitCallback
 Add a callback to be invoked when the server has been initialized, but before it starts. If multiple callbacks are added they will be invoked in the sequence added. More...
 
class  AppendEventFilter
 
class  ApplicationAuthorizer
 
class  ApplicationCredentials
 
struct  ApplicationInfo
 
class  BasicSetApplicationAuthorizer
 
class  CanonicalWindowManagerPolicy
 Widely accepted defaults for window management. More...
 
class  ConfigurationOption
 Add a user configuration option to Mir's option handling. By default the callback will be invoked following Mir initialisation but prior to the server starting. The value supplied to the callback will come from the command line, environment variable, config file or the default. More...
 
class  CursorTheme
 Load an X-cursor theme, either the supplied default, or through the –cursor-theme config option. More...
 
class  DisplayConfiguration
 Enable display configuration. The config file (miral::MirRunner::display_config_file()) is located via the XDG Base Directory Specification. Vis: ($XDG_CONFIG_HOME or $HOME/.config followed by $XDG_CONFIG_DIRS) More...
 
class  ExternalClientLauncher
 
struct  FdHandle
 A handle which keeps a file descriptor registered to the main loop until it is dropped. More...
 
class  InternalClientLauncher
 
class  Keymap
 Load a keymap. More...
 
class  MinimalWindowManager
 Minimal implementation of a floating window management policy. More...
 
class  MirRunner
 Runner for applying initialization options to Mir. More...
 
class  Output
 
class  PrependEventFilter
 
class  SetApplicationAuthorizer
 
class  SetCommandLineHandler
 Set a handler for any command line options Mir/MirAL does not recognise. This will be invoked if any unrecognised options are found during initialisation. Any unrecognised arguments are passed to this function. The pointers remain valid for the duration of the call only. If set_command_line_handler is not called the default action is to exit by throwing mir::AbnormalExit (which will be handled by the exception handler prior to exiting run(). More...
 
class  SetTerminator
 Set handler for termination requests. terminator will be called following receipt of SIGTERM or SIGINT. The default terminator stop()s the server, replacements should probably do the same in addition to any additional shutdown logic. More...
 
class  SetWindowManagementPolicy
 
class  StartupInternalClient
 Wrapper for running an internal Mir client at startup. More...
 
class  WaylandExtensions
 Enable configuration of the Wayland extensions enabled at runtime. More...
 
class  Window
 Handle class to manage a Mir surface. It may be null (e.g. default initialized) More...
 
struct  WindowInfo
 
class  WindowManagementPolicy
 The interface through which the window management policy is determined. More...
 
struct  WindowManagerOption
 
class  WindowManagerOptions
 
class  WindowManagerTools
 Window management functions for querying and updating MirAL's model. More...
 
class  WindowSpecification
 
class  X11Support
 Add a user configuration option for X11 support. More...
 
class  Zone
 A rectangular area of the display. Not tied to a specific output. More...
 

Typedefs

using CommandLineOption = ConfigurationOption
 
using WindowManagementPolicyBuilder = std::function< std::unique_ptr< miral::WindowManagementPolicy >(WindowManagerTools const &tools)>
 
using Application = std::shared_ptr< mir::scene::Session >
 
typedef mir::IntWrapper< detail::SessionsBufferStreamIdTag > BufferStreamId
 

Functions

template<typename Policy , typename ... Args>
auto set_window_management_policy (Args &... args) -> SetWindowManagementPolicy
 
auto application_for (wl_client *client) -> Application
 Get the MirAL application for a wl_client. More...
 
auto application_for (wl_resource *resource) -> Application
 Get the MirAL application for a wl_resource. More...
 
auto window_for (wl_resource *surface) -> Window
 Get the MirAL Window for a Wayland Surface, XdgSurface, etc. Note that there may not be a corresponding miral::Window (e.g. the surface is created and assigned properties before 'commit' creates the miral::Window). More...
 
void display_configuration_options (mir::Server &server)
 Enable the display configuration options. More...
 
template<typename Policy , typename ... Args>
auto add_window_manager_policy (std::string const &name, Args &... args) -> WindowManagerOption
 
auto pre_init (ConfigurationOption const &clo) -> ConfigurationOption
 Update the option to be called back before Mir initialization starts. More...
 
void apply_lifecycle_state_to (Application const &application, MirLifecycleState state)
 
void kill (Application const &application, int sig)
 
auto name_of (Application const &application) -> std::string
 
auto pid_of (Application const &application) -> pid_t
 
auto socket_fd_of (Application const &application) -> int
 Returns the file descriptor of the client's socket connection, or -1 if there is no client socket. May be used for authentication with apparmor. X11 apps always return -1, since they do not connect directly to the Mir process. More...
 
bool operator== (Window const &lhs, Window const &rhs)
 
bool operator== (std::shared_ptr< mir::scene::Surface > const &lhs, Window const &rhs)
 
bool operator== (Window const &lhs, std::shared_ptr< mir::scene::Surface > const &rhs)
 
bool operator< (Window const &lhs, Window const &rhs)
 
bool operator!= (Window const &lhs, Window const &rhs)
 
bool operator!= (std::shared_ptr< mir::scene::Surface > const &lhs, Window const &rhs)
 
bool operator!= (Window const &lhs, std::shared_ptr< mir::scene::Surface > const &rhs)
 
bool operator> (Window const &lhs, Window const &rhs)
 
bool operator<= (Window const &lhs, Window const &rhs)
 
bool operator>= (Window const &lhs, Window const &rhs)
 
void PrintTo (Window const &bar, std::ostream *os)
 Customization for Google test (to print surface name in errors) More...
 
template<typename Lambda >
auto lambda_as_function (Lambda &&lambda) -> typename detail::FunctionType< decltype(&Lambda::operator())>::type
 
bool operator== (Output::PhysicalSizeMM const &lhs, Output::PhysicalSizeMM const &rhs)
 
bool operator!= (Output::PhysicalSizeMM const &lhs, Output::PhysicalSizeMM const &rhs)
 
auto equivalent_display_area (Output const &lhs, Output const &rhs) -> bool
 

Detailed Description

Mir Abstraction Layer.

A thin, hopefully ABI stable, layer over the Mir libraries exposing only those abstractions needed to write a shell. One day this may inspire a core Mir library.

Typedef Documentation

◆ Application

using miral::Application = typedef std::shared_ptr<mir::scene::Session>

◆ BufferStreamId

typedef mir::IntWrapper<detail::SessionsBufferStreamIdTag> miral::BufferStreamId

◆ CommandLineOption

◆ WindowManagementPolicyBuilder

using miral::WindowManagementPolicyBuilder = typedef std::function<std::unique_ptr<miral::WindowManagementPolicy>(WindowManagerTools const& tools)>

Function Documentation

◆ add_window_manager_policy()

template<typename Policy , typename ... Args>
auto miral::add_window_manager_policy ( std::string const &  name,
Args &...  args 
) -> WindowManagerOption
inline

◆ application_for() [1/2]

auto miral::application_for ( wl_client *  client) -> Application

Get the MirAL application for a wl_client.

Returns
The application (null if no application is found)
Remarks
Since MirAL 2.5

◆ application_for() [2/2]

auto miral::application_for ( wl_resource *  resource) -> Application

Get the MirAL application for a wl_resource.

Returns
The application (null if no application is found)
Remarks
Since MirAL 2.5

◆ apply_lifecycle_state_to()

void miral::apply_lifecycle_state_to ( Application const &  application,
MirLifecycleState  state 
)

◆ display_configuration_options()

void miral::display_configuration_options ( mir::Server &  server)

Enable the display configuration options.

  • display-config {clone,sidebyside,single,static=<filename>}
  • translucent {on,off}

◆ equivalent_display_area()

auto miral::equivalent_display_area ( Output const &  lhs,
Output const &  rhs 
) -> bool

◆ kill()

void miral::kill ( Application const &  application,
int  sig 
)

◆ lambda_as_function()

template<typename Lambda >
auto miral::lambda_as_function ( Lambda &&  lambda) -> typename detail::FunctionType<decltype(&Lambda::operator())>::type

◆ name_of()

auto miral::name_of ( Application const &  application) -> std::string

◆ operator!=() [1/4]

bool miral::operator!= ( Output::PhysicalSizeMM const &  lhs,
Output::PhysicalSizeMM const &  rhs 
)
inline

◆ operator!=() [2/4]

bool miral::operator!= ( std::shared_ptr< mir::scene::Surface > const &  lhs,
Window const &  rhs 
)
inline

◆ operator!=() [3/4]

bool miral::operator!= ( Window const &  lhs,
std::shared_ptr< mir::scene::Surface > const &  rhs 
)
inline

◆ operator!=() [4/4]

bool miral::operator!= ( Window const &  lhs,
Window const &  rhs 
)
inline

◆ operator<()

bool miral::operator< ( Window const &  lhs,
Window const &  rhs 
)

◆ operator<=()

bool miral::operator<= ( Window const &  lhs,
Window const &  rhs 
)
inline

◆ operator==() [1/4]

bool miral::operator== ( Output::PhysicalSizeMM const &  lhs,
Output::PhysicalSizeMM const &  rhs 
)

◆ operator==() [2/4]

bool miral::operator== ( std::shared_ptr< mir::scene::Surface > const &  lhs,
Window const &  rhs 
)

◆ operator==() [3/4]

bool miral::operator== ( Window const &  lhs,
std::shared_ptr< mir::scene::Surface > const &  rhs 
)

◆ operator==() [4/4]

bool miral::operator== ( Window const &  lhs,
Window const &  rhs 
)

◆ operator>()

bool miral::operator> ( Window const &  lhs,
Window const &  rhs 
)
inline

◆ operator>=()

bool miral::operator>= ( Window const &  lhs,
Window const &  rhs 
)
inline

◆ pid_of()

auto miral::pid_of ( Application const &  application) -> pid_t

◆ pre_init()

auto miral::pre_init ( ConfigurationOption const &  clo) -> ConfigurationOption

Update the option to be called back before Mir initialization starts.

Parameters
clothe option

◆ PrintTo()

void miral::PrintTo ( Window const &  bar,
std::ostream *  os 
)

Customization for Google test (to print surface name in errors)

See also
https://github.com/google/googletest/blob/main/docs/advanced.md#teaching-googletest-how-to-print-your-values
Remarks
Since MirAL 3.3

◆ set_window_management_policy()

template<typename Policy , typename ... Args>
auto miral::set_window_management_policy ( Args &...  args) -> SetWindowManagementPolicy

◆ socket_fd_of()

auto miral::socket_fd_of ( Application const &  application) -> int

Returns the file descriptor of the client's socket connection, or -1 if there is no client socket. May be used for authentication with apparmor. X11 apps always return -1, since they do not connect directly to the Mir process.

Remarks
Since MirAL 3.4

◆ window_for()

auto miral::window_for ( wl_resource *  surface) -> Window

Get the MirAL Window for a Wayland Surface, XdgSurface, etc. Note that there may not be a corresponding miral::Window (e.g. the surface is created and assigned properties before 'commit' creates the miral::Window).

Returns
The window (null if no window is found)
Remarks
Since MirAL 2.5

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.