pub struct XFrontend { /* private fields */ }unsafe_ffi and x11 only.Expand description
๐ โฌก An X11 frontend for frame-driven runtimes.
Owns the current X11 runtime backend and its presentation finalizer, while leaving runtime control, app logic, and rendering policy external.
The current implementation manages one window. That is an implementation detail, not the intended long-term boundary.
Implementationsยง
Sourceยงimpl XFrontend
impl XFrontend
Sourcepub fn open(x: i16, y: i16, width: u16, height: u16) -> Result<Self, XError> โ
pub fn open(x: i16, y: i16, width: u16, height: u16) -> Result<Self, XError> โ
Opens an X11 frontend.
Sourcepub fn open_with(
mode: XImageMode,
x: i16,
y: i16,
width: u16,
height: u16,
) -> Result<Self, XError> โ
pub fn open_with( mode: XImageMode, x: i16, y: i16, width: u16, height: u16, ) -> Result<Self, XError> โ
Opens an X11 frontend with the given image mode.
Sourcepub const fn display_mut(&mut self) -> &mut XDisplay
pub const fn display_mut(&mut self) -> &mut XDisplay
Returns an exclusive reference to the X11 Display server.
Sourcepub const fn mode(&self) -> XImageMode
pub const fn mode(&self) -> XImageMode
Returns the configured X11 image presentation mode.
This is the mode requested when opening the frontend.
It may still be XImageMode::Auto before any presentation occurs.
Sourcepub fn active_mode(&self) -> Option<XImageMode> โ
pub fn active_mode(&self) -> Option<XImageMode> โ
Returns the currently resolved X11 image presentation mode, if any.
This resolves the active backing chosen after presentation begins.
It returns None while no presentation surface has been created yet.
Sourcepub fn poll_event(&mut self) -> Event
pub fn poll_event(&mut self) -> Event
Polls the next event without blocking.
See XDisplay::poll_event for more information.
Sourcepub fn wait_event(&mut self) -> Event
pub fn wait_event(&mut self) -> Event
Waits for the next event, blocking until one is available.
See XDisplay::wait_event for more information.
Sourceยงimpl XFrontend
impl XFrontend
Sourcepub fn step_frame<T, A, R, S, RE>(
&mut self,
driver: &mut RunDriver<T>,
app: &mut A,
renderer: &mut R,
scene: &S,
events: &mut [A::Event],
) -> Result<RunControl, RunDriverFrameError<XError, A::Error, RE, XError>> โ
pub fn step_frame<T, A, R, S, RE>( &mut self, driver: &mut RunDriver<T>, app: &mut A, renderer: &mut R, scene: &S, events: &mut [A::Event], ) -> Result<RunControl, RunDriverFrameError<XError, A::Error, RE, XError>> โ
Drives one X11 runtime iteration including rendering and presentation.
Sourceยงimpl XFrontend
impl XFrontend
Sourcepub fn with_surface_frame<F, T>(
&mut self,
width: u16,
height: u16,
depth: u8,
clear_redraw: bool,
render: F,
) -> Result<T, XError> โ
pub fn with_surface_frame<F, T>( &mut self, width: u16, height: u16, depth: u8, clear_redraw: bool, render: F, ) -> Result<T, XError> โ
Renders directly into the retained X11 surface and presents it.
This bypasses XRasterRenderer
and avoids the scene-to-surface copy.
Sourcepub fn step_frame_surface<R, A, F, RE>(
&mut self,
driver: &mut RunDriver<R>,
app: &mut A,
width: u16,
height: u16,
depth: u8,
clear_redraw: bool,
events: &mut [Event],
render: F,
) -> Result<RunControl, RunDriverFrameError<XError, A::Error, RE, XError>> โ
pub fn step_frame_surface<R, A, F, RE>( &mut self, driver: &mut RunDriver<R>, app: &mut A, width: u16, height: u16, depth: u8, clear_redraw: bool, events: &mut [Event], render: F, ) -> Result<RunControl, RunDriverFrameError<XError, A::Error, RE, XError>> โ
Advances one runtime frame and renders directly into the retained X11 surface.
This is the X11-specific zero-copy rendering path. It bypasses
XRasterRenderer and exposes the
retained surface bytes for the duration of one frame.
This avoids the intermediate artifact-to-surface copy, but it also gives up backend independence.
Trait Implementationsยง
Auto Trait Implementationsยง
impl !Send for XFrontend
impl !Sync for XFrontend
impl Freeze for XFrontend
impl RefUnwindSafe for XFrontend
impl Unpin for XFrontend
impl UnsafeUnpin for XFrontend
impl UnwindSafe for XFrontend
Blanket Implementationsยง
Sourceยงimpl<T> AnyExt for T
impl<T> AnyExt for T
Sourceยงfn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
TypeId of Self using a custom hasher.Sourceยงfn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Sourceยงfn as_any_box(self: Box<Self>) -> Box<dyn Any>where
Self: Sized,
fn as_any_box(self: Box<Self>) -> Box<dyn Any>where
Self: Sized,
alloc only.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
Sourceยงimpl<T> ByteSized for T
impl<T> ByteSized for T
Sourceยงconst BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
Sourceยงfn byte_align(&self) -> usize
fn byte_align(&self) -> usize
Sourceยงfn ptr_size_ratio(&self) -> [usize; 2]
fn ptr_size_ratio(&self) -> [usize; 2]
Sourceยงimpl<T> MemExt for Twhere
T: ?Sized,
impl<T> MemExt for Twhere
T: ?Sized,
Sourceยงconst NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Sourceยงfn mem_align_of<T>() -> usize
fn mem_align_of<T>() -> usize
Sourceยงfn mem_align_of_val(&self) -> usize
fn mem_align_of_val(&self) -> usize
Sourceยงfn mem_size_of<T>() -> usize
fn mem_size_of<T>() -> usize
Sourceยงfn mem_size_of_val(&self) -> usize
fn mem_size_of_val(&self) -> usize
Sourceยงfn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
true if dropping values of this type matters. Read moreSourceยงfn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
self without running its destructor. Read moreSourceยงfn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
Sourceยงunsafe fn mem_zeroed<T>() -> T
unsafe fn mem_zeroed<T>() -> T
unsafe_layout only.T represented by the all-zero byte-pattern. Read moreSourceยงunsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe_layout only.T represented by the all-zero byte-pattern. Read moreSourceยงfn mem_as_bytes(&self) -> &[u8] โ
fn mem_as_bytes(&self) -> &[u8] โ
unsafe_slice only.