aboutsummaryrefslogtreecommitdiff
path: root/scripts/style_api_gen.py
diff options
context:
space:
mode:
authorembeddedt <42941056+embeddedt@users.noreply.github.com>2022-07-20 05:32:40 -0400
committerGitHub <noreply@github.com>2022-07-20 11:32:40 +0200
commitd6e5200013e9d661609aef3213c670d00f87cf70 (patch)
tree8ee5249d01c6609f19d7ffe99a59db6fbf117add /scripts/style_api_gen.py
parent9ed5b3fe067bb6d66d84b4b587a35b0a5200cb4e (diff)
downloadlvgl-d6e5200013e9d661609aef3213c670d00f87cf70.tar.gz
lvgl-d6e5200013e9d661609aef3213c670d00f87cf70.zip
refactor(style): store constant property IDs with a pointer instead of directly (#3506)
Diffstat (limited to 'scripts/style_api_gen.py')
-rwxr-xr-xscripts/style_api_gen.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/style_api_gen.py b/scripts/style_api_gen.py
index 5bcddede5..9b3644d86 100755
--- a/scripts/style_api_gen.py
+++ b/scripts/style_api_gen.py
@@ -401,12 +401,15 @@ 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("extern const lv_style_prop_t lv_style_const_prop_id_" + p['name'] + ";")
def local_style_set_c(p):
@@ -435,7 +438,7 @@ def style_const_set(p):
print("")
print("#define LV_STYLE_CONST_" + p['name'] + "(val) \\")
print(" { \\")
- print(" .prop = LV_STYLE_" + p['name'] + ", .value = { ." + p['style_type'] +" = " + cast + "val } \\")
+ print(" .prop_ptr = &lv_style_const_prop_id_" + p['name'] + ", .value = { ." + p['style_type'] +" = " + cast + "val } \\")
print(" }")