Skip to main content

ferroui_linuxframebuffer/
lib.rs

1//! The Linux framebuffer platform of FerroUI: an application without a
2//! window system, as one full-screen top-level drawn into a framebuffer
3//! device (`/dev/fb0`) or onto a KMS output, with input read from the
4//! kernel's input devices.
5//!
6//! An application starts on it with one of the functions of
7//! [`LinuxFramebufferPlatformExtensions`] on its builder, after choosing
8//! a renderer:
9//!
10//! ```ignore
11//! let code = AppBuilder::configure::<App>().use_skia().start_linux_fb_dev(&args, None, 1.0, None)?;
12//! ```
13//!
14//! Without an input backend the input is read through `libinput` from
15//! every event device (touch, absolute pointers, buttons and the wheel,
16//! as the reference: no keys and no relative motion), or, with
17//! `FERROUI_USE_EVDEV=1`, from the devices the environment names: one
18//! variable `FERROUI_EVDEV_DEVICE_{name}` per device,
19//! `(path):type=(touchscreen|multitouch|keyboard|mouse)`, with an optional
20//! `:calibration=m11,m12,m21,m22,m31,m32` for the touch screens. The keys
21//! of a keyboard are those of a US layout.
22//!
23//! The design, what is built and what was verified where:
24//! `docs/porting/linux-framebuffer-platform.md`. Built: the framebuffer
25//! device output with software rendering, the DRM output (a KMS
26//! connector drawn with OpenGL through EGL on a GBM surface; `libdrm`,
27//! `libgbm` and `libEGL` are opened at run time), the evdev input backend
28//! and the `libinput` backend (the default; the library is opened at run
29//! time).
30//!
31//! The parts that are functions of values compile on every Unix system
32//! (their tests run on a development machine that is not Linux); what
33//! makes Linux system calls is compiled for Linux only. The crate is
34//! empty elsewhere.
35
36#![cfg(unix)]
37#![cfg_attr(not(target_os = "linux"), allow(dead_code))]
38
39mod drm_connector_type;
40mod drm_output_options;
41mod epoll_dispatcher_impl;
42mod framebuffer_toplevel_impl;
43pub mod input;
44#[cfg(target_os = "linux")]
45mod linux_framebuffer_platform;
46mod linux_framebuffer_platform_options;
47#[cfg(target_os = "linux")]
48mod native_library;
49pub mod native_unsafe_methods;
50pub mod output;
51pub mod raw_event_grouping;
52#[cfg(target_os = "linux")]
53mod stubs;
54
55pub use drm_connector_type::DrmConnectorType;
56pub use drm_output_options::DrmOutputOptions;
57#[cfg(target_os = "linux")]
58pub use epoll_dispatcher_impl::EpollDispatcherImpl;
59pub use framebuffer_toplevel_impl::FramebufferToplevelImpl;
60#[cfg(target_os = "linux")]
61pub use linux_framebuffer_platform::{
62    LinuxFramebufferLifetime, LinuxFramebufferPlatform, LinuxFramebufferPlatformExtensions,
63};
64pub use linux_framebuffer_platform_options::LinuxFramebufferPlatformOptions;