BigW Consortium Gitlab

Commit 05fe9b6b by Gabor Kiss-Vamosi

add lv_obj_get_type

parent e4b677be
...@@ -1353,6 +1353,34 @@ void * lv_obj_get_ext_attr(lv_obj_t * obj) ...@@ -1353,6 +1353,34 @@ void * lv_obj_get_ext_attr(lv_obj_t * obj)
return obj->ext_attr; return obj->ext_attr;
} }
/**
* Get object's and its ancestors type. Put their name in `type_buf` starting with the current type.
* E.g. buf.type[0]="lv_btn", buf.type[1]="lv_cont", buf.type[2]="lv_obj"
* @param obj pointer to an object which type should be get
* @param buf pointer to an `lv_obj_type_t` buffer to store the types
*/
void lv_obj_get_type(lv_obj_t * obj, lv_obj_type_t * buf)
{
lv_obj_type_t tmp;
memset(buf, 0, sizeof(lv_obj_type_t));
memset(&tmp, 0, sizeof(lv_obj_type_t));
obj->signal_func(obj, LV_SIGNAL_GET_TYPE, &tmp);
uint8_t cnt;
for(cnt = 0; cnt < LV_MAX_ANCESTOR_NUM; cnt++) {
if(tmp.type[cnt] == NULL) break;
}
/*Swap the order. The real type comes first*/
uint8_t i;
for(i = 0; i < cnt; i++) {
buf->type[i] = tmp.type[cnt - 1 - i];
}
}
#ifdef LV_OBJ_FREE_NUM_TYPE #ifdef LV_OBJ_FREE_NUM_TYPE
/** /**
* Get the free number * Get the free number
...@@ -1377,6 +1405,7 @@ void * lv_obj_get_free_ptr(lv_obj_t * obj) ...@@ -1377,6 +1405,7 @@ void * lv_obj_get_free_ptr(lv_obj_t * obj)
} }
#endif #endif
#if USE_LV_GROUP #if USE_LV_GROUP
/** /**
* Get the group of the object * Get the group of the object
...@@ -1451,19 +1480,19 @@ static lv_res_t lv_obj_signal(lv_obj_t * obj, lv_signal_t sign, void * param) ...@@ -1451,19 +1480,19 @@ static lv_res_t lv_obj_signal(lv_obj_t * obj, lv_signal_t sign, void * param)
lv_res_t res = LV_RES_OK; lv_res_t res = LV_RES_OK;
lv_style_t * style = lv_obj_get_style(obj); lv_style_t * style = lv_obj_get_style(obj);
switch(sign) { if(sign == LV_SIGNAL_CHILD_CHG) {
case LV_SIGNAL_CHILD_CHG: /*Return 'invalid' if the child change signal is not enabled*/
/*Return 'invalid' if the child change signal is not enabled*/ if(lv_obj_is_protected(obj, LV_PROTECT_CHILD_CHG) != false) res = LV_RES_INV;
if(lv_obj_is_protected(obj, LV_PROTECT_CHILD_CHG) != false) res = LV_RES_INV; }
break; else if(sign == LV_SIGNAL_REFR_EXT_SIZE) {
case LV_SIGNAL_REFR_EXT_SIZE: if(style->body.shadow.width > obj->ext_size) obj->ext_size = style->body.shadow.width;
if(style->body.shadow.width > obj->ext_size) obj->ext_size = style->body.shadow.width; }
break; else if(sign == LV_SIGNAL_STYLE_CHG) {
case LV_SIGNAL_STYLE_CHG: lv_obj_refresh_ext_size(obj);
lv_obj_refresh_ext_size(obj); }
break; else if(sign == LV_SIGNAL_GET_TYPE) {
default: lv_obj_type_t * buf = param;
break; buf->type[0] = "lv_obj";
} }
return res; return res;
......
...@@ -52,6 +52,7 @@ extern "C" { ...@@ -52,6 +52,7 @@ extern "C" {
#define LV_ANIM_OUT 0x80 /*Animation to hide an object. 'OR' it with lv_anim_builtin_t*/ #define LV_ANIM_OUT 0x80 /*Animation to hide an object. 'OR' it with lv_anim_builtin_t*/
#define LV_ANIM_DIR_MASK 0x80 /*ANIM_IN/ANIM_OUT mask*/ #define LV_ANIM_DIR_MASK 0x80 /*ANIM_IN/ANIM_OUT mask*/
#define LV_MAX_ANCESTOR_NUM 8
/********************** /**********************
* TYPEDEFS * TYPEDEFS
**********************/ **********************/
...@@ -81,6 +82,7 @@ typedef enum ...@@ -81,6 +82,7 @@ typedef enum
LV_SIGNAL_CORD_CHG, LV_SIGNAL_CORD_CHG,
LV_SIGNAL_STYLE_CHG, LV_SIGNAL_STYLE_CHG,
LV_SIGNAL_REFR_EXT_SIZE, LV_SIGNAL_REFR_EXT_SIZE,
LV_SIGNAL_GET_TYPE,
/*Input device related*/ /*Input device related*/
LV_SIGNAL_PRESSED, LV_SIGNAL_PRESSED,
...@@ -151,6 +153,12 @@ typedef enum ...@@ -151,6 +153,12 @@ typedef enum
LV_PROTECT_PRESS_LOST= 0x10, /*TODO */ LV_PROTECT_PRESS_LOST= 0x10, /*TODO */
}lv_protect_t; }lv_protect_t;
/*Used by `lv_obj_get_type()`. The object's and its ancestor types are stored here*/
typedef struct {
const char * type[LV_MAX_ANCESTOR_NUM]; /*[0]: the actual type, [1]: ancestor, [2] #1's ancestor ... [x]: "lv_obj" */
}lv_obj_type_t;
typedef enum typedef enum
{ {
LV_ALIGN_CENTER = 0, LV_ALIGN_CENTER = 0,
...@@ -677,6 +685,14 @@ lv_design_func_t lv_obj_get_design_func(lv_obj_t * obj); ...@@ -677,6 +685,14 @@ lv_design_func_t lv_obj_get_design_func(lv_obj_t * obj);
*/ */
void * lv_obj_get_ext_attr(lv_obj_t * obj); void * lv_obj_get_ext_attr(lv_obj_t * obj);
/**
* Get object's and its ancestors type. Put their name in `type_buf` starting with the current type.
* E.g. buf.type[0]="lv_btn", buf.type[1]="lv_cont", buf.type[2]="lv_obj"
* @param obj pointer to an object which type should be get
* @param buf pointer to an `lv_obj_type_t` buffer to store the types
*/
void lv_obj_get_type(lv_obj_t * obj, lv_obj_type_t * buf);
#ifdef LV_OBJ_FREE_NUM_TYPE #ifdef LV_OBJ_FREE_NUM_TYPE
/** /**
* Get the free number * Get the free number
......
...@@ -318,6 +318,14 @@ static lv_res_t lv_bar_signal(lv_obj_t * bar, lv_signal_t sign, void * param) ...@@ -318,6 +318,14 @@ static lv_res_t lv_bar_signal(lv_obj_t * bar, lv_signal_t sign, void * param)
lv_style_t * style_indic = lv_bar_get_style(bar, LV_BAR_STYLE_INDIC); lv_style_t * style_indic = lv_bar_get_style(bar, LV_BAR_STYLE_INDIC);
if(style_indic->body.shadow.width > bar->ext_size) bar->ext_size = style_indic->body.shadow.width; if(style_indic->body.shadow.width > bar->ext_size) bar->ext_size = style_indic->body.shadow.width;
} }
else if(sign == LV_SIGNAL_GET_TYPE) {
lv_obj_type_t * buf = param;
uint8_t i;
for(i = 0; i < LV_MAX_ANCESTOR_NUM - 1; i++) { /*Find the last set data*/
if(buf->type[i] == NULL) break;
}
buf->type[i] = "lv_bar";
}
return res; return res;
} }
......
...@@ -388,6 +388,14 @@ static lv_res_t lv_btn_signal(lv_obj_t * btn, lv_signal_t sign, void * param) ...@@ -388,6 +388,14 @@ static lv_res_t lv_btn_signal(lv_obj_t * btn, lv_signal_t sign, void * param)
} }
} }
} }
else if(sign == LV_SIGNAL_GET_TYPE) {
lv_obj_type_t * buf = param;
uint8_t i;
for(i = 0; i < LV_MAX_ANCESTOR_NUM - 1; i++) { /*Find the last set data*/
if(buf->type[i] == NULL) break;
}
buf->type[i] = "lv_btn";
}
return res; return res;
} }
......
...@@ -593,6 +593,14 @@ static lv_res_t lv_btnm_signal(lv_obj_t * btnm, lv_signal_t sign, void * param) ...@@ -593,6 +593,14 @@ static lv_res_t lv_btnm_signal(lv_obj_t * btnm, lv_signal_t sign, void * param)
} }
} }
} }
else if(sign == LV_SIGNAL_GET_TYPE) {
lv_obj_type_t * buf = param;
uint8_t i;
for(i = 0; i < LV_MAX_ANCESTOR_NUM - 1; i++) { /*Find the last set data*/
if(buf->type[i] == NULL) break;
}
buf->type[i] = "lv_btnm";
}
} }
return res; return res;
......
...@@ -309,6 +309,14 @@ static lv_res_t lv_cb_signal(lv_obj_t * cb, lv_signal_t sign, void * param) ...@@ -309,6 +309,14 @@ static lv_res_t lv_cb_signal(lv_obj_t * cb, lv_signal_t sign, void * param)
lv_btn_set_state(ext->bullet, lv_btn_get_state(cb)); lv_btn_set_state(ext->bullet, lv_btn_get_state(cb));
} }
} }
else if(sign == LV_SIGNAL_GET_TYPE) {
lv_obj_type_t * buf = param;
uint8_t i;
for(i = 0; i < LV_MAX_ANCESTOR_NUM - 1; i++) { /*Find the last set data*/
if(buf->type[i] == NULL) break;
}
buf->type[i] = "lv_cb";
}
return res; return res;
} }
......
...@@ -436,6 +436,14 @@ static lv_res_t lv_chart_signal(lv_obj_t * chart, lv_signal_t sign, void * param ...@@ -436,6 +436,14 @@ static lv_res_t lv_chart_signal(lv_obj_t * chart, lv_signal_t sign, void * param
} }
lv_ll_clear(&ext->series_ll); lv_ll_clear(&ext->series_ll);
} }
else if(sign == LV_SIGNAL_GET_TYPE) {
lv_obj_type_t * buf = param;
uint8_t i;
for(i = 0; i < LV_MAX_ANCESTOR_NUM - 1; i++) { /*Find the last set data*/
if(buf->type[i] == NULL) break;
}
buf->type[i] = "lv_chart";
}
return res; return res;
} }
......
...@@ -207,6 +207,14 @@ static lv_res_t lv_cont_signal(lv_obj_t * cont, lv_signal_t sign, void * param) ...@@ -207,6 +207,14 @@ static lv_res_t lv_cont_signal(lv_obj_t * cont, lv_signal_t sign, void * param)
lv_cont_refr_autofit(cont); lv_cont_refr_autofit(cont);
} }
} }
else if(sign == LV_SIGNAL_GET_TYPE) {
lv_obj_type_t * buf = param;
uint8_t i;
for(i = 0; i < LV_MAX_ANCESTOR_NUM - 1; i++) { /*Find the last set data*/
if(buf->type[i] == NULL) break;
}
buf->type[i] = "lv_cont";
}
return res; return res;
} }
......
...@@ -537,6 +537,14 @@ static lv_res_t lv_ddlist_signal(lv_obj_t * ddlist, lv_signal_t sign, void * par ...@@ -537,6 +537,14 @@ static lv_res_t lv_ddlist_signal(lv_obj_t * ddlist, lv_signal_t sign, void * par
lv_ddlist_refr_size(ddlist, true); lv_ddlist_refr_size(ddlist, true);
} }
} }
else if(sign == LV_SIGNAL_GET_TYPE) {
lv_obj_type_t * buf = param;
uint8_t i;
for(i = 0; i < LV_MAX_ANCESTOR_NUM - 1; i++) { /*Find the last set data*/
if(buf->type[i] == NULL) break;
}
buf->type[i] = "lv_ddlist";
}
return res; return res;
} }
......
...@@ -308,6 +308,14 @@ static lv_res_t lv_gauge_signal(lv_obj_t * gauge, lv_signal_t sign, void * param ...@@ -308,6 +308,14 @@ static lv_res_t lv_gauge_signal(lv_obj_t * gauge, lv_signal_t sign, void * param
lv_mem_free(ext->values); lv_mem_free(ext->values);
ext->values = NULL; ext->values = NULL;
} }
else if(sign == LV_SIGNAL_GET_TYPE) {
lv_obj_type_t * buf = param;
uint8_t i;
for(i = 0; i < LV_MAX_ANCESTOR_NUM - 1; i++) { /*Find the last set data*/
if(buf->type[i] == NULL) break;
}
buf->type[i] = "lv_gauge";
}
return res; return res;
} }
......
...@@ -352,6 +352,14 @@ static lv_res_t lv_img_signal(lv_obj_t * img, lv_signal_t sign, void * param) ...@@ -352,6 +352,14 @@ static lv_res_t lv_img_signal(lv_obj_t * img, lv_signal_t sign, void * param)
} }
} }
else if(sign == LV_SIGNAL_GET_TYPE) {
lv_obj_type_t * buf = param;
uint8_t i;
for(i = 0; i < LV_MAX_ANCESTOR_NUM - 1; i++) { /*Find the last set data*/
if(buf->type[i] == NULL) break;
}
buf->type[i] = "lv_img";
}
return res; return res;
} }
......
...@@ -346,6 +346,14 @@ static lv_res_t lv_kb_signal(lv_obj_t * kb, lv_signal_t sign, void * param) ...@@ -346,6 +346,14 @@ static lv_res_t lv_kb_signal(lv_obj_t * kb, lv_signal_t sign, void * param)
if(sign == LV_SIGNAL_CLEANUP) { if(sign == LV_SIGNAL_CLEANUP) {
/*Nothing to cleanup. (No dynamically allocated memory in 'ext')*/ /*Nothing to cleanup. (No dynamically allocated memory in 'ext')*/
} }
else if(sign == LV_SIGNAL_GET_TYPE) {
lv_obj_type_t * buf = param;
uint8_t i;
for(i = 0; i < LV_MAX_ANCESTOR_NUM - 1; i++) { /*Find the last set data*/
if(buf->type[i] == NULL) break;
}
buf->type[i] = "lv_kb";
}
return res; return res;
} }
......
...@@ -714,6 +714,14 @@ static lv_res_t lv_label_signal(lv_obj_t * label, lv_signal_t sign, void * param ...@@ -714,6 +714,14 @@ static lv_res_t lv_label_signal(lv_obj_t * label, lv_signal_t sign, void * param
label->ext_size = LV_MATH_MAX(label->ext_size, style->body.padding.ver); label->ext_size = LV_MATH_MAX(label->ext_size, style->body.padding.ver);
} }
} }
else if(sign == LV_SIGNAL_GET_TYPE) {
lv_obj_type_t * buf = param;
uint8_t i;
for(i = 0; i < LV_MAX_ANCESTOR_NUM - 1; i++) { /*Find the last set data*/
if(buf->type[i] == NULL) break;
}
buf->type[i] = "lv_label";
}
return res; return res;
} }
......
...@@ -219,6 +219,16 @@ static lv_res_t lv_led_signal(lv_obj_t * led, lv_signal_t sign, void * param) ...@@ -219,6 +219,16 @@ static lv_res_t lv_led_signal(lv_obj_t * led, lv_signal_t sign, void * param)
res = ancestor_signal(led, sign, param); res = ancestor_signal(led, sign, param);
if(res != LV_RES_OK) return res; if(res != LV_RES_OK) return res;
if(sign == LV_SIGNAL_GET_TYPE) {
lv_obj_type_t * buf = param;
uint8_t i;
for(i = 0; i < LV_MAX_ANCESTOR_NUM - 1; i++) { /*Find the last set data*/
if(buf->type[i] == NULL) break;
}
buf->type[i] = "lv_led";
}
return res; return res;
} }
#endif #endif
...@@ -246,6 +246,16 @@ static lv_res_t lv_line_signal(lv_obj_t * line, lv_signal_t sign, void * param) ...@@ -246,6 +246,16 @@ static lv_res_t lv_line_signal(lv_obj_t * line, lv_signal_t sign, void * param)
res = ancestor_signal(line, sign, param); res = ancestor_signal(line, sign, param);
if(res != LV_RES_OK) return res; if(res != LV_RES_OK) return res;
if(sign == LV_SIGNAL_GET_TYPE) {
lv_obj_type_t * buf = param;
uint8_t i;
for(i = 0; i < LV_MAX_ANCESTOR_NUM - 1; i++) { /*Find the last set data*/
if(buf->type[i] == NULL) break;
}
buf->type[i] = "lv_line";
}
return res; return res;
} }
#endif #endif
...@@ -575,6 +575,14 @@ static lv_res_t lv_list_signal(lv_obj_t * list, lv_signal_t sign, void * param) ...@@ -575,6 +575,14 @@ static lv_res_t lv_list_signal(lv_obj_t * list, lv_signal_t sign, void * param)
if(rel_action != NULL) rel_action(btn); if(rel_action != NULL) rel_action(btn);
} }
} }
else if(sign == LV_SIGNAL_GET_TYPE) {
lv_obj_type_t * buf = param;
uint8_t i;
for(i = 0; i < LV_MAX_ANCESTOR_NUM - 1; i++) { /*Find the last set data*/
if(buf->type[i] == NULL) break;
}
buf->type[i] = "lv_list";
}
} }
return res; return res;
} }
......
...@@ -326,6 +326,14 @@ static lv_res_t lv_lmeter_signal(lv_obj_t * lmeter, lv_signal_t sign, void * par ...@@ -326,6 +326,14 @@ static lv_res_t lv_lmeter_signal(lv_obj_t * lmeter, lv_signal_t sign, void * par
if(sign == LV_SIGNAL_CLEANUP) { if(sign == LV_SIGNAL_CLEANUP) {
/*Nothing to cleanup. (No dynamically allocated memory in 'ext')*/ /*Nothing to cleanup. (No dynamically allocated memory in 'ext')*/
} }
else if(sign == LV_SIGNAL_GET_TYPE) {
lv_obj_type_t * buf = param;
uint8_t i;
for(i = 0; i < LV_MAX_ANCESTOR_NUM - 1; i++) { /*Find the last set data*/
if(buf->type[i] == NULL) break;
}
buf->type[i] = "lv_lmeter";
}
return res; return res;
} }
......
...@@ -365,6 +365,14 @@ static lv_res_t lv_mbox_signal(lv_obj_t * mbox, lv_signal_t sign, void * param) ...@@ -365,6 +365,14 @@ static lv_res_t lv_mbox_signal(lv_obj_t * mbox, lv_signal_t sign, void * param)
ext->btnm->signal_func(ext->btnm, sign, param); ext->btnm->signal_func(ext->btnm, sign, param);
} }
} }
else if(sign == LV_SIGNAL_GET_TYPE) {
lv_obj_type_t * buf = param;
uint8_t i;
for(i = 0; i < LV_MAX_ANCESTOR_NUM - 1; i++) { /*Find the last set data*/
if(buf->type[i] == NULL) break;
}
buf->type[i] = "lv_mbox";
}
return res; return res;
} }
......
...@@ -210,6 +210,14 @@ static lv_res_t lv_templ_signal(lv_obj_t * templ, lv_signal_t sign, void * param ...@@ -210,6 +210,14 @@ static lv_res_t lv_templ_signal(lv_obj_t * templ, lv_signal_t sign, void * param
if(sign == LV_SIGNAL_CLEANUP) { if(sign == LV_SIGNAL_CLEANUP) {
/*Nothing to cleanup. (No dynamically allocated memory in 'ext')*/ /*Nothing to cleanup. (No dynamically allocated memory in 'ext')*/
} }
else if(sign == LV_SIGNAL_GET_TYPE) {
lv_obj_type_t * buf = param;
uint8_t i;
for(i = 0; i < LV_MAX_ANCESTOR_NUM - 1; i++) { /*Find the last set data*/
if(buf->type[i] == NULL) break;
}
buf->type[i] = "lv_templ";
}
return res; return res;
} }
......
...@@ -517,6 +517,14 @@ static lv_res_t lv_page_signal(lv_obj_t * page, lv_signal_t sign, void * param) ...@@ -517,6 +517,14 @@ static lv_res_t lv_page_signal(lv_obj_t * page, lv_signal_t sign, void * param)
if(page->ext_size < (-ext->sb.style->body.padding.hor)) page->ext_size = -ext->sb.style->body.padding.hor; if(page->ext_size < (-ext->sb.style->body.padding.hor)) page->ext_size = -ext->sb.style->body.padding.hor;
if(page->ext_size < (-ext->sb.style->body.padding.ver)) page->ext_size = -ext->sb.style->body.padding.ver; if(page->ext_size < (-ext->sb.style->body.padding.ver)) page->ext_size = -ext->sb.style->body.padding.ver;
} }
else if(sign == LV_SIGNAL_GET_TYPE) {
lv_obj_type_t * buf = param;
uint8_t i;
for(i = 0; i < LV_MAX_ANCESTOR_NUM - 1; i++) { /*Find the last set data*/
if(buf->type[i] == NULL) break;
}
buf->type[i] = "lv_page";
}
return res; return res;
} }
......
...@@ -312,6 +312,14 @@ static lv_res_t lv_roller_signal(lv_obj_t * roller, lv_signal_t sign, void * par ...@@ -312,6 +312,14 @@ static lv_res_t lv_roller_signal(lv_obj_t * roller, lv_signal_t sign, void * par
} }
} }
} }
else if(sign == LV_SIGNAL_GET_TYPE) {
lv_obj_type_t * buf = param;
uint8_t i;
for(i = 0; i < LV_MAX_ANCESTOR_NUM - 1; i++) { /*Find the last set data*/
if(buf->type[i] == NULL) break;
}
buf->type[i] = "lv_roller";
}
return res; return res;
} }
......
...@@ -443,6 +443,14 @@ static lv_res_t lv_slider_signal(lv_obj_t * slider, lv_signal_t sign, void * par ...@@ -443,6 +443,14 @@ static lv_res_t lv_slider_signal(lv_obj_t * slider, lv_signal_t sign, void * par
if(ext->action != NULL) ext->action(slider); if(ext->action != NULL) ext->action(slider);
} }
} }
else if(sign == LV_SIGNAL_GET_TYPE) {
lv_obj_type_t * buf = param;
uint8_t i;
for(i = 0; i < LV_MAX_ANCESTOR_NUM - 1; i++) { /*Find the last set data*/
if(buf->type[i] == NULL) break;
}
buf->type[i] = "lv_slider";
}
return res; return res;
} }
......
...@@ -236,6 +236,14 @@ static lv_res_t lv_sw_signal(lv_obj_t * sw, lv_signal_t sign, void * param) ...@@ -236,6 +236,14 @@ static lv_res_t lv_sw_signal(lv_obj_t * sw, lv_signal_t sign, void * param)
ext->changed = 0; ext->changed = 0;
} }
else if(sign == LV_SIGNAL_GET_TYPE) {
lv_obj_type_t * buf = param;
uint8_t i;
for(i = 0; i < LV_MAX_ANCESTOR_NUM - 1; i++) { /*Find the last set data*/
if(buf->type[i] == NULL) break;
}
buf->type[i] = "lv_sw";
}
/*Restore the callback*/ /*Restore the callback*/
ext->slider.action = slider_cb; ext->slider.action = slider_cb;
......
...@@ -958,6 +958,14 @@ static lv_res_t lv_ta_signal(lv_obj_t * ta, lv_signal_t sign, void * param) ...@@ -958,6 +958,14 @@ static lv_res_t lv_ta_signal(lv_obj_t * ta, lv_signal_t sign, void * param)
#endif #endif
} }
} }
else if(sign == LV_SIGNAL_GET_TYPE) {
lv_obj_type_t * buf = param;
uint8_t i;
for(i = 0; i < LV_MAX_ANCESTOR_NUM - 1; i++) { /*Find the last set data*/
if(buf->type[i] == NULL) break;
}
buf->type[i] = "lv_ta";
}
return res; return res;
} }
......
...@@ -516,6 +516,14 @@ static lv_res_t lv_tabview_signal(lv_obj_t * tabview, lv_signal_t sign, void * p ...@@ -516,6 +516,14 @@ static lv_res_t lv_tabview_signal(lv_obj_t * tabview, lv_signal_t sign, void * p
ext->btns->signal_func(ext->btns, sign, param); ext->btns->signal_func(ext->btns, sign, param);
} }
} }
else if(sign == LV_SIGNAL_GET_TYPE) {
lv_obj_type_t * buf = param;
uint8_t i;
for(i = 0; i < LV_MAX_ANCESTOR_NUM - 1; i++) { /*Find the last set data*/
if(buf->type[i] == NULL) break;
}
buf->type[i] = "lv_tabview";
}
return res; return res;
} }
......
...@@ -453,6 +453,14 @@ static lv_res_t lv_win_signal(lv_obj_t * win, lv_signal_t sign, void * param) ...@@ -453,6 +453,14 @@ static lv_res_t lv_win_signal(lv_obj_t * win, lv_signal_t sign, void * param)
ext->page = NULL; ext->page = NULL;
ext->title = NULL; ext->title = NULL;
} }
else if(sign == LV_SIGNAL_GET_TYPE) {
lv_obj_type_t * buf = param;
uint8_t i;
for(i = 0; i < LV_MAX_ANCESTOR_NUM - 1; i++) { /*Find the last set data*/
if(buf->type[i] == NULL) break;
}
buf->type[i] = "lv_win";
}
return res; return res;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment