165 operator lv_obj_t *()
const
174 explicit operator bool()
const
176 return obj_ !=
nullptr;
194 return lv_obj_get_child_count(
obj_);
213 return lv_obj_get_width(
obj_);
222 return lv_obj_get_height(
obj_);
258static_assert(
sizeof(
ObjectView) ==
sizeof(
void *),
"ObjectView must be pointer-sized");
289 Derived &
size(int32_t w, int32_t h)
291 lv_obj_set_size(self().get(), w, h);
302 lv_obj_set_width(self().get(), w);
313 lv_obj_set_height(self().get(), h);
323 Derived &
pos(int32_t x, int32_t y)
325 lv_obj_set_pos(self().get(), x, y);
335 lv_obj_center(self().get());
346 Derived &
align(lv_align_t a, int32_t x_ofs = 0, int32_t y_ofs = 0)
348 lv_obj_align(self().get(), a, x_ofs, y_ofs);
358 lv_obj_add_flag(self().get(), LV_OBJ_FLAG_HIDDEN);
368 lv_obj_remove_flag(self().get(), LV_OBJ_FLAG_HIDDEN);
389 lv_obj_add_flag(self().get(), f);
400 lv_obj_remove_flag(self().get(), f);
411 lv_obj_add_state(self().get(), s);
422 lv_obj_remove_state(self().get(), s);
433 lv_obj_set_user_data(self().get(), data);
445 lv_obj_add_flag(self().get(), LV_OBJ_FLAG_CLICKABLE);
447 lv_obj_remove_flag(self().get(), LV_OBJ_FLAG_CLICKABLE);
462 Derived &
grid_dsc(
const int32_t *cols,
const int32_t *rows)
464 lv_obj_set_grid_dsc_array(self().get(), cols, rows);
473 lv_obj_set_flex_flow(self().get(), flow);
480 Derived &
flex_align(lv_flex_align_t main, lv_flex_align_t cross, lv_flex_align_t track)
482 lv_obj_set_flex_align(self().get(), main, cross, track);
491 lv_obj_set_flex_grow(self().get(), grow);
500 lv_obj_set_layout(self().get(), kind);
509 lv_obj_scroll_to_y(self().get(), y, anim);
518 lv_obj_update_layout(self().get());
525 return lv_obj_get_content_width(
526 const_cast<lv_obj_t *
>(
static_cast<const Derived &
>(*this).get()));
532 return lv_obj_get_scroll_bottom(
533 const_cast<lv_obj_t *
>(
static_cast<const Derived &
>(*this).get()));
539 lv_obj_remove_style_all(self().get());
553 Derived &
grid_cell(lv_grid_align_t col_align, int32_t col_pos, int32_t col_span,
554 lv_grid_align_t row_align, int32_t row_pos, int32_t row_span)
556 lv_obj_set_grid_cell(self().get(), col_align, col_pos, col_span, row_align, row_pos,
574 return static_cast<Derived &
>(*this);
629 template <detail::StatelessCallable F> Derived &
on(lv_event_code_t code, F &&fn)
631 lv_obj_add_event_cb(self().get(),
static_cast<lv_event_cb_t
>(fn), code,
nullptr);
648 template <auto MemFn,
typename T> Derived &
on(lv_event_code_t code, T *instance)
653 auto *self =
static_cast<T *
>(lv_event_get_user_data(e));
666 template <detail::StatelessCallable F> Derived &
on_click(F &&fn)
668 return on(LV_EVENT_CLICKED,
static_cast<F &&
>(fn));
678 template <auto MemFn,
typename T> Derived &
on_click(T *instance)
709 return static_cast<Derived &
>(*this);
739 lv_obj_set_style_bg_color(self().get(), c, LV_PART_MAIN);
747 Derived &
bg_color(lv_color_t c, lv_style_selector_t part)
749 lv_obj_set_style_bg_color(self().get(), c, part);
760 lv_obj_set_style_bg_opa(self().get(), opa, LV_PART_MAIN);
765 Derived &
bg_opa(lv_opa_t opa, lv_style_selector_t part)
767 lv_obj_set_style_bg_opa(self().get(), opa, part);
778 lv_obj_set_style_border_color(self().get(), c, LV_PART_MAIN);
789 lv_obj_set_style_border_width(self().get(), w, LV_PART_MAIN);
796 lv_obj_set_style_border_width(self().get(), w, part);
807 lv_obj_set_style_radius(self().get(), r, LV_PART_MAIN);
812 Derived &
radius(int32_t r, lv_style_selector_t part)
814 lv_obj_set_style_radius(self().get(), r, part);
825 lv_obj_set_style_pad_all(self().get(), p, LV_PART_MAIN);
836 lv_obj_set_style_pad_hor(self().get(), p, LV_PART_MAIN);
847 lv_obj_set_style_pad_ver(self().get(), p, LV_PART_MAIN);
858 lv_obj_set_style_pad_gap(self().get(), g, LV_PART_MAIN);
869 lv_obj_set_style_text_color(self().get(), c, LV_PART_MAIN);
880 lv_obj_set_style_text_font(self().get(), f, LV_PART_MAIN);
888 lv_obj_set_style_pad_top(self().get(), p, LV_PART_MAIN);
894 lv_obj_set_style_pad_bottom(self().get(), p, LV_PART_MAIN);
900 lv_obj_set_style_pad_left(self().get(), p, LV_PART_MAIN);
906 lv_obj_set_style_pad_right(self().get(), p, LV_PART_MAIN);
912 lv_obj_set_style_pad_row(self().get(), p, LV_PART_MAIN);
918 lv_obj_set_style_pad_column(self().get(), p, LV_PART_MAIN);
924 Derived &
text_align(uint32_t align, lv_style_selector_t part = LV_PART_MAIN)
926 lv_obj_set_style_text_align(self().get(),
static_cast<lv_text_align_t
>(align),
933 lv_obj_set_style_opa(self().get(), opa, LV_PART_MAIN);
941 lv_obj_set_style_text_color(self().get(), c, part);
947 lv_obj_set_style_border_color(self().get(), c, part);
951 Derived &
arc_color(lv_color_t c, lv_style_selector_t part)
953 lv_obj_set_style_arc_color(self().get(), c, part);
959 lv_obj_set_style_arc_width(self().get(), w, part);
963 Derived &
arc_opa(lv_opa_t opa, lv_style_selector_t part)
965 lv_obj_set_style_arc_opa(self().get(), opa, part);
971 lv_obj_set_style_arc_rounded(self().get(), rounded, part);
977 Derived &
translate_y(int32_t v, lv_style_selector_t part = LV_PART_MAIN)
979 lv_obj_set_style_translate_y(self().get(), v, part);
983 Derived &
margin_top(int32_t v, lv_style_selector_t part = LV_PART_MAIN)
985 lv_obj_set_style_margin_top(self().get(), v, part);
991 lv_obj_set_style_margin_bottom(self().get(), v, part);
995 Derived &
margin_left(int32_t v, lv_style_selector_t part = LV_PART_MAIN)
997 lv_obj_set_style_margin_left(self().get(), v, part);
1003 lv_obj_set_style_margin_right(self().get(), v, part);
1007 Derived &
max_height(int32_t v, lv_style_selector_t part = LV_PART_MAIN)
1009 lv_obj_set_style_max_height(self().get(), v, part);
1013 Derived &
opa_layered(lv_opa_t opa, lv_style_selector_t part = LV_PART_MAIN)
1015 lv_obj_set_style_opa_layered(self().get(), opa, part);
1022 return static_cast<Derived &
>(*this);
1056 lv_style_init(&style_);
1064 lv_style_reset(&style_);
1076 lv_style_init(&other.style_);
1086 if (
this != &other) {
1087 lv_style_reset(&style_);
1088 style_ = other.style_;
1089 lv_style_init(&other.style_);
1119 lv_style_set_bg_color(&style_, c);
1130 lv_style_set_bg_opa(&style_, opa);
1141 lv_style_set_radius(&style_, r);
1152 lv_style_set_border_color(&style_, c);
1163 lv_style_set_border_width(&style_, w);
1174 lv_style_set_pad_all(&style_, p);
1185 lv_style_set_text_color(&style_, c);
1196 lv_style_set_text_font(&style_, f);
1206template <
typename Derived>
1209 lv_obj_add_style(self().get(), style.
get(), selector);
1235template <std::
integral T>
class State
1242 explicit State(T initial = 0)
1244 lv_subject_init_int(&subject_,
static_cast<int32_t
>(initial));
1252 lv_subject_deinit(&subject_);
1255 State(
const State &) =
delete;
1256 State &operator=(
const State &) =
delete;
1264 lv_subject_set_int(&subject_,
static_cast<int32_t
>(val));
1273 return static_cast<T
>(lv_subject_get_int(
const_cast<lv_subject_t *
>(&subject_)));
1309 lv_subject_t *subject()
1315 lv_subject_t subject_;
1471static_assert(
sizeof(Label) ==
sizeof(
void *),
"Label must be pointer-sized");
1571static_assert(
sizeof(Bar) ==
sizeof(
void *),
"Bar must be pointer-sized");
1613static_assert(
sizeof(Box) ==
sizeof(
void *),
"Box must be pointer-sized");
1670static_assert(
sizeof(Button) ==
sizeof(
void *),
"Button must be pointer-sized");
1738static_assert(
sizeof(Slider) ==
sizeof(
void *),
"Slider must be pointer-sized");
1781static_assert(
sizeof(Switch) ==
sizeof(
void *),
"Switch must be pointer-sized");
1838static_assert(
sizeof(Checkbox) ==
sizeof(
void *),
"Checkbox must be pointer-sized");
1936static_assert(
sizeof(Arc) ==
sizeof(
void *),
"Arc must be pointer-sized");
1999static_assert(
sizeof(Image) ==
sizeof(
void *),
"Image must be pointer-sized");
2082static_assert(
sizeof(Msgbox) ==
sizeof(
void *),
"Msgbox must be pointer-sized");
2120static_assert(
sizeof(Spinner) ==
sizeof(
void *),
"Spinner must be pointer-sized");
2185static_assert(
sizeof(Led) ==
sizeof(
void *),
"Led must be pointer-sized");
2314static_assert(
sizeof(Textarea) ==
sizeof(
void *),
"Textarea must be pointer-sized");
2432static_assert(
sizeof(Dropdown) ==
sizeof(
void *),
"Dropdown must be pointer-sized");
2505static_assert(
sizeof(Roller) ==
sizeof(
void *),
"Roller must be pointer-sized");
2605static_assert(
sizeof(Spinbox) ==
sizeof(
void *),
"Spinbox must be pointer-sized");
2660static_assert(
sizeof(Keyboard) ==
sizeof(
void *),
"Keyboard must be pointer-sized");
2683 Series() : chart_(
nullptr), ser_(
nullptr)
2699 return ser_ !=
nullptr;
2782static_assert(
sizeof(Chart) ==
sizeof(
void *),
"Chart must be pointer-sized");
2861static_assert(
sizeof(Table) ==
sizeof(
void *),
"Table must be pointer-sized");
2944static_assert(
sizeof(Tabview) ==
sizeof(
void *),
"Tabview must be pointer-sized");
2989static_assert(
sizeof(List) ==
sizeof(
void *),
"List must be pointer-sized");
3063static_assert(
sizeof(Canvas) ==
sizeof(
void *),
"Canvas must be pointer-sized");
3132static_assert(
sizeof(Calendar) ==
sizeof(
void *),
"Calendar must be pointer-sized");
3151 lv_obj_set_flex_flow(b.get(), LV_FLEX_FLOW_COLUMN);
3152 lv_obj_set_size(b.get(), LV_SIZE_CONTENT, LV_SIZE_CONTENT);
3164 lv_obj_set_flex_flow(b.get(), LV_FLEX_FLOW_ROW);
3165 lv_obj_set_size(b.get(), LV_SIZE_CONTENT, LV_SIZE_CONTENT);
3188 Group() : group_(
nullptr)
3192 explicit Group(lv_group_t *g) : group_(g)
3199 lv_group_delete(group_);
3202 Group(
const Group &) =
delete;
3203 Group &operator=(
const Group &) =
delete;
3208 other.group_ =
nullptr;
3214 if (
this != &other) {
3216 lv_group_delete(group_);
3217 group_ = other.group_;
3218 other.group_ =
nullptr;
3226 return Group(lv_group_create());
3232 return lv_group_get_default();
3245 lv_group_set_default(group_);
3252 lv_group_add_obj(group_, obj);
3259 lv_group_remove_all_objs(group_);
3266 lv_group_focus_next(group_);
3273 lv_group_focus_prev(group_);
3280 lv_group_focus_freeze(group_, freeze);
3287 return ObjectView(lv_group_get_focused(group_));
3293 lv_group_set_editing(group_, enable);
3300 return lv_group_get_editing(group_);
3306 return lv_group_get_obj_count(group_);
3313 lv_group_focus_obj(obj);
3319 lv_group_remove_obj(obj);
3388static_assert(
sizeof(Screen) ==
sizeof(
void *),
"Screen must be pointer-sized");
3428 Timer(lv_timer_cb_t cb, uint32_t period_ms,
void *user_data =
nullptr)
3429 : timer_(lv_timer_create(cb, period_ms, user_data))
3436 lv_timer_delete(timer_);
3445 other.timer_ =
nullptr;
3451 if (
this != &other) {
3453 lv_timer_delete(timer_);
3454 timer_ = other.timer_;
3455 other.timer_ =
nullptr;
3467 explicit operator bool()
const
3469 return timer_ !=
nullptr;
3476 lv_timer_set_period(timer_, ms);
3484 lv_timer_pause(timer_);
3492 lv_timer_resume(timer_);
3503 lv_timer_set_repeat_count(timer_, count);
3511 lv_timer_reset(timer_);
3519 lv_timer_ready(timer_);
3551 lv_anim_init(&anim_);
3557 lv_anim_set_var(&anim_, var);
3570 lv_anim_set_values(&anim_, from, to);
3577 lv_anim_set_duration(&anim_, ms);
3584 lv_anim_set_delay(&anim_, ms);
3591 lv_anim_set_path_cb(&anim_, cb);
3598 lv_anim_set_repeat_count(&anim_, count);
3605 lv_anim_set_repeat_delay(&anim_, ms);
3612 lv_anim_set_playback_duration(&anim_, ms);
3619 lv_anim_set_playback_delay(&anim_, ms);
3629 lv_anim_set_exec_cb(&anim_, cb);
3636 lv_anim_set_ready_cb(&anim_, cb);
3646 lv_anim_start(&anim_);
3652 return lv_anim_delete(var,
exec_cb);
3658 return lv_anim_speed(speed);
3670 .
values(lv_obj_get_x(obj), to)
3672 .
path(lv_anim_path_ease_out)
3673 .
exec_cb(
reinterpret_cast<lv_anim_exec_xcb_t
>(lv_obj_set_x))
3682 .
values(lv_obj_get_y(obj), to)
3684 .
path(lv_anim_path_ease_out)
3685 .
exec_cb(
reinterpret_cast<lv_anim_exec_xcb_t
>(lv_obj_set_y))
3694 .
values(lv_obj_get_width(obj), to)
3696 .
path(lv_anim_path_ease_out)
3697 .
exec_cb(
reinterpret_cast<lv_anim_exec_xcb_t
>(lv_obj_set_width))
3703inline void anim_set_opa_shim(
void *var, int32_t v)
3705 lv_obj_set_style_opa(
static_cast<lv_obj_t *
>(var),
static_cast<lv_opa_t
>(v), LV_PART_MAIN);
3712 lv_opa_t from = lv_obj_get_style_opa(obj, LV_PART_MAIN);
3717 .
path(lv_anim_path_ease_in_out)
3718 .
exec_cb(detail::anim_set_opa_shim)
3771 root_ =
static_cast<Derived *
>(
this)->build(parent);
3773 lv_obj_set_user_data(
root_.
get(),
this);
3775 lv_obj_add_event_cb(
root_.
get(), delete_cb, LV_EVENT_DELETE,
this);
3802 return static_cast<bool>(
root_);
3820 lv_obj_add_flag(
root_.
get(), LV_OBJ_FLAG_HIDDEN);
3829 lv_obj_remove_flag(
root_.
get(), LV_OBJ_FLAG_HIDDEN);
3844 lv_obj_t *target =
static_cast<lv_obj_t *
>(lv_event_get_target(e));
3846 void *ud = lv_obj_get_user_data(target);
3848 return static_cast<Derived *
>(
static_cast<Component *
>(ud));
3849 target = lv_obj_get_parent(target);
3864 static void delete_cb(lv_event_t *e)
3866 auto *self =
static_cast<Component *
>(lv_event_get_user_data(e));
3879 return lv_display_get_horizontal_resolution(
nullptr);
3885 return lv_display_get_vertical_resolution(
nullptr);
3891 return lv_display_get_dpi(
nullptr);
RAII wrapper around an oveRTOS software timer.
Definition timer.hpp:49
Fluent builder for LVGL animations (lv_anim_t).
Definition lvgl.hpp:3547
Animation & target(ObjectView obj)
Sets the target as an LVGL object.
Definition lvgl.hpp:3562
Animation & playback_duration(uint32_t ms)
Sets the duration of the playback (reverse) phase.
Definition lvgl.hpp:3610
Animation & exec_cb(lv_anim_exec_xcb_t cb)
Sets the exec callback invoked on every frame.
Definition lvgl.hpp:3627
Animation & path(lv_anim_path_cb_t cb)
Sets the easing curve. Use lv_anim_path_linear, _ease_out, etc.
Definition lvgl.hpp:3589
Animation & values(int32_t from, int32_t to)
Sets the start and end values.
Definition lvgl.hpp:3568
Animation & repeat_delay(uint32_t ms)
Sets the delay between repeats.
Definition lvgl.hpp:3603
Animation & playback_delay(uint32_t ms)
Sets the delay before the playback phase.
Definition lvgl.hpp:3617
Animation & duration(uint32_t ms)
Sets the animation duration in milliseconds.
Definition lvgl.hpp:3575
Animation & target(void *var)
Sets the target variable pointer (typically an lv_obj_t *).
Definition lvgl.hpp:3555
Animation & repeat_count(uint32_t count)
Sets the repeat count; use LV_ANIM_REPEAT_INFINITE for endless.
Definition lvgl.hpp:3596
static uint32_t duration_for_speed(uint32_t speed)
Computes the duration (ms) needed to animate at the given speed.
Definition lvgl.hpp:3656
void start()
Starts the animation. LVGL copies the state into its internal list, so this Animation can be destruct...
Definition lvgl.hpp:3644
Animation & ready_cb(lv_anim_ready_cb_t cb)
Sets the ready callback invoked when the animation finishes.
Definition lvgl.hpp:3634
static bool stop(void *var, lv_anim_exec_xcb_t exec_cb)
Stops any animations matching (var, exec_cb).
Definition lvgl.hpp:3650
Animation & delay(uint32_t ms)
Sets the delay before the animation starts, in milliseconds.
Definition lvgl.hpp:3582
C++ wrapper for an LVGL arc widget (circular slider / gauge).
Definition lvgl.hpp:1853
Arc & range(int32_t min, int32_t max)
Sets the min/max range.
Definition lvgl.hpp:1874
Arc & track_color(lv_color_t c)
Sets the track arc colour (LV_PART_MAIN).
Definition lvgl.hpp:1908
Arc(lv_obj_t *obj)
Wraps an existing LVGL arc object (non-owning).
Definition lvgl.hpp:1856
Arc & indicator_color(lv_color_t c)
Sets the indicator arc colour (LV_PART_INDICATOR).
Definition lvgl.hpp:1915
int32_t get_value() const
Returns the current value.
Definition lvgl.hpp:1902
Arc & indicator_width(int32_t w)
Sets the indicator arc width (LV_PART_INDICATOR).
Definition lvgl.hpp:1922
static Arc create(ObjectView parent)
Creates a new arc as a child of parent.
Definition lvgl.hpp:1861
Arc & bg_angles(uint32_t start, uint32_t end)
Sets the background arc start/end angles in degrees.
Definition lvgl.hpp:1881
Arc & rotation(uint32_t rot)
Sets the rotation offset of the arc in degrees.
Definition lvgl.hpp:1895
Arc & angles(uint32_t start, uint32_t end)
Sets the foreground indicator start/end angles in degrees.
Definition lvgl.hpp:1888
Arc & value(int32_t val)
Sets the current value.
Definition lvgl.hpp:1867
Arc & knob_color(lv_color_t c)
Sets the knob colour (LV_PART_KNOB).
Definition lvgl.hpp:1929
C++ wrapper for an LVGL progress-bar widget.
Definition lvgl.hpp:1491
static Bar create(ObjectView parent)
Factory method — creates a new LVGL bar as a child of parent.
Definition lvgl.hpp:1506
Bar & range(int32_t min, int32_t max)
Sets the minimum and maximum values for the bar.
Definition lvgl.hpp:1540
Bar & indicator_color(lv_color_t c)
Sets the background color of the indicator (filled) part.
Definition lvgl.hpp:1551
Bar & bar_color(lv_color_t c)
Sets the background color of the bar track (unfilled) part.
Definition lvgl.hpp:1562
Bar & value(int32_t val)
Sets the current value of the bar with animation enabled.
Definition lvgl.hpp:1516
Bar(lv_obj_t *obj)
Constructs a Bar wrapping an existing LVGL bar object.
Definition lvgl.hpp:1497
Bar & value(int32_t val, lv_anim_enable_t anim)
Sets the current value of the bar with explicit animation control.
Definition lvgl.hpp:1528
C++ wrapper for a generic LVGL container object with scrolling disabled.
Definition lvgl.hpp:1590
static Box create(ObjectView parent)
Factory method — creates a new LVGL container with scrolling disabled.
Definition lvgl.hpp:1605
Box(lv_obj_t *obj)
Constructs a Box wrapping an existing LVGL object.
Definition lvgl.hpp:1596
C++ wrapper for LVGL's month-grid date picker.
Definition lvgl.hpp:3078
Calendar & today(uint32_t year, uint32_t month, uint32_t day)
Sets today's date (highlighted in the grid).
Definition lvgl.hpp:3092
ObjectView add_header_dropdown()
Adds a dropdown-header navigation bar as a child.
Definition lvgl.hpp:3126
bool get_pressed_date(lv_calendar_date_t *out) const
Returns the last date the user pressed in the grid.
Definition lvgl.hpp:3114
static Calendar create(ObjectView parent)
Creates a new calendar as a child of parent.
Definition lvgl.hpp:3086
ObjectView add_header_arrow()
Adds an arrow-header navigation bar as a child.
Definition lvgl.hpp:3120
Calendar & showed(uint32_t year, uint32_t month)
Sets the currently visible month (year/month).
Definition lvgl.hpp:3099
Calendar & highlighted_dates(lv_calendar_date_t *dates, size_t count)
Highlights a list of dates with a visual accent. LVGL retains the pointer — the array must outlive th...
Definition lvgl.hpp:3107
Calendar(lv_obj_t *obj)
Wraps an existing LVGL calendar object (non-owning).
Definition lvgl.hpp:3081
C++ wrapper for LVGL's user-buffer drawing surface.
Definition lvgl.hpp:3008
Canvas & buffer(void *buf, int32_t w, int32_t h, lv_color_format_t cf)
Attaches a pixel buffer of the given geometry and format.
Definition lvgl.hpp:3022
Canvas & init_layer(lv_layer_t *layer)
Begins a draw sequence on the canvas layer.
Definition lvgl.hpp:3049
Canvas & set_pixel(int32_t x, int32_t y, lv_color_t color)
Sets a single pixel to the given colour.
Definition lvgl.hpp:3036
Canvas(lv_obj_t *obj)
Wraps an existing LVGL canvas object (non-owning).
Definition lvgl.hpp:3011
static Canvas create(ObjectView parent)
Creates a new canvas as a child of parent.
Definition lvgl.hpp:3016
Canvas & finish_layer(lv_layer_t *layer)
Finishes a draw sequence started by init_layer().
Definition lvgl.hpp:3056
Canvas & fill_bg(lv_color_t color, lv_opa_t opa)
Fills the entire canvas with a solid color + opacity.
Definition lvgl.hpp:3029
Lightweight handle to an lv_chart_series_t *.
Definition lvgl.hpp:2681
lv_chart_series_t * get() const
Returns the underlying lv_chart_series_t *.
Definition lvgl.hpp:2692
Series(lv_obj_t *chart, lv_chart_series_t *ser)
Binds the handle to an existing chart + series pointer pair.
Definition lvgl.hpp:2687
Series & next_value(int32_t v)
Pushes a new value using the current update mode.
Definition lvgl.hpp:2703
Series & set_value_by_idx(uint32_t idx, int32_t v)
Sets a specific point index to v.
Definition lvgl.hpp:2710
C++ wrapper for an LVGL chart (line / bar / scatter).
Definition lvgl.hpp:2677
Chart(lv_obj_t *obj)
Wraps an existing LVGL chart object (non-owning).
Definition lvgl.hpp:2722
Chart & remove_series(Series s)
Removes a series from the chart.
Definition lvgl.hpp:2775
Chart & update_mode(lv_chart_update_mode_t mode)
Sets how next_value() updates the point array.
Definition lvgl.hpp:2754
Chart & range(lv_chart_axis_t axis, int32_t min, int32_t max)
Sets the min/max range for the given axis.
Definition lvgl.hpp:2747
static Chart create(ObjectView parent)
Creates a new chart as a child of parent.
Definition lvgl.hpp:2727
Series add_series(lv_color_t color, lv_chart_axis_t axis)
Adds a new series with the given colour and axis binding.
Definition lvgl.hpp:2768
Chart & point_count(uint32_t count)
Sets the number of data points per series.
Definition lvgl.hpp:2740
Chart & type(lv_chart_type_t t)
Sets the chart type (line / bar / scatter / none).
Definition lvgl.hpp:2733
Chart & div_line_count(uint8_t hdiv, uint8_t vdiv)
Sets the horizontal/vertical division line count.
Definition lvgl.hpp:2761
C++ wrapper for an LVGL checkbox (labelled binary toggle).
Definition lvgl.hpp:1794
Checkbox & text(const char *txt)
Sets the label text (copies into LVGL-owned memory).
Definition lvgl.hpp:1808
Checkbox & text_static(const char *txt)
Sets the label text from a persistent static string (no copy).
Definition lvgl.hpp:1815
bool is_checked() const
Returns true if the checkbox is ticked.
Definition lvgl.hpp:1832
Checkbox(lv_obj_t *obj)
Wraps an existing LVGL checkbox object (non-owning).
Definition lvgl.hpp:1797
static Checkbox create(ObjectView parent)
Creates a new checkbox as a child of parent.
Definition lvgl.hpp:1802
Checkbox & checked(bool v)
Sets the checked state.
Definition lvgl.hpp:1822
CRTP base class for reusable, self-contained LVGL UI components.
Definition lvgl.hpp:3748
bool is_mounted() const
Returns true if the component is currently mounted.
Definition lvgl.hpp:3800
void mount(ObjectView parent)
Builds and mounts the component under the given parent.
Definition lvgl.hpp:3767
Component()=default
Default constructor — component starts in the unmounted state.
void show()
Shows the component's root widget if mounted.
Definition lvgl.hpp:3826
ObjectView root_
Non-owning view of the component's root LVGL widget.
Definition lvgl.hpp:3856
void unmount()
Unmounts and deletes the component's widget subtree.
Definition lvgl.hpp:3785
static Derived * from_event(lv_event_t *e)
Walks up the LVGL object tree from the event target to find the Derived component instance.
Definition lvgl.hpp:3842
void hide()
Hides the component's root widget if mounted.
Definition lvgl.hpp:3817
ObjectView root() const
Returns an ObjectView of the component's root widget.
Definition lvgl.hpp:3809
C++ wrapper for an LVGL click-to-open dropdown list.
Definition lvgl.hpp:2327
Dropdown & selected(uint32_t sel)
Sets the currently selected option index.
Definition lvgl.hpp:2369
Dropdown & options_static(const char *opts)
Sets options from a persistent \n-separated string (no copy).
Definition lvgl.hpp:2348
void open()
Expands the popup list.
Definition lvgl.hpp:2420
Dropdown & add_option(const char *opt, uint32_t pos)
Inserts a single option at pos.
Definition lvgl.hpp:2355
Dropdown(lv_obj_t *obj)
Wraps an existing LVGL dropdown object (non-owning).
Definition lvgl.hpp:2330
void get_selected_str(char *buf, uint32_t size) const
Fills buf with the currently selected option text.
Definition lvgl.hpp:2402
Dropdown & dir(lv_dir_t d)
Sets the popup direction.
Definition lvgl.hpp:2376
const char * get_options() const
Returns the entire option list as a \n-separated string.
Definition lvgl.hpp:2408
bool is_open() const
Returns true if the popup list is currently expanded.
Definition lvgl.hpp:2414
void close()
Collapses the popup list.
Definition lvgl.hpp:2426
Dropdown & options(const char *opts)
Sets options from a \n-separated string (LVGL copies it).
Definition lvgl.hpp:2341
uint32_t get_selected() const
Returns the currently selected option index.
Definition lvgl.hpp:2390
uint32_t get_option_count() const
Returns the total option count.
Definition lvgl.hpp:2396
Dropdown & clear_options()
Clears the entire option list.
Definition lvgl.hpp:2362
Dropdown & symbol(const void *sym)
Sets the dropdown-arrow icon (image dsc or symbol string).
Definition lvgl.hpp:2383
static Dropdown create(ObjectView parent)
Creates a new dropdown as a child of parent.
Definition lvgl.hpp:2335
CRTP mixin that adds type-safe LVGL event registration to widget classes.
Definition lvgl.hpp:616
Derived & on_click(F &&fn)
Registers a stateless click callback (shorthand for on(LV_EVENT_CLICKED, fn)).
Definition lvgl.hpp:666
Derived & on_value_changed(F &&fn)
Registers a stateless value-changed callback (shorthand for on(LV_EVENT_VALUE_CHANGED,...
Definition lvgl.hpp:689
Derived & on_click(T *instance)
Registers a member function click callback.
Definition lvgl.hpp:678
Derived & on(lv_event_code_t code, F &&fn)
Registers a stateless callback for the given event code.
Definition lvgl.hpp:629
Derived & on_value_changed(T *instance)
Registers a member function value-changed callback.
Definition lvgl.hpp:701
Derived & on(lv_event_code_t code, T *instance)
Registers a member function pointer as an event callback — minimal-overhead trampoline.
Definition lvgl.hpp:648
RAII wrapper for an LVGL input focus group (lv_group_t).
Definition lvgl.hpp:3186
static Group create()
Creates a fresh focus group.
Definition lvgl.hpp:3224
Group & operator=(Group &&other) noexcept
Move-assignment — releases current group, then takes other's.
Definition lvgl.hpp:3212
ObjectView focused() const
Returns the currently focused widget, or a null view.
Definition lvgl.hpp:3285
Group & remove_all()
Removes all widgets from this group.
Definition lvgl.hpp:3257
Group & edit_mode(bool enable)
Enables/disables edit mode (relevant for encoder input).
Definition lvgl.hpp:3291
Group & set_as_default()
Marks this group as the default — new focusable widgets will auto-join it at creation time.
Definition lvgl.hpp:3243
static lv_group_t * get_default()
Returns the default group (set via set_as_default()).
Definition lvgl.hpp:3230
bool is_editing() const
Returns the current edit-mode flag.
Definition lvgl.hpp:3298
Group & focus_freeze(bool freeze)
Freezes/unfreezes focus movement.
Definition lvgl.hpp:3278
Group & add(ObjectView obj)
Adds a widget to the group's focusable list.
Definition lvgl.hpp:3250
lv_group_t * get() const
Raw lv_group_t * for FFI interop.
Definition lvgl.hpp:3236
Group(Group &&other) noexcept
Move constructor — transfers ownership; source becomes empty.
Definition lvgl.hpp:3206
static void focus_obj(ObjectView obj)
Static helper: focus a specific widget regardless of its group membership.
Definition lvgl.hpp:3311
Group & focus_next()
Moves focus to the next member.
Definition lvgl.hpp:3264
uint32_t obj_count() const
Returns the number of widgets in the group.
Definition lvgl.hpp:3304
Group(lv_group_t *g)
Takes ownership of an existing lv_group_t *.
Definition lvgl.hpp:3192
Group & focus_prev()
Moves focus to the previous member.
Definition lvgl.hpp:3271
static void remove_obj(ObjectView obj)
Static helper: remove a widget from whatever group it's in.
Definition lvgl.hpp:3317
C++ wrapper for an LVGL image widget.
Definition lvgl.hpp:1950
Image & inner_align(lv_image_align_t align)
Sets how the image is aligned within its own coordinates.
Definition lvgl.hpp:1992
Image(lv_obj_t *obj)
Wraps an existing LVGL image object (non-owning).
Definition lvgl.hpp:1953
static Image create(ObjectView parent)
Creates a new image as a child of parent.
Definition lvgl.hpp:1958
Image & scale(uint32_t zoom)
Sets the zoom factor (256 = 1.0x, 512 = 2.0x).
Definition lvgl.hpp:1978
Image & pivot(int32_t x, int32_t y)
Sets the rotation/scale pivot point.
Definition lvgl.hpp:1985
Image & rotation(int32_t angle)
Sets the rotation angle in 0.1 degree units (0–3600).
Definition lvgl.hpp:1971
Image & src(const void *src)
Sets the image source (descriptor, symbol, or path).
Definition lvgl.hpp:1964
C++ wrapper for LVGL's on-screen keyboard.
Definition lvgl.hpp:2619
Keyboard & attach(Textarea ta)
Attaches to a Textarea so typed keys flow to it.
Definition lvgl.hpp:2633
Keyboard & mode(lv_keyboard_mode_t m)
Switches keyboard mode (lowercase/upper/special/number).
Definition lvgl.hpp:2640
ObjectView get_textarea() const
Returns the currently attached Textarea, or a null view.
Definition lvgl.hpp:2654
Keyboard(lv_obj_t *obj)
Wraps an existing LVGL keyboard object (non-owning).
Definition lvgl.hpp:2622
Keyboard & popovers(bool en)
Enables or disables on-press popovers for letter keys.
Definition lvgl.hpp:2647
static Keyboard create(ObjectView parent)
Creates a new keyboard as a child of parent.
Definition lvgl.hpp:2627
C++ wrapper for an LVGL label widget.
Definition lvgl.hpp:1348
Label & font(const lv_font_t *f)
Sets the font used to render the label text.
Definition lvgl.hpp:1421
Label & color(lv_color_t c)
Sets the text color.
Definition lvgl.hpp:1432
Label & text(const char *txt)
Sets the label text by copying the string (LVGL allocates internally).
Definition lvgl.hpp:1373
Label & long_mode(lv_label_long_mode_t mode)
Sets the long-text mode (wrap, scroll, clip, etc.).
Definition lvgl.hpp:1443
Label(lv_obj_t *obj)
Constructs a Label wrapping an existing LVGL label object.
Definition lvgl.hpp:1354
Label & text_fmt(const char *fmt,...)
Sets the label text using a printf-style format string.
Definition lvgl.hpp:1404
static Label create(ObjectView parent)
Factory method — creates a new LVGL label as a child of parent.
Definition lvgl.hpp:1363
Label & text_static(const char *txt)
Sets the label text to a static string (no copy — pointer must remain valid).
Definition lvgl.hpp:1388
C++ wrapper for LVGL's LED widget — a colored indicator circle.
Definition lvgl.hpp:2130
uint8_t get_brightness() const
Returns the current brightness.
Definition lvgl.hpp:2179
Led & brightness(uint8_t bright)
Sets the LED brightness (0–255).
Definition lvgl.hpp:2151
Led(lv_obj_t *obj)
Wraps an existing LVGL LED object (non-owning).
Definition lvgl.hpp:2133
Led & on()
Turns the LED on (full brightness).
Definition lvgl.hpp:2158
Led & color(lv_color_t c)
Sets the LED base colour.
Definition lvgl.hpp:2144
Led & toggle()
Toggles between on/off.
Definition lvgl.hpp:2172
Led & off()
Turns the LED off.
Definition lvgl.hpp:2165
static Led create(ObjectView parent)
Creates a new LED as a child of parent.
Definition lvgl.hpp:2138
C++ wrapper for LVGL's scrollable list of buttons/text.
Definition lvgl.hpp:2957
const char * get_button_text(ObjectView btn) const
Returns the text of a list button.
Definition lvgl.hpp:2983
ObjectView add_text(const char *text)
Adds a text heading row. Returns the label object.
Definition lvgl.hpp:2971
static List create(ObjectView parent)
Creates a new list as a child of parent.
Definition lvgl.hpp:2965
ObjectView add_button(const void *icon, const char *text)
Adds a button row with icon and text. Returns the button.
Definition lvgl.hpp:2977
List(lv_obj_t *obj)
Wraps an existing LVGL list object (non-owning).
Definition lvgl.hpp:2960
RAII scoped lock for thread-safe access to the LVGL rendering context.
Definition lvgl.hpp:92
LvglGuard()
Acquires the LVGL lock, blocking until it is available.
Definition lvgl.hpp:97
~LvglGuard() noexcept
Releases the LVGL lock.
Definition lvgl.hpp:105
C++ wrapper for an LVGL message-box (modal dialog).
Definition lvgl.hpp:2014
ObjectView get_header() const
Returns the header container.
Definition lvgl.hpp:2064
void close()
Closes and deletes the msgbox.
Definition lvgl.hpp:2076
ObjectView get_footer() const
Returns the footer container.
Definition lvgl.hpp:2070
Msgbox & add_text(const char *txt)
Adds body text. Chainable — returns *this.
Definition lvgl.hpp:2036
ObjectView get_content() const
Returns the content container (where body widgets live).
Definition lvgl.hpp:2058
Msgbox(lv_obj_t *obj)
Wraps an existing LVGL msgbox object (non-owning).
Definition lvgl.hpp:2017
ObjectView add_footer_button(const char *txt)
Adds a footer button with the given text. Returns an ObjectView wrapping the created button so caller...
Definition lvgl.hpp:2052
Msgbox & add_close_button()
Adds a close (X) button in the header.
Definition lvgl.hpp:2043
static Msgbox create(ObjectView parent)
Creates a new modal msgbox. Passing a null parent centers it on the active screen.
Definition lvgl.hpp:2023
Msgbox & add_title(const char *txt)
Adds a title in the header. Chainable — returns *this.
Definition lvgl.hpp:2029
CRTP mixin that adds fluent layout and visibility setters to widget classes.
Definition lvgl.hpp:281
Derived & hide()
Hides the object by adding LV_OBJ_FLAG_HIDDEN.
Definition lvgl.hpp:356
Derived & user_data(void *data)
Stores an arbitrary user data pointer on the LVGL object.
Definition lvgl.hpp:431
Derived & show()
Shows the object by removing LV_OBJ_FLAG_HIDDEN.
Definition lvgl.hpp:366
Derived & height(int32_t h)
Sets the height of the object.
Definition lvgl.hpp:311
Derived & clickable(bool on)
Enables or disables click events on the object.
Definition lvgl.hpp:442
Derived & width(int32_t w)
Sets the width of the object.
Definition lvgl.hpp:300
Derived & size(int32_t w, int32_t h)
Sets both width and height of the object.
Definition lvgl.hpp:289
int32_t get_content_width() const
Definition lvgl.hpp:523
Derived & remove_style_all()
Definition lvgl.hpp:537
Derived & align(lv_align_t a, int32_t x_ofs=0, int32_t y_ofs=0)
Aligns the object to an anchor with an optional offset.
Definition lvgl.hpp:346
Derived & add_state(lv_state_t s)
Adds one or more object states.
Definition lvgl.hpp:409
Derived & visible(bool v)
Conditionally shows or hides the object.
Definition lvgl.hpp:377
Derived & flex_grow(uint8_t grow)
Set this child's flex grow factor (0 disables growing).
Definition lvgl.hpp:489
Derived & scroll_to_y(int32_t y, bool anim)
Scroll the object so y is visible. anim enables animated scrolling.
Definition lvgl.hpp:507
Derived & pos(int32_t x, int32_t y)
Sets the position of the object relative to its parent.
Definition lvgl.hpp:323
Derived & flex_align(lv_flex_align_t main, lv_flex_align_t cross, lv_flex_align_t track)
Set flex alignment for main axis, cross axis (items), and cross axis (tracks).
Definition lvgl.hpp:480
Derived & grid_cell(lv_grid_align_t col_align, int32_t col_pos, int32_t col_span, lv_grid_align_t row_align, int32_t row_pos, int32_t row_span)
Places this object into a cell of its parent grid.
Definition lvgl.hpp:553
Derived & center()
Centers the object within its parent.
Definition lvgl.hpp:333
Derived & remove_flag(lv_obj_flag_t f)
Removes one or more object flags.
Definition lvgl.hpp:398
int32_t get_scroll_bottom() const
Definition lvgl.hpp:530
Derived & update_layout()
Force a layout recomputation (needed before get_content_width/get_scroll_bottom).
Definition lvgl.hpp:516
Derived & add_flag(lv_obj_flag_t f)
Adds one or more object flags.
Definition lvgl.hpp:387
Derived & remove_state(lv_state_t s)
Removes one or more object states.
Definition lvgl.hpp:420
Derived & grid_dsc(const int32_t *cols, const int32_t *rows)
Configures this object as a grid container.
Definition lvgl.hpp:462
Derived & flex_flow(lv_flex_flow_t flow)
Configure this object as a flex container with the given flow.
Definition lvgl.hpp:471
Derived & layout(uint32_t kind)
Switch the object's layout engine (None / Flex / Grid).
Definition lvgl.hpp:498
Non-owning, pointer-sized wrapper around an lv_obj_t*.
Definition lvgl.hpp:135
ObjectView(lv_obj_t *obj)
Constructs an ObjectView wrapping the given lv_obj_t*.
Definition lvgl.hpp:148
uint32_t child_count() const
Returns the number of direct children of this object.
Definition lvgl.hpp:192
void clean()
Deletes all children of this object without deleting the object itself.
Definition lvgl.hpp:239
static ObjectView screen_active()
Returns an ObjectView wrapping the currently active screen.
Definition lvgl.hpp:248
int32_t get_width() const
Returns the current rendered width of this object.
Definition lvgl.hpp:211
int32_t get_height() const
Returns the current rendered height of this object.
Definition lvgl.hpp:220
ObjectView get_child(int32_t idx) const
Returns an ObjectView wrapping the child at the given index.
Definition lvgl.hpp:202
lv_obj_t * get() const
Returns the raw lv_obj_t* pointer.
Definition lvgl.hpp:156
ObjectView()
Constructs a null ObjectView (no associated LVGL object).
Definition lvgl.hpp:140
lv_obj_t * obj_
Raw pointer to the wrapped LVGL object.
Definition lvgl.hpp:255
void del()
Deletes the LVGL object and all its children, then nulls the pointer.
Definition lvgl.hpp:230
ObjectView parent() const
Returns an ObjectView wrapping the parent of this object.
Definition lvgl.hpp:183
C++ wrapper for LVGL's iOS-picker-style scrollable option wheel.
Definition lvgl.hpp:2446
Roller & options(const char *opts, lv_roller_mode_t mode=LV_ROLLER_MODE_NORMAL)
Sets options (newline-separated) and scroll mode.
Definition lvgl.hpp:2460
Roller & selected(uint32_t sel, lv_anim_enable_t anim=LV_ANIM_OFF)
Sets the currently selected option index.
Definition lvgl.hpp:2467
const char * get_options() const
Returns the entire option list as a \n-separated string.
Definition lvgl.hpp:2499
static Roller create(ObjectView parent)
Creates a new roller as a child of parent.
Definition lvgl.hpp:2454
void get_selected_str(char *buf, uint32_t size) const
Fills buf with the currently selected option text.
Definition lvgl.hpp:2493
Roller & visible_row_count(uint32_t rows)
Sets how many rows are visible in the wheel at once.
Definition lvgl.hpp:2474
Roller(lv_obj_t *obj)
Wraps an existing LVGL roller object (non-owning).
Definition lvgl.hpp:2449
uint32_t get_option_count() const
Returns the total option count.
Definition lvgl.hpp:2487
uint32_t get_selected() const
Returns the currently selected option index.
Definition lvgl.hpp:2481
Top-level LVGL screen — a display root without a parent.
Definition lvgl.hpp:3347
Screen(lv_obj_t *obj)
Wraps an existing LVGL screen object (non-owning).
Definition lvgl.hpp:3350
void load_anim(lv_screen_load_anim_t anim, uint32_t time_ms, uint32_t delay_ms=0, bool auto_del=false)
Loads this screen with an animated transition.
Definition lvgl.hpp:3381
static Screen create()
Creates a new top-level screen with no parent.
Definition lvgl.hpp:3355
static Screen active()
Returns the currently active screen.
Definition lvgl.hpp:3361
void load()
Instantly loads this screen as the active one.
Definition lvgl.hpp:3367
C++ wrapper for an LVGL slider widget (interactive bar).
Definition lvgl.hpp:1683
int32_t get_value() const
Returns the current value.
Definition lvgl.hpp:1718
Slider & value(int32_t val, lv_anim_enable_t anim)
Sets the current value with explicit animation control.
Definition lvgl.hpp:1704
static Slider create(ObjectView parent)
Creates a new slider as a child of parent.
Definition lvgl.hpp:1691
Slider & indicator_color(lv_color_t c)
Sets the filled indicator colour (LV_PART_INDICATOR).
Definition lvgl.hpp:1724
Slider & knob_color(lv_color_t c)
Sets the knob colour (LV_PART_KNOB).
Definition lvgl.hpp:1731
Slider(lv_obj_t *obj)
Wraps an existing LVGL slider object (non-owning).
Definition lvgl.hpp:1686
Slider & value(int32_t val)
Sets the current value (animated).
Definition lvgl.hpp:1697
Slider & range(int32_t min, int32_t max)
Sets the min/max range.
Definition lvgl.hpp:1711
C++ wrapper for an LVGL numeric stepper (+ / − buttons).
Definition lvgl.hpp:2519
Spinbox & step(uint32_t s)
Sets the increment/decrement step size.
Definition lvgl.hpp:2547
Spinbox & cursor_pos(uint32_t pos)
Sets the cursor to edit a specific digit.
Definition lvgl.hpp:2572
Spinbox & digit_format(uint32_t digit_count, uint32_t sep_pos)
Configures how the numeric value is displayed.
Definition lvgl.hpp:2558
int32_t get_step() const
Returns the current step size.
Definition lvgl.hpp:2585
Spinbox & increment()
Increments the value by one step.
Definition lvgl.hpp:2591
Spinbox & decrement()
Decrements the value by one step.
Definition lvgl.hpp:2598
Spinbox(lv_obj_t *obj)
Wraps an existing LVGL spinbox object (non-owning).
Definition lvgl.hpp:2522
Spinbox & value(int32_t v)
Sets the current integer value (scaled by digit_format).
Definition lvgl.hpp:2533
Spinbox & range(int32_t min, int32_t max)
Sets min/max bounds.
Definition lvgl.hpp:2540
Spinbox & rollover(bool on)
Enables wrap-around at min/max bounds.
Definition lvgl.hpp:2565
static Spinbox create(ObjectView parent)
Creates a new spinbox as a child of parent.
Definition lvgl.hpp:2527
int32_t get_value() const
Returns the current integer value.
Definition lvgl.hpp:2579
C++ wrapper for LVGL's circular loading indicator.
Definition lvgl.hpp:2095
Spinner(lv_obj_t *obj)
Wraps an existing LVGL spinner object (non-owning).
Definition lvgl.hpp:2098
Spinner & anim_params(uint32_t time_ms, uint32_t angle_deg)
Sets the animation parameters.
Definition lvgl.hpp:2113
static Spinner create(ObjectView parent)
Creates a new spinner as a child of parent.
Definition lvgl.hpp:2103
CRTP mixin that adds inline per-object style setters to widget classes.
Definition lvgl.hpp:730
Derived & pad_right(int32_t p)
Sets right padding in pixels.
Definition lvgl.hpp:904
Derived & radius(int32_t r)
Sets the corner radius.
Definition lvgl.hpp:805
Derived & pad_gap(int32_t g)
Sets the gap between children in flex/grid layouts.
Definition lvgl.hpp:856
Derived & max_height(int32_t v, lv_style_selector_t part=LV_PART_MAIN)
Sets the maximum height (in pixels) on the given part.
Definition lvgl.hpp:1007
Derived & margin_top(int32_t v, lv_style_selector_t part=LV_PART_MAIN)
Sets top margin (outer spacing) on the given part.
Definition lvgl.hpp:983
Derived & pad_top(int32_t p)
Sets top padding in pixels.
Definition lvgl.hpp:886
Derived & margin_right(int32_t v, lv_style_selector_t part=LV_PART_MAIN)
Sets right margin (outer spacing) on the given part.
Definition lvgl.hpp:1001
Derived & pad_column(int32_t p)
Sets the column gap between children in flex/grid layouts.
Definition lvgl.hpp:916
Derived & margin_bottom(int32_t v, lv_style_selector_t part=LV_PART_MAIN)
Sets bottom margin (outer spacing) on the given part.
Definition lvgl.hpp:989
Derived & pad_left(int32_t p)
Sets left padding in pixels.
Definition lvgl.hpp:898
Derived & pad_hor(int32_t p)
Sets horizontal (left + right) padding.
Definition lvgl.hpp:834
Derived & border_width(int32_t w)
Sets the border width in pixels.
Definition lvgl.hpp:787
Derived & border_color(lv_color_t c, lv_style_selector_t part)
Sets border color on a specific part.
Definition lvgl.hpp:945
Derived & text_font(const lv_font_t *f)
Sets the font used to render text.
Definition lvgl.hpp:878
Derived & pad_all(int32_t p)
Sets uniform padding on all four sides.
Definition lvgl.hpp:823
Derived & bg_color(lv_color_t c)
Sets the background color of the object.
Definition lvgl.hpp:737
Derived & margin_left(int32_t v, lv_style_selector_t part=LV_PART_MAIN)
Sets left margin (outer spacing) on the given part.
Definition lvgl.hpp:995
Derived & pad_row(int32_t p)
Sets the row gap between children in flex/grid layouts.
Definition lvgl.hpp:910
Derived & set_opa(lv_opa_t opa)
Sets the overall object opacity (0–255, or LV_OPA_*).
Definition lvgl.hpp:931
Derived & arc_opa(lv_opa_t opa, lv_style_selector_t part)
Sets arc opacity on a specific part.
Definition lvgl.hpp:963
Derived & bg_opa(lv_opa_t opa, lv_style_selector_t part)
Sets the background opacity on a specific part.
Definition lvgl.hpp:765
Derived & translate_y(int32_t v, lv_style_selector_t part=LV_PART_MAIN)
Sets a vertical translation (post-layout offset) on the given part.
Definition lvgl.hpp:977
Derived & opa_layered(lv_opa_t opa, lv_style_selector_t part=LV_PART_MAIN)
Sets the layered opacity (applied after compositing) on the given part.
Definition lvgl.hpp:1013
Derived & pad_ver(int32_t p)
Sets vertical (top + bottom) padding.
Definition lvgl.hpp:845
Derived & radius(int32_t r, lv_style_selector_t part)
Sets the corner radius on a specific part.
Definition lvgl.hpp:812
Derived & bg_color(lv_color_t c, lv_style_selector_t part)
Sets the background color of a specific part (e.g. LV_PART_INDICATOR, LV_PART_KNOB,...
Definition lvgl.hpp:747
Derived & text_align(uint32_t align, lv_style_selector_t part=LV_PART_MAIN)
Sets the horizontal text alignment on the given part.
Definition lvgl.hpp:924
Derived & border_width(int32_t w, lv_style_selector_t part)
Sets the border width on a specific part.
Definition lvgl.hpp:794
Derived & border_color(lv_color_t c)
Sets the border color.
Definition lvgl.hpp:776
Derived & pad_bottom(int32_t p)
Sets bottom padding in pixels.
Definition lvgl.hpp:892
Derived & arc_color(lv_color_t c, lv_style_selector_t part)
Sets arc color on a specific part.
Definition lvgl.hpp:951
Derived & text_color(lv_color_t c)
Sets the text color.
Definition lvgl.hpp:867
Derived & text_color(lv_color_t c, lv_style_selector_t part)
Sets text color on a specific part.
Definition lvgl.hpp:939
Derived & arc_rounded(bool rounded, lv_style_selector_t part)
Enables/disables rounded arc end caps on a specific part.
Definition lvgl.hpp:969
Derived & arc_width(int32_t w, lv_style_selector_t part)
Sets arc stroke width on a specific part.
Definition lvgl.hpp:957
Derived & bg_opa(lv_opa_t opa)
Sets the background opacity.
Definition lvgl.hpp:758
RAII wrapper around an lv_style_t object.
Definition lvgl.hpp:1049
const lv_style_t * get() const
Returns a const pointer to the underlying lv_style_t.
Definition lvgl.hpp:1107
Style & pad_all(int32_t p)
Sets uniform padding on all four sides.
Definition lvgl.hpp:1172
Style & border_color(lv_color_t c)
Sets the border color.
Definition lvgl.hpp:1150
Style & bg_opa(lv_opa_t opa)
Sets the background opacity.
Definition lvgl.hpp:1128
Style()
Constructs and initialises an empty LVGL style.
Definition lvgl.hpp:1054
Style & operator=(Style &&other) noexcept
Move-assignment operator — transfers the style data and reinitialises the source.
Definition lvgl.hpp:1084
Style & border_width(int32_t w)
Sets the border width in pixels.
Definition lvgl.hpp:1161
Style & bg_color(lv_color_t c)
Sets the background color.
Definition lvgl.hpp:1117
~Style() noexcept
Destroys the style, releasing any resources held by LVGL.
Definition lvgl.hpp:1062
Style & text_color(lv_color_t c)
Sets the text color.
Definition lvgl.hpp:1183
Style & text_font(const lv_font_t *f)
Sets the font used to render text.
Definition lvgl.hpp:1194
lv_style_t * get()
Returns a mutable pointer to the underlying lv_style_t.
Definition lvgl.hpp:1098
Style & radius(int32_t r)
Sets the corner radius.
Definition lvgl.hpp:1139
Style(Style &&other) noexcept
Move constructor — transfers the style data and reinitialises the source.
Definition lvgl.hpp:1074
C++ wrapper for an LVGL switch widget (binary toggle).
Definition lvgl.hpp:1751
bool is_checked() const
Returns true if the switch is on.
Definition lvgl.hpp:1775
Switch(lv_obj_t *obj)
Wraps an existing LVGL switch object (non-owning).
Definition lvgl.hpp:1754
Switch & checked(bool v)
Sets the checked (on) state.
Definition lvgl.hpp:1765
static Switch create(ObjectView parent)
Creates a new switch as a child of parent.
Definition lvgl.hpp:1759
C++ wrapper for LVGL's 2D data table widget.
Definition lvgl.hpp:2795
static Table create(ObjectView parent)
Creates a new table as a child of parent.
Definition lvgl.hpp:2803
uint32_t get_row_count() const
Returns the total row count.
Definition lvgl.hpp:2843
Table & column_width(uint32_t col, int32_t w)
Sets the width of a specific column in pixels.
Definition lvgl.hpp:2830
Table(lv_obj_t *obj)
Wraps an existing LVGL table object (non-owning).
Definition lvgl.hpp:2798
int32_t get_column_width(uint32_t col) const
Returns the width of a specific column in pixels.
Definition lvgl.hpp:2855
Table & row_count(uint32_t n)
Sets the row count (grows/shrinks the table).
Definition lvgl.hpp:2816
Table & column_count(uint32_t n)
Sets the column count.
Definition lvgl.hpp:2823
uint32_t get_column_count() const
Returns the total column count.
Definition lvgl.hpp:2849
Table & cell_value(uint32_t row, uint32_t col, const char *txt)
Sets a cell's text (LVGL copies the string).
Definition lvgl.hpp:2809
const char * get_cell_value(uint32_t row, uint32_t col) const
Returns the text at (row, col).
Definition lvgl.hpp:2837
C++ wrapper for LVGL's tabbed container with swipeable pages.
Definition lvgl.hpp:2874
Tabview & set_active_tab(uint32_t idx, lv_anim_enable_t anim)
Sets the active tab index with optional animation.
Definition lvgl.hpp:2905
uint32_t get_tab_count() const
Returns the number of tabs.
Definition lvgl.hpp:2926
uint32_t get_tab_active() const
Returns the currently active tab index.
Definition lvgl.hpp:2932
ObjectView add_tab(const char *name)
Adds a new tab and returns its content container.
Definition lvgl.hpp:2892
ObjectView get_content() const
Returns the content container (all tabs live here).
Definition lvgl.hpp:2938
Tabview(lv_obj_t *obj)
Wraps an existing LVGL tabview object (non-owning).
Definition lvgl.hpp:2877
Tabview & rename_tab(uint32_t idx, const char *name)
Renames an existing tab.
Definition lvgl.hpp:2898
static Tabview create(ObjectView parent)
Creates a tabview with default bar position/size. Call tab_bar_position() / tab_bar_size() to customi...
Definition lvgl.hpp:2886
Tabview & tab_bar_size(int32_t size)
Sets the tab bar size in pixels.
Definition lvgl.hpp:2919
Tabview & tab_bar_position(lv_dir_t dir)
Sets the tab bar position (TOP/BOTTOM/LEFT/RIGHT).
Definition lvgl.hpp:2912
C++ wrapper for an LVGL text-entry widget.
Definition lvgl.hpp:2199
Textarea & placeholder(const char *txt)
Sets the placeholder shown while the textarea is empty.
Definition lvgl.hpp:2227
static Textarea create(ObjectView parent)
Creates a new textarea as a child of parent.
Definition lvgl.hpp:2207
Textarea & delete_char()
Deletes the character before the cursor.
Definition lvgl.hpp:2307
Textarea & accepted_chars(const char *list)
Restricts input to characters in list; nullptr = any.
Definition lvgl.hpp:2255
uint32_t get_cursor_pos() const
Returns the current cursor position.
Definition lvgl.hpp:2282
Textarea & cursor_pos(int32_t pos)
Moves the cursor to the given character position.
Definition lvgl.hpp:2262
Textarea & one_line(bool en)
Toggles single-line mode (enter fires LV_EVENT_READY).
Definition lvgl.hpp:2234
Textarea(lv_obj_t *obj)
Wraps an existing LVGL textarea object (non-owning).
Definition lvgl.hpp:2202
Textarea & password_mode(bool en)
Enables password masking.
Definition lvgl.hpp:2241
bool is_one_line() const
Returns true if single-line mode is enabled.
Definition lvgl.hpp:2294
Textarea & max_length(uint32_t n)
Sets the maximum character count (0 = unlimited).
Definition lvgl.hpp:2248
Textarea & add_text(const char *txt)
Appends text to the end.
Definition lvgl.hpp:2220
const char * get_text() const
Returns the current text (pointer owned by LVGL).
Definition lvgl.hpp:2276
Textarea & cursor_click_pos(bool en)
Enables moving the cursor by clicking.
Definition lvgl.hpp:2269
bool is_password_mode() const
Returns true if password mode is enabled.
Definition lvgl.hpp:2288
Textarea & text(const char *txt)
Replaces the current text (LVGL copies the string).
Definition lvgl.hpp:2213
Textarea & add_char(uint32_t c)
Appends a single Unicode codepoint to the text.
Definition lvgl.hpp:2300
RAII wrapper for LVGL's built-in timer system.
Definition lvgl.hpp:3415
Timer()
Constructs a null (inactive) timer.
Definition lvgl.hpp:3418
Timer(Timer &&other) noexcept
Move constructor — transfers ownership; source becomes empty.
Definition lvgl.hpp:3443
Timer & pause()
Pauses the timer (can be resumed).
Definition lvgl.hpp:3481
Timer & period(uint32_t ms)
Updates the timer period in milliseconds.
Definition lvgl.hpp:3473
Timer & reset()
Resets the internal elapsed-time counter.
Definition lvgl.hpp:3508
Timer(lv_timer_cb_t cb, uint32_t period_ms, void *user_data=nullptr)
Creates and starts an LVGL timer.
Definition lvgl.hpp:3428
Timer & operator=(Timer &&other) noexcept
Move-assignment — deletes the current timer, then takes other's.
Definition lvgl.hpp:3449
Timer & repeat_count(int32_t count)
Sets the number of times the timer should fire.
Definition lvgl.hpp:3500
Timer & resume()
Resumes a paused timer.
Definition lvgl.hpp:3489
lv_timer_t * get() const
Returns the raw lv_timer_t * for FFI interop.
Definition lvgl.hpp:3461
Timer & ready()
Makes the timer ready to fire on the next lv_timer_handler() pass.
Definition lvgl.hpp:3516
Concept satisfied by callables that are directly convertible to void(*)(lv_event_t*).
Definition lvgl.hpp:595
int32_t display_height()
Vertical resolution (pixels) of the default LVGL display.
Definition lvgl.hpp:3883
void animate_width(ObjectView obj, int32_t to, uint32_t duration_ms)
Helper: animate an object's width.
Definition lvgl.hpp:3690
int32_t display_width()
Horizontal resolution (pixels) of the default LVGL display.
Definition lvgl.hpp:3877
void animate_opa(ObjectView obj, lv_opa_t to, uint32_t duration_ms)
Helper: fade an object's main-part opacity from current → to.
Definition lvgl.hpp:3710
ObjectView layer_top()
Returns the top layer (for overlays that should render above screens).
Definition lvgl.hpp:3895
void animate_y(ObjectView obj, int32_t to, uint32_t duration_ms)
Helper: animate an object's Y position with ease-out.
Definition lvgl.hpp:3678
void animate_x(ObjectView obj, int32_t to, uint32_t duration_ms)
Helper: animate an object's X position with ease-out.
Definition lvgl.hpp:3666
int32_t display_dpi()
DPI of the default LVGL display.
Definition lvgl.hpp:3889
Box hbox(ObjectView parent)
Creates a horizontal flex container (LV_FLEX_FLOW_ROW) sized to its content.
Definition lvgl.hpp:3161
Box vbox(ObjectView parent)
Creates a vertical flex container (LV_FLEX_FLOW_COLUMN) sized to its content.
Definition lvgl.hpp:3148
Derived & add_style(Style &style, lv_style_selector_t selector)
Applies a reusable Style to this object for the given selector.
Definition lvgl.hpp:1207
Result< void > set(unsigned int port, unsigned int pin, int value) noexcept
Drives a GPIO output pin to the specified logic level.
Definition gpio.hpp:55
Result< int > get(unsigned int port, unsigned int pin) noexcept
Reads the current logic level of a GPIO pin.
Definition gpio.hpp:67
C++ abstractions for the LVGL embedded GUI library.
ove_pm_state_t State
System power state (active / sleep / deep-sleep / off).
Definition pm.hpp:37