Merge pull request #13444 from s-hadinger/openhasp_alpha2

LVGL OpenHASP alpha2
This commit is contained in:
s-hadinger 2021-10-23 15:34:09 +02:00 committed by GitHub
commit 8ad20cb4a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
31 changed files with 1553 additions and 181 deletions

View File

@ -10,6 +10,7 @@
#include "lvgl.h"
#include "be_lvgl.h"
#include "lv_theme_openhasp.h"
extern int lv0_member(bvm *vm); // resolve virtual members
@ -70,6 +71,7 @@ const lvbe_call_c_t lv_func[] = {
{ "get_ver_res", (void*) &lv_get_ver_res, "i", "" },
{ "group_get_default", (void*) &lv_group_get_default, "lv.lv_group", "" },
{ "img_src_get_type", (void*) &lv_img_src_get_type, "i", "." },
{ "indev_get_act", (void*) &lv_indev_get_act, "lv.lv_indev", "" },
{ "indev_get_obj_act", (void*) &lv_indev_get_obj_act, "lv.lv_obj", "" },
{ "indev_read_timer_cb", (void*) &lv_indev_read_timer_cb, "", "(lv.lv_timer)" },
{ "layer_sys", (void*) &lv_layer_sys, "lv.lv_obj", "" },
@ -81,18 +83,23 @@ const lvbe_call_c_t lv_func[] = {
{ "obj_enable_style_refresh", (void*) &lv_obj_enable_style_refresh, "", "b" },
{ "obj_event_base", (void*) &lv_obj_event_base, "i", "(lv.lv_obj_class)(lv.lv_event)" },
{ "obj_report_style_change", (void*) &lv_obj_report_style_change, "", "(lv.lv_style)" },
{ "obj_style_get_selector_part", (void*) &lv_obj_style_get_selector_part, "i", "(lv.lv_style_selector)" },
{ "obj_style_get_selector_state", (void*) &lv_obj_style_get_selector_state, "i", "(lv.lv_style_selector)" },
{ "obj_style_get_selector_part", (void*) &lv_obj_style_get_selector_part, "i", "i" },
{ "obj_style_get_selector_state", (void*) &lv_obj_style_get_selector_state, "i", "i" },
{ "refr_now", (void*) &lv_refr_now, "", "(lv.lv_disp)" },
{ "scr_act", (void*) &lv_scr_act, "lv.lv_obj", "" },
{ "scr_load", (void*) &lv_scr_load, "", "(lv.lv_obj)" },
{ "scr_load_anim", (void*) &lv_scr_load_anim, "", "(lv.lv_obj)iiib" },
{ "theme_apply", (void*) &lv_theme_apply, "", "(lv.lv_obj)" },
{ "theme_default_init", (void*) &lv_theme_default_init, "lv.lv_theme", "(lv.lv_disp)(lv.lv_color)(lv.lv_color)b(lv.lv_font)" },
{ "theme_default_is_inited", (void*) &lv_theme_default_is_inited, "b", "" },
{ "theme_get_color_primary", (void*) &lv_theme_get_color_primary, "lv.lv_color", "(lv.lv_obj)" },
{ "theme_get_color_secondary", (void*) &lv_theme_get_color_secondary, "lv.lv_color", "(lv.lv_obj)" },
{ "theme_get_font_large", (void*) &lv_theme_get_font_large, "lv.lv_font", "(lv.lv_obj)" },
{ "theme_get_font_normal", (void*) &lv_theme_get_font_normal, "lv.lv_font", "(lv.lv_obj)" },
{ "theme_get_font_small", (void*) &lv_theme_get_font_small, "lv.lv_font", "(lv.lv_obj)" },
{ "theme_get_from_obj", (void*) &lv_theme_get_from_obj, "lv.lv_theme", "(lv.lv_obj)" },
{ "theme_openhasp_init", (void*) &lv_theme_openhasp_init, "lv.lv_theme", "(lv.lv_disp)(lv.lv_color)(lv.lv_color)b(lv.lv_font)" },
{ "theme_openhasp_is_inited", (void*) &lv_theme_openhasp_is_inited, "b", "" },
{ "theme_set_apply_cb", (void*) &lv_theme_set_apply_cb, "", "(lv.lv_theme)^lv_theme_apply_cb^" },
{ "theme_set_parent", (void*) &lv_theme_set_parent, "", "(lv.lv_theme)(lv.lv_theme)" },
@ -673,7 +680,7 @@ be_local_module(lv,
{ be_nested_key("start", 1697318111, 5, 0), be_const_func(lv0_start) },
}))
);
BE_EXPORT_VARIABLE be_define_const_native_module(lv, NULL);
BE_EXPORT_VARIABLE be_define_const_native_module(lv);
#endif // USE_LVGL

View File

@ -28,6 +28,7 @@ extern int lvs_tostring(bvm *vm);
BE_EXPORT_VARIABLE extern const bclass be_class_lv_obj;
extern int lvbe_font_create(bvm *vm);
extern int lvbe_theme_create(bvm *vm);
/* `lv_style` external functions definitions */
@ -125,6 +126,8 @@ extern int lvbe_style_set_arc_img_src(bvm *vm);
/* `lv_color` external functions definitions */
/* `lv_theme` external functions definitions */
/* `lv_img` external functions definitions */
extern int lvbe_img_set_tasmota_logo(bvm *vm);
extern int lvbe_img_create(bvm *vm);
@ -143,6 +146,22 @@ extern int lvbe_img_get_pivot(bvm *vm);
extern int lvbe_img_get_zoom(bvm *vm);
extern int lvbe_img_get_antialias(bvm *vm);
/* `lv_disp` external functions definitions */
extern int lvbe_disp_get_scr_act(bvm *vm);
extern int lvbe_disp_get_scr_prev(bvm *vm);
extern int lvbe_disp_load_scr(bvm *vm);
extern int lvbe_disp_get_layer_top(bvm *vm);
extern int lvbe_disp_get_layer_sys(bvm *vm);
extern int lvbe_disp_set_theme(bvm *vm);
extern int lvbe_disp_get_theme(bvm *vm);
extern int lvbe_disp_set_bg_color(bvm *vm);
extern int lvbe_disp_set_bg_image(bvm *vm);
extern int lvbe_disp_set_bg_opa(bvm *vm);
extern int lvbe_disp_get_inactive_time(bvm *vm);
extern int lvbe_disp_trig_activity(bvm *vm);
extern int lvbe_disp_clean_dcache(bvm *vm);
extern int lvbe_disp_dpx(bvm *vm);
/* `lv_obj` external functions definitions */
extern int lvbe_obj_add_event_cb(bvm *vm);
extern int lvbe_obj_remove_event_cb(bvm *vm);
@ -439,6 +458,7 @@ extern int lvbe_obj_set_parent(bvm *vm);
extern int lvbe_obj_move_foreground(bvm *vm);
extern int lvbe_obj_move_background(bvm *vm);
extern int lvbe_obj_get_screen(bvm *vm);
extern int lvbe_obj_get_disp(bvm *vm);
extern int lvbe_obj_get_parent(bvm *vm);
extern int lvbe_obj_get_child(bvm *vm);
extern int lvbe_obj_get_child_cnt(bvm *vm);
@ -786,7 +806,9 @@ extern int lvbe_textarea_cursor_up(bvm *vm);
extern int be_ntv_lv_style_init(bvm *vm);
extern int be_ntv_lv_font_init(bvm *vm);
extern int be_ntv_lv_color_init(bvm *vm);
extern int be_ntv_lv_theme_init(bvm *vm);
extern int be_ntv_lv_img_init(bvm *vm);
extern int be_ntv_lv_disp_init(bvm *vm);
extern int be_ntv_lv_obj_init(bvm *vm);
extern int be_ntv_lv_group_init(bvm *vm);
extern int be_ntv_lv_indev_init(bvm *vm);
@ -882,6 +904,23 @@ be_local_class(lv_indev,
);
/*******************************************************************/
/********************************************************************
** Solidified class: lv_disp
********************************************************************/
be_local_class(lv_disp,
1,
NULL,
be_nested_map(4,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_nested_key("init", 380752755, 4, -1), be_const_func(lv0_init) },
{ be_nested_key("tostring", -1995258651, 8, -1), be_const_func(lvx_tostring) },
{ be_nested_key("_p", 1594591802, 2, -1), be_const_var(0) },
{ be_nested_key("member", 719708611, 6, 0), be_const_func(lvx_member) },
})),
(be_nested_const_str("lv_disp", 609712084, 8))
);
/*******************************************************************/
/********************************************************************
** Solidified class: lv_font
********************************************************************/
@ -898,6 +937,22 @@ be_local_class(lv_font,
);
/*******************************************************************/
/********************************************************************
** Solidified class: lv_theme
********************************************************************/
be_local_class(lv_theme,
1,
NULL,
be_nested_map(3,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_nested_key("init", 380752755, 4, -1), be_const_func(lvbe_theme_create) },
{ be_nested_key("tostring", -1995258651, 8, -1), be_const_func(lvx_tostring) },
{ be_nested_key("_p", 1594591802, 2, -1), be_const_var(0) },
})),
(be_nested_const_str("lv_theme", 1550958453, 7))
);
/*******************************************************************/
/********************************************************************
** Solidified class: lv_color
********************************************************************/
@ -933,6 +988,12 @@ void be_load_lv_color_class(bvm *vm) {
be_pop(vm, 1);
}
void be_load_lv_theme_class(bvm *vm) {
be_pushntvclass(vm, &be_class_lv_theme);
be_setglobal(vm, "lv_theme");
be_pop(vm, 1);
}
/********************************************************************
** Solidified class: lv_img
********************************************************************/
@ -955,6 +1016,12 @@ void be_load_lv_img_class(bvm *vm) {
be_pop(vm, 1);
}
void be_load_lv_disp_class(bvm *vm) {
be_pushntvclass(vm, &be_class_lv_disp);
be_setglobal(vm, "lv_disp");
be_pop(vm, 1);
}
void be_load_lv_obj_class(bvm *vm) {
be_pushntvclass(vm, &be_class_lv_obj);
be_setglobal(vm, "lv_obj");

View File

@ -54,5 +54,5 @@ be_local_module(python_compat,
{ be_nested_key("init", 380752755, 4, -1), be_const_closure(_anonymous__closure) },
}))
);
BE_EXPORT_VARIABLE be_define_const_native_module(python_compat, NULL);
BE_EXPORT_VARIABLE be_define_const_native_module(python_compat);
/********************************************************************/

