Skip to main content

Manager

Struct Manager 

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

Implementations§

Source§

impl Manager

Source

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.

Source

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.

Source

pub async fn capture_screen(&self) -> Result<ScreenSnapshot>

Capture the active LVGL screen into an owned, bounded RGBA8888 buffer.

Source

pub async fn get_resolution(&self) -> Result<Point>

Return the current active LVGL display resolution.

Source

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.

Source

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.

Source

pub async fn inject_pointer_move(&self, point: Point) -> Result<()>

Queue a pointer move for the graphics-owned LVGL pointer input.

Source

pub async fn inject_pointer_click(&self, point: Point) -> Result<()>

Atomically queue a pointer move and complete click at a valid display point.

Source

pub async fn inject_pointer_button(&self, state: State) -> Result<()>

Queue a pointer button state at the most recently injected pointer point.

Source

pub async fn inject_key(&self, key: Key, state: State) -> Result<()>

Queue one keyboard key transition for the graphics-owned LVGL keypad.

Source

pub async fn inject_key_press(&self, key: Key) -> Result<()>

Queue a complete key press and release, or leave the queue unchanged.

Source

pub async fn inject_text(&self, text: &str) -> Result<usize>

Queue printable ASCII text as ordered key press and release events.

Source

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.

Source

pub fn lock_function_sync<T>( &self, function: impl FnOnce() -> Result<T>, ) -> Result<T>

Source§

impl Manager

Source

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.

Source

pub async fn loop<F>( &self, sleep: impl Fn(Duration) -> F + Send + 'static, ) -> Result<()>
where F: Future<Output = ()> + Send + 'static,

Source

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.

Source

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();
}
Source

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.

Source

pub fn get_window_count(&self, lvgl: &Lvgl) -> Result<usize>

Source

pub fn get_window_icon( &self, lvgl: &Lvgl, index: usize, ) -> Result<(String, Color)>

Source

pub fn get_window_identifier(&self, lvgl: &Lvgl, index: usize) -> Result<usize>

Source

pub fn maximize_window(&self, lvgl: &mut Lvgl, identifier: usize) -> Result<()>

Source

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.

Source

pub async fn lock_function<T>( &self, function: impl FnOnce() -> Result<T>, ) -> Result<T>

Source

pub async fn lock(&self) -> GraphicsGuard<'_>

Source

pub fn synchronous_lock(&self) -> GraphicsGuard<'_>

Source

pub fn try_lock(&self) -> Option<GraphicsGuard<'_>>

Source

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.

Source

pub fn with_lvgl_sync<T>( &self, function: impl FnOnce(&mut Lvgl) -> Result<T>, ) -> Result<T>

Manager::with_lvgl from synchronous code.

Source

pub fn get_current_screen(&self, _lvgl: &Lvgl) -> Result<*mut lv_obj_t>

Source

pub async fn update_theme( &self, primary_color: Color, secondary_color: Color, is_dark: bool, ) -> Result<()>

Source

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.

Source

pub fn get_rendering_mode(&self) -> RenderingMode

The rendering mode in use.

Trait Implementations§

Source§

impl Drop for Manager

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Send for Manager

Source§

impl Sync for Manager

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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.