refactor(API): don't expose private symbols in lvgl.h. phase-out "_lv*" names (#6068)
Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
This commit is contained in:
@@ -89,7 +89,7 @@ fout.write(
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LV_COLOR_DEPTH
|
||||
#define _LV_KCONFIG_PRESENT
|
||||
#define LV_KCONFIG_PRESENT
|
||||
#endif
|
||||
|
||||
/*----------------------------------
|
||||
@@ -131,7 +131,7 @@ for line in fin.read().splitlines():
|
||||
|
||||
fout.write(
|
||||
f'{indent}#ifndef {name}\n'
|
||||
f'{indent} #ifdef _LV_KCONFIG_PRESENT\n'
|
||||
f'{indent} #ifdef LV_KCONFIG_PRESENT\n'
|
||||
f'{indent} #ifdef CONFIG_{name.upper()}\n'
|
||||
f'{indent} #define {name} CONFIG_{name.upper()}\n'
|
||||
f'{indent} #else\n'
|
||||
@@ -175,7 +175,7 @@ LV_EXPORT_CONST_INT(LV_DRAW_BUF_STRIDE_ALIGN);
|
||||
LV_EXPORT_CONST_INT(LV_DRAW_BUF_ALIGN);
|
||||
#endif
|
||||
|
||||
#undef _LV_KCONFIG_PRESENT
|
||||
#undef LV_KCONFIG_PRESENT
|
||||
|
||||
/*Set some defines if a dependency is disabled*/
|
||||
#if LV_USE_LOG == 0
|
||||
|
||||
@@ -492,7 +492,7 @@ def obj_style_get(p):
|
||||
if 'filtered' in p and p['filtered']:
|
||||
print("static inline " + p['var_type'] + " lv_obj_get_style_" + p['name'].lower() +"_filtered(const lv_obj_t * obj, lv_part_t part)")
|
||||
print("{")
|
||||
print(" lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_" + p['name'] + "));")
|
||||
print(" lv_style_value_t v = lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_" + p['name'] + "));")
|
||||
print(" return " + cast + "v." + p['style_type'] + ";")
|
||||
print("}")
|
||||
print("")
|
||||
@@ -518,15 +518,12 @@ def style_set_c(p):
|
||||
print(" };")
|
||||
print(" lv_style_set_prop(style, LV_STYLE_" + p['name'] +", v);")
|
||||
print("}")
|
||||
print("")
|
||||
print("const lv_style_prop_t _lv_style_const_prop_id_" + p['name'] + " = LV_STYLE_" + p['name'] + ";")
|
||||
|
||||
|
||||
def style_set_h(p):
|
||||
if 'section' in p: return
|
||||
|
||||
print("void lv_style_set_" + p['name'].lower() +"(lv_style_t * style, "+ p['var_type'] +" value);")
|
||||
print("LV_ATTRIBUTE_EXTERN_DATA extern const lv_style_prop_t _lv_style_const_prop_id_" + p['name'] + ";")
|
||||
|
||||
|
||||
def local_style_set_c(p):
|
||||
@@ -555,7 +552,7 @@ def style_const_set(p):
|
||||
print("")
|
||||
print("#define LV_STYLE_CONST_" + p['name'] + "(val) \\")
|
||||
print(" { \\")
|
||||
print(" .prop_ptr = &_lv_style_const_prop_id_" + p['name'] + ", .value = { ." + p['style_type'] +" = " + cast + "val } \\")
|
||||
print(" .prop = LV_STYLE_" + p['name'] + ", .value = { ." + p['style_type'] +" = " + cast + "val } \\")
|
||||
print(" }")
|
||||
|
||||
|
||||
@@ -643,6 +640,7 @@ extern "C" {
|
||||
print("#include \"../misc/lv_area.h\"")
|
||||
print("#include \"../misc/lv_style.h\"")
|
||||
print("#include \"../core/lv_obj_style.h\"")
|
||||
print("#include \"../misc/lv_types.h\"")
|
||||
print()
|
||||
|
||||
guard = ""
|
||||
|
||||
Reference in New Issue
Block a user