2007-11-19 10:27:11 -08:00
|
|
|
/*
|
|
|
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
|
|
|
*/
|
|
|
|
|
2009-01-31 10:33:39 -08:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <Ecore.h>
|
2009-03-10 15:44:36 -07:00
|
|
|
#include <ecore_private.h>
|
2007-11-19 10:27:11 -08:00
|
|
|
|
|
|
|
#include "Ecore_IMF.h"
|
2007-11-22 03:55:35 -08:00
|
|
|
#include "ecore_imf_private.h"
|
|
|
|
|
2007-11-19 10:27:11 -08:00
|
|
|
EAPI int ECORE_IMF_EVENT_PREEDIT_START = 0;
|
|
|
|
EAPI int ECORE_IMF_EVENT_PREEDIT_END = 0;
|
|
|
|
EAPI int ECORE_IMF_EVENT_PREEDIT_CHANGED = 0;
|
|
|
|
EAPI int ECORE_IMF_EVENT_COMMIT = 0;
|
2007-12-12 11:00:48 -08:00
|
|
|
EAPI int ECORE_IMF_EVENT_DELETE_SURROUNDING = 0;
|
2007-11-19 10:27:11 -08:00
|
|
|
|
2009-10-09 22:28:43 -07:00
|
|
|
static int _ecore_imf_init_count = 0;
|
2007-11-19 10:27:11 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @defgroup Ecore_IMF_Lib_Group Ecore Input Method Library Functions
|
|
|
|
*
|
|
|
|
* Utility functions that set up and shut down the Ecore Input Method
|
|
|
|
* library.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialises the Ecore_IMF library.
|
|
|
|
* @return Number of times the library has been initialised without being
|
|
|
|
* shut down.
|
|
|
|
* @ingroup Ecore_IMF_Lib_Group
|
|
|
|
*/
|
|
|
|
EAPI int
|
|
|
|
ecore_imf_init(void)
|
|
|
|
{
|
2009-10-09 22:28:43 -07:00
|
|
|
if (++_ecore_imf_init_count != 1)
|
|
|
|
return _ecore_imf_init_count;
|
|
|
|
|
|
|
|
if (!ecore_init())
|
|
|
|
return --_ecore_imf_init_count;
|
2007-11-19 10:27:11 -08:00
|
|
|
|
|
|
|
ecore_imf_module_init();
|
|
|
|
|
|
|
|
ECORE_IMF_EVENT_PREEDIT_START = ecore_event_type_new();
|
|
|
|
ECORE_IMF_EVENT_PREEDIT_END = ecore_event_type_new();
|
|
|
|
ECORE_IMF_EVENT_PREEDIT_CHANGED = ecore_event_type_new();
|
|
|
|
ECORE_IMF_EVENT_COMMIT = ecore_event_type_new();
|
2007-12-12 11:00:48 -08:00
|
|
|
ECORE_IMF_EVENT_DELETE_SURROUNDING = ecore_event_type_new();
|
2007-11-19 10:27:11 -08:00
|
|
|
|
2009-10-09 22:28:43 -07:00
|
|
|
return _ecore_imf_init_count;
|
2007-11-19 10:27:11 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Shuts down the Ecore_IMF library.
|
|
|
|
* @return Number of times the library has been initialised without being
|
|
|
|
* shut down.
|
|
|
|
* @ingroup Ecore_IMF_Lib_Group
|
|
|
|
*/
|
|
|
|
EAPI int
|
|
|
|
ecore_imf_shutdown(void)
|
|
|
|
{
|
2009-10-09 22:28:43 -07:00
|
|
|
if (--_ecore_imf_init_count != 0)
|
|
|
|
return _ecore_imf_init_count;
|
2007-11-19 10:27:11 -08:00
|
|
|
|
|
|
|
ecore_shutdown();
|
|
|
|
ecore_imf_module_shutdown();
|
|
|
|
|
2009-10-09 22:28:43 -07:00
|
|
|
return _ecore_imf_init_count;
|
2007-11-19 10:27:11 -08:00
|
|
|
}
|