Trait smithay_client_toolkit::window::Frame[][src]

pub trait Frame: Sized + Send {
    type Error;
    fn init(
        base_surface: &Proxy<WlSurface>,
        compositor: &Proxy<WlCompositor>,
        subcompositor: &Proxy<WlSubcompositor>,
        shm: &Proxy<WlShm>,
        implementation: Box<Implementation<u32, FrameRequest> + Send>
    ) -> Result<Self, Self::Error>;
fn set_active(&mut self, active: bool) -> bool;
fn set_maximized(&mut self, maximized: bool) -> bool;
fn set_hidden(&mut self, hidden: bool);
fn set_resizable(&mut self, resizable: bool);
fn new_seat(&mut self, seat: &Proxy<WlSeat>);
fn resize(&mut self, newsize: (u32, u32));
fn redraw(&mut self);
fn subtract_borders(&self, width: i32, height: i32) -> (i32, i32);
fn add_borders(&self, width: i32, height: i32) -> (i32, i32); fn location(&self) -> (i32, i32) { ... } }

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 of errors that may occur when attempting to create a frame

Required Methods

Initialize the Frame

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.

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

Set whether interactive resize hints should be displayed and reacted to

Notify that a new wl_seat should be handled

Change the size of the decorations

Calling this should not trigger a redraw

Redraw the decorations

Subtracts the border dimensions from the given dimensions.

Adds the border dimensions to the given dimensions.

Provided Methods

Returns the coordinates of the top-left corner of the borders relative to the content

Values should thus be negative

Implementors