pub struct Window { /* private fields */ }Expand description
An LVGL object that queues the events of its widgets for one consumer.
The fixed ring has crate::WINDOW_EVENT_QUEUE_CAPACITY regular slots.
A separate slot holds a pending CloseRequested in arrival order.
Further close requests merge into it until the consumer takes it.
Press repeats and state changes coalesce for the same target between
lifecycle events. When the ring is full, higher-priority events can evict
lower-priority events. Insert and Delete are low-priority notifications.
Lifecycle events stay in arrival order. The queue reserves room for the
end of each accepted press. If it rejects a press, it rejects its end.
Losses are counted (Window::dropped_event_count) and logged at most
once per second. The crate README (“Window events”) details the policy.
Implementations§
Source§impl Window
impl Window
Sourcepub unsafe fn new(parent: *mut lv_obj_t) -> Result<NonNull<Self>>
pub unsafe fn new(parent: *mut lv_obj_t) -> Result<NonNull<Self>>
Create a new window.
The caller owns the new window: give it to OwnedWindow::from_raw,
or delete it itself with lv_obj_delete, exactly once.
§Arguments
parent- The parent object of the window.
§Safety
parent must be a live LVGL object, and the caller must hold the
graphics lock.
Sourcepub unsafe fn peek_event(window: NonNull<Self>) -> Option<Event>
pub unsafe fn peek_event(window: NonNull<Self>) -> Option<Event>
Read the oldest queued event without removing it.
§Safety
The caller holds the graphics lock and window points to a live Window.
Sourcepub unsafe fn dropped_event_count(window: NonNull<Self>) -> u32
pub unsafe fn dropped_event_count(window: NonNull<Self>) -> u32
Count events lost to queue overflow since the window was created.
§Safety
The caller holds the graphics lock and window points to a live Window.