Mir
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
mir Namespace Reference

All things Mir. More...

Namespaces

 client
 The client-side library implementation namespace.
 
 compositor
 Compositing. Combining renderables into a display image.
 
 cookie
 
 detail
 
 dispatch
 
 draw
 
 events
 
 examples
 
 frontend
 Frontend interface. Mediates the interaction between client processes and the core of the mir system.
 
 geometry
 Basic geometry types. Types for dimensions, displacements, etc. and the operations that they support.
 
 gl
 
 graphics
 Graphics subsystem. Mediates interaction between core system and the graphics environment.
 
 input
 
 logging
 
 options
 System options. Interface for extracting configuration options from wherever they may be (e.g. program arguments, config files or environment variables).
 
 protobuf
 
 raii
 Utilities for exception safe use of paired function calls.
 
 renderer
 
 report
 
 scene
 Management of Surface objects. Includes the model (SurfaceStack and Surface classes) and controller (SurfaceController) elements of an MVC design.
 
 shell
 
 thread
 
 time
 
 tools
 
 udev
 
 X
 

Classes

class  AbnormalExit
 
class  BasicCallback
 
class  BasicObservers
 
class  CachedPtr
 
class  DefaultEmergencyCleanup
 
class  DefaultServerConfiguration
 
class  DefaultServerStatusListener
 
class  DisplayChanger
 
class  DisplayServer
 
class  EmergencyCleanup
 
class  EmergencyCleanupRegistry
 
class  FatalErrorStrategy
 
class  Fd
 
struct  fd_reception_error
 
struct  Flags
 
class  GLibMainLoop
 
struct  IntOwnedFd
 
class  IntWrapper
 
class  LockableCallback
 
class  LockableCallbackWrapper
 
class  MainLoop
 
struct  ModuleDeleter
 
struct  ModuleProperties
 Describes a platform module. More...
 
class  optional_value
 
class  RecursiveReadLock
 
class  RecursiveReadWriteMutex
 a recursive read-write mutex. More...
 
class  RecursiveWriteLock
 
class  RevertIfUnwinding
 
class  Server
 Customise and run a Mir server. More...
 
class  ServerActionQueue
 
class  ServerConfiguration
 
class  ServerStatusListener
 
class  SharedLibrary
 
class  SharedLibraryProberReport
 
class  SignalBlocker
 
struct  socket_disconnected_error
 
struct  socket_error
 
class  ThreadSafeList
 
class  VariableLengthArray
 

Typedefs

typedef std::function< void()> EmergencyCleanupHandler
 
using EventUPtr = std::unique_ptr< MirEvent, void(*)(MirEvent *)>
 
template<typename T >
using UniqueModulePtr = std::unique_ptr< T, ModuleDeleter< T >>
 Use UniqueModulePtr to ensure that your loadable libray outlives instances created within it. More...
 
typedef std::function< void()> ServerAction
 

Enumerations

enum  OptionType { OptionType::null, OptionType::integer, OptionType::string, OptionType::boolean }
 

Functions

void logv (logging::Severity sev, char const *component, char const *fmt, va_list va)
 
void log (logging::Severity sev, char const *component, char const *fmt,...)
 
void log (logging::Severity sev, char const *component, std::string const &message)
 
std::string event_type_to_string (MirEventType t)
 
bool socket_error_is_transient (int error_code)
 
void send_fds (mir::Fd const &socket, std::vector< mir::Fd > const &fd)
 
void receive_data (mir::Fd const &socket, void *buffer, size_t bytes_requested, std::vector< mir::Fd > &fds)
 
void require (bool const expr)
 
std::vector< std::shared_ptr< SharedLibrary > > libraries_for_path (std::string const &path, SharedLibraryProberReport &report)
 
void set_thread_name (std::string const &name)
 
template<typename Apply , typename Revert >
auto try_but_revert_if_unwinding (Apply &&apply, Revert &&reverse) -> RevertIfUnwinding< Revert >
 
template<typename Revert >
auto on_unwind (Revert &&action) -> RevertIfUnwinding< Revert >
 
void run_mir (ServerConfiguration &config, std::function< void(DisplayServer &)> init)
 Run a DisplayServer with the supplied configuration. More...
 
void run_mir (ServerConfiguration &config, std::function< void(DisplayServer &)> init, std::function< void(int)> const &terminator)
 Run a DisplayServer with the supplied configuration. More...
 
std::ostream & operator<< (std::ostream &out, MirInputEventModifier modifier)
 
std::ostream & operator<< (std::ostream &out, MirKeyboardAction action)
 
