Skip to main content

Crate ferroui_headless_vnc

Crate ferroui_headless_vnc 

Source
Expand description

The VNC server of the headless platform.

An application runs on the headless platform (ferroui-headless), renders its windows with a rendering backend (Skia by default), and a VNC (RFB) server shows its main window to any VNC viewer and passes the keyboard and the mouse of the viewer to it:

use ferroui_controls::{AppBuilder, Application, ShutdownMode};
use ferroui_headless_vnc::HeadlessVncPlatformExtensions;

fn main() {
    let args: Vec<String> = std::env::args().skip(1).collect();
    // The builder of the application, with its rendering backend (for
    // example `use_skia` of `ferroui-skia`).
    let builder = AppBuilder::configure::<Application>();
    let exit_code = builder.start_with_headless_vnc_platform(None, 5901, &args, ShutdownMode::OnMainWindowClose);
    std::process::exit(exit_code);
}

HeadlessVncPlatformExtensions starts the application with the headless platform, binds the server (on the loopback address unless a host is given, with an optional password) and runs the lifetime of the application. Each client gets a session (remote_viewing::vnc::server::VncServerSession) whose framebuffer is the last frame of the main window (HeadlessVncFramebufferSource).

The RFB server is remote_viewing, a port of the parts of the .NET library RemoteViewing that the original builds on (NOTICE.md of this crate; docs/porting/headless-vnc.md of the repository says why it was ported and what differs).

Modules§

remote_viewing
The RFB (VNC) server the original is built on: a port of the parts of RemoteViewing (https://github.com/quamotion/remoteviewing, version 1.1.211, BSD-2-Clause; NOTICE.md of this crate) that the original uses.

Structs§

HeadlessVncFramebufferSource
The framebuffer source of a VNC server session that shows a headless window.

Traits§

HeadlessVncPlatformExtensions
The extensions of the application builder that start an application on the headless platform with a VNC server.