[][src]Module smithay_client_toolkit::environment

Environment management utilities

This module provide the tools to automatically bind the wayland global objects you need in your program.

At the heart of this is the environment! macro, which allows you to signal the globals you need and a struct to manage them as they are signaled in the registry.

Global handlers

Wayland globals are split in two kinds, that we will call here "single" globals and "multi" globals.

The objects you need to handle these globals must implement one the two traits GlobalHandler<I> or MultiGlobalHandler<I>, depending on the kind of globals it will handle. These objects are responsible for binding the globals from the registry, and assigning them to filters to receive their events as necessary.

This module provides a generic implementation of the GlobalHandler<I> trait as SimpleGlobal<I>. It can manage "single" globals that do not generate events, and thus require no filter.

the environment! macro

This macro is at the core of this module. See its documentation for details about how to use it: environment!. You can alternatively use the default_environment! macro to quickly setup things and bring in all SCTK modules.

Structs

Environment

A Wayland Environment

SimpleGlobal

A minimalist global handler for "single" globals

Traits

GlobalHandler

Required trait for implementing a handler for "single" globals

InnerEnv

Internal trait for the Environment logic

MultiGlobalHandler

Required trait for implementing a handler for "multi" globals