summaryrefslogtreecommitdiff
path: root/legacy/elementary/src/edje_externals/elm_radio.c
diff options
context:
space:
mode:
authorIván Briano <sachieru@gmail.com>2009-12-09 04:37:48 +0000
committerIván Briano <sachieru@gmail.com>2009-12-09 04:37:48 +0000
commitbf5af093fa4ff59cd9c19f3e7c833f481ebca8ad (patch)
tree4ccf9ff6676d11f7615fb0c7f2e9e01e792c2b39 /legacy/elementary/src/edje_externals/elm_radio.c
parent0c8c7266014756466950aff669c5ae34918e1bc0 (diff)
style, better parsing, some parameter names changed
SVN revision: 44302
Diffstat (limited to '')
-rw-r--r--legacy/elementary/src/edje_externals/elm_radio.c45
1 files changed, 23 insertions, 22 deletions
diff --git a/legacy/elementary/src/edje_externals/elm_radio.c b/legacy/elementary/src/edje_externals/elm_radio.c
index c74f82a..7c3c068 100644
--- a/legacy/elementary/src/edje_externals/elm_radio.c
+++ b/legacy/elementary/src/edje_externals/elm_radio.c
@@ -18,17 +18,17 @@ external_radio_state_set(void *data, Evas_Object *obj, const void *from_params,
18 18
19 if (!p2) 19 if (!p2)
20 { 20 {
21 elm_radio_label_set(obj, p1->base.label); 21 elm_radio_label_set(obj, p1->base.label);
22 elm_radio_icon_set(obj, p1->icon); 22 elm_radio_icon_set(obj, p1->icon);
23 elm_radio_state_value_set(obj, p1->state); 23 elm_radio_state_value_set(obj, p1->state);
24 if (p1->group_name) 24 if (p1->group_name)
25 { 25 {
26 Evas_Object *ed = evas_object_smart_parent_get(obj); 26 Evas_Object *ed = evas_object_smart_parent_get(obj);
27 Evas_Object *group = edje_object_part_swallow_get(ed, p1->group_name); 27 Evas_Object *group = edje_object_part_swallow_get(ed, p1->group_name);
28 if (group) 28 if (group)
29 elm_radio_group_add(obj, group); 29 elm_radio_group_add(obj, group);
30 } 30 }
31 return; 31 return;
32 } 32 }
33 33
34 elm_radio_label_set(obj, p2->base.label); 34 elm_radio_label_set(obj, p2->base.label);
@@ -36,9 +36,9 @@ external_radio_state_set(void *data, Evas_Object *obj, const void *from_params,
36 elm_radio_state_value_set(obj, p2->state); 36 elm_radio_state_value_set(obj, p2->state);
37 if (p2->group_name) 37 if (p2->group_name)
38 { 38 {
39 Evas_Object *ed = evas_object_smart_parent_get(obj); 39 Evas_Object *ed = evas_object_smart_parent_get(obj);
40 Evas_Object *group = edje_object_part_swallow_get(ed, p2->group_name); 40 Evas_Object *group = edje_object_part_swallow_get(ed, p2->group_name);
41 elm_radio_group_add(obj, group); 41 elm_radio_group_add(obj, group);
42 } 42 }
43} 43}
44 44
@@ -47,6 +47,7 @@ external_radio_params_parse(void *data, Evas_Object *obj, const Eina_List *param
47{ 47{
48 Elm_Params_Radio *mem; 48 Elm_Params_Radio *mem;
49 Edje_External_Param *param; 49 Edje_External_Param *param;
50 const Eina_List *l;
50 51
51 mem = external_common_params_parse(Elm_Params_Radio, data, obj, params); 52 mem = external_common_params_parse(Elm_Params_Radio, data, obj, params);
52 if (!mem) 53 if (!mem)
@@ -54,13 +55,13 @@ external_radio_params_parse(void *data, Evas_Object *obj, const Eina_List *param
54 55
55 external_common_icon_param_parse(&mem->icon, obj, params); 56 external_common_icon_param_parse(&mem->icon, obj, params);
56 57
57 param = edje_external_param_find(params, "group"); 58 EINA_LIST_FOREACH(params, l, param)
58 if (param) 59 {
59 mem->group_name = eina_stringshare_add(param->s); 60 if (!strcmp(param->name, "group"))
60 61 mem->group_name = eina_stringshare_add(param->s);
61 param = edje_external_param_find(params, "state"); 62 else if (!strcmp(param->name, "value"))
62 if (param) 63 mem->state = param->i;
63 mem->state = param->i; 64 }
64 65
65 return mem; 66 return mem;
66} 67}
@@ -81,7 +82,7 @@ static Edje_External_Param_Info external_radio_params[] = {
81 DEFINE_EXTERNAL_COMMON_PARAMS, 82 DEFINE_EXTERNAL_COMMON_PARAMS,
82 EDJE_EXTERNAL_PARAM_INFO_STRING("icon"), 83 EDJE_EXTERNAL_PARAM_INFO_STRING("icon"),
83 EDJE_EXTERNAL_PARAM_INFO_STRING("group"), 84 EDJE_EXTERNAL_PARAM_INFO_STRING("group"),
84 EDJE_EXTERNAL_PARAM_INFO_INT("state"), 85 EDJE_EXTERNAL_PARAM_INFO_INT("value"),
85 EDJE_EXTERNAL_PARAM_INFO_SENTINEL 86 EDJE_EXTERNAL_PARAM_INFO_SENTINEL
86}; 87};
87 88