feat(style) add support for declaring styles in ROM (#2220)

Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
This commit is contained in:
embeddedt
2021-05-01 20:16:34 -04:00
committed by GitHub
parent b1f7d195db
commit e3b8b84d71
4 changed files with 772 additions and 17 deletions

View File

@@ -388,6 +388,17 @@ def local_style_set(p):
print("}")
print("")
def style_const_set(p):
cast = style_set_cast(p['style_type'])
print("#define LV_STYLE_CONST_" + p['name'] + "(val) \\")
print(" { \\")
print(" .prop = LV_STYLE_" + p['name'] + ", \\")
print(" .value = { \\")
print(" ." + p['style_type'] +" = " + cast + "val \\")
print(" } \\")
print(" }")
print("")
def docs(p):
@@ -430,6 +441,7 @@ sys.stdout = open(base_dir + '/../src/misc/lv_style_gen.h', 'w')
for p in props:
style_set(p)
style_const_set(p)
sys.stdout = open(base_dir + '/style_props.md', 'w')