docs(style): output the style properties to style-props.rst (#5802)

This commit is contained in:
Gabor Kiss-Vamosi
2024-03-10 07:46:40 +01:00
committed by GitHub
parent 5971c33e45
commit 7a59cd15ec
9 changed files with 966 additions and 5268 deletions

View File

@@ -18,7 +18,7 @@ jobs:
with:
repository: szepeviktor/astyle
path: astyle
ref: v3.4.10
ref: v3.4.12
- name: Install astyle
run: |
cd astyle/build/gcc/

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -558,7 +558,9 @@ def style_const_set(p):
def docs(p):
if "section" in p:
print("")
print("## " + p['section'])
print(p['section'])
print("-" * len(p['section']))
print("")
print(p['dsc'])
return
@@ -575,14 +577,20 @@ def docs(p):
e = "No"
if p["ext_draw"]: e = "Yes"
li_style = "style='display:inline; margin-right: 20px; margin-left: 0px"
li_style = "style='display:inline-block; margin-right: 20px; margin-left: 0px"
dsc = p['dsc']
print("")
print("### " + p["name"].lower())
print(p["name"].lower())
print("~" * len(p["name"].lower()))
print("")
print(dsc)
print("")
print(".. raw:: html")
print("")
print(" <ul>")
print(" <li " + li_style + "'><strong>Default</strong> " + d + "</li>")
print(" <li " + li_style + "'><strong>Inherited</strong> " + i + "</li>")
@@ -597,7 +605,7 @@ def guard_proc(p):
guard_close()
if 'guard' in p:
guard = p['guard']
print(f"#if {guard}\n")
print(f"#if {guard}")
def guard_close():
global guard
@@ -684,8 +692,11 @@ guard_close()
print()
print('#endif /* LV_STYLE_GEN_H */')
sys.stdout = open(base_dir + '/../docs/overview/style-props.md', 'w')
sys.stdout = open(base_dir + '/../docs/overview/style-props.rst', 'w')
print('================')
print('Style properties')
print('================')
print('# Style properties')
for p in props:
docs(p)

View File

@@ -690,7 +690,8 @@ void lv_obj_set_style_opa_layered(lv_obj_t * obj, lv_opa_t value, lv_style_selec
lv_obj_set_local_style_prop(obj, LV_STYLE_OPA_LAYERED, v, selector);
}
void lv_obj_set_style_color_filter_dsc(lv_obj_t * obj, const lv_color_filter_dsc_t * value, lv_style_selector_t selector)
void lv_obj_set_style_color_filter_dsc(lv_obj_t * obj, const lv_color_filter_dsc_t * value,
lv_style_selector_t selector)
{
lv_style_value_t v = {
.ptr = value
@@ -763,7 +764,6 @@ void lv_obj_set_style_bitmap_mask_src(lv_obj_t * obj, const lv_image_dsc_t * val
}
#if LV_USE_FLEX
void lv_obj_set_style_flex_flow(lv_obj_t * obj, lv_flex_flow_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
@@ -807,7 +807,6 @@ void lv_obj_set_style_flex_grow(lv_obj_t * obj, uint8_t value, lv_style_selector
#if LV_USE_GRID
void lv_obj_set_style_grid_column_dsc_array(lv_obj_t * obj, const int32_t * value, lv_style_selector_t selector)
{
lv_style_value_t v = {

View File

@@ -226,7 +226,8 @@ static inline lv_color_t lv_obj_get_style_bg_grad_color(const lv_obj_t * obj, ui
static inline lv_color_t lv_obj_get_style_bg_grad_color_filtered(const lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_BG_GRAD_COLOR));
lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part,
LV_STYLE_BG_GRAD_COLOR));
return v.color;
}
@@ -286,7 +287,8 @@ static inline lv_color_t lv_obj_get_style_bg_image_recolor(const lv_obj_t * obj,
static inline lv_color_t lv_obj_get_style_bg_image_recolor_filtered(const lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_BG_IMAGE_RECOLOR));
lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part,
LV_STYLE_BG_IMAGE_RECOLOR));
return v.color;
}
@@ -310,7 +312,8 @@ static inline lv_color_t lv_obj_get_style_border_color(const lv_obj_t * obj, uin
static inline lv_color_t lv_obj_get_style_border_color_filtered(const lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_BORDER_COLOR));
lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part,
LV_STYLE_BORDER_COLOR));
return v.color;
}
@@ -352,7 +355,8 @@ static inline lv_color_t lv_obj_get_style_outline_color(const lv_obj_t * obj, ui
static inline lv_color_t lv_obj_get_style_outline_color_filtered(const lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_OUTLINE_COLOR));
lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part,
LV_STYLE_OUTLINE_COLOR));
return v.color;
}
@@ -400,7 +404,8 @@ static inline lv_color_t lv_obj_get_style_shadow_color(const lv_obj_t * obj, uin
static inline lv_color_t lv_obj_get_style_shadow_color_filtered(const lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_COLOR));
lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part,
LV_STYLE_SHADOW_COLOR));
return v.color;
}
@@ -424,7 +429,8 @@ static inline lv_color_t lv_obj_get_style_image_recolor(const lv_obj_t * obj, ui
static inline lv_color_t lv_obj_get_style_image_recolor_filtered(const lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_IMAGE_RECOLOR));
lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part,
LV_STYLE_IMAGE_RECOLOR));
return v.color;
}
@@ -639,7 +645,6 @@ static inline const lv_image_dsc_t * lv_obj_get_style_bitmap_mask_src(const lv_o
}
#if LV_USE_FLEX
static inline lv_flex_flow_t lv_obj_get_style_flex_flow(const lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_FLEX_FLOW);
@@ -673,7 +678,6 @@ static inline uint8_t lv_obj_get_style_flex_grow(const lv_obj_t * obj, uint32_t
#endif /*LV_USE_FLEX*/
#if LV_USE_GRID
static inline const int32_t * lv_obj_get_style_grid_column_dsc_array(const lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_COLUMN_DSC_ARRAY);
@@ -821,7 +825,8 @@ void lv_obj_set_style_radius(lv_obj_t * obj, int32_t value, lv_style_selector_t
void lv_obj_set_style_clip_corner(lv_obj_t * obj, bool value, lv_style_selector_t selector);
void lv_obj_set_style_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_opa_layered(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_color_filter_dsc(lv_obj_t * obj, const lv_color_filter_dsc_t * value, lv_style_selector_t selector);
void lv_obj_set_style_color_filter_dsc(lv_obj_t * obj, const lv_color_filter_dsc_t * value,
lv_style_selector_t selector);
void lv_obj_set_style_color_filter_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_anim(lv_obj_t * obj, const lv_anim_t * value, lv_style_selector_t selector);
void lv_obj_set_style_anim_duration(lv_obj_t * obj, uint32_t value, lv_style_selector_t selector);
@@ -831,7 +836,6 @@ void lv_obj_set_style_layout(lv_obj_t * obj, uint16_t value, lv_style_selector_t
void lv_obj_set_style_base_dir(lv_obj_t * obj, lv_base_dir_t value, lv_style_selector_t selector);
void lv_obj_set_style_bitmap_mask_src(lv_obj_t * obj, const lv_image_dsc_t * value, lv_style_selector_t selector);
#if LV_USE_FLEX
void lv_obj_set_style_flex_flow(lv_obj_t * obj, lv_flex_flow_t value, lv_style_selector_t selector);
void lv_obj_set_style_flex_main_place(lv_obj_t * obj, lv_flex_align_t value, lv_style_selector_t selector);
void lv_obj_set_style_flex_cross_place(lv_obj_t * obj, lv_flex_align_t value, lv_style_selector_t selector);
@@ -840,7 +844,6 @@ void lv_obj_set_style_flex_grow(lv_obj_t * obj, uint8_t value, lv_style_selector
#endif /*LV_USE_FLEX*/
#if LV_USE_GRID
void lv_obj_set_style_grid_column_dsc_array(lv_obj_t * obj, const int32_t * value, lv_style_selector_t selector);
void lv_obj_set_style_grid_column_align(lv_obj_t * obj, lv_grid_align_t value, lv_style_selector_t selector);
void lv_obj_set_style_grid_row_dsc_array(lv_obj_t * obj, const int32_t * value, lv_style_selector_t selector);

View File

@@ -6,8 +6,10 @@
**********************************************************************
*/
#include "lv_style.h"
void lv_style_set_width(lv_style_t * style, int32_t value)
{
lv_style_value_t v = {
@@ -1102,3 +1104,4 @@ void lv_style_set_grid_cell_row_span(lv_style_t * style, int32_t value)
const lv_style_prop_t _lv_style_const_prop_id_GRID_CELL_ROW_SPAN = LV_STYLE_GRID_CELL_ROW_SPAN;
#endif /*LV_USE_GRID*/

View File

@@ -6,6 +6,7 @@
**********************************************************************
*/
#ifndef LV_STYLE_GEN_H
#define LV_STYLE_GEN_H
@@ -198,7 +199,6 @@ LV_ATTRIBUTE_EXTERN_DATA extern const lv_style_prop_t _lv_style_const_prop_id_BA
void lv_style_set_bitmap_mask_src(lv_style_t * style, const lv_image_dsc_t * value);
LV_ATTRIBUTE_EXTERN_DATA extern const lv_style_prop_t _lv_style_const_prop_id_BITMAP_MASK_SRC;
#if LV_USE_FLEX
void lv_style_set_flex_flow(lv_style_t * style, lv_flex_flow_t value);
LV_ATTRIBUTE_EXTERN_DATA extern const lv_style_prop_t _lv_style_const_prop_id_FLEX_FLOW;
void lv_style_set_flex_main_place(lv_style_t * style, lv_flex_align_t value);
@@ -212,7 +212,6 @@ LV_ATTRIBUTE_EXTERN_DATA extern const lv_style_prop_t _lv_style_const_prop_id_BI
#endif /*LV_USE_FLEX*/
#if LV_USE_GRID
void lv_style_set_grid_column_dsc_array(lv_style_t * style, const int32_t * value);
LV_ATTRIBUTE_EXTERN_DATA extern const lv_style_prop_t _lv_style_const_prop_id_GRID_COLUMN_DSC_ARRAY;
void lv_style_set_grid_column_align(lv_style_t * style, lv_grid_align_t value);
@@ -235,6 +234,7 @@ LV_ATTRIBUTE_EXTERN_DATA extern const lv_style_prop_t _lv_style_const_prop_id_BI
LV_ATTRIBUTE_EXTERN_DATA extern const lv_style_prop_t _lv_style_const_prop_id_GRID_CELL_ROW_SPAN;
#endif /*LV_USE_GRID*/
#define LV_STYLE_CONST_WIDTH(val) \
{ \
.prop_ptr = &_lv_style_const_prop_id_WIDTH, .value = { .num = (int32_t)val } \
@@ -785,4 +785,5 @@ LV_ATTRIBUTE_EXTERN_DATA extern const lv_style_prop_t _lv_style_const_prop_id_BI
}
#endif /*LV_USE_GRID*/
#endif /* LV_STYLE_GEN_H */