std::ostream & operator<< (std::ostream &out, MirTouchAction action)
 
std::ostream & operator<< (std::ostream &out, MirTouchTooltype tool)
 
std::ostream & operator<< (std::ostream &out, MirPointerAction action)
 
std::ostream & operator<< (std::ostream &out, MirPromptSessionState state)
 
std::ostream & operator<< (std::ostream &out, MirOrientation orientation)
 
std::ostream & operator<< (std::ostream &out, MirSurfaceAttrib attribute)
 
std::ostream & operator<< (std::ostream &out, MirSurfaceFocusState state)
 
std::ostream & operator<< (std::ostream &out, MirSurfaceVisibility state)
 
std::ostream & operator<< (std::ostream &out, MirSurfaceType type)
 
std::ostream & operator<< (std::ostream &out, MirSurfaceState state)
 
std::ostream & operator<< (std::ostream &out, MirPromptSessionEvent const &event)
 
std::ostream & operator<< (std::ostream &out, MirResizeEvent const &event)
 
std::ostream & operator<< (std::ostream &out, MirOrientationEvent const &event)
 
std::ostream & operator<< (std::ostream &out, MirInputEvent const &event)
 
std::ostream & operator<< (std::ostream &out, MirCloseSurfaceEvent const &event)
 
std::ostream & operator<< (std::ostream &out, MirKeymapEvent const &event)
 
std::ostream & operator<< (std::ostream &out, MirSurfaceEvent const &event)
 
std::ostream & operator<< (std::ostream &out, MirEvent const &event)
 
void fatal_error_except (char const *reason,...)
 Throws an exception that will typically kill the Mir server and propagate from mir::run_mir. More...
 
void fatal_error_abort (char const *reason,...)
 An alternative to fatal_error_except() that kills the program and dump core as cleanly as possible. More...
 
template<typename Enum >
constexpr Flags< Enum > operator| (Flags< Enum > flags, Enum e) noexcept
 
template<typename Enum >
constexpr Flags< Enum > operator| (Enum e, Flags< Enum > flags) noexcept
 
template<typename Enum >
constexpr Enum operator& (Enum e, Flags< Enum > flags) noexcept
 
template<typename Enum >
constexpr Enum operator& (Flags< Enum > flags, Enum e) noexcept
 
template<typename Enum >
constexpr bool operator== (Flags< Enum > flags, Enum e) noexcept
 
template<typename Enum >
constexpr bool operator== (Enum e, Flags< Enum > flags) noexcept
 
template<typename Enum >
constexpr bool contains (Flags< Enum > flags, Enum e) noexcept
 
template<typename Tag , typename ValueType >
std::ostream & operator<< (std::ostream &out, IntWrapper< Tag, ValueType > const &value)
 
template<typename Tag , typename ValueType >
bool operator== (IntWrapper< Tag, ValueType > const &lhs, IntWrapper< Tag, ValueType > const &rhs)
 
template<typename Tag , typename ValueType >
bool operator!= (IntWrapper< Tag, ValueType > const &lhs, IntWrapper< Tag, ValueType > const &rhs)
 
template<typename Tag , typename ValueType >
bool operator<= (IntWrapper< Tag, ValueType > const &lhs, IntWrapper< Tag, ValueType > const &rhs)
 
template<typename Tag , typename ValueType >
bool operator>= (IntWrapper< Tag, ValueType > const &lhs, IntWrapper< Tag, ValueType > const &rhs)
 
template<typename Tag , typename ValueType >
bool operator< (IntWrapper< Tag, ValueType > const &lhs, IntWrapper< Tag, ValueType > const &rhs)
 
template<typename T >
bool operator== (optional_value< T > const &lhs, optional_value< T > const &rhs)
 
template<typename T >
bool operator!= (optional_value< T > const &lhs, optional_value< T > const &rhs)
 
template<typename T >
bool operator== (optional_value< T > const &lhs, T const &rhs)
 
template<typename T >
bool operator!= (optional_value< T > const &lhs, T const &rhs)
 
template<typename T >
bool operator== (T const &lhs, optional_value< T > const &rhs)
 
template<typename T >
bool operator!= (T const &lhs, optional_value< T > const &rhs)
 
void report_exception (std::ostream &out)
 Call this from a catch block (and only from a catch block) to write error information to an output stream. More...
 
void report_exception ()
 Call this from a catch block (and only from a catch block) to write error information to std:cerr. More...
 
void terminate_with_current_exception ()
 
void check_for_termination_exception ()
 called by main thread to rethrow any termination exception More...
 
void clear_termination_exception ()
 

Variables

const char *const default_server_socket = init()
 
