lv_style.h
API reference for lv_style.h
Functions
lv_style_set_prop
Set the value of property in a style. This function shouldn't be used directly by the user. Instead use lv_style_set_<prop_name>(). E.g. lv_style_set_bg_color()
void lv_style_set_prop(lv_style_t *style, lv_style_prop_t prop, lv_style_value_t value)| Name | Type | Description |
|---|---|---|
style | lv_style_t * | pointer to style |
prop | lv_style_prop_t | the ID of a property (e.g. LV_STYLE_BG_COLOR) |
value | lv_style_value_t | lv_style_value_t variable in which a field is set according to the type of prop |
lv_style_set_size
Set styles width and height.
void lv_style_set_size(lv_style_t *style, int32_t width, int32_t height)| Name | Type | Description |
|---|---|---|
style | lv_style_t * | pointer to style to be modified |
width | int32_t | width in pixels |
height | int32_t | height in pixels |
lv_style_set_pad_all
Set all 4 of styles padding values.
void lv_style_set_pad_all(lv_style_t *style, int32_t value)| Name | Type | Description |
|---|---|---|
style | lv_style_t * | pointer to style to be modified |
value | int32_t | padding dimension in pixels |
lv_style_set_pad_hor
Set styles left and right padding values.
void lv_style_set_pad_hor(lv_style_t *style, int32_t value)| Name | Type | Description |
|---|---|---|
style | lv_style_t * | pointer to style to be modified |
value | int32_t | padding dimension in pixels |
lv_style_set_pad_ver
Set styles top and bottom padding values.
void lv_style_set_pad_ver(lv_style_t *style, int32_t value)| Name | Type | Description |
|---|---|---|
style | lv_style_t * | pointer to style to be modified |
value | int32_t | padding dimension in pixels |
lv_style_set_pad_gap
Set styles row and column padding gaps (applies only to Grid and Flex layouts).
void lv_style_set_pad_gap(lv_style_t *style, int32_t value)| Name | Type | Description |
|---|---|---|
style | lv_style_t * | pointer to style to be modified |
value | int32_t | gap dimension in pixels |
lv_style_set_margin_hor
Set styles left and right margin values.
void lv_style_set_margin_hor(lv_style_t *style, int32_t value)| Name | Type | Description |
|---|---|---|
style | lv_style_t * | pointer to style to be modified |
value | int32_t | margin dimension in pixels |
lv_style_set_margin_ver
Set styles top and bottom margin values.
void lv_style_set_margin_ver(lv_style_t *style, int32_t value)| Name | Type | Description |
|---|---|---|
style | lv_style_t * | pointer to style to be modified |
value | int32_t | margin dimension in pixels |
lv_style_set_margin_all
Set all 4 of styles margin values.
void lv_style_set_margin_all(lv_style_t *style, int32_t value)| Name | Type | Description |
|---|---|---|
style | lv_style_t * | pointer to style to be modified |
value | int32_t | margin dimension in pixels |
lv_style_set_transform_scale
Set styles X and Y transform scale values.
void lv_style_set_transform_scale(lv_style_t *style, int32_t value)| Name | Type | Description |
|---|---|---|
style | lv_style_t * | pointer to style to be modified |
value | int32_t | scale factor. Example values: - 256 or LV_SCALE_NONE: no zoom - <256: scale down - >256: scale up - 128: half size - 512: double size |
lv_style_get_num_custom_props
Get the number of custom properties that have been registered thus far.
lv_style_prop_t lv_style_get_num_custom_props(void)lv_style_get_prop
Get the value of a property
lv_style_res_t lv_style_get_prop(const lv_style_t *style, lv_style_prop_t prop, lv_style_value_t *value)| Name | Type | Description |
|---|---|---|
style | const lv_style_t * | pointer to a style |
prop | lv_style_prop_t | the ID of a property |
value | lv_style_value_t * | pointer to a lv_style_value_t variable to store the value |
Returns: lv_style_res_t — LV_RESULT_INVALID: the property wasn't found in the style (value is unchanged) LV_RESULT_OK: the property was fond, and value is set accordingly
For performance reasons there are no sanity check on style
lv_style_prop_get_default
Get the default value of a property
lv_style_value_t lv_style_prop_get_default(lv_style_prop_t prop)| Name | Type | Description |
|---|---|---|
prop | lv_style_prop_t | the ID of a property |
Returns: lv_style_value_t — the default value
lv_style_get_prop_group
Tell the group of a property. If the a property from a group is set in a style the (1 << group) bit of style->has_group is set. It allows early skipping the style if the property is not exists in the style at all.
static uint32_t lv_style_get_prop_group(lv_style_prop_t prop)| Name | Type | Description |
|---|---|---|
prop | lv_style_prop_t | a style property |
Returns: uint32_t — the group [0..30] 30 means all the custom properties with index > 120
lv_style_init
Initialize a style
void lv_style_init(lv_style_t *style)| Name | Type | Description |
|---|---|---|
style | lv_style_t * | pointer to a style to initialize |
Do not call lv_style_init on styles that already have some properties because this function won't free the used memory, just sets a default state for the style. In other words be sure to initialize styles only once!
lv_style_reset
Clear all properties from a style and free all allocated memories.
void lv_style_reset(lv_style_t *style)| Name | Type | Description |
|---|---|---|
style | lv_style_t * | pointer to a style |
lv_style_copy
Copy all properties of a style to an other. It has the same affect callying the same lv_set_style_... functions on both styles. It means new memory will be allocated to store the properties in the destination style. After the copy the destination style is fully independent of the source and source can removed without affecting the destination style.
void lv_style_copy(lv_style_t *dst, const lv_style_t *src)| Name | Type | Description |
|---|---|---|
dst | lv_style_t * | the destination to copy into (can not the a constant style) |
src | const lv_style_t * | the source style to copy from. |
lv_style_merge
Copy all properties of a style to an other without resetting the dst style. It has the same effect as calling the same lv_set_style_... functions on both styles. It means new memory will be allocated to store the properties in the destination style. After the copy the destination style is fully independent of the source and source can removed without affecting the destination style.
void lv_style_merge(lv_style_t *dst, const lv_style_t *src)| Name | Type | Description |
|---|---|---|
dst | lv_style_t * | the destination to copy into (cannot be a constant style) |
src | const lv_style_t * | the source style to copy from. |
lv_style_is_const
Check if a style is constant
bool lv_style_is_const(const lv_style_t *style)| Name | Type | Description |
|---|---|---|
style | const lv_style_t * | pointer to a style |
Returns: bool — true: the style is constant
lv_style_register_prop
Register a new style property for custom usage Example:
lv_style_prop_t MY_PROP;
static inline void lv_style_set_my_prop(lv_style_t * style, lv_color_t value) {
lv_style_value_t v = {.color = value}; lv_style_set_prop(style, MY_PROP, v); }
...
MY_PROP = lv_style_register_prop();
...
lv_style_set_my_prop(&style1, lv_palette_main(LV_PALETTE_RED));lv_style_prop_t lv_style_register_prop(uint8_t flag)| Name | Type |
|---|---|
flag | uint8_t |
Returns: lv_style_prop_t — a new property ID, or LV_STYLE_PROP_INV if there are no more available.
lv_style_remove_prop
Remove a property from a style
bool lv_style_remove_prop(lv_style_t *style, lv_style_prop_t prop)| Name | Type | Description |
|---|---|---|
style | lv_style_t * | pointer to a style |
prop | lv_style_prop_t | a style property ORed with a state. |
Returns: bool — true: the property was found and removed; false: the property wasn't found
lv_style_transition_dsc_init
Initialize a transition descriptor. Example:
const static lv_style_prop_t trans_props[] = { LV_STYLE_BG_OPA, LV_STYLE_BG_COLOR, 0 };
static lv_style_transition_dsc_t trans1;
lv_style_transition_dsc_init(&trans1, trans_props, NULL, 300, 0, NULL);void lv_style_transition_dsc_init(lv_style_transition_dsc_t *tr, const lv_style_prop_t props[], lv_anim_path_cb_t path_cb, uint32_t time, uint32_t delay, void *user_data)| Name | Type | Description |
|---|---|---|
tr | lv_style_transition_dsc_t * | pointer to a transition descriptor to initialize |
props | const lv_style_prop_t | an array with the properties to transition. The last element must be zero. |
path_cb | lv_anim_path_cb_t | an animation path (ease) callback. If NULL liner path will be used. |
time | uint32_t | duration of the transition in [ms] |
delay | uint32_t | delay before the transition in [ms] |
user_data | void * | any custom data that will be saved in the transition animation and will be available when path_cb is called May be NULL. |
lv_style_is_empty
Checks if a style is empty (has no properties)
bool lv_style_is_empty(const lv_style_t *style)| Name | Type | Description |
|---|---|---|
style | const lv_style_t * | pointer to a style |
Returns: bool — true if the style is empty
lv_style_prop_lookup_flags
Get the flags of a built-in or custom property.
uint8_t lv_style_prop_lookup_flags(lv_style_prop_t prop)| Name | Type | Description |
|---|---|---|
prop | lv_style_prop_t | a style property |
Returns: uint8_t — the flags of the property
lv_style_prop_has_flag
Check if the style property has a specified behavioral flag.
static bool lv_style_prop_has_flag(lv_style_prop_t prop, uint8_t flag)| Name | Type | Description |
|---|---|---|
prop | lv_style_prop_t | a style property like LV_STYLE_BG_COLOR |
flag | uint8_t | a flag like LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE, or several flags OR-ed together |
Returns: bool — true if at least one of the given flags is set for this property
Enums
lv_blend_mode_t
Possible options for blending opaque drawings
| Name | Description |
|---|---|
LV_BLEND_MODE_NORMAL | Simply mix according to the opacity value |
LV_BLEND_MODE_ADDITIVE | Add the respective color channels |
LV_BLEND_MODE_SUBTRACTIVE | Subtract the foreground from the background |
LV_BLEND_MODE_MULTIPLY | Multiply the foreground and background |
LV_BLEND_MODE_DIFFERENCE | Absolute difference between foreground and background |
Used by 5 functions
lv_obj_set_style_blend_mode— paramvaluelv_style_set_blend_mode— paramvaluelv_image_set_blend_mode— paramblend_modelv_nemagfx_blending_mode— paramlv_blend_modelv_vg_lite_blend_mode— paramblend_mode
lv_text_decor_t
Some options to apply decorations on texts. 'OR'ed values can be used.
| Name | Value |
|---|---|
LV_TEXT_DECOR_NONE | 0x00 |
LV_TEXT_DECOR_UNDERLINE | 0x01 |
LV_TEXT_DECOR_STRIKETHROUGH | 0x02 |
Used by 2 functions
lv_obj_set_style_text_decor— paramvaluelv_style_set_text_decor— paramvalue
lv_border_side_t
Selects on which sides border should be drawn 'OR'ed values can be used.
| Name | Value | Description |
|---|---|---|
LV_BORDER_SIDE_NONE | 0x00 | |
LV_BORDER_SIDE_BOTTOM | 0x01 | |
LV_BORDER_SIDE_TOP | 0x02 | |
LV_BORDER_SIDE_LEFT | 0x04 | |
LV_BORDER_SIDE_RIGHT | 0x08 | |
LV_BORDER_SIDE_FULL | 0x0F | |
LV_BORDER_SIDE_INTERNAL | 0x10 | FOR matrix-like objects (e.g. Button matrix) |
Used by 2 functions
lv_obj_set_style_border_side— paramvaluelv_style_set_border_side— paramvalue
lv_blur_quality_t
| Name | Value | Description |
|---|---|---|
LV_BLUR_QUALITY_AUTO | 0 | Set the quality automatically |
LV_BLUR_QUALITY_SPEED | Prefer speed over precision | |
LV_BLUR_QUALITY_PRECISION | Prefer precision over speed |
Used by 4 functions
lv_obj_set_style_blur_quality— paramvaluelv_obj_set_style_drop_shadow_quality— paramvaluelv_style_set_blur_quality— paramvaluelv_style_set_drop_shadow_quality— paramvalue
_lv_style_id_t
Enumeration of all built in style properties
Props are split into groups of 16. When adding a new prop to a group, ensure it does not overflow into the next one.
| Name | Value |
|---|---|
LV_STYLE_PROP_INV | 0 |
LV_STYLE_WIDTH | 1 |
LV_STYLE_HEIGHT | |
LV_STYLE_LENGTH | |
LV_STYLE_TRANSFORM_WIDTH | |
LV_STYLE_TRANSFORM_HEIGHT | |
LV_STYLE_MIN_WIDTH | 8 |
LV_STYLE_MAX_WIDTH | |
LV_STYLE_MIN_HEIGHT | |
LV_STYLE_MAX_HEIGHT | |
LV_STYLE_TRANSLATE_X | |
LV_STYLE_TRANSLATE_Y | |
LV_STYLE_RADIAL_OFFSET | |
LV_STYLE_X | 16 |
LV_STYLE_Y | |
LV_STYLE_ALIGN | |
LV_STYLE_PAD_TOP | 24 |
LV_STYLE_PAD_BOTTOM | |
LV_STYLE_PAD_LEFT | |
LV_STYLE_PAD_RIGHT | |
LV_STYLE_PAD_RADIAL | |
LV_STYLE_PAD_ROW | |
LV_STYLE_PAD_COLUMN | |
LV_STYLE_MARGIN_TOP | 32 |
LV_STYLE_MARGIN_BOTTOM | |
LV_STYLE_MARGIN_LEFT | |
LV_STYLE_MARGIN_RIGHT | |
LV_STYLE_BG_GRAD | 40 |
LV_STYLE_BG_GRAD_DIR | |
LV_STYLE_BG_MAIN_OPA | |
LV_STYLE_BG_GRAD_OPA | |
LV_STYLE_BG_GRAD_COLOR | |
LV_STYLE_BG_MAIN_STOP | |
LV_STYLE_BG_GRAD_STOP | |
LV_STYLE_BG_IMAGE_SRC | 48 |
LV_STYLE_BG_IMAGE_OPA | |
LV_STYLE_BG_IMAGE_RECOLOR_OPA | |
LV_STYLE_BG_IMAGE_TILED | |
LV_STYLE_BG_IMAGE_RECOLOR | |
LV_STYLE_BORDER_WIDTH | 56 |
LV_STYLE_BORDER_COLOR | |
LV_STYLE_BORDER_OPA | |
LV_STYLE_BORDER_POST | |
LV_STYLE_BORDER_SIDE | |
LV_STYLE_OUTLINE_WIDTH | 64 |
LV_STYLE_OUTLINE_COLOR | |
LV_STYLE_OUTLINE_OPA | |
LV_STYLE_OUTLINE_PAD | |
LV_STYLE_BG_OPA | 72 |
LV_STYLE_BG_COLOR | |
LV_STYLE_SHADOW_WIDTH | |
LV_STYLE_LINE_WIDTH | |
LV_STYLE_ARC_WIDTH | |
LV_STYLE_TEXT_FONT | |
LV_STYLE_IMAGE_RECOLOR_OPA | |
LV_STYLE_IMAGE_OPA | 80 |
LV_STYLE_SHADOW_OPA | |
LV_STYLE_LINE_OPA | |
LV_STYLE_ARC_OPA | |
LV_STYLE_TEXT_OPA | |
LV_STYLE_SHADOW_COLOR | 88 |
LV_STYLE_IMAGE_RECOLOR | |
LV_STYLE_LINE_COLOR | |
LV_STYLE_ARC_COLOR | |
LV_STYLE_TEXT_COLOR | |
LV_STYLE_ARC_IMAGE_SRC | 96 |
LV_STYLE_SHADOW_OFFSET_X | |
LV_STYLE_SHADOW_OFFSET_Y | |
LV_STYLE_SHADOW_SPREAD | |
LV_STYLE_LINE_DASH_WIDTH | |
LV_STYLE_TEXT_ALIGN | |
LV_STYLE_TEXT_LETTER_SPACE | |
LV_STYLE_TEXT_LINE_SPACE | |
LV_STYLE_LINE_DASH_GAP | 104 |
LV_STYLE_LINE_ROUNDED | |
LV_STYLE_IMAGE_COLORKEY | |
LV_STYLE_TEXT_OUTLINE_STROKE_WIDTH | |
LV_STYLE_TEXT_OUTLINE_STROKE_OPA | |
LV_STYLE_TEXT_OUTLINE_STROKE_COLOR | |
LV_STYLE_TEXT_DECOR | |
LV_STYLE_ARC_ROUNDED | |
LV_STYLE_OPA | 112 |
LV_STYLE_OPA_LAYERED | |
LV_STYLE_COLOR_FILTER_DSC | |
LV_STYLE_COLOR_FILTER_OPA | |
LV_STYLE_ANIM | |
LV_STYLE_ANIM_DURATION | |
LV_STYLE_TRANSITION | |
LV_STYLE_RADIUS | 120 |
LV_STYLE_BITMAP_MASK_SRC | |
LV_STYLE_BLEND_MODE | |
LV_STYLE_ROTARY_SENSITIVITY | |
LV_STYLE_TRANSLATE_RADIAL | |
LV_STYLE_CLIP_CORNER | 128 |
LV_STYLE_BASE_DIR | |
LV_STYLE_RECOLOR | |
LV_STYLE_RECOLOR_OPA | |
LV_STYLE_LAYOUT | |
LV_STYLE_BLUR_RADIUS | 136 |
LV_STYLE_BLUR_BACKDROP | |
LV_STYLE_BLUR_QUALITY | |
LV_STYLE_DROP_SHADOW_RADIUS | 144 |
LV_STYLE_DROP_SHADOW_OFFSET_X | |
LV_STYLE_DROP_SHADOW_OFFSET_Y | |
LV_STYLE_DROP_SHADOW_COLOR | |
LV_STYLE_DROP_SHADOW_OPA | |
LV_STYLE_DROP_SHADOW_QUALITY | |
LV_STYLE_TRANSFORM_SCALE_X | 152 |
LV_STYLE_TRANSFORM_SCALE_Y | |
LV_STYLE_TRANSFORM_PIVOT_X | |
LV_STYLE_TRANSFORM_PIVOT_Y | |
LV_STYLE_TRANSFORM_ROTATION | |
LV_STYLE_TRANSFORM_SKEW_X | |
LV_STYLE_TRANSFORM_SKEW_Y | |
LV_STYLE_FLEX_FLOW | 160 |
LV_STYLE_FLEX_MAIN_PLACE | |
LV_STYLE_FLEX_CROSS_PLACE | |
LV_STYLE_FLEX_TRACK_PLACE | |
LV_STYLE_FLEX_GROW | |
LV_STYLE_GRID_COLUMN_DSC_ARRAY | |
LV_STYLE_GRID_ROW_DSC_ARRAY | |
LV_STYLE_GRID_COLUMN_ALIGN | 168 |
LV_STYLE_GRID_ROW_ALIGN | |
LV_STYLE_GRID_CELL_COLUMN_POS | |
LV_STYLE_GRID_CELL_COLUMN_SPAN | |
LV_STYLE_GRID_CELL_X_ALIGN | |
LV_STYLE_GRID_CELL_ROW_POS | |
LV_STYLE_GRID_CELL_ROW_SPAN | |
LV_STYLE_GRID_CELL_Y_ALIGN | |
LV_STYLE_TEXT_LEADING_TRIM | 176 |
LV_STYLE_LAST_BUILT_IN_PROP | |
LV_STYLE_NUM_BUILT_IN_PROPS | LV_STYLE_LAST_BUILT_IN_PROP + 1 |
LV_STYLE_PROP_ANY | 0xFF |
LV_STYLE_PROP_CONST | 0xFF |
lv_style_res_t
| Name |
|---|
LV_STYLE_RES_NOT_FOUND |
LV_STYLE_RES_FOUND |
Structs
lv_image_colorkey_t
A image colorkey definition. The transparency within the color range of [low, high] will be set to LV_OPA_TRANSP If the "enable" flag is set to true.
| Member | Type | Description |
|---|---|---|
low | lv_color_t | |
high | lv_color_t |
Used by 3 functions
lv_obj_set_style_image_colorkey— paramvaluelv_style_set_image_colorkey— paramvaluelv_vg_lite_set_color_key— paramcolorkey
lv_style_value_t
A common type to handle all the property types in the same way.
| Member | Type | Description |
|---|---|---|
num | int32_t | Number integer number (opacity, enums, booleans or "normal" numbers) |
ptr | const void * | Constant pointers (font, cone text, etc) |
color | lv_color_t | Colors |
Used by 7 functions
lv_obj_set_local_style_prop— paramvaluelv_obj_get_local_style_prop— paramvaluelv_obj_style_apply_color_filter— paramvlv_style_set_prop— paramvaluelv_style_get_prop— paramvaluelv_obj_style_apply_color_filter_internal— paramvlv_style_get_prop_internal— paramvalue
lv_style_transition_dsc_t
Descriptor for style transitions
| Member | Type | Description |
|---|---|---|
props | const lv_style_prop_t * | An array with the properties to animate. |
user_data | void * | A custom user data that will be passed to the animation's user_data |
path_xcb | lv_anim_path_cb_t | A path for the animation. |
time | uint32_t | Duration of the transition in [ms] |
delay | uint32_t | Delay before the transition in [ms] |
Used by 3 functions
lv_obj_set_style_transition— paramvaluelv_style_transition_dsc_init— paramtrlv_style_set_transition— paramvalue
lv_style_const_prop_t
Descriptor of a constant style property.
| Member | Type | Description |
|---|---|---|
prop | lv_style_prop_t | |
value | lv_style_value_t |
lv_style_t
Descriptor of a style (a collection of properties and values).
| Member | Type | Description |
|---|---|---|
sentinel | uint32_t | |
values_and_props | void * | |
has_group | uint32_t | |
prop_cnt | uint8_t | 255 means it's a constant style |
Used by 166 functions
lv_obj_add_style— paramstylelv_obj_replace_style— paramold_stylelv_obj_replace_style— paramnew_stylelv_obj_remove_style— paramstylelv_obj_report_style_change— paramstylelv_obj_set_style_enabled— paramstylelv_obj_get_style_enabled— paramstylelv_obj_style_set_disabled— paramstylelv_obj_style_get_disabled— paramstylelv_obj_bind_style— paramstylelv_style_init— paramstylelv_style_reset— paramstylelv_style_copy— paramdstlv_style_copy— paramsrclv_style_merge— paramdstlv_style_merge— paramsrclv_style_is_const— paramstylelv_style_remove_prop— paramstylelv_style_set_prop— paramstylelv_style_get_prop— paramstylelv_style_is_empty— paramstylelv_style_set_size— paramstylelv_style_set_pad_all— paramstylelv_style_set_pad_hor— paramstylelv_style_set_pad_ver— paramstylelv_style_set_pad_gap— paramstylelv_style_set_margin_hor— paramstylelv_style_set_margin_ver— paramstylelv_style_set_margin_all— paramstylelv_style_set_transform_scale— paramstylelv_style_set_width— paramstylelv_style_set_min_width— paramstylelv_style_set_max_width— paramstylelv_style_set_height— paramstylelv_style_set_min_height— paramstylelv_style_set_max_height— paramstylelv_style_set_length— paramstylelv_style_set_x— paramstylelv_style_set_y— paramstylelv_style_set_align— paramstylelv_style_set_transform_width— paramstylelv_style_set_transform_height— paramstylelv_style_set_translate_x— paramstylelv_style_set_translate_y— paramstylelv_style_set_translate_radial— paramstylelv_style_set_transform_scale_x— paramstylelv_style_set_transform_scale_y— paramstylelv_style_set_transform_rotation— paramstylelv_style_set_transform_pivot_x— paramstylelv_style_set_transform_pivot_y— paramstylelv_style_set_transform_skew_x— paramstylelv_style_set_transform_skew_y— paramstylelv_style_set_pad_top— paramstylelv_style_set_pad_bottom— paramstylelv_style_set_pad_left— paramstylelv_style_set_pad_right— paramstylelv_style_set_pad_row— paramstylelv_style_set_pad_column— paramstylelv_style_set_pad_radial— paramstylelv_style_set_margin_top— paramstylelv_style_set_margin_bottom— paramstylelv_style_set_margin_left— paramstylelv_style_set_margin_right— paramstylelv_style_set_bg_color— paramstylelv_style_set_bg_opa— paramstylelv_style_set_bg_grad_color— paramstylelv_style_set_bg_grad_dir— paramstylelv_style_set_bg_main_stop— paramstylelv_style_set_bg_grad_stop— paramstylelv_style_set_bg_main_opa— paramstylelv_style_set_bg_grad_opa— paramstylelv_style_set_bg_grad— paramstylelv_style_set_bg_image_src— paramstylelv_style_set_bg_image_opa— paramstylelv_style_set_bg_image_recolor— paramstylelv_style_set_bg_image_recolor_opa— paramstylelv_style_set_bg_image_tiled— paramstylelv_style_set_border_color— paramstylelv_style_set_border_opa— paramstylelv_style_set_border_width— paramstylelv_style_set_border_side— paramstylelv_style_set_border_post— paramstylelv_style_set_outline_width— paramstylelv_style_set_outline_color— paramstylelv_style_set_outline_opa— paramstylelv_style_set_outline_pad— paramstylelv_style_set_shadow_width— paramstylelv_style_set_shadow_offset_x— paramstylelv_style_set_shadow_offset_y— paramstylelv_style_set_shadow_spread— paramstylelv_style_set_shadow_color— paramstylelv_style_set_shadow_opa— paramstylelv_style_set_image_opa— paramstylelv_style_set_image_recolor— paramstylelv_style_set_image_recolor_opa— paramstylelv_style_set_image_colorkey— paramstylelv_style_set_line_width— paramstylelv_style_set_line_dash_width— paramstylelv_style_set_line_dash_gap— paramstylelv_style_set_line_rounded— paramstylelv_style_set_line_color— paramstylelv_style_set_line_opa— paramstylelv_style_set_arc_width— paramstylelv_style_set_arc_rounded— paramstylelv_style_set_arc_color— paramstylelv_style_set_arc_opa— paramstylelv_style_set_arc_image_src— paramstylelv_style_set_text_color— paramstylelv_style_set_text_opa— paramstylelv_style_set_text_font— paramstylelv_style_set_text_letter_space— paramstylelv_style_set_text_line_space— paramstylelv_style_set_text_decor— paramstylelv_style_set_text_align— paramstylelv_style_set_text_outline_stroke_color— paramstylelv_style_set_text_outline_stroke_width— paramstylelv_style_set_text_outline_stroke_opa— paramstylelv_style_set_text_leading_trim— paramstylelv_style_set_blur_radius— paramstylelv_style_set_blur_backdrop— paramstylelv_style_set_blur_quality— paramstylelv_style_set_drop_shadow_radius— paramstylelv_style_set_drop_shadow_offset_x— paramstylelv_style_set_drop_shadow_offset_y— paramstylelv_style_set_drop_shadow_color— paramstylelv_style_set_drop_shadow_opa— paramstylelv_style_set_drop_shadow_quality— paramstylelv_style_set_radius— paramstylelv_style_set_radial_offset— paramstylelv_style_set_clip_corner— paramstylelv_style_set_opa— paramstylelv_style_set_opa_layered— paramstylelv_style_set_color_filter_dsc— paramstylelv_style_set_color_filter_opa— paramstylelv_style_set_recolor— paramstylelv_style_set_recolor_opa— paramstylelv_style_set_anim— paramstylelv_style_set_anim_duration— paramstylelv_style_set_transition— paramstylelv_style_set_blend_mode— paramstylelv_style_set_layout— paramstylelv_style_set_base_dir— paramstylelv_style_set_bitmap_mask_src— paramstylelv_style_set_rotary_sensitivity— paramstylelv_style_set_flex_flow— paramstylelv_style_set_flex_main_place— paramstylelv_style_set_flex_cross_place— paramstylelv_style_set_flex_track_place— paramstylelv_style_set_flex_grow— paramstylelv_style_set_grid_column_dsc_array— paramstylelv_style_set_grid_column_align— paramstylelv_style_set_grid_row_dsc_array— paramstylelv_style_set_grid_row_align— paramstylelv_style_set_grid_cell_column_pos— paramstylelv_style_set_grid_cell_x_align— paramstylelv_style_set_grid_cell_column_span— paramstylelv_style_set_grid_cell_row_pos— paramstylelv_style_set_grid_cell_y_align— paramstylelv_style_set_grid_cell_row_span— paramstylelv_scale_section_set_style— paramsection_part_stylelv_scale_set_section_style_main— paramstylelv_scale_set_section_style_indicator— paramstylelv_scale_set_section_style_items— paramstylelv_spangroup_set_span_style— paramstylelv_style_is_const_internal— paramstylelv_style_get_prop_internal— paramstyle
Macros
LV_STYLE_SENTINEL_VALUE
#define LV_STYLE_SENTINEL_VALUE 0xAABBCCDDLV_STYLE_PROP_FLAG_NONE
#define LV_STYLE_PROP_FLAG_NONE (0)No special behavior
LV_STYLE_PROP_FLAG_INHERITABLE
#define LV_STYLE_PROP_FLAG_INHERITABLE (1 << 0)Inherited
LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE
#define LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE (1 << 1)Requires ext. draw size update when changed
LV_STYLE_PROP_FLAG_LAYOUT_UPDATE
#define LV_STYLE_PROP_FLAG_LAYOUT_UPDATE (1 << 2)Requires layout update when changed
LV_STYLE_PROP_FLAG_PARENT_LAYOUT_UPDATE
#define LV_STYLE_PROP_FLAG_PARENT_LAYOUT_UPDATE (1 << 3)Requires layout update on parent when changed
LV_STYLE_PROP_FLAG_LAYER_UPDATE
#define LV_STYLE_PROP_FLAG_LAYER_UPDATE (1 << 4)Affects layer handling
LV_STYLE_PROP_FLAG_TRANSFORM
#define LV_STYLE_PROP_FLAG_TRANSFORM (1 << 5)Affects the object's transformation
LV_STYLE_PROP_FLAG_ALL
#define LV_STYLE_PROP_FLAG_ALL (0x3F)Indicating all flags
LV_SCALE_NONE
#define LV_SCALE_NONE 256Value for not zooming the image
LV_STYLE_CONST_INIT
#define LV_STYLE_CONST_INIT(var_name, prop_array) \
const lv_style_t var_name = { \
.sentinel = LV_STYLE_SENTINEL_VALUE, \
.values_and_props = (void*)prop_array, \
.has_group = 0xFFFFFFFF, \
.prop_cnt = 255 \
}LV_STYLE_CONST_PROPS_END
#define LV_STYLE_CONST_PROPS_END { .prop = LV_STYLE_PROP_INV, .value = { .num = 0 } }LV_GRAD_LEFT
#define LV_GRAD_LEFT LV_PCT(0)LV_GRAD_RIGHT
#define LV_GRAD_RIGHT LV_PCT(100)LV_GRAD_TOP
#define LV_GRAD_TOP LV_PCT(0)LV_GRAD_BOTTOM
#define LV_GRAD_BOTTOM LV_PCT(100)LV_GRAD_CENTER
#define LV_GRAD_CENTER LV_PCT(50)LV_STYLE_SENTINEL_OK
#define LV_STYLE_SENTINEL_OK(style_p) \
((style_p)->sentinel == LV_STYLE_SENTINEL_VALUE)Evaluate to true if style_p's sentinel marker is intact, i.e. the style was initialized by lv_style_init() and is not corrupted. Always true when LV_USE_ASSERT_STYLE is disabled, because the sentinel field is absent then.
Intended for use inside LV_CHECK_ARG, combined with a NULL check so the dereference is short-circuited for NULL pointers:
LV_CHECK_ARG(style != NULL && LV_STYLE_SENTINEL_OK(style), return);LV_ASSERT_STYLE
#define LV_ASSERT_STYLE(style_p) \
do { \
LV_DEPRECATED_MACRO_WARN("LV_ASSERT_STYLE is deprecated. Use LV_CHECK_ARG instead."); \
LV_ASSERT_INTERNAL(style_p != NULL, ""); \
LV_ASSERT_INTERNAL(style_p->sentinel == LV_STYLE_SENTINEL_VALUE, "Style is not initialized or corrupted"); \
} while(0)> Deprecated: Use LV_CHECK_ARG(style != NULL && LV_STYLE_SENTINEL_OK(style), return ...) instead. LV_ASSERT_STYLE aborts on failure; LV_CHECK_ARG logs a warning and executes the supplied action, which is safer in production.
Variables
lv_style_const_prop_id_inv
const lv_style_prop_t lv_style_const_prop_id_invDependencies
Last updated on