View File

@ -1,7 +1,45 @@
import string
import json
# lv.start()
# scr = lv.scr_act() # default screean object
# scr.set_style_bg_color(lv.color(0x0000A0), lv.PART_MAIN | lv.STATE_DEFAULT)
lv.start()
hres = lv.get_hor_res() # should be 320
vres = lv.get_ver_res() # should be 240
scr = lv.scr_act() # default screean object
f20 = lv.montserrat_font(20) # load embedded Montserrat 20
th2 = lv.theme_openhasp_init(0, lv.color(0xFF0000), lv.color(0xFFFF00), true, f20)
scr.get_disp().set_theme(th2)
# apply theme to layer_top, but keep it transparent
lv.theme_apply(lv.layer_top())
lv.layer_top().set_style_bg_opa(0,0)
# parse hex string
def parse_hex(s)
import string
s = string.toupper(s) # turn to uppercase
var val = 0
for i:0..size(s)-1
var c = s[i]
# var c_int = string.byte(c)
if c == "#" continue end # skip '#' prefix if any
if c == "x" || c == "X" continue end # skip 'x' or 'X'
if c >= "A" && c <= "F"
val = (val << 4) | string.byte(c) - 55
elif c >= "0" && c <= "9"
val = (val << 4) | string.byte(c) - 48
end
end
return val
end
#- ------------------------------------------------------------
Class `lvh_obj` encapsulating `lv_obj``
@ -11,7 +49,9 @@ import json
Adds specific virtual members used by OpenHASP
- ------------------------------------------------------------ -#
class lvh_obj
static _lv_class = lv_obj
# _lv_class refers to the lvgl class encapsulated, and is overriden by subclasses
static _lv_class = lv.obj
#- mapping from OpenHASP attribute to LVGL attribute -#
#- if mapping is null, we use set_X and get_X from our own class -#
static _attr_map = {
@ -25,31 +65,37 @@ class lvh_obj
"hidden": nil, # apply to self
"enabled": nil, # apply to self
"toggle": nil,
"bg_color": nil,
"align": nil,
}
var _lv_obj # native lvgl object
var _lv_label # sub-label if exists
# init
# - create the LVGL encapsulated object
def init(parent)
var obj_class = self._lv_class # need to copy to a var to distinguish from method call
self._lv_obj = obj_class(parent)
var obj_class = self._lv_class # need to assign to a var to distinguish from method call
self._lv_obj = obj_class(parent) # instanciate LVGL object
self.post_init()
end
def obj()
# post-init, to be overriden
def post_init()
end
# get LVGL encapsulated object
def get_obj()
return self._lv_obj
end
def tostring()
return "<instance "+classname(self)+"()>"
end
#- ------------------------------------------------------------
Mapping of synthetic attributes
- text
- hidden
- enabled
- ------------------------------------------------------------ -#
#- `hidden` attributes mapped to LV_OBJ_FLAG_HIDDEN -#
#- `hidden` attributes mapped to OBJ_FLAG_HIDDEN -#
def set_hidden(h)
if h
self._lv_obj.add_flag(lv.OBJ_FLAG_HIDDEN)
@ -62,6 +108,7 @@ class lvh_obj
return self._lv_obj.has_flag(lv.OBJ_FLAG_HIDDEN)
end
#- `enabled` attributes mapped to OBJ_FLAG_CLICKABLE -#
def set_enabled(h)
if h
self._lv_obj.add_flag(lv.OBJ_FLAG_CLICKABLE)
@ -74,9 +121,10 @@ class lvh_obj
return self._lv_obj.has_flag(lv.OBJ_FLAG_CLICKABLE)
end
#- `toggle` attributes mapped to STATE_CHECKED -#
def set_toggle(t)
if t == "TRUE" t = true end
if t == "FASLE" t = false end
if t == "FALSE" t = false end
if t
self._lv_obj.add_state(lv.STATE_CHECKED)
else
@ -90,24 +138,67 @@ class lvh_obj
#- set_text: create a `lv_label` sub object to the current object -#
#- (default case, may be overriden by object that directly take text) -#
def set_text(t)
def check_label()
if self._lv_label == nil
self._lv_label = lv_label(self.obj())
self._lv_label = lv.label(self.get_obj())
end
end
def set_text(t)
self.check_label()
self._lv_label.set_text(t)
end
def get_text()
if self._lv_label == nil
if self._lv_label == nil return nil end
return self._lv_label.get_text()
end
def set_align(t)
var align
self.check_label()
if t == 0 || t == "left"
align = lv.TEXT_ALIGN_LEFT
elif t == 1 || t == "center"
align = lv.TEXT_ALIGN_CENTER
elif t == 2 || t == "right"
align = lv.TEXT_ALIGN_RIGHT
else
align = lv.TEXT_ALIGN_auto
end
self._lv_label.set_style_text_align(align, lv.PART_MAIN | lv.STATE_DEFAULT)
end
def get_align()
if self._lv_label == nil return nil end
var align self._lv_label.get_style_text_align(lv.PART_MAIN | lv.STATE_DEFAULT)
if align == lv.TEXT_ALIGN_LEFT
return "left"
elif align == lv.TEXT_ALIGN_CENTER
return "center"
elif align == lv.TEXT_ALIGN_RIGHT
return "right"
else
return nil
end
return self._lv_label.get_text()
end
def set_bg_color(t)
var color = lv.color(parse_hex(t))
self._lv_obj.set_style_bg_color(color, lv.PART_MAIN | lv.STATE_DEFAULT)
end
def get_bg_color()
return self._lv_obj.get_style_bg_color(lv.PART_MAIN | lv.STATE_DEFAULT)
end
#- ------------------------------------------------------------
Mapping of virtual attributes
- ------------------------------------------------------------ -#
def member(k)
# tostring is a special case, we shouldn't raise an exception for it
if k == 'tostring' return nil end
#
if self._attr_map.has(k)
import introspect
if self._attr_map[k]
@ -153,34 +244,42 @@ class lvh_obj
end
end
#- creat sub-classes of lvh_obj and map the LVGL class in static '_lv_class' attribute -#
class lvh_arc : lvh_obj static _lv_class = lv_arc end
class lvh_bar : lvh_obj static _lv_class = lv_bar end
class lvh_btn : lvh_obj static _lv_class = lv_btn end
class lvh_btnmatrix : lvh_obj static _lv_class = lv_btnmatrix end
class lvh_checkbox : lvh_obj static _lv_class = lv_checkbox end
class lvh_dropdown : lvh_obj static _lv_class = lv_dropdown end
class lvh_img : lvh_obj static _lv_class = lv_img end
class lvh_label : lvh_obj static _lv_class = lv_label end
class lvh_line : lvh_obj static _lv_class = lv_line end
class lvh_roller : lvh_obj static _lv_class = lv_roller end
class lvh_slider : lvh_obj static _lv_class = lv_slider end
class lvh_slider : lvh_obj static _lv_class = lv_slider end
class lvh_switch : lvh_obj static _lv_class = lv_switch end
class lvh_textarea : lvh_obj static _lv_class = lv_textarea end
class lvh_label : lvh_obj
static _lv_class = lv.label
# label do not need a sub-label
def post_init()
self._lv_label = self._lv_obj
# label don't have opaque background by default
self._lv_obj.set_style_bg_opa(lv.OPA_COVER, lv.PART_MAIN | lv.STATE_DEFAULT)
end
end
#- ------------------------------------------------------------
Class `lvh_page` encapsulating `lv_obj` as screen (created with lv_obj(0))
- ------------------------------------------------------------ -#
#- creat sub-classes of lvh_obj and map the LVGL class in static '_lv_class' attribute -#
class lvh_arc : lvh_obj static _lv_class = lv.arc end
class lvh_bar : lvh_obj static _lv_class = lv.bar end
class lvh_btn : lvh_obj static _lv_class = lv.btn end
class lvh_btnmatrix : lvh_obj static _lv_class = lv.btnmatrix end
class lvh_checkbox : lvh_obj static _lv_class = lv.checkbox end
class lvh_dropdown : lvh_obj static _lv_class = lv.dropdown end
class lvh_img : lvh_obj static _lv_class = lv.img end
class lvh_line : lvh_obj static _lv_class = lv.line end
class lvh_roller : lvh_obj static _lv_class = lv.roller end
class lvh_slider : lvh_obj static _lv_class = lv.slider end
class lvh_slider : lvh_obj static _lv_class = lv.slider end
class lvh_switch : lvh_obj static _lv_class = lv.switch end
class lvh_textarea : lvh_obj static _lv_class = lv.textarea end
#- ----------------------------------------------------------------------------
Class `lvh_page` encapsulating `lv_obj` as screen (created with lv.obj(0))
- ----------------------------------------------------------------------------- -#
# ex of transition: lv.scr_load_anim(scr, lv.SCR_LOAD_ANIM_MOVE_RIGHT, 500, 0, false)
class lvh_page
var _obj_id # list of objects by id numbers
var _page_id
var _lv_scr # lvgl screen object
var _obj_id # (map) of objects by id numbers
var _page_id # (int) id number of the page
var _lv_scr # (lv_obj) lvgl screen object
#- init(page_number) -#
def init(page_number)
import string
import global
# if no parameter, default to page #1
@ -190,8 +289,10 @@ class lvh_page
self._obj_id = {} # init list of objects
if page_number == 1
self._lv_scr = lv.scr_act() # default screen
elif page_number == 0
self._lv_scr = lv.layer_top() # top layer, visible over all screens
else
self._lv_scr = lv_obj(0) # allocate a new screen
self._lv_scr = lv.obj(0) # allocate a new screen
self._lv_scr.set_style_bg_color(lv_color(0x000000), lv.PART_MAIN | lv.STATE_DEFAULT) # set black background
end
@ -217,6 +318,8 @@ class lvh_page
#- show this page, with animation -#
def show(anim, duration)
# ignore if there is no screen, like for id 0
if self._lv_scr == nil return nil end
# ignore if the screen is already active
if self._lv_scr._p == lv.scr_act()._p return end # do nothing
@ -289,11 +392,11 @@ def parse_obj(jline, page)
# add object to page object
lvh_page_cur.set_obj(obj_id, obj)
# set attributes
# try every attribute, if not supported it is silently ignored
for k:jline.keys()
obj.(k) = jline[k]
introspect.set(obj, k, jline[k])
# obj.(k) = jline[k]
end
# create a global variable for this object of form p<page>b<id>, ex p1b2
@ -314,8 +417,10 @@ for j:jsonl
var jline = json.load(j)
# parse page first
parse_page(jline)
parse_obj(jline, lvh_page_cur)
if type(jline) == 'instance'
parse_page(jline)
parse_obj(jline, lvh_page_cur)
end
end
print(lvh_pages[1]._obj_id)

View File

@ -19,4 +19,4 @@ static be_define_const_module(
"debug"
);
BE_EXPORT_VARIABLE be_define_const_native_module(debug, NULL);
BE_EXPORT_VARIABLE be_define_const_native_module(debug);

View File

@ -18,4 +18,4 @@ static be_define_const_module(
"energy"
);
BE_EXPORT_VARIABLE be_define_const_native_module(energy, NULL);
BE_EXPORT_VARIABLE be_define_const_native_module(energy);

View File

@ -16,4 +16,4 @@ static be_define_const_module(
"flash"
);
BE_EXPORT_VARIABLE be_define_const_native_module(flash, NULL);
BE_EXPORT_VARIABLE be_define_const_native_module(flash);

View File

@ -15,4 +15,4 @@ static be_define_const_module(
"gc"
);
BE_EXPORT_VARIABLE be_define_const_native_module(gc, NULL);
BE_EXPORT_VARIABLE be_define_const_native_module(gc);

View File

@ -16,4 +16,4 @@ static be_define_const_module(
"global"
);
BE_EXPORT_VARIABLE be_define_const_native_module(global, NULL);
BE_EXPORT_VARIABLE be_define_const_native_module(global);

View File

@ -283,4 +283,4 @@ static be_define_const_module(
"gpio"
);
BE_EXPORT_VARIABLE be_define_const_native_module(gpio, NULL);
BE_EXPORT_VARIABLE be_define_const_native_module(gpio);

View File

@ -18,4 +18,4 @@ static be_define_const_module(
"introspect"
);
BE_EXPORT_VARIABLE be_define_const_native_module(introspect, NULL);
BE_EXPORT_VARIABLE be_define_const_native_module(introspect);

View File

@ -15,4 +15,4 @@ static be_define_const_module(
"json"
);
BE_EXPORT_VARIABLE be_define_const_native_module(json, NULL);
BE_EXPORT_VARIABLE be_define_const_native_module(json);

View File

@ -18,4 +18,4 @@ static be_define_const_module(
"light"
);
BE_EXPORT_VARIABLE be_define_const_native_module(light, NULL);
BE_EXPORT_VARIABLE be_define_const_native_module(light);

View File

@ -40,4 +40,4 @@ static be_define_const_module(
"math"
);
BE_EXPORT_VARIABLE be_define_const_native_module(math, NULL);
BE_EXPORT_VARIABLE be_define_const_native_module(math);

View File

@ -14,4 +14,4 @@ static be_define_const_module(
"persist"
);
BE_EXPORT_VARIABLE be_define_const_native_module(persist, NULL);
BE_EXPORT_VARIABLE be_define_const_native_module(persist);

View File

@ -14,4 +14,4 @@ static be_define_const_module(
"solidify"
);
BE_EXPORT_VARIABLE be_define_const_native_module(solidify, NULL);
BE_EXPORT_VARIABLE be_define_const_native_module(solidify);

View File

@ -14,4 +14,4 @@ static be_define_const_module(
"strict"
);
BE_EXPORT_VARIABLE be_define_const_native_module(strict, NULL);
BE_EXPORT_VARIABLE be_define_const_native_module(strict);

View File

@ -22,4 +22,4 @@ static be_define_const_module(
"string"
);
BE_EXPORT_VARIABLE be_define_const_native_module(string, NULL);
BE_EXPORT_VARIABLE be_define_const_native_module(string);

View File

@ -15,4 +15,4 @@ static be_define_const_module(
"path"
);
BE_EXPORT_VARIABLE be_define_const_native_module(path, NULL);
BE_EXPORT_VARIABLE be_define_const_native_module(path);

View File

@ -28,4 +28,4 @@ static be_define_const_module(
"webserver"
);
BE_EXPORT_VARIABLE be_define_const_native_module(webserver, NULL);
BE_EXPORT_VARIABLE be_define_const_native_module(webserver);

View File

@ -138,13 +138,12 @@ const bvector _name = { \
.end = (void*)(_data + (_size) - 1) \
}
#define be_define_const_native_module(_module, _init) \
#define be_define_const_native_module(_module) \
const bntvmodule be_native_module(_module) = { \
.name = #_module, \
.attrs = NULL, \
.size = 0, \
.module = (bmodule*)&(m_lib##_module), \
.init = _init \
.module = (bmodule*)&(m_lib##_module) \
}
/* defines needed for solidified classes */

View File

@ -297,6 +297,62 @@ static void m_solidify_class(bvm *vm, bclass *cl, int builtins)
logfmt("}\n");
}
static void m_solidify_module(bvm *vm, bmodule *ml, int builtins)
{
const char * module_name = ml->info.name;
/* iterate on members to dump closures */
if (ml->table) {
bmapnode *node;
bmapiter iter = be_map_iter();
while ((node = be_map_next(ml->table, &iter)) != NULL) {
if (var_isstr(&node->key) && var_isclosure(&node->value)) {
bclosure *f = var_toobj(&node->value);
m_solidify_closure(vm, f, builtins);
}
}
}
logfmt("\n");
logfmt("/********************************************************************\n");
logfmt("** Solidified module: %s\n", module_name);
logfmt("********************************************************************/\n");
logfmt("be_local_module(%s,\n", module_name);
logfmt(" \"%s\",\n", module_name);
if (ml->table) {
logfmt(" be_nested_map(%i,\n", ml->table->count);
logfmt(" ( (struct bmapnode*) &(const bmapnode[]) {\n");
for (int i = 0; i < ml->table->count; i++) {
bmapnode * node = &ml->table->slots[i];
if (node->key.type != BE_STRING) {
char error[64];
snprintf(error, sizeof(error), "Unsupported type in key: %i", node->key.type);
be_raise(vm, "internal_error", error);
}
int key_next = node->key.next;
size_t len = strlen(str(node->key.v.s));
if (0xFFFFFF == key_next) {
key_next = -1; /* more readable */
}
logfmt(" { be_nested_key(\"%s\", %i, %zu, %i), ", str(node->key.v.s), be_strhash(node->key.v.s), len >= 255 ? 255 : len, key_next);
m_solidify_bvalue(vm, &node->value, module_name, str(node->key.v.s));
logfmt(" },\n");
}
logfmt(" }))\n");
} else {
logfmt(" NULL,\n");
}
logfmt(");\n");
logfmt("BE_EXPORT_VARIABLE be_define_const_native_module(%s, NULL);\n", module_name);
logfmt("/********************************************************************\n");
}
#define be_builtin_count(vm) \
be_vector_count(&(vm)->gbldesc.builtin.vlist)
@ -308,6 +364,8 @@ static int m_dump(bvm *vm)
m_solidify_closure(vm, var_toobj(v), be_builtin_count(vm));
} else if (var_isclass(v)) {
m_solidify_class(vm, var_toobj(v), be_builtin_count(vm));
} else if (var_ismodule(v)) {
m_solidify_module(vm, var_toobj(v), be_builtin_count(vm));
}
}
be_return_nil(vm);

View File

@ -18,7 +18,7 @@ extern "C" {
#endif
/* do not modify the version number! */
#define BERRY_VERSION "0.1.10"
#define BERRY_VERSION "1.0.0"
#if BE_STACK_TOTAL_MAX < BE_STACK_FREE_MIN * 2
#error "The value of the macro BE_STACK_TOTAL_MAX is too small."
@ -172,7 +172,6 @@ typedef struct bntvmodule {
const bntvmodobj *attrs; /* native module attributes */
size_t size; /* native module attribute count */
const struct bmodule *module; /* const module object */
bntvfunc init; /* initialization function */
} bntvmodule;
/* native module node definition macro */

View File

@ -143,8 +143,7 @@ std::string block_builder::module_tostring(const block &block)
if (scp != "static") { /* extern */
ostr << "\n" << scp
<< " be_define_const_native_module("
<< block.name << ", "
<< init(block) << ");" << std::endl;
<< block.name << ");" << std::endl;
}
return ostr.str();
}
@ -168,12 +167,6 @@ std::string block_builder::name(const block &block)
return it == block.attr.end() ? block.name : it->second;
}
std::string block_builder::init(const block &block)
{
auto it = block.attr.find("init");
return it == block.attr.end() ? "NULL" : it->second;
}
void block_builder::writefile(const std::string &filename, const std::string &text)
{
std::string pathname(filename);

View File

@ -39,7 +39,6 @@ private:
std::string scope(const block &block);
std::string super(const block &block);
std::string name(const block &block);
std::string init(const block &block);
void writefile(const std::string &filename, const std::string &text);
private:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,49 @@
/**
* @file lv_theme_openhasp.h
*
*/
#ifndef LV_THEME_OPENHASP_H
#define LV_THEME_OPENHASP_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "core/lv_obj.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* GLOBAL PROTOTYPES
**********************/
/**
* Initialize the theme
* @param color_primary the primary color of the theme
* @param color_secondary the secondary color for the theme
* @param font pointer to a font to use.
* @return a pointer to reference this theme later
*/
lv_theme_t * lv_theme_openhasp_init(lv_disp_t * disp, lv_color_t color_primary, lv_color_t color_secondary, bool dark, const lv_font_t * font);
bool lv_theme_openhasp_is_inited(void);
/**********************
* MACROS
**********************/
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /*LV_THEME_DEFAULT_H*/

View File

@ -110,6 +110,10 @@ const lvbe_call_c_t lv_font_func[] = {
const lvbe_call_c_t lv_color_func[] = {
};
/* `lv_theme` methods */
const lvbe_call_c_t lv_theme_func[] = {
};
/* `lv_img` methods */
#ifdef BE_LV_WIDGET_IMG
const lvbe_call_c_t lv_img_func[] = {
@ -131,12 +135,30 @@ const lvbe_call_c_t lv_img_func[] = {
};
#endif // BE_LV_WIDGET_IMG
/* `lv_disp` methods */
const lvbe_call_c_t lv_disp_func[] = {
{ "clean_dcache", (void*) &lv_disp_clean_dcache, "", "(lv.lv_disp)" },
{ "dpx", (void*) &lv_disp_dpx, "i", "(lv.lv_disp)i" },
{ "get_inactive_time", (void*) &lv_disp_get_inactive_time, "i", "(lv.lv_disp)" },
{ "get_layer_sys", (void*) &lv_disp_get_layer_sys, "lv.lv_obj", "(lv.lv_disp)" },
{ "get_layer_top", (void*) &lv_disp_get_layer_top, "lv.lv_obj", "(lv.lv_disp)" },
{ "get_scr_act", (void*) &lv_disp_get_scr_act, "lv.lv_obj", "(lv.lv_disp)" },
{ "get_scr_prev", (void*) &lv_disp_get_scr_prev, "lv.lv_obj", "(lv.lv_disp)" },
{ "get_theme", (void*) &lv_disp_get_theme, "lv.lv_theme", "(lv.lv_disp)" },
{ "load_scr", (void*) &lv_disp_load_scr, "", "(lv.lv_obj)" },
{ "set_bg_color", (void*) &lv_disp_set_bg_color, "", "(lv.lv_disp)(lv.lv_color)" },
{ "set_bg_image", (void*) &lv_disp_set_bg_image, "", "(lv.lv_disp)." },
{ "set_bg_opa", (void*) &lv_disp_set_bg_opa, "", "(lv.lv_disp)i" },
{ "set_theme", (void*) &lv_disp_set_theme, "", "(lv.lv_disp)(lv.lv_theme)" },
{ "trig_activity", (void*) &lv_disp_trig_activity, "", "(lv.lv_disp)" },
};
/* `lv_obj` methods */
const lvbe_call_c_t lv_obj_func[] = {
{ "add_event_cb", (void*) &lv_obj_add_event_cb, "i", "(lv.lv_obj)^lv_event_cb^i." },
{ "add_flag", (void*) &lv_obj_add_flag, "", "(lv.lv_obj)i" },
{ "add_state", (void*) &lv_obj_add_state, "", "(lv.lv_obj)i" },
{ "add_style", (void*) &lv_obj_add_style, "", "(lv.lv_obj)(lv.lv_style)(lv.lv_style_selector)" },
{ "add_style", (void*) &lv_obj_add_style, "", "(lv.lv_obj)(lv.lv_style)i" },
{ "align", (void*) &lv_obj_align, "", "(lv.lv_obj)iii" },
{ "align_to", (void*) &lv_obj_align_to, "", "(lv.lv_obj)(lv.lv_obj)iii" },
{ "allocate_spec_attr", (void*) &lv_obj_allocate_spec_attr, "", "(lv.lv_obj)" },
@ -162,9 +184,10 @@ const lvbe_call_c_t lv_obj_func[] = {
{ "get_content_height", (void*) &lv_obj_get_content_height, "i", "(lv.lv_obj)" },
{ "get_content_width", (void*) &lv_obj_get_content_width, "i", "(lv.lv_obj)" },
{ "get_coords", (void*) &lv_obj_get_coords, "", "(lv.lv_obj)(lv.lv_area)" },
{ "get_disp", (void*) &lv_obj_get_disp, "lv.lv_disp", "(lv.lv_obj)" },
{ "get_group", (void*) &lv_obj_get_group, ".", "(lv.lv_obj)" },
{ "get_height", (void*) &lv_obj_get_height, "i", "(lv.lv_obj)" },
{ "get_local_style_prop", (void*) &lv_obj_get_local_style_prop, "i", "(lv.lv_obj)(lv.lv_style_prop)(lv.lv_style_value)(lv.lv_style_selector)" },
{ "get_local_style_prop", (void*) &lv_obj_get_local_style_prop, "i", "(lv.lv_obj)(lv.lv_style_prop)(lv.lv_style_value)i" },
{ "get_parent", (void*) &lv_obj_get_parent, "lv.lv_obj", "(lv.lv_obj)" },
{ "get_screen", (void*) &lv_obj_get_screen, "lv.lv_obj", "(lv.lv_obj)" },
{ "get_scroll_bottom", (void*) &lv_obj_get_scroll_bottom, "i", "(lv.lv_obj)" },
@ -307,8 +330,8 @@ const lvbe_call_c_t lv_obj_func[] = {
{ "refresh_style", (void*) &lv_obj_refresh_style, "", "(lv.lv_obj)i(lv.lv_style_prop)" },
{ "remove_event_cb", (void*) &lv_obj_remove_event_cb, "b", "(lv.lv_obj)^lv_event_cb^" },
{ "remove_event_dsc", (void*) &lv_obj_remove_event_dsc, "b", "(lv.lv_obj)i" },
{ "remove_local_style_prop", (void*) &lv_obj_remove_local_style_prop, "b", "(lv.lv_obj)(lv.lv_style_prop)(lv.lv_style_selector)" },
{ "remove_style", (void*) &lv_obj_remove_style, "", "(lv.lv_obj)(lv.lv_style)(lv.lv_style_selector)" },
{ "remove_local_style_prop", (void*) &lv_obj_remove_local_style_prop, "b", "(lv.lv_obj)(lv.lv_style_prop)i" },
{ "remove_style", (void*) &lv_obj_remove_style, "", "(lv.lv_obj)(lv.lv_style)i" },
{ "remove_style_all", (void*) &lv_obj_remove_style_all, "", "(lv.lv_obj)" },
{ "scroll_by", (void*) &lv_obj_scroll_by, "", "(lv.lv_obj)ii(lv.lv_anim_enable)" },
{ "scroll_to", (void*) &lv_obj_scroll_to, "", "(lv.lv_obj)ii(lv.lv_anim_enable)" },
@ -323,7 +346,7 @@ const lvbe_call_c_t lv_obj_func[] = {
{ "set_ext_click_area", (void*) &lv_obj_set_ext_click_area, "", "(lv.lv_obj)i" },
{ "set_height", (void*) &lv_obj_set_height, "", "(lv.lv_obj)i" },
{ "set_layout", (void*) &lv_obj_set_layout, "", "(lv.lv_obj)i" },
{ "set_local_style_prop", (void*) &lv_obj_set_local_style_prop, "", "(lv.lv_obj)(lv.lv_style_prop)i(lv.lv_style_selector)" },
{ "set_local_style_prop", (void*) &lv_obj_set_local_style_prop, "", "(lv.lv_obj)(lv.lv_style_prop)ii" },
{ "set_parent", (void*) &lv_obj_set_parent, "", "(lv.lv_obj)(lv.lv_obj)" },
{ "set_pos", (void*) &lv_obj_set_pos, "", "(lv.lv_obj)ii" },
{ "set_scroll_dir", (void*) &lv_obj_set_scroll_dir, "", "(lv.lv_obj)i" },
@ -331,100 +354,100 @@ const lvbe_call_c_t lv_obj_func[] = {
{ "set_scroll_snap_y", (void*) &lv_obj_set_scroll_snap_y, "", "(lv.lv_obj)i" },
{ "set_scrollbar_mode", (void*) &lv_obj_set_scrollbar_mode, "", "(lv.lv_obj)i" },
{ "set_size", (void*) &lv_obj_set_size, "", "(lv.lv_obj)ii" },
{ "set_style_align", (void*) &lv_obj_set_style_align, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_anim_speed", (void*) &lv_obj_set_style_anim_speed, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_anim_time", (void*) &lv_obj_set_style_anim_time, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_arc_color", (void*) &lv_obj_set_style_arc_color, "", "(lv.lv_obj)(lv.lv_color)(lv.lv_style_selector)" },
{ "set_style_arc_color_filtered", (void*) &lv_obj_set_style_arc_color_filtered, "", "(lv.lv_obj)(lv.lv_color)(lv.lv_style_selector)" },
{ "set_style_arc_img_src", (void*) &lv_obj_set_style_arc_img_src, "", "(lv.lv_obj).(lv.lv_style_selector)" },
{ "set_style_arc_opa", (void*) &lv_obj_set_style_arc_opa, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_arc_rounded", (void*) &lv_obj_set_style_arc_rounded, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_arc_width", (void*) &lv_obj_set_style_arc_width, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_base_dir", (void*) &lv_obj_set_style_base_dir, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_bg_color", (void*) &lv_obj_set_style_bg_color, "", "(lv.lv_obj)(lv.lv_color)(lv.lv_style_selector)" },
{ "set_style_bg_color_filtered", (void*) &lv_obj_set_style_bg_color_filtered, "", "(lv.lv_obj)(lv.lv_color)(lv.lv_style_selector)" },
{ "set_style_bg_grad_color", (void*) &lv_obj_set_style_bg_grad_color, "", "(lv.lv_obj)(lv.lv_color)(lv.lv_style_selector)" },
{ "set_style_bg_grad_color_filtered", (void*) &lv_obj_set_style_bg_grad_color_filtered, "", "(lv.lv_obj)(lv.lv_color)(lv.lv_style_selector)" },
{ "set_style_bg_grad_dir", (void*) &lv_obj_set_style_bg_grad_dir, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_bg_grad_stop", (void*) &lv_obj_set_style_bg_grad_stop, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_bg_img_opa", (void*) &lv_obj_set_style_bg_img_opa, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_bg_img_recolor", (void*) &lv_obj_set_style_bg_img_recolor, "", "(lv.lv_obj)(lv.lv_color)(lv.lv_style_selector)" },
{ "set_style_bg_img_recolor_filtered", (void*) &lv_obj_set_style_bg_img_recolor_filtered, "", "(lv.lv_obj)(lv.lv_color)(lv.lv_style_selector)" },
{ "set_style_bg_img_recolor_opa", (void*) &lv_obj_set_style_bg_img_recolor_opa, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_bg_img_src", (void*) &lv_obj_set_style_bg_img_src, "", "(lv.lv_obj).(lv.lv_style_selector)" },
{ "set_style_bg_img_tiled", (void*) &lv_obj_set_style_bg_img_tiled, "", "(lv.lv_obj)b(lv.lv_style_selector)" },
{ "set_style_bg_main_stop", (void*) &lv_obj_set_style_bg_main_stop, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_bg_opa", (void*) &lv_obj_set_style_bg_opa, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_blend_mode", (void*) &lv_obj_set_style_blend_mode, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_border_color", (void*) &lv_obj_set_style_border_color, "", "(lv.lv_obj)(lv.lv_color)(lv.lv_style_selector)" },
{ "set_style_border_color_filtered", (void*) &lv_obj_set_style_border_color_filtered, "", "(lv.lv_obj)(lv.lv_color)(lv.lv_style_selector)" },
{ "set_style_border_opa", (void*) &lv_obj_set_style_border_opa, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_border_post", (void*) &lv_obj_set_style_border_post, "", "(lv.lv_obj)b(lv.lv_style_selector)" },
{ "set_style_border_side", (void*) &lv_obj_set_style_border_side, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_border_width", (void*) &lv_obj_set_style_border_width, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_clip_corner", (void*) &lv_obj_set_style_clip_corner, "", "(lv.lv_obj)b(lv.lv_style_selector)" },
{ "set_style_color_filter_dsc", (void*) &lv_obj_set_style_color_filter_dsc, "", "(lv.lv_obj)(lv.lv_color_filter_dsc)(lv.lv_style_selector)" },
{ "set_style_color_filter_opa", (void*) &lv_obj_set_style_color_filter_opa, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_height", (void*) &lv_obj_set_style_height, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_img_opa", (void*) &lv_obj_set_style_img_opa, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_img_recolor", (void*) &lv_obj_set_style_img_recolor, "", "(lv.lv_obj)(lv.lv_color)(lv.lv_style_selector)" },
{ "set_style_img_recolor_filtered", (void*) &lv_obj_set_style_img_recolor_filtered, "", "(lv.lv_obj)(lv.lv_color)(lv.lv_style_selector)" },
{ "set_style_img_recolor_opa", (void*) &lv_obj_set_style_img_recolor_opa, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_layout", (void*) &lv_obj_set_style_layout, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_line_color", (void*) &lv_obj_set_style_line_color, "", "(lv.lv_obj)(lv.lv_color)(lv.lv_style_selector)" },
{ "set_style_line_color_filtered", (void*) &lv_obj_set_style_line_color_filtered, "", "(lv.lv_obj)(lv.lv_color)(lv.lv_style_selector)" },
{ "set_style_line_dash_gap", (void*) &lv_obj_set_style_line_dash_gap, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_line_dash_width", (void*) &lv_obj_set_style_line_dash_width, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_line_opa", (void*) &lv_obj_set_style_line_opa, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_line_rounded", (void*) &lv_obj_set_style_line_rounded, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_line_width", (void*) &lv_obj_set_style_line_width, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_max_height", (void*) &lv_obj_set_style_max_height, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_max_width", (void*) &lv_obj_set_style_max_width, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_min_height", (void*) &lv_obj_set_style_min_height, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_min_width", (void*) &lv_obj_set_style_min_width, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_opa", (void*) &lv_obj_set_style_opa, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_outline_color", (void*) &lv_obj_set_style_outline_color, "", "(lv.lv_obj)(lv.lv_color)(lv.lv_style_selector)" },
{ "set_style_outline_color_filtered", (void*) &lv_obj_set_style_outline_color_filtered, "", "(lv.lv_obj)(lv.lv_color)(lv.lv_style_selector)" },
{ "set_style_outline_opa", (void*) &lv_obj_set_style_outline_opa, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_outline_pad", (void*) &lv_obj_set_style_outline_pad, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_outline_width", (void*) &lv_obj_set_style_outline_width, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_pad_all", (void*) &lv_obj_set_style_pad_all, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_pad_bottom", (void*) &lv_obj_set_style_pad_bottom, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_pad_column", (void*) &lv_obj_set_style_pad_column, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_pad_gap", (void*) &lv_obj_set_style_pad_gap, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_pad_hor", (void*) &lv_obj_set_style_pad_hor, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_pad_left", (void*) &lv_obj_set_style_pad_left, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_pad_right", (void*) &lv_obj_set_style_pad_right, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_pad_row", (void*) &lv_obj_set_style_pad_row, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_pad_top", (void*) &lv_obj_set_style_pad_top, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_pad_ver", (void*) &lv_obj_set_style_pad_ver, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_radius", (void*) &lv_obj_set_style_radius, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_shadow_color", (void*) &lv_obj_set_style_shadow_color, "", "(lv.lv_obj)(lv.lv_color)(lv.lv_style_selector)" },
{ "set_style_shadow_color_filtered", (void*) &lv_obj_set_style_shadow_color_filtered, "", "(lv.lv_obj)(lv.lv_color)(lv.lv_style_selector)" },
{ "set_style_shadow_ofs_x", (void*) &lv_obj_set_style_shadow_ofs_x, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_shadow_ofs_y", (void*) &lv_obj_set_style_shadow_ofs_y, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_shadow_opa", (void*) &lv_obj_set_style_shadow_opa, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_shadow_spread", (void*) &lv_obj_set_style_shadow_spread, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_shadow_width", (void*) &lv_obj_set_style_shadow_width, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_size", (void*) &lv_obj_set_style_size, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_text_align", (void*) &lv_obj_set_style_text_align, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_text_color", (void*) &lv_obj_set_style_text_color, "", "(lv.lv_obj)(lv.lv_color)(lv.lv_style_selector)" },
{ "set_style_text_color_filtered", (void*) &lv_obj_set_style_text_color_filtered, "", "(lv.lv_obj)(lv.lv_color)(lv.lv_style_selector)" },
{ "set_style_text_decor", (void*) &lv_obj_set_style_text_decor, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_text_font", (void*) &lv_obj_set_style_text_font, "", "(lv.lv_obj)(lv.lv_font)(lv.lv_style_selector)" },
{ "set_style_text_letter_space", (void*) &lv_obj_set_style_text_letter_space, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_text_line_space", (void*) &lv_obj_set_style_text_line_space, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_text_opa", (void*) &lv_obj_set_style_text_opa, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_transform_angle", (void*) &lv_obj_set_style_transform_angle, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_transform_height", (void*) &lv_obj_set_style_transform_height, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_transform_width", (void*) &lv_obj_set_style_transform_width, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_transform_zoom", (void*) &lv_obj_set_style_transform_zoom, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_transition", (void*) &lv_obj_set_style_transition, "", "(lv.lv_obj)(lv.lv_style_transition_dsc)(lv.lv_style_selector)" },
{ "set_style_translate_x", (void*) &lv_obj_set_style_translate_x, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_translate_y", (void*) &lv_obj_set_style_translate_y, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_width", (void*) &lv_obj_set_style_width, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_x", (void*) &lv_obj_set_style_x, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_y", (void*) &lv_obj_set_style_y, "", "(lv.lv_obj)i(lv.lv_style_selector)" },
{ "set_style_align", (void*) &lv_obj_set_style_align, "", "(lv.lv_obj)ii" },
{ "set_style_anim_speed", (void*) &lv_obj_set_style_anim_speed, "", "(lv.lv_obj)ii" },
{ "set_style_anim_time", (void*) &lv_obj_set_style_anim_time, "", "(lv.lv_obj)ii" },
{ "set_style_arc_color", (void*) &lv_obj_set_style_arc_color, "", "(lv.lv_obj)(lv.lv_color)i" },
{ "set_style_arc_color_filtered", (void*) &lv_obj_set_style_arc_color_filtered, "", "(lv.lv_obj)(lv.lv_color)i" },
{ "set_style_arc_img_src", (void*) &lv_obj_set_style_arc_img_src, "", "(lv.lv_obj).i" },
{ "set_style_arc_opa", (void*) &lv_obj_set_style_arc_opa, "", "(lv.lv_obj)ii" },
{ "set_style_arc_rounded", (void*) &lv_obj_set_style_arc_rounded, "", "(lv.lv_obj)ii" },
{ "set_style_arc_width", (void*) &lv_obj_set_style_arc_width, "", "(lv.lv_obj)ii" },
{ "set_style_base_dir", (void*) &lv_obj_set_style_base_dir, "", "(lv.lv_obj)ii" },
{ "set_style_bg_color", (void*) &lv_obj_set_style_bg_color, "", "(lv.lv_obj)(lv.lv_color)i" },
{ "set_style_bg_color_filtered", (void*) &lv_obj_set_style_bg_color_filtered, "", "(lv.lv_obj)(lv.lv_color)i" },
{ "set_style_bg_grad_color", (void*) &lv_obj_set_style_bg_grad_color, "", "(lv.lv_obj)(lv.lv_color)i" },
{ "set_style_bg_grad_color_filtered", (void*) &lv_obj_set_style_bg_grad_color_filtered, "", "(lv.lv_obj)(lv.lv_color)i" },
{ "set_style_bg_grad_dir", (void*) &lv_obj_set_style_bg_grad_dir, "", "(lv.lv_obj)ii" },
{ "set_style_bg_grad_stop", (void*) &lv_obj_set_style_bg_grad_stop, "", "(lv.lv_obj)ii" },
{ "set_style_bg_img_opa", (void*) &lv_obj_set_style_bg_img_opa, "", "(lv.lv_obj)ii" },
{ "set_style_bg_img_recolor", (void*) &lv_obj_set_style_bg_img_recolor, "", "(lv.lv_obj)(lv.lv_color)i" },
{ "set_style_bg_img_recolor_filtered", (void*) &lv_obj_set_style_bg_img_recolor_filtered, "", "(lv.lv_obj)(lv.lv_color)i" },
{ "set_style_bg_img_recolor_opa", (void*) &lv_obj_set_style_bg_img_recolor_opa, "", "(lv.lv_obj)ii" },
{ "set_style_bg_img_src", (void*) &lv_obj_set_style_bg_img_src, "", "(lv.lv_obj).i" },
{ "set_style_bg_img_tiled", (void*) &lv_obj_set_style_bg_img_tiled, "", "(lv.lv_obj)bi" },
{ "set_style_bg_main_stop", (void*) &lv_obj_set_style_bg_main_stop, "", "(lv.lv_obj)ii" },
{ "set_style_bg_opa", (void*) &lv_obj_set_style_bg_opa, "", "(lv.lv_obj)ii" },
{ "set_style_blend_mode", (void*) &lv_obj_set_style_blend_mode, "", "(lv.lv_obj)ii" },
{ "set_style_border_color", (void*) &lv_obj_set_style_border_color, "", "(lv.lv_obj)(lv.lv_color)i" },
{ "set_style_border_color_filtered", (void*) &lv_obj_set_style_border_color_filtered, "", "(lv.lv_obj)(lv.lv_color)i" },
{ "set_style_border_opa", (void*) &lv_obj_set_style_border_opa, "", "(lv.lv_obj)ii" },
{ "set_style_border_post", (void*) &lv_obj_set_style_border_post, "", "(lv.lv_obj)bi" },
{ "set_style_border_side", (void*) &lv_obj_set_style_border_side, "", "(lv.lv_obj)ii" },
{ "set_style_border_width", (void*) &lv_obj_set_style_border_width, "", "(lv.lv_obj)ii" },
{ "set_style_clip_corner", (void*) &lv_obj_set_style_clip_corner, "", "(lv.lv_obj)bi" },
{ "set_style_color_filter_dsc", (void*) &lv_obj_set_style_color_filter_dsc, "", "(lv.lv_obj)(lv.lv_color_filter_dsc)i" },
{ "set_style_color_filter_opa", (void*) &lv_obj_set_style_color_filter_opa, "", "(lv.lv_obj)ii" },
{ "set_style_height", (void*) &lv_obj_set_style_height, "", "(lv.lv_obj)ii" },
{ "set_style_img_opa", (void*) &lv_obj_set_style_img_opa, "", "(lv.lv_obj)ii" },
{ "set_style_img_recolor", (void*) &lv_obj_set_style_img_recolor, "", "(lv.lv_obj)(lv.lv_color)i" },
{ "set_style_img_recolor_filtered", (void*) &lv_obj_set_style_img_recolor_filtered, "", "(lv.lv_obj)(lv.lv_color)i" },
{ "set_style_img_recolor_opa", (void*) &lv_obj_set_style_img_recolor_opa, "", "(lv.lv_obj)ii" },
{ "set_style_layout", (void*) &lv_obj_set_style_layout, "", "(lv.lv_obj)ii" },
{ "set_style_line_color", (void*) &lv_obj_set_style_line_color, "", "(lv.lv_obj)(lv.lv_color)i" },
{ "set_style_line_color_filtered", (void*) &lv_obj_set_style_line_color_filtered, "", "(lv.lv_obj)(lv.lv_color)i" },
{ "set_style_line_dash_gap", (void*) &lv_obj_set_style_line_dash_gap, "", "(lv.lv_obj)ii" },
{ "set_style_line_dash_width", (void*) &lv_obj_set_style_line_dash_width, "", "(lv.lv_obj)ii" },
{ "set_style_line_opa", (void*) &lv_obj_set_style_line_opa, "", "(lv.lv_obj)ii" },
{ "set_style_line_rounded", (void*) &lv_obj_set_style_line_rounded, "", "(lv.lv_obj)ii" },
{ "set_style_line_width", (void*) &lv_obj_set_style_line_width, "", "(lv.lv_obj)ii" },
{ "set_style_max_height", (void*) &lv_obj_set_style_max_height, "", "(lv.lv_obj)ii" },
{ "set_style_max_width", (void*) &lv_obj_set_style_max_width, "", "(lv.lv_obj)ii" },
{ "set_style_min_height", (void*) &lv_obj_set_style_min_height, "", "(lv.lv_obj)ii" },
{ "set_style_min_width", (void*) &lv_obj_set_style_min_width, "", "(lv.lv_obj)ii" },
{ "set_style_opa", (void*) &lv_obj_set_style_opa, "", "(lv.lv_obj)ii" },
{ "set_style_outline_color", (void*) &lv_obj_set_style_outline_color, "", "(lv.lv_obj)(lv.lv_color)i" },
{ "set_style_outline_color_filtered", (void*) &lv_obj_set_style_outline_color_filtered, "", "(lv.lv_obj)(lv.lv_color)i" },
{ "set_style_outline_opa", (void*) &lv_obj_set_style_outline_opa, "", "(lv.lv_obj)ii" },
{ "set_style_outline_pad", (void*) &lv_obj_set_style_outline_pad, "", "(lv.lv_obj)ii" },
{ "set_style_outline_width", (void*) &lv_obj_set_style_outline_width, "", "(lv.lv_obj)ii" },
{ "set_style_pad_all", (void*) &lv_obj_set_style_pad_all, "", "(lv.lv_obj)ii" },
{ "set_style_pad_bottom", (void*) &lv_obj_set_style_pad_bottom, "", "(lv.lv_obj)ii" },
{ "set_style_pad_column", (void*) &lv_obj_set_style_pad_column, "", "(lv.lv_obj)ii" },
{ "set_style_pad_gap", (void*) &lv_obj_set_style_pad_gap, "", "(lv.lv_obj)ii" },
{ "set_style_pad_hor", (void*) &lv_obj_set_style_pad_hor, "", "(lv.lv_obj)ii" },
{ "set_style_pad_left", (void*) &lv_obj_set_style_pad_left, "", "(lv.lv_obj)ii" },
{ "set_style_pad_right", (void*) &lv_obj_set_style_pad_right, "", "(lv.lv_obj)ii" },
{ "set_style_pad_row", (void*) &lv_obj_set_style_pad_row, "", "(lv.lv_obj)ii" },
{ "set_style_pad_top", (void*) &lv_obj_set_style_pad_top, "", "(lv.lv_obj)ii" },
{ "set_style_pad_ver", (void*) &lv_obj_set_style_pad_ver, "", "(lv.lv_obj)ii" },
{ "set_style_radius", (void*) &lv_obj_set_style_radius, "", "(lv.lv_obj)ii" },
{ "set_style_shadow_color", (void*) &lv_obj_set_style_shadow_color, "", "(lv.lv_obj)(lv.lv_color)i" },
{ "set_style_shadow_color_filtered", (void*) &lv_obj_set_style_shadow_color_filtered, "", "(lv.lv_obj)(lv.lv_color)i" },
{ "set_style_shadow_ofs_x", (void*) &lv_obj_set_style_shadow_ofs_x, "", "(lv.lv_obj)ii" },
{ "set_style_shadow_ofs_y", (void*) &lv_obj_set_style_shadow_ofs_y, "", "(lv.lv_obj)ii" },
{ "set_style_shadow_opa", (void*) &lv_obj_set_style_shadow_opa, "", "(lv.lv_obj)ii" },
{ "set_style_shadow_spread", (void*) &lv_obj_set_style_shadow_spread, "", "(lv.lv_obj)ii" },
{ "set_style_shadow_width", (void*) &lv_obj_set_style_shadow_width, "", "(lv.lv_obj)ii" },
{ "set_style_size", (void*) &lv_obj_set_style_size, "", "(lv.lv_obj)ii" },
{ "set_style_text_align", (void*) &lv_obj_set_style_text_align, "", "(lv.lv_obj)ii" },
{ "set_style_text_color", (void*) &lv_obj_set_style_text_color, "", "(lv.lv_obj)(lv.lv_color)i" },
{ "set_style_text_color_filtered", (void*) &lv_obj_set_style_text_color_filtered, "", "(lv.lv_obj)(lv.lv_color)i" },
{ "set_style_text_decor", (void*) &lv_obj_set_style_text_decor, "", "(lv.lv_obj)ii" },
{ "set_style_text_font", (void*) &lv_obj_set_style_text_font, "", "(lv.lv_obj)(lv.lv_font)i" },
{ "set_style_text_letter_space", (void*) &lv_obj_set_style_text_letter_space, "", "(lv.lv_obj)ii" },
{ "set_style_text_line_space", (void*) &lv_obj_set_style_text_line_space, "", "(lv.lv_obj)ii" },
{ "set_style_text_opa", (void*) &lv_obj_set_style_text_opa, "", "(lv.lv_obj)ii" },
{ "set_style_transform_angle", (void*) &lv_obj_set_style_transform_angle, "", "(lv.lv_obj)ii" },
{ "set_style_transform_height", (void*) &lv_obj_set_style_transform_height, "", "(lv.lv_obj)ii" },
{ "set_style_transform_width", (void*) &lv_obj_set_style_transform_width, "", "(lv.lv_obj)ii" },
{ "set_style_transform_zoom", (void*) &lv_obj_set_style_transform_zoom, "", "(lv.lv_obj)ii" },
{ "set_style_transition", (void*) &lv_obj_set_style_transition, "", "(lv.lv_obj)(lv.lv_style_transition_dsc)i" },
{ "set_style_translate_x", (void*) &lv_obj_set_style_translate_x, "", "(lv.lv_obj)ii" },
{ "set_style_translate_y", (void*) &lv_obj_set_style_translate_y, "", "(lv.lv_obj)ii" },
{ "set_style_width", (void*) &lv_obj_set_style_width, "", "(lv.lv_obj)ii" },
{ "set_style_x", (void*) &lv_obj_set_style_x, "", "(lv.lv_obj)ii" },
{ "set_style_y", (void*) &lv_obj_set_style_y, "", "(lv.lv_obj)ii" },
{ "set_user_data", (void*) &lv_obj_set_user_data, "", "(lv.lv_obj)." },
{ "set_width", (void*) &lv_obj_set_width, "", "(lv.lv_obj)i" },
{ "set_x", (void*) &lv_obj_set_x, "", "(lv.lv_obj)i" },
@ -847,6 +870,7 @@ extern const bclass be_class_lv_chart;
extern const bclass be_class_lv_checkbox;
extern const bclass be_class_lv_color;
extern const bclass be_class_lv_colorwheel;
extern const bclass be_class_lv_disp;
extern const bclass be_class_lv_dropdown;
extern const bclass be_class_lv_font;
extern const bclass be_class_lv_group;
@ -866,6 +890,7 @@ extern const bclass be_class_lv_style;
extern const bclass be_class_lv_switch;
extern const bclass be_class_lv_table;
extern const bclass be_class_lv_textarea;
extern const bclass be_class_lv_theme;
// map of clases
@ -895,6 +920,7 @@ const lvbe_call_c_classes_t lv_classes[] = {
#ifdef BE_LV_WIDGET_COLORWHEEL
{ "lv_colorwheel", &be_class_lv_colorwheel, lv_colorwheel_func, sizeof(lv_colorwheel_func) / sizeof(lv_colorwheel_func[0]) },
#endif // BE_LV_WIDGET_COLORWHEEL
{ "lv_disp", &be_class_lv_disp, lv_disp_func, sizeof(lv_disp_func) / sizeof(lv_disp_func[0]) },
#ifdef BE_LV_WIDGET_DROPDOWN
{ "lv_dropdown", &be_class_lv_dropdown, lv_dropdown_func, sizeof(lv_dropdown_func) / sizeof(lv_dropdown_func[0]) },
#endif // BE_LV_WIDGET_DROPDOWN
@ -942,16 +968,19 @@ const lvbe_call_c_classes_t lv_classes[] = {
#ifdef BE_LV_WIDGET_TEXTAREA
{ "lv_textarea", &be_class_lv_textarea, lv_textarea_func, sizeof(lv_textarea_func) / sizeof(lv_textarea_func[0]) },
#endif // BE_LV_WIDGET_TEXTAREA
{ "lv_theme", &be_class_lv_theme, lv_theme_func, sizeof(lv_theme_func) / sizeof(lv_theme_func[0]) },
};
const size_t lv_classes_size = sizeof(lv_classes) / sizeof(lv_classes[0]);
/* `lv_style` methods */
/* `lv_font` methods */
/* `lv_color` methods */
/* `lv_theme` methods */
/* `lv_img` methods */
#ifdef BE_LV_WIDGET_IMG
int be_ntv_lv_img_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_img_create, "+lv.lv_img", "(lv.lv_obj)"); }
#endif // BE_LV_WIDGET_IMG
/* `lv_disp` methods */
/* `lv_obj` methods */
int be_ntv_lv_obj_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_obj_create, "+lv.lv_obj", "(lv.lv_obj)"); }
/* `lv_group` methods */
@ -1043,7 +1072,8 @@ const size_t lv_classes_size = sizeof(lv_classes) / sizeof(lv_classes[0]);
#endif // BE_LV_WIDGET_TEXTAREA
// create font either empty or from parameter on stack
int lvbe_font_create(bvm *vm) { return be_call_c_func(vm, NULL, "+lv_group", ""); }
int lvbe_font_create(bvm *vm) { return be_call_c_func(vm, NULL, "+lv_font", ""); }
int lvbe_theme_create(bvm *vm) { return be_call_c_func(vm, NULL, "+lv_theme", ""); }
#ifdef __cplusplus

View File

@ -97,6 +97,7 @@ return_types = {
"lv_img_src_t": "i",
"lv_colorwheel_mode_t": "i",
"lv_scr_load_anim_t": "i",
"lv_style_selector_t": "i",
"_lv_event_dsc_t *": "i",
@ -117,6 +118,9 @@ return_types = {
"lv_style_t *": "lv_style",
"lv_group_t *": "lv_group",
"lv_font_t *": "lv_font",
"lv_theme_t *": "lv_theme",
"lv_disp_t *": "lv_disp",
"lv_indev_t *": "lv_indev",
#"lv_disp_t*": "lv_disp",
#"lv_style_list_t*": "",
@ -137,10 +141,11 @@ lv_cb_types = ['lv_group_focus_cb', 'lv_event_cb',
]
# list of callback types that will need each a separate C callback
# For LVGL8, need to add synthetic lv_style, lv_font, lv_color
# For LVGL8, need to add synthetic lv_style, lv_font, lv_color, lv_theme
lv['style'] = []
lv['font'] = []
lv['color'] = []
lv['theme'] = []
# standard widgets
lv_widgets = ['arc', 'bar', 'btn', 'btnmatrix', 'canvas', 'checkbox',
@ -149,7 +154,7 @@ lv_widgets = ['arc', 'bar', 'btn', 'btnmatrix', 'canvas', 'checkbox',
# extra widgets
lv_widgets = lv_widgets + [ 'chart', 'colorwheel', 'imgbtn', 'led', 'meter', 'msgbox', 'spinbox' ]
lv_prefix = ['obj', 'group', 'style', 'indev', ] + lv_widgets
lv_prefix = ['obj', 'group', 'style', 'indev', 'disp'] + lv_widgets
def try_int(s):
try:
@ -383,7 +388,8 @@ for subtype, flv in lv.items():
print("""
// create font either empty or from parameter on stack
int lvbe_font_create(bvm *vm) { return be_call_c_func(vm, NULL, "+lv_group", ""); }
int lvbe_font_create(bvm *vm) { return be_call_c_func(vm, NULL, "+lv_font", ""); }
int lvbe_theme_create(bvm *vm) { return be_call_c_func(vm, NULL, "+lv_theme", ""); }
""")
print()
@ -425,6 +431,7 @@ extern int lvs_tostring(bvm *vm);
BE_EXPORT_VARIABLE extern const bclass be_class_lv_obj;
extern int lvbe_font_create(bvm *vm);
extern int lvbe_theme_create(bvm *vm);
""")
@ -521,6 +528,23 @@ be_local_class(lv_indev,
);
/*******************************************************************/
/********************************************************************
** Solidified class: lv_disp
********************************************************************/
be_local_class(lv_disp,
1,
NULL,
be_nested_map(4,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_nested_key("init", 380752755, 4, -1), be_const_func(lv0_init) },
{ be_nested_key("tostring", -1995258651, 8, -1), be_const_func(lvx_tostring) },
{ be_nested_key("_p", 1594591802, 2, -1), be_const_var(0) },
{ be_nested_key("member", 719708611, 6, 0), be_const_func(lvx_member) },
})),
(be_nested_const_str("lv_disp", 609712084, 8))
);
/*******************************************************************/
/********************************************************************
** Solidified class: lv_font
********************************************************************/
@ -537,6 +561,22 @@ be_local_class(lv_font,
);
/*******************************************************************/
/********************************************************************
** Solidified class: lv_theme
********************************************************************/
be_local_class(lv_theme,
1,
NULL,
be_nested_map(3,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_nested_key("init", 380752755, 4, -1), be_const_func(lvbe_theme_create) },
{ be_nested_key("tostring", -1995258651, 8, -1), be_const_func(lvx_tostring) },
{ be_nested_key("_p", 1594591802, 2, -1), be_const_var(0) },
})),
(be_nested_const_str("lv_theme", 1550958453, 7))
);
/*******************************************************************/
/********************************************************************
** Solidified class: lv_color
********************************************************************/
@ -603,6 +643,7 @@ print("""/********************************************************************
#include "lvgl.h"
#include "be_lvgl.h"
#include "lv_theme_openhasp.h"
extern int lv0_member(bvm *vm); // resolve virtual members
@ -721,7 +762,7 @@ be_local_module(lv,
{ be_nested_key("start", 1697318111, 5, 0), be_const_func(lv0_start) },
}))
);
BE_EXPORT_VARIABLE be_define_const_native_module(lv, NULL);
BE_EXPORT_VARIABLE be_define_const_native_module(lv);
#endif // USE_LVGL
""")

View File

@ -29,12 +29,26 @@ lv_coord_t lv_get_ver_res(void);
// ../../lib/libesp32_lvgl/LVGL8/src/core/lv_disp.h
lv_obj_t * lv_disp_get_scr_act(lv_disp_t * disp)
lv_obj_t * lv_disp_get_scr_prev(lv_disp_t * disp)
void lv_disp_load_scr(lv_obj_t * scr)
lv_obj_t * lv_disp_get_layer_top(lv_disp_t * disp)
lv_obj_t * lv_disp_get_layer_sys(lv_disp_t * disp)
void lv_disp_set_theme(lv_disp_t * disp, lv_theme_t * th)
lv_theme_t * lv_disp_get_theme(lv_disp_t * disp)
void lv_disp_set_bg_color(lv_disp_t * disp, lv_color_t color)
void lv_disp_set_bg_image(lv_disp_t * disp, const void * img_src)
void lv_disp_set_bg_opa(lv_disp_t * disp, lv_opa_t opa)
void lv_scr_load_anim(lv_obj_t * scr, lv_scr_load_anim_t anim_type, uint32_t time, uint32_t delay, bool auto_del)
uint32_t lv_disp_get_inactive_time(const lv_disp_t * disp)
void lv_disp_trig_activity(lv_disp_t * disp)
void lv_disp_clean_dcache(lv_disp_t * disp)
static inline lv_obj_t * lv_scr_act(void)
static inline lv_obj_t * lv_layer_top(void)
static inline lv_obj_t * lv_layer_sys(void)
static inline void lv_scr_load(lv_obj_t * scr)
static inline lv_coord_t lv_dpx(lv_coord_t n)
static inline lv_coord_t lv_disp_dpx(const lv_disp_t * disp, lv_coord_t n)
// ../../lib/libesp32_lvgl/LVGL8/src/core/lv_event.h
lv_res_t lv_event_send(struct _lv_obj_t * obj, lv_event_code_t event_code, void * param)
@ -483,6 +497,10 @@ void lv_draw_polygon(const lv_point_t points[], uint16_t point_cnt, const lv_are
// ../../lib/libesp32_lvgl/LVGL8/src/draw/lv_img_decoder.h
// ../../lib/libesp32_lvgl/LVGL8/src/extra/themes/default/lv_theme_default.h
lv_theme_t * lv_theme_default_init(lv_disp_t * disp, lv_color_t color_primary, lv_color_t color_secondary, bool dark, const lv_font_t * font)
bool lv_theme_default_is_inited(void)
// ../../lib/libesp32_lvgl/LVGL8/src/extra/widgets/chart/lv_chart.h
lv_obj_t * lv_chart_create(lv_obj_t * parent)
void lv_chart_set_type(lv_obj_t * obj, lv_chart_type_t type)
@ -899,3 +917,7 @@ void lv_textarea_cursor_left(lv_obj_t * obj)
void lv_textarea_cursor_down(lv_obj_t * obj)
void lv_textarea_cursor_up(lv_obj_t * obj)
// ../../lib/libesp32_lvgl/LVGL_assets/src/lv_theme_openhasp.h
lv_theme_t * lv_theme_openhasp_init(lv_disp_t * disp, lv_color_t color_primary, lv_color_t color_secondary, bool dark, const lv_font_t * font)
bool lv_theme_openhasp_is_inited(void)

View File

@ -59,6 +59,7 @@ lv_fun_globs = [
"extra/widgets/meter/*.h",
"extra/widgets/msgbox/*.h",
"extra/widgets/spinbox/*.h",
"extra/themes/default/*.h",
"core/*.h",
"draw/*.h",
"misc/lv_style_gen.h",
@ -66,6 +67,7 @@ lv_fun_globs = [
#"**/*.h",
]
headers_names = list_files(lv_src_prefix, lv_fun_globs)
headers_names += list_files("../../lib/libesp32_lvgl/LVGL_assets/src/", ["lv_theme_openhasp.h"])
# headers_names += ["lv_pre_style.h"] # for LVGL v7, add pre-generated style functions from C preprocessor
# unit test
@ -143,7 +145,7 @@ for header_name in headers_names:
"^lv_templ_",
"^lv_imgbtn_get_src_", # LV_IMGBTN_TILED == 0
"^lv_imgbtn_set_src_tiled",# !LV_IMGBTN_TILED
"^lv_disp_",
#"^lv_disp_",
"^lv_refr_get_fps_", # no LV_USE_PERF_MONITOR
"^lv_img_cache_",
"^lv_img_decoder_",