6 #include <ecore_private.h>
9 #include "ecore_imf_private.h"
11 EAPI int ECORE_IMF_EVENT_PREEDIT_START = 0;
12 EAPI int ECORE_IMF_EVENT_PREEDIT_END = 0;
13 EAPI int ECORE_IMF_EVENT_PREEDIT_CHANGED = 0;
14 EAPI int ECORE_IMF_EVENT_COMMIT = 0;
15 EAPI int ECORE_IMF_EVENT_DELETE_SURROUNDING = 0;
17 int _ecore_imf_log_dom = -1;
18 static int _ecore_imf_init_count = 0;
21 * @defgroup Ecore_IMF_Lib_Group Ecore Input Method Library Functions
23 * Utility functions that set up and shut down the Ecore Input Method
28 * Initialises the Ecore_IMF library.
29 * @return Number of times the library has been initialised without being
31 * @ingroup Ecore_IMF_Lib_Group
36 if (++_ecore_imf_init_count != 1) return _ecore_imf_init_count;
38 if (!ecore_init()) return --_ecore_imf_init_count;
39 _ecore_imf_log_dom = eina_log_domain_register("EcoreIMF", ECORE_IMF_DEFAULT_LOG_COLOR);
40 if (_ecore_imf_log_dom < 0)
42 EINA_LOG_ERR("Impossible to create a log domain for the Ecore IMF module.");
44 return --_ecore_imf_init_count;
46 ecore_imf_module_init();
48 ECORE_IMF_EVENT_PREEDIT_START = ecore_event_type_new();
49 ECORE_IMF_EVENT_PREEDIT_END = ecore_event_type_new();
50 ECORE_IMF_EVENT_PREEDIT_CHANGED = ecore_event_type_new();
51 ECORE_IMF_EVENT_COMMIT = ecore_event_type_new();
52 ECORE_IMF_EVENT_DELETE_SURROUNDING = ecore_event_type_new();
54 return _ecore_imf_init_count;
58 * Shuts down the Ecore_IMF library.
59 * @return Number of times the library has been initialised without being
61 * @ingroup Ecore_IMF_Lib_Group
64 ecore_imf_shutdown(void)
66 if (--_ecore_imf_init_count != 0) return _ecore_imf_init_count;
67 ecore_imf_module_shutdown();
68 eina_log_domain_unregister(_ecore_imf_log_dom);
69 _ecore_imf_log_dom = -1;
71 return _ecore_imf_init_count;