Trait river_layout_toolkit::Layout
source · pub trait Layout: 'static {
type Error: StdError;
const NAMESPACE: &'static str;
// Required methods
fn user_cmd(
&mut self,
cmd: String,
tags: Option<u32>,
output: &str
) -> Result<(), Self::Error>;
fn generate_layout(
&mut self,
view_count: u32,
usable_width: u32,
usable_height: u32,
tags: u32,
output: &str
) -> Result<GeneratedLayout, Self::Error>;
}
Expand description
This trait represents a layout generator implementation.
Required Associated Types§
sourcetype Error: StdError
type Error: StdError
The error type of user_cmd
and generate_layout
functions. Use Infallible
if you don’t need it.
Required Associated Constants§
sourceconst NAMESPACE: &'static str
const NAMESPACE: &'static str
The namespace is used by the compositor to distinguish between layout generators. Two separate
clients may not share a namespace. Otherwise, run
will return Error::NamespaceInUse
.
Required Methods§
sourcefn user_cmd(
&mut self,
cmd: String,
tags: Option<u32>,
output: &str
) -> Result<(), Self::Error>
fn user_cmd( &mut self, cmd: String, tags: Option<u32>, output: &str ) -> Result<(), Self::Error>
This function is called whenever the user sends a command via riverctl send-layout-cmd
.
sourcefn generate_layout(
&mut self,
view_count: u32,
usable_width: u32,
usable_height: u32,
tags: u32,
output: &str
) -> Result<GeneratedLayout, Self::Error>
fn generate_layout( &mut self, view_count: u32, usable_width: u32, usable_height: u32, tags: u32, output: &str ) -> Result<GeneratedLayout, Self::Error>
This function is called whenever compositor requests a layout.