2
3
4
5
6
7
8
9
10
11
12
13
14
15
17#ifndef MIRAL_WAYLAND_EXTENSIONS_H
18#define MIRAL_WAYLAND_EXTENSIONS_H
32namespace mir {
class Server; }
69 virtual auto display()
const -> wl_display* = 0;
91 std::function<std::shared_ptr<
void>(
Context const* context)>
build;
100 auto app()
const -> Application
const&;
102 auto name()
const ->
const char*;
108 EnableInfo(Application
const& app,
const char* name, std::optional<
bool> user_preference);
110 std::unique_ptr<Self>
const self;
114 using Filter = std::function<
bool(Application
const& app,
char const* protocol)>;
117 using EnableCallback = std::function<
bool(
EnableInfo const& info)>;
125 [[
deprecated(
"use conditionally_enable() instead")]]
129
130
131
175
176
177
178 [[
deprecated(
"use zwp_virtual_keyboard_manager_v1 instead")]]
180 [[
deprecated(
"use zwp_input_method_manager_v2 instead")]]
227 std::shared_ptr<Self> self;
Context information useful for implementing Wayland extensions.
Definition: wayland_extensions.h:67
Context & operator=(Context const &)=delete
virtual void run_on_wayland_mainloop(std::function< void()> &&work) const =0
virtual auto display() const -> wl_display *=0
Context(Context const &)=delete
virtual ~Context()=default
Information that can be used to determine if to enable a conditionally enabled extension.
Definition: wayland_extensions.h:97
auto app() const -> Application const &
The application that is being given access to this extension.
auto name() const -> const char *
The name of the extension/global, always the same as given to conditionally_enable()
auto user_preference() const -> std::optional< bool >
If the user has enabled or disabled this extension one of the wayland extension Mir options.
Enable configuration of the Wayland extensions enabled at runtime.
Definition: wayland_extensions.h:47
static char const *const zwlr_layer_shell_v1
Supported wayland extensions that are not enabled by default.
Definition: wayland_extensions.h:138
static auto supported() -> std::set< std::string >
The set of Wayland extensions that core Mir supports. Does not include bespoke extensions A superset ...
void add_extension_disabled_by_default(Builder const &builder)
Add a bespoke Wayland extension both to "supported" but not "enabled by default".
static char const *const zwp_virtual_keyboard_manager_v1
Allows clients to act as a virtual keyboard, useful for on-screen keyboards. Clients are not required...
Definition: wayland_extensions.h:154
static char const *const zwp_input_method_manager_v2
Allows clients (such as on-screen keyboards) to intercept physical key events and act as a source of ...
Definition: wayland_extensions.h:161
void add_extension(Builder const &builder)
Add a bespoke Wayland extension both to "supported" and "enabled by default".
static char const *const zwlr_virtual_pointer_manager_v1
Allows clients to act as a virtual pointer, useful for remote control and automation....
Definition: wayland_extensions.h:172
static auto recommended() -> std::set< std::string >
The set of Wayland extensions that Mir recommends. Also the set that is enabled by default upon const...
static char const *const zwp_input_method_v2
Definition: wayland_extensions.h:181
static char const *const zwp_virtual_keyboard_v1
Definition: wayland_extensions.h:179
auto operator=(WaylandExtensions const &) -> WaylandExtensions &
WaylandExtensions(WaylandExtensions const &)
static char const *const zxdg_output_manager_v1
Allows clients to retrieve additional information about outputs.
Definition: wayland_extensions.h:142
void operator()(mir::Server &server) const
auto enable(std::string name) -> WaylandExtensions &
Enable a Wayland extension by default. The user can still disable it with the drop-wayland-extensions...
auto disable(std::string name) -> WaylandExtensions &
Disable a Wayland extension by default. The user can still enable it with the add-wayland-extensions ...
auto all_supported() const -> std::set< std::string >
All Wayland extensions supported. This includes both the supported() provided by Mir and any extensio...
static char const *const zwlr_foreign_toplevel_manager_v1
Allows a client to get information and gain control over all toplevels of all clients Useful for task...
Definition: wayland_extensions.h:148
static char const *const zwlr_screencopy_manager_v1
Allows clients to take screenshots and record the screen. Only enable for clients that are trusted to...
Definition: wayland_extensions.h:166
void set_filter(Filter const &extension_filter)
Set an extension filter callback to control the extensions available to specific clients....
auto conditionally_enable(std::string name, EnableCallback const &callback) -> WaylandExtensions &
Enable a Wayland extension only when the callback returns true. The callback can use info....
WaylandExtensions()
Default to enabling the extensions recommended by Mir.
Handle class to manage a Mir surface. It may be null (e.g. default initialized)
Definition: window.h:36
Mir Abstraction Layer.
Definition: runner.h:35
auto application_for(wl_resource *resource) -> Application
Get the MirAL application for a wl_resource.
auto application_for(wl_client *client) -> Application
Get the MirAL application for a wl_client.
auto window_for(wl_resource *surface) -> Window
Get the MirAL Window for a Wayland Surface, XdgSurface, etc. Note that there may not be a correspondi...
A Builder creates and registers an extension protocol.
Definition: wayland_extensions.h:82
std::function< std::shared_ptr< void >(Context const *context)> build
Functor that creates and registers an extension protocol.
Definition: wayland_extensions.h:91
std::string name
Name of the protocol extension's Wayland global.
Definition: wayland_extensions.h:84