summaryrefslogtreecommitdiff
path: root/legacy/elementary/src/edje_externals/elm_radio.c
diff options
context:
space:
mode:
authorOtavio Pontes <otavio@profusion.mobi>2010-10-21 22:03:43 +0000
committerLucas De Marchi <lucas.demarchi@profusion.mobi>2010-10-21 22:03:43 +0000
commitc11bf5692a9ca61033b1f46b7a3f00bee1e5c3cd (patch)
treeb98f93b8aeb00ebac7473ed173539b44dadddf97 /legacy/elementary/src/edje_externals/elm_radio.c
parentca157edc920772232ad42a01d4c37837a710b921 (diff)
Add support for changing style from one elm widget in edje external.
Create a param 'style' that can be used in edje external to change the style of one object. Patch by: Otavio Pontes <otavio@profusion.mobi> SVN revision: 53754
Diffstat (limited to '')
-rw-r--r--legacy/elementary/src/edje_externals/elm_radio.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/legacy/elementary/src/edje_externals/elm_radio.c b/legacy/elementary/src/edje_externals/elm_radio.c
index 31aa3f7..3e010c2 100644
--- a/legacy/elementary/src/edje_externals/elm_radio.c
+++ b/legacy/elementary/src/edje_externals/elm_radio.c
@@ -3,6 +3,7 @@
3typedef struct _Elm_Params_Radio 3typedef struct _Elm_Params_Radio
4{ 4{
5 Elm_Params base; 5 Elm_Params base;
6 const char *label;
6 Evas_Object *icon; 7 Evas_Object *icon;
7 const char* group_name; 8 const char* group_name;
8 int value; 9 int value;
@@ -18,8 +19,8 @@ external_radio_state_set(void *data __UNUSED__, Evas_Object *obj, const void *fr
18 else if (from_params) p = from_params; 19 else if (from_params) p = from_params;
19 else return; 20 else return;
20 21
21 if (p->base.label) 22 if (p->label)
22 elm_radio_label_set(obj, p->base.label); 23 elm_radio_label_set(obj, p->label);
23 if (p->icon) 24 if (p->icon)
24 elm_radio_icon_set(obj, p->icon); 25 elm_radio_icon_set(obj, p->icon);
25 if (p->value_exists) 26 if (p->value_exists)
@@ -121,7 +122,7 @@ external_radio_params_parse(void *data, Evas_Object *obj, const Eina_List *param
121 Edje_External_Param *param; 122 Edje_External_Param *param;
122 const Eina_List *l; 123 const Eina_List *l;
123 124
124 mem = external_common_params_parse(Elm_Params_Radio, data, obj, params); 125 mem = calloc(1, sizeof(Elm_Params_Radio));
125 if (!mem) 126 if (!mem)
126 return NULL; 127 return NULL;
127 128
@@ -136,6 +137,8 @@ external_radio_params_parse(void *data, Evas_Object *obj, const Eina_List *param
136 mem->value = param->i; 137 mem->value = param->i;
137 mem->value_exists = EINA_TRUE; 138 mem->value_exists = EINA_TRUE;
138 } 139 }
140 else if (!strcmp(param->name, "label"))
141 mem->label = eina_stringshare_add(param->s);
139 } 142 }
140 143
141 return mem; 144 return mem;
@@ -155,11 +158,14 @@ external_radio_params_free(void *params)
155 158
156 if (mem->group_name) 159 if (mem->group_name)
157 eina_stringshare_del(mem->group_name); 160 eina_stringshare_del(mem->group_name);
158 external_common_params_free(params); 161 if (mem->label)
162 eina_stringshare_del(mem->label);
163 free(params);
159} 164}
160 165
161static Edje_External_Param_Info external_radio_params[] = { 166static Edje_External_Param_Info external_radio_params[] = {
162 DEFINE_EXTERNAL_COMMON_PARAMS, 167 DEFINE_EXTERNAL_COMMON_PARAMS,
168 EDJE_EXTERNAL_PARAM_INFO_STRING("label"),
163 EDJE_EXTERNAL_PARAM_INFO_STRING("icon"), 169 EDJE_EXTERNAL_PARAM_INFO_STRING("icon"),
164 EDJE_EXTERNAL_PARAM_INFO_STRING("group"), 170 EDJE_EXTERNAL_PARAM_INFO_STRING("group"),
165 EDJE_EXTERNAL_PARAM_INFO_INT("value"), 171 EDJE_EXTERNAL_PARAM_INFO_INT("value"),