pub struct Engine { /* private fields */ }
Expand description
This is main structure of wayland_frontend
crate.
For information about its role and place among other structures see crate-level documentation.
Implementations§
Source§impl Engine
impl Engine
Sourcepub fn new(
coordinator: Box<dyn FrontendsCoordinationTrait>,
settings: Settings,
keyboard_config: KeyboardConfig,
) -> Self
pub fn new( coordinator: Box<dyn FrontendsCoordinationTrait>, settings: Settings, keyboard_config: KeyboardConfig, ) -> Self
Constructs new Engine
.
Sets display socket up. First tries default skylane
socket, if that fails tries
$XDG_RUNTIME_DIR/wayland-X
where X
is number from 0 to 9.
Panics if failed to set display socket up or to initialize keyboard state.
Sourcepub fn start(&mut self, sender: DirectSender<Perceptron>)
pub fn start(&mut self, sender: DirectSender<Perceptron>)
Starts Engine
: adds display socket to LocalDispatcher
.
Source§impl Engine
impl Engine
Public handlers for client related events.
Sourcepub fn handle_new_client(
&mut self,
sender: DirectSender<Perceptron>,
coordinator: Box<dyn FrontendsCoordinationTrait>,
)
pub fn handle_new_client( &mut self, sender: DirectSender<Perceptron>, coordinator: Box<dyn FrontendsCoordinationTrait>, )
Handles new client:
- accepts socket and adds it to
Dispatcher
- creates proxy for new client and registers global Wayland objects.
- creates global display Wayland objects and bind it to client
Sourcepub fn terminate_client(&mut self, id: EventHandlerId)
pub fn terminate_client(&mut self, id: EventHandlerId)
Handles termination (socket hung up) of client.
Sourcepub fn process_events(&mut self, id: EventHandlerId)
pub fn process_events(&mut self, id: EventHandlerId)
Handles request from client associated with given id
.
Trait Implementations§
Source§impl Gateway for Engine
impl Gateway for Engine
Source§fn on_output_found(&mut self, bundle: DrmBundle)
fn on_output_found(&mut self, bundle: DrmBundle)
Notifies output was found.
Source§fn on_display_created(&mut self, output_info: OutputInfo)
fn on_display_created(&mut self, output_info: OutputInfo)
Notifies display was created.
Source§fn on_keyboard_input(&mut self, key: Key, _mods: Option<KeyMods>)
fn on_keyboard_input(&mut self, key: Key, _mods: Option<KeyMods>)
Notifies keyboard key was pressed.
Source§fn on_surface_frame(&mut self, sid: SurfaceId, milliseconds: Milliseconds)
fn on_surface_frame(&mut self, sid: SurfaceId, milliseconds: Milliseconds)
Notifies about redrawing surface.
Source§fn on_pointer_focus_changed(
&self,
old_sid: SurfaceId,
new_sid: SurfaceId,
position: Position,
)
fn on_pointer_focus_changed( &self, old_sid: SurfaceId, new_sid: SurfaceId, position: Position, )
Notifies that pointer was moved from above one surface above another.
Source§fn on_pointer_relative_motion(
&self,
sid: SurfaceId,
position: Position,
milliseconds: Milliseconds,
)
fn on_pointer_relative_motion( &self, sid: SurfaceId, position: Position, milliseconds: Milliseconds, )
Notifies that pointer moved.
Notifies mouse or touchpad button was pressed.
Source§fn on_pointer_axis(&self, axis: Axis)
fn on_pointer_axis(&self, axis: Axis)
Notifies about pointer move.
Source§fn on_keyboard_focus_changed(&mut self, old_sid: SurfaceId, new_sid: SurfaceId)
fn on_keyboard_focus_changed(&mut self, old_sid: SurfaceId, new_sid: SurfaceId)
Notifies about keyboard focus change.
Source§fn on_transfer_offered(&mut self)
fn on_transfer_offered(&mut self)
Handles change of offered transfer data.
Source§fn on_transfer_requested(&mut self, mime_type: String, fd: RawFd)
fn on_transfer_requested(&mut self, mime_type: String, fd: RawFd)
Handles data transfer request to requesting client.
Source§fn on_surface_reconfigured(
&self,
sid: SurfaceId,
size: Size,
state_flags: SurfaceState,
)
fn on_surface_reconfigured( &self, sid: SurfaceId, size: Size, state_flags: SurfaceState, )
Notifies about change of size or state of surface.
Source§fn on_screenshot_done(&mut self)
fn on_screenshot_done(&mut self)
Notifies that screenshot data are ready.
Auto Trait Implementations§
impl Freeze for Engine
impl !RefUnwindSafe for Engine
impl !Send for Engine
impl !Sync for Engine
impl Unpin for Engine
impl !UnwindSafe for Engine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more