support tabview for pika_lvgl and add example

This commit is contained in:
lyon 2023-12-30 09:33:04 +08:00
parent 0ce3e4c7a4
commit acfb5daadf
7 changed files with 1140 additions and 0 deletions

View File

@ -0,0 +1,42 @@
import PikaStdLib
import pika_lvgl as lv
print('hello pikapython!')
mem = PikaStdLib.MemChecker()
print('mem used max:')
mem.max()
# Create a Tab view object
tabview = lv.tabview(lv.scr_act(), lv.DIR.TOP, 50)
# Add 3 tabs (the tabs are page (lv_page) and can be scrolled
tab1 = tabview.add_tab("Tab 1")
tab2 = tabview.add_tab("Tab 2")
tab3 = tabview.add_tab("Tab 3")
# Add content to the tabs
label = lv.label(tab1)
label.set_text("This the first tab\n\
\n\
If the content\n\
of a tab\n\
becomes too\n\
longer\n\
than the\n\
container\n\
then it\n\
automatically\n\
becomes\n\
scrollable.\n\
\n\
\n\
\n\
Can you see it?")
label = lv.label(tab2)
label.set_text("Second tab")
label = lv.label(tab3)
label.set_text("Third tab");
label.scroll_to_view_recursive(lv.ANIM.ON)

View File

@ -0,0 +1,44 @@
import PikaStdLib
import pika_lvgl as lv
print('hello pikapython!')
mem = PikaStdLib.MemChecker()
print('mem used max:')
mem.max()
# Create a Tab view object
tabview = lv.tabview(lv.scr_act(), lv.DIR.LEFT, 80)
tabview.set_style_bg_color(lv.palette_lighten(lv.PALETTE.RED, 2), 0)
tab_btns = tabview.get_tab_btns()
tab_btns.set_style_bg_color(lv.palette_darken(lv.PALETTE.GREY, 3), 0)
tab_btns.set_style_text_color(lv.palette_lighten(lv.PALETTE.GREY, 5), 0)
# tab_btns.set_style_border_side(lv.BORDER_SIDE.RIGHT, lv.PART.ITEMS | lv.STATE.CHECKED)
# Add 3 tabs (the tabs are page (lv_page) and can be scrolled
tab1 = tabview.add_tab("Tab 1")
tab2 = tabview.add_tab("Tab 2")
tab3 = tabview.add_tab("Tab 3")
tab4 = tabview.add_tab("Tab 4")
tab5 = tabview.add_tab("Tab 5")
tab2.set_style_bg_color(lv.palette_lighten(lv.PALETTE.AMBER, 3), 0)
tab2.set_style_bg_opa(lv.OPA.COVER, 0)
# Add content to the tabs
label = lv.label(tab1)
label.set_text("First tab")
label = lv.label(tab2)
label.set_text("Second tab")
label = lv.label(tab3)
label.set_text("Third tab")
label = lv.label(tab4)
label.set_text("Forth tab")
label = lv.label(tab5)
label.set_text("Fifth tab")
tabview.get_content().clear_flag(lv.obj.FLAG.SCROLLABLE)

View File

