cognitive_wayland_frontend::engine

Struct Engine

Source
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

Source

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.

Source

pub fn start(&mut self, sender: DirectSender<Perceptron>)

Starts Engine: adds display socket to LocalDispatcher.

Source

pub fn receive(&mut self)

Reads client requests without blocking.

Source§

impl Engine

Public handlers for client related events.

Source

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
Source

pub fn terminate_client(&mut self, id: EventHandlerId)

Handles termination (socket hung up) of client.

Source

pub fn process_events(&mut self, id: EventHandlerId)

Handles request from client associated with given id.

Trait Implementations§

Source§

impl Gateway for Engine

Source§

fn on_output_found(&mut self, bundle: DrmBundle)

Notifies output was found.
Source§

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>)

Notifies keyboard key was pressed.
Source§

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, )

Notifies that pointer was moved from above one surface above another.
Source§

fn on_pointer_relative_motion( &self, sid: SurfaceId, position: Position, milliseconds: Milliseconds, )

Notifies that pointer moved.
Source§

fn on_pointer_button(&self, btn: Button)

Notifies mouse or touchpad button was pressed.
Source§

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)

Notifies about keyboard focus change.
Source§

fn on_transfer_offered(&mut self)

Handles change of offered transfer data.
Source§

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, )

Notifies about change of size or state of surface.
Source§

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> 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, 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.