Trait runa_orbiter::shell::surface::Role
source · pub trait Role<S: Shell>: Any {
// Required methods
fn name(&self) -> &'static str;
fn is_active(&self) -> bool;
fn deactivate(&mut self, shell: &mut S);
// Provided methods
fn provide<'a>(&'a self, _demand: &mut Demand<'a>) { ... }
fn provide_mut<'a>(&'a mut self, _demand: &mut Demand<'a>) { ... }
fn pre_commit(
&mut self,
_shell: &mut S,
_surfacee: &Surface<S>
) -> Result<(), &'static str> { ... }
fn post_commit(&mut self, _shell: &mut S, _surface: &Surface<S>) { ... }
}
Expand description
A surface role
Required Methods§
sourcefn is_active(&self) -> bool
fn is_active(&self) -> bool
Returns true if the role is active.
As specified by the wayland protocol, a surface can be assigned a role, then have the role object destroyed. This makes the role “inactive”, but the surface cannot be assigned a different role. So we keep the role object but “deactivate” it.
sourcefn deactivate(&mut self, shell: &mut S)
fn deactivate(&mut self, shell: &mut S)
Deactivate the role.
Provided Methods§
sourcefn provide<'a>(&'a self, _demand: &mut Demand<'a>)
fn provide<'a>(&'a self, _demand: &mut Demand<'a>)
Provides type based access to member variables of this role.
sourcefn provide_mut<'a>(&'a mut self, _demand: &mut Demand<'a>)
fn provide_mut<'a>(&'a mut self, _demand: &mut Demand<'a>)
Provides type based access to member variables of this role.
sourcefn pre_commit(
&mut self,
_shell: &mut S,
_surfacee: &Surface<S>
) -> Result<(), &'static str>
fn pre_commit( &mut self, _shell: &mut S, _surfacee: &Surface<S> ) -> Result<(), &'static str>
Called before the pending state becomes the current state, in
Surface::commit
. If an error is returned, the commit will be
stopped.
sourcefn post_commit(&mut self, _shell: &mut S, _surface: &Surface<S>)
fn post_commit(&mut self, _shell: &mut S, _surface: &Surface<S>)
Called after the pending state becomes the current state, in
Surface::commit