Struct Manager

Source
pub struct Manager<H: Handle, C, SERVER> {
    pub state: State<H>,
    pub config: C,
    pub display_server: SERVER,
    /* private fields */
}
Expand description

Maintains current program state.

Fields§

§state: State<H>§config: C§display_server: SERVER

Implementations§

Source§

impl<H: Handle, C: Config, SERVER: DisplayServer<H>> Manager<H, C, SERVER>

Source

pub async fn start_event_loop(self) -> Result<(), Error>

Starts the event loop of leftwm

§Errors

EventResponse if the initialisation of the command pipe or/and the state socket failed.

Source§

impl<H: Handle, C: Config, SERVER: DisplayServer<H>> Manager<H, C, SERVER>

Source

pub fn command_handler(&mut self, command: &Command<H>) -> bool

Processes a command and invokes the associated function.

Source§

impl<H: Handle, C: Config, SERVER: DisplayServer<H>> Manager<H, C, SERVER>

Source

pub fn display_event_handler(&mut self, event: DisplayEvent<H>) -> bool

Process a collection of events, and apply changes to a manager. Returns true if changes need to be rendered.

Source§

impl<H: Handle, C: Config, SERVER: DisplayServer<H>> Manager<H, C, SERVER>

Source

pub fn screen_create_handler(&mut self, screen: Screen<H>) -> bool

screen_create_handler is called when the display server sends a DisplayEvent::ScreenCreate(screen) event. This happens at initialization.

Returns true if changes need to be rendered.

Source§

impl<H: Handle, C: Config, SERVER: DisplayServer<H>> Manager<H, C, SERVER>

Source

pub fn window_created_handler( &mut self, window: Window<H>, x: i32, y: i32, ) -> bool

window_created_handler is called when the display server sends the event DisplayEvent::WindowCreate(w, x, y).

Returns true if changes need to be rendered.

Source

pub fn window_destroyed_handler(&mut self, handle: &WindowHandle<H>) -> bool

window_destroyed_handler is called when the display server sends the DisplayEvent::WindowDestroy(handle) event.

Returns true if changes need to be rendered.

Source

pub fn window_changed_handler(&mut self, change: WindowChange<H>) -> bool

window_changed_handler is called when the display server sends the DisplayEvent::WindowChange(change) event.

Returns true if changes need to be rendered.

Source

pub fn get_next_or_previous_handle( &mut self, handle: &WindowHandle<H>, ) -> Option<WindowHandle<H>>

Find the next or previous window on the currently focused workspace. May return None if no other window is present.

Returns true if changes need to be rendered.

Source§

impl<H: Handle, C: Config, SERVER: DisplayServer<H>> Manager<H, C, SERVER>

Source

pub fn window_move_handler( &mut self, handle: &WindowHandle<H>, offset_x: i32, offset_y: i32, ) -> bool

window_move_handler is called when the display server sends the DisplayEvent::MoveWindow(handle, offset_x, offset_y) event.

Returns true if changes need to be rendered.

Source§

impl<H: Handle, C: Config, SERVER: DisplayServer<H>> Manager<H, C, SERVER>

Source

pub fn window_resize_handler( &mut self, handle: &WindowHandle<H>, offset_w: i32, offset_h: i32, ) -> bool

Source§

impl<H: Handle, C, SERVER> Manager<H, C, SERVER>
where C: Config, SERVER: DisplayServer<H>,

Source

pub fn new(config: C) -> Self

Source§

impl<H: Handle, C, SERVER> Manager<H, C, SERVER>

Source

pub fn register_child_hook(&self)

Source

pub fn hard_reload(&mut self)

Soft reload the worker without saving state.

Source§

impl<H: Handle, C: Config, SERVER: DisplayServer<H>> Manager<H, C, SERVER>

Source

pub fn load_theme_config(&mut self) -> bool

Reload the configuration of the running Manager.

Source§

impl<H: Handle, C: Config, SERVER: DisplayServer<H>> Manager<H, C, SERVER>

Source

pub fn update_windows(&mut self)

Trait Implementations§

Source§

impl<H: Debug + Handle, C: Debug, SERVER: Debug> Debug for Manager<H, C, SERVER>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<H, C, SERVER> Freeze for Manager<H, C, SERVER>
where C: Freeze, SERVER: Freeze, H: Freeze,

§

impl<H, C, SERVER> RefUnwindSafe for Manager<H, C, SERVER>

§

impl<H, C, SERVER> Send for Manager<H, C, SERVER>
where C: Send, SERVER: Send,

§

impl<H, C, SERVER> Sync for Manager<H, C, SERVER>
where C: Sync, SERVER: Sync, H: Sync,

§

impl<H, C, SERVER> Unpin for Manager<H, C, SERVER>
where C: Unpin, SERVER: Unpin, H: Unpin,

§

impl<H, C, SERVER> UnwindSafe for Manager<H, C, SERVER>
where C: UnwindSafe, SERVER: UnwindSafe, H: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more