mirror of
https://github.com/lvgl/lvgl.git
synced 2024-11-25 10:43:54 +08:00
fix: add guard macros to lv_style_gen.c,h and lv_obj_style_gen.c,h (#4450)
This commit is contained in:
parent
ea6d27682b
commit
dcffe24094
@ -502,34 +502,64 @@ def docs(p):
|
||||
base_dir = os.path.abspath(os.path.dirname(__file__))
|
||||
sys.stdout = open(base_dir + '/../src/core/lv_obj_style_gen.h', 'w')
|
||||
|
||||
|
||||
HEADING = f'''
|
||||
/*
|
||||
**********************************************************************
|
||||
* DO NOT EDIT
|
||||
* This file is automatically generated by "{os.path.split(__file__)[-1]}"
|
||||
**********************************************************************
|
||||
*/
|
||||
|
||||
'''
|
||||
|
||||
print(HEADING)
|
||||
print('#ifndef LV_OBJ_STYLE_GEN_H')
|
||||
print('#define LV_OBJ_STYLE_GEN_H')
|
||||
print()
|
||||
print("#include \"../misc/lv_area.h\"")
|
||||
print("#include \"../misc/lv_style.h\"")
|
||||
print("#include \"../core/lv_obj_style.h\"")
|
||||
print()
|
||||
for p in props:
|
||||
obj_style_get(p)
|
||||
|
||||
for p in props:
|
||||
local_style_set_h(p)
|
||||
|
||||
print()
|
||||
print('#endif /* LV_OBJ_STYLE_GEN_H */')
|
||||
|
||||
sys.stdout = open(base_dir + '/../src/core/lv_obj_style_gen.c', 'w')
|
||||
|
||||
print(HEADING)
|
||||
print("#include \"lv_obj.h\"")
|
||||
print()
|
||||
for p in props:
|
||||
local_style_set_c(p)
|
||||
|
||||
sys.stdout = open(base_dir + '/../src/misc/lv_style_gen.c', 'w')
|
||||
|
||||
print(HEADING)
|
||||
print("#include \"lv_style.h\"")
|
||||
print()
|
||||
for p in props:
|
||||
style_set_c(p)
|
||||
|
||||
sys.stdout = open(base_dir + '/../src/misc/lv_style_gen.h', 'w')
|
||||
|
||||
print(HEADING)
|
||||
print('#ifndef LV_STYLE_GEN_H')
|
||||
print('#define LV_STYLE_GEN_H')
|
||||
print()
|
||||
for p in props:
|
||||
style_set_h(p)
|
||||
|
||||
for p in props:
|
||||
style_const_set(p)
|
||||
print()
|
||||
print('#endif /* LV_STYLE_GEN_H */')
|
||||
|
||||
|
||||
sys.stdout = open(base_dir + '/../docs/overview/style-props.md', 'w')
|
||||
|
||||
|
@ -1,5 +1,15 @@
|
||||
|
||||
/*
|
||||
**********************************************************************
|
||||
* DO NOT EDIT
|
||||
* This file is automatically generated by "style_api_gen.py"
|
||||
**********************************************************************
|
||||
*/
|
||||
|
||||
|
||||
#include "lv_obj.h"
|
||||
|
||||
|
||||
void lv_obj_set_style_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
|
@ -1,6 +1,19 @@
|
||||
|
||||
/*
|
||||
**********************************************************************
|
||||
* DO NOT EDIT
|
||||
* This file is automatically generated by "style_api_gen.py"
|
||||
**********************************************************************
|
||||
*/
|
||||
|
||||
|
||||
#ifndef LV_OBJ_STYLE_GEN_H
|
||||
#define LV_OBJ_STYLE_GEN_H
|
||||
|
||||
#include "../misc/lv_area.h"
|
||||
#include "../misc/lv_style.h"
|
||||
#include "../core/lv_obj_style.h"
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_width(const struct _lv_obj_t * obj, uint32_t part)
|
||||
{
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_WIDTH);
|
||||
@ -695,3 +708,5 @@ void lv_obj_set_style_transition(struct _lv_obj_t * obj, const lv_style_transiti
|
||||
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);
|
||||
|
||||
#endif /* LV_OBJ_STYLE_GEN_H */
|
||||
|
@ -1,5 +1,15 @@
|
||||
|
||||
/*
|
||||
**********************************************************************
|
||||
* DO NOT EDIT
|
||||
* This file is automatically generated by "style_api_gen.py"
|
||||
**********************************************************************
|
||||
*/
|
||||
|
||||
|
||||
#include "lv_style.h"
|
||||
|
||||
|
||||
void lv_style_set_width(lv_style_t * style, lv_coord_t value)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
|
@ -1,3 +1,15 @@
|
||||
|
||||
/*
|
||||
**********************************************************************
|
||||
* DO NOT EDIT
|
||||
* This file is automatically generated by "style_api_gen.py"
|
||||
**********************************************************************
|
||||
*/
|
||||
|
||||
|
||||
#ifndef LV_STYLE_GEN_H
|
||||
#define LV_STYLE_GEN_H
|
||||
|
||||
void lv_style_set_width(lv_style_t * style, lv_coord_t value);
|
||||
extern const lv_style_prop_t _lv_style_const_prop_id_WIDTH;
|
||||
void lv_style_set_min_width(lv_style_t * style, lv_coord_t value);
|
||||
@ -621,3 +633,5 @@ extern const lv_style_prop_t _lv_style_const_prop_id_BASE_DIR;
|
||||
{ \
|
||||
.prop_ptr = &_lv_style_const_prop_id_BASE_DIR, .value = { .num = (int32_t)val } \
|
||||
}
|
||||
|
||||
#endif /* LV_STYLE_GEN_H */
|
||||
|
Loading…
Reference in New Issue
Block a user