Skip to main content

CefRenderer

Struct CefRenderer 

Source
pub struct CefRenderer { /* private fields */ }

Implementations§

Source§

impl CefRenderer

Source

pub fn new(config: &AppConfig) -> Result<Self>

Source

pub fn set_screenshot_sink( &mut self, sink: Arc<dyn Fn(&[u8], u32, u32) + Send + Sync>, )

Publish each complete CDP PNG frame to a native Agent or test sink. The callback receives immutable bytes and the decoded frame dimensions.

Source

pub fn set_outbox(&mut self, outbox: Arc<Mutex<Vec<String>>>)

Attach an external outbox so other runtimes (e.g. a Node extension host, or the global hotkey / input managers) can push messages to the frontend. Each entry is a JSON string emitted as window.__RDESKTOP_IPC__(<json>).

Trait Implementations§

Source§

impl Renderer for CefRenderer

Source§

fn init(&mut self) -> Result<()>

Initialize the renderer.
Source§

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

Create a new window with the given configuration.
Source§

fn load_url(&self, w: WindowHandle, url: &str) -> Result<()>

Load a URL in the specified window.
Source§

fn load_html(&self, w: WindowHandle, html: &str) -> Result<()>

Load HTML content directly.
Source§

fn eval_script(&self, w: WindowHandle, script: &str) -> Result<()>

Execute JavaScript in the specified window.
Source§

fn set_ipc_handler(&mut self, h: Box<dyn IpcHandler>)

Set the IPC handler for messages from the frontend.
Source§

fn send_to_frontend(&self, w: WindowHandle, msg: &str) -> Result<()>

Send a message to the frontend JavaScript.
Source§

fn set_title(&self, _w: WindowHandle, _t: &str) -> Result<()>

Set the window title.
Source§

fn set_size(&self, _w: WindowHandle, _x: u32, _y: u32) -> Result<()>

Set the window size.
Source§

fn set_resizable(&self, _w: WindowHandle, _r: bool) -> Result<()>

Set whether the window is resizable.
Source§

fn set_visible(&self, _w: WindowHandle, _v: bool) -> Result<()>

Show or hide the window.
Source§

fn close_window(&mut self, _w: WindowHandle) -> Result<()>

Close a window.
Source§

fn minimize_window(&self, _w: WindowHandle) -> Result<()>

Minimize the window.
Source§

fn maximize_window(&self, _w: WindowHandle) -> Result<()>

Toggle maximize/restore.
Source§

fn is_maximized(&self, _w: WindowHandle) -> Result<bool>

Check whether the window is currently maximized.
Source§

fn set_fullscreen(&self, _w: WindowHandle, _f: bool) -> Result<()>

Toggle fullscreen mode.
Source§

fn is_fullscreen(&self, _w: WindowHandle) -> Result<bool>

Check whether the window is currently fullscreen.
Source§

fn start_drag(&self, _w: WindowHandle) -> Result<()>

Begin an interactive window drag. Read more
Source§

fn start_resize(&self, _w: WindowHandle, _e: ResizeEdge) -> Result<()>

Begin an interactive window resize. Read more
Source§

fn set_decorations(&self, _w: WindowHandle, _d: bool) -> Result<()>

Set whether the window has OS decorations (title bar + borders).
Source§

fn set_always_on_top(&self, _w: WindowHandle, _a: bool) -> Result<()>

Set the window’s always-on-top state.
Source§

fn run(self: Box<Self>) -> Result<()>

Run the main event loop. This blocks until the application exits.
Source§

fn kind(&self) -> RendererKind

Get the renderer kind.
Source§

fn load_html_with_base_url( &self, window: WindowHandle, html: &str, base_url: &str, ) -> Result<(), RdesktopError>

Load HTML content with a document base URL for relative assets. Read more
Source§

fn set_click_through( &self, _window: WindowHandle, _enabled: bool, ) -> Result<(), RdesktopError>

Enable or disable click-through: when enabled, pointer events fall through the window to whatever is behind it (used by wallpaper and click-through overlays). Applied at window creation by default; this method allows toggling it at runtime where the platform supports it. Read more

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more