@ -24,6 +24,7 @@
#include "pika_lvgl_lv_color_t.h"
#include "pika_lvgl_lv_obj.h"
#include "pika_lvgl_lv_timer_t.h"
#include "pika_lvgl_common.h"
PikaObj* pika_lv_event_listener_g;
Args* pika_lv_id_register_g;
@ -53,17 +54,25 @@ void pika_lvgl_STATE___init__(PikaObj* self) {
}
void pika_lvgl_lock(PikaObj* self) {
#if PIKA_LVGL_THREAD_LOCK_ENABLE
if (!g_lvgl_inited) {
return;
}
pika_platform_thread_mutex_lock(&pika_lv_global_mutex_g);
#else
return;
#endif
}
void pika_lvgl_unlock(PikaObj* self) {
#if PIKA_LVGL_THREAD_LOCK_ENABLE
if (!g_lvgl_inited) {
return;
}
pika_platform_thread_mutex_unlock(&pika_lv_global_mutex_g);
#else
return;
#endif
}
void pika_lvgl_flag_t___init__(PikaObj* self) {
@ -227,8 +236,10 @@ void pika_lvgl___init__(PikaObj* self) {
pika_lv_event_listener_g = obj_getObj(self, "lv_event_listener");
pika_lv_id_register_g = New_args(NULL);
if (!g_lvgl_inited) {
#if PIKA_LVGL_THREAD_LOCK_ENABLE
pika_debug("Init pika_lv_global_mutex_g");
pika_platform_thread_mutex_init(&pika_lv_global_mutex_g);
#endif
pika_lvgl_lock(NULL);
lv_png_init();
pika_lvgl_unlock(NULL);
@ -265,6 +276,15 @@ PikaObj* pika_lvgl_palette_lighten(PikaObj* self, int p, int lvl) {
return new_obj;
}
PikaObj* pika_lvgl_palette_darken(PikaObj* self, int p, int lvl) {
PikaObj* new_obj = newNormalObj(New_pika_lvgl_lv_color_t);
lv_color_t lv_color = lv_palette_darken(p, lvl);
args_setStruct(new_obj->list, "lv_color_struct", lv_color);
lv_color_t* plv_color = args_getStruct(new_obj->list, "lv_color_struct");
obj_setPtr(new_obj, "lv_color", plv_color);
return new_obj;
}
PikaObj* pika_lvgl_lv_color_hex(PikaObj* self, int64_t hex) {
PikaObj* new_obj = newNormalObj(New_pika_lvgl_lv_color_t);
lv_color_t lv_color = lv_color_hex(hex);
@ -329,4 +349,43 @@ int pika_lvgl_pct(PikaObj* self, int x) {
return LV_PCT(x);
}
/*
"""
enum {
LV_DIR_NONE = 0x00,
LV_DIR_LEFT = (1 << 0),
LV_DIR_RIGHT = (1 << 1),
LV_DIR_TOP = (1 << 2),
LV_DIR_BOTTOM = (1 << 3),
LV_DIR_HOR = LV_DIR_LEFT | LV_DIR_RIGHT,
LV_DIR_VER = LV_DIR_TOP | LV_DIR_BOTTOM,
LV_DIR_ALL = LV_DIR_HOR | LV_DIR_VER,
};
typedef uint8_t lv_dir_t;
"""
class DIR:
NONE: int
LEFT: int
RIGHT: int
TOP: int
BOTTOM: int
HOR: int
VER: int
ALL: int
def __init__(self): ...
*/
void pika_lvgl_DIR___init__(PikaObj* self) {
obj_setInt(self, "NONE", LV_DIR_NONE);
obj_setInt(self, "LEFT", LV_DIR_LEFT);
obj_setInt(self, "RIGHT", LV_DIR_RIGHT);
obj_setInt(self, "TOP", LV_DIR_TOP);
obj_setInt(self, "BOTTOM", LV_DIR_BOTTOM);
obj_setInt(self, "HOR", LV_DIR_HOR);
obj_setInt(self, "VER", LV_DIR_VER);
obj_setInt(self, "ALL", LV_DIR_ALL);
}
#endif

View File

@ -123,6 +123,32 @@ class ANIM:
ON: int
def __init__(self): ...
"""
enum {
LV_DIR_NONE = 0x00,
LV_DIR_LEFT = (1 << 0),
LV_DIR_RIGHT = (1 << 1),
LV_DIR_TOP = (1 << 2),
LV_DIR_BOTTOM = (1 << 3),
LV_DIR_HOR = LV_DIR_LEFT | LV_DIR_RIGHT,
LV_DIR_VER = LV_DIR_TOP | LV_DIR_BOTTOM,
LV_DIR_ALL = LV_DIR_HOR | LV_DIR_VER,
};
typedef uint8_t lv_dir_t;
"""
class DIR:
NONE: int
LEFT: int
RIGHT: int
TOP: int
BOTTOM: int
HOR: int
VER: int
ALL: int
def __init__(self): ...
class STATE:
DEFAULT: int
@ -168,6 +194,7 @@ class lv_timer_t:
def palette_lighten(p: int, lvl: int) -> lv_color_t: ...
def palette_darken(p: int, lvl: int) -> lv_color_t: ...
def palette_main(p: int) -> lv_color_t: ...
@ -335,6 +362,96 @@ class FLEX_FLOW:
COLUMN_WRAP_REVERSE: int
def __init__(self): ...
"""
void lv_obj_scroll_to_view(struct _lv_obj_t * obj, lv_anim_enable_t anim_en);
void lv_obj_scroll_to_view_recursive(struct _lv_obj_t * obj, lv_anim_enable_t anim_en);
void lv_obj_set_style_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_min_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_max_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_height(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_min_height(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_max_height(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_y(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_align(struct _lv_obj_t * obj, lv_align_t value, lv_style_selector_t selector);
void lv_obj_set_style_transform_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_transform_height(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_translate_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_translate_y(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_transform_zoom(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_transform_angle(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_transform_pivot_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_transform_pivot_y(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_pad_top(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_pad_bottom(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_pad_left(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_pad_right(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_pad_row(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_pad_column(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_grad_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_grad_dir(struct _lv_obj_t * obj, lv_grad_dir_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_main_stop(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_grad_stop(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_grad(struct _lv_obj_t * obj, const lv_grad_dsc_t * value, lv_style_selector_t selector);
void lv_obj_set_style_bg_dither_mode(struct _lv_obj_t * obj, lv_dither_mode_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_img_src(struct _lv_obj_t * obj, const void * value, lv_style_selector_t selector);
void lv_obj_set_style_bg_img_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_img_recolor(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_img_recolor_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_img_tiled(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector);
void lv_obj_set_style_border_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
void lv_obj_set_style_border_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_border_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_border_side(struct _lv_obj_t * obj, lv_border_side_t value, lv_style_selector_t selector);
void lv_obj_set_style_border_post(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector);
void lv_obj_set_style_outline_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_outline_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
void lv_obj_set_style_outline_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_outline_pad(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_shadow_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_shadow_ofs_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_shadow_ofs_y(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_shadow_spread(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_shadow_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
void lv_obj_set_style_shadow_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_img_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_img_recolor(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
void lv_obj_set_style_img_recolor_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_line_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_line_dash_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_line_dash_gap(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_line_rounded(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector);
void lv_obj_set_style_line_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
void lv_obj_set_style_line_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_arc_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_arc_rounded(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector);
void lv_obj_set_style_arc_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
void lv_obj_set_style_arc_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_arc_img_src(struct _lv_obj_t * obj, const void * value, lv_style_selector_t selector);
void lv_obj_set_style_text_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
void lv_obj_set_style_text_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_text_font(struct _lv_obj_t * obj, const lv_font_t * value, lv_style_selector_t selector);
void lv_obj_set_style_text_letter_space(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_text_line_space(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_text_decor(struct _lv_obj_t * obj, lv_text_decor_t value, lv_style_selector_t selector);
void lv_obj_set_style_text_align(struct _lv_obj_t * obj, lv_text_align_t value, lv_style_selector_t selector);
void lv_obj_set_style_radius(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_clip_corner(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector);
void lv_obj_set_style_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_color_filter_dsc(struct _lv_obj_t * obj, const lv_color_filter_dsc_t * value,
lv_style_selector_t selector);
void lv_obj_set_style_color_filter_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_anim(struct _lv_obj_t * obj, const lv_anim_t * value, lv_style_selector_t selector);
void lv_obj_set_style_anim_time(struct _lv_obj_t * obj, uint32_t value, lv_style_selector_t selector);
void lv_obj_set_style_anim_speed(struct _lv_obj_t * obj, uint32_t value, lv_style_selector_t selector);
void lv_obj_set_style_transition(struct _lv_obj_t * obj, const lv_style_transition_dsc_t * value,
lv_style_selector_t selector);
void lv_obj_set_style_blend_mode(struct _lv_obj_t * obj, lv_blend_mode_t value, lv_style_selector_t selector);
void lv_obj_set_style_layout(struct _lv_obj_t * obj, uint16_t value, lv_style_selector_t selector);
void lv_obj_set_style_base_dir(struct _lv_obj_t * obj, lv_base_dir_t value, lv_style_selector_t selector);
"""
class lv_obj:
def __init__(self, parent: lv_obj): ...
@ -399,6 +516,93 @@ class lv_obj:
def get_id(self) -> str: ...
def clean(self): ...
def del_(self): ...
def scroll_to_view(self, anim_en: int): ...
def scroll_to_view_recursive(self, anim_en: int): ...
def set_style_width(self, value: int, selector: int): ...
def set_style_min_width(self, value: int, selector: int): ...
def set_style_max_width(self, value: int, selector: int): ...
def set_style_height(self, value: int, selector: int): ...
def set_style_min_height(self, value: int, selector: int): ...
def set_style_max_height(self, value: int, selector: int): ...
def set_style_x(self, value: int, selector: int): ...
def set_style_y(self, value: int, selector: int): ...
def set_style_align(self, value: int, selector: int): ...
def set_style_transform_width(self, value: int, selector: int): ...
def set_style_transform_height(self, value: int, selector: int): ...
def set_style_translate_x(self, value: int, selector: int): ...
def set_style_translate_y(self, value: int, selector: int): ...
def set_style_transform_zoom(self, value: int, selector: int): ...
def set_style_transform_angle(self, value: int, selector: int): ...
def set_style_transform_pivot_x(self, value: int, selector: int): ...
def set_style_transform_pivot_y(self, value: int, selector: int): ...
def set_style_pad_top(self, value: int, selector: int): ...
def set_style_pad_bottom(self, value: int, selector: int): ...
def set_style_pad_left(self, value: int, selector: int): ...
def set_style_pad_right(self, value: int, selector: int): ...
def set_style_pad_row(self, value: int, selector: int): ...
def set_style_pad_column(self, value: int, selector: int): ...
def set_style_bg_color(self, value: lv_color_t, selector: int): ...
def set_style_bg_opa(self, value: int, selector: int): ...
def set_style_bg_grad_color(self, value: lv_color_t, selector: int): ...
def set_style_bg_grad_dir(self, value: int, selector: int): ...
def set_style_bg_main_stop(self, value: int, selector: int): ...
def set_style_bg_grad_stop(self, value: int, selector: int): ...
# def set_style_bg_grad(self, value: lv_grad_dsc_t, selector: int): ...
def set_style_bg_dither_mode(self, value: int, selector: int): ...
def set_style_bg_img_src(self, value: bytes, selector: int): ...
def set_style_bg_img_opa(self, value: int, selector: int): ...
def set_style_bg_img_recolor(self, value: lv_color_t, selector: int): ...
def set_style_bg_img_recolor_opa(self, value: int, selector: int): ...
def set_style_bg_img_tiled(self, value: int, selector: int): ...
def set_style_border_color(self, value: lv_color_t, selector: int): ...
def set_style_border_opa(self, value: int, selector: int): ...
def set_style_border_width(self, value: int, selector: int): ...
def set_style_border_side(self, value: int, selector: int): ...
def set_style_border_post(self, value: int, selector: int): ...
def set_style_outline_width(self, value: int, selector: int): ...
def set_style_outline_color(self, value: lv_color_t, selector: int): ...
def set_style_outline_opa(self, value: int, selector: int): ...
def set_style_outline_pad(self, value: int, selector: int): ...
def set_style_shadow_width(self, value: int, selector: int): ...
def set_style_shadow_ofs_x(self, value: int, selector: int): ...
def set_style_shadow_ofs_y(self, value: int, selector: int): ...
def set_style_shadow_spread(self, value: int, selector: int): ...
def set_style_shadow_color(self, value: lv_color_t, selector: int): ...
def set_style_shadow_opa(self, value: int, selector: int): ...
def set_style_img_opa(self, value: int, selector: int): ...
def set_style_img_recolor(self, value: lv_color_t, selector: int): ...
def set_style_img_recolor_opa(self, value: int, selector: int): ...
def set_style_line_width(self, value: int, selector: int): ...
def set_style_line_dash_width(self, value: int, selector: int): ...
def set_style_line_dash_gap(self, value: int, selector: int): ...
def set_style_line_rounded(self, value: int, selector: int): ...
def set_style_line_color(self, value: lv_color_t, selector: int): ...
def set_style_line_opa(self, value: int, selector: int): ...
def set_style_arc_width(self, value: int, selector: int): ...
def set_style_arc_rounded(self, value: int, selector: int): ...
def set_style_arc_color(self, value: lv_color_t, selector: int): ...
def set_style_arc_opa(self, value: int, selector: int): ...
def set_style_arc_img_src(self, value: bytes, selector: int): ...
def set_style_text_color(self, value: lv_color_t, selector: int): ...
def set_style_text_opa(self, value: int, selector: int): ...
# def set_style_text_font(self, value: lv_font_t, selector: int): ...
def set_style_text_letter_space(self, value: int, selector: int): ...
def set_style_text_line_space(self, value: int, selector: int): ...
def set_style_text_decor(self, value: int, selector: int): ...
def set_style_text_align(self, value: int, selector: int): ...
def set_style_radius(self, value: int, selector: int): ...
def set_style_clip_corner(self, value: int, selector: int): ...
def set_style_opa(self, value: int, selector: int): ...
# def set_style_color_filter_dsc(self, value: lv_color_filter_dsc_t, selector: int): ...
def set_style_color_filter_opa(self, value: int, selector: int): ...
def set_style_anim(self, value: int, selector: int): ...
def set_style_anim_time(self, value: int, selector: int): ...
def set_style_anim_speed(self, value: int, selector: int): ...
# def set_style_transition(self, value: lv_style_transition_dsc_t, selector: int): ...
def set_style_blend_mode(self, value: int, selector: int): ...
def set_style_layout(self, value: int, selector: int): ...
def set_style_base_dir(self, value: int, selector: int): ...
class indev_t:
@ -623,6 +827,37 @@ class chart(lv_obj):
def refresh(self): ...
"""
typedef struct {
lv_obj_t obj;
char ** map;
uint16_t tab_cnt;
uint16_t tab_cur;
lv_dir_t tab_pos;
} lv_tabview_t;
extern const lv_obj_class_t lv_tabview_class;
/**********************
* GLOBAL PROTOTYPES
**********************/
lv_obj_t * lv_tabview_create(lv_obj_t * parent, lv_dir_t tab_pos, lv_coord_t tab_size);
lv_obj_t * lv_tabview_add_tab(lv_obj_t * tv, const char * name);
lv_obj_t * lv_tabview_get_content(lv_obj_t * tv);
lv_obj_t * lv_tabview_get_tab_btns(lv_obj_t * tv);
void lv_tabview_set_act(lv_obj_t * obj, uint32_t id, lv_anim_enable_t anim_en);
uint16_t lv_tabview_get_tab_act(lv_obj_t * tv);
"""
class tabview(lv_obj):
def __init__(self, parent: lv_obj, tab_pos: int, tab_size: int): ...
def add_tab(self, name: str) -> lv_obj: ...
def get_content(self) -> lv_obj: ...
def get_tab_btns(self) -> lv_obj: ...
def set_act(self, id: int, anim_en: int): ...
def get_tab_act(self) -> int: ...
def scr_act() -> lv_obj: ...
def pct(x: int) -> int: ...
def timer_create_basic() -> lv_timer_t: ...

View File

@ -0,0 +1,9 @@
#ifndef _PIKA_LVGL_COMMON_H_
#define _PIKA_LVGL_COMMON_H_
#include "PikaObj.h"
#ifndef PIKA_LVGL_THREAD_LOCK_ENABLE
#define PIKA_LVGL_THREAD_LOCK_ENABLE 0
#endif
#endif

View File

@ -348,4 +348,690 @@ void pika_lvgl_lv_obj_del_(PikaObj* self) {
lv_obj_del(lv_obj);
}
/*
"""
void lv_obj_scroll_to_view(struct _lv_obj_t * obj, lv_anim_enable_t anim_en);
void lv_obj_scroll_to_view_recursive(struct _lv_obj_t * obj, lv_anim_enable_t anim_en);
void lv_obj_set_style_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_min_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_max_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_height(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_min_height(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_max_height(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_y(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_align(struct _lv_obj_t * obj, lv_align_t value, lv_style_selector_t selector);
void lv_obj_set_style_transform_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_transform_height(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_translate_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_translate_y(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_transform_zoom(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_transform_angle(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_transform_pivot_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_transform_pivot_y(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_pad_top(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_pad_bottom(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_pad_left(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_pad_right(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_pad_row(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_pad_column(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_grad_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_grad_dir(struct _lv_obj_t * obj, lv_grad_dir_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_main_stop(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_grad_stop(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_grad(struct _lv_obj_t * obj, const lv_grad_dsc_t * value, lv_style_selector_t selector);
void lv_obj_set_style_bg_dither_mode(struct _lv_obj_t * obj, lv_dither_mode_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_img_src(struct _lv_obj_t * obj, const void * value, lv_style_selector_t selector);
void lv_obj_set_style_bg_img_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_img_recolor(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_img_recolor_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_img_tiled(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector);
void lv_obj_set_style_border_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
void lv_obj_set_style_border_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_border_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_border_side(struct _lv_obj_t * obj, lv_border_side_t value, lv_style_selector_t selector);
void lv_obj_set_style_border_post(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector);
void lv_obj_set_style_outline_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_outline_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
void lv_obj_set_style_outline_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_outline_pad(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_shadow_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_shadow_ofs_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_shadow_ofs_y(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_shadow_spread(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_shadow_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
void lv_obj_set_style_shadow_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_img_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_img_recolor(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
void lv_obj_set_style_img_recolor_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_line_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_line_dash_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_line_dash_gap(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_line_rounded(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector);
void lv_obj_set_style_line_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
void lv_obj_set_style_line_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_arc_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_arc_rounded(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector);
void lv_obj_set_style_arc_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
void lv_obj_set_style_arc_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_arc_img_src(struct _lv_obj_t * obj, const void * value, lv_style_selector_t selector);
void lv_obj_set_style_text_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
void lv_obj_set_style_text_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_text_font(struct _lv_obj_t * obj, const lv_font_t * value, lv_style_selector_t selector);
void lv_obj_set_style_text_letter_space(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_text_line_space(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_text_decor(struct _lv_obj_t * obj, lv_text_decor_t value, lv_style_selector_t selector);
void lv_obj_set_style_text_align(struct _lv_obj_t * obj, lv_text_align_t value, lv_style_selector_t selector);
void lv_obj_set_style_radius(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_clip_corner(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector);
void lv_obj_set_style_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_color_filter_dsc(struct _lv_obj_t * obj, const lv_color_filter_dsc_t * value,
lv_style_selector_t selector);
void lv_obj_set_style_color_filter_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_anim(struct _lv_obj_t * obj, const lv_anim_t * value, lv_style_selector_t selector);
void lv_obj_set_style_anim_time(struct _lv_obj_t * obj, uint32_t value, lv_style_selector_t selector);
void lv_obj_set_style_anim_speed(struct _lv_obj_t * obj, uint32_t value, lv_style_selector_t selector);
void lv_obj_set_style_transition(struct _lv_obj_t * obj, const lv_style_transition_dsc_t * value,
lv_style_selector_t selector);
void lv_obj_set_style_blend_mode(struct _lv_obj_t * obj, lv_blend_mode_t value, lv_style_selector_t selector);
void lv_obj_set_style_layout(struct _lv_obj_t * obj, uint16_t value, lv_style_selector_t selector);
void lv_obj_set_style_base_dir(struct _lv_obj_t * obj, lv_base_dir_t value, lv_style_selector_t selector);
"""
class lv_obj:
def __init__(self, parent: lv_obj): ...
def add_state(self, state: int): ...
def add_flag(self, flag: int): ...
def clear_flag(self, flag: int): ...
def add_event_cb(self, event_cb: any, filter: int, user_data: pointer): ...
def add_style(self, style: style_t, selector: int): ...
def set_pos(self, x: int, y: int): ...
def set_x(self, x: int): ...
def set_y(self, y: int): ...
def set_size(self, w: int, h: int): ...
def refr_size(self) -> int: ...
def set_width(self, w: int): ...
def set_height(self, h: int): ...
def set_content_width(self, w: int): ...
def set_content_height(self, h: int): ...
def set_layout(self, layout: int): ...
def is_layout_positioned(self) -> int: ...
def mark_layout_as_dirty(self): ...
def update_layout(self): ...
def set_align(self, align: int): ...
def align(self, align: int, x_ofs: int, y_ofs: int): ...
def align_to(self, base: lv_obj, align: int, x_ofs: int, y_ofs: int): ...
def center(self): ...
# def get_coords(self, coords: lv_area_t): ...
def get_x(self) -> int: ...
def get_x2(self) -> int: ...
def get_y(self) -> int: ...
def get_y2(self) -> int: ...
def get_x_aligned(self) -> int: ...
def get_y_aligned(self) -> int: ...
def get_width(self) -> int: ...
def get_height(self) -> int: ...
def get_content_width(self) -> int: ...
def get_content_height(self) -> int: ...
# def get_content_coords(self, area: lv_area_t): ...
def get_self_width(self) -> int: ...
def get_self_height(self) -> int: ...
def refresh_self_size(self) -> int: ...
def refr_pos(self): ...
def move_to(self, x: int, y: int): ...
def move_children_by(self, x_diff: int, y_diff: int,
ignore_floating: int): ...
def transform_point(self, p: point_t, recursive: int, inv: int): ...
# def get_transformed_area(self, area: lv_area_t, recursive: int, inv: int): ...
# def invalidate_area(self, area: lv_area_t): ...
def invalidate(self): ...
# def area_is_visible(self, area: lv_area_t) -> int: ...
def is_visible(self) -> int: ...
def set_ext_click_area(self, size: int): ...
def set_style_size(self, value: int, selector: int): ...
# def get_click_area(self, area: lv_area_t): ...
def hit_test(self, point: point_t) -> int: ...
def set_flex_flow(self, flow: int): ...
def set_flex_grow(self, value: int): ...
def set_flex_align(self, main_place: int,
cross_place: int, align: int): ...
def set_id(self, id: str): ...
def get_id(self) -> str: ...
def clean(self): ...
def del_(self): ...
def scroll_to_view(self, anim_en: int): ...
def scroll_to_view_recursive(self, anim_en: int): ...
def set_style_width(self, value: int, selector: int): ...
def set_style_min_width(self, value: int, selector: int): ...
def set_style_max_width(self, value: int, selector: int): ...
def set_style_height(self, value: int, selector: int): ...
def set_style_min_height(self, value: int, selector: int): ...
def set_style_max_height(self, value: int, selector: int): ...
def set_style_x(self, value: int, selector: int): ...
def set_style_y(self, value: int, selector: int): ...
def set_style_align(self, value: int, selector: int): ...
def set_style_transform_width(self, value: int, selector: int): ...
def set_style_transform_height(self, value: int, selector: int): ...
def set_style_translate_x(self, value: int, selector: int): ...
def set_style_translate_y(self, value: int, selector: int): ...
def set_style_transform_zoom(self, value: int, selector: int): ...
def set_style_transform_angle(self, value: int, selector: int): ...
def set_style_transform_pivot_x(self, value: int, selector: int): ...
def set_style_transform_pivot_y(self, value: int, selector: int): ...
def set_style_pad_top(self, value: int, selector: int): ...
def set_style_pad_bottom(self, value: int, selector: int): ...
def set_style_pad_left(self, value: int, selector: int): ...
def set_style_pad_right(self, value: int, selector: int): ...
def set_style_pad_row(self, value: int, selector: int): ...
def set_style_pad_column(self, value: int, selector: int): ...
def set_style_bg_color(self, value: lv_color_t, selector: int): ...
def set_style_bg_opa(self, value: int, selector: int): ...
def set_style_bg_grad_color(self, value: lv_color_t, selector: int): ...
def set_style_bg_grad_dir(self, value: int, selector: int): ...
def set_style_bg_main_stop(self, value: int, selector: int): ...
def set_style_bg_grad_stop(self, value: int, selector: int): ...
# def set_style_bg_grad(self, value: lv_grad_dsc_t, selector: int): ...
def set_style_bg_dither_mode(self, value: int, selector: int): ...
def set_style_bg_img_src(self, value: bytes, selector: int): ...
def set_style_bg_img_opa(self, value: int, selector: int): ...
def set_style_bg_img_recolor(self, value: lv_color_t, selector: int): ...
def set_style_bg_img_recolor_opa(self, value: int, selector: int): ...
def set_style_bg_img_tiled(self, value: int, selector: int): ...
def set_style_border_color(self, value: lv_color_t, selector: int): ...
def set_style_border_opa(self, value: int, selector: int): ...
def set_style_border_width(self, value: int, selector: int): ...
def set_style_border_side(self, value: int, selector: int): ...
def set_style_border_post(self, value: int, selector: int): ...
def set_style_outline_width(self, value: int, selector: int): ...
def set_style_outline_color(self, value: lv_color_t, selector: int): ...
def set_style_outline_opa(self, value: int, selector: int): ...
def set_style_outline_pad(self, value: int, selector: int): ...
def set_style_shadow_width(self, value: int, selector: int): ...
def set_style_shadow_ofs_x(self, value: int, selector: int): ...
def set_style_shadow_ofs_y(self, value: int, selector: int): ...
def set_style_shadow_spread(self, value: int, selector: int): ...
def set_style_shadow_color(self, value: lv_color_t, selector: int): ...
def set_style_shadow_opa(self, value: int, selector: int): ...
def set_style_img_opa(self, value: int, selector: int): ...
def set_style_img_recolor(self, value: lv_color_t, selector: int): ...
def set_style_img_recolor_opa(self, value: int, selector: int): ...
def set_style_line_width(self, value: int, selector: int): ...
def set_style_line_dash_width(self, value: int, selector: int): ...
def set_style_line_dash_gap(self, value: int, selector: int): ...
def set_style_line_rounded(self, value: int, selector: int): ...
def set_style_line_color(self, value: lv_color_t, selector: int): ...
def set_style_line_opa(self, value: int, selector: int): ...
def set_style_arc_width(self, value: int, selector: int): ...
def set_style_arc_rounded(self, value: int, selector: int): ...
def set_style_arc_color(self, value: lv_color_t, selector: int): ...
def set_style_arc_opa(self, value: int, selector: int): ...
def set_style_arc_img_src(self, value: bytes, selector: int): ...
def set_style_text_color(self, value: lv_color_t, selector: int): ...
def set_style_text_opa(self, value: int, selector: int): ...
# def set_style_text_font(self, value: lv_font_t, selector: int): ...
def set_style_text_letter_space(self, value: int, selector: int): ...
def set_style_text_line_space(self, value: int, selector: int): ...
def set_style_text_decor(self, value: int, selector: int): ...
def set_style_text_align(self, value: int, selector: int): ...
def set_style_radius(self, value: int, selector: int): ...
def set_style_clip_corner(self, value: int, selector: int): ...
def set_style_opa(self, value: int, selector: int): ...
# def set_style_color_filter_dsc(self, value: lv_color_filter_dsc_t, selector: int): ...
def set_style_color_filter_opa(self, value: int, selector: int): ...
def set_style_anim(self, value: int, selector: int): ...
def set_style_anim_time(self, value: int, selector: int): ...
def set_style_anim_speed(self, value: int, selector: int): ...
# def set_style_transition(self, value: lv_style_transition_dsc_t, selector: int): ...
def set_style_blend_mode(self, value: int, selector: int): ...
def set_style_layout(self, value: int, selector: int): ...
def set_style_base_dir(self, value: int, selector: int): ...
*/
void pika_lvgl_lv_obj_scroll_to_view(PikaObj* self, int anim_en) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_scroll_to_view(lv_obj, anim_en);
}
void pika_lvgl_lv_obj_scroll_to_view_recursive(PikaObj* self, int anim_en) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_scroll_to_view_recursive(lv_obj, anim_en);
}
void pika_lvgl_lv_obj_set_style_width(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_width(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_min_width(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_min_width(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_max_width(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_max_width(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_height(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_height(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_min_height(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_min_height(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_max_height(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_max_height(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_x(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_x(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_y(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_y(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_align(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_align(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_transform_width(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_transform_width(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_transform_height(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_transform_height(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_translate_x(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_translate_x(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_translate_y(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_translate_y(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_transform_zoom(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_transform_zoom(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_transform_angle(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_transform_angle(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_transform_pivot_x(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_transform_pivot_x(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_transform_pivot_y(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_transform_pivot_y(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_pad_top(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_pad_top(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_pad_bottom(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_pad_bottom(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_pad_left(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_pad_left(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_pad_right(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_pad_right(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_pad_row(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_pad_row(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_pad_column(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_pad_column(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_bg_color(PikaObj* self, PikaObj* value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_color_t* lv_color = obj_getPtr(value, "lv_color");
lv_obj_set_style_bg_color(lv_obj, *lv_color, selector);
}
void pika_lvgl_lv_obj_set_style_bg_opa(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_bg_opa(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_bg_grad_color(PikaObj* self, PikaObj* value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_color_t* lv_color = obj_getPtr(value, "lv_color");
lv_obj_set_style_bg_grad_color(lv_obj, *lv_color, selector);
}
void pika_lvgl_lv_obj_set_style_bg_grad_dir(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_bg_grad_dir(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_bg_main_stop(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_bg_main_stop(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_bg_grad_stop(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_bg_grad_stop(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_bg_dither_mode(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_bg_dither_mode(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_bg_img_src(PikaObj* self, PikaObj* value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_img_dsc_t* lv_img_dsc = obj_getPtr(value, "lv_img_dsc");
lv_obj_set_style_bg_img_src(lv_obj, lv_img_dsc, selector);
}
void pika_lvgl_lv_obj_set_style_bg_img_opa(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_bg_img_opa(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_bg_img_recolor(PikaObj* self, PikaObj* value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_color_t* lv_color = obj_getPtr(value, "lv_color");
lv_obj_set_style_bg_img_recolor(lv_obj, *lv_color, selector);
}
void pika_lvgl_lv_obj_set_style_bg_img_recolor_opa(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_bg_img_recolor_opa(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_bg_img_tiled(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_bg_img_tiled(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_border_color(PikaObj* self, PikaObj* value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_color_t* lv_color = obj_getPtr(value, "lv_color");
lv_obj_set_style_border_color(lv_obj, *lv_color, selector);
}
void pika_lvgl_lv_obj_set_style_border_opa(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_border_opa(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_border_width(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_border_width(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_border_side(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_border_side(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_border_post(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_border_post(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_outline_width(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_outline_width(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_outline_color(PikaObj* self, PikaObj* value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_color_t* lv_color = obj_getPtr(value, "lv_color");
lv_obj_set_style_outline_color(lv_obj, *lv_color, selector);
}
void pika_lvgl_lv_obj_set_style_outline_opa(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_outline_opa(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_outline_pad(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_outline_pad(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_shadow_width(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_shadow_width(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_shadow_ofs_x(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_shadow_ofs_x(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_shadow_ofs_y(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_shadow_ofs_y(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_shadow_spread(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_shadow_spread(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_shadow_color(PikaObj* self, PikaObj* value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_color_t* lv_color = obj_getPtr(value, "lv_color");
lv_obj_set_style_shadow_color(lv_obj, *lv_color, selector);
}
void pika_lvgl_lv_obj_set_style_shadow_opa(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_shadow_opa(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_img_opa(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_img_opa(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_img_recolor(PikaObj* self, PikaObj* value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_color_t* lv_color = obj_getPtr(value, "lv_color");
lv_obj_set_style_img_recolor(lv_obj, *lv_color, selector);
}
void pika_lvgl_lv_obj_set_style_img_recolor_opa(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_img_recolor_opa(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_line_width(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_line_width(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_line_dash_width(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_line_dash_width(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_line_dash_gap(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_line_dash_gap(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_line_rounded(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_line_rounded(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_line_color(PikaObj* self, PikaObj* value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_color_t* lv_color = obj_getPtr(value, "lv_color");
lv_obj_set_style_line_color(lv_obj, *lv_color, selector);
}
void pika_lvgl_lv_obj_set_style_line_opa(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_line_opa(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_arc_width(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_arc_width(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_arc_rounded(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_arc_rounded(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_arc_color(PikaObj* self, PikaObj* value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_color_t* lv_color = obj_getPtr(value, "lv_color");
lv_obj_set_style_arc_color(lv_obj, *lv_color, selector);
}
void pika_lvgl_lv_obj_set_style_arc_opa(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_arc_opa(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_arc_img_src(PikaObj* self, PikaObj* value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_img_dsc_t* lv_img_dsc = obj_getPtr(value, "lv_img_dsc");
lv_obj_set_style_arc_img_src(lv_obj, lv_img_dsc, selector);
}
void pika_lvgl_lv_obj_set_style_text_color(PikaObj* self, PikaObj* value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_color_t* lv_color = obj_getPtr(value, "lv_color");
lv_obj_set_style_text_color(lv_obj, *lv_color, selector);
}
void pika_lvgl_lv_obj_set_style_text_opa(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_text_opa(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_text_font(PikaObj* self, PikaObj* value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_font_t* lv_font = obj_getPtr(value, "lv_font");
lv_obj_set_style_text_font(lv_obj, lv_font, selector);
}
void pika_lvgl_lv_obj_set_style_text_letter_space(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_text_letter_space(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_text_line_space(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_text_line_space(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_text_decor(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_text_decor(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_text_align(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_text_align(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_radius(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_radius(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_clip_corner(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_clip_corner(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_opa(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_opa(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_color_filter_dsc(PikaObj* self, PikaObj* value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_color_filter_dsc_t* lv_color_filter_dsc = obj_getPtr(value, "lv_color_filter_dsc");
lv_obj_set_style_color_filter_dsc(lv_obj, lv_color_filter_dsc, selector);
}
void pika_lvgl_lv_obj_set_style_color_filter_opa(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_color_filter_opa(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_anim(PikaObj* self, PikaObj* value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_anim_t* lv_anim = obj_getPtr(value, "lv_anim");
lv_obj_set_style_anim(lv_obj, lv_anim, selector);
}
void pika_lvgl_lv_obj_set_style_anim_time(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_anim_time(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_anim_speed(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_anim_speed(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_transition(PikaObj* self, PikaObj* value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_style_transition_dsc_t* lv_style_transition_dsc = obj_getPtr(value, "lv_style_transition_dsc");
lv_obj_set_style_transition(lv_obj, lv_style_transition_dsc, selector);
}
void pika_lvgl_lv_obj_set_style_blend_mode(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_blend_mode(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_layout(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_layout(lv_obj, value, selector);
}
void pika_lvgl_lv_obj_set_style_base_dir(PikaObj* self, int value, int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_base_dir(lv_obj, value, selector);
}
#endif

View File

@ -555,5 +555,70 @@ void pika_lvgl_chart_set_zoom_y(PikaObj *self, int zoom_y){
lv_chart_set_zoom_y(lv_obj, zoom_y);
}
/*
typedef struct {
lv_obj_t obj;
char ** map;
uint16_t tab_cnt;
uint16_t tab_cur;
lv_dir_t tab_pos;
} lv_tabview_t;
extern const lv_obj_class_t lv_tabview_class;
lv_obj_t * lv_tabview_create(lv_obj_t * parent, lv_dir_t tab_pos, lv_coord_t tab_size);
lv_obj_t * lv_tabview_add_tab(lv_obj_t * tv, const char * name);
lv_obj_t * lv_tabview_get_content(lv_obj_t * tv);
lv_obj_t * lv_tabview_get_tab_btns(lv_obj_t * tv);
void lv_tabview_set_act(lv_obj_t * obj, uint32_t id, lv_anim_enable_t anim_en);
uint16_t lv_tabview_get_tab_act(lv_obj_t * tv);
class tabview(lv_obj):
def __init__(self, parent: lv_obj, tab_pos: int, tab_size: int): ...
def add_tab(self, name: str) -> lv_obj: ...
def get_content(self) -> lv_obj: ...
def get_tab_btns(self) -> lv_obj: ...
def set_act(self, id: int, anim_en: int): ...
def get_tab_act(self) -> int: ...
*/
void pika_lvgl_tabview___init__(PikaObj *self, PikaObj* parent, int tab_pos, int tab_size){
lv_obj_t* lv_obj = lv_tabview_create(obj_getPtr(parent, "lv_obj"), tab_pos, tab_size);
obj_setPtr(self, "lv_obj", lv_obj);
}
PikaObj* pika_lvgl_tabview_add_tab(PikaObj *self, char* name){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_t* tab = lv_tabview_add_tab(lv_obj, name);
PikaObj* new_obj = newNormalObj(New_pika_lvgl_lv_obj);
obj_setPtr(new_obj, "lv_obj", tab);
return new_obj;
}
PikaObj* pika_lvgl_tabview_get_content(PikaObj *self){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_t* content = lv_tabview_get_content(lv_obj);
PikaObj* new_obj = newNormalObj(New_pika_lvgl_lv_obj);
obj_setPtr(new_obj, "lv_obj", content);
return new_obj;
}
PikaObj* pika_lvgl_tabview_get_tab_btns(PikaObj *self){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_t* btns = lv_tabview_get_tab_btns(lv_obj);
PikaObj* new_obj = newNormalObj(New_pika_lvgl_lv_obj);
obj_setPtr(new_obj, "lv_obj", btns);
return new_obj;
}
void pika_lvgl_tabview_set_act(PikaObj *self, int id, int anim_en){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_tabview_set_act(lv_obj, id, anim_en);
}
int pika_lvgl_tabview_get_tab_act(PikaObj *self){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
return lv_tabview_get_tab_act(lv_obj);
}
#endif