mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-29 22:56:58 +08:00
refactoring and fixes
This commit is contained in:
+87
-83
@@ -1,90 +1,90 @@
|
||||
props = [
|
||||
{'name': 'RADIUS', 'style_type': '_int', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'CLIP_CORNER', 'style_type': '_int', 'var_type': 'bool' },
|
||||
{'name': 'TRANSFORM_WIDTH', 'style_type': '_int', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'TRANSFORM_HEIGHT', 'style_type': '_int', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'TRANSFORM_ZOOM', 'style_type': '_int', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'TRANSFORM_ANGLE', 'style_type': '_int', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'OPA', 'style_type': '_int', 'var_type': 'lv_opa_t' },
|
||||
{'name': 'COLOR_FILTER_CB', 'style_type': '_func', 'var_type': 'lv_color_filter_cb_t' },
|
||||
{'name': 'COLOR_FILTER_OPA', 'style_type': '_int', 'var_type': 'lv_opa_t' },
|
||||
{'name': 'PAD_TOP', 'style_type': '_int', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'PAD_BOTTOM', 'style_type': '_int', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'PAD_LEFT', 'style_type': '_int', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'PAD_RIGHT', 'style_type': '_int', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'MARGIN_TOP', 'style_type': '_int', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'MARGIN_BOTTOM', 'style_type': '_int', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'MARGIN_LEFT', 'style_type': '_int', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'MARGIN_RIGHT', 'style_type': '_int', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'BG_COLOR', 'style_type': '_color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'BG_COLOR_FILTERED', 'style_type': '_color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'BG_OPA', 'style_type': '_int', 'var_type': 'lv_opa_t' },
|
||||
{'name': 'BG_GRAD_COLOR', 'style_type': '_color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'BG_GRAD_COLOR_FILTERED', 'style_type': '_color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'BG_GRAD_DIR', 'style_type': '_int', 'var_type': 'lv_grad_dir_t' },
|
||||
{'name': 'BG_BLEND_MODE', 'style_type': '_int', 'var_type': 'lv_blend_mode_t' },
|
||||
{'name': 'BG_MAIN_STOP', 'style_type': '_int', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'BG_GRAD_STOP', 'style_type': '_int', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'BORDER_COLOR', 'style_type': '_color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'BORDER_COLOR_FILTERED', 'style_type': '_color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'BORDER_OPA', 'style_type': '_int', 'var_type': 'lv_opa_t' },
|
||||
{'name': 'BORDER_WIDTH', 'style_type': '_int', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'BORDER_SIDE', 'style_type': '_int', 'var_type': 'lv_border_side_t' },
|
||||
{'name': 'BORDER_POST', 'style_type': '_int', 'var_type': 'bool' },
|
||||
{'name': 'BORDER_BLEND_MODE', 'style_type': '_int', 'var_type': 'lv_blend_mode_t' },
|
||||
{'name': 'TEXT_COLOR', 'style_type': '_color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'TEXT_COLOR_FILTERED', 'style_type': '_color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'TEXT_OPA', 'style_type': '_int', 'var_type': 'lv_opa_t' },
|
||||
{'name': 'TEXT_FONT', 'style_type': '_ptr', 'var_type': 'const lv_font_t *' },
|
||||
{'name': 'TEXT_LETTER_SPACE', 'style_type': '_int', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'TEXT_LINE_SPACE', 'style_type': '_int', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'TEXT_DECOR', 'style_type': '_int', 'var_type': 'lv_text_decor_t' },
|
||||
{'name': 'TEXT_BLEND_MODE', 'style_type': '_int', 'var_type': 'lv_blend_mode_t' },
|
||||
{'name': 'IMG_OPA', 'style_type': '_int', 'var_type': 'lv_opa_t' },
|
||||
{'name': 'IMG_BLEND_MODE', 'style_type': '_int', 'var_type': 'lv_blend_mode_t' },
|
||||
{'name': 'IMG_RECOLOR', 'style_type': '_color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'IMG_RECOLOR_FILTERED', 'style_type': '_color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'IMG_RECOLOR_OPA', 'style_type': '_int', 'var_type': 'lv_opa_t' },
|
||||
{'name': 'OUTLINE_WIDTH', 'style_type': '_int', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'OUTLINE_COLOR', 'style_type': '_color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'OUTLINE_COLOR_FILTERED', 'style_type': '_color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'OUTLINE_OPA', 'style_type': '_int', 'var_type': 'lv_opa_t' },
|
||||
{'name': 'OUTLINE_PAD', 'style_type': '_int', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'OUTLINE_BLEND_MODE', 'style_type': '_int', 'var_type': 'lv_blend_mode_t' },
|
||||
{'name': 'SHADOW_WIDTH', 'style_type': '_int', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'SHADOW_OFS_X', 'style_type': '_int', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'SHADOW_OFS_Y', 'style_type': '_int', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'SHADOW_SPREAD', 'style_type': '_int', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'SHADOW_BLEND_MODE', 'style_type': '_int', 'var_type': 'lv_blend_mode_t' },
|
||||
{'name': 'SHADOW_COLOR', 'style_type': '_color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'SHADOW_COLOR_FILTERED', 'style_type': '_color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'SHADOW_OPA', 'style_type': '_int', 'var_type': 'lv_opa_t' },
|
||||
{'name': 'LINE_WIDTH', 'style_type': '_int', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'LINE_BLEND_MODE', 'style_type': '_int', 'var_type': 'lv_blend_mode_t' },
|
||||
{'name': 'LINE_DASH_WIDTH', 'style_type': '_int', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'LINE_DASH_GAP', 'style_type': '_int', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'LINE_ROUNDED', 'style_type': '_int', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'LINE_COLOR', 'style_type': '_color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'LINE_COLOR_FILTERED', 'style_type': '_color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'LINE_OPA', 'style_type': '_int', 'var_type': 'lv_opa_t' },
|
||||
{'name': 'CONTENT_SRC', 'style_type': '_ptr', 'var_type': 'const char *' },
|
||||
{'name': 'CONTENT_ALIGN', 'style_type': '_int', 'var_type': 'lv_align_t' },
|
||||
{'name': 'CONTENT_OFS_X', 'style_type': '_int', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'CONTENT_OFS_Y', 'style_type': '_int', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'TRANSITION_TIME', 'style_type': '_int', 'var_type': 'uint16_t' },
|
||||
{'name': 'TRANSITION_DELAY', 'style_type': '_int', 'var_type': 'uint16_t' },
|
||||
{'name': 'TRANSITION_PATH', 'style_type': '_ptr', 'var_type': 'const lv_anim_path_t *' },
|
||||
{'name': 'TRANSITION_PROP_1', 'style_type': '_int', 'var_type': 'lv_style_prop_t' },
|
||||
{'name': 'TRANSITION_PROP_2', 'style_type': '_int', 'var_type': 'lv_style_prop_t' },
|
||||
{'name': 'TRANSITION_PROP_3', 'style_type': '_int', 'var_type': 'lv_style_prop_t' },
|
||||
{'name': 'TRANSITION_PROP_4', 'style_type': '_int', 'var_type': 'lv_style_prop_t' },
|
||||
{'name': 'TRANSITION_PROP_5', 'style_type': '_int', 'var_type': 'lv_style_prop_t' },
|
||||
{'name': 'TRANSITION_PROP_6', 'style_type': '_int', 'var_type': 'lv_style_prop_t' }
|
||||
{'name': 'RADIUS', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'CLIP_CORNER', 'style_type': 'num', 'var_type': 'bool' },
|
||||
{'name': 'TRANSFORM_WIDTH', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'TRANSFORM_HEIGHT', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'TRANSFORM_ZOOM', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'TRANSFORM_ANGLE', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'OPA', 'style_type': 'num', 'var_type': 'lv_opa_t' },
|
||||
{'name': 'COLOR_FILTER_CB', 'style_type': 'func', 'var_type': 'lv_color_filter_cb_t' },
|
||||
{'name': 'COLOR_FILTER_OPA', 'style_type': 'num', 'var_type': 'lv_opa_t' },
|
||||
{'name': 'ANIM_TIME', 'style_type': 'num', 'var_type': 'uint32_t' },
|
||||
{'name': 'TRANSITION', 'style_type': 'ptr', 'var_type': 'const lv_style_transition_t *' },
|
||||
{'name': 'SIZE', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'BLEND_MODE', 'style_type': 'num', 'var_type': 'lv_blend_mode_t' },
|
||||
{'name': 'PAD_TOP', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'PAD_BOTTOM', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'PAD_LEFT', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'PAD_RIGHT', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'PAD_ROW', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'PAD_COLUMN', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'BG_COLOR', 'style_type': 'color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'BG_COLOR_FILTERED', 'style_type': 'color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'BG_OPA', 'style_type': 'num', 'var_type': 'lv_opa_t' },
|
||||
{'name': 'BG_GRAD_COLOR', 'style_type': 'color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'BG_GRAD_COLOR_FILTERED', 'style_type': 'color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'BG_GRAD_DIR', 'style_type': 'num', 'var_type': 'lv_grad_dir_t' },
|
||||
{'name': 'BG_MAIN_STOP', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'BG_GRAD_STOP', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'BG_IMG_SRC', 'style_type': 'ptr', 'var_type': 'const void *' },
|
||||
{'name': 'BG_IMG_OPA', 'style_type': 'num', 'var_type': 'lv_opa_t' },
|
||||
{'name': 'BG_IMG_RECOLOR', 'style_type': 'color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'BG_IMG_RECOLOR_FILTERED', 'style_type': 'color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'BG_IMG_RECOLOR_OPA', 'style_type': 'num', 'var_type': 'lv_opa_t' },
|
||||
{'name': 'BG_IMG_TILED', 'style_type': 'num', 'var_type': 'bool' },
|
||||
{'name': 'BORDER_COLOR', 'style_type': 'color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'BORDER_COLOR_FILTERED', 'style_type': 'color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'BORDER_OPA', 'style_type': 'num', 'var_type': 'lv_opa_t' },
|
||||
{'name': 'BORDER_WIDTH', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'BORDER_SIDE', 'style_type': 'num', 'var_type': 'lv_border_side_t' },
|
||||
{'name': 'BORDER_POST', 'style_type': 'num', 'var_type': 'bool' },
|
||||
{'name': 'TEXT_COLOR', 'style_type': 'color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'TEXT_COLOR_FILTERED', 'style_type': 'color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'TEXT_OPA', 'style_type': 'num', 'var_type': 'lv_opa_t' },
|
||||
{'name': 'TEXT_FONT', 'style_type': 'ptr', 'var_type': 'const lv_font_t *' },
|
||||
{'name': 'TEXT_LETTER_SPACE', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'TEXT_LINE_SPACE', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'TEXT_DECOR', 'style_type': 'num', 'var_type': 'lv_text_decor_t' },
|
||||
{'name': 'TEXT_ALIGN', 'style_type': 'num', 'var_type': 'lv_text_align_t' },
|
||||
{'name': 'IMG_OPA', 'style_type': 'num', 'var_type': 'lv_opa_t' },
|
||||
{'name': 'IMG_RECOLOR', 'style_type': 'color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'IMG_RECOLOR_FILTERED', 'style_type': 'color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'IMG_RECOLOR_OPA', 'style_type': 'num', 'var_type': 'lv_opa_t' },
|
||||
{'name': 'OUTLINE_WIDTH', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'OUTLINE_COLOR', 'style_type': 'color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'OUTLINE_COLOR_FILTERED', 'style_type': 'color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'OUTLINE_OPA', 'style_type': 'num', 'var_type': 'lv_opa_t' },
|
||||
{'name': 'OUTLINE_PAD', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'SHADOW_WIDTH', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'SHADOW_OFS_X', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'SHADOW_OFS_Y', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'SHADOW_SPREAD', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'SHADOW_COLOR', 'style_type': 'color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'SHADOW_COLOR_FILTERED', 'style_type': 'color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'SHADOW_OPA', 'style_type': 'num', 'var_type': 'lv_opa_t' },
|
||||
{'name': 'LINE_WIDTH', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'LINE_DASH_WIDTH', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'LINE_DASH_GAP', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'LINE_ROUNDED', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'LINE_COLOR', 'style_type': 'color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'LINE_COLOR_FILTERED', 'style_type': 'color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'LINE_OPA', 'style_type': 'num', 'var_type': 'lv_opa_t' },
|
||||
{'name': 'CONTENT_TEXT', 'style_type': 'ptr', 'var_type': 'const char *' },
|
||||
{'name': 'CONTENT_ALIGN', 'style_type': 'num', 'var_type': 'lv_align_t' },
|
||||
{'name': 'CONTENT_OFS_X', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'CONTENT_OFS_Y', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'CONTENT_OPA', 'style_type': 'num', 'var_type': 'lv_opa_t' },
|
||||
{'name': 'CONTENT_FONT', 'style_type': 'ptr', 'var_type': 'const lv_font_t *' },
|
||||
{'name': 'CONTENT_COLOR', 'style_type': 'color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'CONTENT_COLOR_FILTERED', 'style_type': 'color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'CONTENT_LETTER_SPACE', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'CONTENT_LINE_SPACE', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||
{'name': 'CONTENT_DECOR', 'style_type': 'num', 'var_type': 'lv_text_decor_t' },
|
||||
]
|
||||
|
||||
def obj_style_get(i):
|
||||
print("static inline " + props[i]['var_type'] + " lv_obj_get_style_" + props[i]['name'].lower() +"(const struct _lv_obj_t * obj, uint32_t part) {")
|
||||
print(" lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_" + props[i]['name'] + "); return v." + props[i][ 'style_type'] + "; }")
|
||||
print(" lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_" + props[i]['name'] + "); return (" + props[i]['var_type'] + ") v." + props[i]['style_type'] + "; }")
|
||||
print("")
|
||||
|
||||
|
||||
@@ -96,4 +96,8 @@ def style_set(i):
|
||||
|
||||
|
||||
for i in range(len(props)):
|
||||
obj_style_get(i)
|
||||
style_set(i)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -318,7 +318,7 @@ uint32_t lv_disp_get_inactive_time(const lv_disp_t * disp)
|
||||
d = lv_disp_get_next(NULL);
|
||||
while(d) {
|
||||
uint32_t elaps = lv_tick_elaps(d->last_activity_time);
|
||||
t = LV_MATH_MIN(t, elaps);
|
||||
t = LV_MIN(t, elaps);
|
||||
d = lv_disp_get_next(d);
|
||||
}
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@ static inline void lv_scr_load(lv_obj_t * scr)
|
||||
* 1 dip is 2 px on a 320 DPI screen
|
||||
* https://stackoverflow.com/questions/2025282/what-is-the-difference-between-px-dip-dp-and-sp
|
||||
*/
|
||||
#define LV_DPX(n) (n == 0 ? 0 :LV_MATH_MAX((( lv_disp_get_dpi(NULL) * (n) + 80) / 160), 1)) /*+80 for rounding*/
|
||||
#define LV_DPX(n) (n == 0 ? 0 :LV_MAX((( lv_disp_get_dpi(NULL) * (n) + 80) / 160), 1)) /*+80 for rounding*/
|
||||
|
||||
static inline lv_coord_t lv_dpx(lv_coord_t n)
|
||||
{
|
||||
|
||||
@@ -80,7 +80,7 @@ const lv_flex_t lv_flex_even = {
|
||||
|
||||
void lv_flex_init(lv_flex_t * flex)
|
||||
{
|
||||
_lv_memset_00(flex, sizeof(lv_flex_t));
|
||||
lv_memset_00(flex, sizeof(lv_flex_t));
|
||||
flex->update_cb = flex_update;
|
||||
flex->dir = LV_FLEX_FLOW_ROW;
|
||||
flex->item_main_place = LV_FLEX_PLACE_START;
|
||||
@@ -197,6 +197,11 @@ static int32_t find_track_end(lv_obj_t * cont, int32_t item_start_id, lv_coord_t
|
||||
const lv_flex_t * f = cont->spec_attr->layout_dsc;
|
||||
|
||||
bool row = f->dir == LV_FLEX_FLOW_ROW ? true : false;
|
||||
bool wrap = f->wrap;
|
||||
/*Can't wrap if the size if auto (i.e. the size depends on the children)*/
|
||||
if(wrap && ((row && cont->w_set == LV_SIZE_AUTO) || (!row && cont->h_set == LV_SIZE_AUTO))) {
|
||||
wrap = false;
|
||||
}
|
||||
lv_coord_t(*get_main_size)(const lv_obj_t *) = (row ? lv_obj_get_width : lv_obj_get_height);
|
||||
lv_coord_t(*get_cross_size)(const lv_obj_t *) = (!row ? lv_obj_get_width : lv_obj_get_height);
|
||||
|
||||
@@ -217,10 +222,10 @@ static int32_t find_track_end(lv_obj_t * cont, int32_t item_start_id, lv_coord_t
|
||||
grow_item_cnt++;
|
||||
} else {
|
||||
lv_coord_t item_size = get_main_size(item) + item_gap;
|
||||
if(f->wrap && t->track_main_size + item_size > max_main_size) break;
|
||||
if(wrap && t->track_main_size + item_size > max_main_size) break;
|
||||
t->track_main_size += item_size;
|
||||
}
|
||||
t->track_cross_size = LV_MATH_MAX(get_cross_size(item), t->track_cross_size);
|
||||
t->track_cross_size = LV_MAX(get_cross_size(item), t->track_cross_size);
|
||||
|
||||
item_id += f->rev ? -1 : +1;
|
||||
item = lv_obj_get_child(cont, item_id);
|
||||
|
||||
+11
-11
@@ -50,7 +50,7 @@ static lv_coord_t grid_place(lv_coord_t cont_size, bool auto_size, uint8_t plac
|
||||
|
||||
void lv_grid_init(lv_grid_t * grid)
|
||||
{
|
||||
_lv_memset_00(grid,sizeof(lv_grid_t));
|
||||
lv_memset_00(grid,sizeof(lv_grid_t));
|
||||
grid->update_cb = grid_update;
|
||||
grid->col_place = LV_GRID_START;
|
||||
grid->row_place = LV_GRID_START;
|
||||
@@ -105,7 +105,7 @@ static void full_refresh(lv_obj_t * cont)
|
||||
|
||||
|
||||
item_repos_hint_t hint;
|
||||
_lv_memset_00(&hint, sizeof(hint));
|
||||
lv_memset_00(&hint, sizeof(hint));
|
||||
|
||||
/* Calculate the grids absolute x and y coordinates.
|
||||
* It will be used as helper during item repositioning to avoid calculating this value for every children*/
|
||||
@@ -158,7 +158,7 @@ static void calc(struct _lv_obj_t * cont, _lv_grid_calc_t * calc_out)
|
||||
if(g->col_dsc_len == 0 || g->row_dsc_len == 0) return;
|
||||
|
||||
if(lv_obj_get_child(cont, 0) == NULL) {
|
||||
_lv_memset_00(calc_out, sizeof(_lv_grid_calc_t));
|
||||
lv_memset_00(calc_out, sizeof(_lv_grid_calc_t));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -186,10 +186,10 @@ static void calc(struct _lv_obj_t * cont, _lv_grid_calc_t * calc_out)
|
||||
*/
|
||||
static void calc_free(_lv_grid_calc_t * calc)
|
||||
{
|
||||
_lv_mem_buf_release(calc->x);
|
||||
_lv_mem_buf_release(calc->y);
|
||||
_lv_mem_buf_release(calc->w);
|
||||
_lv_mem_buf_release(calc->h);
|
||||
lv_mem_buf_release(calc->x);
|
||||
lv_mem_buf_release(calc->y);
|
||||
lv_mem_buf_release(calc->w);
|
||||
lv_mem_buf_release(calc->h);
|
||||
}
|
||||
|
||||
static void calc_cols(lv_obj_t * cont, _lv_grid_calc_t * c)
|
||||
@@ -200,8 +200,8 @@ static void calc_cols(lv_obj_t * cont, _lv_grid_calc_t * c)
|
||||
lv_coord_t cont_w = lv_obj_get_width_fit(cont);
|
||||
|
||||
c->col_num = grid->col_dsc_len;
|
||||
c->x = _lv_mem_buf_get(sizeof(lv_coord_t) * c->col_num);
|
||||
c->w = _lv_mem_buf_get(sizeof(lv_coord_t) * c->col_num);
|
||||
c->x = lv_mem_buf_get(sizeof(lv_coord_t) * c->col_num);
|
||||
c->w = lv_mem_buf_get(sizeof(lv_coord_t) * c->col_num);
|
||||
|
||||
uint32_t col_fr_cnt = 0;
|
||||
lv_coord_t grid_w = 0;
|
||||
@@ -238,8 +238,8 @@ static void calc_rows(lv_obj_t * cont, _lv_grid_calc_t * c)
|
||||
uint32_t i;
|
||||
|
||||
c->row_num = grid->row_dsc_len;
|
||||
c->y = _lv_mem_buf_get(sizeof(lv_coord_t) * c->row_num);
|
||||
c->h = _lv_mem_buf_get(sizeof(lv_coord_t) * c->row_num);
|
||||
c->y = lv_mem_buf_get(sizeof(lv_coord_t) * c->row_num);
|
||||
c->h = lv_mem_buf_get(sizeof(lv_coord_t) * c->row_num);
|
||||
|
||||
uint32_t row_fr_cnt = 0;
|
||||
lv_coord_t grid_h = 0;
|
||||
|
||||
@@ -72,7 +72,7 @@ lv_group_t * lv_group_create(void)
|
||||
group->wrap = 1;
|
||||
|
||||
#if LV_USE_USER_DATA
|
||||
_lv_memset_00(&group->user_data, sizeof(lv_group_user_data_t));
|
||||
lv_memset_00(&group->user_data, sizeof(lv_group_user_data_t));
|
||||
#endif
|
||||
|
||||
return group;
|
||||
|
||||
@@ -1191,8 +1191,8 @@ void indev_gesture(lv_indev_proc_t * proc)
|
||||
if(gesture_obj == NULL) return;
|
||||
|
||||
|
||||
if((LV_MATH_ABS(proc->types.pointer.vect.x) < indev_act->driver.gesture_min_velocity) &&
|
||||
(LV_MATH_ABS(proc->types.pointer.vect.y) < indev_act->driver.gesture_min_velocity)) {
|
||||
if((LV_ABS(proc->types.pointer.vect.x) < indev_act->driver.gesture_min_velocity) &&
|
||||
(LV_ABS(proc->types.pointer.vect.y) < indev_act->driver.gesture_min_velocity)) {
|
||||
proc->types.pointer.gesture_sum.x = 0;
|
||||
proc->types.pointer.gesture_sum.y = 0;
|
||||
}
|
||||
@@ -1201,12 +1201,12 @@ void indev_gesture(lv_indev_proc_t * proc)
|
||||
proc->types.pointer.gesture_sum.x += proc->types.pointer.vect.x;
|
||||
proc->types.pointer.gesture_sum.y += proc->types.pointer.vect.y;
|
||||
|
||||
if((LV_MATH_ABS(proc->types.pointer.gesture_sum.x) > indev_act->driver.gesture_limit) ||
|
||||
(LV_MATH_ABS(proc->types.pointer.gesture_sum.y) > indev_act->driver.gesture_limit)) {
|
||||
if((LV_ABS(proc->types.pointer.gesture_sum.x) > indev_act->driver.gesture_limit) ||
|
||||
(LV_ABS(proc->types.pointer.gesture_sum.y) > indev_act->driver.gesture_limit)) {
|
||||
|
||||
proc->types.pointer.gesture_sent = 1;
|
||||
|
||||
if(LV_MATH_ABS(proc->types.pointer.gesture_sum.x) > LV_MATH_ABS(proc->types.pointer.gesture_sum.y)) {
|
||||
if(LV_ABS(proc->types.pointer.gesture_sum.x) > LV_ABS(proc->types.pointer.gesture_sum.y)) {
|
||||
if(proc->types.pointer.gesture_sum.x > 0)
|
||||
proc->types.pointer.gesture_dir = LV_GESTURE_DIR_RIGHT;
|
||||
else
|
||||
|
||||
@@ -268,7 +268,7 @@ static lv_obj_t * find_scroll_obj(lv_indev_proc_t * proc)
|
||||
/*Decide if it's a horizontal or vertical scroll*/
|
||||
bool hor_en = false;
|
||||
bool ver_en = false;
|
||||
if(LV_MATH_ABS(proc->types.pointer.scroll_sum.x) > LV_MATH_ABS(proc->types.pointer.scroll_sum.y)) {
|
||||
if(LV_ABS(proc->types.pointer.scroll_sum.x) > LV_ABS(proc->types.pointer.scroll_sum.y)) {
|
||||
hor_en = true;
|
||||
}
|
||||
else {
|
||||
@@ -436,7 +436,7 @@ static lv_coord_t find_snap_point_x(const lv_obj_t * obj, lv_coord_t min, lv_coo
|
||||
x_child += ofs;
|
||||
if(x_child >= min && x_child <= max) {
|
||||
lv_coord_t x = x_child - x_parent;
|
||||
if(LV_MATH_ABS(x) < LV_MATH_ABS(dist)) dist = x;
|
||||
if(LV_ABS(x) < LV_ABS(dist)) dist = x;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -483,7 +483,7 @@ static lv_coord_t find_snap_point_y(const lv_obj_t * obj, lv_coord_t min, lv_coo
|
||||
y_child += ofs;
|
||||
if(y_child >= min && y_child <= max) {
|
||||
lv_coord_t y = y_child - y_parent;
|
||||
if(LV_MATH_ABS(y) < LV_MATH_ABS(dist)) dist = y;
|
||||
if(LV_ABS(y) < LV_ABS(dist)) dist = y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+19
-29
@@ -85,7 +85,7 @@ static void lv_obj_destructor(lv_obj_t * obj);
|
||||
**********************/
|
||||
static bool lv_initialized = false;
|
||||
static lv_event_temp_data_t * event_temp_data_head;
|
||||
static const void * event_act_data;
|
||||
static void * event_act_data;
|
||||
const lv_obj_class_t lv_obj = {
|
||||
.constructor = lv_obj_constructor,
|
||||
.destructor = lv_obj_destructor,
|
||||
@@ -117,7 +117,7 @@ void lv_init(void)
|
||||
LV_LOG_TRACE("lv_init started");
|
||||
|
||||
/*Initialize the lv_misc modules*/
|
||||
_lv_mem_init();
|
||||
lv_mem_init();
|
||||
|
||||
_lv_timer_core_init();
|
||||
|
||||
@@ -193,7 +193,7 @@ void lv_deinit(void)
|
||||
_lv_gc_clear_roots();
|
||||
|
||||
lv_disp_set_default(NULL);
|
||||
_lv_mem_deinit();
|
||||
lv_mem_deinit();
|
||||
lv_initialized = false;
|
||||
|
||||
LV_LOG_INFO("lv_deinit done");
|
||||
@@ -225,7 +225,7 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, const lv_obj_t * copy)
|
||||
lv_obj_t * lv_obj_create_from_class(const lv_obj_class_t * class, lv_obj_t * parent, const lv_obj_t * copy)
|
||||
{
|
||||
lv_obj_t * obj = lv_mem_alloc(class->instance_size);
|
||||
_lv_memset_00(obj, class->instance_size);
|
||||
lv_memset_00(obj, class->instance_size);
|
||||
obj->class_p = class;
|
||||
|
||||
class->constructor(obj, parent, copy);
|
||||
@@ -482,13 +482,10 @@ void lv_obj_set_parent(lv_obj_t * obj, lv_obj_t * parent)
|
||||
old_parent->spec_attr->children = NULL;
|
||||
}
|
||||
|
||||
/*Add the child to the new parent*/
|
||||
/*Add the child to the new parent as the last (newest child)*/
|
||||
parent->spec_attr->child_cnt++;
|
||||
parent->spec_attr->children = lv_mem_realloc(parent->spec_attr->children, parent->spec_attr->child_cnt * (sizeof(lv_obj_t *)));
|
||||
for(i = lv_obj_get_child_cnt(parent) - 1; i > 0 ; i--) {
|
||||
parent->spec_attr->children[i] = parent->spec_attr->children[i - 1];
|
||||
}
|
||||
parent->spec_attr->children[0] = obj;
|
||||
parent->spec_attr->children[lv_obj_get_child_cnt(parent) - 1] = obj;
|
||||
|
||||
obj->parent = parent;
|
||||
|
||||
@@ -584,7 +581,7 @@ void lv_obj_set_ext_click_area(lv_obj_t * obj, lv_coord_t left, lv_coord_t right
|
||||
obj->spec_attr->ext_click_pad.y2 = bottom;
|
||||
#elif LV_USE_EXT_CLICK_AREA == LV_EXT_CLICK_AREA_TINY
|
||||
if(obj->spec_attr == NULL) lv_obj_allocate_spec_attr(obj);
|
||||
obj->spec_attr->ext_click_pad = LV_MATH_MAX4(left, right, top, bottom);
|
||||
obj->spec_attr->ext_click_pad = LV_MAX4(left, right, top, bottom);
|
||||
#else
|
||||
LV_UNUSED(obj);
|
||||
LV_UNUSED(left);
|
||||
@@ -687,8 +684,8 @@ void lv_obj_set_state(lv_obj_t * obj, lv_state_t new_state)
|
||||
/*If there is no difference in styles there is nothing else to do*/
|
||||
if(cmp_res == _LV_STYLE_STATE_CMP_SAME) return;
|
||||
|
||||
trans_set_t * ts = _lv_mem_buf_get(sizeof(trans_set_t) * STYLE_TRANSITION_MAX);
|
||||
_lv_memset_00(ts, sizeof(sizeof(trans_set_t) * 64));
|
||||
trans_set_t * ts = lv_mem_buf_get(sizeof(trans_set_t) * STYLE_TRANSITION_MAX);
|
||||
lv_memset_00(ts, sizeof(sizeof(trans_set_t) * 64));
|
||||
uint32_t tsi = 0;
|
||||
uint32_t i;
|
||||
for(i = 0; i < obj->style_list.style_cnt && tsi < STYLE_TRANSITION_MAX; i++) {
|
||||
@@ -698,7 +695,7 @@ void lv_obj_set_state(lv_obj_t * obj, lv_state_t new_state)
|
||||
|
||||
lv_style_value_t v;
|
||||
if(lv_style_get_prop(obj_style->style, LV_STYLE_TRANSITION, &v) == false) continue;
|
||||
const lv_style_transiton_t * tr = v.ptr;
|
||||
const lv_style_transition_t * tr = v.ptr;
|
||||
|
||||
/*Add the props t the set is not added yet or added but with smaller weight*/
|
||||
uint32_t j;
|
||||
@@ -725,7 +722,7 @@ void lv_obj_set_state(lv_obj_t * obj, lv_state_t new_state)
|
||||
_lv_obj_create_style_transition(obj, ts[i].prop, ts[i].part, prev_state, new_state, ts[i].time, ts[i].delay, ts[i].path);
|
||||
}
|
||||
|
||||
_lv_mem_buf_release(ts);
|
||||
lv_mem_buf_release(ts);
|
||||
|
||||
if(cmp_res == _LV_STYLE_STATE_CMP_DIFF_LAYOUT) _lv_obj_refresh_style(obj, LV_STYLE_PROP_ALL);
|
||||
else if(cmp_res == _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD) _lv_obj_refresh_ext_draw_pad(obj);
|
||||
@@ -953,7 +950,7 @@ lv_obj_spec_attr_t * lv_obj_allocate_spec_attr(lv_obj_t * obj)
|
||||
LV_ASSERT_MEM(obj->spec_attr);
|
||||
if(obj->spec_attr == NULL) return NULL;
|
||||
|
||||
_lv_memset_00(obj->spec_attr, sizeof(lv_obj_spec_attr_t));
|
||||
lv_memset_00(obj->spec_attr, sizeof(lv_obj_spec_attr_t));
|
||||
|
||||
obj->spec_attr->scroll_dir = LV_DIR_ALL;
|
||||
obj->spec_attr->base_dir = LV_BIDI_DIR_INHERIT;
|
||||
@@ -1496,7 +1493,7 @@ static void lv_obj_constructor(lv_obj_t * obj, lv_obj_t * parent, const lv_obj_t
|
||||
obj->flags = copy->flags;
|
||||
if(copy->spec_attr) {
|
||||
lv_obj_allocate_spec_attr(obj);
|
||||
_lv_memcpy_small(obj->spec_attr, copy->spec_attr, sizeof(lv_obj_spec_attr_t));
|
||||
lv_memcpy_small(obj->spec_attr, copy->spec_attr, sizeof(lv_obj_spec_attr_t));
|
||||
obj->spec_attr->children = NULL; /*Make the child list empty*/
|
||||
}
|
||||
#if LV_USE_GROUP
|
||||
@@ -1564,8 +1561,9 @@ static lv_draw_res_t lv_obj_draw(lv_obj_t * obj, const lv_area_t * clip_area, lv
|
||||
|
||||
if(lv_obj_get_style_bg_opa(obj, LV_PART_MAIN) < LV_OPA_MAX) return LV_DRAW_RES_NOT_COVER;
|
||||
|
||||
if(lv_obj_get_style_bg_blend_mode(obj, LV_PART_MAIN) != LV_BLEND_MODE_NORMAL) return LV_DRAW_RES_NOT_COVER;
|
||||
if(lv_obj_get_style_border_blend_mode(obj, LV_PART_MAIN) != LV_BLEND_MODE_NORMAL) return LV_DRAW_RES_NOT_COVER;
|
||||
#if LV_USE_BLEND_MODES
|
||||
if(lv_obj_get_style_blend_mode(obj, LV_PART_MAIN) != LV_BLEND_MODE_NORMAL) return LV_DRAW_RES_NOT_COVER;
|
||||
#endif
|
||||
if(lv_obj_get_style_opa(obj, LV_PART_MAIN) < LV_OPA_MAX) return LV_DRAW_RES_NOT_COVER;
|
||||
|
||||
return LV_DRAW_RES_COVER;
|
||||
@@ -1590,30 +1588,22 @@ static lv_draw_res_t lv_obj_draw(lv_obj_t * obj, const lv_area_t * clip_area, lv
|
||||
coords.y1 -= h;
|
||||
coords.y2 += h;
|
||||
|
||||
lv_obj_draw_hook_dsc_t hook_dsc;
|
||||
lv_obj_draw_hook_dsc_init(&hook_dsc, clip_area);
|
||||
hook_dsc.draw_area = &coords;
|
||||
hook_dsc.part = LV_PART_MAIN;
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &hook_dsc);
|
||||
|
||||
lv_draw_rect(&coords, clip_area, &draw_dsc);
|
||||
|
||||
if(lv_obj_get_style_clip_corner(obj, LV_PART_MAIN)) {
|
||||
lv_draw_mask_radius_param_t * mp = _lv_mem_buf_get(sizeof(lv_draw_mask_radius_param_t));
|
||||
lv_draw_mask_radius_param_t * mp = lv_mem_buf_get(sizeof(lv_draw_mask_radius_param_t));
|
||||
lv_coord_t r = lv_obj_get_style_radius(obj, LV_PART_MAIN);
|
||||
lv_draw_mask_radius_init(mp, &obj->coords, r, false);
|
||||
/*Add the mask and use `obj+8` as custom id. Don't use `obj` directly because it might be used by the user*/
|
||||
lv_draw_mask_add(mp, obj + 8);
|
||||
}
|
||||
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &hook_dsc);
|
||||
}
|
||||
else if(mode == LV_DRAW_MODE_POST_DRAW) {
|
||||
_lv_obj_draw_scrollbar(obj, clip_area);
|
||||
|
||||
if(lv_obj_get_style_clip_corner(obj, LV_PART_MAIN)) {
|
||||
lv_draw_mask_radius_param_t * param = lv_draw_mask_remove_custom(obj + 8);
|
||||
_lv_mem_buf_release(param);
|
||||
lv_mem_buf_release(param);
|
||||
}
|
||||
|
||||
/*If the border is drawn later disable loading other properties*/
|
||||
@@ -1833,7 +1823,7 @@ static lv_res_t lv_obj_signal(lv_obj_t * obj, lv_signal_t sign, void * param)
|
||||
else if(sign == LV_SIGNAL_REFR_EXT_DRAW_PAD) {
|
||||
lv_coord_t * s = param;
|
||||
lv_coord_t d = _lv_obj_get_draw_rect_ext_pad_size(obj, LV_PART_MAIN);
|
||||
*s = LV_MATH_MAX(*s, d);
|
||||
*s = LV_MAX(*s, d);
|
||||
}
|
||||
else if(sign == LV_SIGNAL_STYLE_CHG) {
|
||||
/* Padding might have changed so the layout should be recalculated*/
|
||||
|
||||
@@ -257,23 +257,6 @@ enum {
|
||||
LV_PART_ITEMS,
|
||||
LV_PART_MARKER,
|
||||
LV_PART_CURSOR, //combine with marker?
|
||||
|
||||
LV_PART_CUSTOM_1,
|
||||
LV_PART_CUSTOM_2,
|
||||
LV_PART_CUSTOM_3,
|
||||
LV_PART_CUSTOM_4,
|
||||
LV_PART_CUSTOM_5,
|
||||
LV_PART_CUSTOM_6,
|
||||
LV_PART_CUSTOM_7,
|
||||
LV_PART_CUSTOM_8,
|
||||
LV_PART_CUSTOM_9,
|
||||
LV_PART_CUSTOM_10,
|
||||
LV_PART_CUSTOM_11,
|
||||
LV_PART_CUSTOM_12,
|
||||
LV_PART_CUSTOM_13,
|
||||
LV_PART_CUSTOM_14,
|
||||
LV_PART_CUSTOM_15,
|
||||
LV_PART_CUSTOM_16,
|
||||
};
|
||||
|
||||
typedef uint8_t lv_part_t;
|
||||
|
||||
+101
-79
@@ -65,6 +65,10 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, uint8_t part, lv_draw_rect_dsc_t
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_BLEND_MODES
|
||||
draw_dsc->blend_mode = lv_obj_get_style_blend_mode(obj, part);
|
||||
#endif
|
||||
|
||||
if(draw_dsc->bg_opa != LV_OPA_TRANSP) {
|
||||
draw_dsc->bg_opa = lv_obj_get_style_bg_opa(obj, part);
|
||||
if(draw_dsc->bg_opa > LV_OPA_MIN) {
|
||||
@@ -75,10 +79,6 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, uint8_t part, lv_draw_rect_dsc_t
|
||||
draw_dsc->bg_main_color_stop = lv_obj_get_style_bg_main_stop(obj, part);
|
||||
draw_dsc->bg_grad_color_stop = lv_obj_get_style_bg_grad_stop(obj, part);
|
||||
}
|
||||
|
||||
#if LV_USE_BLEND_MODES
|
||||
draw_dsc->bg_blend_mode = lv_obj_get_style_bg_blend_mode(obj, part);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,9 +90,6 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, uint8_t part, lv_draw_rect_dsc_t
|
||||
draw_dsc->border_side = lv_obj_get_style_border_side(obj, part);
|
||||
draw_dsc->border_color = lv_obj_get_style_border_color_filtered(obj, part);
|
||||
}
|
||||
#if LV_USE_BLEND_MODES
|
||||
draw_dsc->border_blend_mode = lv_obj_get_style_border_blend_mode(obj, part);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,44 +102,37 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, uint8_t part, lv_draw_rect_dsc_t
|
||||
draw_dsc->outline_pad = lv_obj_get_style_outline_pad(obj, part);
|
||||
draw_dsc->outline_color = lv_obj_get_style_outline_color(obj, part);
|
||||
}
|
||||
#if LV_USE_BLEND_MODES
|
||||
draw_dsc->outline_blend_mode = lv_obj_get_style_outline_blend_mode(obj, part);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if(draw_dsc->bg_img_opa != LV_OPA_TRANSP) {
|
||||
draw_dsc->bg_img_src = lv_obj_get_style_bg_img_src(obj, part);
|
||||
if(draw_dsc->bg_img_src) {
|
||||
// draw_dsc->bg_img_opa = lv_obj_get_style_bg_img_opa(obj, part); //TODO
|
||||
if(draw_dsc->bg_img_opa > LV_OPA_MIN) {
|
||||
draw_dsc->bg_img_recolor = lv_obj_get_style_bg_img_recolor(obj, part);
|
||||
draw_dsc->bg_img_recolor_opa = lv_obj_get_style_bg_img_recolor_opa(obj, part);
|
||||
draw_dsc->bg_img_tiled = lv_obj_get_style_bg_img_tiled(obj, part);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if LV_USE_PATTERN
|
||||
if(draw_dsc->content_opa != LV_OPA_TRANSP) {
|
||||
draw_dsc->content_src = lv_obj_get_style_content_src(obj, part);
|
||||
if(draw_dsc->content_src) {
|
||||
draw_dsc->content_ofs_y = lv_obj_get_style_content_ofs_y(obj, part);
|
||||
draw_dsc->content_ofs_x = lv_obj_get_style_content_ofs_x(obj, part);
|
||||
draw_dsc->content_align = lv_obj_get_style_content_align(obj, part);
|
||||
draw_dsc->content_text = lv_obj_get_style_content_text(obj, part);
|
||||
if(draw_dsc->content_text) {
|
||||
|
||||
if(lv_img_src_get_type(draw_dsc->content_src) == LV_IMG_SRC_SYMBOL) {
|
||||
draw_dsc->content_opa = lv_obj_get_style_text_opa(obj, part);
|
||||
if(draw_dsc->content_opa > LV_OPA_MIN) {
|
||||
draw_dsc->content_font = lv_obj_get_style_text_font(obj, part);
|
||||
draw_dsc->content_color = lv_obj_get_style_text_color(obj, part);
|
||||
draw_dsc->content_letter_space = lv_obj_get_style_text_letter_space(obj, part);
|
||||
draw_dsc->content_line_space = lv_obj_get_style_text_line_space(obj, part);
|
||||
#if LV_USE_BLEND_MODES
|
||||
draw_dsc->content_blend_mode = lv_obj_get_style_text_blend_mode(obj, part);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else {
|
||||
draw_dsc->content_opa = lv_obj_get_style_img_opa(obj, part);
|
||||
if(draw_dsc->content_opa > LV_OPA_MIN) {
|
||||
draw_dsc->content_color = lv_obj_get_style_img_recolor(obj, part);
|
||||
draw_dsc->content_recolor_opa = lv_obj_get_style_img_recolor_opa(obj, part);
|
||||
|
||||
#if LV_USE_BLEND_MODES
|
||||
draw_dsc->content_blend_mode = lv_obj_get_style_img_blend_mode(obj, part);
|
||||
#endif
|
||||
}
|
||||
draw_dsc->content_opa = lv_obj_get_style_content_opa(obj, part);
|
||||
if(draw_dsc->content_opa > LV_OPA_MIN) {
|
||||
draw_dsc->content_ofs_y = lv_obj_get_style_content_ofs_y(obj, part);
|
||||
draw_dsc->content_ofs_x = lv_obj_get_style_content_ofs_x(obj, part);
|
||||
draw_dsc->content_align = lv_obj_get_style_content_align(obj, part);
|
||||
draw_dsc->content_font = lv_obj_get_style_content_font(obj, part);
|
||||
draw_dsc->content_color = lv_obj_get_style_content_color_filtered(obj, part);
|
||||
draw_dsc->content_letter_space = lv_obj_get_style_content_letter_space(obj, part);
|
||||
draw_dsc->content_line_space = lv_obj_get_style_content_line_space(obj, part);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -160,9 +150,6 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, uint8_t part, lv_draw_rect_dsc_t
|
||||
draw_dsc->shadow_ofs_y = lv_obj_get_style_shadow_ofs_y(obj, part);
|
||||
draw_dsc->shadow_spread = lv_obj_get_style_shadow_spread(obj, part);
|
||||
draw_dsc->shadow_color = lv_obj_get_style_shadow_color(obj, part);
|
||||
#if LV_USE_BLEND_MODES
|
||||
draw_dsc->shadow_blend_mode = lv_obj_get_style_shadow_blend_mode(obj, part);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -210,7 +197,7 @@ void lv_obj_init_draw_label_dsc(lv_obj_t * obj, uint8_t part, lv_draw_label_dsc_
|
||||
draw_dsc->line_space = lv_obj_get_style_text_line_space(obj, part);
|
||||
draw_dsc->decor = lv_obj_get_style_text_decor(obj, part);
|
||||
#if LV_USE_BLEND_MODES
|
||||
draw_dsc->blend_mode = lv_obj_get_style_text_blend_mode(obj, part);
|
||||
draw_dsc->blend_mode = lv_obj_get_style_blend_mode(obj, part);
|
||||
#endif
|
||||
|
||||
draw_dsc->font = lv_obj_get_style_text_font(obj, part);
|
||||
@@ -245,29 +232,29 @@ void lv_obj_init_draw_label_dsc(lv_obj_t * obj, uint8_t part, lv_draw_label_dsc_
|
||||
*/
|
||||
void lv_obj_init_draw_img_dsc(lv_obj_t * obj, uint8_t part, lv_draw_img_dsc_t * draw_dsc)
|
||||
{
|
||||
// draw_dsc->opa = lv_obj_get_style_image_opa(obj, part);
|
||||
// if(draw_dsc->opa <= LV_OPA_MIN) return;
|
||||
//
|
||||
//#if LV_USE_OPA_SCALE
|
||||
// lv_opa_t opa_scale = lv_obj_get_style_opa_scale(obj, part);
|
||||
// if(opa_scale < LV_OPA_MAX) {
|
||||
// draw_dsc->opa = (uint16_t)((uint16_t)draw_dsc->opa * opa_scale) >> 8;
|
||||
// }
|
||||
// if(draw_dsc->opa <= LV_OPA_MIN) return;
|
||||
//#endif
|
||||
//
|
||||
// draw_dsc->angle = 0;
|
||||
// draw_dsc->zoom = LV_IMG_ZOOM_NONE;
|
||||
// draw_dsc->pivot.x = lv_area_get_width(&obj->coords) / 2;
|
||||
// draw_dsc->pivot.y = lv_area_get_height(&obj->coords) / 2;
|
||||
//
|
||||
// draw_dsc->recolor_opa = lv_obj_get_style_image_recolor_opa(obj, part);
|
||||
// if(draw_dsc->recolor_opa > 0) {
|
||||
// draw_dsc->recolor = lv_obj_get_style_image_recolor(obj, part);
|
||||
// }
|
||||
//#if LV_USE_BLEND_MODES
|
||||
// draw_dsc->blend_mode = lv_obj_get_style_image_blend_mode(obj, part);
|
||||
//#endif
|
||||
draw_dsc->opa = lv_obj_get_style_img_opa(obj, part);
|
||||
if(draw_dsc->opa <= LV_OPA_MIN) return;
|
||||
|
||||
#if LV_USE_OPA_SCALE
|
||||
lv_opa_t opa_scale = lv_obj_get_style_opa(obj, part);
|
||||
if(opa_scale < LV_OPA_MAX) {
|
||||
draw_dsc->opa = (uint16_t)((uint16_t)draw_dsc->opa * opa_scale) >> 8;
|
||||
}
|
||||
if(draw_dsc->opa <= LV_OPA_MIN) return;
|
||||
#endif
|
||||
|
||||
draw_dsc->angle = 0;
|
||||
draw_dsc->zoom = LV_IMG_ZOOM_NONE;
|
||||
draw_dsc->pivot.x = lv_area_get_width(&obj->coords) / 2;
|
||||
draw_dsc->pivot.y = lv_area_get_height(&obj->coords) / 2;
|
||||
|
||||
draw_dsc->recolor_opa = lv_obj_get_style_img_recolor_opa(obj, part);
|
||||
if(draw_dsc->recolor_opa > 0) {
|
||||
draw_dsc->recolor = lv_obj_get_style_img_recolor(obj, part);
|
||||
}
|
||||
#if LV_USE_BLEND_MODES
|
||||
draw_dsc->blend_mode = lv_obj_get_style_blend_mode(obj, part);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -306,10 +293,45 @@ void lv_obj_init_draw_line_dsc(lv_obj_t * obj, uint8_t part, lv_draw_line_dsc_t
|
||||
draw_dsc->round_end = draw_dsc->round_start;
|
||||
|
||||
#if LV_USE_BLEND_MODES
|
||||
draw_dsc->blend_mode = lv_obj_get_style_line_blend_mode(obj, part);
|
||||
draw_dsc->blend_mode = lv_obj_get_style_blend_mode(obj, part);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize a line draw descriptor from an object's styles in its current state
|
||||
* @param obj pointer to an object
|
||||
* @param type type of style. E.g. `LV_LINE_PART_MAIN`
|
||||
* @param draw_dsc the descriptor the initialize.
|
||||
* If the `opa` filed is set to or the property is equal to `LV_OPA_TRANSP` the rest won't be initialized.
|
||||
* Should be initialized with `lv_draw_line_dsc_init(draw_dsc)`.
|
||||
*/
|
||||
void lv_obj_init_draw_arc_dsc(lv_obj_t * obj, uint8_t part, lv_draw_arc_dsc_t * draw_dsc)
|
||||
{
|
||||
draw_dsc->width = lv_obj_get_style_line_width(obj, part);
|
||||
if(draw_dsc->width == 0) return;
|
||||
|
||||
draw_dsc->opa = lv_obj_get_style_line_opa(obj, part);
|
||||
if(draw_dsc->opa <= LV_OPA_MIN) return;
|
||||
|
||||
#if LV_USE_OPA_SCALE
|
||||
lv_opa_t opa = lv_obj_get_style_opa(obj, part);
|
||||
if(opa < LV_OPA_MAX) {
|
||||
draw_dsc->opa = (uint16_t)((uint16_t)draw_dsc->opa * opa) >> 8;
|
||||
}
|
||||
if(draw_dsc->opa <= LV_OPA_MIN) return;
|
||||
#endif
|
||||
|
||||
draw_dsc->color = lv_obj_get_style_line_color(obj, part);
|
||||
draw_dsc->bg_img_src = lv_obj_get_style_bg_img_src(obj, part);
|
||||
|
||||
draw_dsc->rounded = lv_obj_get_style_line_rounded(obj, part);
|
||||
|
||||
#if LV_USE_BLEND_MODES
|
||||
draw_dsc->blend_mode = lv_obj_get_style_blend_mode(obj, part);
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
/**
|
||||
* Get the required extra size (around the object's part) to draw shadow, outline, value etc.
|
||||
* @param obj pointer to an object
|
||||
@@ -328,8 +350,8 @@ lv_coord_t _lv_obj_get_draw_rect_ext_pad_size(lv_obj_t * obj, uint8_t part)
|
||||
sh_width += lv_obj_get_style_shadow_spread(obj, part);
|
||||
lv_coord_t sh_ofs_x = lv_obj_get_style_shadow_ofs_x(obj, part);
|
||||
lv_coord_t sh_ofs_y = lv_obj_get_style_shadow_ofs_y(obj, part);
|
||||
sh_width += LV_MATH_MAX(LV_MATH_ABS(sh_ofs_x), LV_MATH_ABS(sh_ofs_y));
|
||||
s = LV_MATH_MAX(s, sh_width);
|
||||
sh_width += LV_MAX(LV_ABS(sh_ofs_x), LV_ABS(sh_ofs_y));
|
||||
s = LV_MAX(s, sh_width);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -338,12 +360,12 @@ lv_coord_t _lv_obj_get_draw_rect_ext_pad_size(lv_obj_t * obj, uint8_t part)
|
||||
lv_opa_t outline_opa = lv_obj_get_style_outline_opa(obj, part);
|
||||
if(outline_opa > LV_OPA_MIN) {
|
||||
lv_coord_t outline_pad = lv_obj_get_style_outline_pad(obj, part);
|
||||
s = LV_MATH_MAX(s, outline_pad + outline_width);
|
||||
s = LV_MAX(s, outline_pad + outline_width);
|
||||
}
|
||||
}
|
||||
|
||||
const void * content_src = lv_obj_get_style_content_src(obj, part);
|
||||
if(content_src) {
|
||||
const void * content_text = lv_obj_get_style_content_text(obj, part);
|
||||
if(content_text) {
|
||||
lv_opa_t content_opa;
|
||||
lv_point_t content_size;
|
||||
content_opa = lv_obj_get_style_text_opa(obj, part);
|
||||
@@ -351,7 +373,7 @@ lv_coord_t _lv_obj_get_draw_rect_ext_pad_size(lv_obj_t * obj, uint8_t part)
|
||||
lv_coord_t letter_space = lv_obj_get_style_text_letter_space(obj, part);
|
||||
lv_coord_t line_space = lv_obj_get_style_text_letter_space(obj, part);
|
||||
const lv_font_t * font = lv_obj_get_style_text_font(obj, part);
|
||||
_lv_txt_get_size(&content_size, content_src, font, letter_space, line_space, LV_COORD_MAX, LV_TEXT_FLAG_NONE);
|
||||
_lv_txt_get_size(&content_size, content_text, font, letter_space, line_space, LV_COORD_MAX, LV_TEXT_FLAG_NONE);
|
||||
|
||||
lv_area_t content_area;
|
||||
content_area.x1 = 0;
|
||||
@@ -370,16 +392,16 @@ lv_coord_t _lv_obj_get_draw_rect_ext_pad_size(lv_obj_t * obj, uint8_t part)
|
||||
content_area.x2 += p_align.x + xofs;
|
||||
content_area.y2 += p_align.y + yofs;
|
||||
|
||||
s = LV_MATH_MAX(s, obj->coords.x1 - content_area.x1);
|
||||
s = LV_MATH_MAX(s, obj->coords.y1 - content_area.y1);
|
||||
s = LV_MATH_MAX(s, content_area.x2 - obj->coords.x2);
|
||||
s = LV_MATH_MAX(s, content_area.y2 - obj->coords.y2);
|
||||
s = LV_MAX(s, obj->coords.x1 - content_area.x1);
|
||||
s = LV_MAX(s, obj->coords.y1 - content_area.y1);
|
||||
s = LV_MAX(s, content_area.x2 - obj->coords.x2);
|
||||
s = LV_MAX(s, content_area.y2 - obj->coords.y2);
|
||||
}
|
||||
}
|
||||
|
||||
lv_coord_t w = lv_obj_get_style_transform_width(obj, part);
|
||||
lv_coord_t h = lv_obj_get_style_transform_height(obj, part);
|
||||
lv_coord_t wh = LV_MATH_MAX(w, h);
|
||||
lv_coord_t wh = LV_MAX(w, h);
|
||||
if(wh > 0) s += wh;
|
||||
|
||||
return s;
|
||||
@@ -387,7 +409,7 @@ lv_coord_t _lv_obj_get_draw_rect_ext_pad_size(lv_obj_t * obj, uint8_t part)
|
||||
|
||||
void lv_obj_draw_hook_dsc_init(lv_obj_draw_hook_dsc_t * hook_dsc, const lv_area_t * clip_area)
|
||||
{
|
||||
_lv_memset_00(hook_dsc, sizeof(lv_obj_draw_hook_dsc_t));
|
||||
lv_memset_00(hook_dsc, sizeof(lv_obj_draw_hook_dsc_t));
|
||||
hook_dsc->clip_area = clip_area;
|
||||
}
|
||||
|
||||
@@ -488,7 +510,7 @@ void _lv_obj_draw_scrollbar(lv_obj_t * obj, const lv_area_t * clip_area)
|
||||
if(ver_draw && _lv_area_is_on(&area, clip_area)) {
|
||||
lv_coord_t content_h = obj_h + st + sb;
|
||||
lv_coord_t sb_h = ((obj_h - end_space * 2 - hor_req_space) * obj_h) / content_h;
|
||||
sb_h = LV_MATH_MAX(sb_h, SCROLLBAR_MIN_SIZE);
|
||||
sb_h = LV_MAX(sb_h, SCROLLBAR_MIN_SIZE);
|
||||
rem = (obj_h - end_space * 2 - hor_req_space) - sb_h; /*Remaining size from the scrollbar track that is not the scrollbar itself*/
|
||||
lv_coord_t scroll_h = content_h - obj_h; /*The size of the content which can be really scrolled*/
|
||||
if(scroll_h <= 0) {
|
||||
@@ -524,7 +546,7 @@ void _lv_obj_draw_scrollbar(lv_obj_t * obj, const lv_area_t * clip_area)
|
||||
if(hor_draw && _lv_area_is_on(&area, clip_area)) {
|
||||
lv_coord_t content_w = obj_w + sl + sr;
|
||||
lv_coord_t sb_w = ((obj_w - end_space * 2 - ver_reg_space) * obj_w) / content_w;
|
||||
sb_w = LV_MATH_MAX(sb_w, SCROLLBAR_MIN_SIZE);
|
||||
sb_w = LV_MAX(sb_w, SCROLLBAR_MIN_SIZE);
|
||||
rem = (obj_w - end_space * 2 - ver_reg_space) - sb_w; /*Remaining size from the scrollbar track that is not the scrollbar itself*/
|
||||
lv_coord_t scroll_w = content_w - obj_w; /*The size of the content which can be really scrolled*/
|
||||
if(scroll_w <= 0) {
|
||||
|
||||
@@ -40,7 +40,11 @@ typedef struct
|
||||
lv_draw_label_dsc_t * label_dsc;
|
||||
lv_draw_line_dsc_t * line_dsc;
|
||||
lv_draw_img_dsc_t * img_dsc;
|
||||
lv_draw_arc_dsc_t * arc_dsc;
|
||||
const lv_area_t * draw_area;
|
||||
const lv_point_t * p1;
|
||||
const lv_point_t * p2;
|
||||
const lv_coord_t * radius;
|
||||
const lv_area_t * clip_area;
|
||||
uint32_t id;
|
||||
uint8_t part;
|
||||
@@ -105,6 +109,7 @@ void lv_obj_init_draw_img_dsc(struct _lv_obj_t * obj, uint8_t part, lv_draw_img_
|
||||
*/
|
||||
void lv_obj_init_draw_line_dsc(struct _lv_obj_t * obj, uint8_t part, lv_draw_line_dsc_t * draw_dsc);
|
||||
|
||||
void lv_obj_init_draw_arc_dsc(struct _lv_obj_t * obj, uint8_t part, lv_draw_arc_dsc_t * draw_dsc);
|
||||
|
||||
bool lv_obj_draw_has_custom(const struct _lv_obj_t * obj, uint8_t part);
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ lv_coord_t lv_obj_get_scroll_bottom(lv_obj_t * obj)
|
||||
uint32_t i;
|
||||
for(i = 0; i < lv_obj_get_child_cnt(obj); i++) {
|
||||
lv_obj_t * child = lv_obj_get_child(obj, i);
|
||||
child_res = LV_MATH_MAX(child_res, child->coords.y2);
|
||||
child_res = LV_MAX(child_res, child->coords.y2);
|
||||
}
|
||||
|
||||
lv_coord_t pad_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN);
|
||||
@@ -141,7 +141,7 @@ lv_coord_t lv_obj_get_scroll_bottom(lv_obj_t * obj)
|
||||
lv_coord_t self_h = _lv_obj_get_self_height(obj);
|
||||
self_h = self_h - (lv_obj_get_height(obj) - pad_top - pad_bottom);
|
||||
self_h -= lv_obj_get_scroll_y(obj);
|
||||
return LV_MATH_MAX(child_res, self_h);
|
||||
return LV_MAX(child_res, self_h);
|
||||
}
|
||||
|
||||
lv_coord_t lv_obj_get_scroll_left(lv_obj_t * obj)
|
||||
@@ -165,7 +165,7 @@ lv_coord_t lv_obj_get_scroll_left(lv_obj_t * obj)
|
||||
lv_coord_t x1 = LV_COORD_MAX;
|
||||
for(i = 0; i < lv_obj_get_child_cnt(obj); i++) {
|
||||
lv_obj_t * child = lv_obj_get_child(obj, i);
|
||||
x1 = LV_MATH_MIN(x1, child->coords.x1);
|
||||
x1 = LV_MIN(x1, child->coords.x1);
|
||||
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ lv_coord_t lv_obj_get_scroll_left(lv_obj_t * obj)
|
||||
self_w = self_w - (lv_obj_get_width(obj) - pad_right - pad_left);
|
||||
self_w -= lv_obj_get_scroll_x(obj);
|
||||
|
||||
return LV_MATH_MAX(child_res, self_w);
|
||||
return LV_MAX(child_res, self_w);
|
||||
}
|
||||
|
||||
lv_coord_t lv_obj_get_scroll_right(lv_obj_t * obj)
|
||||
@@ -197,7 +197,7 @@ lv_coord_t lv_obj_get_scroll_right(lv_obj_t * obj)
|
||||
uint32_t i;
|
||||
for(i = 0; i < lv_obj_get_child_cnt(obj); i++) {
|
||||
lv_obj_t * child = lv_obj_get_child(obj, i);
|
||||
child_res = LV_MATH_MAX(child_res, child->coords.x2);
|
||||
child_res = LV_MAX(child_res, child->coords.x2);
|
||||
}
|
||||
|
||||
lv_coord_t pad_right = lv_obj_get_style_pad_right(obj, LV_PART_MAIN);
|
||||
@@ -209,7 +209,7 @@ lv_coord_t lv_obj_get_scroll_right(lv_obj_t * obj)
|
||||
self_w = _lv_obj_get_self_width(obj);
|
||||
self_w = self_w - (lv_obj_get_width(obj) - pad_right - pad_left);
|
||||
self_w -= lv_obj_get_scroll_x(obj);
|
||||
return LV_MATH_MAX(child_res, self_w);
|
||||
return LV_MAX(child_res, self_w);
|
||||
}
|
||||
|
||||
void lv_obj_get_scroll_end(struct _lv_obj_t * obj, lv_point_t * end)
|
||||
@@ -336,13 +336,13 @@ void lv_obj_scroll_to_view(lv_obj_t * obj, lv_anim_enable_t anim_en)
|
||||
|
||||
lv_coord_t y_scroll = 0;
|
||||
if((top_diff > 0 || bottom_diff > 0)) {
|
||||
if(LV_MATH_ABS(top_diff) < LV_MATH_ABS(bottom_diff)) y_scroll = top_diff;
|
||||
if(LV_ABS(top_diff) < LV_ABS(bottom_diff)) y_scroll = top_diff;
|
||||
else y_scroll = -bottom_diff;
|
||||
}
|
||||
|
||||
lv_coord_t x_scroll = 0;
|
||||
if((left_diff > 0 || right_diff > 0)) {
|
||||
if(LV_MATH_ABS(left_diff) < LV_MATH_ABS(right_diff)) x_scroll = left_diff;
|
||||
if(LV_ABS(left_diff) < LV_ABS(right_diff)) x_scroll = left_diff;
|
||||
else x_scroll = -right_diff;
|
||||
}
|
||||
|
||||
|
||||
+18
-34
@@ -104,7 +104,7 @@ void lv_obj_add_style_no_refresh(struct _lv_obj_t * obj, uint32_t part, uint32_t
|
||||
obj->style_list.styles[j] = obj->style_list.styles[j - 1];
|
||||
}
|
||||
|
||||
_lv_memset_00(&obj->style_list.styles[i], sizeof(lv_obj_style_t));
|
||||
lv_memset_00(&obj->style_list.styles[i], sizeof(lv_obj_style_t));
|
||||
obj->style_list.styles[i].style = style;
|
||||
obj->style_list.styles[i].part = part;
|
||||
obj->style_list.styles[i].state = state;
|
||||
@@ -460,7 +460,7 @@ lv_obj_style_t * _get_trans_style(lv_obj_t * obj, uint32_t part)
|
||||
obj->style_list.styles[i] = obj->style_list.styles[i - 1];
|
||||
}
|
||||
|
||||
_lv_memset_00(&obj->style_list.styles[0], sizeof(lv_obj_style_t));
|
||||
lv_memset_00(&obj->style_list.styles[0], sizeof(lv_obj_style_t));
|
||||
obj->style_list.styles[0].style = lv_mem_alloc(sizeof(lv_style_t));
|
||||
lv_style_init(obj->style_list.styles[0].style);
|
||||
obj->style_list.styles[0].is_trans = 1;
|
||||
@@ -491,7 +491,7 @@ lv_style_t * lv_obj_get_local_style(lv_obj_t * obj, uint32_t part, uint32_t stat
|
||||
obj->style_list.styles[i] = obj->style_list.styles[i - 1];
|
||||
}
|
||||
|
||||
_lv_memset_00(&obj->style_list.styles[i], sizeof(lv_obj_style_t));
|
||||
lv_memset_00(&obj->style_list.styles[i], sizeof(lv_obj_style_t));
|
||||
obj->style_list.styles[i].style = lv_mem_alloc(sizeof(lv_style_t));
|
||||
lv_style_init(obj->style_list.styles[i].style);
|
||||
obj->style_list.styles[i].is_local = 1;
|
||||
@@ -546,8 +546,8 @@ void _lv_obj_create_style_transition(lv_obj_t * obj, lv_style_prop_t prop, uint8
|
||||
if(v1.num == LV_RADIUS_CIRCLE || v2.num == LV_RADIUS_CIRCLE) {
|
||||
lv_coord_t whalf = lv_obj_get_width(obj) / 2;
|
||||
lv_coord_t hhalf = lv_obj_get_width(obj) / 2;
|
||||
if(v1.num == LV_RADIUS_CIRCLE) v1.num = LV_MATH_MIN(whalf + 1, hhalf + 1);
|
||||
if(v2.num == LV_RADIUS_CIRCLE) v2.num = LV_MATH_MIN(whalf + 1, hhalf + 1);
|
||||
if(v1.num == LV_RADIUS_CIRCLE) v1.num = LV_MIN(whalf + 1, hhalf + 1);
|
||||
if(v2.num == LV_RADIUS_CIRCLE) v2.num = LV_MIN(whalf + 1, hhalf + 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -632,10 +632,14 @@ _lv_style_state_cmp_t _lv_obj_style_state_compare(lv_obj_t * obj, lv_state_t sta
|
||||
else if(lv_style_get_prop(style, LV_STYLE_SHADOW_OFS_Y, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD;
|
||||
else if(lv_style_get_prop(style, LV_STYLE_SHADOW_SPREAD, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD;
|
||||
else if(lv_style_get_prop(style, LV_STYLE_LINE_WIDTH, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD;
|
||||
else if(lv_style_get_prop(style, LV_STYLE_CONTENT_SRC, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD;
|
||||
else if(lv_style_get_prop(style, LV_STYLE_CONTENT_TEXT, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD;
|
||||
else if(lv_style_get_prop(style, LV_STYLE_CONTENT_OFS_X, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD;
|
||||
else if(lv_style_get_prop(style, LV_STYLE_CONTENT_OFS_Y, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD;
|
||||
else if(lv_style_get_prop(style, LV_STYLE_CONTENT_ALIGN, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD;
|
||||
else if(lv_style_get_prop(style, LV_STYLE_CONTENT_FONT, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD;
|
||||
else if(lv_style_get_prop(style, LV_STYLE_CONTENT_LINE_SPACE, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD;
|
||||
else if(lv_style_get_prop(style, LV_STYLE_CONTENT_LETTER_SPACE, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD;
|
||||
else if(lv_style_get_prop(style, LV_STYLE_CONTENT_OPA, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD;
|
||||
else {
|
||||
if(res != _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD) res = _LV_STYLE_STATE_CMP_DIFF_REDRAW;
|
||||
}
|
||||
@@ -719,16 +723,9 @@ static void update_cache(lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop)
|
||||
list->cache_transform_zero = 0;
|
||||
}
|
||||
}
|
||||
if(prop == LV_STYLE_PROP_ALL || prop == LV_STYLE_BG_BLEND_MODE || prop == LV_STYLE_TEXT_BLEND_MODE || prop == LV_STYLE_BORDER_BLEND_MODE) {
|
||||
lv_style_value_t va[5];
|
||||
if(get_prop_core(obj, part, LV_STYLE_BG_BLEND_MODE, &va[0]) == false) va[0].num = 0;
|
||||
if(get_prop_core(obj, part, LV_STYLE_BORDER_BLEND_MODE, &va[1]) == false) va[1].num = 0;
|
||||
if(get_prop_core(obj, part, LV_STYLE_SHADOW_BLEND_MODE, &va[1]) == false) va[2].num = 0;
|
||||
if(get_prop_core(obj, part, LV_STYLE_OUTLINE_BLEND_MODE, &va[1]) == false) va[3].num = 0;
|
||||
if(get_prop_core(obj, part, LV_STYLE_TEXT_BLEND_MODE, &va[2]) == false) va[4].num = 0;
|
||||
|
||||
if(va[0].num || va[1].num || va[2].num || va[3].num || va[4].num) list->cache_blend_mode_zero = 1;
|
||||
else list->cache_blend_mode_zero = 0;
|
||||
if(prop == LV_STYLE_PROP_ALL || prop == LV_STYLE_BLEND_MODE) {
|
||||
if(get_prop_core(obj, part, LV_STYLE_BLEND_MODE, &v) == false) v.num = LV_BLEND_MODE_NORMAL;
|
||||
list->cache_blend_mode_zero = v.num == LV_BLEND_MODE_NORMAL ? 1 : 0;
|
||||
}
|
||||
|
||||
if(prop == LV_STYLE_PROP_ALL || prop == LV_STYLE_BG_GRAD_DIR) {
|
||||
@@ -751,8 +748,8 @@ static void update_cache(lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop)
|
||||
if(v.num == 0) list->cache_img_recolor_opa_zero = 1;
|
||||
else list->cache_img_recolor_opa_zero = 0;
|
||||
}
|
||||
if(prop == LV_STYLE_PROP_ALL || prop == LV_STYLE_CONTENT_SRC) {
|
||||
if(get_prop_core(obj, part, LV_STYLE_CONTENT_SRC, &v) == false) v.ptr = NULL;
|
||||
if(prop == LV_STYLE_PROP_ALL || prop == LV_STYLE_CONTENT_TEXT) {
|
||||
if(get_prop_core(obj, part, LV_STYLE_CONTENT_TEXT, &v) == false) v.ptr = NULL;
|
||||
if(v.ptr == NULL) list->cache_content_src_zero = 1;
|
||||
else list->cache_content_src_zero = 0;
|
||||
}
|
||||
@@ -806,19 +803,11 @@ static cache_t read_cache(const lv_obj_t * obj, lv_part_t part, lv_style_prop_t
|
||||
|
||||
switch(prop) {
|
||||
|
||||
case LV_STYLE_BG_BLEND_MODE:
|
||||
case LV_STYLE_BORDER_BLEND_MODE:
|
||||
case LV_STYLE_SHADOW_BLEND_MODE:
|
||||
case LV_STYLE_OUTLINE_BLEND_MODE:
|
||||
case LV_STYLE_BLEND_MODE:
|
||||
if(list->cache_blend_mode_zero ) return CACHE_ZERO;
|
||||
else return CACHE_NEED_CHECK;
|
||||
break;
|
||||
|
||||
case LV_STYLE_TEXT_BLEND_MODE:
|
||||
if(list->cache_blend_mode_zero ) return CACHE_UNSET;
|
||||
else return CACHE_NEED_CHECK;
|
||||
break;
|
||||
|
||||
case LV_STYLE_OPA:
|
||||
if(list->cache_opa_set) return CACHE_NEED_CHECK;
|
||||
else return CACHE_UNSET;
|
||||
@@ -871,7 +860,7 @@ static cache_t read_cache(const lv_obj_t * obj, lv_part_t part, lv_style_prop_t
|
||||
if(list->cache_shadow_width_zero ) return CACHE_ZERO;
|
||||
else return CACHE_NEED_CHECK;
|
||||
break;
|
||||
case LV_STYLE_CONTENT_SRC:
|
||||
case LV_STYLE_CONTENT_TEXT:
|
||||
if(list->cache_content_src_zero ) return CACHE_ZERO;
|
||||
else return CACHE_NEED_CHECK;
|
||||
break;
|
||||
@@ -1004,12 +993,7 @@ static void trans_anim_cb(lv_style_trans_t * tr, lv_anim_value_t v)
|
||||
|
||||
case LV_STYLE_BORDER_SIDE:
|
||||
case LV_STYLE_BORDER_POST:
|
||||
case LV_STYLE_BG_BLEND_MODE:
|
||||
case LV_STYLE_BORDER_BLEND_MODE:
|
||||
case LV_STYLE_OUTLINE_BLEND_MODE:
|
||||
case LV_STYLE_SHADOW_BLEND_MODE:
|
||||
case LV_STYLE_TEXT_BLEND_MODE:
|
||||
case LV_STYLE_LINE_BLEND_MODE:
|
||||
case LV_STYLE_BLEND_MODE:
|
||||
if(v < 255) value_final.num = tr->start_value.num;
|
||||
else value_final.num = tr->end_value.num;
|
||||
break;
|
||||
|
||||
+218
-201
@@ -195,228 +195,245 @@ _lv_style_state_cmp_t _lv_obj_style_state_compare(struct _lv_obj_t * obj, lv_sta
|
||||
/*********************
|
||||
* OBJ STYLE GET
|
||||
*********************/
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_radius(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_RADIUS); return v.num; }
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_RADIUS); return (lv_coord_t) v.num; }
|
||||
|
||||
static inline bool lv_obj_get_style_clip_corner(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_CLIP_CORNER); return v.num; }
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_CLIP_CORNER); return (bool) v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_transform_width(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_WIDTH); return v.num; }
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_WIDTH); return (lv_coord_t) v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_transform_height(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_HEIGHT); return v.num; }
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_HEIGHT); return (lv_coord_t) v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_transform_zoom(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_ZOOM); return v.num; }
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_ZOOM); return (lv_coord_t) v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_transform_angle(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_ANGLE); return v.num; }
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_ANGLE); return (lv_coord_t) v.num; }
|
||||
|
||||
static inline lv_opa_t lv_obj_get_style_opa(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_OPA); return v.num; }
|
||||
|
||||
static inline lv_opa_t lv_obj_get_style_anim_time(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_ANIM_TIME); return v.num; }
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_OPA); return (lv_opa_t) v.num; }
|
||||
|
||||
static inline lv_color_filter_cb_t lv_obj_get_style_color_filter_cb(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_COLOR_FILTER_CB); return (lv_color_filter_cb_t)v.func; }
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_COLOR_FILTER_CB); return (lv_color_filter_cb_t) v.func; }
|
||||
|
||||
static inline lv_opa_t lv_obj_get_style_color_filter_opa(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_COLOR_FILTER_OPA); return v.num; }
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_COLOR_FILTER_OPA); return (lv_opa_t) v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_pad_top(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_PAD_TOP); return v.num; }
|
||||
static inline uint32_t lv_obj_get_style_anim_time(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_ANIM_TIME); return (uint32_t) v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_pad_bottom(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_PAD_BOTTOM); return v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_pad_left(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_PAD_LEFT); return v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_pad_right(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_PAD_RIGHT); return v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_pad_row(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_PAD_ROW); return v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_pad_column(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_PAD_COLUMN); return v.num; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_bg_color(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_COLOR); return v.color; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_bg_color_filtered(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_COLOR_FILTERED); return v.color; }
|
||||
|
||||
static inline lv_opa_t lv_obj_get_style_bg_opa(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_OPA); return v.num; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_bg_grad_color(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_GRAD_COLOR); return v.color; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_bg_grad_color_filtered(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_GRAD_COLOR_FILTERED); return v.color; }
|
||||
|
||||
static inline lv_grad_dir_t lv_obj_get_style_bg_grad_dir(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_GRAD_DIR); return v.num; }
|
||||
|
||||
static inline lv_blend_mode_t lv_obj_get_style_bg_blend_mode(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_BLEND_MODE); return v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_bg_main_stop(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_MAIN_STOP); return v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_bg_grad_stop(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_GRAD_STOP); return v.num; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_border_color(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BORDER_COLOR); return v.color; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_border_color_filtered(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BORDER_COLOR_FILTERED); return v.color; }
|
||||
|
||||
static inline lv_opa_t lv_obj_get_style_border_opa(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BORDER_OPA); return v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_border_width(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BORDER_WIDTH); return v.num; }
|
||||
|
||||
static inline lv_border_side_t lv_obj_get_style_border_side(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BORDER_SIDE); return v.num; }
|
||||
|
||||
static inline bool lv_obj_get_style_border_post(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BORDER_POST); return v.num; }
|
||||
|
||||
static inline lv_blend_mode_t lv_obj_get_style_border_blend_mode(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BORDER_BLEND_MODE); return v.num; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_text_color(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_COLOR); return v.color; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_text_color_filtered(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_COLOR_FILTERED); return v.color; }
|
||||
|
||||
static inline lv_opa_t lv_obj_get_style_text_opa(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_OPA); return v.num; }
|
||||
|
||||
static inline const lv_font_t * lv_obj_get_style_text_font(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_FONT); return v.ptr; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_text_letter_space(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_LETTER_SPACE); return v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_text_line_space(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_LINE_SPACE); return v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_text_align(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_ALIGN); return v.num; }
|
||||
|
||||
static inline lv_text_decor_t lv_obj_get_style_text_decor(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_DECOR); return v.num; }
|
||||
|
||||
static inline lv_blend_mode_t lv_obj_get_style_text_blend_mode(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_BLEND_MODE); return v.num; }
|
||||
|
||||
static inline lv_opa_t lv_obj_get_style_img_opa(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_IMG_OPA); return v.num; }
|
||||
|
||||
static inline lv_blend_mode_t lv_obj_get_style_img_blend_mode(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_IMG_BLEND_MODE); return v.num; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_img_recolor(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_IMG_RECOLOR); return v.color; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_img_recolor_filtered(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_IMG_RECOLOR_FILTERED); return v.color; }
|
||||
|
||||
static inline lv_opa_t lv_obj_get_style_img_recolor_opa(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_IMG_RECOLOR_OPA); return v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_outline_width(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_OUTLINE_WIDTH); return v.num; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_outline_color(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_OUTLINE_COLOR); return v.color; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_outline_color_filtered(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_OUTLINE_COLOR_FILTERED); return v.color; }
|
||||
|
||||
static inline lv_opa_t lv_obj_get_style_outline_opa(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_OUTLINE_OPA); return v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_outline_pad(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_OUTLINE_PAD); return v.num; }
|
||||
|
||||
static inline lv_blend_mode_t lv_obj_get_style_outline_blend_mode(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_OUTLINE_BLEND_MODE); return v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_shadow_width(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_WIDTH); return v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_shadow_ofs_x(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_OFS_X); return v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_shadow_ofs_y(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_OFS_Y); return v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_shadow_spread(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_SPREAD); return v.num; }
|
||||
|
||||
static inline lv_blend_mode_t lv_obj_get_style_shadow_blend_mode(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_BLEND_MODE); return v.num; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_shadow_color(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_COLOR); return v.color; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_shadow_color_filtered(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_COLOR_FILTERED); return v.color; }
|
||||
|
||||
static inline lv_opa_t lv_obj_get_style_shadow_opa(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_OPA); return v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_line_width(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_WIDTH); return v.num; }
|
||||
|
||||
static inline lv_blend_mode_t lv_obj_get_style_line_blend_mode(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_BLEND_MODE); return v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_line_dash_width(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_DASH_WIDTH); return v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_line_dash_gap(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_DASH_GAP); return v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_line_rounded(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_ROUNDED); return v.num; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_line_color(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_COLOR); return v.color; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_line_color_filtered(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_COLOR_FILTERED); return v.color; }
|
||||
|
||||
static inline lv_opa_t lv_obj_get_style_line_opa(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_OPA); return v.num; }
|
||||
|
||||
static inline const char * lv_obj_get_style_content_src(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_CONTENT_SRC); return v.ptr; }
|
||||
|
||||
static inline lv_align_t lv_obj_get_style_content_align(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_CONTENT_ALIGN); return v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_content_ofs_x(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_CONTENT_OFS_X); return v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_content_ofs_y(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_CONTENT_OFS_Y); return v.num; }
|
||||
|
||||
static inline const lv_style_transiton_t * lv_obj_get_style_transition(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSITION); return v.ptr; }
|
||||
static inline const lv_style_transition_t * lv_obj_get_style_transition(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSITION); return (const lv_style_transition_t *) v.ptr; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_size(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SIZE); return v.num; }
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SIZE); return (lv_coord_t) v.num; }
|
||||
|
||||
static inline lv_blend_mode_t lv_obj_get_style_blend_mode(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BLEND_MODE); return (lv_blend_mode_t) v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_pad_top(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_PAD_TOP); return (lv_coord_t) v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_pad_bottom(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_PAD_BOTTOM); return (lv_coord_t) v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_pad_left(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_PAD_LEFT); return (lv_coord_t) v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_pad_right(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_PAD_RIGHT); return (lv_coord_t) v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_pad_row(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_PAD_ROW); return (lv_coord_t) v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_pad_column(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_PAD_COLUMN); return (lv_coord_t) v.num; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_bg_color(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_COLOR); return (lv_color_t) v.color; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_bg_color_filtered(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_COLOR_FILTERED); return (lv_color_t) v.color; }
|
||||
|
||||
static inline lv_opa_t lv_obj_get_style_bg_opa(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_OPA); return (lv_opa_t) v.num; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_bg_grad_color(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_GRAD_COLOR); return (lv_color_t) v.color; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_bg_grad_color_filtered(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_GRAD_COLOR_FILTERED); return (lv_color_t) v.color; }
|
||||
|
||||
static inline lv_grad_dir_t lv_obj_get_style_bg_grad_dir(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_GRAD_DIR); return (lv_grad_dir_t) v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_bg_main_stop(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_MAIN_STOP); return (lv_coord_t) v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_bg_grad_stop(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_GRAD_STOP); return (lv_coord_t) v.num; }
|
||||
|
||||
static inline const void * lv_obj_get_style_bg_img_src(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_IMG_SRC); return (const void *) v.ptr; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_bg_img_recolor(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_IMG_RECOLOR); return (lv_color_t) v.color; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_bg_img_recolor_filtered(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_IMG_RECOLOR_FILTERED); return (lv_color_t) v.color; }
|
||||
|
||||
static inline lv_opa_t lv_obj_get_style_bg_img_recolor_opa(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_IMG_RECOLOR_OPA); return (lv_opa_t) v.num; }
|
||||
|
||||
static inline bool lv_obj_get_style_bg_img_tiled(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_IMG_TILED); return (bool) v.num; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_border_color(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BORDER_COLOR); return (lv_color_t) v.color; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_border_color_filtered(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BORDER_COLOR_FILTERED); return (lv_color_t) v.color; }
|
||||
|
||||
static inline lv_opa_t lv_obj_get_style_border_opa(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BORDER_OPA); return (lv_opa_t) v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_border_width(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BORDER_WIDTH); return (lv_coord_t) v.num; }
|
||||
|
||||
static inline lv_border_side_t lv_obj_get_style_border_side(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BORDER_SIDE); return (lv_border_side_t) v.num; }
|
||||
|
||||
static inline bool lv_obj_get_style_border_post(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BORDER_POST); return (bool) v.num; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_text_color(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_COLOR); return (lv_color_t) v.color; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_text_color_filtered(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_COLOR_FILTERED); return (lv_color_t) v.color; }
|
||||
|
||||
static inline lv_opa_t lv_obj_get_style_text_opa(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_OPA); return (lv_opa_t) v.num; }
|
||||
|
||||
static inline const lv_font_t * lv_obj_get_style_text_font(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_FONT); return (const lv_font_t *) v.ptr; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_text_letter_space(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_LETTER_SPACE); return (lv_coord_t) v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_text_line_space(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_LINE_SPACE); return (lv_coord_t) v.num; }
|
||||
|
||||
static inline lv_text_decor_t lv_obj_get_style_text_decor(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_DECOR); return (lv_text_decor_t) v.num; }
|
||||
|
||||
static inline lv_text_align_t lv_obj_get_style_text_align(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_ALIGN); return (lv_text_align_t) v.num; }
|
||||
|
||||
static inline lv_opa_t lv_obj_get_style_img_opa(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_IMG_OPA); return (lv_opa_t) v.num; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_img_recolor(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_IMG_RECOLOR); return (lv_color_t) v.color; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_img_recolor_filtered(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_IMG_RECOLOR_FILTERED); return (lv_color_t) v.color; }
|
||||
|
||||
static inline lv_opa_t lv_obj_get_style_img_recolor_opa(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_IMG_RECOLOR_OPA); return (lv_opa_t) v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_outline_width(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_OUTLINE_WIDTH); return (lv_coord_t) v.num; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_outline_color(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_OUTLINE_COLOR); return (lv_color_t) v.color; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_outline_color_filtered(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_OUTLINE_COLOR_FILTERED); return (lv_color_t) v.color; }
|
||||
|
||||
static inline lv_opa_t lv_obj_get_style_outline_opa(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_OUTLINE_OPA); return (lv_opa_t) v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_outline_pad(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_OUTLINE_PAD); return (lv_coord_t) v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_shadow_width(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_WIDTH); return (lv_coord_t) v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_shadow_ofs_x(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_OFS_X); return (lv_coord_t) v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_shadow_ofs_y(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_OFS_Y); return (lv_coord_t) v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_shadow_spread(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_SPREAD); return (lv_coord_t) v.num; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_shadow_color(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_COLOR); return (lv_color_t) v.color; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_shadow_color_filtered(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_COLOR_FILTERED); return (lv_color_t) v.color; }
|
||||
|
||||
static inline lv_opa_t lv_obj_get_style_shadow_opa(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_OPA); return (lv_opa_t) v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_line_width(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_WIDTH); return (lv_coord_t) v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_line_dash_width(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_DASH_WIDTH); return (lv_coord_t) v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_line_dash_gap(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_DASH_GAP); return (lv_coord_t) v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_line_rounded(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_ROUNDED); return (lv_coord_t) v.num; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_line_color(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_COLOR); return (lv_color_t) v.color; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_line_color_filtered(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_COLOR_FILTERED); return (lv_color_t) v.color; }
|
||||
|
||||
static inline lv_opa_t lv_obj_get_style_line_opa(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_OPA); return (lv_opa_t) v.num; }
|
||||
|
||||
static inline const char * lv_obj_get_style_content_text(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_CONTENT_TEXT); return (const char *) v.ptr; }
|
||||
|
||||
static inline lv_align_t lv_obj_get_style_content_align(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_CONTENT_ALIGN); return (lv_align_t) v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_content_ofs_x(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_CONTENT_OFS_X); return (lv_coord_t) v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_content_ofs_y(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_CONTENT_OFS_Y); return (lv_coord_t) v.num; }
|
||||
|
||||
static inline lv_opa_t lv_obj_get_style_content_opa(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_CONTENT_OPA); return (lv_opa_t) v.num; }
|
||||
|
||||
static inline const lv_font_t * lv_obj_get_style_content_font(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_CONTENT_FONT); return (const lv_font_t *) v.ptr; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_content_color(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_CONTENT_COLOR); return (lv_color_t) v.color; }
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_content_color_filtered(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_CONTENT_COLOR_FILTERED); return (lv_color_t) v.color; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_content_letter_space(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_CONTENT_LETTER_SPACE); return (lv_coord_t) v.num; }
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_content_line_space(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_CONTENT_LINE_SPACE); return (lv_coord_t) v.num; }
|
||||
|
||||
static inline lv_text_decor_t lv_obj_get_style_content_decor(const struct _lv_obj_t * obj, uint32_t part) {
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_CONTENT_DECOR); return (lv_text_decor_t) v.num; }
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
|
||||
@@ -225,7 +225,7 @@ void _lv_disp_refr_task(lv_timer_t * tmr)
|
||||
#if LV_USE_GPU_STM32_DMA2D
|
||||
LV_UNUSED(copy_buf);
|
||||
#else
|
||||
copy_buf = _lv_mem_buf_get(disp_refr->driver.hor_res * sizeof(lv_color_t));
|
||||
copy_buf = lv_mem_buf_get(disp_refr->driver.hor_res * sizeof(lv_color_t));
|
||||
#endif
|
||||
|
||||
uint8_t * buf_act = (uint8_t *)vdb->buf_act;
|
||||
@@ -250,21 +250,21 @@ void _lv_disp_refr_task(lv_timer_t * tmr)
|
||||
for(y = disp_refr->inv_areas[a].y1; y <= disp_refr->inv_areas[a].y2; y++) {
|
||||
/* The frame buffer is probably in an external RAM where sequential access is much faster.
|
||||
* So first copy a line into a buffer and write it back the ext. RAM */
|
||||
_lv_memcpy(copy_buf, buf_ina + start_offs, line_length);
|
||||
_lv_memcpy(buf_act + start_offs, copy_buf, line_length);
|
||||
lv_memcpy(copy_buf, buf_ina + start_offs, line_length);
|
||||
lv_memcpy(buf_act + start_offs, copy_buf, line_length);
|
||||
start_offs += hres * sizeof(lv_color_t);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
if(copy_buf) _lv_mem_buf_release(copy_buf);
|
||||
if(copy_buf) lv_mem_buf_release(copy_buf);
|
||||
}
|
||||
} /*End of true double buffer handling*/
|
||||
|
||||
/*Clean up*/
|
||||
_lv_memset_00(disp_refr->inv_areas, sizeof(disp_refr->inv_areas));
|
||||
_lv_memset_00(disp_refr->inv_area_joined, sizeof(disp_refr->inv_area_joined));
|
||||
lv_memset_00(disp_refr->inv_areas, sizeof(disp_refr->inv_areas));
|
||||
lv_memset_00(disp_refr->inv_area_joined, sizeof(disp_refr->inv_area_joined));
|
||||
disp_refr->inv_p = 0;
|
||||
|
||||
elaps = lv_tick_elaps(start);
|
||||
@@ -274,7 +274,7 @@ void _lv_disp_refr_task(lv_timer_t * tmr)
|
||||
}
|
||||
}
|
||||
|
||||
_lv_mem_buf_free_all();
|
||||
lv_mem_buf_free_all();
|
||||
_lv_font_clean_up_fmt_txt();
|
||||
|
||||
#if LV_USE_PERF_MONITOR && LV_USE_LABEL
|
||||
|
||||
+119
-140
@@ -21,9 +21,6 @@
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
static void set_prop(lv_style_t * style, lv_style_prop_t prop, lv_style_value_t value);
|
||||
static bool get_prop(const lv_style_t * style, lv_style_prop_t prop, lv_style_value_t * value);
|
||||
static bool remove_prop(lv_style_t * style, lv_style_prop_t prop);
|
||||
|
||||
/**********************
|
||||
* GLOBAL VARIABLES
|
||||
@@ -51,7 +48,7 @@ void _lv_style_system_init(void)
|
||||
*/
|
||||
void lv_style_init(lv_style_t * style)
|
||||
{
|
||||
_lv_memset_00(style, sizeof(lv_style_t));
|
||||
lv_memset_00(style, sizeof(lv_style_t));
|
||||
#if LV_USE_ASSERT_STYLE
|
||||
style->sentinel = LV_DEBUG_STYLE_SENTINEL_VALUE;
|
||||
#endif
|
||||
@@ -75,7 +72,50 @@ uint16_t lv_style_register_prop(bool inherit)
|
||||
*/
|
||||
bool lv_style_remove_prop(lv_style_t * style, lv_style_prop_t prop)
|
||||
{
|
||||
return remove_prop(style, prop);
|
||||
if(style == NULL) return false;
|
||||
LV_ASSERT_STYLE(style);
|
||||
|
||||
if(!style->allocated) {
|
||||
if(style->prop1 == prop) {
|
||||
style->prop1 = _LV_STYLE_PROP_INV;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
uint8_t * tmp = style->props_and_values + style->prop_cnt * sizeof(lv_style_value_t);
|
||||
uint16_t * props = (uint16_t *) tmp;
|
||||
uint32_t i;
|
||||
for(i = 0; i < style->prop_cnt; i++) {
|
||||
if(props[i] == prop) {
|
||||
lv_style_value_t * values = (lv_style_value_t *)style->props_and_values;
|
||||
style->prop_cnt--;
|
||||
size_t size = style->prop_cnt * (sizeof(lv_style_value_t) + sizeof(uint16_t));
|
||||
uint8_t * new_values_and_props = lv_mem_alloc(size);
|
||||
|
||||
uint8_t * tmp = new_values_and_props + style->prop_cnt * sizeof(lv_style_value_t);
|
||||
uint16_t * new_props = (uint16_t *) tmp;
|
||||
lv_style_value_t * new_values = (lv_style_value_t *)new_values_and_props;
|
||||
|
||||
uint32_t j;
|
||||
for(j = 0; j < style->prop_cnt + 1; j++) { /* +1: because prop_cnt already reduced but all the old props. needs to be checked. */
|
||||
if(props[j] != prop) {
|
||||
*new_values = values[j];
|
||||
*new_props = props[j];
|
||||
|
||||
new_values++;
|
||||
new_props++;
|
||||
}
|
||||
}
|
||||
|
||||
lv_mem_free(style->props_and_values);
|
||||
style->props_and_values = new_values_and_props;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -91,17 +131,87 @@ void lv_style_reset(lv_style_t * style)
|
||||
|
||||
void lv_style_set_prop(lv_style_t * style, lv_style_prop_t prop, lv_style_value_t value)
|
||||
{
|
||||
set_prop(style, prop, value);
|
||||
if(style->allocated) {
|
||||
uint8_t * tmp = style->props_and_values + style->prop_cnt * sizeof(lv_style_value_t);
|
||||
uint16_t * props = (uint16_t *) tmp;
|
||||
int32_t i;
|
||||
for(i = 0; i < style->prop_cnt; i++) {
|
||||
if(props[i] == prop) {
|
||||
lv_style_value_t * values = (lv_style_value_t *)style->props_and_values;
|
||||
values[i] = value;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
style->prop_cnt++;
|
||||
size_t size = style->prop_cnt * (sizeof(lv_style_value_t) + sizeof(uint16_t));
|
||||
style->props_and_values = lv_mem_realloc(style->props_and_values, size);
|
||||
tmp = style->props_and_values + (style->prop_cnt - 1) * sizeof(lv_style_value_t);
|
||||
props = (uint16_t *) tmp;
|
||||
/*Shift all props to make place for the value before them*/
|
||||
for(i = style->prop_cnt - 2; i >= 0; i--) {
|
||||
props[i + sizeof(lv_style_value_t) /sizeof(uint16_t)] = props[i];
|
||||
}
|
||||
|
||||
/*Go to the new position wit the props*/
|
||||
tmp = style->props_and_values + (style->prop_cnt) * sizeof(lv_style_value_t);
|
||||
props = (uint16_t *) tmp;
|
||||
lv_style_value_t * values = (lv_style_value_t *)style->props_and_values;
|
||||
|
||||
/*Set the new property and value*/
|
||||
props[style->prop_cnt - 1] = prop;
|
||||
values[style->prop_cnt - 1] = value;
|
||||
} else if(style->prop_cnt == 1) {
|
||||
if(style->prop1 == prop) {
|
||||
style->value1 = value;
|
||||
return;
|
||||
}
|
||||
style->prop_cnt++;
|
||||
size_t size = style->prop_cnt * (sizeof(lv_style_value_t) + sizeof(uint16_t));
|
||||
uint8_t * props_and_values = lv_mem_alloc(size);
|
||||
uint8_t * tmp = props_and_values + (style->prop_cnt) * sizeof(lv_style_value_t);
|
||||
uint16_t * props = (uint16_t *) tmp;
|
||||
lv_style_value_t * values = (lv_style_value_t *)props_and_values;
|
||||
props[0] = style->prop1;
|
||||
props[1] = prop;
|
||||
values[0] = style->value1;
|
||||
values[1] = value;
|
||||
|
||||
style->props_and_values = props_and_values;
|
||||
|
||||
style->allocated = 1;
|
||||
} else if (style->prop_cnt == 0) {
|
||||
style->prop_cnt++;
|
||||
style->prop1 = prop;
|
||||
style->value1 = value;
|
||||
}
|
||||
}
|
||||
|
||||
bool lv_style_get_prop(lv_style_t * style, lv_style_prop_t prop, lv_style_value_t * value)
|
||||
{
|
||||
return get_prop(style, prop, value);
|
||||
if(style->allocated) {
|
||||
uint8_t * tmp = style->props_and_values + style->prop_cnt * sizeof(lv_style_value_t);
|
||||
uint16_t * props = (uint16_t *) tmp;
|
||||
uint32_t i;
|
||||
for(i = 0; i < style->prop_cnt; i++) {
|
||||
if(props[i] == prop) {
|
||||
lv_style_value_t * values = (lv_style_value_t *)style->props_and_values;
|
||||
*value = values[i];
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(style->prop1 == prop) {
|
||||
*value = style->value1;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void lv_style_transition_init(lv_style_transiton_t * tr, const lv_style_prop_t * props, const lv_anim_path_t * path, uint32_t time, uint32_t delay)
|
||||
void lv_style_transition_init(lv_style_transition_t * tr, const lv_style_prop_t * props, const lv_anim_path_t * path, uint32_t time, uint32_t delay)
|
||||
{
|
||||
_lv_memset_00(tr, sizeof(lv_style_transiton_t));
|
||||
lv_memset_00(tr, sizeof(lv_style_transition_t));
|
||||
tr->props = props;
|
||||
tr->path = path;
|
||||
tr->time = time;
|
||||
@@ -187,134 +297,3 @@ bool lv_style_is_empty(const lv_style_t * style)
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
static void set_prop(lv_style_t * style, lv_style_prop_t prop, lv_style_value_t value)
|
||||
{
|
||||
if(style->allocated) {
|
||||
uint8_t * tmp = style->props_and_values + style->prop_cnt * sizeof(lv_style_value_t);
|
||||
uint16_t * props = (uint16_t *) tmp;
|
||||
int32_t i;
|
||||
for(i = 0; i < style->prop_cnt; i++) {
|
||||
if(props[i] == prop) {
|
||||
lv_style_value_t * values = (lv_style_value_t *)style->props_and_values;
|
||||
values[i] = value;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
style->prop_cnt++;
|
||||
size_t size = style->prop_cnt * (sizeof(lv_style_value_t) + sizeof(uint16_t));
|
||||
style->props_and_values = lv_mem_realloc(style->props_and_values, size);
|
||||
tmp = style->props_and_values + (style->prop_cnt - 1) * sizeof(lv_style_value_t);
|
||||
props = (uint16_t *) tmp;
|
||||
/*Shift all props to make place for the value before them*/
|
||||
for(i = style->prop_cnt - 2; i >= 0; i--) {
|
||||
props[i + sizeof(lv_style_value_t) /sizeof(uint16_t)] = props[i];
|
||||
}
|
||||
|
||||
/*Go to the new position wit the props*/
|
||||
tmp = style->props_and_values + (style->prop_cnt) * sizeof(lv_style_value_t);
|
||||
props = (uint16_t *) tmp;
|
||||
lv_style_value_t * values = (lv_style_value_t *)style->props_and_values;
|
||||
|
||||
/*Set the new propery and value*/
|
||||
props[style->prop_cnt - 1] = prop;
|
||||
values[style->prop_cnt - 1] = value;
|
||||
} else if(style->prop_cnt == 1) {
|
||||
if(style->prop1 == prop) {
|
||||
style->value1 = value;
|
||||
return;
|
||||
}
|
||||
style->prop_cnt++;
|
||||
size_t size = style->prop_cnt * (sizeof(lv_style_value_t) + sizeof(uint16_t));
|
||||
uint8_t * props_and_values = lv_mem_alloc(size);
|
||||
uint8_t * tmp = props_and_values + (style->prop_cnt) * sizeof(lv_style_value_t);
|
||||
uint16_t * props = (uint16_t *) tmp;
|
||||
lv_style_value_t * values = (lv_style_value_t *)props_and_values;
|
||||
props[0] = style->prop1;
|
||||
props[1] = prop;
|
||||
values[0] = style->value1;
|
||||
values[1] = value;
|
||||
|
||||
style->props_and_values = props_and_values;
|
||||
|
||||
style->allocated = 1;
|
||||
} else if (style->prop_cnt == 0) {
|
||||
style->prop_cnt++;
|
||||
style->prop1 = prop;
|
||||
style->value1 = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static bool get_prop(const lv_style_t * style, lv_style_prop_t prop, lv_style_value_t * value)
|
||||
{
|
||||
if(style->allocated) {
|
||||
uint8_t * tmp = style->props_and_values + style->prop_cnt * sizeof(lv_style_value_t);
|
||||
uint16_t * props = (uint16_t *) tmp;
|
||||
uint32_t i;
|
||||
for(i = 0; i < style->prop_cnt; i++) {
|
||||
if(props[i] == prop) {
|
||||
lv_style_value_t * values = (lv_style_value_t *)style->props_and_values;
|
||||
*value = values[i];
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(style->prop1 == prop) {
|
||||
*value = style->value1;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool remove_prop(lv_style_t * style, lv_style_prop_t prop)
|
||||
{
|
||||
if(style == NULL) return false;
|
||||
LV_ASSERT_STYLE(style);
|
||||
|
||||
if(!style->allocated) {
|
||||
if(style->prop1 == prop) {
|
||||
style->prop1 = _LV_STYLE_PROP_INV;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
uint8_t * tmp = style->props_and_values + style->prop_cnt * sizeof(lv_style_value_t);
|
||||
uint16_t * props = (uint16_t *) tmp;
|
||||
uint32_t i;
|
||||
for(i = 0; i < style->prop_cnt; i++) {
|
||||
if(props[i] == prop) {
|
||||
lv_style_value_t * values = (lv_style_value_t *)style->props_and_values;
|
||||
style->prop_cnt--;
|
||||
size_t size = style->prop_cnt * (sizeof(lv_style_value_t) + sizeof(uint16_t));
|
||||
uint8_t * new_values_and_props = lv_mem_alloc(size);
|
||||
|
||||
uint8_t * tmp = new_values_and_props + style->prop_cnt * sizeof(lv_style_value_t);
|
||||
uint16_t * new_props = (uint16_t *) tmp;
|
||||
lv_style_value_t * new_values = (lv_style_value_t *)new_values_and_props;
|
||||
|
||||
uint32_t j;
|
||||
for(j = 0; j < style->prop_cnt + 1; j++) { /* +1: because prop_cnt already reduced but all the old props. needs to be checked. */
|
||||
if(props[j] != prop) {
|
||||
*new_values = values[j];
|
||||
*new_props = props[j];
|
||||
|
||||
new_values++;
|
||||
new_props++;
|
||||
}
|
||||
}
|
||||
|
||||
lv_mem_free(style->props_and_values);
|
||||
style->props_and_values = new_values_and_props;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
+112
-79
@@ -63,6 +63,7 @@ typedef enum {
|
||||
LV_STYLE_ANIM_TIME = 10,
|
||||
LV_STYLE_TRANSITION = 11,
|
||||
LV_STYLE_SIZE = 12,
|
||||
LV_STYLE_BLEND_MODE = 13,
|
||||
|
||||
LV_STYLE_PAD_TOP = 20 | LV_STYLE_PROP_LAYOUT_REFR,
|
||||
LV_STYLE_PAD_BOTTOM = 21 | LV_STYLE_PROP_LAYOUT_REFR,
|
||||
@@ -77,63 +78,70 @@ typedef enum {
|
||||
LV_STYLE_BG_GRAD_COLOR = 32,
|
||||
LV_STYLE_BG_GRAD_COLOR_FILTERED = 32 | LV_STYLE_PROP_FILTER,
|
||||
LV_STYLE_BG_GRAD_DIR = 33,
|
||||
LV_STYLE_BG_BLEND_MODE = 34,
|
||||
LV_STYLE_BG_MAIN_STOP = 35,
|
||||
LV_STYLE_BG_GRAD_STOP = 36,
|
||||
|
||||
LV_STYLE_BORDER_COLOR = 40,
|
||||
LV_STYLE_BORDER_COLOR_FILTERED = 40 | LV_STYLE_PROP_FILTER,
|
||||
LV_STYLE_BORDER_OPA = 41,
|
||||
LV_STYLE_BORDER_WIDTH = 42,
|
||||
LV_STYLE_BORDER_SIDE = 43,
|
||||
LV_STYLE_BORDER_POST = 44,
|
||||
LV_STYLE_BORDER_BLEND_MODE = 45,
|
||||
LV_STYLE_BG_IMG_SRC = 40,
|
||||
LV_STYLE_BG_IMG_OPA = 41,
|
||||
LV_STYLE_BG_IMG_RECOLOR = 42,
|
||||
LV_STYLE_BG_IMG_RECOLOR_FILTERED = 43 | LV_STYLE_PROP_FILTER,
|
||||
LV_STYLE_BG_IMG_RECOLOR_OPA = 44,
|
||||
LV_STYLE_BG_IMG_TILED = 45,
|
||||
|
||||
LV_STYLE_TEXT_COLOR = 50 | LV_STYLE_PROP_INHERIT,
|
||||
LV_STYLE_TEXT_COLOR_FILTERED = 50 | LV_STYLE_PROP_INHERIT | LV_STYLE_PROP_FILTER,
|
||||
LV_STYLE_TEXT_OPA = 51 | LV_STYLE_PROP_INHERIT,
|
||||
LV_STYLE_TEXT_FONT = 52 | LV_STYLE_PROP_INHERIT,
|
||||
LV_STYLE_TEXT_LETTER_SPACE = 53 | LV_STYLE_PROP_INHERIT,
|
||||
LV_STYLE_TEXT_LINE_SPACE = 54 | LV_STYLE_PROP_INHERIT,
|
||||
LV_STYLE_TEXT_DECOR = 55 | LV_STYLE_PROP_INHERIT,
|
||||
LV_STYLE_TEXT_ALIGN = 56 | LV_STYLE_PROP_INHERIT,
|
||||
LV_STYLE_TEXT_BLEND_MODE = 57 | LV_STYLE_PROP_INHERIT,
|
||||
LV_STYLE_BORDER_COLOR = 50,
|
||||
LV_STYLE_BORDER_COLOR_FILTERED = 50 | LV_STYLE_PROP_FILTER,
|
||||
LV_STYLE_BORDER_OPA = 51,
|
||||
LV_STYLE_BORDER_WIDTH = 52,
|
||||
LV_STYLE_BORDER_SIDE = 53,
|
||||
LV_STYLE_BORDER_POST = 54,
|
||||
|
||||
LV_STYLE_IMG_OPA = 60,
|
||||
LV_STYLE_IMG_BLEND_MODE = 61,
|
||||
LV_STYLE_IMG_RECOLOR = 62,
|
||||
LV_STYLE_IMG_RECOLOR_FILTERED = 62 | LV_STYLE_PROP_FILTER,
|
||||
LV_STYLE_IMG_RECOLOR_OPA = 63,
|
||||
LV_STYLE_TEXT_COLOR = 60 | LV_STYLE_PROP_INHERIT,
|
||||
LV_STYLE_TEXT_COLOR_FILTERED = 60 | LV_STYLE_PROP_INHERIT | LV_STYLE_PROP_FILTER,
|
||||
LV_STYLE_TEXT_OPA = 61 | LV_STYLE_PROP_INHERIT,
|
||||
LV_STYLE_TEXT_FONT = 62 | LV_STYLE_PROP_INHERIT,
|
||||
LV_STYLE_TEXT_LETTER_SPACE = 63 | LV_STYLE_PROP_INHERIT,
|
||||
LV_STYLE_TEXT_LINE_SPACE = 64 | LV_STYLE_PROP_INHERIT,
|
||||
LV_STYLE_TEXT_DECOR = 65 | LV_STYLE_PROP_INHERIT,
|
||||
LV_STYLE_TEXT_ALIGN = 66 | LV_STYLE_PROP_INHERIT,
|
||||
|
||||
LV_STYLE_OUTLINE_WIDTH = 71 | LV_STYLE_PROP_EXT_DRAW,
|
||||
LV_STYLE_OUTLINE_COLOR = 72,
|
||||
LV_STYLE_OUTLINE_COLOR_FILTERED = 72 | LV_STYLE_PROP_FILTER,
|
||||
LV_STYLE_OUTLINE_OPA = 73 | LV_STYLE_PROP_EXT_DRAW,
|
||||
LV_STYLE_OUTLINE_PAD = 74 | LV_STYLE_PROP_EXT_DRAW,
|
||||
LV_STYLE_OUTLINE_BLEND_MODE = 75,
|
||||
LV_STYLE_IMG_OPA = 70,
|
||||
LV_STYLE_IMG_RECOLOR = 71,
|
||||
LV_STYLE_IMG_RECOLOR_FILTERED = 71 | LV_STYLE_PROP_FILTER,
|
||||
LV_STYLE_IMG_RECOLOR_OPA = 73,
|
||||
|
||||
LV_STYLE_SHADOW_WIDTH = 80 | LV_STYLE_PROP_EXT_DRAW,
|
||||
LV_STYLE_SHADOW_OFS_X = 81 | LV_STYLE_PROP_EXT_DRAW,
|
||||
LV_STYLE_SHADOW_OFS_Y = 82 | LV_STYLE_PROP_EXT_DRAW,
|
||||
LV_STYLE_SHADOW_SPREAD = 83 | LV_STYLE_PROP_EXT_DRAW,
|
||||
LV_STYLE_SHADOW_BLEND_MODE = 84,
|
||||
LV_STYLE_SHADOW_COLOR = 85,
|
||||
LV_STYLE_SHADOW_COLOR_FILTERED = 85 | LV_STYLE_PROP_FILTER,
|
||||
LV_STYLE_SHADOW_OPA = 86 | LV_STYLE_PROP_EXT_DRAW,
|
||||
LV_STYLE_OUTLINE_WIDTH = 80 | LV_STYLE_PROP_EXT_DRAW,
|
||||
LV_STYLE_OUTLINE_COLOR = 81,
|
||||
LV_STYLE_OUTLINE_COLOR_FILTERED = 81 | LV_STYLE_PROP_FILTER,
|
||||
LV_STYLE_OUTLINE_OPA = 82 | LV_STYLE_PROP_EXT_DRAW,
|
||||
LV_STYLE_OUTLINE_PAD = 83 | LV_STYLE_PROP_EXT_DRAW,
|
||||
|
||||
LV_STYLE_LINE_WIDTH = 90 | LV_STYLE_PROP_EXT_DRAW,
|
||||
LV_STYLE_LINE_BLEND_MODE = 91,
|
||||
LV_STYLE_LINE_DASH_WIDTH = 92,
|
||||
LV_STYLE_LINE_DASH_GAP = 93,
|
||||
LV_STYLE_LINE_ROUNDED = 94,
|
||||
LV_STYLE_LINE_COLOR = 95,
|
||||
LV_STYLE_LINE_COLOR_FILTERED = 95 | LV_STYLE_PROP_FILTER,
|
||||
LV_STYLE_LINE_OPA = 96,
|
||||
LV_STYLE_SHADOW_WIDTH = 90 | LV_STYLE_PROP_EXT_DRAW,
|
||||
LV_STYLE_SHADOW_OFS_X = 91 | LV_STYLE_PROP_EXT_DRAW,
|
||||
LV_STYLE_SHADOW_OFS_Y = 92 | LV_STYLE_PROP_EXT_DRAW,
|
||||
LV_STYLE_SHADOW_SPREAD = 93 | LV_STYLE_PROP_EXT_DRAW,
|
||||
LV_STYLE_SHADOW_COLOR = 94,
|
||||
LV_STYLE_SHADOW_COLOR_FILTERED = 94 | LV_STYLE_PROP_FILTER,
|
||||
LV_STYLE_SHADOW_OPA = 95 | LV_STYLE_PROP_EXT_DRAW,
|
||||
|
||||
LV_STYLE_CONTENT_SRC = 100 | LV_STYLE_PROP_EXT_DRAW,
|
||||
LV_STYLE_CONTENT_ALIGN = 101 | LV_STYLE_PROP_EXT_DRAW,
|
||||
LV_STYLE_CONTENT_OFS_X = 102 | LV_STYLE_PROP_EXT_DRAW,
|
||||
LV_STYLE_CONTENT_OFS_Y = 103 | LV_STYLE_PROP_EXT_DRAW,
|
||||
LV_STYLE_LINE_WIDTH = 100 | LV_STYLE_PROP_EXT_DRAW,
|
||||
LV_STYLE_LINE_DASH_WIDTH = 101,
|
||||
LV_STYLE_LINE_DASH_GAP = 102,
|
||||
LV_STYLE_LINE_ROUNDED = 103,
|
||||
LV_STYLE_LINE_COLOR = 104,
|
||||
LV_STYLE_LINE_COLOR_FILTERED = 104 | LV_STYLE_PROP_FILTER,
|
||||
LV_STYLE_LINE_OPA = 105,
|
||||
|
||||
LV_STYLE_CONTENT_TEXT = 110 | LV_STYLE_PROP_EXT_DRAW,
|
||||
LV_STYLE_CONTENT_ALIGN = 111 | LV_STYLE_PROP_EXT_DRAW,
|
||||
LV_STYLE_CONTENT_OFS_X = 112 | LV_STYLE_PROP_EXT_DRAW,
|
||||
LV_STYLE_CONTENT_OFS_Y = 113 | LV_STYLE_PROP_EXT_DRAW,
|
||||
LV_STYLE_CONTENT_FONT = 114 | LV_STYLE_PROP_EXT_DRAW | LV_STYLE_PROP_INHERIT,
|
||||
LV_STYLE_CONTENT_COLOR = 115 | LV_STYLE_PROP_INHERIT,
|
||||
LV_STYLE_CONTENT_COLOR_FILTERED = 115 | LV_STYLE_PROP_INHERIT | LV_STYLE_PROP_FILTER,
|
||||
LV_STYLE_CONTENT_OPA = 116 | LV_STYLE_PROP_EXT_DRAW | LV_STYLE_PROP_INHERIT,
|
||||
LV_STYLE_CONTENT_LETTER_SPACE = 117 | LV_STYLE_PROP_EXT_DRAW | LV_STYLE_PROP_INHERIT,
|
||||
LV_STYLE_CONTENT_LINE_SPACE = 118 | LV_STYLE_PROP_EXT_DRAW | LV_STYLE_PROP_INHERIT,
|
||||
LV_STYLE_CONTENT_DECOR = 119 | LV_STYLE_PROP_EXT_DRAW | LV_STYLE_PROP_INHERIT,
|
||||
|
||||
_LV_STYLE_LAST_BUILT_IN_PROP = 128,
|
||||
|
||||
@@ -147,7 +155,7 @@ typedef struct _lv_style_transiton_t{
|
||||
const lv_anim_path_t * path;
|
||||
uint32_t time;
|
||||
uint32_t delay;
|
||||
}lv_style_transiton_t;
|
||||
}lv_style_transition_t;
|
||||
|
||||
#if LV_USE_ASSERT_STYLE
|
||||
# define _LV_STYLE_SENTINEL uint32_t sentinel;
|
||||
@@ -196,7 +204,7 @@ void lv_style_set_prop(lv_style_t * style, lv_style_prop_t prop, lv_style_value_
|
||||
|
||||
bool lv_style_get_prop(lv_style_t * style, lv_style_prop_t prop, lv_style_value_t * value);
|
||||
|
||||
void lv_style_transition_init(lv_style_transiton_t * tr, const lv_style_prop_t * props, const lv_anim_path_t * path, uint32_t time, uint32_t delay);
|
||||
void lv_style_transition_init(lv_style_transition_t * tr, const lv_style_prop_t * props, const lv_anim_path_t * path, uint32_t time, uint32_t delay);
|
||||
|
||||
uint32_t lv_style_find_index_num(lv_style_value_t v);
|
||||
uint32_t lv_style_find_index_color(lv_style_value_t v);
|
||||
@@ -213,9 +221,6 @@ bool lv_style_remove_prop(lv_style_t * style, lv_style_prop_t prop);
|
||||
static inline void lv_style_set_radius(lv_style_t * style, lv_coord_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_RADIUS, v); }
|
||||
|
||||
static inline void lv_style_set_anim_time(lv_style_t * style, lv_coord_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_ANIM_TIME, v); }
|
||||
|
||||
static inline void lv_style_set_clip_corner(lv_style_t * style, bool value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_CLIP_CORNER, v); }
|
||||
|
||||
@@ -240,6 +245,18 @@ static inline void lv_style_set_color_filter_cb(lv_style_t * style, lv_color_fil
|
||||
static inline void lv_style_set_color_filter_opa(lv_style_t * style, lv_opa_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_COLOR_FILTER_OPA, v); }
|
||||
|
||||
static inline void lv_style_set_anim_time(lv_style_t * style, uint32_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_ANIM_TIME, v); }
|
||||
|
||||
static inline void lv_style_set_transition(lv_style_t * style, const lv_style_transition_t * value) {
|
||||
lv_style_value_t v = {.ptr = value}; lv_style_set_prop(style, LV_STYLE_TRANSITION, v); }
|
||||
|
||||
static inline void lv_style_set_size(lv_style_t * style, lv_coord_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_SIZE, v); }
|
||||
|
||||
static inline void lv_style_set_blend_mode(lv_style_t * style, lv_blend_mode_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_BLEND_MODE, v); }
|
||||
|
||||
static inline void lv_style_set_pad_top(lv_style_t * style, lv_coord_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_PAD_TOP, v); }
|
||||
|
||||
@@ -276,15 +293,27 @@ static inline void lv_style_set_bg_grad_color_filtered(lv_style_t * style, lv_co
|
||||
static inline void lv_style_set_bg_grad_dir(lv_style_t * style, lv_grad_dir_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_BG_GRAD_DIR, v); }
|
||||
|
||||
static inline void lv_style_set_bg_blend_mode(lv_style_t * style, lv_blend_mode_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_BG_BLEND_MODE, v); }
|
||||
|
||||
static inline void lv_style_set_bg_main_stop(lv_style_t * style, lv_coord_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_BG_MAIN_STOP, v); }
|
||||
|
||||
static inline void lv_style_set_bg_grad_stop(lv_style_t * style, lv_coord_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_BG_GRAD_STOP, v); }
|
||||
|
||||
static inline void lv_style_set_bg_img_src(lv_style_t * style, const void * value) {
|
||||
lv_style_value_t v = {.ptr = value}; lv_style_set_prop(style, LV_STYLE_BG_IMG_SRC, v); }
|
||||
|
||||
static inline void lv_style_set_bg_img_recolor(lv_style_t * style, lv_color_t value) {
|
||||
lv_style_value_t v = {.color = value}; lv_style_set_prop(style, LV_STYLE_BG_IMG_RECOLOR, v); }
|
||||
|
||||
static inline void lv_style_set_bg_img_recolor_filtered(lv_style_t * style, lv_color_t value) {
|
||||
lv_style_value_t v = {.color = value}; lv_style_set_prop(style, LV_STYLE_BG_IMG_RECOLOR_FILTERED, v); }
|
||||
|
||||
static inline void lv_style_set_bg_img_recolor_opa(lv_style_t * style, lv_opa_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_BG_IMG_RECOLOR_OPA, v); }
|
||||
|
||||
static inline void lv_style_set_bg_img_tiled(lv_style_t * style, bool value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_BG_IMG_TILED, v); }
|
||||
|
||||
static inline void lv_style_set_border_color(lv_style_t * style, lv_color_t value) {
|
||||
lv_style_value_t v = {.color = value}; lv_style_set_prop(style, LV_STYLE_BORDER_COLOR, v); }
|
||||
|
||||
@@ -303,9 +332,6 @@ static inline void lv_style_set_border_side(lv_style_t * style, lv_border_side_t
|
||||
static inline void lv_style_set_border_post(lv_style_t * style, bool value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_BORDER_POST, v); }
|
||||
|
||||
static inline void lv_style_set_border_blend_mode(lv_style_t * style, lv_blend_mode_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_BORDER_BLEND_MODE, v); }
|
||||
|
||||
static inline void lv_style_set_text_color(lv_style_t * style, lv_color_t value) {
|
||||
lv_style_value_t v = {.color = value}; lv_style_set_prop(style, LV_STYLE_TEXT_COLOR, v); }
|
||||
|
||||
@@ -327,15 +353,12 @@ static inline void lv_style_set_text_line_space(lv_style_t * style, lv_coord_t v
|
||||
static inline void lv_style_set_text_decor(lv_style_t * style, lv_text_decor_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_TEXT_DECOR, v); }
|
||||
|
||||
static inline void lv_style_set_text_blend_mode(lv_style_t * style, lv_blend_mode_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_TEXT_BLEND_MODE, v); }
|
||||
static inline void lv_style_set_text_align(lv_style_t * style, lv_text_align_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_TEXT_ALIGN, v); }
|
||||
|
||||
static inline void lv_style_set_img_opa(lv_style_t * style, lv_opa_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_IMG_OPA, v); }
|
||||
|
||||
static inline void lv_style_set_img_blend_mode(lv_style_t * style, lv_blend_mode_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_IMG_BLEND_MODE, v); }
|
||||
|
||||
static inline void lv_style_set_img_recolor(lv_style_t * style, lv_color_t value) {
|
||||
lv_style_value_t v = {.color = value}; lv_style_set_prop(style, LV_STYLE_IMG_RECOLOR, v); }
|
||||
|
||||
@@ -351,15 +374,15 @@ static inline void lv_style_set_outline_width(lv_style_t * style, lv_coord_t val
|
||||
static inline void lv_style_set_outline_color(lv_style_t * style, lv_color_t value) {
|
||||
lv_style_value_t v = {.color = value}; lv_style_set_prop(style, LV_STYLE_OUTLINE_COLOR, v); }
|
||||
|
||||
static inline void lv_style_set_outline_color_filtered(lv_style_t * style, lv_color_t value) {
|
||||
lv_style_value_t v = {.color = value}; lv_style_set_prop(style, LV_STYLE_OUTLINE_COLOR_FILTERED, v); }
|
||||
|
||||
static inline void lv_style_set_outline_opa(lv_style_t * style, lv_opa_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_OUTLINE_OPA, v); }
|
||||
|
||||
static inline void lv_style_set_outline_pad(lv_style_t * style, lv_coord_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_OUTLINE_PAD, v); }
|
||||
|
||||
static inline void lv_style_set_outline_blend_mode(lv_style_t * style, lv_blend_mode_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_OUTLINE_BLEND_MODE, v); }
|
||||
|
||||
static inline void lv_style_set_shadow_width(lv_style_t * style, lv_coord_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_SHADOW_WIDTH, v); }
|
||||
|
||||
@@ -372,9 +395,6 @@ static inline void lv_style_set_shadow_ofs_y(lv_style_t * style, lv_coord_t valu
|
||||
static inline void lv_style_set_shadow_spread(lv_style_t * style, lv_coord_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_SHADOW_SPREAD, v); }
|
||||
|
||||
static inline void lv_style_set_shadow_blend_mode(lv_style_t * style, lv_blend_mode_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_SHADOW_BLEND_MODE, v); }
|
||||
|
||||
static inline void lv_style_set_shadow_color(lv_style_t * style, lv_color_t value) {
|
||||
lv_style_value_t v = {.color = value}; lv_style_set_prop(style, LV_STYLE_SHADOW_COLOR, v); }
|
||||
|
||||
@@ -387,9 +407,6 @@ static inline void lv_style_set_shadow_opa(lv_style_t * style, lv_opa_t value) {
|
||||
static inline void lv_style_set_line_width(lv_style_t * style, lv_coord_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_LINE_WIDTH, v); }
|
||||
|
||||
static inline void lv_style_set_line_blend_mode(lv_style_t * style, lv_blend_mode_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_LINE_BLEND_MODE, v); }
|
||||
|
||||
static inline void lv_style_set_line_dash_width(lv_style_t * style, lv_coord_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_LINE_DASH_WIDTH, v); }
|
||||
|
||||
@@ -408,8 +425,8 @@ static inline void lv_style_set_line_color_filtered(lv_style_t * style, lv_color
|
||||
static inline void lv_style_set_line_opa(lv_style_t * style, lv_opa_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_LINE_OPA, v); }
|
||||
|
||||
static inline void lv_style_set_content_src(lv_style_t * style, const char * value) {
|
||||
lv_style_value_t v = {.ptr = value}; lv_style_set_prop(style, LV_STYLE_CONTENT_SRC, v); }
|
||||
static inline void lv_style_set_content_text(lv_style_t * style, const char * value) {
|
||||
lv_style_value_t v = {.ptr = value}; lv_style_set_prop(style, LV_STYLE_CONTENT_TEXT, v); }
|
||||
|
||||
static inline void lv_style_set_content_align(lv_style_t * style, lv_align_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_CONTENT_ALIGN, v); }
|
||||
@@ -420,11 +437,27 @@ static inline void lv_style_set_content_ofs_x(lv_style_t * style, lv_coord_t val
|
||||
static inline void lv_style_set_content_ofs_y(lv_style_t * style, lv_coord_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_CONTENT_OFS_Y, v); }
|
||||
|
||||
static inline void lv_style_set_transition(lv_style_t * style, const lv_style_transiton_t * value) {
|
||||
lv_style_value_t v = {.ptr = value}; lv_style_set_prop(style, LV_STYLE_TRANSITION, v); }
|
||||
static inline void lv_style_set_content_opa(lv_style_t * style, lv_opa_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_CONTENT_OPA, v); }
|
||||
|
||||
static inline void lv_style_set_content_font(lv_style_t * style, const lv_font_t * value) {
|
||||
lv_style_value_t v = {.ptr = value}; lv_style_set_prop(style, LV_STYLE_CONTENT_FONT, v); }
|
||||
|
||||
static inline void lv_style_set_content_color(lv_style_t * style, lv_color_t value) {
|
||||
lv_style_value_t v = {.color = value}; lv_style_set_prop(style, LV_STYLE_CONTENT_COLOR, v); }
|
||||
|
||||
static inline void lv_style_set_content_color_filtered(lv_style_t * style, lv_color_t value) {
|
||||
lv_style_value_t v = {.color = value}; lv_style_set_prop(style, LV_STYLE_CONTENT_COLOR_FILTERED, v); }
|
||||
|
||||
static inline void lv_style_set_content_letter_space(lv_style_t * style, lv_coord_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_CONTENT_LETTER_SPACE, v); }
|
||||
|
||||
static inline void lv_style_set_content_line_space(lv_style_t * style, lv_coord_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_CONTENT_LINE_SPACE, v); }
|
||||
|
||||
static inline void lv_style_set_content_decor(lv_style_t * style, lv_text_decor_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_CONTENT_DECOR, v); }
|
||||
|
||||
static inline void lv_style_set_size(lv_style_t * style, lv_coord_t value) {
|
||||
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_SIZE, v); }
|
||||
|
||||
static inline void lv_style_set_pad_ver(lv_style_t * style, lv_coord_t value)
|
||||
{
|
||||
|
||||
+97
-69
@@ -57,6 +57,14 @@ static void get_rounded_area(int16_t angle, lv_coord_t radius, uint8_t thickness
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_draw_arc_dsc_init(lv_draw_arc_dsc_t * dsc)
|
||||
{
|
||||
lv_memset_00(dsc, sizeof(lv_draw_arc_dsc_t));
|
||||
dsc->width = 1;
|
||||
dsc->opa = LV_OPA_COVER;
|
||||
dsc->color = LV_COLOR_BLACK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw an arc. (Can draw pie too with great thickness.)
|
||||
* @param center_x the x coordinate of the center of the arc
|
||||
@@ -69,7 +77,7 @@ static void get_rounded_area(int16_t angle, lv_coord_t radius, uint8_t thickness
|
||||
* @param dsc pointer to an initialized `lv_draw_line_dsc_t` variable
|
||||
*/
|
||||
void lv_draw_arc(lv_coord_t center_x, lv_coord_t center_y, uint16_t radius, uint16_t start_angle, uint16_t end_angle,
|
||||
const lv_area_t * clip_area, const lv_draw_line_dsc_t * dsc)
|
||||
const lv_area_t * clip_area, const lv_draw_arc_dsc_t * dsc)
|
||||
{
|
||||
if(dsc->opa <= LV_OPA_MIN) return;
|
||||
if(dsc->width == 0) return;
|
||||
@@ -80,22 +88,27 @@ void lv_draw_arc(lv_coord_t center_x, lv_coord_t center_y, uint16_t radius, uin
|
||||
|
||||
lv_draw_rect_dsc_t cir_dsc;
|
||||
lv_draw_rect_dsc_init(&cir_dsc);
|
||||
cir_dsc.radius = LV_RADIUS_CIRCLE;
|
||||
cir_dsc.bg_opa = LV_OPA_TRANSP;
|
||||
cir_dsc.border_opa = dsc->opa;
|
||||
cir_dsc.border_color = dsc->color;
|
||||
cir_dsc.border_width = width;
|
||||
cir_dsc.border_blend_mode = dsc->blend_mode;
|
||||
cir_dsc.bg_opa = dsc->opa;
|
||||
cir_dsc.bg_color = dsc->color;
|
||||
cir_dsc.blend_mode = dsc->blend_mode;
|
||||
cir_dsc.bg_img_src = dsc->bg_img_src;
|
||||
|
||||
lv_area_t area;
|
||||
area.x1 = center_x - radius;
|
||||
area.y1 = center_y - radius;
|
||||
area.x2 = center_x + radius - 1; /*-1 because the center already belongs to the left/bottom part*/
|
||||
area.y2 = center_y + radius - 1;
|
||||
lv_area_t area_out;
|
||||
area_out.x1 = center_x - radius;
|
||||
area_out.y1 = center_y - radius;
|
||||
area_out.x2 = center_x + radius - 1; /*-1 because the center already belongs to the left/bottom part*/
|
||||
area_out.y2 = center_y + radius - 1;
|
||||
|
||||
lv_area_t area_in;
|
||||
lv_area_copy(&area_in, &area_out);
|
||||
area_in.x1 += dsc->width;
|
||||
area_in.y1 += dsc->width;
|
||||
area_in.x2 -= dsc->width;
|
||||
area_in.y2 -= dsc->width;
|
||||
|
||||
/*Draw a full ring*/
|
||||
if(start_angle + 360 == end_angle || start_angle == end_angle + 360) {
|
||||
lv_draw_rect(&area, clip_area, &cir_dsc);
|
||||
lv_draw_rect(&area_out, clip_area, &cir_dsc);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -104,9 +117,17 @@ void lv_draw_arc(lv_coord_t center_x, lv_coord_t center_y, uint16_t radius, uin
|
||||
|
||||
lv_draw_mask_angle_param_t mask_angle_param;
|
||||
lv_draw_mask_angle_init(&mask_angle_param, center_x, center_y, start_angle, end_angle);
|
||||
|
||||
int16_t mask_angle_id = lv_draw_mask_add(&mask_angle_param, NULL);
|
||||
|
||||
/*Create inner the mask*/
|
||||
lv_draw_mask_radius_param_t mask_in_param;
|
||||
lv_draw_mask_radius_init(&mask_in_param, &area_in, LV_RADIUS_CIRCLE, true);
|
||||
int16_t mask_in_id = lv_draw_mask_add(&mask_in_param, NULL);
|
||||
|
||||
lv_draw_mask_radius_param_t mask_out_param;
|
||||
lv_draw_mask_radius_init(&mask_out_param, &area_out, LV_RADIUS_CIRCLE, false);
|
||||
int16_t mask_out_id = lv_draw_mask_add(&mask_out_param, NULL);
|
||||
|
||||
int32_t angle_gap;
|
||||
if(end_angle > start_angle) {
|
||||
angle_gap = 360 - (end_angle - start_angle);
|
||||
@@ -126,7 +147,7 @@ void lv_draw_arc(lv_coord_t center_x, lv_coord_t center_y, uint16_t radius, uin
|
||||
q_dsc.end_quarter = (end_angle / 90) & 0x3;
|
||||
q_dsc.width = width;
|
||||
q_dsc.draw_dsc = &cir_dsc;
|
||||
q_dsc.draw_area = &area;
|
||||
q_dsc.draw_area = &area_out;
|
||||
q_dsc.clip_area = clip_area;
|
||||
|
||||
draw_quarter_0(&q_dsc);
|
||||
@@ -135,35 +156,42 @@ void lv_draw_arc(lv_coord_t center_x, lv_coord_t center_y, uint16_t radius, uin
|
||||
draw_quarter_3(&q_dsc);
|
||||
}
|
||||
else {
|
||||
lv_draw_rect(&area, clip_area, &cir_dsc);
|
||||
lv_draw_rect(&area_out, clip_area, &cir_dsc);
|
||||
}
|
||||
lv_draw_mask_remove_id(mask_angle_id);
|
||||
lv_draw_mask_remove_id(mask_out_id);
|
||||
lv_draw_mask_remove_id(mask_in_id);
|
||||
|
||||
if(dsc->round_start || dsc->round_end) {
|
||||
cir_dsc.bg_color = dsc->color;
|
||||
cir_dsc.bg_opa = dsc->opa;
|
||||
cir_dsc.bg_blend_mode = dsc->blend_mode;
|
||||
cir_dsc.border_width = 0;
|
||||
if(dsc->rounded) {
|
||||
|
||||
lv_draw_mask_radius_param_t mask_end_param;
|
||||
|
||||
lv_area_t round_area;
|
||||
if(dsc->round_start) {
|
||||
get_rounded_area(start_angle, radius, width, &round_area);
|
||||
round_area.x1 += center_x;
|
||||
round_area.x2 += center_x;
|
||||
round_area.y1 += center_y;
|
||||
round_area.y2 += center_y;
|
||||
get_rounded_area(start_angle, radius, width, &round_area);
|
||||
round_area.x1 += center_x;
|
||||
round_area.x2 += center_x;
|
||||
round_area.y1 += center_y;
|
||||
round_area.y2 += center_y;
|
||||
lv_area_t clip_area2;
|
||||
if(_lv_area_intersect(&clip_area2, clip_area, &round_area)) {
|
||||
lv_draw_mask_radius_init(&mask_end_param, &round_area, LV_RADIUS_CIRCLE, false);
|
||||
int16_t mask_end_id = lv_draw_mask_add(&mask_end_param, NULL);
|
||||
|
||||
lv_draw_rect(&round_area, clip_area, &cir_dsc);
|
||||
lv_draw_rect(&area_out, &clip_area2, &cir_dsc);
|
||||
lv_draw_mask_remove_id(mask_end_id);
|
||||
}
|
||||
|
||||
if(dsc->round_end) {
|
||||
get_rounded_area(end_angle, radius, width, &round_area);
|
||||
round_area.x1 += center_x;
|
||||
round_area.x2 += center_x;
|
||||
round_area.y1 += center_y;
|
||||
round_area.y2 += center_y;
|
||||
get_rounded_area(end_angle, radius, width, &round_area);
|
||||
round_area.x1 += center_x;
|
||||
round_area.x2 += center_x;
|
||||
round_area.y1 += center_y;
|
||||
round_area.y2 += center_y;
|
||||
if(_lv_area_intersect(&clip_area2, clip_area, &round_area)) {
|
||||
lv_draw_mask_radius_init(&mask_end_param, &round_area, LV_RADIUS_CIRCLE, false);
|
||||
int16_t mask_end_id = lv_draw_mask_add(&mask_end_param, NULL);
|
||||
|
||||
lv_draw_rect(&round_area, clip_area, &cir_dsc);
|
||||
lv_draw_rect(&area_out, &clip_area2, &cir_dsc);
|
||||
lv_draw_mask_remove_id(mask_end_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -178,11 +206,11 @@ static void draw_quarter_0(quarter_draw_dsc_t * q)
|
||||
|
||||
if(q->start_quarter == 0 && q->end_quarter == 0 && q->start_angle < q->end_angle) {
|
||||
/*Small arc here*/
|
||||
quarter_area.y1 = q->center_y + ((_lv_trigo_sin(q->start_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.x2 = q->center_x + ((_lv_trigo_sin(q->start_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.y1 = q->center_y + ((lv_trigo_sin(q->start_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.x2 = q->center_x + ((lv_trigo_sin(q->start_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT);
|
||||
|
||||
quarter_area.y2 = q->center_y + ((_lv_trigo_sin(q->end_angle) * q->radius) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.x1 = q->center_x + ((_lv_trigo_sin(q->end_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.y2 = q->center_y + ((lv_trigo_sin(q->end_angle) * q->radius) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.x1 = q->center_x + ((lv_trigo_sin(q->end_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT);
|
||||
|
||||
bool ok = _lv_area_intersect(&quarter_area, &quarter_area, q->clip_area);
|
||||
if(ok) lv_draw_rect(q->draw_area, &quarter_area, q->draw_dsc);
|
||||
@@ -193,8 +221,8 @@ static void draw_quarter_0(quarter_draw_dsc_t * q)
|
||||
quarter_area.x1 = q->center_x;
|
||||
quarter_area.y2 = q->center_y + q->radius;
|
||||
|
||||
quarter_area.y1 = q->center_y + ((_lv_trigo_sin(q->start_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.x2 = q->center_x + ((_lv_trigo_sin(q->start_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.y1 = q->center_y + ((lv_trigo_sin(q->start_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.x2 = q->center_x + ((lv_trigo_sin(q->start_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT);
|
||||
|
||||
bool ok = _lv_area_intersect(&quarter_area, &quarter_area, q->clip_area);
|
||||
if(ok) lv_draw_rect(q->draw_area, &quarter_area, q->draw_dsc);
|
||||
@@ -203,8 +231,8 @@ static void draw_quarter_0(quarter_draw_dsc_t * q)
|
||||
quarter_area.x2 = q->center_x + q->radius;
|
||||
quarter_area.y1 = q->center_y;
|
||||
|
||||
quarter_area.y2 = q->center_y + ((_lv_trigo_sin(q->end_angle) * q->radius) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.x1 = q->center_x + ((_lv_trigo_sin(q->end_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.y2 = q->center_y + ((lv_trigo_sin(q->end_angle) * q->radius) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.x1 = q->center_x + ((lv_trigo_sin(q->end_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT);
|
||||
|
||||
bool ok = _lv_area_intersect(&quarter_area, &quarter_area, q->clip_area);
|
||||
if(ok) lv_draw_rect(q->draw_area, &quarter_area, q->draw_dsc);
|
||||
@@ -231,11 +259,11 @@ static void draw_quarter_1(quarter_draw_dsc_t * q)
|
||||
|
||||
if(q->start_quarter == 1 && q->end_quarter == 1 && q->start_angle < q->end_angle) {
|
||||
/*Small arc here*/
|
||||
quarter_area.y2 = q->center_y + ((_lv_trigo_sin(q->start_angle) * (q->radius)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.x2 = q->center_x + ((_lv_trigo_sin(q->start_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.y2 = q->center_y + ((lv_trigo_sin(q->start_angle) * (q->radius)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.x2 = q->center_x + ((lv_trigo_sin(q->start_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT);
|
||||
|
||||
quarter_area.y1 = q->center_y + ((_lv_trigo_sin(q->end_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.x1 = q->center_x + ((_lv_trigo_sin(q->end_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.y1 = q->center_y + ((lv_trigo_sin(q->end_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.x1 = q->center_x + ((lv_trigo_sin(q->end_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT);
|
||||
|
||||
bool ok = _lv_area_intersect(&quarter_area, &quarter_area, q->clip_area);
|
||||
if(ok) lv_draw_rect(q->draw_area, &quarter_area, q->draw_dsc);
|
||||
@@ -246,8 +274,8 @@ static void draw_quarter_1(quarter_draw_dsc_t * q)
|
||||
quarter_area.x1 = q->center_x - q->radius;
|
||||
quarter_area.y1 = q->center_y;
|
||||
|
||||
quarter_area.y2 = q->center_y + ((_lv_trigo_sin(q->start_angle) * (q->radius)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.x2 = q->center_x + ((_lv_trigo_sin(q->start_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.y2 = q->center_y + ((lv_trigo_sin(q->start_angle) * (q->radius)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.x2 = q->center_x + ((lv_trigo_sin(q->start_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT);
|
||||
|
||||
bool ok = _lv_area_intersect(&quarter_area, &quarter_area, q->clip_area);
|
||||
if(ok) lv_draw_rect(q->draw_area, &quarter_area, q->draw_dsc);
|
||||
@@ -256,8 +284,8 @@ static void draw_quarter_1(quarter_draw_dsc_t * q)
|
||||
quarter_area.x2 = q->center_x - 1;
|
||||
quarter_area.y2 = q->center_y + q->radius;
|
||||
|
||||
quarter_area.y1 = q->center_y + ((_lv_trigo_sin(q->end_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.x1 = q->center_x + ((_lv_trigo_sin(q->end_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.y1 = q->center_y + ((lv_trigo_sin(q->end_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.x1 = q->center_x + ((lv_trigo_sin(q->end_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT);
|
||||
|
||||
bool ok = _lv_area_intersect(&quarter_area, &quarter_area, q->clip_area);
|
||||
if(ok) lv_draw_rect(q->draw_area, &quarter_area, q->draw_dsc);
|
||||
@@ -284,11 +312,11 @@ static void draw_quarter_2(quarter_draw_dsc_t * q)
|
||||
|
||||
if(q->start_quarter == 2 && q->end_quarter == 2 && q->start_angle < q->end_angle) {
|
||||
/*Small arc here*/
|
||||
quarter_area.x1 = q->center_x + ((_lv_trigo_sin(q->start_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.y2 = q->center_y + ((_lv_trigo_sin(q->start_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.x1 = q->center_x + ((lv_trigo_sin(q->start_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.y2 = q->center_y + ((lv_trigo_sin(q->start_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT);
|
||||
|
||||
quarter_area.y1 = q->center_y + ((_lv_trigo_sin(q->end_angle) * q->radius) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.x2 = q->center_x + ((_lv_trigo_sin(q->end_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.y1 = q->center_y + ((lv_trigo_sin(q->end_angle) * q->radius) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.x2 = q->center_x + ((lv_trigo_sin(q->end_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT);
|
||||
|
||||
bool ok = _lv_area_intersect(&quarter_area, &quarter_area, q->clip_area);
|
||||
if(ok) lv_draw_rect(q->draw_area, &quarter_area, q->draw_dsc);
|
||||
@@ -299,8 +327,8 @@ static void draw_quarter_2(quarter_draw_dsc_t * q)
|
||||
quarter_area.x2 = q->center_x - 1;
|
||||
quarter_area.y1 = q->center_y - q->radius;
|
||||
|
||||
quarter_area.x1 = q->center_x + ((_lv_trigo_sin(q->start_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.y2 = q->center_y + ((_lv_trigo_sin(q->start_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.x1 = q->center_x + ((lv_trigo_sin(q->start_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.y2 = q->center_y + ((lv_trigo_sin(q->start_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT);
|
||||
|
||||
bool ok = _lv_area_intersect(&quarter_area, &quarter_area, q->clip_area);
|
||||
if(ok) lv_draw_rect(q->draw_area, &quarter_area, q->draw_dsc);
|
||||
@@ -309,8 +337,8 @@ static void draw_quarter_2(quarter_draw_dsc_t * q)
|
||||
quarter_area.x1 = q->center_x - q->radius;
|
||||
quarter_area.y2 = q->center_y - 1;
|
||||
|
||||
quarter_area.x2 = q->center_x + ((_lv_trigo_sin(q->end_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.y1 = q->center_y + ((_lv_trigo_sin(q->end_angle) * (q->radius)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.x2 = q->center_x + ((lv_trigo_sin(q->end_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.y1 = q->center_y + ((lv_trigo_sin(q->end_angle) * (q->radius)) >> LV_TRIGO_SHIFT);
|
||||
|
||||
bool ok = _lv_area_intersect(&quarter_area, &quarter_area, q->clip_area);
|
||||
if(ok) lv_draw_rect(q->draw_area, &quarter_area, q->draw_dsc);
|
||||
@@ -338,11 +366,11 @@ static void draw_quarter_3(quarter_draw_dsc_t * q)
|
||||
|
||||
if(q->start_quarter == 3 && q->end_quarter == 3 && q->start_angle < q->end_angle) {
|
||||
/*Small arc here*/
|
||||
quarter_area.x1 = q->center_x + ((_lv_trigo_sin(q->start_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.y1 = q->center_y + ((_lv_trigo_sin(q->start_angle) * (q->radius)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.x1 = q->center_x + ((lv_trigo_sin(q->start_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.y1 = q->center_y + ((lv_trigo_sin(q->start_angle) * (q->radius)) >> LV_TRIGO_SHIFT);
|
||||
|
||||
quarter_area.x2 = q->center_x + ((_lv_trigo_sin(q->end_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.y2 = q->center_y + ((_lv_trigo_sin(q->end_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.x2 = q->center_x + ((lv_trigo_sin(q->end_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.y2 = q->center_y + ((lv_trigo_sin(q->end_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT);
|
||||
|
||||
bool ok = _lv_area_intersect(&quarter_area, &quarter_area, q->clip_area);
|
||||
if(ok) lv_draw_rect(q->draw_area, &quarter_area, q->draw_dsc);
|
||||
@@ -353,8 +381,8 @@ static void draw_quarter_3(quarter_draw_dsc_t * q)
|
||||
quarter_area.x2 = q->center_x + q->radius;
|
||||
quarter_area.y2 = q->center_y - 1;
|
||||
|
||||
quarter_area.x1 = q->center_x + ((_lv_trigo_sin(q->start_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.y1 = q->center_y + ((_lv_trigo_sin(q->start_angle) * (q->radius)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.x1 = q->center_x + ((lv_trigo_sin(q->start_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.y1 = q->center_y + ((lv_trigo_sin(q->start_angle) * (q->radius)) >> LV_TRIGO_SHIFT);
|
||||
|
||||
bool ok = _lv_area_intersect(&quarter_area, &quarter_area, q->clip_area);
|
||||
if(ok) lv_draw_rect(q->draw_area, &quarter_area, q->draw_dsc);
|
||||
@@ -363,8 +391,8 @@ static void draw_quarter_3(quarter_draw_dsc_t * q)
|
||||
quarter_area.x1 = q->center_x;
|
||||
quarter_area.y1 = q->center_y - q->radius;
|
||||
|
||||
quarter_area.x2 = q->center_x + ((_lv_trigo_sin(q->end_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.y2 = q->center_y + ((_lv_trigo_sin(q->end_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.x2 = q->center_x + ((lv_trigo_sin(q->end_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT);
|
||||
quarter_area.y2 = q->center_y + ((lv_trigo_sin(q->end_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT);
|
||||
|
||||
bool ok = _lv_area_intersect(&quarter_area, &quarter_area, q->clip_area);
|
||||
if(ok) lv_draw_rect(q->draw_area, &quarter_area, q->draw_dsc);
|
||||
@@ -397,8 +425,8 @@ static void get_rounded_area(int16_t angle, lv_coord_t radius, uint8_t thickness
|
||||
int32_t cir_x;
|
||||
int32_t cir_y;
|
||||
|
||||
cir_x = ((radius - thick_half) * _lv_trigo_sin(90 - angle)) >> (LV_TRIGO_SHIFT - ps);
|
||||
cir_y = ((radius - thick_half) * _lv_trigo_sin(angle)) >> (LV_TRIGO_SHIFT - ps);
|
||||
cir_x = ((radius - thick_half) * lv_trigo_sin(90 - angle)) >> (LV_TRIGO_SHIFT - ps);
|
||||
cir_y = ((radius - thick_half) * lv_trigo_sin(angle)) >> (LV_TRIGO_SHIFT - ps);
|
||||
|
||||
/* Actually the center of the pixel need to be calculated so apply 1/2 px offset*/
|
||||
if(cir_x > 0) {
|
||||
|
||||
@@ -22,11 +22,22 @@ extern "C" {
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
typedef struct {
|
||||
lv_color_t color;
|
||||
lv_coord_t width;
|
||||
const void * bg_img_src;
|
||||
lv_opa_t opa;
|
||||
lv_blend_mode_t blend_mode : 2;
|
||||
uint8_t rounded : 1;
|
||||
} lv_draw_arc_dsc_t;
|
||||
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_draw_arc_dsc_init(lv_draw_arc_dsc_t * dsc);
|
||||
|
||||
/**
|
||||
* Draw an arc. (Can draw pie too with great thickness.)
|
||||
* @param center_x the x coordinate of the center of the arc
|
||||
@@ -39,7 +50,7 @@ extern "C" {
|
||||
* @param dsc pointer to an initialized `lv_draw_line_dsc_t` variable
|
||||
*/
|
||||
void lv_draw_arc(lv_coord_t center_x, lv_coord_t center_y, uint16_t radius, uint16_t start_angle, uint16_t end_angle,
|
||||
const lv_area_t * clip_area, const lv_draw_line_dsc_t * dsc);
|
||||
const lv_area_t * clip_area, const lv_draw_arc_dsc_t * dsc);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
|
||||
+16
-16
@@ -801,7 +801,7 @@ LV_ATTRIBUTE_FAST_MEM static void map_normal(const lv_area_t * disp_area, lv_col
|
||||
|
||||
/*Software rendering*/
|
||||
for(y = 0; y < draw_area_h; y++) {
|
||||
_lv_memcpy(disp_buf_first, map_buf_first, draw_area_w * sizeof(lv_color_t));
|
||||
lv_memcpy(disp_buf_first, map_buf_first, draw_area_w * sizeof(lv_color_t));
|
||||
disp_buf_first += disp_w;
|
||||
map_buf_first += map_w;
|
||||
}
|
||||
@@ -1041,41 +1041,41 @@ static inline lv_color_t color_blend_true_color_additive(lv_color_t fg, lv_color
|
||||
uint32_t tmp;
|
||||
#if LV_COLOR_DEPTH == 1
|
||||
tmp = bg.full + fg.full;
|
||||
fg.full = LV_MATH_MIN(tmp, 1);
|
||||
fg.full = LV_MIN(tmp, 1);
|
||||
#else
|
||||
tmp = bg.ch.red + fg.ch.red;
|
||||
#if LV_COLOR_DEPTH == 8
|
||||
fg.ch.red = LV_MATH_MIN(tmp, 7);
|
||||
fg.ch.red = LV_MIN(tmp, 7);
|
||||
#elif LV_COLOR_DEPTH == 16
|
||||
fg.ch.red = LV_MATH_MIN(tmp, 31);
|
||||
fg.ch.red = LV_MIN(tmp, 31);
|
||||
#elif LV_COLOR_DEPTH == 32
|
||||
fg.ch.red = LV_MATH_MIN(tmp, 255);
|
||||
fg.ch.red = LV_MIN(tmp, 255);
|
||||
#endif
|
||||
|
||||
#if LV_COLOR_DEPTH == 8
|
||||
fg.ch.green = LV_MATH_MIN(tmp, 7);
|
||||
fg.ch.green = LV_MIN(tmp, 7);
|
||||
#elif LV_COLOR_DEPTH == 16
|
||||
#if LV_COLOR_16_SWAP == 0
|
||||
tmp = bg.ch.green + fg.ch.green;
|
||||
fg.ch.green = LV_MATH_MIN(tmp, 63);
|
||||
fg.ch.green = LV_MIN(tmp, 63);
|
||||
#else
|
||||
tmp = (bg.ch.green_h << 3) + bg.ch.green_l + (fg.ch.green_h << 3) + fg.ch.green_l;
|
||||
tmp = LV_MATH_MIN(tmp, 63);
|
||||
tmp = LV_MIN(tmp, 63);
|
||||
fg.ch.green_h = tmp >> 3;
|
||||
fg.ch.green_l = tmp & 0x7;
|
||||
#endif
|
||||
|
||||
#elif LV_COLOR_DEPTH == 32
|
||||
fg.ch.green = LV_MATH_MIN(tmp, 255);
|
||||
fg.ch.green = LV_MIN(tmp, 255);
|
||||
#endif
|
||||
|
||||
tmp = bg.ch.blue + fg.ch.blue;
|
||||
#if LV_COLOR_DEPTH == 8
|
||||
fg.ch.blue = LV_MATH_MIN(tmp, 4);
|
||||
fg.ch.blue = LV_MIN(tmp, 4);
|
||||
#elif LV_COLOR_DEPTH == 16
|
||||
fg.ch.blue = LV_MATH_MIN(tmp, 31);
|
||||
fg.ch.blue = LV_MIN(tmp, 31);
|
||||
#elif LV_COLOR_DEPTH == 32
|
||||
fg.ch.blue = LV_MATH_MIN(tmp, 255);
|
||||
fg.ch.blue = LV_MIN(tmp, 255);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1091,20 +1091,20 @@ static inline lv_color_t color_blend_true_color_subtractive(lv_color_t fg, lv_co
|
||||
|
||||
int32_t tmp;
|
||||
tmp = bg.ch.red - fg.ch.red;
|
||||
fg.ch.red = LV_MATH_MAX(tmp, 0);
|
||||
fg.ch.red = LV_MAX(tmp, 0);
|
||||
|
||||
#if LV_COLOR_16_SWAP == 0
|
||||
tmp = bg.ch.green - fg.ch.green;
|
||||
fg.ch.green = LV_MATH_MAX(tmp, 0);
|
||||
fg.ch.green = LV_MAX(tmp, 0);
|
||||
#else
|
||||
tmp = (bg.ch.green_h << 3) + bg.ch.green_l + (fg.ch.green_h << 3) + fg.ch.green_l;
|
||||
tmp = LV_MATH_MAX(tmp, 0);
|
||||
tmp = LV_MAX(tmp, 0);
|
||||
fg.ch.green_h = tmp >> 3;
|
||||
fg.ch.green_l = tmp & 0x7;
|
||||
#endif
|
||||
|
||||
tmp = bg.ch.blue - fg.ch.blue;
|
||||
fg.ch.blue = LV_MATH_MAX(tmp, 0);
|
||||
fg.ch.blue = LV_MAX(tmp, 0);
|
||||
|
||||
if(opa == LV_OPA_COVER) return fg;
|
||||
|
||||
|
||||
+16
-16
@@ -56,7 +56,7 @@ static void draw_cleanup(lv_img_cache_entry_t * cache);
|
||||
|
||||
void lv_draw_img_dsc_init(lv_draw_img_dsc_t * dsc)
|
||||
{
|
||||
_lv_memset_00(dsc, sizeof(lv_draw_img_dsc_t));
|
||||
lv_memset_00(dsc, sizeof(lv_draw_img_dsc_t));
|
||||
dsc->recolor = LV_COLOR_BLACK;
|
||||
dsc->opa = LV_OPA_COVER;
|
||||
dsc->zoom = LV_IMG_ZOOM_NONE;
|
||||
@@ -289,7 +289,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_res_t lv_img_draw_core(const lv_area_t * coords,
|
||||
|
||||
int32_t width = lv_area_get_width(&mask_com);
|
||||
|
||||
uint8_t * buf = _lv_mem_buf_get(lv_area_get_width(&mask_com) *
|
||||
uint8_t * buf = lv_mem_buf_get(lv_area_get_width(&mask_com) *
|
||||
LV_IMG_PX_SIZE_ALPHA_BYTE); /*+1 because of the possible alpha byte*/
|
||||
|
||||
lv_area_t line;
|
||||
@@ -308,7 +308,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_res_t lv_img_draw_core(const lv_area_t * coords,
|
||||
if(read_res != LV_RES_OK) {
|
||||
lv_img_decoder_close(&cdsc->dec_dsc);
|
||||
LV_LOG_WARN("Image draw can't read the line");
|
||||
_lv_mem_buf_release(buf);
|
||||
lv_mem_buf_release(buf);
|
||||
draw_cleanup(cdsc);
|
||||
return LV_RES_INV;
|
||||
}
|
||||
@@ -319,7 +319,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_res_t lv_img_draw_core(const lv_area_t * coords,
|
||||
line.y2++;
|
||||
y++;
|
||||
}
|
||||
_lv_mem_buf_release(buf);
|
||||
lv_mem_buf_release(buf);
|
||||
}
|
||||
|
||||
draw_cleanup(cdsc);
|
||||
@@ -426,8 +426,8 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
|
||||
#endif
|
||||
uint32_t hor_res = (uint32_t) lv_disp_get_hor_res(disp);
|
||||
uint32_t mask_buf_size = lv_area_get_size(&draw_area) > (uint32_t) hor_res ? hor_res : lv_area_get_size(&draw_area);
|
||||
lv_color_t * map2 = _lv_mem_buf_get(mask_buf_size * sizeof(lv_color_t));
|
||||
lv_opa_t * mask_buf = _lv_mem_buf_get(mask_buf_size);
|
||||
lv_color_t * map2 = lv_mem_buf_get(mask_buf_size * sizeof(lv_color_t));
|
||||
lv_opa_t * mask_buf = lv_mem_buf_get(mask_buf_size);
|
||||
|
||||
int32_t x;
|
||||
int32_t y;
|
||||
@@ -469,20 +469,20 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
|
||||
_lv_blend_map(clip_area, &blend_area, map2, mask_buf, LV_DRAW_MASK_RES_CHANGED, draw_dsc->opa, draw_dsc->blend_mode);
|
||||
}
|
||||
|
||||
_lv_mem_buf_release(mask_buf);
|
||||
_lv_mem_buf_release(map2);
|
||||
lv_mem_buf_release(mask_buf);
|
||||
lv_mem_buf_release(map2);
|
||||
}
|
||||
/*Most complicated case: transform or other mask or chroma keyed*/
|
||||
else {
|
||||
/*Build the image and a mask line-by-line*/
|
||||
uint32_t hor_res = (uint32_t) lv_disp_get_hor_res(disp);
|
||||
uint32_t mask_buf_size = lv_area_get_size(&draw_area) > hor_res ? hor_res : lv_area_get_size(&draw_area);
|
||||
lv_color_t * map2 = _lv_mem_buf_get(mask_buf_size * sizeof(lv_color_t));
|
||||
lv_opa_t * mask_buf = _lv_mem_buf_get(mask_buf_size);
|
||||
lv_color_t * map2 = lv_mem_buf_get(mask_buf_size * sizeof(lv_color_t));
|
||||
lv_opa_t * mask_buf = lv_mem_buf_get(mask_buf_size);
|
||||
|
||||
#if LV_USE_IMG_TRANSFORM
|
||||
lv_img_transform_dsc_t trans_dsc;
|
||||
_lv_memset_00(&trans_dsc, sizeof(lv_img_transform_dsc_t));
|
||||
lv_memset_00(&trans_dsc, sizeof(lv_img_transform_dsc_t));
|
||||
if(transform) {
|
||||
lv_img_cf_t cf = LV_IMG_CF_TRUE_COLOR;
|
||||
if(alpha_byte) cf = LV_IMG_CF_TRUE_COLOR_ALPHA;
|
||||
@@ -515,7 +515,7 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
|
||||
|
||||
/*Prepare the `mask_buf`if there are other masks*/
|
||||
if(other_mask_cnt) {
|
||||
_lv_memset_ff(mask_buf, mask_buf_size);
|
||||
lv_memset_ff(mask_buf, mask_buf_size);
|
||||
}
|
||||
|
||||
int32_t x;
|
||||
@@ -600,7 +600,7 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
|
||||
mask_res_sub = lv_draw_mask_apply(mask_buf + px_i_start, draw_area.x1 + vdb->area.x1, y + draw_area.y1 + vdb->area.y1,
|
||||
lv_area_get_width(&draw_area));
|
||||
if(mask_res_sub == LV_DRAW_MASK_RES_TRANSP) {
|
||||
_lv_memset_00(mask_buf + px_i_start, lv_area_get_width(&draw_area));
|
||||
lv_memset_00(mask_buf + px_i_start, lv_area_get_width(&draw_area));
|
||||
mask_res = LV_DRAW_MASK_RES_CHANGED;
|
||||
}
|
||||
else if(mask_res_sub == LV_DRAW_MASK_RES_CHANGED) {
|
||||
@@ -625,7 +625,7 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
|
||||
|
||||
/*Prepare the `mask_buf`if there are other masks*/
|
||||
if(other_mask_cnt) {
|
||||
_lv_memset_ff(mask_buf, mask_buf_size);
|
||||
lv_memset_ff(mask_buf, mask_buf_size);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -636,8 +636,8 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
|
||||
_lv_blend_map(clip_area, &blend_area, map2, mask_buf, mask_res, draw_dsc->opa, draw_dsc->blend_mode);
|
||||
}
|
||||
|
||||
_lv_mem_buf_release(mask_buf);
|
||||
_lv_mem_buf_release(map2);
|
||||
lv_mem_buf_release(mask_buf);
|
||||
lv_mem_buf_release(map2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+13
-13
@@ -92,7 +92,7 @@ const uint8_t _lv_bpp8_opa_table[256] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 1
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_draw_label_dsc_init(lv_draw_label_dsc_t * dsc)
|
||||
{
|
||||
_lv_memset_00(dsc, sizeof(lv_draw_label_dsc_t));
|
||||
lv_memset_00(dsc, sizeof(lv_draw_label_dsc_t));
|
||||
dsc->opa = LV_OPA_COVER;
|
||||
dsc->color = LV_COLOR_BLACK;
|
||||
dsc->font = LV_THEME_DEFAULT_FONT_NORMAL;
|
||||
@@ -162,7 +162,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area
|
||||
/*Check the hint to use the cached info*/
|
||||
if(hint && y_ofs == 0 && coords->y1 < 0) {
|
||||
/*If the label changed too much recalculate the hint.*/
|
||||
if(LV_MATH_ABS(hint->coord_y - coords->y1) > LV_LABEL_HINT_UPDATE_TH - 2 * line_height) {
|
||||
if(LV_ABS(hint->coord_y - coords->y1) > LV_LABEL_HINT_UPDATE_TH - 2 * line_height) {
|
||||
hint->line_start = -1;
|
||||
}
|
||||
last_line_start = hint->line_start;
|
||||
@@ -245,7 +245,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area
|
||||
cmd_state = CMD_STATE_WAIT;
|
||||
i = 0;
|
||||
#if LV_USE_BIDI
|
||||
char * bidi_txt = _lv_mem_buf_get(line_end - line_start + 1);
|
||||
char * bidi_txt = lv_mem_buf_get(line_end - line_start + 1);
|
||||
_lv_bidi_process_paragraph(txt + line_start, bidi_txt, line_end - line_start, dsc->bidi_dir, NULL, 0);
|
||||
#else
|
||||
const char * bidi_txt = txt + line_start;
|
||||
@@ -289,7 +289,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area
|
||||
/*Get the parameter*/
|
||||
if(i - par_start == LABEL_RECOLOR_PAR_LENGTH + 1) {
|
||||
char buf[LABEL_RECOLOR_PAR_LENGTH + 1];
|
||||
_lv_memcpy_small(buf, &bidi_txt[par_start], LABEL_RECOLOR_PAR_LENGTH);
|
||||
lv_memcpy_small(buf, &bidi_txt[par_start], LABEL_RECOLOR_PAR_LENGTH);
|
||||
buf[LABEL_RECOLOR_PAR_LENGTH] = '\0';
|
||||
int r, g, b;
|
||||
r = (hex_char_to_num(buf[0]) << 4) + hex_char_to_num(buf[1]);
|
||||
@@ -352,7 +352,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area
|
||||
}
|
||||
|
||||
#if LV_USE_BIDI
|
||||
_lv_mem_buf_release(bidi_txt);
|
||||
lv_mem_buf_release(bidi_txt);
|
||||
bidi_txt = NULL;
|
||||
#endif
|
||||
/*Go to next line*/
|
||||
@@ -525,7 +525,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_letter_normal(lv_coord_t pos_x, lv_coord_
|
||||
|
||||
lv_coord_t hor_res = lv_disp_get_hor_res(_lv_refr_get_disp_refreshing());
|
||||
uint32_t mask_buf_size = box_w * box_h > hor_res ? hor_res : box_w * box_h;
|
||||
lv_opa_t * mask_buf = _lv_mem_buf_get(mask_buf_size);
|
||||
lv_opa_t * mask_buf = lv_mem_buf_get(mask_buf_size);
|
||||
int32_t mask_p = 0;
|
||||
|
||||
lv_area_t fill_area;
|
||||
@@ -574,7 +574,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_letter_normal(lv_coord_t pos_x, lv_coord_
|
||||
lv_draw_mask_res_t mask_res = lv_draw_mask_apply(mask_buf + mask_p_start, fill_area.x1, fill_area.y2,
|
||||
lv_area_get_width(&fill_area));
|
||||
if(mask_res == LV_DRAW_MASK_RES_TRANSP) {
|
||||
_lv_memset_00(mask_buf + mask_p_start, lv_area_get_width(&fill_area));
|
||||
lv_memset_00(mask_buf + mask_p_start, lv_area_get_width(&fill_area));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -605,7 +605,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_letter_normal(lv_coord_t pos_x, lv_coord_
|
||||
mask_p = 0;
|
||||
}
|
||||
|
||||
_lv_mem_buf_release(mask_buf);
|
||||
lv_mem_buf_release(mask_buf);
|
||||
}
|
||||
|
||||
static void draw_letter_subpx(lv_coord_t pos_x, lv_coord_t pos_y, lv_font_glyph_dsc_t * g, const lv_area_t * clip_area,
|
||||
@@ -663,10 +663,10 @@ static void draw_letter_subpx(lv_coord_t pos_x, lv_coord_t pos_y, lv_font_glyph_
|
||||
col_bit = bit_ofs & 0x7; /* "& 0x7" equals to "% 8" just faster */
|
||||
|
||||
int32_t mask_buf_size = box_w * box_h > LV_HOR_RES_MAX ? LV_HOR_RES_MAX : g->box_w * g->box_h;
|
||||
lv_opa_t * mask_buf = _lv_mem_buf_get(mask_buf_size);
|
||||
lv_opa_t * mask_buf = lv_mem_buf_get(mask_buf_size);
|
||||
int32_t mask_p = 0;
|
||||
|
||||
lv_color_t * color_buf = _lv_mem_buf_get(mask_buf_size * sizeof(lv_color_t));
|
||||
lv_color_t * color_buf = lv_mem_buf_get(mask_buf_size * sizeof(lv_color_t));
|
||||
|
||||
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
|
||||
lv_disp_buf_t * vdb = lv_disp_get_buf(disp);
|
||||
@@ -779,7 +779,7 @@ static void draw_letter_subpx(lv_coord_t pos_x, lv_coord_t pos_y, lv_font_glyph_
|
||||
lv_draw_mask_res_t mask_res = lv_draw_mask_apply(mask_buf + mask_p_start, map_area.x1, map_area.y2,
|
||||
lv_area_get_width(&map_area));
|
||||
if(mask_res == LV_DRAW_MASK_RES_TRANSP) {
|
||||
_lv_memset_00(mask_buf + mask_p_start, lv_area_get_width(&map_area));
|
||||
lv_memset_00(mask_buf + mask_p_start, lv_area_get_width(&map_area));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -809,8 +809,8 @@ static void draw_letter_subpx(lv_coord_t pos_x, lv_coord_t pos_y, lv_font_glyph_
|
||||
_lv_blend_map(clip_area, &map_area, color_buf, mask_buf, LV_DRAW_MASK_RES_CHANGED, opa, blend_mode);
|
||||
}
|
||||
|
||||
_lv_mem_buf_release(mask_buf);
|
||||
_lv_mem_buf_release(color_buf);
|
||||
lv_mem_buf_release(mask_buf);
|
||||
lv_mem_buf_release(color_buf);
|
||||
#else
|
||||
LV_LOG_WARN("Can't draw sub-pixel rendered letter because LV_USE_FONT_SUBPX == 0 in lv_conf.h");
|
||||
#endif
|
||||
|
||||
+28
-28
@@ -48,7 +48,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_ver(const lv_point_t * point1, const
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_draw_line_dsc_init(lv_draw_line_dsc_t * dsc)
|
||||
{
|
||||
_lv_memset_00(dsc, sizeof(lv_draw_line_dsc_t));
|
||||
lv_memset_00(dsc, sizeof(lv_draw_line_dsc_t));
|
||||
dsc->width = 1;
|
||||
dsc->opa = LV_OPA_COVER;
|
||||
dsc->color = LV_COLOR_BLACK;
|
||||
@@ -70,10 +70,10 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_line(const lv_point_t * point1, const lv_poin
|
||||
if(point1->x == point2->x && point1->y == point2->y) return;
|
||||
|
||||
lv_area_t clip_line;
|
||||
clip_line.x1 = LV_MATH_MIN(point1->x, point2->x) - dsc->width / 2;
|
||||
clip_line.x2 = LV_MATH_MAX(point1->x, point2->x) + dsc->width / 2;
|
||||
clip_line.y1 = LV_MATH_MIN(point1->y, point2->y) - dsc->width / 2;
|
||||
clip_line.y2 = LV_MATH_MAX(point1->y, point2->y) + dsc->width / 2;
|
||||
clip_line.x1 = LV_MIN(point1->x, point2->x) - dsc->width / 2;
|
||||
clip_line.x2 = LV_MAX(point1->x, point2->x) + dsc->width / 2;
|
||||
clip_line.y1 = LV_MIN(point1->y, point2->y) - dsc->width / 2;
|
||||
clip_line.y2 = LV_MAX(point1->y, point2->y) + dsc->width / 2;
|
||||
|
||||
bool is_common;
|
||||
is_common = _lv_area_intersect(&clip_line, &clip_line, clip);
|
||||
@@ -139,8 +139,8 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_hor(const lv_point_t * point1, const
|
||||
else if(dashed) simple_mode = false;
|
||||
|
||||
lv_area_t draw_area;
|
||||
draw_area.x1 = LV_MATH_MIN(point1->x, point2->x);
|
||||
draw_area.x2 = LV_MATH_MAX(point1->x, point2->x) - 1;
|
||||
draw_area.x1 = LV_MIN(point1->x, point2->x);
|
||||
draw_area.x2 = LV_MAX(point1->x, point2->x) - 1;
|
||||
draw_area.y1 = point1->y - w_half1;
|
||||
draw_area.y2 = point1->y + w_half0;
|
||||
|
||||
@@ -178,10 +178,10 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_hor(const lv_point_t * point1, const
|
||||
dash_start = (vdb->area.x1 + draw_area.x1) % (dsc->dash_gap + dsc->dash_width);
|
||||
}
|
||||
|
||||
lv_opa_t * mask_buf = _lv_mem_buf_get(draw_area_w);
|
||||
lv_opa_t * mask_buf = lv_mem_buf_get(draw_area_w);
|
||||
int32_t h;
|
||||
for(h = draw_area.y1; h <= draw_area.y2; h++) {
|
||||
_lv_memset_ff(mask_buf, draw_area_w);
|
||||
lv_memset_ff(mask_buf, draw_area_w);
|
||||
lv_draw_mask_res_t mask_res = lv_draw_mask_apply(mask_buf, vdb->area.x1 + draw_area.x1, vdb->area.y1 + h, draw_area_w);
|
||||
|
||||
if(dashed) {
|
||||
@@ -213,7 +213,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_hor(const lv_point_t * point1, const
|
||||
fill_area.y1++;
|
||||
fill_area.y2++;
|
||||
}
|
||||
_lv_mem_buf_release(mask_buf);
|
||||
lv_mem_buf_release(mask_buf);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,8 +242,8 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_ver(const lv_point_t * point1, const
|
||||
lv_area_t draw_area;
|
||||
draw_area.x1 = point1->x - w_half1;
|
||||
draw_area.x2 = point1->x + w_half0;
|
||||
draw_area.y1 = LV_MATH_MIN(point1->y, point2->y);
|
||||
draw_area.y2 = LV_MATH_MAX(point1->y, point2->y) - 1;
|
||||
draw_area.y1 = LV_MIN(point1->y, point2->y);
|
||||
draw_area.y2 = LV_MAX(point1->y, point2->y) - 1;
|
||||
|
||||
/*If there is no mask then simply draw a rectangle*/
|
||||
if(simple_mode) {
|
||||
@@ -274,7 +274,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_ver(const lv_point_t * point1, const
|
||||
fill_area.y1 = draw_area.y1 + disp_area->y1;
|
||||
fill_area.y2 = fill_area.y1;
|
||||
|
||||
lv_opa_t * mask_buf = _lv_mem_buf_get(draw_area_w);
|
||||
lv_opa_t * mask_buf = lv_mem_buf_get(draw_area_w);
|
||||
|
||||
lv_coord_t dash_start = 0;
|
||||
if(dashed) {
|
||||
@@ -285,7 +285,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_ver(const lv_point_t * point1, const
|
||||
|
||||
int32_t h;
|
||||
for(h = draw_area.y1; h <= draw_area.y2; h++) {
|
||||
_lv_memset_ff(mask_buf, draw_area_w);
|
||||
lv_memset_ff(mask_buf, draw_area_w);
|
||||
lv_draw_mask_res_t mask_res = lv_draw_mask_apply(mask_buf, vdb->area.x1 + draw_area.x1, vdb->area.y1 + h, draw_area_w);
|
||||
|
||||
if(dashed) {
|
||||
@@ -308,7 +308,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_ver(const lv_point_t * point1, const
|
||||
fill_area.y1++;
|
||||
fill_area.y2++;
|
||||
}
|
||||
_lv_mem_buf_release(mask_buf);
|
||||
lv_mem_buf_release(mask_buf);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -335,7 +335,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_skew(const lv_point_t * point1, cons
|
||||
|
||||
int32_t xdiff = p2.x - p1.x;
|
||||
int32_t ydiff = p2.y - p1.y;
|
||||
bool flat = LV_MATH_ABS(xdiff) > LV_MATH_ABS(ydiff) ? true : false;
|
||||
bool flat = LV_ABS(xdiff) > LV_ABS(ydiff) ? true : false;
|
||||
|
||||
static const uint8_t wcorr[] = {
|
||||
128, 128, 128, 129, 129, 130, 130, 131,
|
||||
@@ -347,18 +347,18 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_skew(const lv_point_t * point1, cons
|
||||
|
||||
int32_t w = dsc->width;
|
||||
int32_t wcorr_i = 0;
|
||||
if(flat) wcorr_i = (LV_MATH_ABS(ydiff) << 5) / LV_MATH_ABS(xdiff);
|
||||
else wcorr_i = (LV_MATH_ABS(xdiff) << 5) / LV_MATH_ABS(ydiff);
|
||||
if(flat) wcorr_i = (LV_ABS(ydiff) << 5) / LV_ABS(xdiff);
|
||||
else wcorr_i = (LV_ABS(xdiff) << 5) / LV_ABS(ydiff);
|
||||
|
||||
w = (w * wcorr[wcorr_i] + 63) >> 7; /*+ 63 for rounding*/
|
||||
int32_t w_half0 = w >> 1;
|
||||
int32_t w_half1 = w_half0 + (w & 0x1); /*Compensate rounding error*/
|
||||
|
||||
lv_area_t draw_area;
|
||||
draw_area.x1 = LV_MATH_MIN(p1.x, p2.x) - w;
|
||||
draw_area.x2 = LV_MATH_MAX(p1.x, p2.x) + w;
|
||||
draw_area.y1 = LV_MATH_MIN(p1.y, p2.y) - w;
|
||||
draw_area.y2 = LV_MATH_MAX(p1.y, p2.y) + w;
|
||||
draw_area.x1 = LV_MIN(p1.x, p2.x) - w;
|
||||
draw_area.x2 = LV_MAX(p1.x, p2.x) + w;
|
||||
draw_area.y1 = LV_MIN(p1.y, p2.y) - w;
|
||||
draw_area.y2 = LV_MAX(p1.y, p2.y) + w;
|
||||
|
||||
/* Get the union of `coords` and `clip`*/
|
||||
/* `clip` is already truncated to the `vdb` size
|
||||
@@ -425,8 +425,8 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_skew(const lv_point_t * point1, cons
|
||||
/*Draw the background line by line*/
|
||||
int32_t h;
|
||||
uint32_t hor_res = (uint32_t)lv_disp_get_hor_res(disp);
|
||||
size_t mask_buf_size = LV_MATH_MIN(lv_area_get_size(&draw_area), hor_res);
|
||||
lv_opa_t * mask_buf = _lv_mem_buf_get(mask_buf_size);
|
||||
size_t mask_buf_size = LV_MIN(lv_area_get_size(&draw_area), hor_res);
|
||||
lv_opa_t * mask_buf = lv_mem_buf_get(mask_buf_size);
|
||||
|
||||
lv_area_t fill_area;
|
||||
fill_area.x1 = draw_area.x1 + disp_area->x1;
|
||||
@@ -438,13 +438,13 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_skew(const lv_point_t * point1, cons
|
||||
|
||||
uint32_t mask_p = 0;
|
||||
|
||||
_lv_memset_ff(mask_buf, mask_buf_size);
|
||||
lv_memset_ff(mask_buf, mask_buf_size);
|
||||
/*Fill the first row with 'color'*/
|
||||
for(h = draw_area.y1 + disp_area->y1; h <= draw_area.y2 + disp_area->y1; h++) {
|
||||
|
||||
lv_draw_mask_res_t mask_res = lv_draw_mask_apply(&mask_buf[mask_p], x, h, draw_area_w);
|
||||
if(mask_res == LV_DRAW_MASK_RES_TRANSP) {
|
||||
_lv_memset_00(&mask_buf[mask_p], draw_area_w);
|
||||
lv_memset_00(&mask_buf[mask_p], draw_area_w);
|
||||
}
|
||||
|
||||
mask_p += draw_area_w;
|
||||
@@ -459,7 +459,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_skew(const lv_point_t * point1, cons
|
||||
fill_area.y1 = fill_area.y2 + 1;
|
||||
fill_area.y2 = fill_area.y1;
|
||||
mask_p = 0;
|
||||
_lv_memset_ff(mask_buf, mask_buf_size);
|
||||
lv_memset_ff(mask_buf, mask_buf_size);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -472,7 +472,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_skew(const lv_point_t * point1, cons
|
||||
|
||||
}
|
||||
|
||||
_lv_mem_buf_release(mask_buf);
|
||||
lv_mem_buf_release(mask_buf);
|
||||
|
||||
lv_draw_mask_remove_id(mask_left_id);
|
||||
lv_draw_mask_remove_id(mask_right_id);
|
||||
|
||||
+36
-36
@@ -189,7 +189,7 @@ LV_ATTRIBUTE_FAST_MEM uint8_t lv_draw_mask_get_cnt(void)
|
||||
void lv_draw_mask_line_points_init(lv_draw_mask_line_param_t * param, lv_coord_t p1x, lv_coord_t p1y, lv_coord_t p2x,
|
||||
lv_coord_t p2y, lv_draw_mask_line_side_t side)
|
||||
{
|
||||
_lv_memset_00(param, sizeof(lv_draw_mask_line_param_t));
|
||||
lv_memset_00(param, sizeof(lv_draw_mask_line_param_t));
|
||||
|
||||
if(p1y > p2y) {
|
||||
lv_coord_t t;
|
||||
@@ -210,7 +210,7 @@ void lv_draw_mask_line_points_init(lv_draw_mask_line_param_t * param, lv_coord_t
|
||||
|
||||
param->origo.x = p1x;
|
||||
param->origo.y = p1y;
|
||||
param->flat = (LV_MATH_ABS(p2x - p1x) > LV_MATH_ABS(p2y - p1y)) ? 1 : 0;
|
||||
param->flat = (LV_ABS(p2x - p1x) > LV_ABS(p2y - p1y)) ? 1 : 0;
|
||||
param->yx_steep = 0;
|
||||
param->xy_steep = 0;
|
||||
param->dsc.cb = (lv_draw_mask_xcb_t)lv_draw_mask_line;
|
||||
@@ -288,8 +288,8 @@ void lv_draw_mask_line_angle_init(lv_draw_mask_line_param_t * param, lv_coord_t
|
||||
int32_t p2x;
|
||||
int32_t p2y;
|
||||
|
||||
p2x = (_lv_trigo_sin(angle + 90) >> 5) + p1x;
|
||||
p2y = (_lv_trigo_sin(angle) >> 5) + py;
|
||||
p2x = (lv_trigo_sin(angle + 90) >> 5) + p1x;
|
||||
p2y = (lv_trigo_sin(angle) >> 5) + py;
|
||||
|
||||
lv_draw_mask_line_points_init(param, p1x, py, p2x, p2y, side);
|
||||
}
|
||||
@@ -324,7 +324,7 @@ void lv_draw_mask_angle_init(lv_draw_mask_angle_param_t * param, lv_coord_t vert
|
||||
param->delta_deg = 360 - start_angle + end_angle;
|
||||
}
|
||||
else {
|
||||
param->delta_deg = LV_MATH_ABS(end_angle - start_angle);
|
||||
param->delta_deg = LV_ABS(end_angle - start_angle);
|
||||
}
|
||||
|
||||
param->cfg.start_angle = start_angle;
|
||||
@@ -372,7 +372,7 @@ void lv_draw_mask_radius_init(lv_draw_mask_radius_param_t * param, const lv_area
|
||||
{
|
||||
lv_coord_t w = lv_area_get_width(rect);
|
||||
lv_coord_t h = lv_area_get_height(rect);
|
||||
int32_t short_side = LV_MATH_MIN(w, h);
|
||||
int32_t short_side = LV_MIN(w, h);
|
||||
if(radius > short_side >> 1) radius = short_side >> 1;
|
||||
|
||||
lv_area_copy(¶m->cfg.rect, rect);
|
||||
@@ -460,7 +460,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_line(lv_opa_t * mas
|
||||
else {
|
||||
int32_t k = - abs_x;
|
||||
if(k < 0) return LV_DRAW_MASK_RES_TRANSP;
|
||||
if(k >= 0 && k < len) _lv_memset_00(&mask_buf[k], len - k);
|
||||
if(k >= 0 && k < len) lv_memset_00(&mask_buf[k], len - k);
|
||||
return LV_DRAW_MASK_RES_CHANGED;
|
||||
}
|
||||
}
|
||||
@@ -470,7 +470,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_line(lv_opa_t * mas
|
||||
int32_t k = - abs_x;
|
||||
if(k < 0) k = 0;
|
||||
if(k >= len) return LV_DRAW_MASK_RES_TRANSP;
|
||||
else if(k >= 0 && k < len) _lv_memset_00(&mask_buf[0], k);
|
||||
else if(k >= 0 && k < len) lv_memset_00(&mask_buf[0], k);
|
||||
return LV_DRAW_MASK_RES_CHANGED;
|
||||
}
|
||||
}
|
||||
@@ -589,7 +589,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_flat(lv_opa_t * mask_b
|
||||
return LV_DRAW_MASK_RES_TRANSP;
|
||||
}
|
||||
if(k >= 0) {
|
||||
_lv_memset_00(&mask_buf[0], k);
|
||||
lv_memset_00(&mask_buf[0], k);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -598,7 +598,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_flat(lv_opa_t * mask_b
|
||||
return LV_DRAW_MASK_RES_TRANSP;
|
||||
}
|
||||
if(k <= len) {
|
||||
_lv_memset_00(&mask_buf[k], len - k);
|
||||
lv_memset_00(&mask_buf[k], len - k);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -668,13 +668,13 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_steep(lv_opa_t * mask_
|
||||
if(k >= len) {
|
||||
return LV_DRAW_MASK_RES_TRANSP;
|
||||
}
|
||||
if(k >= 0) _lv_memset_00(&mask_buf[0], k);
|
||||
if(k >= 0) lv_memset_00(&mask_buf[0], k);
|
||||
|
||||
}
|
||||
else {
|
||||
if(k > len) k = len;
|
||||
if(k == 0) return LV_DRAW_MASK_RES_TRANSP;
|
||||
else if(k > 0) _lv_memset_00(&mask_buf[k], len - k);
|
||||
else if(k > 0) lv_memset_00(&mask_buf[k], len - k);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -703,12 +703,12 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_steep(lv_opa_t * mask_
|
||||
k = xsi - abs_x - 1;
|
||||
|
||||
if(k > len) k = len;
|
||||
else if(k > 0) _lv_memset_00(&mask_buf[0], k);
|
||||
else if(k > 0) lv_memset_00(&mask_buf[0], k);
|
||||
|
||||
}
|
||||
else {
|
||||
if(k > len) return LV_DRAW_MASK_RES_FULL_COVER;
|
||||
if(k >= 0) _lv_memset_00(&mask_buf[k], len - k);
|
||||
if(k >= 0) lv_memset_00(&mask_buf[k], len - k);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -733,13 +733,13 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_steep(lv_opa_t * mask_
|
||||
if(p->inv) {
|
||||
k = xsi - abs_x;
|
||||
if(k > len) return LV_DRAW_MASK_RES_TRANSP;
|
||||
if(k >= 0) _lv_memset_00(&mask_buf[0], k);
|
||||
if(k >= 0) lv_memset_00(&mask_buf[0], k);
|
||||
|
||||
}
|
||||
else {
|
||||
if(k > len) k = len;
|
||||
if(k == 0) return LV_DRAW_MASK_RES_TRANSP;
|
||||
else if(k > 0) _lv_memset_00(&mask_buf[k], len - k);
|
||||
else if(k > 0) lv_memset_00(&mask_buf[k], len - k);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -789,7 +789,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_angle(lv_opa_t * ma
|
||||
if(tmp > 0) {
|
||||
res1 = lv_draw_mask_line(&mask_buf[0], abs_x, abs_y, tmp, &p->start_line);
|
||||
if(res1 == LV_DRAW_MASK_RES_TRANSP) {
|
||||
_lv_memset_00(&mask_buf[0], tmp);
|
||||
lv_memset_00(&mask_buf[0], tmp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -797,7 +797,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_angle(lv_opa_t * ma
|
||||
if(tmp < 0) tmp = 0;
|
||||
res2 = lv_draw_mask_line(&mask_buf[tmp], abs_x + tmp, abs_y, len - tmp, &p->end_line);
|
||||
if(res2 == LV_DRAW_MASK_RES_TRANSP) {
|
||||
_lv_memset_00(&mask_buf[tmp], len - tmp);
|
||||
lv_memset_00(&mask_buf[tmp], len - tmp);
|
||||
}
|
||||
if(res1 == res2) return res1;
|
||||
else return LV_DRAW_MASK_RES_CHANGED;
|
||||
@@ -831,7 +831,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_angle(lv_opa_t * ma
|
||||
if(tmp > 0) {
|
||||
res1 = lv_draw_mask_line(&mask_buf[0], abs_x, abs_y, tmp, (lv_draw_mask_line_param_t *)&p->end_line);
|
||||
if(res1 == LV_DRAW_MASK_RES_TRANSP) {
|
||||
_lv_memset_00(&mask_buf[0], tmp);
|
||||
lv_memset_00(&mask_buf[0], tmp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -839,7 +839,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_angle(lv_opa_t * ma
|
||||
if(tmp < 0) tmp = 0;
|
||||
res2 = lv_draw_mask_line(&mask_buf[tmp], abs_x + tmp, abs_y, len - tmp, (lv_draw_mask_line_param_t *)&p->start_line);
|
||||
if(res2 == LV_DRAW_MASK_RES_TRANSP) {
|
||||
_lv_memset_00(&mask_buf[tmp], len - tmp);
|
||||
lv_memset_00(&mask_buf[tmp], len - tmp);
|
||||
}
|
||||
if(res1 == res2) return res1;
|
||||
else return LV_DRAW_MASK_RES_CHANGED;
|
||||
@@ -915,13 +915,13 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * m
|
||||
int32_t last = rect.x1 - abs_x;
|
||||
if(last > len) return LV_DRAW_MASK_RES_TRANSP;
|
||||
if(last >= 0) {
|
||||
_lv_memset_00(&mask_buf[0], last);
|
||||
lv_memset_00(&mask_buf[0], last);
|
||||
}
|
||||
|
||||
int32_t first = rect.x2 - abs_x + 1;
|
||||
if(first <= 0) return LV_DRAW_MASK_RES_TRANSP;
|
||||
else if(first < len) {
|
||||
_lv_memset_00(&mask_buf[first], len - first);
|
||||
lv_memset_00(&mask_buf[first], len - first);
|
||||
}
|
||||
if(last == 0 && first == len) return LV_DRAW_MASK_RES_FULL_COVER;
|
||||
else return LV_DRAW_MASK_RES_CHANGED;
|
||||
@@ -933,7 +933,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * m
|
||||
int32_t last = rect.x2 - abs_x - first + 1;
|
||||
if(first + last > len) last = len - first;
|
||||
if(last >= 0) {
|
||||
_lv_memset_00(&mask_buf[first], last);
|
||||
lv_memset_00(&mask_buf[first], last);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -971,9 +971,9 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * m
|
||||
x0.i = p->y_prev_x.i;
|
||||
}
|
||||
else {
|
||||
_lv_sqrt(r2 - (y * y), &x0, sqrt_mask);
|
||||
lv_sqrt(r2 - (y * y), &x0, sqrt_mask);
|
||||
}
|
||||
_lv_sqrt(r2 - ((y - 1) * (y - 1)), &x1, sqrt_mask);
|
||||
lv_sqrt(r2 - ((y - 1) * (y - 1)), &x1, sqrt_mask);
|
||||
p->y_prev = y - 1;
|
||||
p->y_prev_x.f = x1.f;
|
||||
p->y_prev_x.i = x1.i;
|
||||
@@ -989,10 +989,10 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * m
|
||||
x1.i = p->y_prev_x.i;
|
||||
}
|
||||
else {
|
||||
_lv_sqrt(r2 - ((y - 1) * (y - 1)), &x1, sqrt_mask);
|
||||
lv_sqrt(r2 - ((y - 1) * (y - 1)), &x1, sqrt_mask);
|
||||
}
|
||||
|
||||
_lv_sqrt(r2 - (y * y), &x0, sqrt_mask);
|
||||
lv_sqrt(r2 - (y * y), &x0, sqrt_mask);
|
||||
p->y_prev = y;
|
||||
p->y_prev_x.f = x0.f;
|
||||
p->y_prev_x.i = x0.i;
|
||||
@@ -1031,13 +1031,13 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * m
|
||||
return LV_DRAW_MASK_RES_TRANSP;
|
||||
}
|
||||
if(kl >= 0) {
|
||||
_lv_memset_00(&mask_buf[0], kl);
|
||||
lv_memset_00(&mask_buf[0], kl);
|
||||
}
|
||||
if(kr < 0) {
|
||||
return LV_DRAW_MASK_RES_TRANSP;
|
||||
}
|
||||
if(kr <= len) {
|
||||
_lv_memset_00(&mask_buf[kr], len - kr);
|
||||
lv_memset_00(&mask_buf[kr], len - kr);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -1048,7 +1048,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * m
|
||||
int32_t len_tmp = kr - first;
|
||||
if(len_tmp + first > len) len_tmp = len - first;
|
||||
if(first < len && len_tmp >= 0) {
|
||||
_lv_memset_00(&mask_buf[first], len_tmp);
|
||||
lv_memset_00(&mask_buf[first], len_tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1065,7 +1065,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * m
|
||||
int32_t len_tmp = kr - first;
|
||||
if(len_tmp + first > len) len_tmp = len - first;
|
||||
if(first < len && len_tmp >= 0) {
|
||||
_lv_memset_00(&mask_buf[first], len_tmp);
|
||||
lv_memset_00(&mask_buf[first], len_tmp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1074,7 +1074,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * m
|
||||
lv_sqrt_res_t y_prev;
|
||||
lv_sqrt_res_t y_next;
|
||||
|
||||
_lv_sqrt(r2 - (x0.i * x0.i), &y_prev, sqrt_mask);
|
||||
lv_sqrt(r2 - (x0.i * x0.i), &y_prev, sqrt_mask);
|
||||
|
||||
if(y_prev.f == 0) {
|
||||
y_prev.i--;
|
||||
@@ -1083,7 +1083,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * m
|
||||
|
||||
/*The first y intersection is special as it might be in the previous line*/
|
||||
if(y_prev.i >= y) {
|
||||
_lv_sqrt(r2 - (i * i), &y_next, sqrt_mask);
|
||||
lv_sqrt(r2 - (i * i), &y_next, sqrt_mask);
|
||||
m = 255 - (((255 - x0.f) * (255 - y_next.f)) >> 9);
|
||||
|
||||
if(outer) m = 255 - m;
|
||||
@@ -1126,12 +1126,12 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * m
|
||||
if(kl > len) {
|
||||
return LV_DRAW_MASK_RES_TRANSP;
|
||||
}
|
||||
if(kl >= 0) _lv_memset_00(&mask_buf[0], kl);
|
||||
if(kl >= 0) lv_memset_00(&mask_buf[0], kl);
|
||||
|
||||
if(kr < 0) {
|
||||
return LV_DRAW_MASK_RES_TRANSP;
|
||||
}
|
||||
if(kr < len) _lv_memset_00(&mask_buf[kr], len - kr);
|
||||
if(kr < len) lv_memset_00(&mask_buf[kr], len - kr);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1227,7 +1227,7 @@ LV_ATTRIBUTE_FAST_MEM static inline lv_opa_t mask_mix(lv_opa_t mask_act, lv_opa_
|
||||
if(mask_new >= LV_OPA_MAX) return mask_act;
|
||||
if(mask_new <= LV_OPA_MIN) return 0;
|
||||
|
||||
return LV_MATH_UDIV255(mask_act * mask_new);// >> 8);
|
||||
return LV_UDIV255(mask_act * mask_new);// >> 8);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,6 +16,7 @@ extern "C" {
|
||||
#include <stdbool.h>
|
||||
#include "../lv_misc/lv_area.h"
|
||||
#include "../lv_misc/lv_color.h"
|
||||
#include "../lv_misc/lv_math.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
|
||||
+135
-152
File diff suppressed because it is too large
Load Diff
+17
-15
@@ -51,30 +51,35 @@ typedef uint8_t lv_grad_dir_t;
|
||||
|
||||
typedef struct {
|
||||
lv_coord_t radius;
|
||||
lv_blend_mode_t blend_mode;
|
||||
|
||||
/*Background*/
|
||||
lv_color_t bg_color;
|
||||
lv_color_t bg_grad_color;
|
||||
lv_grad_dir_t bg_grad_dir;
|
||||
uint8_t bg_main_color_stop;
|
||||
uint8_t bg_grad_color_stop;
|
||||
lv_opa_t bg_opa;
|
||||
lv_blend_mode_t bg_blend_mode;
|
||||
lv_grad_dir_t bg_grad_dir :3;
|
||||
|
||||
/*Background img*/
|
||||
const void * bg_img_src;
|
||||
lv_color_t bg_img_recolor;
|
||||
lv_opa_t bg_img_opa;
|
||||
lv_opa_t bg_img_recolor_opa;
|
||||
uint8_t bg_img_tiled;
|
||||
|
||||
/*Border*/
|
||||
lv_color_t border_color;
|
||||
lv_coord_t border_width;
|
||||
lv_border_side_t border_side;
|
||||
lv_opa_t border_opa;
|
||||
lv_blend_mode_t border_blend_mode;
|
||||
uint8_t border_post : 1; /*There is a border it will be drawn later. */
|
||||
lv_border_side_t border_side :5;
|
||||
|
||||
/*Outline*/
|
||||
lv_color_t outline_color;
|
||||
lv_coord_t outline_width;
|
||||
lv_coord_t outline_pad;
|
||||
lv_opa_t outline_opa;
|
||||
lv_blend_mode_t outline_blend_mode;
|
||||
|
||||
/*Shadow*/
|
||||
lv_color_t shadow_color;
|
||||
@@ -83,21 +88,18 @@ typedef struct {
|
||||
lv_coord_t shadow_ofs_y;
|
||||
lv_coord_t shadow_spread;
|
||||
lv_opa_t shadow_opa;
|
||||
lv_blend_mode_t shadow_blend_mode;
|
||||
|
||||
/*Content*/
|
||||
const void * content_src;
|
||||
const void * content_img;
|
||||
lv_align_t content_align;
|
||||
lv_coord_t content_ofs_x;
|
||||
lv_coord_t content_ofs_y;
|
||||
lv_opa_t content_opa;
|
||||
const void * content_text;
|
||||
const lv_font_t * content_font;
|
||||
lv_opa_t content_recolor_opa;
|
||||
lv_blend_mode_t content_blend_mode;
|
||||
lv_color_t content_color;
|
||||
lv_coord_t content_letter_space;
|
||||
lv_coord_t content_line_space;
|
||||
lv_coord_t content_ofs_x;
|
||||
lv_coord_t content_ofs_y;
|
||||
lv_color_t content_color;
|
||||
lv_opa_t content_opa;
|
||||
lv_align_t content_align : 5;
|
||||
|
||||
} lv_draw_rect_dsc_t;
|
||||
|
||||
/**********************
|
||||
|
||||
@@ -59,7 +59,7 @@ void lv_draw_polygon(const lv_point_t points[], uint16_t point_cnt, const lv_are
|
||||
if(points == NULL) return;
|
||||
|
||||
/*Join adjacent points if they are on the same coordinate*/
|
||||
lv_point_t * p = _lv_mem_buf_get(point_cnt * sizeof(lv_point_t));
|
||||
lv_point_t * p = lv_mem_buf_get(point_cnt * sizeof(lv_point_t));
|
||||
if(p == NULL) return;
|
||||
uint16_t i;
|
||||
uint16_t pcnt = 0;
|
||||
@@ -78,24 +78,24 @@ void lv_draw_polygon(const lv_point_t points[], uint16_t point_cnt, const lv_are
|
||||
|
||||
point_cnt = pcnt;
|
||||
if(point_cnt < 3) {
|
||||
_lv_mem_buf_release(p);
|
||||
lv_mem_buf_release(p);
|
||||
return;
|
||||
}
|
||||
|
||||
lv_area_t poly_coords = {.x1 = LV_COORD_MAX, .y1 = LV_COORD_MAX, .x2 = LV_COORD_MIN, .y2 = LV_COORD_MIN};
|
||||
|
||||
for(i = 0; i < point_cnt; i++) {
|
||||
poly_coords.x1 = LV_MATH_MIN(poly_coords.x1, p[i].x);
|
||||
poly_coords.y1 = LV_MATH_MIN(poly_coords.y1, p[i].y);
|
||||
poly_coords.x2 = LV_MATH_MAX(poly_coords.x2, p[i].x);
|
||||
poly_coords.y2 = LV_MATH_MAX(poly_coords.y2, p[i].y);
|
||||
poly_coords.x1 = LV_MIN(poly_coords.x1, p[i].x);
|
||||
poly_coords.y1 = LV_MIN(poly_coords.y1, p[i].y);
|
||||
poly_coords.x2 = LV_MAX(poly_coords.x2, p[i].x);
|
||||
poly_coords.y2 = LV_MAX(poly_coords.y2, p[i].y);
|
||||
}
|
||||
|
||||
bool is_common;
|
||||
lv_area_t poly_mask;
|
||||
is_common = _lv_area_intersect(&poly_mask, &poly_coords, clip_area);
|
||||
if(!is_common) {
|
||||
_lv_mem_buf_release(p);
|
||||
lv_mem_buf_release(p);
|
||||
return;
|
||||
}
|
||||
/*Find the lowest point*/
|
||||
@@ -109,7 +109,7 @@ void lv_draw_polygon(const lv_point_t points[], uint16_t point_cnt, const lv_are
|
||||
}
|
||||
}
|
||||
|
||||
lv_draw_mask_line_param_t * mp = _lv_mem_buf_get(sizeof(lv_draw_mask_line_param_t) * point_cnt);
|
||||
lv_draw_mask_line_param_t * mp = lv_mem_buf_get(sizeof(lv_draw_mask_line_param_t) * point_cnt);
|
||||
lv_draw_mask_line_param_t * mp_next = mp;
|
||||
|
||||
int32_t i_prev_left = y_min_i;
|
||||
@@ -192,8 +192,8 @@ void lv_draw_polygon(const lv_point_t points[], uint16_t point_cnt, const lv_are
|
||||
|
||||
lv_draw_mask_remove_custom(mp);
|
||||
|
||||
_lv_mem_buf_release(mp);
|
||||
_lv_mem_buf_release(p);
|
||||
lv_mem_buf_release(mp);
|
||||
lv_mem_buf_release(p);
|
||||
|
||||
}
|
||||
|
||||
|
||||
+110
-21
@@ -58,7 +58,7 @@ lv_color_t lv_img_buf_get_px_color(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t
|
||||
dsc->header.cf == LV_IMG_CF_TRUE_COLOR_ALPHA) {
|
||||
uint8_t px_size = lv_img_cf_get_px_size(dsc->header.cf) >> 3;
|
||||
uint32_t px = dsc->header.w * y * px_size + x * px_size;
|
||||
_lv_memcpy_small(&p_color, &buf_u8[px], sizeof(lv_color_t));
|
||||
lv_memcpy_small(&p_color, &buf_u8[px], sizeof(lv_color_t));
|
||||
#if LV_COLOR_SIZE == 32
|
||||
p_color.ch.alpha = 0xFF; /*Only the color should be get so use a default alpha value*/
|
||||
#endif
|
||||
@@ -245,12 +245,12 @@ void lv_img_buf_set_px_color(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_
|
||||
if(dsc->header.cf == LV_IMG_CF_TRUE_COLOR || dsc->header.cf == LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED) {
|
||||
uint8_t px_size = lv_img_cf_get_px_size(dsc->header.cf) >> 3;
|
||||
uint32_t px = dsc->header.w * y * px_size + x * px_size;
|
||||
_lv_memcpy_small(&buf_u8[px], &c, px_size);
|
||||
lv_memcpy_small(&buf_u8[px], &c, px_size);
|
||||
}
|
||||
else if(dsc->header.cf == LV_IMG_CF_TRUE_COLOR_ALPHA) {
|
||||
uint8_t px_size = lv_img_cf_get_px_size(dsc->header.cf) >> 3;
|
||||
uint32_t px = dsc->header.w * y * px_size + x * px_size;
|
||||
_lv_memcpy_small(&buf_u8[px], &c, px_size - 1); /*-1 to not overwrite the alpha value*/
|
||||
lv_memcpy_small(&buf_u8[px], &c, px_size - 1); /*-1 to not overwrite the alpha value*/
|
||||
}
|
||||
else if(dsc->header.cf == LV_IMG_CF_INDEXED_1BIT) {
|
||||
buf_u8 += sizeof(lv_color32_t) * 2; /*Skip the palette*/
|
||||
@@ -318,7 +318,7 @@ void lv_img_buf_set_palette(lv_img_dsc_t * dsc, uint8_t id, lv_color_t c)
|
||||
lv_color32_t c32;
|
||||
c32.full = lv_color_to32(c);
|
||||
uint8_t * buf = (uint8_t *)dsc->data;
|
||||
_lv_memcpy_small(&buf[id * sizeof(c32)], &c32, sizeof(c32));
|
||||
lv_memcpy_small(&buf[id * sizeof(c32)], &c32, sizeof(c32));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -335,7 +335,7 @@ lv_img_dsc_t * lv_img_buf_alloc(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf)
|
||||
if(dsc == NULL)
|
||||
return NULL;
|
||||
|
||||
_lv_memset_00(dsc, sizeof(lv_img_dsc_t));
|
||||
lv_memset_00(dsc, sizeof(lv_img_dsc_t));
|
||||
|
||||
/* Get image data size */
|
||||
dsc->data_size = lv_img_buf_get_img_size(w, h, cf);
|
||||
@@ -350,7 +350,7 @@ lv_img_dsc_t * lv_img_buf_alloc(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf)
|
||||
lv_mem_free(dsc);
|
||||
return NULL;
|
||||
}
|
||||
_lv_memset_00((uint8_t *)dsc->data, dsc->data_size);
|
||||
lv_memset_00((uint8_t *)dsc->data, dsc->data_size);
|
||||
|
||||
/* Fill in header */
|
||||
dsc->header.always_zero = 0;
|
||||
@@ -426,11 +426,11 @@ void _lv_img_buf_transform_init(lv_img_transform_dsc_t * dsc)
|
||||
int32_t angle_high = angle_low + 1;
|
||||
int32_t angle_rem = dsc->cfg.angle - (angle_low * 10);
|
||||
|
||||
int32_t s1 = _lv_trigo_sin(-angle_low);
|
||||
int32_t s2 = _lv_trigo_sin(-angle_high);
|
||||
int32_t s1 = lv_trigo_sin(-angle_low);
|
||||
int32_t s2 = lv_trigo_sin(-angle_high);
|
||||
|
||||
int32_t c1 = _lv_trigo_sin(-angle_low + 90);
|
||||
int32_t c2 = _lv_trigo_sin(-angle_high + 90);
|
||||
int32_t c1 = lv_trigo_sin(-angle_low + 90);
|
||||
int32_t c2 = lv_trigo_sin(-angle_high + 90);
|
||||
|
||||
dsc->tmp.sinma = (s1 * (10 - angle_rem) + s2 * angle_rem) / 10;
|
||||
dsc->tmp.cosma = (c1 * (10 - angle_rem) + c2 * angle_rem) / 10;
|
||||
@@ -503,11 +503,11 @@ void _lv_img_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t
|
||||
int32_t angle_high = angle_low + 1;
|
||||
int32_t angle_rem = angle - (angle_low * 10);
|
||||
|
||||
int32_t s1 = _lv_trigo_sin(angle_low);
|
||||
int32_t s2 = _lv_trigo_sin(angle_high);
|
||||
int32_t s1 = lv_trigo_sin(angle_low);
|
||||
int32_t s2 = lv_trigo_sin(angle_high);
|
||||
|
||||
int32_t c1 = _lv_trigo_sin(angle_low + 90);
|
||||
int32_t c2 = _lv_trigo_sin(angle_high + 90);
|
||||
int32_t c1 = lv_trigo_sin(angle_low + 90);
|
||||
int32_t c2 = lv_trigo_sin(angle_high + 90);
|
||||
|
||||
int32_t sinma = (s1 * (10 - angle_rem) + s2 * angle_rem) / 10;
|
||||
int32_t cosma = (c1 * (10 - angle_rem) + c2 * angle_rem) / 10;
|
||||
@@ -544,10 +544,10 @@ void _lv_img_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t
|
||||
rb.x = ((cosma * xt - sinma * yt) >> _LV_TRANSFORM_TRIGO_SHIFT) + pivot->x;
|
||||
rb.y = ((sinma * xt + cosma * yt) >> _LV_TRANSFORM_TRIGO_SHIFT) + pivot->y;
|
||||
|
||||
res->x1 = LV_MATH_MIN4(lb.x, lt.x, rb.x, rt.x);
|
||||
res->x2 = LV_MATH_MAX4(lb.x, lt.x, rb.x, rt.x);
|
||||
res->y1 = LV_MATH_MIN4(lb.y, lt.y, rb.y, rt.y);
|
||||
res->y2 = LV_MATH_MAX4(lb.y, lt.y, rb.y, rt.y);
|
||||
res->x1 = LV_MIN4(lb.x, lt.x, rb.x, rt.x);
|
||||
res->x2 = LV_MAX4(lb.x, lt.x, rb.x, rt.x);
|
||||
res->y1 = LV_MIN4(lb.y, lt.y, rb.y, rt.y);
|
||||
res->y2 = LV_MAX4(lb.y, lt.y, rb.y, rt.y);
|
||||
#else
|
||||
LV_UNUSED(angle);
|
||||
LV_UNUSED(zoom);
|
||||
@@ -560,6 +560,95 @@ void _lv_img_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t
|
||||
}
|
||||
|
||||
#if LV_USE_IMG_TRANSFORM
|
||||
/**
|
||||
* Get which color and opa would come to a pixel if it were rotated
|
||||
* @param dsc a descriptor initialized by `lv_img_buf_rotate_init`
|
||||
* @param x the coordinate which color and opa should be get
|
||||
* @param y the coordinate which color and opa should be get
|
||||
* @return true: there is valid pixel on these x/y coordinates; false: the rotated pixel was out of the image
|
||||
* @note the result is written back to `dsc->res_color` and `dsc->res_opa`
|
||||
*/
|
||||
bool _lv_img_buf_transform(lv_img_transform_dsc_t * dsc, lv_coord_t x, lv_coord_t y)
|
||||
{
|
||||
const uint8_t * src_u8 = (const uint8_t *)dsc->cfg.src;
|
||||
|
||||
/*Get the target point relative coordinates to the pivot*/
|
||||
int32_t xt = x - dsc->cfg.pivot_x;
|
||||
int32_t yt = y - dsc->cfg.pivot_y;
|
||||
|
||||
int32_t xs;
|
||||
int32_t ys;
|
||||
if(dsc->cfg.zoom == LV_IMG_ZOOM_NONE) {
|
||||
/*Get the source pixel from the upscaled image*/
|
||||
xs = ((dsc->tmp.cosma * xt - dsc->tmp.sinma * yt) >> (_LV_TRANSFORM_TRIGO_SHIFT - 8)) + dsc->tmp.pivot_x_256;
|
||||
ys = ((dsc->tmp.sinma * xt + dsc->tmp.cosma * yt) >> (_LV_TRANSFORM_TRIGO_SHIFT - 8)) + dsc->tmp.pivot_y_256;
|
||||
}
|
||||
else if(dsc->cfg.angle == 0) {
|
||||
xt = (int32_t)((int32_t)xt * dsc->tmp.zoom_inv) >> _LV_ZOOM_INV_UPSCALE;
|
||||
yt = (int32_t)((int32_t)yt * dsc->tmp.zoom_inv) >> _LV_ZOOM_INV_UPSCALE;
|
||||
xs = xt + dsc->tmp.pivot_x_256;
|
||||
ys = yt + dsc->tmp.pivot_y_256;
|
||||
}
|
||||
else {
|
||||
xt = (int32_t)((int32_t)xt * dsc->tmp.zoom_inv) >> _LV_ZOOM_INV_UPSCALE;
|
||||
yt = (int32_t)((int32_t)yt * dsc->tmp.zoom_inv) >> _LV_ZOOM_INV_UPSCALE;
|
||||
xs = ((dsc->tmp.cosma * xt - dsc->tmp.sinma * yt) >> (_LV_TRANSFORM_TRIGO_SHIFT)) + dsc->tmp.pivot_x_256;
|
||||
ys = ((dsc->tmp.sinma * xt + dsc->tmp.cosma * yt) >> (_LV_TRANSFORM_TRIGO_SHIFT)) + dsc->tmp.pivot_y_256;
|
||||
}
|
||||
|
||||
/*Get the integer part of the source pixel*/
|
||||
int32_t xs_int = xs >> 8;
|
||||
int32_t ys_int = ys >> 8;
|
||||
|
||||
if(xs_int >= dsc->cfg.src_w) return false;
|
||||
else if(xs_int < 0) return false;
|
||||
|
||||
if(ys_int >= dsc->cfg.src_h) return false;
|
||||
else if(ys_int < 0) return false;
|
||||
|
||||
uint8_t px_size;
|
||||
uint32_t pxi;
|
||||
if(dsc->tmp.native_color) {
|
||||
if(dsc->tmp.has_alpha == 0) {
|
||||
px_size = LV_COLOR_SIZE >> 3;
|
||||
|
||||
pxi = dsc->cfg.src_w * ys_int * px_size + xs_int * px_size;
|
||||
lv_memcpy_small(&dsc->res.color, &src_u8[pxi], px_size);
|
||||
}
|
||||
else {
|
||||
px_size = LV_IMG_PX_SIZE_ALPHA_BYTE;
|
||||
pxi = dsc->cfg.src_w * ys_int * px_size + xs_int * px_size;
|
||||
lv_memcpy_small(&dsc->res.color, &src_u8[pxi], px_size - 1);
|
||||
dsc->res.opa = src_u8[pxi + px_size - 1];
|
||||
}
|
||||
}
|
||||
else {
|
||||
pxi = 0; /*unused*/
|
||||
px_size = 0; /*unused*/
|
||||
dsc->res.color = lv_img_buf_get_px_color(&dsc->tmp.img_dsc, xs_int, ys_int, dsc->cfg.color);
|
||||
dsc->res.opa = lv_img_buf_get_px_alpha(&dsc->tmp.img_dsc, xs_int, ys_int);
|
||||
}
|
||||
|
||||
if(dsc->tmp.chroma_keyed) {
|
||||
lv_color_t ct = LV_COLOR_TRANSP;
|
||||
if(dsc->res.color.full == ct.full) return false;
|
||||
}
|
||||
|
||||
if(dsc->cfg.antialias == false) return true;
|
||||
|
||||
dsc->tmp.xs = xs;
|
||||
dsc->tmp.ys = ys;
|
||||
dsc->tmp.xs_int = xs_int;
|
||||
dsc->tmp.ys_int = ys_int;
|
||||
dsc->tmp.pxi = pxi;
|
||||
dsc->tmp.px_size = px_size;
|
||||
|
||||
bool ret;
|
||||
ret = _lv_img_buf_transform_anti_alias(dsc);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Continue transformation by taking the neighbors into account
|
||||
* @param dsc pointer to the transformation descriptor
|
||||
@@ -620,9 +709,9 @@ bool _lv_img_buf_transform_anti_alias(lv_img_transform_dsc_t * dsc)
|
||||
lv_opa_t a11 = 0;
|
||||
|
||||
if(dsc->tmp.native_color) {
|
||||
_lv_memcpy_small(&c01, &src_u8[dsc->tmp.pxi + dsc->tmp.px_size * xn], sizeof(lv_color_t));
|
||||
_lv_memcpy_small(&c10, &src_u8[dsc->tmp.pxi + dsc->cfg.src_w * dsc->tmp.px_size * yn], sizeof(lv_color_t));
|
||||
_lv_memcpy_small(&c11, &src_u8[dsc->tmp.pxi + dsc->cfg.src_w * dsc->tmp.px_size * yn + dsc->tmp.px_size * xn],
|
||||
lv_memcpy_small(&c01, &src_u8[dsc->tmp.pxi + dsc->tmp.px_size * xn], sizeof(lv_color_t));
|
||||
lv_memcpy_small(&c10, &src_u8[dsc->tmp.pxi + dsc->cfg.src_w * dsc->tmp.px_size * yn], sizeof(lv_color_t));
|
||||
lv_memcpy_small(&c11, &src_u8[dsc->tmp.pxi + dsc->cfg.src_w * dsc->tmp.px_size * yn + dsc->tmp.px_size * xn],
|
||||
sizeof(lv_color_t));
|
||||
if(dsc->tmp.has_alpha) {
|
||||
a10 = src_u8[dsc->tmp.pxi + dsc->tmp.px_size * xn + dsc->tmp.px_size - 1];
|
||||
|
||||
@@ -292,86 +292,8 @@ bool _lv_img_buf_transform_anti_alias(lv_img_transform_dsc_t * dsc);
|
||||
* @return true: there is valid pixel on these x/y coordinates; false: the rotated pixel was out of the image
|
||||
* @note the result is written back to `dsc->res_color` and `dsc->res_opa`
|
||||
*/
|
||||
static inline bool _lv_img_buf_transform(lv_img_transform_dsc_t * dsc, lv_coord_t x, lv_coord_t y)
|
||||
{
|
||||
const uint8_t * src_u8 = (const uint8_t *)dsc->cfg.src;
|
||||
bool _lv_img_buf_transform(lv_img_transform_dsc_t * dsc, lv_coord_t x, lv_coord_t y);
|
||||
|
||||
/*Get the target point relative coordinates to the pivot*/
|
||||
int32_t xt = x - dsc->cfg.pivot_x;
|
||||
int32_t yt = y - dsc->cfg.pivot_y;
|
||||
|
||||
int32_t xs;
|
||||
int32_t ys;
|
||||
if(dsc->cfg.zoom == LV_IMG_ZOOM_NONE) {
|
||||
/*Get the source pixel from the upscaled image*/
|
||||
xs = ((dsc->tmp.cosma * xt - dsc->tmp.sinma * yt) >> (_LV_TRANSFORM_TRIGO_SHIFT - 8)) + dsc->tmp.pivot_x_256;
|
||||
ys = ((dsc->tmp.sinma * xt + dsc->tmp.cosma * yt) >> (_LV_TRANSFORM_TRIGO_SHIFT - 8)) + dsc->tmp.pivot_y_256;
|
||||
}
|
||||
else if(dsc->cfg.angle == 0) {
|
||||
xt = (int32_t)((int32_t)xt * dsc->tmp.zoom_inv) >> _LV_ZOOM_INV_UPSCALE;
|
||||
yt = (int32_t)((int32_t)yt * dsc->tmp.zoom_inv) >> _LV_ZOOM_INV_UPSCALE;
|
||||
xs = xt + dsc->tmp.pivot_x_256;
|
||||
ys = yt + dsc->tmp.pivot_y_256;
|
||||
}
|
||||
else {
|
||||
xt = (int32_t)((int32_t)xt * dsc->tmp.zoom_inv) >> _LV_ZOOM_INV_UPSCALE;
|
||||
yt = (int32_t)((int32_t)yt * dsc->tmp.zoom_inv) >> _LV_ZOOM_INV_UPSCALE;
|
||||
xs = ((dsc->tmp.cosma * xt - dsc->tmp.sinma * yt) >> (_LV_TRANSFORM_TRIGO_SHIFT)) + dsc->tmp.pivot_x_256;
|
||||
ys = ((dsc->tmp.sinma * xt + dsc->tmp.cosma * yt) >> (_LV_TRANSFORM_TRIGO_SHIFT)) + dsc->tmp.pivot_y_256;
|
||||
}
|
||||
|
||||
/*Get the integer part of the source pixel*/
|
||||
int32_t xs_int = xs >> 8;
|
||||
int32_t ys_int = ys >> 8;
|
||||
|
||||
if(xs_int >= dsc->cfg.src_w) return false;
|
||||
else if(xs_int < 0) return false;
|
||||
|
||||
if(ys_int >= dsc->cfg.src_h) return false;
|
||||
else if(ys_int < 0) return false;
|
||||
|
||||
uint8_t px_size;
|
||||
uint32_t pxi;
|
||||
if(dsc->tmp.native_color) {
|
||||
if(dsc->tmp.has_alpha == 0) {
|
||||
px_size = LV_COLOR_SIZE >> 3;
|
||||
|
||||
pxi = dsc->cfg.src_w * ys_int * px_size + xs_int * px_size;
|
||||
_lv_memcpy_small(&dsc->res.color, &src_u8[pxi], px_size);
|
||||
}
|
||||
else {
|
||||
px_size = LV_IMG_PX_SIZE_ALPHA_BYTE;
|
||||
pxi = dsc->cfg.src_w * ys_int * px_size + xs_int * px_size;
|
||||
_lv_memcpy_small(&dsc->res.color, &src_u8[pxi], px_size - 1);
|
||||
dsc->res.opa = src_u8[pxi + px_size - 1];
|
||||
}
|
||||
}
|
||||
else {
|
||||
pxi = 0; /*unused*/
|
||||
px_size = 0; /*unused*/
|
||||
dsc->res.color = lv_img_buf_get_px_color(&dsc->tmp.img_dsc, xs_int, ys_int, dsc->cfg.color);
|
||||
dsc->res.opa = lv_img_buf_get_px_alpha(&dsc->tmp.img_dsc, xs_int, ys_int);
|
||||
}
|
||||
|
||||
if(dsc->tmp.chroma_keyed) {
|
||||
lv_color_t ct = LV_COLOR_TRANSP;
|
||||
if(dsc->res.color.full == ct.full) return false;
|
||||
}
|
||||
|
||||
if(dsc->cfg.antialias == false) return true;
|
||||
|
||||
dsc->tmp.xs = xs;
|
||||
dsc->tmp.ys = ys;
|
||||
dsc->tmp.xs_int = xs_int;
|
||||
dsc->tmp.ys_int = ys_int;
|
||||
dsc->tmp.pxi = pxi;
|
||||
dsc->tmp.px_size = px_size;
|
||||
|
||||
bool ret;
|
||||
ret = _lv_img_buf_transform_anti_alias(dsc);
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
/**
|
||||
* Get the area of a rectangle if its rotated and scaled
|
||||
|
||||
@@ -137,8 +137,8 @@ lv_img_cache_entry_t * _lv_img_cache_open(const void * src, lv_color_t color)
|
||||
if(open_res == LV_RES_INV) {
|
||||
LV_LOG_WARN("Image draw cannot open the image resource");
|
||||
lv_img_decoder_close(&cached_src->dec_dsc);
|
||||
_lv_memset_00(&cached_src->dec_dsc, sizeof(lv_img_decoder_dsc_t));
|
||||
_lv_memset_00(cached_src, sizeof(lv_img_cache_entry_t));
|
||||
lv_memset_00(&cached_src->dec_dsc, sizeof(lv_img_decoder_dsc_t));
|
||||
lv_memset_00(cached_src, sizeof(lv_img_cache_entry_t));
|
||||
cached_src->life = INT32_MIN; /*Make the empty entry very "weak" to force its use */
|
||||
return NULL;
|
||||
}
|
||||
@@ -185,8 +185,8 @@ void lv_img_cache_set_size(uint16_t new_entry_cnt)
|
||||
/*Clean the cache*/
|
||||
uint16_t i;
|
||||
for(i = 0; i < entry_cnt; i++) {
|
||||
_lv_memset_00(&LV_GC_ROOT(_lv_img_cache_array)[i].dec_dsc, sizeof(lv_img_decoder_dsc_t));
|
||||
_lv_memset_00(&LV_GC_ROOT(_lv_img_cache_array)[i], sizeof(lv_img_cache_entry_t));
|
||||
lv_memset_00(&LV_GC_ROOT(_lv_img_cache_array)[i].dec_dsc, sizeof(lv_img_decoder_dsc_t));
|
||||
lv_memset_00(&LV_GC_ROOT(_lv_img_cache_array)[i], sizeof(lv_img_cache_entry_t));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -208,8 +208,8 @@ void lv_img_cache_invalidate_src(const void * src)
|
||||
lv_img_decoder_close(&cache[i].dec_dsc);
|
||||
}
|
||||
|
||||
_lv_memset_00(&cache[i].dec_dsc, sizeof(lv_img_decoder_dsc_t));
|
||||
_lv_memset_00(&cache[i], sizeof(lv_img_cache_entry_t));
|
||||
lv_memset_00(&cache[i].dec_dsc, sizeof(lv_img_decoder_dsc_t));
|
||||
lv_memset_00(&cache[i], sizeof(lv_img_cache_entry_t));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -200,7 +200,7 @@ lv_img_decoder_t * lv_img_decoder_create(void)
|
||||
LV_ASSERT_MEM(decoder);
|
||||
if(decoder == NULL) return NULL;
|
||||
|
||||
_lv_memset_00(decoder, sizeof(lv_img_decoder_t));
|
||||
lv_memset_00(decoder, sizeof(lv_img_decoder_t));
|
||||
|
||||
return decoder;
|
||||
}
|
||||
@@ -338,7 +338,7 @@ lv_res_t lv_img_decoder_built_in_open(lv_img_decoder_t * decoder, lv_img_decoder
|
||||
LV_LOG_ERROR("img_decoder_built_in_open: out of memory");
|
||||
return LV_RES_INV;
|
||||
}
|
||||
_lv_memset_00(dsc->user_data, sizeof(lv_img_decoder_built_in_data_t));
|
||||
lv_memset_00(dsc->user_data, sizeof(lv_img_decoder_built_in_data_t));
|
||||
}
|
||||
|
||||
lv_img_decoder_built_in_data_t * user_data = dsc->user_data;
|
||||
@@ -387,7 +387,7 @@ lv_res_t lv_img_decoder_built_in_open(lv_img_decoder_t * decoder, lv_img_decoder
|
||||
lv_img_decoder_built_in_close(decoder, dsc);
|
||||
return LV_RES_INV;
|
||||
}
|
||||
_lv_memset_00(dsc->user_data, sizeof(lv_img_decoder_built_in_data_t));
|
||||
lv_memset_00(dsc->user_data, sizeof(lv_img_decoder_built_in_data_t));
|
||||
}
|
||||
|
||||
lv_img_decoder_built_in_data_t * user_data = dsc->user_data;
|
||||
@@ -631,7 +631,7 @@ static lv_res_t lv_img_decoder_built_in_line_alpha(lv_img_decoder_dsc_t * dsc, l
|
||||
|
||||
#if LV_USE_FILESYSTEM
|
||||
lv_img_decoder_built_in_data_t * user_data = dsc->user_data;
|
||||
uint8_t * fs_buf = _lv_mem_buf_get(w);
|
||||
uint8_t * fs_buf = lv_mem_buf_get(w);
|
||||
#endif
|
||||
|
||||
const uint8_t * data_tmp = NULL;
|
||||
@@ -665,7 +665,7 @@ static lv_res_t lv_img_decoder_built_in_line_alpha(lv_img_decoder_dsc_t * dsc, l
|
||||
}
|
||||
}
|
||||
#if LV_USE_FILESYSTEM
|
||||
_lv_mem_buf_release(fs_buf);
|
||||
lv_mem_buf_release(fs_buf);
|
||||
#endif
|
||||
return LV_RES_OK;
|
||||
|
||||
@@ -719,7 +719,7 @@ static lv_res_t lv_img_decoder_built_in_line_indexed(lv_img_decoder_dsc_t * dsc,
|
||||
lv_img_decoder_built_in_data_t * user_data = dsc->user_data;
|
||||
|
||||
#if LV_USE_FILESYSTEM
|
||||
uint8_t * fs_buf = _lv_mem_buf_get(w);
|
||||
uint8_t * fs_buf = lv_mem_buf_get(w);
|
||||
#endif
|
||||
const uint8_t * data_tmp = NULL;
|
||||
if(dsc->src_type == LV_IMG_SRC_VARIABLE) {
|
||||
@@ -763,7 +763,7 @@ static lv_res_t lv_img_decoder_built_in_line_indexed(lv_img_decoder_dsc_t * dsc,
|
||||
}
|
||||
}
|
||||
#if LV_USE_FILESYSTEM
|
||||
_lv_mem_buf_release(fs_buf);
|
||||
lv_mem_buf_release(fs_buf);
|
||||
#endif
|
||||
return LV_RES_OK;
|
||||
#else
|
||||
|
||||
@@ -117,7 +117,7 @@ const uint8_t * lv_font_get_bitmap_fmt_txt(const lv_font_t * font, uint32_t unic
|
||||
break;
|
||||
}
|
||||
|
||||
if(_lv_mem_get_size(LV_GC_ROOT(_lv_font_decompr_buf)) < buf_size) {
|
||||
if(lv_mem_get_size(LV_GC_ROOT(_lv_font_decompr_buf)) < buf_size) {
|
||||
LV_GC_ROOT(_lv_font_decompr_buf) = lv_mem_realloc(LV_GC_ROOT(_lv_font_decompr_buf), buf_size);
|
||||
LV_ASSERT_MEM(LV_GC_ROOT(_lv_font_decompr_buf));
|
||||
if(LV_GC_ROOT(_lv_font_decompr_buf) == NULL) return NULL;
|
||||
@@ -359,12 +359,12 @@ static void decompress(const uint8_t * in, uint8_t * out, lv_coord_t w, lv_coord
|
||||
|
||||
rle_init(in, bpp);
|
||||
|
||||
uint8_t * line_buf1 = _lv_mem_buf_get(w);
|
||||
uint8_t * line_buf1 = lv_mem_buf_get(w);
|
||||
|
||||
uint8_t * line_buf2 = NULL;
|
||||
|
||||
if(prefilter) {
|
||||
line_buf2 = _lv_mem_buf_get(w);
|
||||
line_buf2 = lv_mem_buf_get(w);
|
||||
}
|
||||
|
||||
decompress_line(line_buf1, w);
|
||||
@@ -397,8 +397,8 @@ static void decompress(const uint8_t * in, uint8_t * out, lv_coord_t w, lv_coord
|
||||
}
|
||||
}
|
||||
|
||||
_lv_mem_buf_release(line_buf1);
|
||||
_lv_mem_buf_release(line_buf2);
|
||||
lv_mem_buf_release(line_buf1);
|
||||
lv_mem_buf_release(line_buf2);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -443,7 +443,7 @@ static void lv_gpu_nxp_pxp_blit_recolor(lv_color_t * dest, lv_coord_t dest_width
|
||||
/* Recolor with transparency */
|
||||
|
||||
/* Step 1: Recolor with full opacity to temporary buffer */
|
||||
lv_color_t * tmpBuf = (lv_color_t *) _lv_mem_buf_get(copy_width * copy_height * sizeof(lv_color_t));
|
||||
lv_color_t * tmpBuf = (lv_color_t *) lv_mem_buf_get(copy_width * copy_height * sizeof(lv_color_t));
|
||||
lv_gpu_nxp_pxp_blit_recolor(tmpBuf, copy_width, src, src_width, copy_width, copy_height, LV_OPA_COVER, recolor,
|
||||
recolorOpa);
|
||||
|
||||
@@ -453,7 +453,7 @@ static void lv_gpu_nxp_pxp_blit_recolor(lv_color_t * dest, lv_coord_t dest_width
|
||||
lv_gpu_nxp_pxp_enable_recolor(recolor, recolorOpa); /* restore state */
|
||||
|
||||
/* Step 3: Clean-up memory */
|
||||
_lv_mem_buf_release(tmpBuf);
|
||||
lv_mem_buf_release(tmpBuf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ static lv_disp_t * disp_def;
|
||||
*/
|
||||
void lv_disp_drv_init(lv_disp_drv_t * driver)
|
||||
{
|
||||
_lv_memset_00(driver, sizeof(lv_disp_drv_t));
|
||||
lv_memset_00(driver, sizeof(lv_disp_drv_t));
|
||||
|
||||
driver->flush_cb = NULL;
|
||||
driver->hor_res = LV_HOR_RES_MAX;
|
||||
@@ -103,7 +103,7 @@ void lv_disp_drv_init(lv_disp_drv_t * driver)
|
||||
*/
|
||||
void lv_disp_buf_init(lv_disp_buf_t * disp_buf, void * buf1, void * buf2, uint32_t size_in_px_cnt)
|
||||
{
|
||||
_lv_memset_00(disp_buf, sizeof(lv_disp_buf_t));
|
||||
lv_memset_00(disp_buf, sizeof(lv_disp_buf_t));
|
||||
|
||||
disp_buf->buf1 = buf1;
|
||||
disp_buf->buf2 = buf2;
|
||||
@@ -125,8 +125,8 @@ lv_disp_t * lv_disp_drv_register(lv_disp_drv_t * driver)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
_lv_memset_00(disp, sizeof(lv_disp_t));
|
||||
_lv_memcpy(&disp->driver, driver, sizeof(lv_disp_drv_t));
|
||||
lv_memset_00(disp, sizeof(lv_disp_t));
|
||||
lv_memcpy(&disp->driver, driver, sizeof(lv_disp_drv_t));
|
||||
|
||||
disp->last_activity_time = 0;
|
||||
|
||||
@@ -327,7 +327,7 @@ LV_ATTRIBUTE_FLUSH_READY void lv_disp_flush_ready(lv_disp_drv_t * disp_drv)
|
||||
/*If the screen is transparent initialize it when the flushing is ready*/
|
||||
#if LV_COLOR_SCREEN_TRANSP
|
||||
if(disp_drv->screen_transp) {
|
||||
_lv_memset_00(disp_drv->buffer->buf_act, disp_drv->buffer->size * sizeof(lv_color32_t));
|
||||
lv_memset_00(disp_drv->buffer->buf_act, disp_drv->buffer->size * sizeof(lv_color32_t));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
*/
|
||||
void lv_indev_drv_init(lv_indev_drv_t * driver)
|
||||
{
|
||||
_lv_memset_00(driver, sizeof(lv_indev_drv_t));
|
||||
lv_memset_00(driver, sizeof(lv_indev_drv_t));
|
||||
|
||||
driver->type = LV_INDEV_TYPE_NONE;
|
||||
driver->scroll_limit = LV_INDEV_DEF_DRAG_LIMIT;
|
||||
@@ -84,8 +84,8 @@ lv_indev_t * lv_indev_drv_register(lv_indev_drv_t * driver)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
_lv_memset_00(indev, sizeof(lv_indev_t));
|
||||
_lv_memcpy(&indev->driver, driver, sizeof(lv_indev_drv_t));
|
||||
lv_memset_00(indev, sizeof(lv_indev_t));
|
||||
lv_memcpy(&indev->driver, driver, sizeof(lv_indev_drv_t));
|
||||
|
||||
indev->proc.reset_query = 1;
|
||||
indev->cursor = NULL;
|
||||
@@ -131,7 +131,7 @@ bool _lv_indev_read(lv_indev_t * indev, lv_indev_data_t * data)
|
||||
{
|
||||
bool cont = false;
|
||||
|
||||
_lv_memset_00(data, sizeof(lv_indev_data_t));
|
||||
lv_memset_00(data, sizeof(lv_indev_data_t));
|
||||
|
||||
/* For touchpad sometimes users don't the last pressed coordinate on release.
|
||||
* So be sure a coordinates are initialized to the last point */
|
||||
|
||||
+31
-10
@@ -76,11 +76,11 @@ void _lv_anim_core_init(void)
|
||||
*/
|
||||
void lv_anim_init(lv_anim_t * a)
|
||||
{
|
||||
_lv_memset_00(a, sizeof(lv_anim_t));
|
||||
lv_memset_00(a, sizeof(lv_anim_t));
|
||||
a->time = 500;
|
||||
a->start = 0;
|
||||
a->end = 100;
|
||||
_lv_memcpy_small(&a->path, &lv_anim_path_def, sizeof(lv_anim_path_cb_t));
|
||||
lv_memcpy_small(&a->path, &lv_anim_path_def, sizeof(lv_anim_path_cb_t));
|
||||
a->repeat_cnt = 1;
|
||||
a->early_apply = 1;
|
||||
}
|
||||
@@ -106,7 +106,7 @@ void lv_anim_start(lv_anim_t * a)
|
||||
|
||||
/*Initialize the animation descriptor*/
|
||||
a->time_orig = a->time;
|
||||
_lv_memcpy(new_anim, a, sizeof(lv_anim_t));
|
||||
lv_memcpy(new_anim, a, sizeof(lv_anim_t));
|
||||
|
||||
/*Set the start value*/
|
||||
if(new_anim->early_apply) {
|
||||
@@ -120,6 +120,27 @@ void lv_anim_start(lv_anim_t * a)
|
||||
LV_LOG_TRACE("animation created")
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize an animation path
|
||||
* @param path pointer to path
|
||||
*/
|
||||
void lv_anim_path_init(lv_anim_path_t * path)
|
||||
{
|
||||
lv_memset_00(path, sizeof(lv_anim_path_t));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the path (curve) of the animation.
|
||||
* @param a pointer to an initialized `lv_anim_t` variable
|
||||
* @param path_cb a function the get the current value of the animation.
|
||||
* The built in functions starts with `lv_anim_path_...`
|
||||
*/
|
||||
void lv_anim_set_path(lv_anim_t * a, const lv_anim_path_t * path)
|
||||
{
|
||||
lv_memcpy_small(&a->path, path, sizeof(lv_anim_path_t));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete an animation of a variable with a given animator function
|
||||
* @param var pointer to variable
|
||||
@@ -192,7 +213,7 @@ uint16_t lv_anim_count_running(void)
|
||||
*/
|
||||
uint16_t lv_anim_speed_to_time(uint16_t speed, lv_anim_value_t start, lv_anim_value_t end)
|
||||
{
|
||||
int32_t d = LV_MATH_ABS((int32_t)start - end);
|
||||
int32_t d = LV_ABS((int32_t)start - end);
|
||||
uint32_t time = (int32_t)((int32_t)(d * 1000) / speed);
|
||||
|
||||
if(time > UINT16_MAX) time = UINT16_MAX;
|
||||
@@ -259,7 +280,7 @@ lv_anim_value_t lv_anim_path_ease_in(const lv_anim_path_t * path, const lv_anim_
|
||||
else
|
||||
t = (uint32_t)((uint32_t)a->act_time * 1024) / a->time;
|
||||
|
||||
int32_t step = _lv_bezier3(t, 0, 0, 580, 1024);
|
||||
int32_t step = lv_bezier3(t, 0, 0, 580, 1024);
|
||||
|
||||
int32_t new_value;
|
||||
new_value = (int32_t)step * (a->end - a->start);
|
||||
@@ -286,7 +307,7 @@ lv_anim_value_t lv_anim_path_ease_out(const lv_anim_path_t * path, const lv_anim
|
||||
else
|
||||
t = (uint32_t)((uint32_t)a->act_time * 1024) / a->time;
|
||||
|
||||
int32_t step = _lv_bezier3(t, 0, 420, 1000, 1024);
|
||||
int32_t step = lv_bezier3(t, 0, 420, 1000, 1024);
|
||||
|
||||
int32_t new_value;
|
||||
new_value = (int32_t)step * (a->end - a->start);
|
||||
@@ -313,7 +334,7 @@ lv_anim_value_t lv_anim_path_ease_in_out(const lv_anim_path_t * path, const lv_a
|
||||
else
|
||||
t = (uint32_t)((uint32_t)a->act_time * 1024) / a->time;
|
||||
|
||||
int32_t step = _lv_bezier3(t, 0, 64, 1024 - 64, 1024);
|
||||
int32_t step = lv_bezier3(t, 0, 64, 1024 - 64, 1024);
|
||||
|
||||
int32_t new_value;
|
||||
new_value = (int32_t)step * (a->end - a->start);
|
||||
@@ -340,7 +361,7 @@ lv_anim_value_t lv_anim_path_overshoot(const lv_anim_path_t * path, const lv_ani
|
||||
else
|
||||
t = (uint32_t)((uint32_t)a->act_time * 1024) / a->time;
|
||||
|
||||
int32_t step = _lv_bezier3(t, 0, 1000, 1300, 1024);
|
||||
int32_t step = lv_bezier3(t, 0, 1000, 1300, 1024);
|
||||
|
||||
int32_t new_value;
|
||||
new_value = (int32_t)step * (a->end - a->start);
|
||||
@@ -405,7 +426,7 @@ lv_anim_value_t lv_anim_path_bounce(const lv_anim_path_t * path, const lv_anim_t
|
||||
if(t > 1024) t = 1024;
|
||||
if(t < 0) t = 0;
|
||||
|
||||
int32_t step = _lv_bezier3(t, 1024, 800, 500, 0);
|
||||
int32_t step = lv_bezier3(t, 1024, 800, 500, 0);
|
||||
|
||||
int32_t new_value;
|
||||
new_value = (int32_t)step * diff;
|
||||
@@ -520,7 +541,7 @@ static bool anim_ready_handler(lv_anim_t * a)
|
||||
/*Create copy from the animation and delete the animation from the list.
|
||||
* This way the `ready_cb` will see the animations like it's animation is ready deleted*/
|
||||
lv_anim_t a_tmp;
|
||||
_lv_memcpy(&a_tmp, a, sizeof(lv_anim_t));
|
||||
lv_memcpy(&a_tmp, a, sizeof(lv_anim_t));
|
||||
_lv_ll_remove(&LV_GC_ROOT(_lv_anim_ll), a);
|
||||
lv_mem_free(a);
|
||||
/*Flag that the list has changed */
|
||||
|
||||
@@ -18,7 +18,6 @@ extern "C" {
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include "lv_mem.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
@@ -197,10 +196,7 @@ static inline void lv_anim_set_custom_exec_cb(lv_anim_t * a, lv_anim_custom_exec
|
||||
* @param path_cb a function the get the current value of the animation.
|
||||
* The built in functions starts with `lv_anim_path_...`
|
||||
*/
|
||||
static inline void lv_anim_set_path(lv_anim_t * a, const lv_anim_path_t * path)
|
||||
{
|
||||
_lv_memcpy_small(&a->path, path, sizeof(lv_anim_path_t));
|
||||
}
|
||||
void lv_anim_set_path(lv_anim_t * a, const lv_anim_path_t * path);
|
||||
|
||||
|
||||
/**
|
||||
@@ -273,10 +269,7 @@ void lv_anim_start(lv_anim_t * a);
|
||||
* Initialize an animation path
|
||||
* @param path pointer to path
|
||||
*/
|
||||
static inline void lv_anim_path_init(lv_anim_path_t * path)
|
||||
{
|
||||
_lv_memset_00(path, sizeof(lv_anim_path_t));
|
||||
}
|
||||
void lv_anim_path_init(lv_anim_path_t * path);
|
||||
|
||||
/**
|
||||
* Set a callback for a path
|
||||
|
||||
@@ -113,10 +113,10 @@ uint32_t lv_area_get_size(const lv_area_t * area_p)
|
||||
bool _lv_area_intersect(lv_area_t * res_p, const lv_area_t * a1_p, const lv_area_t * a2_p)
|
||||
{
|
||||
/* Get the smaller area from 'a1_p' and 'a2_p' */
|
||||
res_p->x1 = LV_MATH_MAX(a1_p->x1, a2_p->x1);
|
||||
res_p->y1 = LV_MATH_MAX(a1_p->y1, a2_p->y1);
|
||||
res_p->x2 = LV_MATH_MIN(a1_p->x2, a2_p->x2);
|
||||
res_p->y2 = LV_MATH_MIN(a1_p->y2, a2_p->y2);
|
||||
res_p->x1 = LV_MAX(a1_p->x1, a2_p->x1);
|
||||
res_p->y1 = LV_MAX(a1_p->y1, a2_p->y1);
|
||||
res_p->x2 = LV_MIN(a1_p->x2, a2_p->x2);
|
||||
res_p->y2 = LV_MIN(a1_p->y2, a2_p->y2);
|
||||
|
||||
/*If x1 or y1 greater then x2 or y2 then the areas union is empty*/
|
||||
bool union_ok = true;
|
||||
@@ -134,10 +134,10 @@ bool _lv_area_intersect(lv_area_t * res_p, const lv_area_t * a1_p, const lv_area
|
||||
*/
|
||||
void _lv_area_join(lv_area_t * a_res_p, const lv_area_t * a1_p, const lv_area_t * a2_p)
|
||||
{
|
||||
a_res_p->x1 = LV_MATH_MIN(a1_p->x1, a2_p->x1);
|
||||
a_res_p->y1 = LV_MATH_MIN(a1_p->y1, a2_p->y1);
|
||||
a_res_p->x2 = LV_MATH_MAX(a1_p->x2, a2_p->x2);
|
||||
a_res_p->y2 = LV_MATH_MAX(a1_p->y2, a2_p->y2);
|
||||
a_res_p->x1 = LV_MIN(a1_p->x1, a2_p->x1);
|
||||
a_res_p->y1 = LV_MIN(a1_p->y1, a2_p->y1);
|
||||
a_res_p->x2 = LV_MAX(a1_p->x2, a2_p->x2);
|
||||
a_res_p->y2 = LV_MAX(a1_p->y2, a2_p->y2);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -163,7 +163,7 @@ bool _lv_area_is_point_on(const lv_area_t * a_p, const lv_point_t * p_p, lv_coor
|
||||
}
|
||||
lv_coord_t w = lv_area_get_width(a_p) / 2;
|
||||
lv_coord_t h = lv_area_get_height(a_p) / 2;
|
||||
lv_coord_t max_radius = LV_MATH_MIN(w, h);
|
||||
lv_coord_t max_radius = LV_MIN(w, h);
|
||||
if(radius > max_radius)
|
||||
radius = max_radius;
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ extern "C" {
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "lv_mem.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
@@ -113,7 +112,10 @@ void lv_area_set(lv_area_t * area_p, lv_coord_t x1, lv_coord_t y1, lv_coord_t x2
|
||||
*/
|
||||
inline static void lv_area_copy(lv_area_t * dest, const lv_area_t * src)
|
||||
{
|
||||
_lv_memcpy_small(dest, src, sizeof(lv_area_t));
|
||||
dest->x1 = src->x1;
|
||||
dest->y1 = src->y1;
|
||||
dest->x2 = src->x2;
|
||||
dest->y2 = src->y2;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+17
-17
@@ -138,12 +138,12 @@ uint16_t _lv_bidi_get_logical_pos(const char * str_in, char ** bidi_txt, uint32_
|
||||
uint32_t visual_pos, bool * is_rtl)
|
||||
{
|
||||
uint32_t pos_conv_len = get_txt_len(str_in, len);
|
||||
char * buf = _lv_mem_buf_get(len + 1);
|
||||
char * buf = lv_mem_buf_get(len + 1);
|
||||
if(buf == NULL) return (uint16_t) -1;
|
||||
|
||||
uint16_t * pos_conv_buf = _lv_mem_buf_get(pos_conv_len * sizeof(uint16_t));
|
||||
uint16_t * pos_conv_buf = lv_mem_buf_get(pos_conv_len * sizeof(uint16_t));
|
||||
if(pos_conv_buf == NULL) {
|
||||
_lv_mem_buf_release(buf);
|
||||
lv_mem_buf_release(buf);
|
||||
return (uint16_t) -1;
|
||||
}
|
||||
|
||||
@@ -153,9 +153,9 @@ uint16_t _lv_bidi_get_logical_pos(const char * str_in, char ** bidi_txt, uint32_
|
||||
|
||||
if(is_rtl) *is_rtl = IS_RTL_POS(pos_conv_buf[visual_pos]);
|
||||
|
||||
if(bidi_txt == NULL) _lv_mem_buf_release(buf);
|
||||
if(bidi_txt == NULL) lv_mem_buf_release(buf);
|
||||
uint16_t res = GET_POS(pos_conv_buf[visual_pos]);
|
||||
_lv_mem_buf_release(pos_conv_buf);
|
||||
lv_mem_buf_release(pos_conv_buf);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -175,12 +175,12 @@ uint16_t _lv_bidi_get_visual_pos(const char * str_in, char ** bidi_txt, uint16_t
|
||||
uint32_t logical_pos, bool * is_rtl)
|
||||
{
|
||||
uint32_t pos_conv_len = get_txt_len(str_in, len);
|
||||
char * buf = _lv_mem_buf_get(len + 1);
|
||||
char * buf = lv_mem_buf_get(len + 1);
|
||||
if(buf == NULL) return (uint16_t) -1;
|
||||
|
||||
uint16_t * pos_conv_buf = _lv_mem_buf_get(pos_conv_len * sizeof(uint16_t));
|
||||
uint16_t * pos_conv_buf = lv_mem_buf_get(pos_conv_len * sizeof(uint16_t));
|
||||
if(pos_conv_buf == NULL) {
|
||||
_lv_mem_buf_release(buf);
|
||||
lv_mem_buf_release(buf);
|
||||
return (uint16_t) -1;
|
||||
}
|
||||
|
||||
@@ -192,14 +192,14 @@ uint16_t _lv_bidi_get_visual_pos(const char * str_in, char ** bidi_txt, uint16_t
|
||||
if(GET_POS(pos_conv_buf[i]) == logical_pos) {
|
||||
|
||||
if(is_rtl) *is_rtl = IS_RTL_POS(pos_conv_buf[i]);
|
||||
_lv_mem_buf_release(pos_conv_buf);
|
||||
lv_mem_buf_release(pos_conv_buf);
|
||||
|
||||
if(bidi_txt == NULL) _lv_mem_buf_release(buf);
|
||||
if(bidi_txt == NULL) lv_mem_buf_release(buf);
|
||||
return i;
|
||||
}
|
||||
}
|
||||
_lv_mem_buf_release(pos_conv_buf);
|
||||
if(bidi_txt == NULL) _lv_mem_buf_release(buf);
|
||||
lv_mem_buf_release(pos_conv_buf);
|
||||
if(bidi_txt == NULL) lv_mem_buf_release(buf);
|
||||
return (uint16_t) -1;
|
||||
}
|
||||
|
||||
@@ -258,7 +258,7 @@ void _lv_bidi_process_paragraph(const char * str_in, char * str_out, uint32_t le
|
||||
if(rd) {
|
||||
if(base_dir == LV_BIDI_DIR_LTR) {
|
||||
if(str_out) {
|
||||
_lv_memcpy(&str_out[wr], str_in, rd);
|
||||
lv_memcpy(&str_out[wr], str_in, rd);
|
||||
wr += rd;
|
||||
}
|
||||
if(pos_conv_out) {
|
||||
@@ -281,7 +281,7 @@ void _lv_bidi_process_paragraph(const char * str_in, char * str_out, uint32_t le
|
||||
|
||||
if(base_dir == LV_BIDI_DIR_LTR) {
|
||||
if(run_dir == LV_BIDI_DIR_LTR) {
|
||||
if(str_out) _lv_memcpy(&str_out[wr], &str_in[rd], run_len);
|
||||
if(str_out) lv_memcpy(&str_out[wr], &str_in[rd], run_len);
|
||||
if(pos_conv_out) fill_pos_conv(&pos_conv_out[pos_conv_wr], pos_conv_run_len, pos_conv_rd);
|
||||
}
|
||||
else rtl_reverse(str_out ? &str_out[wr] : NULL, &str_in[rd], run_len, pos_conv_out ? &pos_conv_out[pos_conv_wr] : NULL,
|
||||
@@ -293,7 +293,7 @@ void _lv_bidi_process_paragraph(const char * str_in, char * str_out, uint32_t le
|
||||
wr -= run_len;
|
||||
pos_conv_wr -= pos_conv_run_len;
|
||||
if(run_dir == LV_BIDI_DIR_LTR) {
|
||||
if(str_out) _lv_memcpy(&str_out[wr], &str_in[rd], run_len);
|
||||
if(str_out) lv_memcpy(&str_out[wr], &str_in[rd], run_len);
|
||||
if(pos_conv_out) fill_pos_conv(&pos_conv_out[pos_conv_wr], pos_conv_run_len, pos_conv_rd);
|
||||
}
|
||||
else rtl_reverse(str_out ? &str_out[wr] : NULL, &str_in[rd], run_len, pos_conv_out ? &pos_conv_out[pos_conv_wr] : NULL,
|
||||
@@ -536,7 +536,7 @@ static void rtl_reverse(char * dest, const char * src, uint32_t len, uint16_t *
|
||||
pos_conv_first_weak = 0;
|
||||
}
|
||||
|
||||
if(dest) _lv_memcpy(&dest[wr], &src[first_weak], last_weak - first_weak + 1);
|
||||
if(dest) lv_memcpy(&dest[wr], &src[first_weak], last_weak - first_weak + 1);
|
||||
if(pos_conv_out) fill_pos_conv(&pos_conv_out[pos_conv_wr], pos_conv_last_weak - pos_conv_first_weak + 1,
|
||||
pos_conv_rd_base + pos_conv_first_weak);
|
||||
wr += last_weak - first_weak + 1;
|
||||
@@ -556,7 +556,7 @@ static void rtl_reverse(char * dest, const char * src, uint32_t len, uint16_t *
|
||||
}
|
||||
/*Just store the letter*/
|
||||
else {
|
||||
if(dest) _lv_memcpy(&dest[wr], &src[i], letter_size);
|
||||
if(dest) lv_memcpy(&dest[wr], &src[i], letter_size);
|
||||
if(pos_conv_out) pos_conv_out[pos_conv_wr] = SET_RTL_POS(pos_conv_rd_base + pos_conv_i, true);
|
||||
wr += letter_size;
|
||||
pos_conv_wr++;
|
||||
|
||||
@@ -38,10 +38,10 @@
|
||||
//{
|
||||
// lv_base_class_t * c = class_p;
|
||||
// const lv_base_class_t * bc = base_p;
|
||||
// _lv_memset_00(c, class_size);
|
||||
// lv_memset_00(c, class_size);
|
||||
//
|
||||
// /*By default use the same methods as the base*/
|
||||
// if(bc) _lv_memcpy(c, base_p, bc->_class_size);
|
||||
// if(bc) lv_memcpy(c, base_p, bc->_class_size);
|
||||
//
|
||||
// c->base_p = base_p; /*Save the base to allow accessing its methods later*/
|
||||
// c->init = NULL;
|
||||
@@ -55,7 +55,7 @@
|
||||
//{
|
||||
// lv_base_class_t * base_class_p = class_p;
|
||||
// lv_base_t * instance = lv_mem_alloc(base_class_p->_instance_size);
|
||||
// _lv_memset_00(instance, base_class_p->_instance_size);
|
||||
// lv_memset_00(instance, base_class_p->_instance_size);
|
||||
// instance->class_p = class_p;
|
||||
// return instance;
|
||||
//}
|
||||
@@ -84,6 +84,6 @@
|
||||
//{
|
||||
// lv_base_t * base_inst = inst;
|
||||
// void * class_p = base_inst->class_p;
|
||||
// _lv_memset_00(inst, base_inst->class_p->_instance_size);
|
||||
// lv_memset_00(inst, base_inst->class_p->_instance_size);
|
||||
// base_inst->class_p = class_p; /*Restore class dsc pointer*/
|
||||
//}
|
||||
|
||||
@@ -234,7 +234,7 @@ lv_color_hsv_t lv_color_rgb_to_hsv(uint8_t r8, uint8_t g8, uint8_t b8)
|
||||
hsv.v = (100 * rgbMax) >> 10;
|
||||
|
||||
int32_t delta = rgbMax - rgbMin;
|
||||
if(LV_MATH_ABS(delta) < 3) {
|
||||
if(LV_ABS(delta) < 3) {
|
||||
hsv.h = 0;
|
||||
hsv.s = 0;
|
||||
return hsv;
|
||||
|
||||
@@ -14,7 +14,6 @@ extern "C" {
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "../lv_conf_internal.h"
|
||||
#include "lv_math.h"
|
||||
|
||||
/*Error checking*/
|
||||
#if LV_COLOR_DEPTH == 24
|
||||
@@ -208,6 +207,9 @@ enum {
|
||||
# define LV_COLOR_GET_A(c) LV_COLOR_GET_A32(c)
|
||||
#endif
|
||||
|
||||
|
||||
#define LV_UDIV255(x) ((uint32_t)((uint32_t) (x) * 0x8081) >> 0x17)
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
@@ -467,11 +469,11 @@ LV_ATTRIBUTE_FAST_MEM static inline lv_color_t lv_color_mix(lv_color_t c1, lv_co
|
||||
lv_color_t ret;
|
||||
#if LV_COLOR_DEPTH != 1
|
||||
/*LV_COLOR_DEPTH == 8, 16 or 32*/
|
||||
LV_COLOR_SET_R(ret, LV_MATH_UDIV255((uint16_t) LV_COLOR_GET_R(c1) * mix + LV_COLOR_GET_R(c2) *
|
||||
LV_COLOR_SET_R(ret, LV_UDIV255((uint16_t) LV_COLOR_GET_R(c1) * mix + LV_COLOR_GET_R(c2) *
|
||||
(255 - mix) + LV_COLOR_MIX_ROUND_OFS));
|
||||
LV_COLOR_SET_G(ret, LV_MATH_UDIV255((uint16_t) LV_COLOR_GET_G(c1) * mix + LV_COLOR_GET_G(c2) *
|
||||
LV_COLOR_SET_G(ret, LV_UDIV255((uint16_t) LV_COLOR_GET_G(c1) * mix + LV_COLOR_GET_G(c2) *
|
||||
(255 - mix) + LV_COLOR_MIX_ROUND_OFS));
|
||||
LV_COLOR_SET_B(ret, LV_MATH_UDIV255((uint16_t) LV_COLOR_GET_B(c1) * mix + LV_COLOR_GET_B(c2) *
|
||||
LV_COLOR_SET_B(ret, LV_UDIV255((uint16_t) LV_COLOR_GET_B(c1) * mix + LV_COLOR_GET_B(c2) *
|
||||
(255 - mix) + LV_COLOR_MIX_ROUND_OFS));
|
||||
LV_COLOR_SET_A(ret, 0xFF);
|
||||
#else
|
||||
@@ -513,9 +515,9 @@ LV_ATTRIBUTE_FAST_MEM static inline lv_color_t lv_color_mix_premult(uint16_t * p
|
||||
lv_color_t ret;
|
||||
#if LV_COLOR_DEPTH != 1
|
||||
/*LV_COLOR_DEPTH == 8, 16 or 32*/
|
||||
LV_COLOR_SET_R(ret, LV_MATH_UDIV255((uint16_t) premult_c1[0] + LV_COLOR_GET_R(c2) * mix + LV_COLOR_MIX_ROUND_OFS));
|
||||
LV_COLOR_SET_G(ret, LV_MATH_UDIV255((uint16_t) premult_c1[1] + LV_COLOR_GET_G(c2) * mix + LV_COLOR_MIX_ROUND_OFS));
|
||||
LV_COLOR_SET_B(ret, LV_MATH_UDIV255((uint16_t) premult_c1[2] + LV_COLOR_GET_B(c2) * mix + LV_COLOR_MIX_ROUND_OFS));
|
||||
LV_COLOR_SET_R(ret, LV_UDIV255((uint16_t) premult_c1[0] + LV_COLOR_GET_R(c2) * mix + LV_COLOR_MIX_ROUND_OFS));
|
||||
LV_COLOR_SET_G(ret, LV_UDIV255((uint16_t) premult_c1[1] + LV_COLOR_GET_G(c2) * mix + LV_COLOR_MIX_ROUND_OFS));
|
||||
LV_COLOR_SET_B(ret, LV_UDIV255((uint16_t) premult_c1[2] + LV_COLOR_GET_B(c2) * mix + LV_COLOR_MIX_ROUND_OFS));
|
||||
LV_COLOR_SET_A(ret, 0xFF);
|
||||
#else
|
||||
/*LV_COLOR_DEPTH == 1*/
|
||||
|
||||
@@ -99,7 +99,7 @@ void lv_debug_log_error(const char * msg, uint64_t value)
|
||||
char * bufp = buf;
|
||||
|
||||
/*Add the function name*/
|
||||
_lv_memcpy(bufp, msg, msg_len);
|
||||
lv_memcpy(bufp, msg, msg_len);
|
||||
bufp += msg_len;
|
||||
|
||||
/*Add value in hey*/
|
||||
|
||||
+2
-2
@@ -473,7 +473,7 @@ lv_fs_res_t lv_fs_free_space(char letter, uint32_t * total_p, uint32_t * free_p)
|
||||
*/
|
||||
void lv_fs_drv_init(lv_fs_drv_t * drv)
|
||||
{
|
||||
_lv_memset_00(drv, sizeof(lv_fs_drv_t));
|
||||
lv_memset_00(drv, sizeof(lv_fs_drv_t));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -489,7 +489,7 @@ void lv_fs_drv_register(lv_fs_drv_t * drv_p)
|
||||
LV_ASSERT_MEM(new_drv);
|
||||
if(new_drv == NULL) return;
|
||||
|
||||
_lv_memcpy(new_drv, drv_p, sizeof(lv_fs_drv_t));
|
||||
lv_memcpy(new_drv, drv_p, sizeof(lv_fs_drv_t));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,7 +19,6 @@ extern "C" {
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "lv_mem.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@
|
||||
|
||||
void _lv_gc_clear_roots(void)
|
||||
{
|
||||
#define LV_CLEAR_ROOT(root_type, root_name) _lv_memset_00(&LV_GC_ROOT(root_name), sizeof(LV_GC_ROOT(root_name)));
|
||||
#define LV_CLEAR_ROOT(root_type, root_name) lv_memset_00(&LV_GC_ROOT(root_name), sizeof(LV_GC_ROOT(root_name)));
|
||||
LV_ITERATE_ROOTS(LV_CLEAR_ROOT)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ extern "C" {
|
||||
f(lv_ll_t, _lv_obj_style_trans_ll) \
|
||||
f(lv_img_cache_entry_t*, _lv_img_cache_array) \
|
||||
f(lv_timer_t*, _lv_timer_act) \
|
||||
f(lv_mem_buf_arr_t , _lv_mem_buf) \
|
||||
f(lv_mem_buf_arr_t , lv_mem_buf) \
|
||||
f(_lv_draw_mask_saved_arr_t , _lv_draw_mask_list) \
|
||||
f(void * , _lv_theme_material_styles) \
|
||||
f(void * , _lv_theme_mono_styles) \
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user