summaryrefslogtreecommitdiff
path: root/src/edje_externals/elm.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2011-01-19 04:55:19 +0000
committerCarsten Haitzler <raster@rasterman.com>2011-01-19 04:55:19 +0000
commitd64a2b5379a3e238494b9539418258413476d482 (patch)
tree7a9553adfb0939dcf523cea4fd03b828e2b6d93d /src/edje_externals/elm.c
parent5a63ccdd6969e9603716c999c9d0f72d45ca6313 (diff)
dont ALWAYS init elm for externals - if one isnt used.. why init it?
(for that matter externals has a problem in design - it loads every module for externals and thus links in every lib even if never used by the app/edje obj). SVN revision: 56218
Diffstat (limited to '')
-rw-r--r--src/edje_externals/elm.c42
1 files changed, 34 insertions, 8 deletions
diff --git a/src/edje_externals/elm.c b/src/edje_externals/elm.c
index 7ed23ab58..ccb6069aa 100644
--- a/src/edje_externals/elm.c
+++ b/src/edje_externals/elm.c
@@ -3,6 +3,38 @@
3 3
4int _elm_log_dom = -1; 4int _elm_log_dom = -1;
5 5
6static int init_count = 0;
7
8void
9external_elm_init(void)
10{
11 int argc = 0;
12 char **argv = NULL;
13
14 init_count++;
15 printf("elm_real_init\n");
16 if (init_count > 1) return;
17 ecore_app_args_get(&argc, &argv);
18 elm_init(argc, argv);
19}
20
21static void
22external_elm_shutdown(void)
23{
24 init_count--;
25 printf("elm_real_shutdown\n");
26 if (init_count > 1) return;
27 elm_shutdown();
28}
29
30static void
31_external_obj_del(void *data __UNUSED__, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
32{
33 evas_object_event_callback_del(obj, EVAS_CALLBACK_DEL,
34 _external_obj_del);
35 external_elm_shutdown();
36}
37
6void 38void
7external_signal(void *data __UNUSED__, Evas_Object *obj, const char *signal, const char *source) 39external_signal(void *data __UNUSED__, Evas_Object *obj, const char *signal, const char *source)
8{ 40{
@@ -133,6 +165,8 @@ external_signals_proxy(Evas_Object *obj, Evas_Object *edje, const char *part_nam
133 evas_object_smart_callback_add 165 evas_object_smart_callback_add
134 (obj, d->name, _external_signal_proxy_cb, ctxt); 166 (obj, d->name, _external_signal_proxy_cb, ctxt);
135 } 167 }
168 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
169 _external_obj_del, NULL);
136} 170}
137 171
138void 172void
@@ -248,12 +282,6 @@ static Edje_External_Type_Info elm_external_types[] =
248static Eina_Bool 282static Eina_Bool
249elm_mod_init(void) 283elm_mod_init(void)
250{ 284{
251 int argc = 0;
252 char **argv = NULL;
253
254 ecore_app_args_get(&argc, &argv);
255 elm_init(argc, argv);
256
257 _elm_log_dom = eina_log_domain_register("elm-externals", EINA_COLOR_LIGHTBLUE); 285 _elm_log_dom = eina_log_domain_register("elm-externals", EINA_COLOR_LIGHTBLUE);
258 edje_external_type_array_register(elm_external_types); 286 edje_external_type_array_register(elm_external_types);
259 return EINA_TRUE; 287 return EINA_TRUE;
@@ -263,11 +291,9 @@ static void
263elm_mod_shutdown(void) 291elm_mod_shutdown(void)
264{ 292{
265 edje_external_type_array_unregister(elm_external_types); 293 edje_external_type_array_unregister(elm_external_types);
266
267 eina_log_domain_unregister(_elm_log_dom); 294 eina_log_domain_unregister(_elm_log_dom);
268 _elm_log_dom = -1; 295 _elm_log_dom = -1;
269 296
270 elm_shutdown();
271} 297}
272 298
273EINA_MODULE_INIT(elm_mod_init); 299EINA_MODULE_INIT(elm_mod_init);