[−][src]Trait smithay_client_toolkit::window::Frame
Interface for defining the drawing of decorations
A type implementing this trait can be used to define custom
decorations additionnaly to the ones provided by this crate
and be used with Window.
Associated Types
type Error
Type of errors that may occur when attempting to create a frame
Required methods
fn init(
base_surface: &Proxy<WlSurface>,
compositor: &Proxy<WlCompositor>,
subcompositor: &Proxy<WlSubcompositor>,
shm: &Proxy<WlShm>,
implementation: Box<dyn FnMut(FrameRequest, u32) + Send>
) -> Result<Self, Self::Error>
base_surface: &Proxy<WlSurface>,
compositor: &Proxy<WlCompositor>,
subcompositor: &Proxy<WlSubcompositor>,
shm: &Proxy<WlShm>,
implementation: Box<dyn FnMut(FrameRequest, u32) + Send>
) -> Result<Self, Self::Error>
Initialize the Frame
fn set_active(&mut self, active: bool) -> bool
Set whether the decorations should be drawn as active or not
Calling this should not trigger a redraw, but return true if
a redraw is needed.
fn set_maximized(&mut self, maximized: bool) -> bool
Set whether the decorations should be drawn as maximized or not
Calling this should not trigger a redraw, but return true if
a redraw is needed.
Hide or show the decorations
Calling this should not trigger a redraw
fn set_resizable(&mut self, resizable: bool)
Set whether interactive resize hints should be displayed and reacted to
fn new_seat(&mut self, seat: &Proxy<WlSeat>)
Notify that a new wl_seat should be handled
fn resize(&mut self, newsize: (u32, u32))
Change the size of the decorations
Calling this should not trigger a redraw
fn redraw(&mut self)
Redraw the decorations
fn subtract_borders(&self, width: i32, height: i32) -> (i32, i32)
Subtracts the border dimensions from the given dimensions.
fn add_borders(&self, width: i32, height: i32) -> (i32, i32)
Adds the border dimensions to the given dimensions.
fn set_theme<T: Theme>(&mut self, theme: T)
Sets the theme for the frame
fn set_title(&mut self, title: String)
Sets the frames title
Provided methods
fn location(&self) -> (i32, i32)
Returns the coordinates of the top-left corner of the borders relative to the content
Values should thus be negative
Implementors
impl Frame for BasicFrame[src]
type Error = Error
fn init(
base_surface: &Proxy<WlSurface>,
compositor: &Proxy<WlCompositor>,
subcompositor: &Proxy<WlSubcompositor>,
shm: &Proxy<WlShm>,
implementation: Box<dyn FnMut(FrameRequest, u32) + Send>
) -> Result<BasicFrame, Error>[src]
base_surface: &Proxy<WlSurface>,
compositor: &Proxy<WlCompositor>,
subcompositor: &Proxy<WlSubcompositor>,
shm: &Proxy<WlShm>,
implementation: Box<dyn FnMut(FrameRequest, u32) + Send>
) -> Result<BasicFrame, Error>
fn new_seat(&mut self, seat: &Proxy<WlSeat>)[src]
fn set_active(&mut self, active: bool) -> bool[src]
[src]
fn set_maximized(&mut self, maximized: bool) -> bool[src]
fn set_resizable(&mut self, resizable: bool)[src]
fn resize(&mut self, newsize: (u32, u32))[src]
fn redraw(&mut self)[src]
fn subtract_borders(&self, width: i32, height: i32) -> (i32, i32)[src]
fn add_borders(&self, width: i32, height: i32) -> (i32, i32)[src]
fn location(&self) -> (i32, i32)[src]
fn set_theme<T: Theme>(&mut self, theme: T)[src]
fn set_title(&mut self, title: String)[src]
impl Frame for ConceptFrame[src]
type Error = Error
fn init(
base_surface: &Proxy<WlSurface>,
compositor: &Proxy<WlCompositor>,
subcompositor: &Proxy<WlSubcompositor>,
shm: &Proxy<WlShm>,
implementation: Box<dyn FnMut(FrameRequest, u32) + Send>
) -> Result<ConceptFrame, Error>[src]
base_surface: &Proxy<WlSurface>,
compositor: &Proxy<WlCompositor>,
subcompositor: &Proxy<WlSubcompositor>,
shm: &Proxy<WlShm>,
implementation: Box<dyn FnMut(FrameRequest, u32) + Send>
) -> Result<ConceptFrame, Error>