summaryrefslogtreecommitdiff
path: root/src/edje_externals/elm.c
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2014-01-23 20:08:10 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2014-01-23 22:36:41 +0900
commit46c51ecec7d886cf079e197840b158a396a20e83 (patch)
treefe1f59c37c8c197b8ca80821e0b34fd58671ee29 /src/edje_externals/elm.c
parentfd5a62d31d50bf9ba60f2b4c55c05f7117c6622d (diff)
edje_externals: Fixed formatting before working on it.
Diffstat (limited to 'src/edje_externals/elm.c')
-rw-r--r--src/edje_externals/elm.c64
1 files changed, 39 insertions, 25 deletions
diff --git a/src/edje_externals/elm.c b/src/edje_externals/elm.c
index f2016c17d..54bbb3baf 100644
--- a/src/edje_externals/elm.c
+++ b/src/edje_externals/elm.c
@@ -32,7 +32,8 @@ external_elm_shutdown(void)
32} 32}
33 33
34static void 34static void
35_external_obj_del(void *data EINA_UNUSED, Evas *evas EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) 35_external_obj_del(void *data EINA_UNUSED, Evas *evas EINA_UNUSED,
36 Evas_Object *obj, void *event_info EINA_UNUSED)
36{ 37{
37 evas_object_event_callback_del(obj, EVAS_CALLBACK_DEL, 38 evas_object_event_callback_del(obj, EVAS_CALLBACK_DEL,
38 _external_obj_del); 39 _external_obj_del);
@@ -40,7 +41,8 @@ _external_obj_del(void *data EINA_UNUSED, Evas *evas EINA_UNUSED, Evas_Object *o
40} 41}
41 42
42void 43void
43external_signal(void *data EINA_UNUSED, Evas_Object *obj, const char *sig, const char *source) 44external_signal(void *data EINA_UNUSED, Evas_Object *obj, const char *sig,
45 const char *source)
44{ 46{
45 char *_signal = strdup(sig); 47 char *_signal = strdup(sig);
46 char *p = _signal; 48 char *p = _signal;
@@ -90,14 +92,17 @@ typedef struct {
90} Elm_External_Signals_Proxy_Context; 92} Elm_External_Signals_Proxy_Context;
91 93
92static void 94static void
93_external_signal_proxy_free_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 95_external_signal_proxy_free_cb(void *data, Evas *e EINA_UNUSED,
96 Evas_Object *obj EINA_UNUSED,
97 void *event_info EINA_UNUSED)
94{ 98{
95 Elm_External_Signals_Proxy_Context *ctxt = data; 99 Elm_External_Signals_Proxy_Context *ctxt = data;
96 free(ctxt); 100 free(ctxt);
97} 101}
98 102
99static void 103static void
100_external_signal_proxy_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 104_external_signal_proxy_cb(void *data, Evas_Object *obj EINA_UNUSED,
105 void *event_info EINA_UNUSED)
101{ 106{
102 Elm_External_Signals_Proxy_Context *ctxt = data; 107 Elm_External_Signals_Proxy_Context *ctxt = data;
103 // TODO: Is it worth to check Evas_Smart_Cb_Description and do something 108 // TODO: Is it worth to check Evas_Smart_Cb_Description and do something
@@ -106,7 +111,8 @@ _external_signal_proxy_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_
106} 111}
107 112
108Eina_Bool 113Eina_Bool
109external_common_param_get(void *data EINA_UNUSED, const Evas_Object *obj, Edje_External_Param *param) 114external_common_param_get(void *data EINA_UNUSED, const Evas_Object *obj,
115 Edje_External_Param *param)
110{ 116{
111 if (!strcmp(param->name, "style")) 117 if (!strcmp(param->name, "style"))
112 { 118 {
@@ -128,7 +134,8 @@ external_common_param_get(void *data EINA_UNUSED, const Evas_Object *obj, Edje_E
128} 134}
129 135
130Eina_Bool 136Eina_Bool
131external_common_param_set(void *data EINA_UNUSED, Evas_Object *obj, const Edje_External_Param *param) 137external_common_param_set(void *data EINA_UNUSED, Evas_Object *obj,
138 const Edje_External_Param *param)
132{ 139{
133 if (!strcmp(param->name, "style")) 140 if (!strcmp(param->name, "style"))
134 { 141 {
@@ -168,29 +175,31 @@ external_signals_proxy(Evas_Object *obj, Evas_Object *edje, const char *part_nam
168 175
169 for (; cls_count > 0; cls_count--, cls_descs++, ctxt++) 176 for (; cls_count > 0; cls_count--, cls_descs++, ctxt++)
170 { 177 {
171 const Evas_Smart_Cb_Description *d = *cls_descs; 178 const Evas_Smart_Cb_Description *d = *cls_descs;
172 ctxt->emission = d->name; 179 ctxt->emission = d->name;
173 ctxt->source = part_name; 180 ctxt->source = part_name;
174 ctxt->edje = edje; 181 ctxt->edje = edje;
175 evas_object_smart_callback_add 182 evas_object_smart_callback_add
176 (obj, d->name, _external_signal_proxy_cb, ctxt); 183 (obj, d->name, _external_signal_proxy_cb, ctxt);
177 } 184 }
178 185
179 for (; inst_count > 0; inst_count--, inst_descs++, ctxt++) 186 for (; inst_count > 0; inst_count--, inst_descs++, ctxt++)
180 { 187 {
181 const Evas_Smart_Cb_Description *d = *inst_descs; 188 const Evas_Smart_Cb_Description *d = *inst_descs;
182 ctxt->emission = d->name; 189 ctxt->emission = d->name;
183 ctxt->source = part_name; 190 ctxt->source = part_name;
184 ctxt->edje = edje; 191 ctxt->edje = edje;
185 evas_object_smart_callback_add 192 evas_object_smart_callback_add
186 (obj, d->name, _external_signal_proxy_cb, ctxt); 193 (obj, d->name, _external_signal_proxy_cb, ctxt);
187 } 194 }
188 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, 195 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
189 _external_obj_del, NULL); 196 _external_obj_del, NULL);
190} 197}
191 198
192void 199void
193external_common_params_parse(void *mem, void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, const Eina_List *params) 200external_common_params_parse(void *mem, void *data EINA_UNUSED,
201 Evas_Object *obj EINA_UNUSED,
202 const Eina_List *params)
194{ 203{
195 Elm_Params *p; 204 Elm_Params *p;
196 const Eina_List *l; 205 const Eina_List *l;
@@ -210,7 +219,9 @@ external_common_params_parse(void *mem, void *data EINA_UNUSED, Evas_Object *obj
210} 219}
211 220
212void 221void
213external_common_state_set(void *data EINA_UNUSED, Evas_Object *obj, const void *from_params, const void *to_params, float pos EINA_UNUSED) 222external_common_state_set(void *data EINA_UNUSED, Evas_Object *obj,
223 const void *from_params, const void *to_params,
224 float pos EINA_UNUSED)
214{ 225{
215 const Elm_Params *p; 226 const Elm_Params *p;
216 if (to_params) p = to_params; 227 if (to_params) p = to_params;
@@ -252,14 +263,16 @@ external_common_param_icon_get(Evas_Object *obj, const Edje_External_Param *p)
252} 263}
253 264
254void 265void
255external_common_icon_param_parse(Evas_Object **icon, Evas_Object *obj, const Eina_List *params) 266external_common_icon_param_parse(Evas_Object **icon, Evas_Object *obj,
267 const Eina_List *params)
256{ 268{
257 Edje_External_Param *p = edje_external_param_find(params, "icon"); 269 Edje_External_Param *p = edje_external_param_find(params, "icon");
258 *icon = external_common_param_icon_get(obj, p); 270 *icon = external_common_param_icon_get(obj, p);
259} 271}
260 272
261Evas_Object * 273Evas_Object *
262external_common_param_edje_object_get(Evas_Object *obj, const Edje_External_Param *p) 274external_common_param_edje_object_get(Evas_Object *obj,
275 const Edje_External_Param *p)
263{ 276{
264 Evas_Object *edje, *parent_widget, *ret; 277 Evas_Object *edje, *parent_widget, *ret;
265 const char *file; 278 const char *file;
@@ -299,16 +312,17 @@ external_common_params_free(void *params)
299static Edje_External_Type_Info elm_external_types[] = 312static Edje_External_Type_Info elm_external_types[] =
300{ 313{
301#define DEFINE_TYPE(type_name) \ 314#define DEFINE_TYPE(type_name) \
302 {"elm/"#type_name, &external_##type_name##_type}, 315 { "elm/"#type_name, &external_##type_name##_type },
303#include "modules.inc" 316#include "modules.inc"
304#undef DEFINE_TYPE 317#undef DEFINE_TYPE
305 {NULL, NULL} 318 { NULL, NULL }
306}; 319};
307 320
308static Eina_Bool 321static Eina_Bool
309elm_mod_init(void) 322elm_mod_init(void)
310{ 323{
311 _elm_ext_log_dom = eina_log_domain_register("elm-externals", EINA_COLOR_LIGHTBLUE); 324 _elm_ext_log_dom = eina_log_domain_register("elm-externals",
325 EINA_COLOR_LIGHTBLUE);
312 edje_external_type_array_register(elm_external_types); 326 edje_external_type_array_register(elm_external_types);
313 return EINA_TRUE; 327 return EINA_TRUE;
314} 328}