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
40 ("ecore_imf", ECORE_IMF_DEFAULT_LOG_COLOR);
41 if (_ecore_imf_log_dom < 0)
43 EINA_LOG_ERR("Impossible to create a log domain for the Ecore IMF module.");
45 return --_ecore_imf_init_count;
47 ecore_imf_module_init();
49 ECORE_IMF_EVENT_PREEDIT_START = ecore_event_type_new();
50 ECORE_IMF_EVENT_PREEDIT_END = ecore_event_type_new();
51 ECORE_IMF_EVENT_PREEDIT_CHANGED = ecore_event_type_new();
52 ECORE_IMF_EVENT_COMMIT = ecore_event_type_new();
53 ECORE_IMF_EVENT_DELETE_SURROUNDING = ecore_event_type_new();
55 return _ecore_imf_init_count;
59 * Shuts down the Ecore_IMF library.
60 * @return Number of times the library has been initialised without being
62 * @ingroup Ecore_IMF_Lib_Group
65 ecore_imf_shutdown(void)
67 if (--_ecore_imf_init_count != 0) return _ecore_imf_init_count;
68 ecore_imf_module_shutdown();
69 eina_log_domain_unregister(_ecore_imf_log_dom);
70 _ecore_imf_log_dom = -1;
72 return _ecore_imf_init_count;