summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-05 16:17:53 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-05 16:17:53 +0000
commit9b5958ce91007a6d6605c01dc475bd8e2ba2dd67 (patch)
treef5dec99cbbe2d64df623014892584137176bf613 /src
parent519a7026811eee3b7a1ace22ec29ecf9ba7a2c7f (diff)
efl/edje: ecore_imf_init() only once.
use technique similar to elementary and delay init() of module, but once you do, do it only once and avoid shutdown() until edje_shutdown(). This is good if we keep creating and deleting edje objects with entry, the count could go to 0 and ecore_imf_shutdown() would unload everything, just to load it soon. SVN revision: 82281
Diffstat (limited to 'src')
-rw-r--r--src/lib/edje/edje_entry.c3
-rw-r--r--src/lib/edje/edje_main.c16
-rw-r--r--src/lib/edje/edje_private.h2
3 files changed, 19 insertions, 2 deletions
diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c
index 67be8b3618..b9f767b25e 100644
--- a/src/lib/edje/edje_entry.c
+++ b/src/lib/edje/edje_entry.c
@@ -2318,7 +2318,7 @@ _edje_entry_real_part_init(Edje_Real_Part *rp)
2318 en->input_panel_enable = EINA_TRUE; 2318 en->input_panel_enable = EINA_TRUE;
2319 2319
2320#ifdef HAVE_ECORE_IMF 2320#ifdef HAVE_ECORE_IMF
2321 ecore_imf_init(); 2321 _edje_need_imf();
2322 2322
2323 edje_object_signal_callback_add(rp->edje->obj, "focus,part,in", rp->part->name, _edje_entry_focus_in_cb, rp); 2323 edje_object_signal_callback_add(rp->edje->obj, "focus,part,in", rp->part->name, _edje_entry_focus_in_cb, rp);
2324 edje_object_signal_callback_add(rp->edje->obj, "focus,part,out", rp->part->name, _edje_entry_focus_out_cb, rp); 2324 edje_object_signal_callback_add(rp->edje->obj, "focus,part,out", rp->part->name, _edje_entry_focus_out_cb, rp);
@@ -2410,7 +2410,6 @@ _edje_entry_real_part_shutdown(Edje_Real_Part *rp)
2410 2410
2411 edje_object_signal_callback_del(rp->edje->obj, "focus,part,in", rp->part->name, _edje_entry_focus_in_cb); 2411 edje_object_signal_callback_del(rp->edje->obj, "focus,part,in", rp->part->name, _edje_entry_focus_in_cb);
2412 edje_object_signal_callback_del(rp->edje->obj, "focus,part,out", rp->part->name, _edje_entry_focus_out_cb); 2412 edje_object_signal_callback_del(rp->edje->obj, "focus,part,out", rp->part->name, _edje_entry_focus_out_cb);
2413 ecore_imf_shutdown();
2414 } 2413 }
2415#endif 2414#endif
2416 _compose_seq_reset(en); 2415 _compose_seq_reset(en);
diff --git a/src/lib/edje/edje_main.c b/src/lib/edje/edje_main.c
index a87d6686e9..f98f8c9263 100644
--- a/src/lib/edje/edje_main.c
+++ b/src/lib/edje/edje_main.c
@@ -7,6 +7,7 @@ static int _edje_init_count = 0;
7int _edje_default_log_dom = -1; 7int _edje_default_log_dom = -1;
8Eina_Mempool *_edje_real_part_mp = NULL; 8Eina_Mempool *_edje_real_part_mp = NULL;
9Eina_Mempool *_edje_real_part_state_mp = NULL; 9Eina_Mempool *_edje_real_part_state_mp = NULL;
10static Eina_Bool _need_imf = EINA_FALSE;
10 11
11/*============================================================================* 12/*============================================================================*
12 * API * 13 * API *
@@ -142,6 +143,11 @@ _edje_shutdown_core(void)
142 _edje_text_class_hash_free(); 143 _edje_text_class_hash_free();
143 _edje_edd_shutdown(); 144 _edje_edd_shutdown();
144 145
146#ifdef HAVE_ECORE_IMF
147 if (_need_imf)
148 ecore_imf_shutdown();
149#endif
150
145#ifdef HAVE_EIO 151#ifdef HAVE_EIO
146 eio_shutdown(); 152 eio_shutdown();
147#endif 153#endif
@@ -293,3 +299,13 @@ _edje_unref(Edje *ed)
293 ed->references--; 299 ed->references--;
294 if (ed->references == 0) _edje_del(ed); 300 if (ed->references == 0) _edje_del(ed);
295} 301}
302
303void
304_edje_need_imf(void)
305{
306 if (_need_imf) return;
307#ifdef HAVE_ECORE_IMF
308 _need_imf = EINA_TRUE;
309 ecore_imf_init();
310#endif
311}
diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h
index 4e44b791a9..a1f27a1d1c 100644
--- a/src/lib/edje/edje_private.h
+++ b/src/lib/edje/edje_private.h
@@ -2260,6 +2260,8 @@ Eina_Module *_edje_module_handle_load(const char *module);
2260void _edje_module_init(void); 2260void _edje_module_init(void);
2261void _edje_module_shutdown(void); 2261void _edje_module_shutdown(void);
2262 2262
2263void _edje_need_imf(void);
2264
2263static inline Eina_Bool 2265static inline Eina_Bool
2264edje_program_is_strncmp(const char *str) 2266edje_program_is_strncmp(const char *str)
2265{ 2267{