2 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
10 #include <ecore_private.h>
12 #include "Ecore_IMF.h"
13 #include "ecore_imf_private.h"
15 EAPI int ECORE_IMF_EVENT_PREEDIT_START = 0;
16 EAPI int ECORE_IMF_EVENT_PREEDIT_END = 0;
17 EAPI int ECORE_IMF_EVENT_PREEDIT_CHANGED = 0;
18 EAPI int ECORE_IMF_EVENT_COMMIT = 0;
19 EAPI int ECORE_IMF_EVENT_DELETE_SURROUNDING = 0;
21 int _ecore_imf_log_dom = -1;
22 static int _ecore_imf_init_count = 0;
25 * @defgroup Ecore_IMF_Lib_Group Ecore Input Method Library Functions
27 * Utility functions that set up and shut down the Ecore Input Method
32 * Initialises the Ecore_IMF library.
33 * @return Number of times the library has been initialised without being
35 * @ingroup Ecore_IMF_Lib_Group
40 if (++_ecore_imf_init_count != 1)
41 return _ecore_imf_init_count;
44 return --_ecore_imf_init_count;
45 _ecore_imf_log_dom = eina_log_domain_register("EcoreIMF", ECORE_IMF_DEFAULT_LOG_COLOR);
46 if(_ecore_imf_log_dom < 0)
48 EINA_LOG_ERR("Impossible to create a log domain for the Ecore IMF module.");
50 return --_ecore_imf_init_count;
52 ecore_imf_module_init();
54 ECORE_IMF_EVENT_PREEDIT_START = ecore_event_type_new();
55 ECORE_IMF_EVENT_PREEDIT_END = ecore_event_type_new();
56 ECORE_IMF_EVENT_PREEDIT_CHANGED = ecore_event_type_new();
57 ECORE_IMF_EVENT_COMMIT = ecore_event_type_new();
58 ECORE_IMF_EVENT_DELETE_SURROUNDING = ecore_event_type_new();
60 return _ecore_imf_init_count;
64 * Shuts down the Ecore_IMF library.
65 * @return Number of times the library has been initialised without being
67 * @ingroup Ecore_IMF_Lib_Group
70 ecore_imf_shutdown(void)
72 if (--_ecore_imf_init_count != 0)
73 return _ecore_imf_init_count;
76 ecore_imf_module_shutdown();
77 eina_log_domain_unregister(_ecore_imf_log_dom);
78 _ecore_imf_log_dom = -1;
79 return _ecore_imf_init_count;