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
This commit is contained in:
Gustavo Sverzut Barbieri 2013-01-05 16:17:53 +00:00
parent 519a702681
commit 9b5958ce91
3 changed files with 19 additions and 2 deletions

View File

@ -2318,7 +2318,7 @@ _edje_entry_real_part_init(Edje_Real_Part *rp)
en->input_panel_enable = EINA_TRUE;
#ifdef HAVE_ECORE_IMF
ecore_imf_init();
_edje_need_imf();
edje_object_signal_callback_add(rp->edje->obj, "focus,part,in", rp->part->name, _edje_entry_focus_in_cb, rp);
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)
edje_object_signal_callback_del(rp->edje->obj, "focus,part,in", rp->part->name, _edje_entry_focus_in_cb);
edje_object_signal_callback_del(rp->edje->obj, "focus,part,out", rp->part->name, _edje_entry_focus_out_cb);
ecore_imf_shutdown();
}
#endif
_compose_seq_reset(en);

View File

@ -7,6 +7,7 @@ static int _edje_init_count = 0;
int _edje_default_log_dom = -1;
Eina_Mempool *_edje_real_part_mp = NULL;
Eina_Mempool *_edje_real_part_state_mp = NULL;
static Eina_Bool _need_imf = EINA_FALSE;
/*============================================================================*
* API *
@ -142,6 +143,11 @@ _edje_shutdown_core(void)
_edje_text_class_hash_free();
_edje_edd_shutdown();
#ifdef HAVE_ECORE_IMF
if (_need_imf)
ecore_imf_shutdown();
#endif
#ifdef HAVE_EIO
eio_shutdown();
#endif
@ -293,3 +299,13 @@ _edje_unref(Edje *ed)
ed->references--;
if (ed->references == 0) _edje_del(ed);
}
void
_edje_need_imf(void)
{
if (_need_imf) return;
#ifdef HAVE_ECORE_IMF
_need_imf = EINA_TRUE;
ecore_imf_init();
#endif
}

View File

@ -2260,6 +2260,8 @@ Eina_Module *_edje_module_handle_load(const char *module);
void _edje_module_init(void);
void _edje_module_shutdown(void);
void _edje_need_imf(void);
static inline Eina_Bool
edje_program_is_strncmp(const char *str)
{