Macro smithay_client_toolkit::delegate_registry

source ·
macro_rules! delegate_registry {
    ($(@<$( $lt:tt $( : $clt:tt $(+ $dlt:tt )* )? ),+>)? $ty: ty) => { ... };
}
Expand description

Delegates the handling of [wl_registry].

Anything which implements RegistryHandler may be used in the delegate.

§Usage

use smithay_client_toolkit::{
    delegate_registry, delegate_shm, registry_handlers,
    shm::{ShmHandler, Shm},
};

struct ExampleApp {
    shm_state: Shm,
}

// Here is the implementation of wl_shm to compile:
delegate_shm!(ExampleApp);

impl ShmHandler for ExampleApp {
    fn shm_state(&mut self) -> &mut Shm {
        &mut self.shm_state
    }
}