summaryrefslogtreecommitdiff
path: root/legacy/elementary/src/edje_externals/elm_progressbar.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_progressbar.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 'legacy/elementary/src/edje_externals/elm_progressbar.c')
-rw-r--r--legacy/elementary/src/edje_externals/elm_progressbar.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/legacy/elementary/src/edje_externals/elm_progressbar.c b/legacy/elementary/src/edje_externals/elm_progressbar.c
index f8066d3..d7bdee3 100644
--- a/legacy/elementary/src/edje_externals/elm_progressbar.c
+++ b/legacy/elementary/src/edje_externals/elm_progressbar.c
@@ -3,6 +3,7 @@
3typedef struct _Elm_Params_Progressbar 3typedef struct _Elm_Params_Progressbar
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 *unit; 8 const char *unit;
8 double value; 9 double value;
@@ -24,8 +25,8 @@ external_progressbar_state_set(void *data __UNUSED__, Evas_Object *obj, const vo
24 else if (from_params) p = from_params; 25 else if (from_params) p = from_params;
25 else return; 26 else return;
26 27
27 if (p->base.label) 28 if (p->label)
28 elm_progressbar_label_set(obj, p->base.label); 29 elm_progressbar_label_set(obj, p->label);
29 if (p->icon) 30 if (p->icon)
30 elm_progressbar_icon_set(obj, p->icon); 31 elm_progressbar_icon_set(obj, p->icon);
31 if (p->span_exists) 32 if (p->span_exists)
@@ -178,7 +179,7 @@ external_progressbar_params_parse(void *data __UNUSED__, Evas_Object *obj __UNUS
178 Edje_External_Param *param; 179 Edje_External_Param *param;
179 const Eina_List *l; 180 const Eina_List *l;
180 181
181 mem = external_common_params_parse(Elm_Params_Progressbar, data, obj, params); 182 mem = calloc(1, sizeof(Elm_Params_Progressbar));
182 if (!mem) 183 if (!mem)
183 return NULL; 184 return NULL;
184 185
@@ -208,6 +209,8 @@ external_progressbar_params_parse(void *data __UNUSED__, Evas_Object *obj __UNUS
208 } 209 }
209 else if (!strcmp(param->name, "unit format")) 210 else if (!strcmp(param->name, "unit format"))
210 mem->unit = eina_stringshare_add(param->s); 211 mem->unit = eina_stringshare_add(param->s);
212 else if (!strcmp(param->name, "label"))
213 mem->label = eina_stringshare_add(param->s);
211 } 214 }
212 215
213 return mem; 216 return mem;
@@ -227,11 +230,14 @@ external_progressbar_params_free(void *params)
227 230
228 if (mem->unit) 231 if (mem->unit)
229 eina_stringshare_del(mem->unit); 232 eina_stringshare_del(mem->unit);
230 external_common_params_free(params); 233 if (mem->label)
234 eina_stringshare_del(mem->label);
235 free(params);
231} 236}
232 237
233static Edje_External_Param_Info external_progressbar_params[] = { 238static Edje_External_Param_Info external_progressbar_params[] = {
234 DEFINE_EXTERNAL_COMMON_PARAMS, 239 DEFINE_EXTERNAL_COMMON_PARAMS,
240 EDJE_EXTERNAL_PARAM_INFO_STRING("label"),
235 EDJE_EXTERNAL_PARAM_INFO_STRING("icon"), 241 EDJE_EXTERNAL_PARAM_INFO_STRING("icon"),
236 EDJE_EXTERNAL_PARAM_INFO_DOUBLE("value"), 242 EDJE_EXTERNAL_PARAM_INFO_DOUBLE("value"),
237 EDJE_EXTERNAL_PARAM_INFO_BOOL("horizontal"), 243 EDJE_EXTERNAL_PARAM_INFO_BOOL("horizontal"),