pub struct Manager { /* private fields */ }Implementations§
Source§impl Manager
impl Manager
Sourcepub async fn inspect_ui_tree(
&self,
max_elements: usize,
max_depth: usize,
) -> Result<UiTreeSnapshot>
pub async fn inspect_ui_tree( &self, max_elements: usize, max_depth: usize, ) -> Result<UiTreeSnapshot>
Snapshot a bounded depth-first view of the currently mounted UI tree.
Element IDs are indexes into this snapshot and must not be retained across snapshots. No LVGL pointer is returned to the caller.
Sourcepub async fn click_ui(
&self,
role: Option<&str>,
name: Option<&str>,
text: Option<&str>,
button: Option<&str>,
) -> Result<(i32, i32), &'static str>
pub async fn click_ui( &self, role: Option<&str>, name: Option<&str>, text: Option<&str>, button: Option<&str>, ) -> Result<(i32, i32), &'static str>
Resolve and hit-test a unique control while holding the graphics lock. Coordinates and raw object pointers never survive the operation.
Sourcepub async fn capture_screen(&self) -> Result<ScreenSnapshot>
pub async fn capture_screen(&self) -> Result<ScreenSnapshot>
Capture the active LVGL screen into an owned, bounded RGBA8888 buffer.
Sourcepub async fn get_resolution(&self) -> Result<Point>
pub async fn get_resolution(&self) -> Result<Point>
Return the current active LVGL display resolution.
Sourcepub async fn get_brightness(&self) -> Result<u8>
pub async fn get_brightness(&self) -> Result<u8>
Read the backlight brightness of the main screen, from
BRIGHTNESS_OFF to
BRIGHTNESS_FULL.
Returns Error::Unsupported when the screen has no brightness
control. Brightness does not touch LVGL: callers may hold the LVGL lock
or not.
Sourcepub async fn set_brightness(&self, level: u8) -> Result<()>
pub async fn set_brightness(&self, level: u8) -> Result<()>
Set the backlight brightness of the main screen; see
Manager::get_brightness. Level BRIGHTNESS_OFF
turns the backlight off.
Sourcepub async fn inject_pointer_move(&self, point: Point) -> Result<()>
pub async fn inject_pointer_move(&self, point: Point) -> Result<()>
Queue a pointer move for the graphics-owned LVGL pointer input.
Sourcepub async fn inject_pointer_click(&self, point: Point) -> Result<()>
pub async fn inject_pointer_click(&self, point: Point) -> Result<()>
Atomically queue a pointer move and complete click at a valid display point.
Queue a pointer button state at the most recently injected pointer point.
Sourcepub async fn inject_key(&self, key: Key, state: State) -> Result<()>
pub async fn inject_key(&self, key: Key, state: State) -> Result<()>
Queue one keyboard key transition for the graphics-owned LVGL keypad.
Sourcepub async fn inject_key_press(&self, key: Key) -> Result<()>
pub async fn inject_key_press(&self, key: Key) -> Result<()>
Queue a complete key press and release, or leave the queue unchanged.
Sourcepub async fn inject_text(&self, text: &str) -> Result<usize>
pub async fn inject_text(&self, text: &str) -> Result<usize>
Queue printable ASCII text as ordered key press and release events.
Sourcepub async fn inject_text_chunk(&self, text: &str) -> Result<usize>
pub async fn inject_text_chunk(&self, text: &str) -> Result<usize>
Queue a bounded prefix of printable Unicode text, returning the accepted byte count. A queue-full error never enqueues a partial press/release pair.
pub fn lock_function_sync<T>( &self, function: impl FnOnce() -> Result<T>, ) -> Result<T>
Source§impl Manager
impl Manager
Sourcepub async fn enable_on_screen_keyboard(&self)
pub async fn enable_on_screen_keyboard(&self)
Enable the system on-screen keyboard on the first display.
Call during platform setup on touch-only devices, before creating any file pickers. A picker chooses its keyboard when it is created. Tapping a text area on the active screen opens the keyboard.
pub async fn loop<F>( &self, sleep: impl Fn(Duration) -> F + Send + 'static, ) -> Result<()>
Sourcepub unsafe fn set_window_parent(
&self,
_lvgl: &mut Lvgl,
window_parent: *mut lv_obj_t,
)
pub unsafe fn set_window_parent( &self, _lvgl: &mut Lvgl, window_parent: *mut lv_obj_t, )
Create the next windows inside window_parent instead of the screen.
§Safety
window_parent must be a live LVGL object that stays alive while it
is the window parent and holds windows. It must not be inside a window.
Sourcepub fn create_window(&'static self, lvgl: &mut Lvgl) -> Result<OwnedWindow>
pub fn create_window(&'static self, lvgl: &mut Lvgl) -> Result<OwnedWindow>
Create a window inside the window parent. By default this is the
active screen. Returns Error::AlreadyInUse if a pending screen
transition can delete the parent. The manager must outlive the owner.
fn create(manager: &'static graphics::Manager) {
let _ = manager.create_window();
}Sourcepub async fn add_input_device(
&self,
input_device: &'static dyn DirectCharacterDevice,
input_type: InputKind,
) -> Result<()>
pub async fn add_input_device( &self, input_device: &'static dyn DirectCharacterDevice, input_type: InputKind, ) -> Result<()>
Register a physical input device under the graphics lock.
pub fn get_window_count(&self, lvgl: &Lvgl) -> Result<usize>
pub fn get_window_icon( &self, lvgl: &Lvgl, index: usize, ) -> Result<(String, Color)>
pub fn get_window_identifier(&self, lvgl: &Lvgl, index: usize) -> Result<usize>
pub fn maximize_window(&self, lvgl: &mut Lvgl, identifier: usize) -> Result<()>
Sourcepub fn send_window_close_request(
&self,
lvgl: &mut Lvgl,
identifier: usize,
) -> Result<()>
pub fn send_window_close_request( &self, lvgl: &mut Lvgl, identifier: usize, ) -> Result<()>
Request that a window close. A pending request satisfies later calls until the window consumes it.
Returns InvalidWindowIdentifier if the identifier does not identify
a window, or NotAvailable if dispatch fails or leaves no pending request.
pub async fn lock_function<T>( &self, function: impl FnOnce() -> Result<T>, ) -> Result<T>
pub async fn lock(&self) -> GraphicsGuard<'_>
pub fn synchronous_lock(&self) -> GraphicsGuard<'_>
pub fn try_lock(&self) -> Option<GraphicsGuard<'_>>
Sourcepub async fn with_lvgl<T>(
&self,
function: impl FnOnce(&mut Lvgl) -> Result<T>,
) -> Result<T>
pub async fn with_lvgl<T>( &self, function: impl FnOnce(&mut Lvgl) -> Result<T>, ) -> Result<T>
Run a synchronous operation under the graphics lock, in an LVGL session. Use the existing guard if the lock is already held.
Sourcepub fn with_lvgl_sync<T>(
&self,
function: impl FnOnce(&mut Lvgl) -> Result<T>,
) -> Result<T>
pub fn with_lvgl_sync<T>( &self, function: impl FnOnce(&mut Lvgl) -> Result<T>, ) -> Result<T>
Manager::with_lvgl from synchronous code.
pub fn get_current_screen(&self, _lvgl: &Lvgl) -> Result<*mut lv_obj_t>
pub async fn update_theme( &self, primary_color: Color, secondary_color: Color, is_dark: bool, ) -> Result<()>
Sourcepub async fn set_rendering_mode(&self, mode: RenderingMode) -> Result<()>
pub async fn set_rendering_mode(&self, mode: RenderingMode) -> Result<()>
Select how much the theme may spend on rendering, on every display.
The mode is theme::RenderingMode::Default until a platform selects
another one for a slow display, ideally before it creates the interface.
Sourcepub fn get_rendering_mode(&self) -> RenderingMode
pub fn get_rendering_mode(&self) -> RenderingMode
The rendering mode in use.