void(* fatal_error )(char const *reason,...)
 fatal_error() is strictly for "this should never happen" situations that you cannot recover from. More...
 

Detailed Description

All things Mir.

Typedef Documentation

typedef std::function<void()> mir::EmergencyCleanupHandler
typedef std::unique_ptr< MirEvent, void(*)(MirEvent *)> mir::EventUPtr
typedef std::function<void()> mir::ServerAction
template<typename T >
using mir::UniqueModulePtr = typedef std::unique_ptr<T,ModuleDeleter<T>>

Use UniqueModulePtr to ensure that your loadable libray outlives instances created within it.

Use mir::make_module_ptr(...) or pass a function from your library to the constructor, to increase the lifetime of your library:

{
return mir::UniqueModulePtr<SomeInterface>(new Implementation, &library_entry_point);
}

The default constructor will not try to infer the dynamic library.

Enumeration Type Documentation

enum mir::OptionType
strong
Enumerator
null 
integer 
string 
boolean 

Function Documentation

void mir::check_for_termination_exception ( )

called by main thread to rethrow any termination exception

void mir::clear_termination_exception ( )
template<typename Enum >
constexpr bool mir::contains ( Flags< Enum >  flags,
Enum  e 
)
noexcept
std::string mir::event_type_to_string ( MirEventType  t)
void mir::fatal_error_abort ( char const *  reason,
  ... 
)

An alternative to fatal_error_except() that kills the program and dump core as cleanly as possible.

Parameters
[in]reasonA printf-style format string.
void mir::fatal_error_except ( char const *  reason,
  ... 
)

Throws an exception that will typically kill the Mir server and propagate from mir::run_mir.

Parameters
[in]reasonA printf-style format string.
std::vector< std::shared_ptr< mir::SharedLibrary > > mir::libraries_for_path ( std::string const &  path,
mir::SharedLibraryProberReport report 
)
void mir::log ( logging::Severity  sev,
char const *  component,
char const *  fmt,
  ... 
)
void mir::log ( logging::Severity  sev,
char const *  component,
std::string const &  message 
)
void mir::logv ( logging::Severity  sev,
char const *  component,
char const *  fmt,
va_list  va 
)
template<typename Revert >
auto mir::on_unwind ( Revert &&  action) -> RevertIfUnwinding<Revert>
inline
template<typename Tag , typename ValueType >
bool mir::operator!= ( IntWrapper< Tag, ValueType > const &  lhs,
IntWrapper< Tag, ValueType > const &  rhs 
)
inline
template<typename T >
bool mir::operator!= ( optional_value< T > const &  lhs,
optional_value< T > const &  rhs 
)
inline
template<typename T >
bool mir::operator!= ( optional_value< T > const &  lhs,
T const &  rhs 
)
inline
template<typename T >
bool mir::operator!= ( T const &  lhs,
optional_value< T > const &  rhs 
)
inline
template<typename Enum >
constexpr Enum mir::operator& ( Enum  e,
Flags< Enum >  flags 
)
noexcept
template<typename Enum >
constexpr Enum mir::operator& ( Flags< Enum >  flags,
Enum  e 
)
noexcept
template<typename Tag , typename ValueType >
bool mir::operator< ( IntWrapper< Tag, ValueType > const &  lhs,
IntWrapper< Tag, ValueType > const &  rhs 
)
inline
std::ostream & mir::operator<< ( std::ostream &  out,
MirInputEventModifier  modifier 
)
std::ostream & mir::operator<< ( std::ostream &  out,
MirKeyboardAction  action 
)
std::ostream & mir::operator<< ( std::ostream &  out,
MirTouchAction  action 
)
std::ostream & mir::operator<< ( std::ostream &  out,
MirTouchTooltype  tool 
)
std::ostream & mir::operator<< ( std::ostream &  out,
MirPointerAction  action 
)
std::ostream & mir::operator<< ( std::ostream &  out,
MirPromptSessionState  state 
)
std::ostream & mir::operator<< ( std::ostream &  out,
MirOrientation  orientation 
)
std::ostream & mir::operator<< ( std::ostream &  out,
MirSurfaceAttrib  attribute 
)
std::ostream & mir::operator<< ( std::ostream &  out,
MirSurfaceFocusState  state 
)
std::ostream & mir::operator<< ( std::ostream &  out,
MirSurfaceVisibility  state 
)
template<typename Tag , typename ValueType >
std::ostream& mir::operator<< ( std::ostream &  out,
IntWrapper< Tag, ValueType > const &  value 
)
std::ostream & mir::operator<< ( std::ostream &  out,
MirSurfaceType  type 
)
std::ostream & mir::operator<< ( std::ostream &  out,
MirSurfaceState  state 
)
std::ostream & mir::operator<< ( std::ostream &  out,
MirPromptSessionEvent const &  event 
)
std::ostream & mir::operator<< ( std::ostream &  out,
MirResizeEvent const &  event 
)
std::ostream & mir::operator<< ( std::ostream &  out,
MirOrientationEvent const &  event 
)
std::ostream & mir::operator<< ( std::ostream &  out,
MirInputEvent const &  event 
)
std::ostream & mir::operator<< ( std::ostream &  out,
MirCloseSurfaceEvent const &  event 
)
std::ostream & mir::operator<< ( std::ostream &  out,
MirKeymapEvent const &  event 
)
std::ostream & mir::operator<< ( std::ostream &  out,
MirSurfaceEvent const &  event 
)
std::ostream & mir::operator<< ( std::ostream &  out,
MirEvent const &  event 
)
template<typename Tag , typename ValueType >
bool mir::operator<= ( IntWrapper< Tag, ValueType > const &  lhs,
IntWrapper< Tag, ValueType > const &  rhs 
)
inline
template<typename Tag , typename ValueType >
bool mir::operator== ( IntWrapper< Tag, ValueType > const &  lhs,
IntWrapper< Tag, ValueType > const &  rhs 
)
inline
template<typename T >
bool mir::operator== ( optional_value< T > const &  lhs,
optional_value< T > const &  rhs 
)
inline
template<typename T >
bool mir::operator== ( optional_value< T > const &  lhs,
T const &  rhs 
)
inline
template<typename T >
bool mir::operator== ( T const &  lhs,
optional_value< T > const &  rhs 
)
inline
template<typename Enum >
constexpr bool mir::operator== ( Flags< Enum >  flags,
Enum  e 
)
noexcept
template<typename Enum >
constexpr bool mir::operator== ( Enum  e,
Flags< Enum >  flags 
)
noexcept
template<typename Tag , typename ValueType >
bool mir::operator>= ( IntWrapper< Tag, ValueType > const &  lhs,
IntWrapper< Tag, ValueType > const &  rhs 
)
inline
template<typename Enum >
constexpr Flags<Enum> mir::operator| ( Flags< Enum >  flags,
Enum  e 
)
noexcept
template<typename Enum >
constexpr Flags<Enum> mir::operator| ( Enum  e,
Flags< Enum >  flags 
)
noexcept
void mir::receive_data ( mir::Fd const &  socket,
void *  buffer,
size_t  bytes_requested,
std::vector< mir::Fd > &  fds 
)
void mir::report_exception ( std::ostream &  out)

