Skip to main content

LinuxPlatform

Struct LinuxPlatform 

Source
pub struct LinuxPlatform { /* private fields */ }
Expand description

Direct Linux X11 / Wayland (dlopen-loaded) + Vulkan platform backend.

Implementations§

Source§

impl LinuxPlatform

Source

pub fn get_windows(&self) -> &HashMap<WindowId, LinuxWindowRecord>

Source

pub fn get_mut_windows(&mut self) -> &mut HashMap<WindowId, LinuxWindowRecord>

Source

pub fn set_windows( &mut self, val: HashMap<WindowId, LinuxWindowRecord>, ) -> &mut Self

Source

pub fn get_pending_events(&self) -> &Vec<WindowEvent>

Source

pub fn get_mut_pending_events(&mut self) -> &mut Vec<WindowEvent>

Source

pub fn set_pending_events(&mut self, val: Vec<WindowEvent>) -> &mut Self

Source

pub fn get_mut_clipboard_cache(&mut self) -> &mut Option<String>

Source

pub fn set_clipboard_cache(&mut self, val: Option<String>) -> &mut Self

Trait Implementations§

Source§

impl Clone for LinuxPlatform

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LinuxPlatform

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for LinuxPlatform

Default initialization for LinuxPlatform.

Source§

fn default() -> Self

Creates an empty Linux X11 / Wayland platform backend.

§Returns
  • Self - Initialized Linux backend.
Source§

impl PlatformBackend for LinuxPlatform

PlatformBackend implementation for native Linux.

Source§

fn kind(&self) -> PlatformKind

Returns PlatformKind::Linux.

§Arguments
  • &Self - Platform reference.
§Returns
  • PlatformKind - PlatformKind::Linux.
Source§

fn capabilities(&self) -> PlatformCapabilities

Returns Linux desktop capabilities.

§Arguments
  • &Self - Platform reference.
§Returns
  • PlatformCapabilities - Linux capability flags.
Source§

fn create_window( &mut self, config: &WindowConfig, ) -> Result<WindowState, PlatformError>

Opens an X11 or Wayland window via dynamic dlopen.

§Arguments
  • &Self - Mutable Linux platform.
  • &WindowConfig - Declarative window config.
§Returns
  • Result<WindowState, PlatformError> - Initial window state.
Source§

fn window_state(&self, id: WindowId) -> Option<WindowState>

Queries live WindowState for id.

§Arguments
  • &Self - Platform reference.
  • WindowId - Window handle.
§Returns
  • Option<WindowState> - Window state if open.
Source§

fn raw_window_handle(&self, id: WindowId) -> RawWindowHandle

Returns RawWindowHandle::Xlib or RawWindowHandle::Wayland for Vulkan/EGL surface binding.

§Arguments
  • &Self - Platform reference.
  • WindowId - Window handle.
§Returns
  • RawWindowHandle - Native Linux display/window handle.
Source§

fn poll_events(&mut self) -> Vec<WindowEvent>

Pumps pending X11 events and drains queued Linux events.

§Arguments
  • &Self - Mutable Linux platform.
§Returns
  • Vec<WindowEvent> - Pending events.
Source§

fn present_framebuffer( &mut self, id: WindowId, framebuffer: &Framebuffer, ) -> Result<(), PlatformError>

Presents framebuffer to the active Linux window surface via X11 XCreateImage + XPutImage.

§Arguments
  • &Self - Mutable Linux platform.
  • WindowId - Target window handle.
  • &Framebuffer - Rendered RGBA8 framebuffer.
§Returns
  • Result<(), PlatformError> - Presentation status.
Source§

fn read_clipboard(&self) -> Option<String>

Reads cached clipboard text.

§Arguments
  • &Self - Platform reference.
§Returns
  • Option<String> - Clipboard contents.
Source§

fn write_clipboard(&mut self, text: &str) -> Result<(), PlatformError>

Writes text to clipboard cache.

§Arguments
  • &Self - Mutable platform.
  • &str - Clipboard text.
§Returns
  • Result<(), PlatformError> - Write status.
Source§

fn system_theme(&self) -> ThemeMode

Returns active system theme mode.

§Arguments
  • &Self - Platform reference.
§Returns
  • ThemeMode - Active appearance mode.
Source§

fn present_framebuffer_region( &mut self, id: WindowId, framebuffer: &Framebuffer, _damage: DamageRegion, ) -> Result<(), PlatformError>

Presents a damaged sub-region of a CPU-rendered RGBA8 Framebuffer when supported by the backend. Read more
Source§

impl WindowController for LinuxPlatform

WindowController implementation for Linux X11 / Wayland.

Source§

fn apply_command(&mut self, command: WindowCommand) -> Result<(), PlatformError>

Applies a WindowCommand onto the native X11 or Wayland window.

§Arguments
  • &Self - Mutable Linux platform.
  • WindowCommand - Command to apply.
§Returns
  • Result<(), PlatformError> - Execution status.

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.