summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2014-11-28 16:26:05 +0100
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2014-11-28 16:26:05 +0100
commit9f16c1c95603fe198fb4befee1a2210cf84b30b2 (patch)
tree68dc04aae6f3bb27af931a4b543373c3692ba7eb
parent870197085d14d18b4636f31db74fbcd6a4834ab5 (diff)
Lets use a given name field at append state
-rw-r--r--src/elm_settingspane.c23
-rw-r--r--src/elm_settingspane.eo2
2 files changed, 15 insertions, 10 deletions
diff --git a/src/elm_settingspane.c b/src/elm_settingspane.c
index c35c6e2..60968e6 100644
--- a/src/elm_settingspane.c
+++ b/src/elm_settingspane.c
@@ -21,6 +21,8 @@ typedef struct
21 const Elm_Settingspane_Item_Class *class; 21 const Elm_Settingspane_Item_Class *class;
22 Eina_List *childs; //list of Elm_Settingspane_Item* 22 Eina_List *childs; //list of Elm_Settingspane_Item*
23 23
24 const char *name;
25
24 Evas_Object *sw; 26 Evas_Object *sw;
25} Elm_Settingspane_Item_Data; 27} Elm_Settingspane_Item_Data;
26 28
@@ -273,7 +275,7 @@ _elm_settingspane_ii_text_cb(void *data, Evas_Object *obj EINA_UNUSED, const cha
273 return NULL; 275 return NULL;
274 276
275 if (!strcmp(part, "elm.text")) 277 if (!strcmp(part, "elm.text"))
276 return itd->class->label_get(itd->data, itd->sw, NORMAL_TEXT); 278 return strdup(itd->name);
277 else if (!strcmp(part, "elm.text.sub")) 279 else if (!strcmp(part, "elm.text.sub"))
278 return itd->class->label_get(itd->data, itd->sw, DESCRIPTION_TEXT); 280 return itd->class->label_get(itd->data, itd->sw, DESCRIPTION_TEXT);
279 return NULL; 281 return NULL;
@@ -301,7 +303,7 @@ _elm_settingspane_ii_content_cb(void *data, Evas_Object *obj, const char *part)
301} 303}
302 304
303static Elm_Settingspane_Item* 305static Elm_Settingspane_Item*
304_item_new(Evas_Object *obj, const Elm_Settingspane_Item_Class *itc, Elm_Settingspane_Item *par, const void *usr_data) 306_item_new(Evas_Object *obj, const Elm_Settingspane_Item_Class *itc, Elm_Settingspane_Item *par, const void *usr_data, const char *name)
305{ 307{
306 Elm_Settingspane_Item *item = eo_add(ELM_SETTINGSPANE_ITEM_CLASS, obj); 308 Elm_Settingspane_Item *item = eo_add(ELM_SETTINGSPANE_ITEM_CLASS, obj);
307 Elm_Settingspane_Item_Data *data = eo_data_scope_get(item, ELM_SETTINGSPANE_ITEM_CLASS); 309 Elm_Settingspane_Item_Data *data = eo_data_scope_get(item, ELM_SETTINGSPANE_ITEM_CLASS);
@@ -310,6 +312,7 @@ _item_new(Evas_Object *obj, const Elm_Settingspane_Item_Class *itc, Elm_Settings
310 data->sw = obj; 312 data->sw = obj;
311 data->par = par; 313 data->par = par;
312 data->class = itc; 314 data->class = itc;
315 data->name = name;
313 316
314 return item; 317 return item;
315} 318}
@@ -509,7 +512,7 @@ _elm_settingspane_evas_object_smart_add(Eo *obj, Elm_Settingspane_Data *pd)
509 _content_layout_content_init(obj); 512 _content_layout_content_init(obj);
510 _menu_layout_init(obj); 513 _menu_layout_init(obj);
511 514
512 pd->zero = _item_new(obj, ic, NULL, NULL); 515 pd->zero = _item_new(obj, ic, NULL, NULL, eina_stringshare_add("root"));
513 _item_stack_push(obj, pd->zero); 516 _item_stack_push(obj, pd->zero);
514// _menu_layout_show(obj, pd->zero, EINA_TRUE); 517// _menu_layout_show(obj, pd->zero, EINA_TRUE);
515} 518}
@@ -526,7 +529,7 @@ _elm_settingspane_eo_base_constructor(Eo *obj, Elm_Settingspane_Data *pd)
526} 529}
527 530
528static Elm_Settingspane_Item * 531static Elm_Settingspane_Item *
529_elm_settingspane_item_append_full(Eo *obj, Elm_Settingspane_Data *pd, const Elm_Settingspane_Item_Class *itc, const void *data, Elm_Settingspane_Item *par, Elm_Settingspane_Item *rel) 532_elm_settingspane_item_append_full(Eo *obj, Elm_Settingspane_Data *pd, const Elm_Settingspane_Item_Class *itc, const void *data, const char *name, Elm_Settingspane_Item *par, Elm_Settingspane_Item *rel)
530{ 533{
531 Elm_Settingspane_Item *new_child = NULL; 534 Elm_Settingspane_Item *new_child = NULL;
532 //TODO should we check if this item is in this layer ? 535 //TODO should we check if this item is in this layer ?
@@ -535,7 +538,7 @@ _elm_settingspane_item_append_full(Eo *obj, Elm_Settingspane_Data *pd, const Elm
535 Elm_Settingspane_Item_Data *data_par = eo_data_scope_get(par, ELM_SETTINGSPANE_ITEM_CLASS); 538 Elm_Settingspane_Item_Data *data_par = eo_data_scope_get(par, ELM_SETTINGSPANE_ITEM_CLASS);
536 if (data_par && CATEGORY_TEST(data_par)) 539 if (data_par && CATEGORY_TEST(data_par))
537 { 540 {
538 new_child = _item_new(obj, itc, par, data); 541 new_child = _item_new(obj, itc, par, data, name);
539 _item_append(par, new_child, rel); 542 _item_append(par, new_child, rel);
540 } 543 }
541 else 544 else
@@ -545,7 +548,7 @@ _elm_settingspane_item_append_full(Eo *obj, Elm_Settingspane_Data *pd, const Elm
545 } 548 }
546 else 549 else
547 { 550 {
548 new_child = _item_new(obj, itc, pd->zero, data); 551 new_child = _item_new(obj, itc, pd->zero, data, name);
549 /* append this to lvl 0 */ 552 /* append this to lvl 0 */
550 _item_append(pd->zero, new_child, rel); 553 _item_append(pd->zero, new_child, rel);
551 } 554 }
@@ -553,15 +556,15 @@ _elm_settingspane_item_append_full(Eo *obj, Elm_Settingspane_Data *pd, const Elm
553} 556}
554 557
555EOLIAN static Elm_Settingspane_Item * 558EOLIAN static Elm_Settingspane_Item *
556_elm_settingspane_item_append(Eo *obj, Elm_Settingspane_Data *pd, const Elm_Settingspane_Item_Class *itc, const void *data, Elm_Settingspane_Item *par) 559_elm_settingspane_item_append(Eo *obj, Elm_Settingspane_Data *pd, const Elm_Settingspane_Item_Class *itc, const void *data, const char *name, Elm_Settingspane_Item *par)
557{ 560{
558 return _elm_settingspane_item_append_full(obj, pd, itc, data, par, NULL); 561 return _elm_settingspane_item_append_full(obj, pd, itc, data, name, par, NULL);
559} 562}
560 563
561EOLIAN static Elm_Settingspane_Item * 564EOLIAN static Elm_Settingspane_Item *
562_elm_settingspane_item_append_relative(Eo *obj, Elm_Settingspane_Data *pd, const Elm_Settingspane_Item_Class *itc, const void *data, Elm_Settingspane_Item *par, Elm_Settingspane_Item *rel) 565_elm_settingspane_item_append_relative(Eo *obj, Elm_Settingspane_Data *pd, const Elm_Settingspane_Item_Class *itc, const void *data, const char *name, Elm_Settingspane_Item *par, Elm_Settingspane_Item *rel)
563{ 566{
564 return _elm_settingspane_item_append_full(obj, pd, itc, data, par, rel); 567 return _elm_settingspane_item_append_full(obj, pd, itc, data, name, par, rel);
565} 568}
566 569
567EOLIAN static void 570EOLIAN static void
diff --git a/src/elm_settingspane.eo b/src/elm_settingspane.eo
index b4363d4..a3aedbf 100644
--- a/src/elm_settingspane.eo
+++ b/src/elm_settingspane.eo
@@ -12,6 +12,7 @@ class Elm_Settingspane(Elm_Layout)
12 params { 12 params {
13 @in const(Elm_Settingspane_Item_Class) *itc; 13 @in const(Elm_Settingspane_Item_Class) *itc;
14 @in const(void) *data; 14 @in const(void) *data;
15 @in const(char) *name;
15 @in Elm_Settingspane_Item *par; 16 @in Elm_Settingspane_Item *par;
16 } 17 }
17 } 18 }
@@ -23,6 +24,7 @@ class Elm_Settingspane(Elm_Layout)
23 params { 24 params {
24 @in const(Elm_Settingspane_Item_Class) *itc; 25 @in const(Elm_Settingspane_Item_Class) *itc;
25 @in const(void) *data; 26 @in const(void) *data;
27 @in const(char) *name;
26 @in Elm_Settingspane_Item *par; 28 @in Elm_Settingspane_Item *par;
27 @in Elm_Settingspane_Item *rel; 29 @in Elm_Settingspane_Item *rel;
28 } 30 }