lv_obj_property.h¶
Defines
-
LV_PROPERTY_TYPE_INVALID¶
-
LV_PROPERTY_TYPE_INT¶
-
LV_PROPERTY_TYPE_PRECISE¶
-
LV_PROPERTY_TYPE_COLOR¶
-
LV_PROPERTY_TYPE_POINT¶
-
LV_PROPERTY_TYPE_POINTER¶
-
LV_PROPERTY_TYPE_IMGSRC¶
-
LV_PROPERTY_TYPE_TEXT¶
-
LV_PROPERTY_TYPE_OBJ¶
-
LV_PROPERTY_TYPE_DISPLAY¶
-
LV_PROPERTY_TYPE_FONT¶
-
LV_PROPERTY_TYPE_BOOL¶
-
LV_PROPERTY_TYPE_SHIFT¶
-
LV_PROPERTY_TYPE2_SHIFT¶
-
LV_PROPERTY_ID(clz, name, type, index)¶
-
LV_PROPERTY_ID2(clz, name, type, type2, index)¶
-
LV_PROPERTY_ID_TYPE(id)¶
-
LV_PROPERTY_ID_TYPE2(id)¶
-
LV_PROPERTY_ID_INDEX(id)¶
-
LV_OBJ_SET_PROPERTY_ARRAY(obj, array)¶
Enums
Group of predefined widget ID start value.
Values:
-
enumerator LV_PROPERTY_ID_INVALID¶
-
enumerator LV_PROPERTY_STYLE_START¶
-
enumerator LV_PROPERTY_ID_START¶
-
enumerator LV_PROPERTY_OBJ_START¶
-
enumerator LV_PROPERTY_IMAGE_START¶
-
enumerator LV_PROPERTY_LABEL_START¶
-
enumerator LV_PROPERTY_KEYBOARD_START¶
-
enumerator LV_PROPERTY_TEXTAREA_START¶
-
enumerator LV_PROPERTY_ROLLER_START¶
-
enumerator LV_PROPERTY_DROPDOWN_START¶
-
enumerator LV_PROPERTY_SLIDER_START¶
-
enumerator LV_PROPERTY_ANIMIMAGE_START¶
-
enumerator LV_PROPERTY_ID_BUILTIN_LAST¶
-
enumerator LV_PROPERTY_ID_ANY¶
-
enumerator LV_PROPERTY_ID_INVALID¶
Functions
-
lv_result_t lv_obj_set_property(lv_obj_t *obj, const lv_property_t *value)¶
Set Widget property.
- Parameters:
obj – pointer to Widget
value – property value to set
- Returns:
return LV_RESULT_OK if call succeeded
-
lv_result_t lv_obj_set_properties(lv_obj_t *obj, const lv_property_t *value, uint32_t count)¶
Set multiple Widget properties. Helper
LV_OBJ_SET_PROPERTY_ARRAY
can be used for constant property array.- Parameters:
obj – pointer to Widget
value – property value array to set
count – number of array elements
- Returns:
return LV_RESULT_OK if call succeeded
-
lv_property_t lv_obj_get_property(lv_obj_t *obj, lv_prop_id_t id)¶
Read property value from Widget. If id is a style property. Style selector is 0 by default.
- Parameters:
obj – pointer to Widget
id – ID of property to read
- Returns:
return property value read. The returned property ID is set to
LV_PROPERTY_ID_INVALID
if read failed.
-
lv_property_t lv_obj_get_style_property(lv_obj_t *obj, lv_prop_id_t id, uint32_t selector)¶
Read style property value from Widget
- Parameters:
obj – pointer to Widget
id – ID of style property
selector – selector for style property
- Returns:
return property value read. The returned property ID is set to
LV_PROPERTY_ID_INVALID
if read failed.
-
lv_prop_id_t lv_obj_property_get_id(const lv_obj_t *obj, const char *name)¶
Get property ID by recursively searching for name in Widget's class hierarchy, and if still not found, then search style properties. Requires to enabling
LV_USE_OBJ_PROPERTY_NAME
.- Parameters:
obj – pointer to Widget whose class and base-class hierarchy are to be searched.
name – property name
- Returns:
property ID found or
LV_PROPERTY_ID_INVALID
if not found.
-
lv_prop_id_t lv_obj_class_property_get_id(const lv_obj_class_t *clz, const char *name)¶
Get property ID by doing a non-recursive search for name directly in Widget class properties. Requires enabling
LV_USE_OBJ_PROPERTY_NAME
.- Parameters:
clz – pointer to Widget class that has specified property.
name – property name
- Returns:
property ID found or
LV_PROPERTY_ID_INVALID
if not found.
-
lv_prop_id_t lv_style_property_get_id(const char *name)¶
Get style property ID by name. Requires enabling
LV_USE_OBJ_PROPERTY_NAME
.- Parameters:
name – property name
- Returns:
property ID found or
LV_PROPERTY_ID_INVALID
if not found.
-
struct _lv_property_name_t¶
-
struct lv_property_t¶
Public Members
-
lv_prop_id_t id¶
-
int32_t num¶
Signed integer number (enums or "normal" numbers)
-
uint32_t num_u¶
Unsigned integer number (opacity, Booleans)
-
bool enable¶
Booleans
-
const void *ptr¶
Constant pointers (font, cone text, etc.)
-
lv_color_t color¶
Colors
-
lv_value_precise_t precise¶
float or int for precise value
-
lv_point_t point¶
Point, contains two int32_t
-
lv_style_value_t style¶
Note that place struct member
style
at first place is intended.style
shares same memory withnum
,ptr
,color
. So we set the style value directly without usingprop.style.num
.E.g.
static const lv_property_t obj_pos_x = { .id = LV_PROPERTY_STYLE_X, .num = 123, .selector = LV_STATE_PRESSED, }
instead of: static const lv_property_t obj_pos_x = { .id = LV_PROPERTY_STYLE_X, .style.num = 123, // note this line. .selector = LV_STATE_PRESSED, } Make sure it's the first element in struct.
-
uint32_t selector¶
Style selector, lv_part_t | lv_state_t
-
union lv_property_t arg1¶
-
union lv_property_t arg2¶
- union lv_property_t
-
lv_prop_id_t id¶
-
struct lv_property_ops_t¶