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

pub trait Frame: Sized {
    type Error;
    type Config;
    pub fn init(
        base_surface: &WlSurface,
        compositor: &Attached<WlCompositor>,
        subcompositor: &Attached<WlSubcompositor>,
        shm: &Attached<WlShm>,
        theme_manager: Option<ThemeManager>,
        callback: Box<dyn FnMut(FrameRequest, u32, DispatchData<'_>)>
    ) -> Result<Self, Self::Error>;
pub fn set_states(&mut self, states: &[State]) -> bool;
pub fn set_hidden(&mut self, hidden: bool);
pub fn set_resizable(&mut self, resizable: bool);
pub fn new_seat(&mut self, seat: &Attached<WlSeat>);
pub fn remove_seat(&mut self, seat: &WlSeat);
pub fn resize(&mut self, newsize: (u32, u32));
pub fn redraw(&mut self);
pub fn subtract_borders(&self, width: i32, height: i32) -> (i32, i32);
pub fn add_borders(&self, width: i32, height: i32) -> (i32, i32);
pub fn set_config(&mut self, config: Self::Config);
pub fn set_title(&mut self, title: String); pub 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 Error[src]

Type of errors that may occur when attempting to create a frame

type Config[src]

Configuration for this frame

Loading content...

Required methods

pub fn init(
    base_surface: &WlSurface,
    compositor: &Attached<WlCompositor>,
    subcompositor: &Attached<WlSubcompositor>,
    shm: &Attached<WlShm>,
    theme_manager: Option<ThemeManager>,
    callback: Box<dyn FnMut(FrameRequest, u32, DispatchData<'_>)>
) -> Result<Self, Self::Error>
[src]

Initialize the Frame.

Providing non None to theme_manager should prevent Frame to theme pointer over base_surface surface.

pub fn set_states(&mut self, states: &[State]) -> bool[src]

Set the Window XDG states for the frame

This notably includes information about whether the window is maximized, active, or tiled, and can affect the way decorations are drawn.

Calling this should not trigger a redraw, but return true if a redraw is needed.

pub fn set_hidden(&mut self, hidden: bool)[src]

Hide or show the decorations

Calling this should not trigger a redraw

pub fn set_resizable(&mut self, resizable: bool)[src]

Set whether interactive resize hints should be displayed and reacted to

pub fn new_seat(&mut self, seat: &Attached<WlSeat>)[src]

Notify that a new wl_seat should be handled

This seat is guaranteed to have pointer capability

pub fn remove_seat(&mut self, seat: &WlSeat)[src]

Notify that this seat has lost the pointer capability or has been lost

pub fn resize(&mut self, newsize: (u32, u32))[src]

Change the size of the decorations

Calling this should not trigger a redraw

pub fn redraw(&mut self)[src]

Redraw the decorations

pub fn subtract_borders(&self, width: i32, height: i32) -> (i32, i32)[src]

Subtracts the border dimensions from the given dimensions.

pub fn add_borders(&self, width: i32, height: i32) -> (i32, i32)[src]

Adds the border dimensions to the given dimensions.

pub fn set_config(&mut self, config: Self::Config)[src]

Sets the configuration for the frame

pub fn set_title(&mut self, title: String)[src]

Sets the frames title

Loading content...

Provided methods

pub fn location(&self) -> (i32, i32)[src]

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

Values should thus be negative

Loading content...

Implementors

impl Frame for ConceptFrame[src]

type Error = Error

type Config = ConceptConfig

Loading content...