minor renames for Micropython binding
This commit is contained in:
@@ -60,13 +60,13 @@ typedef struct {
|
||||
lv_color_t _color;
|
||||
lv_style_int_t _int;
|
||||
lv_opa_t _opa;
|
||||
lv_style_fptr_dptr_t _ptr;
|
||||
_lv_style_fptr_dptr_t _ptr;
|
||||
} start_value;
|
||||
union {
|
||||
lv_color_t _color;
|
||||
lv_style_int_t _int;
|
||||
lv_opa_t _opa;
|
||||
lv_style_fptr_dptr_t _ptr;
|
||||
_lv_style_fptr_dptr_t _ptr;
|
||||
} end_value;
|
||||
} lv_style_trans_t;
|
||||
|
||||
@@ -1235,7 +1235,7 @@ void _lv_obj_set_style_local_opa(lv_obj_t * obj, uint8_t part, lv_style_property
|
||||
* For example: `lv_obj_style_get_border_opa()`
|
||||
* @note for performance reasons it's not checked if the property really has pointer type
|
||||
*/
|
||||
void _lv_obj_set_style_local_ptr(lv_obj_t * obj, uint8_t part, lv_style_property_t prop, lv_style_fptr_dptr_t value)
|
||||
void _lv_obj_set_style_local_ptr(lv_obj_t * obj, uint8_t part, lv_style_property_t prop, _lv_style_fptr_dptr_t value)
|
||||
{
|
||||
lv_style_list_t * style_dsc = lv_obj_get_style_list(obj, part);
|
||||
lv_style_list_set_local_ptr(style_dsc, prop, value);
|
||||
@@ -2513,14 +2513,14 @@ lv_opa_t _lv_obj_get_style_opa(const lv_obj_t * obj, uint8_t part, lv_style_prop
|
||||
* For example: `lv_obj_style_get_border_opa()`
|
||||
* @note for performance reasons it's not checked if the property really has pointer type
|
||||
*/
|
||||
lv_style_fptr_dptr_t _lv_obj_get_style_ptr(const lv_obj_t * obj, uint8_t part, lv_style_property_t prop)
|
||||
_lv_style_fptr_dptr_t _lv_obj_get_style_ptr(const lv_obj_t * obj, uint8_t part, lv_style_property_t prop)
|
||||
{
|
||||
lv_style_property_t prop_ori = prop;
|
||||
|
||||
lv_style_attr_t attr;
|
||||
attr.full = prop_ori >> 8;
|
||||
|
||||
lv_style_fptr_dptr_t value_act;
|
||||
_lv_style_fptr_dptr_t value_act;
|
||||
lv_res_t res = LV_RES_INV;
|
||||
const lv_obj_t * parent = obj;
|
||||
while(parent) {
|
||||
@@ -2546,7 +2546,7 @@ lv_style_fptr_dptr_t _lv_obj_get_style_ptr(const lv_obj_t * obj, uint8_t part, l
|
||||
|
||||
/*Handle unset values*/
|
||||
prop = prop & (~LV_STYLE_STATE_MASK);
|
||||
lv_style_fptr_dptr_t fd;
|
||||
_lv_style_fptr_dptr_t fd;
|
||||
fd.dptr = NULL;
|
||||
fd.fptr = NULL;
|
||||
switch(prop) {
|
||||
@@ -2556,7 +2556,7 @@ lv_style_fptr_dptr_t _lv_obj_get_style_ptr(const lv_obj_t * obj, uint8_t part, l
|
||||
return fd;
|
||||
#if LV_USE_ANIMATION
|
||||
case LV_STYLE_TRANSITION_PATH:
|
||||
fd.fptr = (lv_style_prop_cb_t)lv_anim_path_linear;
|
||||
fd.fptr = (_lv_style_prop_xcb_t)lv_anim_path_linear;
|
||||
return fd;
|
||||
#endif
|
||||
}
|
||||
@@ -3770,12 +3770,12 @@ static lv_style_trans_t * trans_create(lv_obj_t * obj, lv_style_property_t prop,
|
||||
else { /*Ptr*/
|
||||
obj->state = prev_state;
|
||||
style_list->skip_trans = 1;
|
||||
lv_style_fptr_dptr_t fd1 = _lv_obj_get_style_ptr(obj, part, prop);
|
||||
_lv_style_fptr_dptr_t fd1 = _lv_obj_get_style_ptr(obj, part, prop);
|
||||
obj->state = new_state;
|
||||
lv_style_fptr_dptr_t fd2 = _lv_obj_get_style_ptr(obj, part, prop);
|
||||
_lv_style_fptr_dptr_t fd2 = _lv_obj_get_style_ptr(obj, part, prop);
|
||||
style_list->skip_trans = 0;
|
||||
|
||||
if(memcmp(&fd1, &fd2, sizeof(lv_style_fptr_dptr_t)) == 0) return NULL;
|
||||
if(memcmp(&fd1, &fd2, sizeof(_lv_style_fptr_dptr_t)) == 0) return NULL;
|
||||
obj->state = prev_state;
|
||||
fd1 = _lv_obj_get_style_ptr(obj, part, prop);
|
||||
obj->state = new_state;
|
||||
@@ -3853,7 +3853,7 @@ static void trans_anim_cb(lv_style_trans_t * tr, lv_anim_value_t v)
|
||||
_lv_style_set_opa(style, tr->prop, x);
|
||||
}
|
||||
else {
|
||||
lv_style_fptr_dptr_t x;
|
||||
_lv_style_fptr_dptr_t x;
|
||||
if(v < 128) x = tr->start_value._ptr;
|
||||
else x = tr->end_value._ptr;
|
||||
_lv_style_set_ptr(style, tr->prop, x);
|
||||
|
||||
@@ -586,7 +586,7 @@ void _lv_obj_set_style_local_opa(lv_obj_t * obj, uint8_t type, lv_style_property
|
||||
* For example: `lv_obj_style_get_border_opa()`
|
||||
* @note for performance reasons it's not checked if the property really has pointer type
|
||||
*/
|
||||
void _lv_obj_set_style_local_ptr(lv_obj_t * obj, uint8_t type, lv_style_property_t prop, lv_style_fptr_dptr_t value);
|
||||
void _lv_obj_set_style_local_ptr(lv_obj_t * obj, uint8_t type, lv_style_property_t prop, _lv_style_fptr_dptr_t value);
|
||||
|
||||
/**
|
||||
* Set a local style property of a part of an object in a given state.
|
||||
@@ -601,9 +601,9 @@ void _lv_obj_set_style_local_ptr(lv_obj_t * obj, uint8_t type, lv_style_property
|
||||
* @note for performance reasons it's not checked if the property really has pointer type
|
||||
*/
|
||||
static inline void _lv_obj_set_style_local_func_ptr(lv_obj_t * obj, uint8_t type, lv_style_property_t prop,
|
||||
lv_style_prop_cb_t value)
|
||||
_lv_style_prop_xcb_t value)
|
||||
{
|
||||
lv_style_fptr_dptr_t fd;
|
||||
_lv_style_fptr_dptr_t fd;
|
||||
fd.fptr = value;
|
||||
fd.dptr = NULL;
|
||||
_lv_obj_set_style_local_ptr(obj, type, prop, fd);
|
||||
@@ -623,7 +623,7 @@ static inline void _lv_obj_set_style_local_func_ptr(lv_obj_t * obj, uint8_t type
|
||||
static inline void _lv_obj_set_style_local_data_ptr(lv_obj_t * obj, uint8_t type, lv_style_property_t prop,
|
||||
const void * value)
|
||||
{
|
||||
lv_style_fptr_dptr_t fd;
|
||||
_lv_style_fptr_dptr_t fd;
|
||||
fd.fptr = NULL;
|
||||
fd.dptr = value;
|
||||
_lv_obj_set_style_local_ptr(obj, type, prop, fd);
|
||||
@@ -1133,7 +1133,7 @@ lv_opa_t _lv_obj_get_style_opa(const lv_obj_t * obj, uint8_t part, lv_style_prop
|
||||
* For example: `lv_obj_style_get_border_opa()`
|
||||
* @note for performance reasons it's not checked if the property really has pointer type
|
||||
*/
|
||||
lv_style_fptr_dptr_t _lv_obj_get_style_ptr(const lv_obj_t * obj, uint8_t part, lv_style_property_t prop);
|
||||
_lv_style_fptr_dptr_t _lv_obj_get_style_ptr(const lv_obj_t * obj, uint8_t part, lv_style_property_t prop);
|
||||
|
||||
/**
|
||||
* Get a style property of a part of an object in the object's current state.
|
||||
@@ -1149,10 +1149,10 @@ lv_style_fptr_dptr_t _lv_obj_get_style_ptr(const lv_obj_t * obj, uint8_t part, l
|
||||
* For example: `lv_obj_style_get_trasition_path()`
|
||||
* @note for performance reasons it's not checked if the property really has pointer type
|
||||
*/
|
||||
static inline lv_style_prop_cb_t _lv_obj_get_style_func_ptr(const lv_obj_t * obj, uint8_t part,
|
||||
static inline _lv_style_prop_xcb_t _lv_obj_get_style_func_ptr(const lv_obj_t * obj, uint8_t part,
|
||||
lv_style_property_t prop)
|
||||
{
|
||||
lv_style_fptr_dptr_t fd;
|
||||
_lv_style_fptr_dptr_t fd;
|
||||
fd = _lv_obj_get_style_ptr(obj, part, prop);
|
||||
return fd.fptr;
|
||||
}
|
||||
@@ -1173,7 +1173,7 @@ static inline lv_style_prop_cb_t _lv_obj_get_style_func_ptr(const lv_obj_t * ob
|
||||
*/
|
||||
static inline const void * _lv_obj_get_style_data_ptr(const lv_obj_t * obj, uint8_t part, lv_style_property_t prop)
|
||||
{
|
||||
lv_style_fptr_dptr_t fd;
|
||||
_lv_style_fptr_dptr_t fd;
|
||||
fd = _lv_obj_get_style_ptr(obj, part, prop);
|
||||
return fd.dptr;
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ _LV_OBJ_STYLE_SET_GET_DECLARE(TRANSITION_PROP_6, transition_prop_6, lv_style_int
|
||||
#if LV_USE_ANIMATION
|
||||
_LV_OBJ_STYLE_SET_GET_DECLARE(TRANSITION_PATH, transition_path, lv_anim_path_cb_t, _func_ptr, func_ptr)
|
||||
#else
|
||||
_LV_OBJ_STYLE_SET_GET_DECLARE(TRANSITION_PATH, transition_path, lv_style_prop_cb_t, _func_ptr,
|
||||
_LV_OBJ_STYLE_SET_GET_DECLARE(TRANSITION_PATH, transition_path, _lv_style_prop_xcb_t, _func_ptr,
|
||||
func_ptr) /*For compatibility*/
|
||||
#endif
|
||||
_LV_OBJ_STYLE_SET_GET_DECLARE(SCALE_WIDTH, scale_width, lv_style_int_t, _int, scalar)
|
||||
|
||||
@@ -113,7 +113,7 @@ bool lv_style_remove_prop(lv_style_t * style, lv_style_property_t prop)
|
||||
if((prop & 0xF) < LV_STYLE_ID_COLOR) prop_size += sizeof(lv_style_int_t);
|
||||
else if((prop & 0xF) < LV_STYLE_ID_OPA) prop_size += sizeof(lv_color_t);
|
||||
else if((prop & 0xF) < LV_STYLE_ID_PTR) prop_size += sizeof(lv_opa_t);
|
||||
else prop_size += sizeof(lv_style_fptr_dptr_t);
|
||||
else prop_size += sizeof(_lv_style_fptr_dptr_t);
|
||||
|
||||
/*Move the props to fill the space of the property to delete*/
|
||||
uint32_t i;
|
||||
@@ -342,7 +342,7 @@ uint16_t lv_style_get_mem_size(const lv_style_t * style)
|
||||
if((style->map[i] & 0xF) < LV_STYLE_ID_COLOR) i += sizeof(lv_style_int_t);
|
||||
else if((style->map[i] & 0xF) < LV_STYLE_ID_OPA) i += sizeof(lv_color_t);
|
||||
else if((style->map[i] & 0xF) < LV_STYLE_ID_PTR) i += sizeof(lv_opa_t);
|
||||
else i += sizeof(lv_style_fptr_dptr_t);
|
||||
else i += sizeof(_lv_style_fptr_dptr_t);
|
||||
|
||||
i += sizeof(lv_style_property_t);
|
||||
}
|
||||
@@ -500,7 +500,7 @@ void _lv_style_set_opa(lv_style_t * style, lv_style_property_t prop, lv_opa_t op
|
||||
* For example: `lv_style_set_border_width()`
|
||||
* @note for performance reasons it's not checked if the property is really has pointer type
|
||||
*/
|
||||
void _lv_style_set_ptr(lv_style_t * style, lv_style_property_t prop, lv_style_fptr_dptr_t p)
|
||||
void _lv_style_set_ptr(lv_style_t * style, lv_style_property_t prop, _lv_style_fptr_dptr_t p)
|
||||
{
|
||||
LV_ASSERT_STYLE(style);
|
||||
|
||||
@@ -514,26 +514,26 @@ void _lv_style_set_ptr(lv_style_t * style, lv_style_property_t prop, lv_style_fp
|
||||
attr_goal.full = (prop >> 8) & 0xFFU;
|
||||
|
||||
if(attr_found.bits.state == attr_goal.bits.state) {
|
||||
memcpy(style->map + id + sizeof(lv_style_property_t), &p, sizeof(lv_style_fptr_dptr_t));
|
||||
memcpy(style->map + id + sizeof(lv_style_property_t), &p, sizeof(_lv_style_fptr_dptr_t));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/*Add new property if not exists yet*/
|
||||
uint8_t new_prop_size = (sizeof(lv_style_property_t) + sizeof(lv_style_fptr_dptr_t));
|
||||
uint8_t new_prop_size = (sizeof(lv_style_property_t) + sizeof(_lv_style_fptr_dptr_t));
|
||||
lv_style_property_t end_mark = _LV_STYLE_CLOSEING_PROP;
|
||||
uint8_t end_mark_size = sizeof(end_mark);
|
||||
|
||||
uint16_t size = lv_style_get_mem_size(style);
|
||||
if(size == 0) size += end_mark_size;
|
||||
|
||||
size += sizeof(lv_style_property_t) + sizeof(lv_style_fptr_dptr_t);
|
||||
size += sizeof(lv_style_property_t) + sizeof(_lv_style_fptr_dptr_t);
|
||||
style->map = lv_mem_realloc(style->map, size);
|
||||
LV_ASSERT_MEM(style->map);
|
||||
if(style == NULL) return;
|
||||
|
||||
memcpy(style->map + size - new_prop_size - end_mark_size, &prop, sizeof(lv_style_property_t));
|
||||
memcpy(style->map + size - sizeof(lv_style_fptr_dptr_t) - end_mark_size, &p, sizeof(lv_style_fptr_dptr_t));
|
||||
memcpy(style->map + size - sizeof(_lv_style_fptr_dptr_t) - end_mark_size, &p, sizeof(_lv_style_fptr_dptr_t));
|
||||
memcpy(style->map + size - end_mark_size, &end_mark, sizeof(end_mark));
|
||||
}
|
||||
|
||||
@@ -655,7 +655,7 @@ int16_t _lv_style_get_color(const lv_style_t * style, lv_style_property_t prop,
|
||||
*/
|
||||
int16_t _lv_style_get_ptr(const lv_style_t * style, lv_style_property_t prop, void * v_res)
|
||||
{
|
||||
lv_style_fptr_dptr_t * res = (lv_style_fptr_dptr_t *)v_res;
|
||||
_lv_style_fptr_dptr_t * res = (_lv_style_fptr_dptr_t *)v_res;
|
||||
if(style == NULL) return -1;
|
||||
if(style->map == NULL) return -1;
|
||||
int32_t id = get_property_index(style, prop);
|
||||
@@ -663,7 +663,7 @@ int16_t _lv_style_get_ptr(const lv_style_t * style, lv_style_property_t prop, vo
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
memcpy(res, &style->map[id + sizeof(lv_style_property_t)], sizeof(lv_style_fptr_dptr_t));
|
||||
memcpy(res, &style->map[id + sizeof(lv_style_property_t)], sizeof(_lv_style_fptr_dptr_t));
|
||||
lv_style_attr_t attr_act;
|
||||
attr_act.full = style->map[id + 1];
|
||||
|
||||
@@ -789,7 +789,7 @@ void lv_style_list_set_local_color(lv_style_list_t * list, lv_style_property_t p
|
||||
* @param value the value to set
|
||||
* @note for performance reasons it's not checked if the property really has pointer type
|
||||
*/
|
||||
void lv_style_list_set_local_ptr(lv_style_list_t * list, lv_style_property_t prop, lv_style_fptr_dptr_t value)
|
||||
void lv_style_list_set_local_ptr(lv_style_list_t * list, lv_style_property_t prop, _lv_style_fptr_dptr_t value)
|
||||
{
|
||||
LV_ASSERT_STYLE_LIST(list);
|
||||
|
||||
@@ -962,7 +962,7 @@ lv_res_t lv_style_list_get_opa(lv_style_list_t * list, lv_style_property_t prop,
|
||||
* LV_RES_INV: there was NO matching property in the list
|
||||
* @note for performance reasons it's not checked if the property really has pointer type
|
||||
*/
|
||||
lv_res_t lv_style_list_get_ptr(lv_style_list_t * list, lv_style_property_t prop, lv_style_fptr_dptr_t * res)
|
||||
lv_res_t lv_style_list_get_ptr(lv_style_list_t * list, lv_style_property_t prop, _lv_style_fptr_dptr_t * res)
|
||||
{
|
||||
LV_ASSERT_STYLE_LIST(list);
|
||||
|
||||
@@ -975,7 +975,7 @@ lv_res_t lv_style_list_get_ptr(lv_style_list_t * list, lv_style_property_t prop,
|
||||
|
||||
int16_t weight = -1;
|
||||
|
||||
lv_style_fptr_dptr_t value_act;
|
||||
_lv_style_fptr_dptr_t value_act;
|
||||
value_act.dptr = NULL;
|
||||
value_act.fptr = NULL;
|
||||
|
||||
@@ -1058,7 +1058,7 @@ static inline int32_t get_property_index(const lv_style_t * style, lv_style_prop
|
||||
if((style->map[i] & 0xF) < LV_STYLE_ID_COLOR) i += sizeof(lv_style_int_t);
|
||||
else if((style->map[i] & 0xF) < LV_STYLE_ID_OPA) i += sizeof(lv_color_t);
|
||||
else if((style->map[i] & 0xF) < LV_STYLE_ID_PTR) i += sizeof(lv_opa_t);
|
||||
else i += sizeof(lv_style_fptr_dptr_t);
|
||||
else i += sizeof(_lv_style_fptr_dptr_t);
|
||||
|
||||
i += sizeof(lv_style_property_t);
|
||||
}
|
||||
|
||||
@@ -216,12 +216,14 @@ typedef struct {
|
||||
|
||||
typedef int16_t lv_style_int_t;
|
||||
|
||||
typedef void(*lv_style_prop_cb_t)(void);
|
||||
/*A helper general function pointer*/
|
||||
typedef void(*_lv_style_prop_xcb_t)(void);
|
||||
|
||||
/*A helper type to handle data pointers and function pointer is the same way.*/
|
||||
typedef union {
|
||||
lv_style_prop_cb_t fptr;
|
||||
_lv_style_prop_xcb_t fptr;
|
||||
const void * dptr;
|
||||
} lv_style_fptr_dptr_t;
|
||||
} _lv_style_fptr_dptr_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
@@ -371,7 +373,7 @@ void _lv_style_set_opa(lv_style_t * style, lv_style_property_t prop, lv_opa_t op
|
||||
* For example: `lv_style_set_border_width()`
|
||||
* @note for performance reasons it's not checked if the property really has pointer type
|
||||
*/
|
||||
void _lv_style_set_ptr(lv_style_t * style, lv_style_property_t prop, lv_style_fptr_dptr_t p);
|
||||
void _lv_style_set_ptr(lv_style_t * style, lv_style_property_t prop, _lv_style_fptr_dptr_t p);
|
||||
|
||||
/**
|
||||
* Set a function pointer typed property in a style.
|
||||
@@ -383,9 +385,9 @@ void _lv_style_set_ptr(lv_style_t * style, lv_style_property_t prop, lv_style_fp
|
||||
* For example: `lv_style_set_border_width()`
|
||||
* @note for performance reasons it's not checked if the property really has pointer type
|
||||
*/
|
||||
static inline void _lv_style_set_func_ptr(lv_style_t * style, lv_style_property_t prop, lv_style_prop_cb_t p)
|
||||
static inline void _lv_style_set_func_ptr(lv_style_t * style, lv_style_property_t prop, _lv_style_prop_xcb_t p)
|
||||
{
|
||||
lv_style_fptr_dptr_t fd;
|
||||
_lv_style_fptr_dptr_t fd;
|
||||
fd.dptr = NULL;
|
||||
fd.fptr = p;
|
||||
_lv_style_set_ptr(style, prop, fd);
|
||||
@@ -403,7 +405,7 @@ static inline void _lv_style_set_func_ptr(lv_style_t * style, lv_style_property_
|
||||
*/
|
||||
static inline void _lv_style_set_data_ptr(lv_style_t * style, lv_style_property_t prop, const void * p)
|
||||
{
|
||||
lv_style_fptr_dptr_t fd;
|
||||
_lv_style_fptr_dptr_t fd;
|
||||
fd.fptr = NULL;
|
||||
fd.dptr = p;
|
||||
_lv_style_set_ptr(style, prop, fd);
|
||||
@@ -485,12 +487,12 @@ int16_t _lv_style_get_ptr(const lv_style_t * style, lv_style_property_t prop, vo
|
||||
*/
|
||||
static inline int16_t _lv_style_get_func_ptr(const lv_style_t * style, lv_style_property_t prop, void * res)
|
||||
{
|
||||
lv_style_fptr_dptr_t fd_res;
|
||||
_lv_style_fptr_dptr_t fd_res;
|
||||
fd_res.dptr = NULL;
|
||||
fd_res.fptr = NULL;
|
||||
lv_res_t r = _lv_style_get_ptr(style, prop, &fd_res);
|
||||
|
||||
lv_style_prop_cb_t * res2 = (lv_style_prop_cb_t *)res;
|
||||
_lv_style_prop_xcb_t * res2 = (_lv_style_prop_xcb_t *)res;
|
||||
*res2 = fd_res.fptr;
|
||||
return r;
|
||||
}
|
||||
@@ -510,7 +512,7 @@ static inline int16_t _lv_style_get_func_ptr(const lv_style_t * style, lv_style_
|
||||
*/
|
||||
static inline int16_t _lv_style_get_data_ptr(const lv_style_t * style, lv_style_property_t prop, void * res)
|
||||
{
|
||||
lv_style_fptr_dptr_t fd_res;
|
||||
_lv_style_fptr_dptr_t fd_res;
|
||||
fd_res.dptr = NULL;
|
||||
fd_res.fptr = NULL;
|
||||
lv_res_t r = _lv_style_get_ptr(style, prop, &fd_res);
|
||||
@@ -580,7 +582,7 @@ void lv_style_list_set_local_opa(lv_style_list_t * list, lv_style_property_t pro
|
||||
* @param value the value to set
|
||||
* @note for performance reasons it's not checked if the property really has pointer type
|
||||
*/
|
||||
void lv_style_list_set_local_ptr(lv_style_list_t * list, lv_style_property_t prop, lv_style_fptr_dptr_t value);
|
||||
void lv_style_list_set_local_ptr(lv_style_list_t * list, lv_style_property_t prop, _lv_style_fptr_dptr_t value);
|
||||
|
||||
/**
|
||||
* Set a local pointer typed property in a style list.
|
||||
@@ -591,9 +593,9 @@ void lv_style_list_set_local_ptr(lv_style_list_t * list, lv_style_property_t pro
|
||||
* @note for performance reasons it's not checked if the property really has pointer type
|
||||
*/
|
||||
static inline void lv_style_list_set_local_func_ptr(lv_style_list_t * list, lv_style_property_t prop,
|
||||
lv_style_prop_cb_t value)
|
||||
_lv_style_prop_xcb_t value)
|
||||
{
|
||||
lv_style_fptr_dptr_t fd;
|
||||
_lv_style_fptr_dptr_t fd;
|
||||
fd.dptr = NULL;
|
||||
fd.fptr = value;
|
||||
lv_style_list_set_local_ptr(list, prop, fd);
|
||||
@@ -610,7 +612,7 @@ static inline void lv_style_list_set_local_func_ptr(lv_style_list_t * list, lv_s
|
||||
static inline void lv_style_list_set_local_data_ptr(lv_style_list_t * list, lv_style_property_t prop,
|
||||
const void * value)
|
||||
{
|
||||
lv_style_fptr_dptr_t fd;
|
||||
_lv_style_fptr_dptr_t fd;
|
||||
fd.fptr = NULL;
|
||||
fd.dptr = value;
|
||||
lv_style_list_set_local_ptr(list, prop, fd);
|
||||
@@ -667,7 +669,7 @@ lv_res_t lv_style_list_get_opa(lv_style_list_t * list, lv_style_property_t prop,
|
||||
* @note for performance reasons it's not checked if the property really has pointer type
|
||||
* @note Do not use this function directly. Use `lv_style_list_get_func_ptr` or `lv_style_list_get_data_ptr`
|
||||
*/
|
||||
lv_res_t lv_style_list_get_ptr(lv_style_list_t * list, lv_style_property_t prop, lv_style_fptr_dptr_t * res);
|
||||
lv_res_t lv_style_list_get_ptr(lv_style_list_t * list, lv_style_property_t prop, _lv_style_fptr_dptr_t * res);
|
||||
|
||||
|
||||
/**
|
||||
@@ -683,7 +685,7 @@ lv_res_t lv_style_list_get_ptr(lv_style_list_t * list, lv_style_property_t prop,
|
||||
*/
|
||||
static inline lv_res_t lv_style_list_get_func_ptr(lv_style_list_t * list, lv_style_property_t prop, void (**res)(void))
|
||||
{
|
||||
lv_style_fptr_dptr_t fd_res;
|
||||
_lv_style_fptr_dptr_t fd_res;
|
||||
fd_res.dptr = NULL;
|
||||
fd_res.fptr = NULL;
|
||||
lv_res_t r = lv_style_list_get_ptr(list, prop, &fd_res);
|
||||
@@ -705,7 +707,7 @@ static inline lv_res_t lv_style_list_get_func_ptr(lv_style_list_t * list, lv_sty
|
||||
*/
|
||||
static inline lv_res_t lv_style_list_get_data_ptr(lv_style_list_t * list, lv_style_property_t prop, const void ** res)
|
||||
{
|
||||
lv_style_fptr_dptr_t fd_res;
|
||||
_lv_style_fptr_dptr_t fd_res;
|
||||
fd_res.dptr = NULL;
|
||||
fd_res.fptr = NULL;
|
||||
lv_res_t r = lv_style_list_get_ptr(list, prop, &fd_res);
|
||||
|
||||
@@ -210,7 +210,7 @@ void lv_draw_mask_line_points_init(lv_draw_mask_line_param_t * param, lv_coord_t
|
||||
param->flat = (LV_MATH_ABS(p2x - p1x) > LV_MATH_ABS(p2y - p1y)) ? 1 : 0;
|
||||
param->yx_steep = 0;
|
||||
param->xy_steep = 0;
|
||||
param->dsc.cb = (lv_draw_mask_cb_t)lv_draw_mask_line;
|
||||
param->dsc.cb = (lv_draw_mask_xcb_t)lv_draw_mask_line;
|
||||
param->dsc.type = LV_DRAW_MASK_TYPE_LINE;
|
||||
|
||||
int32_t dx = p2x - p1x;
|
||||
@@ -328,7 +328,7 @@ void lv_draw_mask_angle_init(lv_draw_mask_angle_param_t * param, lv_coord_t vert
|
||||
param->cfg.end_angle = end_angle;
|
||||
param->cfg.vertex_p.x = vertex_x;
|
||||
param->cfg.vertex_p.y = vertex_y;
|
||||
param->dsc.cb = (lv_draw_mask_cb_t)lv_draw_mask_angle;
|
||||
param->dsc.cb = (lv_draw_mask_xcb_t)lv_draw_mask_angle;
|
||||
param->dsc.type = LV_DRAW_MASK_TYPE_ANGLE;
|
||||
|
||||
if(start_angle >= 0 && start_angle < 180) {
|
||||
@@ -375,7 +375,7 @@ void lv_draw_mask_radius_init(lv_draw_mask_radius_param_t * param, const lv_area
|
||||
lv_area_copy(¶m->cfg.rect, rect);
|
||||
param->cfg.radius = radius;
|
||||
param->cfg.outer = inv ? 1 : 0;
|
||||
param->dsc.cb = (lv_draw_mask_cb_t)lv_draw_mask_radius;
|
||||
param->dsc.cb = (lv_draw_mask_xcb_t)lv_draw_mask_radius;
|
||||
param->dsc.type = LV_DRAW_MASK_TYPE_RADIUS;
|
||||
param->y_prev = INT32_MIN;
|
||||
param->y_prev_x.f = 0;
|
||||
@@ -401,7 +401,7 @@ void lv_draw_mask_fade_init(lv_draw_mask_fade_param_t * param, const lv_area_t *
|
||||
param->cfg.opa_bottom = opa_bottom;
|
||||
param->cfg.y_top = y_top;
|
||||
param->cfg.y_bottom = y_bottom;
|
||||
param->dsc.cb = (lv_draw_mask_cb_t)lv_draw_mask_fade;
|
||||
param->dsc.cb = (lv_draw_mask_xcb_t)lv_draw_mask_fade;
|
||||
param->dsc.type = LV_DRAW_MASK_TYPE_FADE;
|
||||
}
|
||||
|
||||
@@ -416,7 +416,7 @@ void lv_draw_mask_map_init(lv_draw_mask_map_param_t * param, const lv_area_t * c
|
||||
{
|
||||
lv_area_copy(¶m->cfg.coords, coords);
|
||||
param->cfg.map = map;
|
||||
param->dsc.cb = (lv_draw_mask_cb_t)lv_draw_mask_map;
|
||||
param->dsc.cb = (lv_draw_mask_xcb_t)lv_draw_mask_map;
|
||||
param->dsc.type = LV_DRAW_MASK_TYPE_MAP;
|
||||
}
|
||||
|
||||
|
||||
@@ -53,13 +53,17 @@ enum {
|
||||
LV_DRAW_MASK_LINE_SIDE_BOTTOM,
|
||||
};
|
||||
|
||||
typedef lv_draw_mask_res_t (*lv_draw_mask_cb_t)(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y, lv_coord_t len,
|
||||
/**
|
||||
* A common callback type for every mask type.
|
||||
* Used internally by the library.
|
||||
*/
|
||||
typedef lv_draw_mask_res_t (*lv_draw_mask_xcb_t)(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y, lv_coord_t len,
|
||||
void * p);
|
||||
|
||||
typedef uint8_t lv_draw_mask_line_side_t;
|
||||
|
||||
typedef struct {
|
||||
lv_draw_mask_cb_t cb;
|
||||
lv_draw_mask_xcb_t cb;
|
||||
lv_draw_mask_type_t type;
|
||||
} lv_draw_mask_common_dsc_t;
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ uint32_t lv_theme_get_flags(void)
|
||||
|
||||
void lv_theme_apply(lv_obj_t * obj, lv_theme_style_t name)
|
||||
{
|
||||
act_theme->apply_cb(obj, name);
|
||||
act_theme->apply_xcb(obj, name);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ typedef enum {
|
||||
} lv_theme_style_t;
|
||||
|
||||
typedef struct {
|
||||
void (*apply_cb)(lv_obj_t *, lv_theme_style_t);
|
||||
void (*apply_xcb)(lv_obj_t *, lv_theme_style_t);
|
||||
lv_color_t color_primary;
|
||||
lv_color_t color_secondary;
|
||||
const lv_font_t * font_small;
|
||||
|
||||
@@ -878,7 +878,7 @@ lv_theme_t * lv_theme_material_init(lv_color_t color_primary, lv_color_t color_s
|
||||
table_init();
|
||||
win_init();
|
||||
|
||||
theme.apply_cb = lv_theme_material_apply;
|
||||
theme.apply_xcb = lv_theme_material_apply;
|
||||
|
||||
inited = true;
|
||||
|
||||
|
||||
@@ -527,7 +527,7 @@ lv_theme_t * lv_theme_mono_init(lv_color_t color_primary, lv_color_t color_secon
|
||||
table_init();
|
||||
win_init();
|
||||
|
||||
theme.apply_cb = lv_theme_mono_apply;
|
||||
theme.apply_xcb = lv_theme_mono_apply;
|
||||
|
||||
return &theme;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user