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>
impl<H: Handle, C: Config, SERVER: DisplayServer<H>> Manager<H, C, SERVER>
Sourcepub async fn start_event_loop(self) -> Result<(), Error>
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>
impl<H: Handle, C: Config, SERVER: DisplayServer<H>> Manager<H, C, SERVER>
Sourcepub fn command_handler(&mut self, command: &Command<H>) -> bool
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>
impl<H: Handle, C: Config, SERVER: DisplayServer<H>> Manager<H, C, SERVER>
Sourcepub fn display_event_handler(&mut self, event: DisplayEvent<H>) -> bool
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>
impl<H: Handle, C: Config, SERVER: DisplayServer<H>> Manager<H, C, SERVER>
Sourcepub fn screen_create_handler(&mut self, screen: Screen<H>) -> bool
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>
impl<H: Handle, C: Config, SERVER: DisplayServer<H>> Manager<H, C, SERVER>
Sourcepub fn window_created_handler(
&mut self,
window: Window<H>,
x: i32,
y: i32,
) -> bool
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.
Sourcepub fn window_destroyed_handler(&mut self, handle: &WindowHandle<H>) -> bool
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.
Sourcepub fn window_changed_handler(&mut self, change: WindowChange<H>) -> bool
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.
Sourcepub fn get_next_or_previous_handle(
&mut self,
handle: &WindowHandle<H>,
) -> Option<WindowHandle<H>>
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>
impl<H: Handle, C: Config, SERVER: DisplayServer<H>> Manager<H, C, SERVER>
Sourcepub fn window_move_handler(
&mut self,
handle: &WindowHandle<H>,
offset_x: i32,
offset_y: i32,
) -> bool
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>
impl<H: Handle, C: Config, SERVER: DisplayServer<H>> Manager<H, C, SERVER>
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>
impl<H: Handle, C, SERVER> Manager<H, C, SERVER>
pub fn register_child_hook(&self)
Sourcepub fn hard_reload(&mut self)
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>
impl<H: Handle, C: Config, SERVER: DisplayServer<H>> Manager<H, C, SERVER>
Sourcepub fn load_theme_config(&mut self) -> bool
pub fn load_theme_config(&mut self) -> bool
Reload the configuration of the running Manager
.