|
oveRTOS C++ API
C++20 RAII wrappers for the oveRTOS C API
|
Non-owning, pointer-sized wrapper around an lv_obj_t*.
More...
#include <lvgl.hpp>

Public Member Functions | |
| ObjectView () | |
Constructs a null ObjectView (no associated LVGL object). | |
| ObjectView (lv_obj_t *obj) | |
Constructs an ObjectView wrapping the given lv_obj_t*. | |
| lv_obj_t * | get () const |
Returns the raw lv_obj_t* pointer. | |
| operator lv_obj_t * () const | |
Implicit conversion to lv_obj_t* for use with LVGL C APIs. | |
| operator bool () const | |
Contextual bool conversion — true if the object pointer is non-null. | |
| ObjectView | parent () const |
Returns an ObjectView wrapping the parent of this object. | |
| uint32_t | child_count () const |
| Returns the number of direct children of this object. | |
| int32_t | get_width () const |
| Returns the current rendered width of this object. | |
| int32_t | get_height () const |
| Returns the current rendered height of this object. | |
| void | del () |
| Deletes the LVGL object and all its children, then nulls the pointer. | |
| void | clean () |
| Deletes all children of this object without deleting the object itself. | |
Static Public Member Functions | |
| static ObjectView | screen_active () |
Returns an ObjectView wrapping the currently active screen. | |
Protected Attributes | |
| lv_obj_t * | obj_ |
| Raw pointer to the wrapped LVGL object. | |
Non-owning, pointer-sized wrapper around an lv_obj_t*.
ObjectView does not manage the lifetime of the underlying LVGL object. It provides safe, ergonomic access to the raw lv_obj_t* and exposes a small set of read/query operations. Widget classes (Label, Bar, Box) inherit from ObjectView to gain these capabilities.
The class is guaranteed to be pointer-sized (asserted via static_assert).
ObjectView does NOT delete the underlying LVGL object. Use del() to explicitly delete the LVGL object tree.
|
inlineexplicit |
Constructs an ObjectView wrapping the given lv_obj_t*.
| [in] | obj | Pointer to an existing LVGL object; may be null. |
|
inline |
Returns the raw lv_obj_t* pointer.
|
inline |
Implicit conversion to lv_obj_t* for use with LVGL C APIs.
|
inlineexplicit |
Contextual bool conversion — true if the object pointer is non-null.
true when wrapping a valid LVGL object.
|
inline |
Returns an ObjectView wrapping the parent of this object.
ObjectView of the parent, or a null view if there is none.
|
inline |
Returns the number of direct children of this object.
uint32_t.
|
inline |
Returns the current rendered width of this object.
|
inline |
Returns the current rendered height of this object.
|
inline |
Deletes the LVGL object and all its children, then nulls the pointer.
After calling this method the ObjectView is in a null/invalid state.
|
inlinestatic |
Returns an ObjectView wrapping the currently active screen.
ObjectView of the active LVGL screen.