Call this from a catch block (and only from a catch block) to write error information to an output stream.

Examples:
render_surfaces.cpp, server_example.cpp, and server_minimal.cpp.
void mir::report_exception ( )

Call this from a catch block (and only from a catch block) to write error information to std:cerr.

void mir::require ( bool const  expr)
inline
void mir::run_mir ( ServerConfiguration config,
std::function< void(DisplayServer &)>  init 
)

Run a DisplayServer with the supplied configuration.

init will be called after constructing the server, but before invoking DisplayServer::run() The server will be stopped on receipt of SIGTERM or SIGINT This function does not return until the server has stopped.

void mir::run_mir ( ServerConfiguration config,
std::function< void(DisplayServer &)>  init,
std::function< void(int)> const &  terminator 
)

Run a DisplayServer with the supplied configuration.

init will be called after constructing the server, but before invoking DisplayServer::run() The terminator will be called following receipt of SIGTERM or SIGINT (but not in a signal handler - so arbitrary functions may be invoked). This function does not return until the server has stopped.

void mir::send_fds ( mir::Fd const &  socket,
std::vector< mir::Fd > const &  fd 
)
void mir::set_thread_name ( std::string const &  name)
bool mir::socket_error_is_transient ( int  error_code)
void mir::terminate_with_current_exception ( )
template<typename Apply , typename Revert >
auto mir::try_but_revert_if_unwinding ( Apply &&  apply,
Revert &&  reverse 
) -> RevertIfUnwinding<Revert>
inline

Variable Documentation

const char *const mir::default_server_socket = init()
void(* mir::fatal_error)(char const *reason,...)

fatal_error() is strictly for "this should never happen" situations that you cannot recover from.

By default it points at fatal_error_except(). Note the reason parameter is a simple char* so its value is clearly visible in stack trace output.

Parameters
[in]reasonA printf-style format string.

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Oct 8 16:20:16 UTC 2015