aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/ecore/src/modules/immodules/scim
diff options
context:
space:
mode:
authorDavid Walter Seikel2013-01-13 17:29:19 +1000
committerDavid Walter Seikel2013-01-13 17:29:19 +1000
commit07274513e984f0b5544586c74508ccd16e7dcafa (patch)
treeb32ff2a9136fbc1a4a6a0ed1e4d79cde0f5f16d9 /libraries/ecore/src/modules/immodules/scim
parentAdded Irrlicht 1.8, but without all the Windows binaries. (diff)
downloadSledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.zip
SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.tar.gz
SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.tar.bz2
SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.tar.xz
Remove EFL, since it's been released now.
Diffstat (limited to 'libraries/ecore/src/modules/immodules/scim')
-rw-r--r--libraries/ecore/src/modules/immodules/scim/Makefile.am36
-rw-r--r--libraries/ecore/src/modules/immodules/scim/Makefile.in853
-rw-r--r--libraries/ecore/src/modules/immodules/scim/scim_imcontext.cpp2895
-rw-r--r--libraries/ecore/src/modules/immodules/scim/scim_imcontext.h42
-rw-r--r--libraries/ecore/src/modules/immodules/scim/scim_module.cpp98
5 files changed, 0 insertions, 3924 deletions
diff --git a/libraries/ecore/src/modules/immodules/scim/Makefile.am b/libraries/ecore/src/modules/immodules/scim/Makefile.am
deleted file mode 100644
index 40579ca..0000000
--- a/libraries/ecore/src/modules/immodules/scim/Makefile.am
+++ /dev/null
@@ -1,36 +0,0 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3AM_CPPFLAGS = \
4-I$(top_srcdir) \
5-I$(top_srcdir)/src/lib/ecore \
6-I$(top_srcdir)/src/lib/ecore_input \
7-I$(top_srcdir)/src/lib/ecore_x \
8-I$(top_srcdir)/src/lib/ecore_imf \
9-I$(top_srcdir)/src/lib/ecore_evas \
10-I$(top_builddir)/src/lib/ecore \
11-I$(top_builddir)/src/lib/ecore_input \
12-I$(top_builddir)/src/lib/ecore_x \
13-I$(top_builddir)/src/lib/ecore_imf \
14-I$(top_builddir)/src/lib/ecore_evas \
15-DPACKAGE_LIB_DIR=\"$(libdir)\" \
16-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
17@SCIM_CFLAGS@ \
18@EVAS_CFLAGS@ \
19@EINA_CFLAGS@
20
21pkgdir = $(libdir)/ecore/immodules
22
23pkg_LTLIBRARIES = scim.la
24scim_la_SOURCES = \
25scim_imcontext.cpp \
26scim_module.cpp \
27scim_imcontext.h
28
29scim_la_LIBADD = \
30 $(top_builddir)/src/lib/ecore_imf/libecore_imf.la \
31 $(top_builddir)/src/lib/ecore_x/libecore_x.la \
32 @SCIM_LIBS@ \
33 @EVAS_LIBS@ \
34 @EINA_LIBS@
35scim_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
36scim_la_LIBTOOLFLAGS = --tag=disable-static
diff --git a/libraries/ecore/src/modules/immodules/scim/Makefile.in b/libraries/ecore/src/modules/immodules/scim/Makefile.in
deleted file mode 100644
index ae6fc7d..0000000
--- a/libraries/ecore/src/modules/immodules/scim/Makefile.in
+++ /dev/null
@@ -1,853 +0,0 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17
18VPATH = @srcdir@
19pkgdatadir = $(datadir)/@PACKAGE@
20pkgincludedir = $(includedir)/@PACKAGE@
21pkglibdir = $(libdir)/@PACKAGE@
22pkglibexecdir = $(libexecdir)/@PACKAGE@
23am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
24install_sh_DATA = $(install_sh) -c -m 644
25install_sh_PROGRAM = $(install_sh) -c
26install_sh_SCRIPT = $(install_sh) -c
27INSTALL_HEADER = $(INSTALL_DATA)
28transform = $(program_transform_name)
29NORMAL_INSTALL = :
30PRE_INSTALL = :
31POST_INSTALL = :
32NORMAL_UNINSTALL = :
33PRE_UNINSTALL = :
34POST_UNINSTALL = :
35build_triplet = @build@
36host_triplet = @host@
37subdir = src/modules/immodules/scim
38DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
39ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
40am__aclocal_m4_deps = $(top_srcdir)/m4/ac_attribute.m4 \
41 $(top_srcdir)/m4/ac_path_generic.m4 \
42 $(top_srcdir)/m4/check_x_extension.m4 \
43 $(top_srcdir)/m4/ecore_check_module.m4 \
44 $(top_srcdir)/m4/ecore_check_options.m4 \
45 $(top_srcdir)/m4/efl_compiler_flag.m4 \
46 $(top_srcdir)/m4/efl_doxygen.m4 \
47 $(top_srcdir)/m4/efl_examples.m4 \
48 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \
49 $(top_srcdir)/m4/efl_threads.m4 $(top_srcdir)/m4/gettext.m4 \
50 $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
51 $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
52 $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
53 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
54 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
55 $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
56 $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac
57am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
58 $(ACLOCAL_M4)
59mkinstalldirs = $(install_sh) -d
60CONFIG_HEADER = $(top_builddir)/config.h
61CONFIG_CLEAN_FILES =
62CONFIG_CLEAN_VPATH_FILES =
63am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
64am__vpath_adj = case $$p in \
65 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
66 *) f=$$p;; \
67 esac;
68am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
69am__install_max = 40
70am__nobase_strip_setup = \
71 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
72am__nobase_strip = \
73 for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
74am__nobase_list = $(am__nobase_strip_setup); \
75 for p in $$list; do echo "$$p $$p"; done | \
76 sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
77 $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
78 if (++n[$$2] == $(am__install_max)) \
79 { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
80 END { for (dir in files) print dir, files[dir] }'
81am__base_list = \
82 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
83 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
84am__installdirs = "$(DESTDIR)$(pkgdir)"
85LTLIBRARIES = $(pkg_LTLIBRARIES)
86scim_la_DEPENDENCIES = \
87 $(top_builddir)/src/lib/ecore_imf/libecore_imf.la \
88 $(top_builddir)/src/lib/ecore_x/libecore_x.la
89am_scim_la_OBJECTS = scim_la-scim_imcontext.lo scim_la-scim_module.lo
90scim_la_OBJECTS = $(am_scim_la_OBJECTS)
91AM_V_lt = $(am__v_lt_$(V))
92am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
93am__v_lt_0 = --silent
94scim_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(scim_la_LIBTOOLFLAGS) \
95 $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
96 $(CXXFLAGS) $(scim_la_LDFLAGS) $(LDFLAGS) -o $@
97DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
98depcomp = $(SHELL) $(top_srcdir)/depcomp
99am__depfiles_maybe = depfiles
100am__mv = mv -f
101CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
102 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
103LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
104 $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
105 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
106 $(AM_CXXFLAGS) $(CXXFLAGS)
107AM_V_CXX = $(am__v_CXX_$(V))
108am__v_CXX_ = $(am__v_CXX_$(AM_DEFAULT_VERBOSITY))
109am__v_CXX_0 = @echo " CXX " $@;
110AM_V_at = $(am__v_at_$(V))
111am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
112am__v_at_0 = @
113CXXLD = $(CXX)
114CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
115 $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
116 $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
117AM_V_CXXLD = $(am__v_CXXLD_$(V))
118am__v_CXXLD_ = $(am__v_CXXLD_$(AM_DEFAULT_VERBOSITY))
119am__v_CXXLD_0 = @echo " CXXLD " $@;
120COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
121 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
122LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
123 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
124 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
125 $(AM_CFLAGS) $(CFLAGS)
126AM_V_CC = $(am__v_CC_$(V))
127am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
128am__v_CC_0 = @echo " CC " $@;
129CCLD = $(CC)
130LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
131 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
132 $(AM_LDFLAGS) $(LDFLAGS) -o $@
133AM_V_CCLD = $(am__v_CCLD_$(V))
134am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
135am__v_CCLD_0 = @echo " CCLD " $@;
136AM_V_GEN = $(am__v_GEN_$(V))
137am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
138am__v_GEN_0 = @echo " GEN " $@;
139SOURCES = $(scim_la_SOURCES)
140DIST_SOURCES = $(scim_la_SOURCES)
141ETAGS = etags
142CTAGS = ctags
143DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
144ACLOCAL = @ACLOCAL@
145ALLOCA = @ALLOCA@
146AMTAR = @AMTAR@
147AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
148AR = @AR@
149AS = @AS@
150AUTOCONF = @AUTOCONF@
151AUTOHEADER = @AUTOHEADER@
152AUTOMAKE = @AUTOMAKE@
153AWK = @AWK@
154CARES_CFLAGS = @CARES_CFLAGS@
155CARES_LIBS = @CARES_LIBS@
156CC = @CC@
157CCDEPMODE = @CCDEPMODE@
158CFLAGS = @CFLAGS@
159CHECK_CFLAGS = @CHECK_CFLAGS@
160CHECK_LIBS = @CHECK_LIBS@
161CPP = @CPP@
162CPPFLAGS = @CPPFLAGS@
163CURL_CFLAGS = @CURL_CFLAGS@
164CURL_LIBS = @CURL_LIBS@
165CXX = @CXX@
166CXXCPP = @CXXCPP@
167CXXDEPMODE = @CXXDEPMODE@
168CXXFLAGS = @CXXFLAGS@
169CYGPATH_W = @CYGPATH_W@
170DEFS = @DEFS@
171DEPDIR = @DEPDIR@
172DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@
173DIRECTFB_LIBS = @DIRECTFB_LIBS@
174DLLTOOL = @DLLTOOL@
175DSYMUTIL = @DSYMUTIL@
176DUMPBIN = @DUMPBIN@
177ECHO_C = @ECHO_C@
178ECHO_N = @ECHO_N@
179ECHO_T = @ECHO_T@
180ECORE_XCB_CFLAGS = @ECORE_XCB_CFLAGS@
181ECORE_XCB_LIBS = @ECORE_XCB_LIBS@
182EFL_ECORE_BUILD = @EFL_ECORE_BUILD@
183EFL_ECORE_CON_BUILD = @EFL_ECORE_CON_BUILD@
184EFL_ECORE_EVAS_BUILD = @EFL_ECORE_EVAS_BUILD@
185EFL_ECORE_FILE_BUILD = @EFL_ECORE_FILE_BUILD@
186EFL_ECORE_IMF_BUILD = @EFL_ECORE_IMF_BUILD@
187EFL_ECORE_IMF_EVAS_BUILD = @EFL_ECORE_IMF_EVAS_BUILD@
188EFL_ECORE_INPUT_BUILD = @EFL_ECORE_INPUT_BUILD@
189EFL_ECORE_INPUT_EVAS_BUILD = @EFL_ECORE_INPUT_EVAS_BUILD@
190EFL_ECORE_IPC_BUILD = @EFL_ECORE_IPC_BUILD@
191EFL_ECORE_PSL1GHT_BUILD = @EFL_ECORE_PSL1GHT_BUILD@
192EFL_ECORE_SDL_BUILD = @EFL_ECORE_SDL_BUILD@
193EFL_ECORE_WIN32_BUILD = @EFL_ECORE_WIN32_BUILD@
194EFL_ECORE_WINCE_BUILD = @EFL_ECORE_WINCE_BUILD@
195EFL_PTHREAD_CFLAGS = @EFL_PTHREAD_CFLAGS@
196EFL_PTHREAD_LIBS = @EFL_PTHREAD_LIBS@
197EGREP = @EGREP@
198EINA_CFLAGS = @EINA_CFLAGS@
199EINA_LIBS = @EINA_LIBS@
200ESCAPE_CFLAGS = @ESCAPE_CFLAGS@
201ESCAPE_LIBS = @ESCAPE_LIBS@
202EVAS_CFLAGS = @EVAS_CFLAGS@
203EVAS_LIBS = @EVAS_LIBS@
204EVIL_CFLAGS = @EVIL_CFLAGS@
205EVIL_LIBS = @EVIL_LIBS@
206EXEEXT = @EXEEXT@
207EXOTIC_CFLAGS = @EXOTIC_CFLAGS@
208EXOTIC_LIBS = @EXOTIC_LIBS@
209FGREP = @FGREP@
210GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
211GLIB_CFLAGS = @GLIB_CFLAGS@
212GLIB_LIBS = @GLIB_LIBS@
213GMSGFMT = @GMSGFMT@
214GMSGFMT_015 = @GMSGFMT_015@
215GREP = @GREP@
216INSTALL = @INSTALL@
217INSTALL_DATA = @INSTALL_DATA@
218INSTALL_PROGRAM = @INSTALL_PROGRAM@
219INSTALL_SCRIPT = @INSTALL_SCRIPT@
220INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
221INTLLIBS = @INTLLIBS@
222INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
223KEYSYMDEFS = @KEYSYMDEFS@
224LD = @LD@
225LDFLAGS = @LDFLAGS@
226LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@
227LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@
228LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@
229LIBICONV = @LIBICONV@
230LIBINTL = @LIBINTL@
231LIBOBJS = @LIBOBJS@
232LIBS = @LIBS@
233LIBTOOL = @LIBTOOL@
234LIPO = @LIPO@
235LN_S = @LN_S@
236LTLIBICONV = @LTLIBICONV@
237LTLIBINTL = @LTLIBINTL@
238LTLIBOBJS = @LTLIBOBJS@
239MAKEINFO = @MAKEINFO@
240MKDIR_P = @MKDIR_P@
241MSGFMT = @MSGFMT@
242MSGFMT_015 = @MSGFMT_015@
243MSGMERGE = @MSGMERGE@
244NM = @NM@
245NMEDIT = @NMEDIT@
246OBJC = @OBJC@
247OBJCDEPMODE = @OBJCDEPMODE@
248OBJCFLAGS = @OBJCFLAGS@
249OBJDUMP = @OBJDUMP@
250OBJEXT = @OBJEXT@
251OTOOL = @OTOOL@
252OTOOL64 = @OTOOL64@
253PACKAGE = @PACKAGE@
254PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
255PACKAGE_NAME = @PACKAGE_NAME@
256PACKAGE_STRING = @PACKAGE_STRING@
257PACKAGE_TARNAME = @PACKAGE_TARNAME@
258PACKAGE_URL = @PACKAGE_URL@
259PACKAGE_VERSION = @PACKAGE_VERSION@
260PATH_SEPARATOR = @PATH_SEPARATOR@
261PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
262PIXMAN_LIBS = @PIXMAN_LIBS@
263PKG_CONFIG = @PKG_CONFIG@
264PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
265PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
266POSUB = @POSUB@
267RANLIB = @RANLIB@
268SCIM_CFLAGS = @SCIM_CFLAGS@
269SCIM_LIBS = @SCIM_LIBS@
270SDL_CFLAGS = @SDL_CFLAGS@
271SDL_CONFIG = @SDL_CONFIG@
272SDL_LIBS = @SDL_LIBS@
273SED = @SED@
274SET_MAKE = @SET_MAKE@
275SHELL = @SHELL@
276SHM_OPEN_LIBS = @SHM_OPEN_LIBS@
277SSL_CFLAGS = @SSL_CFLAGS@
278SSL_LIBS = @SSL_LIBS@
279STRIP = @STRIP@
280TLS2_CFLAGS = @TLS2_CFLAGS@
281TLS2_LIBS = @TLS2_LIBS@
282TLS_CFLAGS = @TLS_CFLAGS@
283TLS_LIBS = @TLS_LIBS@
284TSLIB_CFLAGS = @TSLIB_CFLAGS@
285TSLIB_LIBS = @TSLIB_LIBS@
286USE_NLS = @USE_NLS@
287VERSION = @VERSION@
288VMAJ = @VMAJ@
289WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
290WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@
291WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@
292WAYLAND_LIBS = @WAYLAND_LIBS@
293WIN32_CFLAGS = @WIN32_CFLAGS@
294WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
295WIN32_LIBS = @WIN32_LIBS@
296XCB_COMPOSITE_CFLAGS = @XCB_COMPOSITE_CFLAGS@
297XCB_COMPOSITE_LIBS = @XCB_COMPOSITE_LIBS@
298XCB_CURSOR_CFLAGS = @XCB_CURSOR_CFLAGS@
299XCB_CURSOR_LIBS = @XCB_CURSOR_LIBS@
300XCB_DAMAGE_CFLAGS = @XCB_DAMAGE_CFLAGS@
301XCB_DAMAGE_LIBS = @XCB_DAMAGE_LIBS@
302XCB_DPMS_CFLAGS = @XCB_DPMS_CFLAGS@
303XCB_DPMS_LIBS = @XCB_DPMS_LIBS@
304XCB_RANDR_CFLAGS = @XCB_RANDR_CFLAGS@
305XCB_RANDR_LIBS = @XCB_RANDR_LIBS@
306XCB_RENDER_CFLAGS = @XCB_RENDER_CFLAGS@
307XCB_RENDER_LIBS = @XCB_RENDER_LIBS@
308XCB_SCREENSAVER_CFLAGS = @XCB_SCREENSAVER_CFLAGS@
309XCB_SCREENSAVER_LIBS = @XCB_SCREENSAVER_LIBS@
310XCB_SHAPE_CFLAGS = @XCB_SHAPE_CFLAGS@
311XCB_SHAPE_LIBS = @XCB_SHAPE_LIBS@
312XCB_SYNC_CFLAGS = @XCB_SYNC_CFLAGS@
313XCB_SYNC_LIBS = @XCB_SYNC_LIBS@
314XCB_X11_CFLAGS = @XCB_X11_CFLAGS@
315XCB_X11_LIBS = @XCB_X11_LIBS@
316XCB_XFIXES_CFLAGS = @XCB_XFIXES_CFLAGS@
317XCB_XFIXES_LIBS = @XCB_XFIXES_LIBS@
318XCB_XGESTURE_CFLAGS = @XCB_XGESTURE_CFLAGS@
319XCB_XGESTURE_LIBS = @XCB_XGESTURE_LIBS@
320XCB_XINERAMA_CFLAGS = @XCB_XINERAMA_CFLAGS@
321XCB_XINERAMA_LIBS = @XCB_XINERAMA_LIBS@
322XCB_XINPUT_CFLAGS = @XCB_XINPUT_CFLAGS@
323XCB_XINPUT_LIBS = @XCB_XINPUT_LIBS@
324XCB_XPRINT_CFLAGS = @XCB_XPRINT_CFLAGS@
325XCB_XPRINT_LIBS = @XCB_XPRINT_LIBS@
326XCB_XTEST_CFLAGS = @XCB_XTEST_CFLAGS@
327XCB_XTEST_LIBS = @XCB_XTEST_LIBS@
328XCOMPOSITE_CFLAGS = @XCOMPOSITE_CFLAGS@
329XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@
330XDAMAGE_CFLAGS = @XDAMAGE_CFLAGS@
331XDAMAGE_LIBS = @XDAMAGE_LIBS@
332XDPMS_CFLAGS = @XDPMS_CFLAGS@
333XDPMS_LIBS = @XDPMS_LIBS@
334XFIXES_CFLAGS = @XFIXES_CFLAGS@
335XFIXES_LIBS = @XFIXES_LIBS@
336XGESTURE_CFLAGS = @XGESTURE_CFLAGS@
337XGESTURE_LIBS = @XGESTURE_LIBS@
338XGETTEXT = @XGETTEXT@
339XGETTEXT_015 = @XGETTEXT_015@
340XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
341XI2_CFLAGS = @XI2_CFLAGS@
342XI2_LIBS = @XI2_LIBS@
343XINERAMA_CFLAGS = @XINERAMA_CFLAGS@
344XINERAMA_LIBS = @XINERAMA_LIBS@
345XKB_CFLAGS = @XKB_CFLAGS@
346XKB_LIBS = @XKB_LIBS@
347XMKMF = @XMKMF@
348XPRINT_CFLAGS = @XPRINT_CFLAGS@
349XPRINT_LIBS = @XPRINT_LIBS@
350XRANDR_CFLAGS = @XRANDR_CFLAGS@
351XRANDR_LIBS = @XRANDR_LIBS@
352XRENDER_CFLAGS = @XRENDER_CFLAGS@
353XRENDER_LIBS = @XRENDER_LIBS@
354XSS_CFLAGS = @XSS_CFLAGS@
355XSS_LIBS = @XSS_LIBS@
356XTEST_CFLAGS = @XTEST_CFLAGS@
357XTEST_LIBS = @XTEST_LIBS@
358X_CFLAGS = @X_CFLAGS@
359X_EXTRA_LIBS = @X_EXTRA_LIBS@
360X_LIBS = @X_LIBS@
361X_PRE_LIBS = @X_PRE_LIBS@
362Xcursor_cflags = @Xcursor_cflags@
363Xcursor_libs = @Xcursor_libs@
364abs_builddir = @abs_builddir@
365abs_srcdir = @abs_srcdir@
366abs_top_builddir = @abs_top_builddir@
367abs_top_srcdir = @abs_top_srcdir@
368ac_ct_CC = @ac_ct_CC@
369ac_ct_CXX = @ac_ct_CXX@
370ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
371ac_ct_OBJC = @ac_ct_OBJC@
372am__include = @am__include@
373am__leading_dot = @am__leading_dot@
374am__quote = @am__quote@
375am__tar = @am__tar@
376am__untar = @am__untar@
377bindir = @bindir@
378build = @build@
379build_alias = @build_alias@
380build_cpu = @build_cpu@
381build_os = @build_os@
382build_vendor = @build_vendor@
383builddir = @builddir@
384cocoa_ldflags = @cocoa_ldflags@
385datadir = @datadir@
386datarootdir = @datarootdir@
387dlopen_libs = @dlopen_libs@
388docdir = @docdir@
389dvidir = @dvidir@
390ecore_cocoa_cflags = @ecore_cocoa_cflags@
391ecore_cocoa_libs = @ecore_cocoa_libs@
392ecore_con_cflags = @ecore_con_cflags@
393ecore_con_libs = @ecore_con_libs@
394ecore_directfb_cflags = @ecore_directfb_cflags@
395ecore_directfb_libs = @ecore_directfb_libs@
396ecore_evas_cflags = @ecore_evas_cflags@
397ecore_evas_libs = @ecore_evas_libs@
398ecore_fb_cflags = @ecore_fb_cflags@
399ecore_fb_libs = @ecore_fb_libs@
400ecore_file_cflags = @ecore_file_cflags@
401ecore_file_libs = @ecore_file_libs@
402ecore_imf_cflags = @ecore_imf_cflags@
403ecore_imf_evas_cflags = @ecore_imf_evas_cflags@
404ecore_imf_evas_libs = @ecore_imf_evas_libs@
405ecore_imf_libs = @ecore_imf_libs@
406ecore_imf_scim_cflags = @ecore_imf_scim_cflags@
407ecore_imf_scim_libs = @ecore_imf_scim_libs@
408ecore_imf_xim_cflags = @ecore_imf_xim_cflags@
409ecore_imf_xim_libs = @ecore_imf_xim_libs@
410ecore_input_cflags = @ecore_input_cflags@
411ecore_input_evas_cflags = @ecore_input_evas_cflags@
412ecore_input_evas_libs = @ecore_input_evas_libs@
413ecore_input_libs = @ecore_input_libs@
414ecore_ipc_cflags = @ecore_ipc_cflags@
415ecore_ipc_libs = @ecore_ipc_libs@
416ecore_psl1ght_cflags = @ecore_psl1ght_cflags@
417ecore_psl1ght_libs = @ecore_psl1ght_libs@
418ecore_sdl_cflags = @ecore_sdl_cflags@
419ecore_sdl_libs = @ecore_sdl_libs@
420ecore_wayland_cflags = @ecore_wayland_cflags@
421ecore_wayland_libs = @ecore_wayland_libs@
422ecore_win32_cflags = @ecore_win32_cflags@
423ecore_win32_libs = @ecore_win32_libs@
424ecore_wince_cflags = @ecore_wince_cflags@
425ecore_wince_libs = @ecore_wince_libs@
426ecore_x_cflags = @ecore_x_cflags@
427ecore_x_libs = @ecore_x_libs@
428ecore_x_libs_private = @ecore_x_libs_private@
429efl_doxygen = @efl_doxygen@
430efl_have_doxygen = @efl_have_doxygen@
431exec_prefix = @exec_prefix@
432have_ecore_x_xcb_define = @have_ecore_x_xcb_define@
433host = @host@
434host_alias = @host_alias@
435host_cpu = @host_cpu@
436host_os = @host_os@
437host_vendor = @host_vendor@
438htmldir = @htmldir@
439includedir = @includedir@
440infodir = @infodir@
441install_sh = @install_sh@
442libdir = @libdir@
443libexecdir = @libexecdir@
444localedir = @localedir@
445localstatedir = @localstatedir@
446lt_ECHO = @lt_ECHO@
447lt_enable_auto_import = @lt_enable_auto_import@
448mandir = @mandir@
449mkdir_p = @mkdir_p@
450oldincludedir = @oldincludedir@
451pdfdir = @pdfdir@
452pkgconfig_requires_private = @pkgconfig_requires_private@
453prefix = @prefix@
454program_transform_name = @program_transform_name@
455psdir = @psdir@
456release_info = @release_info@
457requirements_ecore = @requirements_ecore@
458requirements_ecore_cocoa = @requirements_ecore_cocoa@
459requirements_ecore_con = @requirements_ecore_con@
460requirements_ecore_directfb = @requirements_ecore_directfb@
461requirements_ecore_evas = @requirements_ecore_evas@
462requirements_ecore_fb = @requirements_ecore_fb@
463requirements_ecore_file = @requirements_ecore_file@
464requirements_ecore_imf = @requirements_ecore_imf@
465requirements_ecore_imf_evas = @requirements_ecore_imf_evas@
466requirements_ecore_imf_scim = @requirements_ecore_imf_scim@
467requirements_ecore_imf_xim = @requirements_ecore_imf_xim@
468requirements_ecore_input = @requirements_ecore_input@
469requirements_ecore_input_evas = @requirements_ecore_input_evas@
470requirements_ecore_ipc = @requirements_ecore_ipc@
471requirements_ecore_psl1ght = @requirements_ecore_psl1ght@
472requirements_ecore_sdl = @requirements_ecore_sdl@
473requirements_ecore_wayland = @requirements_ecore_wayland@
474requirements_ecore_win32 = @requirements_ecore_win32@
475requirements_ecore_wince = @requirements_ecore_wince@
476requirements_ecore_x = @requirements_ecore_x@
477rt_libs = @rt_libs@
478sbindir = @sbindir@
479sharedstatedir = @sharedstatedir@
480srcdir = @srcdir@
481sysconfdir = @sysconfdir@
482target_alias = @target_alias@
483top_build_prefix = @top_build_prefix@
484top_builddir = @top_builddir@
485top_srcdir = @top_srcdir@
486version_info = @version_info@
487x_cflags = @x_cflags@
488x_includes = @x_includes@
489x_libs = @x_libs@
490MAINTAINERCLEANFILES = Makefile.in
491AM_CPPFLAGS = \
492-I$(top_srcdir) \
493-I$(top_srcdir)/src/lib/ecore \
494-I$(top_srcdir)/src/lib/ecore_input \
495-I$(top_srcdir)/src/lib/ecore_x \
496-I$(top_srcdir)/src/lib/ecore_imf \
497-I$(top_srcdir)/src/lib/ecore_evas \
498-I$(top_builddir)/src/lib/ecore \
499-I$(top_builddir)/src/lib/ecore_input \
500-I$(top_builddir)/src/lib/ecore_x \
501-I$(top_builddir)/src/lib/ecore_imf \
502-I$(top_builddir)/src/lib/ecore_evas \
503-DPACKAGE_LIB_DIR=\"$(libdir)\" \
504-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
505@SCIM_CFLAGS@ \
506@EVAS_CFLAGS@ \
507@EINA_CFLAGS@
508
509pkgdir = $(libdir)/ecore/immodules
510pkg_LTLIBRARIES = scim.la
511scim_la_SOURCES = \
512scim_imcontext.cpp \
513scim_module.cpp \
514scim_imcontext.h
515
516scim_la_LIBADD = \
517 $(top_builddir)/src/lib/ecore_imf/libecore_imf.la \
518 $(top_builddir)/src/lib/ecore_x/libecore_x.la \
519 @SCIM_LIBS@ \
520 @EVAS_LIBS@ \
521 @EINA_LIBS@
522
523scim_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
524scim_la_LIBTOOLFLAGS = --tag=disable-static
525all: all-am
526
527.SUFFIXES:
528.SUFFIXES: .cpp .lo .o .obj
529$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
530 @for dep in $?; do \
531 case '$(am__configure_deps)' in \
532 *$$dep*) \
533 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
534 && { if test -f $@; then exit 0; else break; fi; }; \
535 exit 1;; \
536 esac; \
537 done; \
538 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/immodules/scim/Makefile'; \
539 $(am__cd) $(top_srcdir) && \
540 $(AUTOMAKE) --gnu src/modules/immodules/scim/Makefile
541.PRECIOUS: Makefile
542Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
543 @case '$?' in \
544 *config.status*) \
545 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
546 *) \
547 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
548 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
549 esac;
550
551$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
552 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
553
554$(top_srcdir)/configure: $(am__configure_deps)
555 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
556$(ACLOCAL_M4): $(am__aclocal_m4_deps)
557 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
558$(am__aclocal_m4_deps):
559install-pkgLTLIBRARIES: $(pkg_LTLIBRARIES)
560 @$(NORMAL_INSTALL)
561 test -z "$(pkgdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdir)"
562 @list='$(pkg_LTLIBRARIES)'; test -n "$(pkgdir)" || list=; \
563 list2=; for p in $$list; do \
564 if test -f $$p; then \
565 list2="$$list2 $$p"; \
566 else :; fi; \
567 done; \
568 test -z "$$list2" || { \
569 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkgdir)'"; \
570 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkgdir)"; \
571 }
572
573uninstall-pkgLTLIBRARIES:
574 @$(NORMAL_UNINSTALL)
575 @list='$(pkg_LTLIBRARIES)'; test -n "$(pkgdir)" || list=; \
576 for p in $$list; do \
577 $(am__strip_dir) \
578 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkgdir)/$$f'"; \
579 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkgdir)/$$f"; \
580 done
581
582clean-pkgLTLIBRARIES:
583 -test -z "$(pkg_LTLIBRARIES)" || rm -f $(pkg_LTLIBRARIES)
584 @list='$(pkg_LTLIBRARIES)'; for p in $$list; do \
585 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
586 test "$$dir" != "$$p" || dir=.; \
587 echo "rm -f \"$${dir}/so_locations\""; \
588 rm -f "$${dir}/so_locations"; \
589 done
590scim.la: $(scim_la_OBJECTS) $(scim_la_DEPENDENCIES)
591 $(AM_V_CXXLD)$(scim_la_LINK) -rpath $(pkgdir) $(scim_la_OBJECTS) $(scim_la_LIBADD) $(LIBS)
592
593mostlyclean-compile:
594 -rm -f *.$(OBJEXT)
595
596distclean-compile:
597 -rm -f *.tab.c
598
599@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scim_la-scim_imcontext.Plo@am__quote@
600@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scim_la-scim_module.Plo@am__quote@
601
602.cpp.o:
603@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
604@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
605@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@
606@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
607@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
608@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
609
610.cpp.obj:
611@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
612@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
613@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@
614@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
615@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
616@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
617
618.cpp.lo:
619@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
620@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
621@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@
622@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
623@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
624@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
625
626scim_la-scim_imcontext.lo: scim_imcontext.cpp
627@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(scim_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT scim_la-scim_imcontext.lo -MD -MP -MF $(DEPDIR)/scim_la-scim_imcontext.Tpo -c -o scim_la-scim_imcontext.lo `test -f 'scim_imcontext.cpp' || echo '$(srcdir)/'`scim_imcontext.cpp
628@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scim_la-scim_imcontext.Tpo $(DEPDIR)/scim_la-scim_imcontext.Plo
629@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@
630@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='scim_imcontext.cpp' object='scim_la-scim_imcontext.lo' libtool=yes @AMDEPBACKSLASH@
631@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
632@am__fastdepCXX_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CXX $(scim_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o scim_la-scim_imcontext.lo `test -f 'scim_imcontext.cpp' || echo '$(srcdir)/'`scim_imcontext.cpp
633
634scim_la-scim_module.lo: scim_module.cpp
635@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(scim_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT scim_la-scim_module.lo -MD -MP -MF $(DEPDIR)/scim_la-scim_module.Tpo -c -o scim_la-scim_module.lo `test -f 'scim_module.cpp' || echo '$(srcdir)/'`scim_module.cpp
636@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scim_la-scim_module.Tpo $(DEPDIR)/scim_la-scim_module.Plo
637@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@
638@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='scim_module.cpp' object='scim_la-scim_module.lo' libtool=yes @AMDEPBACKSLASH@
639@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
640@am__fastdepCXX_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CXX $(scim_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o scim_la-scim_module.lo `test -f 'scim_module.cpp' || echo '$(srcdir)/'`scim_module.cpp
641
642mostlyclean-libtool:
643 -rm -f *.lo
644
645clean-libtool:
646 -rm -rf .libs _libs
647
648ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
649 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
650 unique=`for i in $$list; do \
651 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
652 done | \
653 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
654 END { if (nonempty) { for (i in files) print i; }; }'`; \
655 mkid -fID $$unique
656tags: TAGS
657
658TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
659 $(TAGS_FILES) $(LISP)
660 set x; \
661 here=`pwd`; \
662 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
663 unique=`for i in $$list; do \
664 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
665 done | \
666 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
667 END { if (nonempty) { for (i in files) print i; }; }'`; \
668 shift; \
669 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
670 test -n "$$unique" || unique=$$empty_fix; \
671 if test $$# -gt 0; then \
672 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
673 "$$@" $$unique; \
674 else \
675 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
676 $$unique; \
677 fi; \
678 fi
679ctags: CTAGS
680CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
681 $(TAGS_FILES) $(LISP)
682 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
683 unique=`for i in $$list; do \
684 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
685 done | \
686 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
687 END { if (nonempty) { for (i in files) print i; }; }'`; \
688 test -z "$(CTAGS_ARGS)$$unique" \
689 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
690 $$unique
691
692GTAGS:
693 here=`$(am__cd) $(top_builddir) && pwd` \
694 && $(am__cd) $(top_srcdir) \
695 && gtags -i $(GTAGS_ARGS) "$$here"
696
697distclean-tags:
698 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
699
700distdir: $(DISTFILES)
701 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
702 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
703 list='$(DISTFILES)'; \
704 dist_files=`for file in $$list; do echo $$file; done | \
705 sed -e "s|^$$srcdirstrip/||;t" \
706 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
707 case $$dist_files in \
708 */*) $(MKDIR_P) `echo "$$dist_files" | \
709 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
710 sort -u` ;; \
711 esac; \
712 for file in $$dist_files; do \
713 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
714 if test -d $$d/$$file; then \
715 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
716 if test -d "$(distdir)/$$file"; then \
717 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
718 fi; \
719 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
720 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
721 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
722 fi; \
723 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
724 else \
725 test -f "$(distdir)/$$file" \
726 || cp -p $$d/$$file "$(distdir)/$$file" \
727 || exit 1; \
728 fi; \
729 done
730check-am: all-am
731check: check-am
732all-am: Makefile $(LTLIBRARIES)
733installdirs:
734 for dir in "$(DESTDIR)$(pkgdir)"; do \
735 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
736 done
737install: install-am
738install-exec: install-exec-am
739install-data: install-data-am
740uninstall: uninstall-am
741
742install-am: all-am
743 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
744
745installcheck: installcheck-am
746install-strip:
747 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
748 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
749 `test -z '$(STRIP)' || \
750 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
751mostlyclean-generic:
752
753clean-generic:
754
755distclean-generic:
756 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
757 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
758
759maintainer-clean-generic:
760 @echo "This command is intended for maintainers to use"
761 @echo "it deletes files that may require special tools to rebuild."
762 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
763clean: clean-am
764
765clean-am: clean-generic clean-libtool clean-pkgLTLIBRARIES \
766 mostlyclean-am
767
768distclean: distclean-am
769 -rm -rf ./$(DEPDIR)
770 -rm -f Makefile
771distclean-am: clean-am distclean-compile distclean-generic \
772 distclean-tags
773
774dvi: dvi-am
775
776dvi-am:
777
778html: html-am
779
780html-am:
781
782info: info-am
783
784info-am:
785
786install-data-am: install-pkgLTLIBRARIES
787
788install-dvi: install-dvi-am
789
790install-dvi-am:
791
792install-exec-am:
793
794install-html: install-html-am
795
796install-html-am:
797
798install-info: install-info-am
799
800install-info-am:
801
802install-man:
803
804install-pdf: install-pdf-am
805
806install-pdf-am:
807
808install-ps: install-ps-am
809
810install-ps-am:
811
812installcheck-am:
813
814maintainer-clean: maintainer-clean-am
815 -rm -rf ./$(DEPDIR)
816 -rm -f Makefile
817maintainer-clean-am: distclean-am maintainer-clean-generic
818
819mostlyclean: mostlyclean-am
820
821mostlyclean-am: mostlyclean-compile mostlyclean-generic \
822 mostlyclean-libtool
823
824pdf: pdf-am
825
826pdf-am:
827
828ps: ps-am
829
830ps-am:
831
832uninstall-am: uninstall-pkgLTLIBRARIES
833
834.MAKE: install-am install-strip
835
836.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
837 clean-libtool clean-pkgLTLIBRARIES ctags distclean \
838 distclean-compile distclean-generic distclean-libtool \
839 distclean-tags distdir dvi dvi-am html html-am info info-am \
840 install install-am install-data install-data-am install-dvi \
841 install-dvi-am install-exec install-exec-am install-html \
842 install-html-am install-info install-info-am install-man \
843 install-pdf install-pdf-am install-pkgLTLIBRARIES install-ps \
844 install-ps-am install-strip installcheck installcheck-am \
845 installdirs maintainer-clean maintainer-clean-generic \
846 mostlyclean mostlyclean-compile mostlyclean-generic \
847 mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
848 uninstall-am uninstall-pkgLTLIBRARIES
849
850
851# Tell versions [3.59,3.63) of GNU make to not export all variables.
852# Otherwise a system limit (for SysV at least) may be exceeded.
853.NOEXPORT:
diff --git a/libraries/ecore/src/modules/immodules/scim/scim_imcontext.cpp b/libraries/ecore/src/modules/immodules/scim/scim_imcontext.cpp
deleted file mode 100644
index eb9b5c9..0000000
--- a/libraries/ecore/src/modules/immodules/scim/scim_imcontext.cpp
+++ /dev/null
@@ -1,2895 +0,0 @@
1#ifdef HAVE_CONFIG_H
2#include <config.h>
3#endif
4
5#define Uses_SCIM_DEBUG
6#define Uses_SCIM_BACKEND
7#define Uses_SCIM_IMENGINE_MODULE
8#define Uses_SCIM_HOTKEY
9#define Uses_SCIM_PANEL_CLIENT
10
11#include <sys/types.h>
12#include <sys/wait.h>
13#include <sys/time.h>
14#include <sys/times.h>
15#include <unistd.h>
16#include <pthread.h>
17#include <Ecore_Evas.h>
18#include <Ecore_X.h>
19#include <Ecore.h>
20#include <Evas.h>
21
22#include <X11/Xlib.h>
23#include <X11/keysym.h>
24#include <X11/Xutil.h>
25
26#include <scim.h>
27#include "scim_imcontext.h"
28
29using namespace scim;
30
31struct _EcoreIMFContextISFImpl
32{
33 EcoreIMFContextISF *parent;
34 IMEngineInstancePointer si;
35 Ecore_X_Window client_window;
36 Evas *client_canvas;
37 Ecore_IMF_Input_Mode input_mode;
38 WideString preedit_string;
39 AttributeList preedit_attrlist;
40 Ecore_IMF_Autocapital_Type autocapital_type;
41 int preedit_caret;
42 int cursor_x;
43 int cursor_y;
44 int cursor_pos;
45 bool use_preedit;
46 bool is_on;
47 bool shared_si;
48 bool preedit_started;
49 bool preedit_updating;
50 bool need_commit_preedit;
51 bool uppercase;
52 bool prediction_allow;
53
54 EcoreIMFContextISFImpl *next;
55};
56
57/* Input Context handling functions. */
58static EcoreIMFContextISFImpl *new_ic_impl (EcoreIMFContextISF *parent);
59static void delete_ic_impl (EcoreIMFContextISFImpl *impl);
60static void delete_all_ic_impl (void);
61
62static EcoreIMFContextISF *find_ic (int id);
63
64
65/* private functions */
66static void panel_slot_reload_config (int context);
67static void panel_slot_exit (int context);
68static void panel_slot_update_lookup_table_page_size(int context,
69 int page_size);
70static void panel_slot_lookup_table_page_up (int context);
71static void panel_slot_lookup_table_page_down (int context);
72static void panel_slot_trigger_property (int context,
73 const String &property);
74static void panel_slot_process_helper_event (int context,
75 const String &target_uuid,
76 const String &helper_uuid,
77 const Transaction &trans);
78static void panel_slot_move_preedit_caret (int context,
79 int caret_pos);
80static void panel_slot_select_candidate (int context,
81 int cand_index);
82static void panel_slot_process_key_event (int context,
83 const KeyEvent &key);
84static void panel_slot_commit_string (int context,
85 const WideString &wstr);
86static void panel_slot_forward_key_event (int context,
87 const KeyEvent &key);
88static void panel_slot_request_help (int context);
89static void panel_slot_request_factory_menu (int context);
90static void panel_slot_change_factory (int context,
91 const String &uuid);
92
93static void panel_req_focus_in (EcoreIMFContextISF *ic);
94static void panel_req_update_factory_info (EcoreIMFContextISF *ic);
95static void panel_req_update_spot_location (EcoreIMFContextISF *ic);
96static void panel_req_show_help (EcoreIMFContextISF *ic);
97static void panel_req_show_factory_menu (EcoreIMFContextISF *ic);
98
99/* Panel iochannel handler*/
100static bool panel_initialize (void);
101static void panel_finalize (void);
102static Eina_Bool panel_iochannel_handler (void *data,
103 Ecore_Fd_Handler *fd_handler);
104
105/* utility functions */
106static bool filter_hotkeys (EcoreIMFContextISF *ic,
107 const KeyEvent &key);
108static void turn_on_ic (EcoreIMFContextISF *ic);
109static void turn_off_ic (EcoreIMFContextISF *ic);
110static void set_ic_capabilities (EcoreIMFContextISF *ic);
111
112static void initialize (void);
113static void finalize (void);
114
115static void open_next_factory (EcoreIMFContextISF *ic);
116static void open_previous_factory (EcoreIMFContextISF *ic);
117static void open_specific_factory (EcoreIMFContextISF *ic,
118 const String &uuid);
119static void initialize_modifier_bits (Display *display);
120static unsigned int scim_x11_keymask_scim_to_x11 (Display *display, uint16 scimkeymask);
121static XKeyEvent createKeyEvent (Display *display, Window &win,
122 Window &winRoot, bool press,
123 int keycode, int modifiers);
124static void _x_send_key_event (const KeyEvent &key);
125
126static void attach_instance (const IMEngineInstancePointer &si);
127
128/* slot functions */
129static void slot_show_preedit_string (IMEngineInstanceBase *si);
130static void slot_show_aux_string (IMEngineInstanceBase *si);
131static void slot_show_lookup_table (IMEngineInstanceBase *si);
132
133static void slot_hide_preedit_string (IMEngineInstanceBase *si);
134static void slot_hide_aux_string (IMEngineInstanceBase *si);
135static void slot_hide_lookup_table (IMEngineInstanceBase *si);
136
137static void slot_update_preedit_caret (IMEngineInstanceBase *si,
138 int caret);
139static void slot_update_preedit_string (IMEngineInstanceBase *si,
140 const WideString &str,
141 const AttributeList &attrs);
142static void slot_update_aux_string (IMEngineInstanceBase *si,
143 const WideString &str,
144 const AttributeList &attrs);
145static void slot_commit_string (IMEngineInstanceBase *si,
146 const WideString &str);
147static void slot_forward_key_event (IMEngineInstanceBase *si,
148 const KeyEvent &key);
149static void slot_update_lookup_table (IMEngineInstanceBase *si,
150 const LookupTable &table);
151
152static void slot_register_properties (IMEngineInstanceBase *si,
153 const PropertyList &properties);
154static void slot_update_property (IMEngineInstanceBase *si,
155 const Property &property);
156static void slot_beep (IMEngineInstanceBase *si);
157static void slot_start_helper (IMEngineInstanceBase *si,
158 const String &helper_uuid);
159static void slot_stop_helper (IMEngineInstanceBase *si,
160 const String &helper_uuid);
161static void slot_send_helper_event (IMEngineInstanceBase *si,
162 const String &helper_uuid,
163 const Transaction &trans);
164static bool slot_get_surrounding_text (IMEngineInstanceBase *si,
165 WideString &text,
166 int &cursor,
167 int maxlen_before,
168 int maxlen_after);
169static bool slot_delete_surrounding_text (IMEngineInstanceBase *si,
170 int offset,
171 int len);
172
173static void reload_config_callback (const ConfigPointer &config);
174
175static void fallback_commit_string_cb (IMEngineInstanceBase *si,
176 const WideString &str);
177
178static void caps_mode_check (Ecore_IMF_Context *ctx, Eina_Bool force);
179
180/* Local variables declaration */
181static String _language;
182static EcoreIMFContextISFImpl *_used_ic_impl_list = 0;
183static EcoreIMFContextISFImpl *_free_ic_impl_list = 0;
184static EcoreIMFContextISF *_ic_list = 0;
185
186static KeyboardLayout _keyboard_layout = SCIM_KEYBOARD_Default;
187static int _valid_key_mask = SCIM_KEY_AllMasks;
188
189static FrontEndHotkeyMatcher _frontend_hotkey_matcher;
190static IMEngineHotkeyMatcher _imengine_hotkey_matcher;
191
192static IMEngineInstancePointer _default_instance;
193
194static ConfigModule *_config_module = 0;
195static ConfigPointer _config;
196static BackEndPointer _backend;
197
198static EcoreIMFContextISF *_focused_ic = 0;
199
200static bool _scim_initialized = false;
201
202static int _instance_count = 0;
203static int _context_count = 0;
204
205static IMEngineFactoryPointer _fallback_factory;
206static IMEngineInstancePointer _fallback_instance;
207static PanelClient _panel_client;
208
209static Ecore_Fd_Handler *_panel_iochannel_read_handler = 0;
210static Ecore_Fd_Handler *_panel_iochannel_err_handler = 0;
211
212static Ecore_X_Window _client_window = 0;
213
214static bool _on_the_spot = true;
215static bool _shared_input_method = false;
216
217static Eina_Bool autocap_allow = EINA_FALSE;
218
219static Display *__current_display = 0;
220static int __current_alt_mask = Mod1Mask;
221static int __current_meta_mask = 0;
222static int __current_super_mask = 0;
223static int __current_hyper_mask = 0;
224static int __current_numlock_mask = Mod2Mask;
225
226// A hack to shutdown the immodule cleanly even if im_module_exit() is not called when exiting.
227class FinalizeHandler
228{
229public:
230 FinalizeHandler()
231 {
232 SCIM_DEBUG_FRONTEND(1) << "FinalizeHandler::FinalizeHandler()\n";
233 }
234 ~FinalizeHandler()
235 {
236 SCIM_DEBUG_FRONTEND(1) << "FinalizeHandler::~FinalizeHandler()\n";
237 isf_imf_context_shutdown();
238 }
239};
240
241static FinalizeHandler _finalize_handler;
242
243static unsigned int
244utf8_offset_to_index(const char *str, int offset)
245{
246 int index = 0;
247 int i;
248 for (i = 0; i < offset; i++)
249 {
250 eina_unicode_utf8_get_next(str, &index);
251 }
252
253 return index;
254}
255
256static unsigned int
257get_time(void)
258{
259 unsigned int tint;
260 struct timeval tv;
261 struct timezone tz; /* is not used since ages */
262 gettimeofday(&tv, &tz);
263 tint = tv.tv_sec * 1000;
264 tint = tint / 1000 * 1000;
265 tint = tint + tv.tv_usec / 1000;
266 return tint;
267}
268
269/* Function Implementations */
270static EcoreIMFContextISFImpl *
271new_ic_impl(EcoreIMFContextISF *parent)
272{
273 EcoreIMFContextISFImpl *impl = NULL;
274
275 if (_free_ic_impl_list != NULL)
276 {
277 impl = _free_ic_impl_list;
278 _free_ic_impl_list = _free_ic_impl_list->next;
279 }
280 else
281 {
282 impl = new EcoreIMFContextISFImpl;
283 if (impl == NULL)
284 return NULL;
285 }
286
287 impl->uppercase = false;
288 impl->autocapital_type = ECORE_IMF_AUTOCAPITAL_TYPE_NONE;
289 impl->next = _used_ic_impl_list;
290 _used_ic_impl_list = impl;
291
292 impl->parent = parent;
293
294 return impl;
295}
296
297static void
298delete_ic_impl(EcoreIMFContextISFImpl *impl)
299{
300 EcoreIMFContextISFImpl *rec = _used_ic_impl_list, *last = 0;
301
302 for (; rec != 0; last = rec, rec = rec->next)
303 {
304 if (rec == impl)
305 {
306 if (last != 0)
307 last->next = rec->next;
308 else
309 _used_ic_impl_list = rec->next;
310
311 rec->next = _free_ic_impl_list;
312 _free_ic_impl_list = rec;
313
314 rec->parent = 0;
315 rec->si.reset();
316 rec->client_window = 0;
317 rec->preedit_string = WideString();
318 rec->preedit_attrlist.clear();
319
320 return;
321 }
322 }
323}
324
325static void
326delete_all_ic_impl(void)
327{
328 EcoreIMFContextISFImpl *it = _used_ic_impl_list;
329
330 while (it != 0)
331 {
332 _used_ic_impl_list = it->next;
333 delete it;
334 it = _used_ic_impl_list;
335 }
336
337 it = _free_ic_impl_list;
338 while (it != 0)
339 {
340 _free_ic_impl_list = it->next;
341 delete it;
342 it = _free_ic_impl_list;
343 }
344}
345
346static EcoreIMFContextISF *
347find_ic(int id)
348{
349 EcoreIMFContextISFImpl *rec = _used_ic_impl_list;
350
351 while (rec != 0)
352 {
353 if (rec->parent && rec->parent->id == id)
354 return rec->parent;
355 rec = rec->next;
356 }
357
358 return 0;
359}
360
361static Eina_Bool
362analyze_surrounding_text(Ecore_IMF_Context *ctx)
363{
364 char *plain_str = NULL;
365 char *markup_str = NULL;
366 const char *puncs[] = {". ", "! ", "? "};
367 Eina_Bool ret = EINA_FALSE;
368 int cursor_pos = 0;
369 int i = 0;
370 Eina_Unicode *tail = NULL;
371 Eina_Unicode *ustr = NULL;
372 const int punc_num = sizeof(puncs) / sizeof(puncs[0]);
373 Eina_Unicode *uni_puncs[punc_num];
374 EcoreIMFContextISF *context_scim;
375
376 if (!ctx) return EINA_FALSE;
377 context_scim = (EcoreIMFContextISF *)ecore_imf_context_data_get(ctx);
378 if (!context_scim || !context_scim->impl) return EINA_FALSE;
379
380 switch (context_scim->impl->autocapital_type)
381 {
382 case ECORE_IMF_AUTOCAPITAL_TYPE_NONE:
383 return EINA_FALSE;
384 case ECORE_IMF_AUTOCAPITAL_TYPE_ALLCHARACTER:
385 return EINA_TRUE;
386 default:
387 break;
388 }
389
390 for (i = 0; i < punc_num; i++)
391 uni_puncs[i] = eina_unicode_utf8_to_unicode(puncs[i], NULL);
392
393 ecore_imf_context_surrounding_get(ctx, &markup_str, &cursor_pos);
394 if (!markup_str) goto done;
395
396 if (cursor_pos == 0)
397 {
398 ret = EINA_TRUE;
399 goto done;
400 }
401
402 // Convert into plain string
403 plain_str = evas_textblock_text_markup_to_utf8(NULL, markup_str);
404 if (!plain_str) goto done;
405
406 // Convert string from utf8 to unicode
407 ustr = eina_unicode_utf8_to_unicode(plain_str, NULL);
408 if (!ustr) goto done;
409
410 if (cursor_pos >= 1)
411 {
412 if (context_scim->impl->autocapital_type == ECORE_IMF_AUTOCAPITAL_TYPE_WORD)
413 {
414 if (ustr[cursor_pos-1] == ' ')
415 {
416 ret = EINA_TRUE;
417 goto done;
418 }
419 }
420
421 // Check paragraph separator <PS> and carrage return <br>
422 if ((ustr[cursor_pos-1] == 0x2029) || (ustr[cursor_pos-1] == '\n'))
423 {
424 ret = EINA_TRUE;
425 goto done;
426 }
427 }
428
429 // check punctuation
430 if (cursor_pos >= 2)
431 {
432 tail = eina_unicode_strndup(ustr+cursor_pos-2, 2);
433
434 if (tail)
435 {
436 for (i = 0; i < punc_num; i++)
437 {
438 if (!eina_unicode_strcmp(tail, uni_puncs[i]))
439 {
440 ret = EINA_TRUE;
441 break;
442 }
443 }
444 free(tail);
445 tail = NULL;
446 }
447 }
448
449done:
450 if (ustr) free(ustr);
451 if (markup_str) free(markup_str);
452 if (plain_str) free(plain_str);
453
454 for (i = 0; i < punc_num; i++)
455 if (uni_puncs[i]) free(uni_puncs[i]);
456
457 return ret;
458}
459
460static void
461caps_mode_check(Ecore_IMF_Context *ctx, Eina_Bool force)
462{
463 Eina_Bool uppercase;
464 EcoreIMFContextISF *context_scim;
465
466 if (!ctx) return;
467 context_scim = (EcoreIMFContextISF *)ecore_imf_context_data_get(ctx);
468
469 if (autocap_allow == EINA_FALSE)
470 return;
471
472 // Check autocapital type
473 if (!context_scim || !context_scim->impl)
474 return;
475
476 if (analyze_surrounding_text(ctx))
477 uppercase = EINA_TRUE;
478 else
479 uppercase = EINA_FALSE;
480
481 if (force)
482 context_scim->impl->uppercase = uppercase;
483 else
484 if (context_scim->impl->uppercase != uppercase)
485 context_scim->impl->uppercase = uppercase;
486}
487
488static void
489feed_key_event(Evas *evas, const char *str, Eina_Bool fake)
490{
491 char key_string[128] = {0};
492 unsigned int timestamp = 0;
493
494 if (!fake)
495 timestamp = get_time();
496
497 if (strncmp(str, "KeyRelease+", 11) == 0)
498 {
499 strncpy(key_string, str + 11, strlen(str)-11);
500 evas_event_feed_key_up(evas, key_string, key_string, NULL, NULL, timestamp, NULL);
501 SCIM_DEBUG_FRONTEND(1) << " evas_event_feed_key_up()...\n";
502 }
503 else
504 {
505 strncpy(key_string, str, strlen(str));
506 evas_event_feed_key_down(evas, key_string, key_string, NULL, NULL, timestamp, NULL);
507 SCIM_DEBUG_FRONTEND(1) << " evas_event_feed_key_down()...\n";
508 }
509}
510
511static void
512window_to_screen_geometry_get(Ecore_X_Window client_win, int *x, int *y)
513{
514 Ecore_X_Window root_window, win;
515 int win_x, win_y;
516 int sum_x = 0, sum_y = 0;
517
518 root_window = ecore_x_window_root_get(client_win);
519 win = client_win;
520
521 while (root_window != win)
522 {
523 ecore_x_window_geometry_get(win, &win_x, &win_y, NULL, NULL);
524 sum_x += win_x;
525 sum_y += win_y;
526 win = ecore_x_window_parent_get(win);
527 }
528
529 if (x)
530 *x = sum_x;
531 if (y)
532 *y = sum_y;
533}
534
535/* Public functions */
536/**
537 * isf_imf_context_new
538 *
539 * This function will be called by Ecore IMF.
540 * Create a instance of type EcoreIMFContextISF.
541 *
542 * Return value: A pointer to the newly created EcoreIMFContextISF instance
543 */
544EAPI EcoreIMFContextISF *
545isf_imf_context_new(void)
546{
547 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
548 char *env;
549
550 EcoreIMFContextISF *context_scim = new EcoreIMFContextISF;
551 if (context_scim == NULL)
552 {
553 std::cerr << "memory allocation failed in " << __FUNCTION__ << "\n";
554 return NULL;
555 }
556
557 context_scim->id = _context_count++;
558
559 if (!_scim_initialized)
560 {
561 initialize();
562 _scim_initialized = true;
563 }
564
565 env = getenv("ECORE_IMF_AUTOCAPITAL_ALLOW");
566 if (env)
567 autocap_allow = !!atoi(env);
568
569 return context_scim;
570}
571
572/**
573 * isf_imf_shutdown
574 *
575 * It will be called when the scim im module is unloaded by ecore. It will do some
576 * cleanup job.
577 */
578EAPI void
579isf_imf_context_shutdown(void)
580{
581 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
582
583 if (_scim_initialized)
584 {
585 _scim_initialized = false;
586 finalize();
587 }
588}
589
590EAPI void
591isf_imf_context_add(Ecore_IMF_Context *ctx)
592{
593 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
594
595 EcoreIMFContextISF *context_scim = (EcoreIMFContextISF*)ecore_imf_context_data_get(ctx);
596
597 if (!context_scim) return;
598
599 context_scim->impl = NULL;
600
601 if (_backend.null())
602 return;
603
604 IMEngineInstancePointer si;
605
606 // Use the default instance if "shared input method" mode is enabled.
607 if (_shared_input_method && !_default_instance.null())
608 {
609 si = _default_instance;
610 SCIM_DEBUG_FRONTEND(2) << "use default instance: " << si->get_id() << " " << si->get_factory_uuid() << "\n";
611 }
612
613 // Not in "shared input method" mode, or no default instance, create an instance.
614 if (si.null())
615 {
616 IMEngineFactoryPointer factory = _backend->get_default_factory(_language, "UTF-8");
617 if (factory.null()) return;
618 si = factory->create_instance("UTF-8", _instance_count++);
619 if (si.null()) return;
620 attach_instance(si);
621 SCIM_DEBUG_FRONTEND(2) << "create new instance: " << si->get_id() << " " << si->get_factory_uuid() << "\n";
622 }
623
624 // If "shared input method" mode is enabled, and there is no default instance,
625 // then store this instance as default one.
626 if (_shared_input_method && _default_instance.null())
627 {
628 SCIM_DEBUG_FRONTEND(2) << "update default instance.\n";
629 _default_instance = si;
630 }
631
632 context_scim->ctx = ctx;
633 context_scim->impl = new_ic_impl(context_scim);
634 if (context_scim->impl == NULL)
635 {
636 std::cerr << "memory allocation failed in " << __FUNCTION__ << "\n";
637 return;
638 }
639
640 context_scim->impl->si = si;
641 context_scim->impl->client_window = 0;
642 context_scim->impl->client_canvas = NULL;
643 context_scim->impl->preedit_caret = 0;
644 context_scim->impl->cursor_x = 0;
645 context_scim->impl->cursor_y = 0;
646 context_scim->impl->cursor_pos = -1;
647 context_scim->impl->is_on = false;
648 context_scim->impl->shared_si = _shared_input_method;
649 context_scim->impl->use_preedit = _on_the_spot;
650 context_scim->impl->preedit_started = false;
651 context_scim->impl->preedit_updating = false;
652 context_scim->impl->need_commit_preedit = false;
653
654 if (!_ic_list)
655 context_scim->next = NULL;
656 else
657 context_scim->next = _ic_list;
658 _ic_list = context_scim;
659
660 if (_shared_input_method)
661 context_scim->impl->is_on = _config->read(String(SCIM_CONFIG_FRONTEND_IM_OPENED_BY_DEFAULT), context_scim->impl->is_on);
662
663 _panel_client.prepare(context_scim->id);
664 _panel_client.register_input_context(context_scim->id, si->get_factory_uuid());
665 set_ic_capabilities(context_scim);
666 _panel_client.send();
667
668 SCIM_DEBUG_FRONTEND(2) << "input context created: id = " << context_scim->id << "\n";
669}
670
671EAPI void
672isf_imf_context_del(Ecore_IMF_Context *ctx)
673{
674 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
675
676 if (!_ic_list) return;
677
678 EcoreIMFContextISF *context_scim = (EcoreIMFContextISF*)ecore_imf_context_data_get(ctx);
679
680 if (context_scim)
681 {
682 if (context_scim->id != _ic_list->id)
683 {
684 EcoreIMFContextISF * pre = _ic_list;
685 EcoreIMFContextISF * cur = _ic_list->next;
686 while (cur != NULL)
687 {
688 if (cur->id == context_scim->id)
689 {
690 pre->next = cur->next;
691 break;
692 }
693 pre = cur;
694 cur = cur->next;
695 }
696 }
697 else
698 _ic_list = _ic_list->next;
699 }
700
701 if (context_scim && context_scim->impl)
702 {
703 _panel_client.prepare(context_scim->id);
704
705 if (context_scim == _focused_ic)
706 context_scim->impl->si->focus_out();
707
708 // Delete the instance.
709 EcoreIMFContextISF *old_focused = _focused_ic;
710 _focused_ic = context_scim;
711 context_scim->impl->si.reset();
712 _focused_ic = old_focused;
713
714 if (context_scim == _focused_ic)
715 {
716 _panel_client.turn_off(context_scim->id);
717 _panel_client.focus_out(context_scim->id);
718 }
719
720 _panel_client.remove_input_context(context_scim->id);
721 _panel_client.send();
722
723 if (context_scim->impl->client_window)
724 isf_imf_context_client_window_set(ctx, NULL);
725
726 if (context_scim->impl)
727 {
728 delete_ic_impl(context_scim->impl);
729 context_scim->impl = 0;
730 }
731 }
732
733 if (context_scim == _focused_ic)
734 _focused_ic = 0;
735
736 if (context_scim)
737 {
738 delete context_scim;
739 context_scim = 0;
740 }
741}
742
743/**
744 * isf_imf_context_client_canvas_set
745 * @ctx: a #Ecore_IMF_Context
746 * @canvas: the client canvas
747 *
748 * This function will be called by Ecore IMF.
749 *
750 * Set the client canvas for the Input Method Context; this is the canvas
751 * in which the input appears.
752 *
753 * The canvas type can be determined by using the context canvas type.
754 * Actually only canvas with type "evas" (Evas *) is supported. This canvas
755 * may be used in order to correctly position status windows, and may also
756 * be used for purposes internal to the Input Method Context.
757 */
758EAPI void
759isf_imf_context_client_canvas_set(Ecore_IMF_Context *ctx, void *canvas)
760{
761 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
762
763 EcoreIMFContextISF *context_scim = (EcoreIMFContextISF *)ecore_imf_context_data_get(ctx);
764
765 if (context_scim && context_scim->impl && context_scim->impl->client_canvas != (Evas*) canvas)
766 context_scim->impl->client_canvas = (Evas*)canvas;
767}
768
769/**
770 * isf_imf_context_client_window_set
771 * @ctx: a #Ecore_IMF_Context
772 * @window: the client window
773 *
774 * This function will be called by Ecore IMF.
775 *
776 * Set the client window for the Input Method Context; this is the Ecore_X_Window
777 * when using X11, Ecore_Win32_Window when using Win32, etc.
778 *
779 * This window is used in order to correctly position status windows,
780 * and may also be used for purposes internal to the Input Method Context.
781 */
782EAPI void
783isf_imf_context_client_window_set(Ecore_IMF_Context *ctx, void *window)
784{
785 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
786
787 EcoreIMFContextISF *context_scim = (EcoreIMFContextISF *)ecore_imf_context_data_get(ctx);
788
789 if (context_scim && context_scim->impl && context_scim->impl->client_window != (Ecore_X_Window)((Ecore_Window)window))
790 {
791 context_scim->impl->client_window = (Ecore_X_Window)((Ecore_Window)window);
792
793 if ((context_scim->impl->client_window != 0) &&
794 (context_scim->impl->client_window != _client_window))
795 _client_window = context_scim->impl->client_window;
796 }
797}
798
799/**
800 * isf_imf_context_reset
801 * @ctx: a #Ecore_IMF_Context
802 *
803 * This function will be called by Ecore IMF.
804 *
805 * Notify the Input Method Context that a change such as a change in cursor
806 * position has been made. This will typically cause the Input Method Context
807 * to clear the preedit state.
808 */
809EAPI void
810isf_imf_context_reset(Ecore_IMF_Context *ctx)
811{
812 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
813
814 EcoreIMFContextISF *context_scim = (EcoreIMFContextISF *)ecore_imf_context_data_get(ctx);
815
816 if (context_scim && context_scim->impl && context_scim == _focused_ic)
817 {
818 WideString wstr = context_scim->impl->preedit_string;
819
820 _panel_client.prepare(context_scim->id);
821 context_scim->impl->si->reset();
822 _panel_client.send();
823
824 if (context_scim->impl->need_commit_preedit)
825 {
826 if (wstr.length())
827 {
828 ecore_imf_context_commit_event_add(context_scim->ctx, utf8_wcstombs(wstr).c_str());
829 ecore_imf_context_event_callback_call(context_scim->ctx, ECORE_IMF_CALLBACK_COMMIT, (void *)utf8_wcstombs(wstr).c_str());
830 }
831 _panel_client.prepare(context_scim->id);
832 _panel_client.send();
833 }
834 }
835}
836
837/**
838 * isf_imf_context_focus_in
839 * @ctx: a #Ecore_IMF_Context
840 *
841 * This function will be called by Ecore IMF.
842 *
843 * Notify the Input Method Context that the widget to which its correspond has gained focus.
844 */
845EAPI void
846isf_imf_context_focus_in(Ecore_IMF_Context *ctx)
847{
848 EcoreIMFContextISF *context_scim = (EcoreIMFContextISF *)ecore_imf_context_data_get(ctx);
849
850 if (!context_scim)
851 return;
852
853 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__<< "(" << context_scim->id << ")...\n";
854
855 if (_focused_ic)
856 {
857 if (_focused_ic == context_scim)
858 {
859 SCIM_DEBUG_FRONTEND(1) << "It's already focused.\n";
860 return;
861 }
862 SCIM_DEBUG_FRONTEND(1) << "Focus out previous IC first: " << _focused_ic->id << "\n";
863 if (_focused_ic->ctx)
864 isf_imf_context_focus_out(_focused_ic->ctx);
865 }
866
867 bool need_cap = false;
868 bool need_reset = false;
869 bool need_reg = false;
870
871 if (context_scim && context_scim->impl)
872 {
873 _focused_ic = context_scim;
874 _panel_client.prepare(context_scim->id);
875
876 // Handle the "Shared Input Method" mode.
877 if (_shared_input_method)
878 {
879 SCIM_DEBUG_FRONTEND(2) << "shared input method.\n";
880 IMEngineFactoryPointer factory = _backend->get_default_factory(_language, "UTF-8");
881 if (!factory.null())
882 {
883 if (_default_instance.null() || _default_instance->get_factory_uuid() != factory->get_uuid())
884 {
885 _default_instance = factory->create_instance("UTF-8", _default_instance.null() ? _instance_count++ : _default_instance->get_id());
886 attach_instance(_default_instance);
887 SCIM_DEBUG_FRONTEND(2) << "create new default instance: " << _default_instance->get_id() << " " << _default_instance->get_factory_uuid() << "\n";
888 }
889
890 context_scim->impl->shared_si = true;
891 context_scim->impl->si = _default_instance;
892
893 context_scim->impl->is_on = _config->read(String(SCIM_CONFIG_FRONTEND_IM_OPENED_BY_DEFAULT), context_scim->impl->is_on);
894 context_scim->impl->preedit_string.clear();
895 context_scim->impl->preedit_attrlist.clear();
896 context_scim->impl->preedit_caret = 0;
897 context_scim->impl->preedit_started = false;
898 need_cap = true;
899 need_reset = true;
900 need_reg = true;
901 }
902 }
903 else if (context_scim->impl->shared_si)
904 {
905 SCIM_DEBUG_FRONTEND(2) << "exit shared input method.\n";
906 IMEngineFactoryPointer factory = _backend->get_default_factory(_language, "UTF-8");
907 if (!factory.null())
908 {
909 context_scim->impl->si = factory->create_instance("UTF-8", _instance_count++);
910 context_scim->impl->preedit_string.clear();
911 context_scim->impl->preedit_attrlist.clear();
912 context_scim->impl->preedit_caret = 0;
913 context_scim->impl->preedit_started = false;
914 attach_instance(context_scim->impl->si);
915 need_cap = true;
916 need_reg = true;
917 context_scim->impl->shared_si = false;
918 SCIM_DEBUG_FRONTEND(2) << "create new instance: " << context_scim->impl->si->get_id() << " " << context_scim->impl->si->get_factory_uuid() << "\n";
919 }
920 }
921
922 context_scim->impl->si->set_frontend_data(static_cast <void*>(context_scim));
923
924 if (need_reg) _panel_client.register_input_context(context_scim->id, context_scim->impl->si->get_factory_uuid());
925 if (need_cap) set_ic_capabilities(context_scim);
926 if (need_reset) context_scim->impl->si->reset();
927
928 panel_req_focus_in(context_scim);
929 panel_req_update_spot_location(context_scim);
930 panel_req_update_factory_info(context_scim);
931
932 if (context_scim->impl->is_on)
933 {
934 _panel_client.turn_on(context_scim->id);
935 _panel_client.hide_preedit_string(context_scim->id);
936 _panel_client.hide_aux_string(context_scim->id);
937 _panel_client.hide_lookup_table(context_scim->id);
938 context_scim->impl->si->focus_in();
939 }
940 else
941 {
942 _panel_client.turn_off(context_scim->id);
943 }
944
945 _panel_client.send();
946 }
947
948 if (ecore_imf_context_input_panel_enabled_get(ctx))
949 ecore_imf_context_input_panel_show(ctx);
950}
951
952/**
953 * isf_imf_context_focus_out
954 * @ctx: a #Ecore_IMF_Context
955 *
956 * This function will be called by Ecore IMF.
957 *
958 * Notify the Input Method Context that the widget to which its correspond has lost focus.
959 */
960EAPI void
961isf_imf_context_focus_out(Ecore_IMF_Context *ctx)
962{
963 EcoreIMFContextISF *context_scim = (EcoreIMFContextISF *)ecore_imf_context_data_get(ctx);
964
965 if (!context_scim) return;
966
967 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "(" << context_scim->id << ")...\n";
968
969 if (context_scim && context_scim->impl && context_scim == _focused_ic)
970 {
971 WideString wstr = context_scim->impl->preedit_string;
972
973 if (context_scim->impl->need_commit_preedit)
974 {
975 if (wstr.length())
976 {
977 ecore_imf_context_commit_event_add(context_scim->ctx, utf8_wcstombs(wstr).c_str());
978 ecore_imf_context_event_callback_call(context_scim->ctx, ECORE_IMF_CALLBACK_COMMIT, (void *)utf8_wcstombs(wstr).c_str());
979 }
980 _panel_client.prepare(context_scim->id);
981 _panel_client.send();
982 }
983
984 _panel_client.prepare(context_scim->id);
985 context_scim->impl->si->focus_out();
986 context_scim->impl->si->reset();
987 _panel_client.turn_off(context_scim->id);
988 _panel_client.focus_out(context_scim->id);
989 _panel_client.send();
990 _focused_ic = 0;
991 }
992
993 if (ecore_imf_context_input_panel_enabled_get(ctx))
994 ecore_imf_context_input_panel_hide(ctx);
995}
996
997/**
998 * isf_imf_context_cursor_location_set
999 * @ctx: a #Ecore_IMF_Context
1000 * @x: x position of New cursor.
1001 * @y: y position of New cursor.
1002 * @w: the width of New cursor.
1003 * @h: the height of New cursor.
1004 *
1005 * This function will be called by Ecore IMF.
1006 *
1007 * Notify the Input Method Context that a change in the cursor location has been made.
1008 */
1009EAPI void
1010isf_imf_context_cursor_location_set(Ecore_IMF_Context *ctx, int cx, int cy, int cw, int ch)
1011{
1012 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
1013
1014 EcoreIMFContextISF *context_scim = (EcoreIMFContextISF *)ecore_imf_context_data_get(ctx);
1015 Ecore_Evas *ee;
1016 int canvas_x, canvas_y;
1017
1018 if (cw == 0 && ch == 0)
1019 return;
1020
1021 if (context_scim && context_scim->impl && context_scim == _focused_ic)
1022 {
1023 // Don't update spot location while updating preedit string.
1024 if (context_scim->impl->preedit_updating)
1025 return;
1026
1027 if (context_scim->impl->client_canvas)
1028 {
1029 ee = ecore_evas_ecore_evas_get(context_scim->impl->client_canvas);
1030 if (!ee) return;
1031
1032 ecore_evas_geometry_get(ee, &canvas_x, &canvas_y, NULL, NULL);
1033 }
1034 else
1035 {
1036 if (context_scim->impl->client_window)
1037 window_to_screen_geometry_get(context_scim->impl->client_window, &canvas_x, &canvas_y);
1038 else
1039 return;
1040 }
1041
1042 if (context_scim->impl->cursor_x != canvas_x + cx || context_scim->impl->cursor_y != canvas_y + cy + ch)
1043 {
1044 context_scim->impl->cursor_x = canvas_x + cx;
1045 context_scim->impl->cursor_y = canvas_y + cy + ch;
1046 _panel_client.prepare(context_scim->id);
1047 panel_req_update_spot_location(context_scim);
1048 _panel_client.send();
1049 SCIM_DEBUG_FRONTEND(2) << "new cursor location = " << context_scim->impl->cursor_x << "," << context_scim->impl->cursor_y << "\n";
1050 }
1051 }
1052}
1053
1054/**
1055 * isf_imf_context_use_preedit_set
1056 * @ctx: a #Ecore_IMF_Context
1057 * @use_preedit: Whether the IM context should use the preedit string.
1058 *
1059 * This function will be called by Ecore IMF.
1060 *
1061 * Set whether the IM context should use the preedit string to display feedback.
1062 * If is 0 (default is 1), then the IM context may use some other method to
1063 * display feedback, such as displaying it in a child of the root window.
1064 */
1065EAPI void
1066isf_imf_context_use_preedit_set(Ecore_IMF_Context* ctx, Eina_Bool use_preedit)
1067{
1068 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " = " << (use_preedit ? "true" : "false") << "...\n";
1069
1070 EcoreIMFContextISF *context_scim = (EcoreIMFContextISF*)ecore_imf_context_data_get(ctx);
1071
1072 if (!_on_the_spot) return;
1073
1074 if (context_scim && context_scim->impl)
1075 {
1076 bool old = context_scim->impl->use_preedit;
1077 context_scim->impl->use_preedit = use_preedit;
1078 if (context_scim == _focused_ic)
1079 {
1080 _panel_client.prepare(context_scim->id);
1081
1082 if (old != use_preedit)
1083 set_ic_capabilities(context_scim);
1084
1085 if (context_scim->impl->preedit_string.length())
1086 slot_show_preedit_string(context_scim->impl->si);
1087
1088 _panel_client.send();
1089 }
1090 }
1091}
1092
1093EAPI void
1094isf_imf_context_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx, char** str, Eina_List **attrs, int *cursor_pos)
1095{
1096 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
1097
1098 EcoreIMFContextISF *context_scim = (EcoreIMFContextISF*)ecore_imf_context_data_get(ctx);
1099
1100 if (context_scim && context_scim->impl && context_scim->impl->is_on)
1101 {
1102 String mbs = utf8_wcstombs(context_scim->impl->preedit_string);
1103
1104 if (str)
1105 {
1106 if (mbs.length())
1107 *str = strdup(mbs.c_str());
1108 else
1109 *str = strdup("");
1110 }
1111
1112 if (cursor_pos)
1113 {
1114 *cursor_pos = context_scim->impl->preedit_caret;
1115 }
1116
1117 if (attrs)
1118 {
1119 if (mbs.length())
1120 {
1121 int start_index, end_index;
1122 int wlen = context_scim->impl->preedit_string.length();
1123
1124 Ecore_IMF_Preedit_Attr *attr = NULL;
1125 AttributeList::const_iterator i;
1126 bool *attrs_flag = new bool [mbs.length()];
1127 memset(attrs_flag, 0, mbs.length() *sizeof(bool));
1128
1129 for (i = context_scim->impl->preedit_attrlist.begin();
1130 i != context_scim->impl->preedit_attrlist.end(); ++i)
1131 {
1132 start_index = i->get_start();
1133 end_index = i->get_end();
1134
1135 if (end_index <= wlen && start_index < end_index && i->get_type() != SCIM_ATTR_DECORATE_NONE)
1136 {
1137 start_index = utf8_offset_to_index(mbs.c_str(), i->get_start());
1138 end_index = utf8_offset_to_index(mbs.c_str(), i->get_end());
1139
1140 if (i->get_type() == SCIM_ATTR_DECORATE)
1141 {
1142 attr = (Ecore_IMF_Preedit_Attr *)calloc(1, sizeof(Ecore_IMF_Preedit_Attr));
1143 if (attr == NULL)
1144 continue;
1145 attr->start_index = start_index;
1146 attr->end_index = end_index;
1147
1148 if (i->get_value() == SCIM_ATTR_DECORATE_UNDERLINE)
1149 {
1150 attr->preedit_type = ECORE_IMF_PREEDIT_TYPE_SUB1;
1151 *attrs = eina_list_append(*attrs, (void *)attr);
1152 }
1153 else if (i->get_value() == SCIM_ATTR_DECORATE_REVERSE)
1154 {
1155 attr->preedit_type = ECORE_IMF_PREEDIT_TYPE_SUB2;
1156 *attrs = eina_list_append(*attrs, (void *)attr);
1157 }
1158 else if (i->get_value() == SCIM_ATTR_DECORATE_HIGHLIGHT)
1159 {
1160 attr->preedit_type = ECORE_IMF_PREEDIT_TYPE_SUB3;
1161 *attrs = eina_list_append(*attrs, (void *)attr);
1162 }
1163 else
1164 {
1165 free(attr);
1166 }
1167
1168 switch(i->get_value())
1169 {
1170 case SCIM_ATTR_DECORATE_UNDERLINE:
1171 case SCIM_ATTR_DECORATE_REVERSE:
1172 case SCIM_ATTR_DECORATE_HIGHLIGHT:
1173 // Record which character has attribute.
1174 for (int pos = start_index; pos < end_index; ++pos)
1175 attrs_flag [pos] = 1;
1176 break;
1177 default:
1178 break;
1179 }
1180 }
1181 else if (i->get_type() == SCIM_ATTR_FOREGROUND)
1182 {
1183 SCIM_DEBUG_FRONTEND(4) << "SCIM_ATTR_FOREGROUND\n";
1184 }
1185 else if (i->get_type() == SCIM_ATTR_BACKGROUND)
1186 {
1187 SCIM_DEBUG_FRONTEND(4) << "SCIM_ATTR_BACKGROUND\n";
1188 }
1189 }
1190 }
1191
1192 // Add underline for all characters which don't have attribute.
1193 for (unsigned int pos = 0; pos < mbs.length(); ++pos)
1194 {
1195 if (!attrs_flag [pos])
1196 {
1197 int begin_pos = pos;
1198
1199 while (pos < mbs.length() && !attrs_flag[pos])
1200 ++pos;
1201
1202 // use REVERSE style as default
1203 attr = (Ecore_IMF_Preedit_Attr *)calloc(1, sizeof(Ecore_IMF_Preedit_Attr));
1204 if (attr == NULL)
1205 continue;
1206 attr->preedit_type = ECORE_IMF_PREEDIT_TYPE_SUB2;
1207 attr->start_index = begin_pos;
1208 attr->end_index = pos;
1209 *attrs = eina_list_append(*attrs, (void *)attr);
1210 }
1211 }
1212
1213 delete [] attrs_flag;
1214 }
1215 }
1216 }
1217 else
1218 {
1219 if (str)
1220 *str = strdup("");
1221
1222 if (cursor_pos)
1223 *cursor_pos = 0;
1224
1225 if (attrs)
1226 *attrs = NULL;
1227 }
1228}
1229
1230/**
1231 * isf_imf_context_preedit_string_get
1232 * @ctx: a #Ecore_IMF_Context
1233 * @str: the preedit string
1234 * @cursor_pos: the cursor position
1235 *
1236 * This function will be called by Ecore IMF.
1237 *
1238 * To get the preedit string of the input method.
1239 */
1240EAPI void
1241isf_imf_context_preedit_string_get(Ecore_IMF_Context *ctx, char** str, int *cursor_pos)
1242{
1243 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
1244
1245 EcoreIMFContextISF *context_scim = (EcoreIMFContextISF*)ecore_imf_context_data_get(ctx);
1246
1247 if (context_scim && context_scim->impl && context_scim->impl->is_on)
1248 {
1249 String mbs = utf8_wcstombs(context_scim->impl->preedit_string);
1250
1251 if (str)
1252 {
1253 if (mbs.length())
1254 *str = strdup(mbs.c_str());
1255 else
1256 *str = strdup("");
1257 }
1258
1259 if (cursor_pos)
1260 *cursor_pos = context_scim->impl->preedit_caret;
1261 }
1262 else
1263 {
1264 if (str)
1265 *str = strdup("");
1266
1267 if (cursor_pos)
1268 *cursor_pos = 0;
1269 }
1270}
1271
1272/**
1273 * isf_imf_context_cursor_position_set
1274 * @ctx: a #Ecore_IMF_Context
1275 * @cursor_pos: New cursor position in characters.
1276 *
1277 * This function will be called by Ecore IMF.
1278 *
1279 * Notify the Input Method Context that a change in the cursor position has been made.
1280 */
1281EAPI void
1282isf_imf_context_cursor_position_set(Ecore_IMF_Context *ctx, int cursor_pos)
1283{
1284 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
1285
1286 EcoreIMFContextISF *context_scim = (EcoreIMFContextISF *)ecore_imf_context_data_get(ctx);
1287
1288 if (context_scim && context_scim->impl && context_scim == _focused_ic)
1289 {
1290 // Don't update spot location while updating preedit string.
1291 if (context_scim->impl->preedit_updating)
1292 return;
1293
1294 if (context_scim->impl->cursor_pos != cursor_pos)
1295 {
1296 context_scim->impl->cursor_pos = cursor_pos;
1297 caps_mode_check(ctx, EINA_FALSE);
1298 }
1299 }
1300}
1301
1302/**
1303 * isf_imf_context_input_mode_set
1304 * @ctx: a #Ecore_IMF_Context
1305 * @input_mode: the input mode
1306 *
1307 * This function will be called by Ecore IMF.
1308 *
1309 * To set the input mode of input method. The definition of Ecore_IMF_Input_Mode
1310 * is in Ecore_IMF.h.
1311 */
1312EAPI void
1313isf_imf_context_input_mode_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode)
1314{
1315 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
1316
1317 EcoreIMFContextISF *context_scim = (EcoreIMFContextISF*)ecore_imf_context_data_get(ctx);
1318 if (context_scim && context_scim->impl)
1319 context_scim->impl->input_mode = input_mode;
1320}
1321
1322/**
1323 * isf_imf_context_prediction_allow_set
1324 * @ctx: a #Ecore_IMF_Context
1325 * @use_prediction: Whether the IM context should use the prediction.
1326 *
1327 * This function will be called by Ecore IMF.
1328 *
1329 * Set whether the IM context should use the prediction.
1330 */
1331EAPI void
1332isf_imf_context_prediction_allow_set(Ecore_IMF_Context* ctx, Eina_Bool prediction)
1333{
1334 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " = " << (prediction ? "true" : "false") << "...\n";
1335
1336 EcoreIMFContextISF *context_scim = (EcoreIMFContextISF *)ecore_imf_context_data_get(ctx);
1337
1338 if (context_scim && context_scim->impl && context_scim->impl->prediction_allow != prediction)
1339 context_scim->impl->prediction_allow = prediction;
1340}
1341
1342EAPI void
1343isf_imf_context_autocapital_type_set(Ecore_IMF_Context* ctx, Ecore_IMF_Autocapital_Type autocapital_type)
1344{
1345 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " = " << autocapital_type << "...\n";
1346
1347 EcoreIMFContextISF *context_scim = (EcoreIMFContextISF *)ecore_imf_context_data_get(ctx);
1348
1349 if (context_scim && context_scim->impl && context_scim->impl->autocapital_type != autocapital_type)
1350 context_scim->impl->autocapital_type = autocapital_type;
1351}
1352
1353/**
1354 * isf_imf_context_filter_event
1355 * @ctx: a #Ecore_IMF_Context
1356 * @type: The type of event defined by Ecore_IMF_Event_Type.
1357 * @event: The event itself.
1358 * Return value: %TRUE if the input method handled the key event.
1359 *
1360 * This function will be called by Ecore IMF.
1361 *
1362 * Allow an Ecore Input Context to internally handle an event. If this function
1363 * returns 1, then no further processing should be done for this event. Input
1364 * methods must be able to accept all types of events (simply returning 0 if
1365 * the event was not handled), but there is no obligation of any events to be
1366 * submitted to this function.
1367 */
1368
1369EAPI Eina_Bool
1370isf_imf_context_filter_event(Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event)
1371{
1372 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
1373
1374 EcoreIMFContextISF *ic = (EcoreIMFContextISF*)ecore_imf_context_data_get(ctx);
1375 Eina_Bool ret = EINA_FALSE;
1376
1377 if (ic == NULL || ic->impl == NULL)
1378 return ret;
1379
1380 KeyEvent key;
1381
1382 if (type == ECORE_IMF_EVENT_KEY_DOWN)
1383 {
1384 Ecore_IMF_Event_Key_Down *ev = (Ecore_IMF_Event_Key_Down *)event;
1385 scim_string_to_key(key, ev->key);
1386 if (ev->modifiers & ECORE_IMF_KEYBOARD_MODIFIER_SHIFT) key.mask |=SCIM_KEY_ShiftMask;
1387 if (ev->modifiers & ECORE_IMF_KEYBOARD_MODIFIER_CTRL) key.mask |=SCIM_KEY_ControlMask;
1388 if (ev->modifiers & ECORE_IMF_KEYBOARD_MODIFIER_ALT) key.mask |=SCIM_KEY_AltMask;
1389 if (ev->locks & ECORE_IMF_KEYBOARD_LOCK_CAPS) key.mask |=SCIM_KEY_CapsLockMask;
1390 if (ev->locks & ECORE_IMF_KEYBOARD_LOCK_NUM) key.mask |=SCIM_KEY_NumLockMask;
1391 }
1392 else if (type == ECORE_IMF_EVENT_KEY_UP)
1393 {
1394 Ecore_IMF_Event_Key_Up *ev = (Ecore_IMF_Event_Key_Up *)event;
1395 scim_string_to_key(key, ev->key);
1396 key.mask = SCIM_KEY_ReleaseMask;
1397 if (ev->modifiers & ECORE_IMF_KEYBOARD_MODIFIER_SHIFT) key.mask |=SCIM_KEY_ShiftMask;
1398 if (ev->modifiers & ECORE_IMF_KEYBOARD_MODIFIER_CTRL) key.mask |=SCIM_KEY_ControlMask;
1399 if (ev->modifiers & ECORE_IMF_KEYBOARD_MODIFIER_ALT) key.mask |=SCIM_KEY_AltMask;
1400 if (ev->locks & ECORE_IMF_KEYBOARD_LOCK_CAPS) key.mask |=SCIM_KEY_CapsLockMask;
1401 if (ev->locks & ECORE_IMF_KEYBOARD_LOCK_NUM) key.mask |=SCIM_KEY_NumLockMask;
1402 }
1403 else
1404 {
1405 return ret;
1406 }
1407
1408 key.mask &= _valid_key_mask;
1409
1410 _panel_client.prepare(ic->id);
1411
1412 ret = EINA_TRUE;
1413 if (!filter_hotkeys(ic, key))
1414 {
1415 if (!_focused_ic || !_focused_ic->impl->is_on ||
1416 !_focused_ic->impl->si->process_key_event(key))
1417 ret = EINA_FALSE;
1418 }
1419
1420 _panel_client.send();
1421
1422 return ret;
1423}
1424
1425EAPI void
1426isf_imf_context_input_panel_show(Ecore_IMF_Context *ctx)
1427{
1428 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
1429
1430 EcoreIMFContextISF *ic = (EcoreIMFContextISF*)ecore_imf_context_data_get(ctx);
1431 if (ic == NULL || ic->impl == NULL)
1432 return;
1433
1434 ecore_x_e_virtual_keyboard_state_set
1435 (ic->impl->client_window, ECORE_X_VIRTUAL_KEYBOARD_STATE_ON);
1436}
1437
1438EAPI void
1439isf_imf_context_input_panel_hide(Ecore_IMF_Context *ctx)
1440{
1441 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
1442
1443 EcoreIMFContextISF *ic = (EcoreIMFContextISF*)ecore_imf_context_data_get(ctx);
1444 if (ic == NULL || ic->impl == NULL)
1445 return;
1446
1447 ecore_x_e_virtual_keyboard_state_set
1448 (ic->impl->client_window, ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF);
1449}
1450
1451/* Panel Slot functions */
1452static void
1453panel_slot_reload_config(int context __UNUSED__)
1454{
1455 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
1456 _config->reload();
1457}
1458
1459static void
1460panel_slot_exit(int /* context */)
1461{
1462 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
1463
1464 finalize();
1465}
1466
1467static void
1468panel_slot_update_lookup_table_page_size(int context, int page_size)
1469{
1470 EcoreIMFContextISF *ic = find_ic(context);
1471 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " context=" << context << " page_size=" << page_size << " ic=" << ic << "\n";
1472 if (ic && ic->impl)
1473 {
1474 _panel_client.prepare(ic->id);
1475 ic->impl->si->update_lookup_table_page_size(page_size);
1476 _panel_client.send();
1477 }
1478}
1479
1480static void
1481panel_slot_lookup_table_page_up(int context)
1482{
1483 EcoreIMFContextISF *ic = find_ic(context);
1484 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " context=" << context << " ic=" << ic << "\n";
1485 if (ic && ic->impl)
1486 {
1487 _panel_client.prepare(ic->id);
1488 ic->impl->si->lookup_table_page_up();
1489 _panel_client.send();
1490 }
1491}
1492
1493static void
1494panel_slot_lookup_table_page_down(int context)
1495{
1496 EcoreIMFContextISF *ic = find_ic(context);
1497 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " context=" << context << " ic=" << ic << "\n";
1498 if (ic && ic->impl)
1499 {
1500 _panel_client.prepare(ic->id);
1501 ic->impl->si->lookup_table_page_down();
1502 _panel_client.send();
1503 }
1504}
1505
1506static void
1507panel_slot_trigger_property(int context, const String &property)
1508{
1509 EcoreIMFContextISF *ic = find_ic(context);
1510 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " context=" << context << " property=" << property << " ic=" << ic << "\n";
1511 if (ic && ic->impl)
1512 {
1513 _panel_client.prepare(ic->id);
1514 ic->impl->si->trigger_property(property);
1515 _panel_client.send();
1516 }
1517}
1518
1519static void
1520panel_slot_process_helper_event(int context, const String &target_uuid, const String &helper_uuid, const Transaction &trans)
1521{
1522 EcoreIMFContextISF *ic = find_ic(context);
1523 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " context=" << context << " target=" << target_uuid
1524 << " helper=" << helper_uuid << " ic=" << ic << " ic->impl=" << (ic ? ic->impl : 0) << " ic-uuid="
1525 << ((ic && ic->impl) ? ic->impl->si->get_factory_uuid() : "" ) << "\n";
1526 if (ic && ic->impl && ic->impl->si->get_factory_uuid() == target_uuid)
1527 {
1528 _panel_client.prepare(ic->id);
1529 SCIM_DEBUG_FRONTEND(2) << "call process_helper_event\n";
1530 ic->impl->si->process_helper_event(helper_uuid, trans);
1531 _panel_client.send();
1532 }
1533}
1534
1535static void
1536panel_slot_move_preedit_caret(int context, int caret_pos)
1537{
1538 EcoreIMFContextISF *ic = find_ic(context);
1539 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " context=" << context << " caret=" << caret_pos << " ic=" << ic << "\n";
1540 if (ic && ic->impl)
1541 {
1542 _panel_client.prepare(ic->id);
1543 ic->impl->si->move_preedit_caret(caret_pos);
1544 _panel_client.send();
1545 }
1546}
1547
1548static void
1549panel_slot_select_candidate(int context, int cand_index)
1550{
1551 EcoreIMFContextISF *ic = find_ic(context);
1552 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " context=" << context << " candidate=" << cand_index << " ic=" << ic << "\n";
1553 if (ic && ic->impl)
1554 {
1555 _panel_client.prepare(ic->id);
1556 ic->impl->si->select_candidate(cand_index);
1557 _panel_client.send();
1558 }
1559}
1560
1561static void
1562panel_slot_process_key_event(int context, const KeyEvent &key)
1563{
1564 EcoreIMFContextISF *ic = find_ic(context);
1565 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " context=" << context << " key=" << key.get_key_string() << " ic=" << ic << "\n";
1566
1567 if (key.is_key_press())
1568 ecore_x_test_fake_key_press(key.get_key_string().c_str());
1569}
1570
1571static void
1572panel_slot_commit_string(int context, const WideString &wstr)
1573{
1574 EcoreIMFContextISF *ic = find_ic(context);
1575 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " context=" << context << " str=" << utf8_wcstombs(wstr) << " ic=" << ic << "\n";
1576
1577 if (ic && ic->impl)
1578 {
1579 if (_focused_ic != ic)
1580 return;
1581
1582 ecore_imf_context_commit_event_add(ic->ctx, utf8_wcstombs(wstr).c_str());
1583 ecore_imf_context_event_callback_call(ic->ctx, ECORE_IMF_CALLBACK_COMMIT, (void *)utf8_wcstombs(wstr).c_str());
1584 }
1585}
1586
1587static void
1588panel_slot_forward_key_event(int context, const KeyEvent &key)
1589{
1590 EcoreIMFContextISF *ic = find_ic(context);
1591 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " context=" << context << " key=" << key.get_key_string() << " ic=" << ic << "\n";
1592
1593 if (ic && ic->impl && ic->impl->client_canvas)
1594 feed_key_event(ic->impl->client_canvas, key.get_key_string().c_str(), EINA_TRUE);
1595}
1596
1597static void
1598panel_slot_request_help(int context)
1599{
1600 EcoreIMFContextISF *ic = find_ic(context);
1601 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " context=" << context << " ic=" << ic << "\n";
1602
1603 if (ic && ic->impl)
1604 {
1605 _panel_client.prepare(ic->id);
1606 panel_req_show_help(ic);
1607 _panel_client.send();
1608 }
1609}
1610
1611static void
1612panel_slot_request_factory_menu(int context)
1613{
1614 EcoreIMFContextISF *ic = find_ic(context);
1615 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " context=" << context << " ic=" << ic << "\n";
1616
1617 if (ic && ic->impl)
1618 {
1619 _panel_client.prepare(ic->id);
1620 panel_req_show_factory_menu(ic);
1621 _panel_client.send();
1622 }
1623}
1624
1625static void
1626panel_slot_change_factory(int context, const String &uuid)
1627{
1628 EcoreIMFContextISF *ic = find_ic(context);
1629 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " context=" << context << " factory=" << uuid << " ic=" << ic << "\n";
1630
1631 if (ic && ic->impl)
1632 {
1633 ic->impl->si->reset();
1634 _panel_client.prepare(ic->id);
1635 open_specific_factory(ic, uuid);
1636 _panel_client.send();
1637 }
1638}
1639
1640/* Panel Requestion functions. */
1641static void
1642panel_req_show_help(EcoreIMFContextISF *ic)
1643{
1644 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
1645
1646 String help;
1647
1648 help = String("Smart Common Input Method platform ") +
1649 //String(SCIM_VERSION) +
1650 String("\n(C) 2002-2005 James Su <suzhe@tsinghua.org.cn>\n\n");
1651
1652 if (ic && ic->impl)
1653 {
1654 IMEngineFactoryPointer sf = _backend->get_factory(ic->impl->si->get_factory_uuid());
1655 if (sf)
1656 {
1657 help += utf8_wcstombs(sf->get_name());
1658 help += String(":\n\n");
1659
1660 help += utf8_wcstombs(sf->get_help());
1661 help += String("\n\n");
1662
1663 help += utf8_wcstombs(sf->get_credits());
1664 }
1665 _panel_client.show_help(ic->id, help);
1666 }
1667}
1668
1669static void
1670panel_req_show_factory_menu(EcoreIMFContextISF *ic)
1671{
1672 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
1673
1674 std::vector<IMEngineFactoryPointer> factories;
1675 std::vector <PanelFactoryInfo> menu;
1676
1677 _backend->get_factories_for_encoding(factories, "UTF-8");
1678
1679 for (size_t i = 0; i < factories.size(); ++ i)
1680 {
1681 menu.push_back(PanelFactoryInfo(
1682 factories [i]->get_uuid(),
1683 utf8_wcstombs(factories [i]->get_name()),
1684 factories [i]->get_language(),
1685 factories [i]->get_icon_file()));
1686 }
1687
1688 if (menu.size())
1689 _panel_client.show_factory_menu(ic->id, menu);
1690}
1691
1692static void
1693panel_req_update_factory_info(EcoreIMFContextISF *ic)
1694{
1695 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
1696
1697 if (ic && ic->impl && ic == _focused_ic)
1698 {
1699 PanelFactoryInfo info;
1700 if (ic->impl->is_on)
1701 {
1702 IMEngineFactoryPointer sf = _backend->get_factory(ic->impl->si->get_factory_uuid());
1703 if (sf)
1704 info = PanelFactoryInfo(sf->get_uuid(), utf8_wcstombs(sf->get_name()), sf->get_language(), sf->get_icon_file());
1705 }
1706 else
1707 {
1708 info = PanelFactoryInfo(String(""), String("English/Keyboard"), String("C"), "");
1709 }
1710 _panel_client.update_factory_info(ic->id, info);
1711 }
1712}
1713
1714static void
1715panel_req_focus_in(EcoreIMFContextISF *ic)
1716{
1717 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
1718
1719 _panel_client.focus_in(ic->id, ic->impl->si->get_factory_uuid());
1720}
1721
1722static void
1723panel_req_update_spot_location(EcoreIMFContextISF *ic)
1724{
1725 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
1726
1727 _panel_client.update_spot_location(ic->id, ic->impl->cursor_x, ic->impl->cursor_y);
1728}
1729
1730static bool
1731filter_hotkeys(EcoreIMFContextISF *ic, const KeyEvent &key)
1732{
1733 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
1734
1735 bool ret = false;
1736
1737 _frontend_hotkey_matcher.push_key_event(key);
1738 _imengine_hotkey_matcher.push_key_event(key);
1739
1740 FrontEndHotkeyAction hotkey_action = _frontend_hotkey_matcher.get_match_result();
1741
1742 if (hotkey_action == SCIM_FRONTEND_HOTKEY_TRIGGER)
1743 {
1744 if (!ic->impl->is_on)
1745 turn_on_ic(ic);
1746 else
1747 turn_off_ic(ic);
1748 ret = true;
1749 }
1750 else if (hotkey_action == SCIM_FRONTEND_HOTKEY_ON)
1751 {
1752 if (!ic->impl->is_on)
1753 turn_on_ic(ic);
1754 ret = true;
1755 }
1756 else if (hotkey_action == SCIM_FRONTEND_HOTKEY_OFF)
1757 {
1758 if (ic->impl->is_on)
1759 turn_off_ic(ic);
1760 ret = true;
1761 }
1762 else if (hotkey_action == SCIM_FRONTEND_HOTKEY_NEXT_FACTORY)
1763 {
1764 open_next_factory(ic);
1765 ret = true;
1766 }
1767 else if (hotkey_action == SCIM_FRONTEND_HOTKEY_PREVIOUS_FACTORY)
1768 {
1769 open_previous_factory(ic);
1770 ret = true;
1771 }
1772 else if (hotkey_action == SCIM_FRONTEND_HOTKEY_SHOW_FACTORY_MENU)
1773 {
1774 panel_req_show_factory_menu(ic);
1775 ret = true;
1776 }
1777 else if (_imengine_hotkey_matcher.is_matched())
1778 {
1779 String sfid = _imengine_hotkey_matcher.get_match_result();
1780 open_specific_factory(ic, sfid);
1781 ret = true;
1782 }
1783 return ret;
1784}
1785
1786static bool
1787panel_initialize(void)
1788{
1789 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
1790
1791 String display_name;
1792 {
1793 const char *p = getenv("DISPLAY");
1794 if (p) display_name = String(p);
1795 }
1796
1797 if (_panel_client.open_connection(_config->get_name(), display_name) >= 0)
1798 {
1799 int fd = _panel_client.get_connection_number();
1800
1801 _panel_iochannel_read_handler = ecore_main_fd_handler_add(fd, ECORE_FD_READ, panel_iochannel_handler, NULL, NULL, NULL);
1802
1803 SCIM_DEBUG_FRONTEND(2) << " Panel FD= " << fd << "\n";
1804
1805 return true;
1806 }
1807 std::cerr << "panel_initialize() failed!!!\n";
1808 return false;
1809}
1810
1811static void
1812panel_finalize(void)
1813{
1814 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
1815
1816 _panel_client.close_connection();
1817
1818 if (_panel_iochannel_read_handler)
1819 {
1820 ecore_main_fd_handler_del(_panel_iochannel_read_handler);
1821 _panel_iochannel_read_handler = 0;
1822 }
1823
1824 if (_panel_iochannel_err_handler)
1825 {
1826 ecore_main_fd_handler_del(_panel_iochannel_err_handler);
1827 _panel_iochannel_err_handler = 0;
1828 }
1829}
1830
1831static Eina_Bool
1832panel_iochannel_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler)
1833{
1834 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
1835
1836 if (fd_handler == _panel_iochannel_read_handler)
1837 {
1838 if (!_panel_client.filter_event())
1839 {
1840 panel_finalize();
1841 panel_initialize();
1842 return ECORE_CALLBACK_CANCEL;
1843 }
1844 }
1845 else if (fd_handler == _panel_iochannel_err_handler)
1846 {
1847 panel_finalize();
1848 panel_initialize();
1849 return ECORE_CALLBACK_CANCEL;
1850 }
1851 return ECORE_CALLBACK_RENEW;
1852}
1853
1854static void
1855turn_on_ic(EcoreIMFContextISF *ic)
1856{
1857 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
1858
1859 if (ic && ic->impl && !ic->impl->is_on)
1860 {
1861 ic->impl->is_on = true;
1862
1863 if (ic == _focused_ic)
1864 {
1865 panel_req_focus_in(ic);
1866 panel_req_update_spot_location(ic);
1867 panel_req_update_factory_info(ic);
1868 _panel_client.turn_on(ic->id);
1869 _panel_client.hide_preedit_string(ic->id);
1870 _panel_client.hide_aux_string(ic->id);
1871 _panel_client.hide_lookup_table(ic->id);
1872 ic->impl->si->focus_in();
1873 }
1874
1875 //Record the IC on/off status
1876 if (_shared_input_method)
1877 _config->write(String(SCIM_CONFIG_FRONTEND_IM_OPENED_BY_DEFAULT), true);
1878
1879 if (ic->impl->use_preedit && ic->impl->preedit_string.length())
1880 {
1881 ecore_imf_context_preedit_start_event_add(ic->ctx);
1882 ecore_imf_context_event_callback_call(ic->ctx, ECORE_IMF_CALLBACK_PREEDIT_START, NULL);
1883 ecore_imf_context_preedit_changed_event_add(ic->ctx);
1884 ecore_imf_context_event_callback_call(ic->ctx, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, NULL);
1885 ic->impl->preedit_started = true;
1886 }
1887 }
1888}
1889
1890static void
1891turn_off_ic(EcoreIMFContextISF *ic)
1892{
1893 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
1894
1895 if (ic && ic->impl && ic->impl->is_on)
1896 {
1897 ic->impl->is_on = false;
1898
1899 if (ic == _focused_ic)
1900 {
1901 ic->impl->si->focus_out();
1902
1903 panel_req_update_factory_info(ic);
1904 _panel_client.turn_off(ic->id);
1905 }
1906
1907 //Record the IC on/off status
1908 if (_shared_input_method)
1909 _config->write(String(SCIM_CONFIG_FRONTEND_IM_OPENED_BY_DEFAULT), false);
1910
1911 if (ic->impl->use_preedit && ic->impl->preedit_string.length())
1912 {
1913 ecore_imf_context_preedit_changed_event_add(ic->ctx);
1914 ecore_imf_context_event_callback_call(ic->ctx, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, NULL);
1915 ecore_imf_context_preedit_end_event_add(ic->ctx);
1916 ecore_imf_context_event_callback_call(ic->ctx, ECORE_IMF_CALLBACK_PREEDIT_END, NULL);
1917 ic->impl->preedit_started = false;
1918 }
1919 }
1920}
1921
1922static void
1923set_ic_capabilities(EcoreIMFContextISF *ic)
1924{
1925 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
1926
1927 if (ic && ic->impl)
1928 {
1929 unsigned int cap = SCIM_CLIENT_CAP_ALL_CAPABILITIES;
1930
1931 if (!_on_the_spot || !ic->impl->use_preedit)
1932 cap -= SCIM_CLIENT_CAP_ONTHESPOT_PREEDIT;
1933
1934 ic->impl->si->update_client_capabilities(cap);
1935 }
1936}
1937
1938static bool
1939check_socket_frontend(void)
1940{
1941 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
1942
1943 SocketAddress address;
1944 SocketClient client;
1945
1946 uint32 magic;
1947
1948 address.set_address(scim_get_default_socket_frontend_address());
1949
1950 if (!client.connect(address))
1951 return false;
1952
1953 if (!scim_socket_open_connection(magic,
1954 String("ConnectionTester"),
1955 String("SocketFrontEnd"),
1956 client,
1957 1000))
1958 return false;
1959
1960 return true;
1961}
1962
1963void
1964initialize(void)
1965{
1966 std::vector<String> config_list;
1967 std::vector<String> engine_list;
1968 std::vector<String> load_engine_list;
1969
1970 std::vector<String>::iterator it;
1971
1972 bool manual = false;
1973
1974 bool socket = true;
1975
1976 String config_module_name = "simple";
1977
1978 printf("Initializing Ecore SCIM IMModule...\n");
1979
1980 SCIM_DEBUG_FRONTEND(1) << "Initializing Ecore SCIM IMModule...\n";
1981
1982 // Get system language.
1983 _language = scim_get_locale_language(scim_get_current_locale());
1984
1985 if (socket)
1986 {
1987 // If no Socket FrontEnd is running, then launch one.
1988 // And set manual to false.
1989 bool check_result = check_socket_frontend();
1990 if (!check_result)
1991 {
1992 std::cerr << "Launching a SCIM daemon with Socket FrontEnd...\n";
1993 //get modules list
1994 scim_get_imengine_module_list(engine_list);
1995
1996 for (it = engine_list.begin(); it != engine_list.end(); it++)
1997 {
1998 if (*it != "socket")
1999 load_engine_list.push_back(*it);
2000 }
2001
2002 const char *new_argv [] = { "--no-stay", 0 };
2003 scim_launch(true,
2004 config_module_name,
2005 (load_engine_list.size() ? scim_combine_string_list(load_engine_list, ',') : "none"),
2006 "socket",
2007 (char **)new_argv);
2008 manual = false;
2009 }
2010
2011 // If there is one Socket FrontEnd running and it's not manual mode,
2012 // then just use this Socket Frontend.
2013 if (!manual)
2014 {
2015 for (int i = 0; i < 200; ++i)
2016 {
2017 if (check_result)
2018 {
2019 config_module_name = "socket";
2020 load_engine_list.clear();
2021 load_engine_list.push_back("socket");
2022 break;
2023 }
2024 scim_usleep(50000);
2025 check_result = check_socket_frontend();
2026 }
2027 }
2028 }
2029
2030 if (config_module_name != "dummy")
2031 {
2032 //load config module
2033 SCIM_DEBUG_FRONTEND(1) << "Loading Config module: " << config_module_name << "...\n";
2034 _config_module = new ConfigModule(config_module_name);
2035
2036 //create config instance
2037 if (_config_module != NULL && _config_module->valid())
2038 _config = _config_module->create_config();
2039 }
2040
2041 if (_config.null())
2042 {
2043 SCIM_DEBUG_FRONTEND(1) << "Config module cannot be loaded, using dummy Config.\n";
2044
2045 if (_config_module) delete _config_module;
2046 _config_module = NULL;
2047
2048 _config = new DummyConfig();
2049 config_module_name = "dummy";
2050 }
2051
2052 reload_config_callback(_config);
2053 _config->signal_connect_reload(slot(reload_config_callback));
2054
2055 // create backend
2056 _backend = new CommonBackEnd(_config, load_engine_list.size() ? load_engine_list : engine_list);
2057
2058 if (_backend.null())
2059 std::cerr << "Cannot create BackEnd Object!\n";
2060 else
2061 _fallback_factory = _backend->get_factory(SCIM_COMPOSE_KEY_FACTORY_UUID);
2062
2063 if (_fallback_factory.null())
2064 _fallback_factory = new DummyIMEngineFactory();
2065
2066 _fallback_instance = _fallback_factory->create_instance(String("UTF-8"), 0);
2067 _fallback_instance->signal_connect_commit_string(slot(fallback_commit_string_cb));
2068
2069 // Attach Panel Client signal.
2070 _panel_client.signal_connect_reload_config (slot(panel_slot_reload_config));
2071 _panel_client.signal_connect_exit (slot(panel_slot_exit));
2072 _panel_client.signal_connect_update_lookup_table_page_size(slot(panel_slot_update_lookup_table_page_size));
2073 _panel_client.signal_connect_lookup_table_page_up (slot(panel_slot_lookup_table_page_up));
2074 _panel_client.signal_connect_lookup_table_page_down (slot(panel_slot_lookup_table_page_down));
2075 _panel_client.signal_connect_trigger_property (slot(panel_slot_trigger_property));
2076 _panel_client.signal_connect_process_helper_event (slot(panel_slot_process_helper_event));
2077 _panel_client.signal_connect_move_preedit_caret (slot(panel_slot_move_preedit_caret));
2078 _panel_client.signal_connect_select_candidate (slot(panel_slot_select_candidate));
2079 _panel_client.signal_connect_process_key_event (slot(panel_slot_process_key_event));
2080 _panel_client.signal_connect_commit_string (slot(panel_slot_commit_string));
2081 _panel_client.signal_connect_forward_key_event (slot(panel_slot_forward_key_event));
2082 _panel_client.signal_connect_request_help (slot(panel_slot_request_help));
2083 _panel_client.signal_connect_request_factory_menu (slot(panel_slot_request_factory_menu));
2084 _panel_client.signal_connect_change_factory (slot(panel_slot_change_factory));
2085
2086 if (!panel_initialize())
2087 std::cerr << "Ecore IM Module: Cannot connect to Panel!\n";
2088}
2089
2090static void
2091finalize(void)
2092{
2093 SCIM_DEBUG_FRONTEND(1) << "Finalizing Ecore ISF IMModule...\n";
2094
2095 // Reset this first so that the shared instance could be released correctly afterwards.
2096 _default_instance.reset();
2097
2098 SCIM_DEBUG_FRONTEND(2) << "Finalize all IC partially.\n";
2099 while (_used_ic_impl_list)
2100 {
2101 // In case in "shared input method" mode,
2102 // all contexts share only one instance,
2103 // so we need point the reference pointer correctly before finalizing.
2104 _used_ic_impl_list->si->set_frontend_data(static_cast <void*>(_used_ic_impl_list->parent));
2105 isf_imf_context_del(_used_ic_impl_list->parent->ctx);
2106 }
2107
2108 delete_all_ic_impl();
2109
2110 _fallback_instance.reset();
2111 _fallback_factory.reset();
2112
2113 SCIM_DEBUG_FRONTEND(2) << " Releasing BackEnd...\n";
2114 _backend.reset();
2115
2116 SCIM_DEBUG_FRONTEND(2) << " Releasing Config...\n";
2117 _config.reset();
2118
2119 if (_config_module)
2120 {
2121 SCIM_DEBUG_FRONTEND(2) << " Deleting _config_module...\n";
2122 delete _config_module;
2123 _config_module = 0;
2124 }
2125
2126 _focused_ic = NULL;
2127 _ic_list = NULL;
2128
2129 _scim_initialized = false;
2130
2131 panel_finalize();
2132}
2133
2134static void
2135open_next_factory(EcoreIMFContextISF *ic)
2136{
2137 SCIM_DEBUG_FRONTEND(2) << __FUNCTION__ << " context=" << ic->id << "\n";
2138 IMEngineFactoryPointer sf = _backend->get_next_factory("", "UTF-8", ic->impl->si->get_factory_uuid());
2139
2140 if (!sf.null())
2141 {
2142 turn_off_ic(ic);
2143 ic->impl->si = sf->create_instance("UTF-8", ic->impl->si->get_id());
2144 ic->impl->si->set_frontend_data(static_cast <void*>(ic));
2145 ic->impl->preedit_string = WideString();
2146 ic->impl->preedit_caret = 0;
2147 attach_instance(ic->impl->si);
2148 _backend->set_default_factory(_language, sf->get_uuid());
2149 _panel_client.register_input_context(ic->id, sf->get_uuid());
2150 set_ic_capabilities(ic);
2151 turn_on_ic(ic);
2152
2153 if (_shared_input_method)
2154 {
2155 _default_instance = ic->impl->si;
2156 ic->impl->shared_si = true;
2157 }
2158 }
2159}
2160
2161static void
2162open_previous_factory(EcoreIMFContextISF *ic)
2163{
2164 if (ic == NULL)
2165 return;
2166
2167 SCIM_DEBUG_FRONTEND(2) << __FUNCTION__ << " context=" << ic->id << "\n";
2168 IMEngineFactoryPointer sf = _backend->get_previous_factory("", "UTF-8", ic->impl->si->get_factory_uuid());
2169
2170 if (!sf.null())
2171 {
2172 turn_off_ic(ic);
2173 ic->impl->si = sf->create_instance("UTF-8", ic->impl->si->get_id());
2174 ic->impl->si->set_frontend_data(static_cast <void*>(ic));
2175 ic->impl->preedit_string = WideString();
2176 ic->impl->preedit_caret = 0;
2177 attach_instance(ic->impl->si);
2178 _backend->set_default_factory(_language, sf->get_uuid());
2179 _panel_client.register_input_context(ic->id, sf->get_uuid());
2180 set_ic_capabilities(ic);
2181 turn_on_ic(ic);
2182
2183 if (_shared_input_method)
2184 {
2185 _default_instance = ic->impl->si;
2186 ic->impl->shared_si = true;
2187 }
2188 }
2189}
2190
2191static void
2192open_specific_factory(EcoreIMFContextISF *ic,
2193 const String &uuid)
2194{
2195 if (ic == NULL)
2196 return;
2197
2198 SCIM_DEBUG_FRONTEND(2) << __FUNCTION__ << " context=" << ic->id << "\n";
2199
2200 // The same input method is selected, just turn on the IC.
2201 if (ic->impl->si->get_factory_uuid() == uuid)
2202 {
2203 turn_on_ic(ic);
2204 return;
2205 }
2206
2207 IMEngineFactoryPointer sf = _backend->get_factory(uuid);
2208
2209 if (uuid.length() && !sf.null())
2210 {
2211 turn_off_ic(ic);
2212 ic->impl->si = sf->create_instance("UTF-8", ic->impl->si->get_id());
2213 ic->impl->si->set_frontend_data(static_cast <void*>(ic));
2214 ic->impl->preedit_string = WideString();
2215 ic->impl->preedit_caret = 0;
2216 attach_instance(ic->impl->si);
2217 _backend->set_default_factory(_language, sf->get_uuid());
2218 _panel_client.register_input_context(ic->id, sf->get_uuid());
2219 set_ic_capabilities(ic);
2220 turn_on_ic(ic);
2221
2222 if (_shared_input_method)
2223 {
2224 _default_instance = ic->impl->si;
2225 ic->impl->shared_si = true;
2226 }
2227 }
2228 else
2229 {
2230 // turn_off_ic comment out panel_req_update_factory_info()
2231 turn_off_ic(ic);
2232 if (ic && ic->impl->is_on)
2233 {
2234 ic->impl->is_on = false;
2235
2236 if (ic == _focused_ic)
2237 {
2238 ic->impl->si->focus_out();
2239
2240 panel_req_update_factory_info(ic);
2241 _panel_client.turn_off(ic->id);
2242 }
2243
2244 //Record the IC on/off status
2245 if (_shared_input_method)
2246 _config->write(String(SCIM_CONFIG_FRONTEND_IM_OPENED_BY_DEFAULT), false);
2247
2248 if (ic->impl->use_preedit && ic->impl->preedit_string.length())
2249 {
2250 ecore_imf_context_preedit_changed_event_add(ic->ctx);
2251 ecore_imf_context_event_callback_call(ic->ctx, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, NULL);
2252 ecore_imf_context_preedit_end_event_add(ic->ctx);
2253 ecore_imf_context_event_callback_call(ic->ctx, ECORE_IMF_CALLBACK_PREEDIT_END, NULL);
2254 ic->impl->preedit_started = false;
2255 }
2256 }
2257 }
2258}
2259
2260static void initialize_modifier_bits(Display *display)
2261{
2262 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
2263
2264 if (__current_display == display)
2265 return;
2266
2267 __current_display = display;
2268
2269 if (display == 0)
2270 {
2271 __current_alt_mask = Mod1Mask;
2272 __current_meta_mask = ShiftMask | Mod1Mask;
2273 __current_super_mask = 0;
2274 __current_hyper_mask = 0;
2275 __current_numlock_mask = Mod2Mask;
2276 return;
2277 }
2278
2279 XModifierKeymap *mods = NULL;
2280
2281 ::KeyCode ctrl_l = XKeysymToKeycode(display, XK_Control_L);
2282 ::KeyCode ctrl_r = XKeysymToKeycode(display, XK_Control_R);
2283 ::KeyCode meta_l = XKeysymToKeycode(display, XK_Meta_L);
2284 ::KeyCode meta_r = XKeysymToKeycode(display, XK_Meta_R);
2285 ::KeyCode alt_l = XKeysymToKeycode(display, XK_Alt_L);
2286 ::KeyCode alt_r = XKeysymToKeycode(display, XK_Alt_R);
2287 ::KeyCode super_l = XKeysymToKeycode(display, XK_Super_L);
2288 ::KeyCode super_r = XKeysymToKeycode(display, XK_Super_R);
2289 ::KeyCode hyper_l = XKeysymToKeycode(display, XK_Hyper_L);
2290 ::KeyCode hyper_r = XKeysymToKeycode(display, XK_Hyper_R);
2291 ::KeyCode numlock = XKeysymToKeycode(display, XK_Num_Lock);
2292
2293 int i, j;
2294
2295 mods = XGetModifierMapping(display);
2296 if (mods == NULL)
2297 return;
2298
2299 __current_alt_mask = 0;
2300 __current_meta_mask = 0;
2301 __current_super_mask = 0;
2302 __current_hyper_mask = 0;
2303 __current_numlock_mask = 0;
2304
2305 /* We skip the first three sets for Shift, Lock, and Control. The
2306 remaining sets are for Mod1, Mod2, Mod3, Mod4, and Mod5. */
2307 for (i = 3; i < 8; i++)
2308 {
2309 for (j = 0; j < mods->max_keypermod; j++)
2310 {
2311 ::KeyCode code = mods->modifiermap [i * mods->max_keypermod + j];
2312 if (! code) continue;
2313 if (code == alt_l || code == alt_r)
2314 __current_alt_mask |= (1 << i);
2315 else if (code == meta_l || code == meta_r)
2316 __current_meta_mask |= (1 << i);
2317 else if (code == super_l || code == super_r)
2318 __current_super_mask |= (1 << i);
2319 else if (code == hyper_l || code == hyper_r)
2320 __current_hyper_mask |= (1 << i);
2321 else if (code == numlock)
2322 __current_numlock_mask |= (1 << i);
2323 }
2324 }
2325
2326 /* Check whether there is a combine keys mapped to Meta */
2327 if (__current_meta_mask == 0)
2328 {
2329 char buf [32];
2330 XKeyEvent xkey;
2331 KeySym keysym_l, keysym_r;
2332
2333 xkey.type = KeyPress;
2334 xkey.display = display;
2335 xkey.serial = 0L;
2336 xkey.send_event = False;
2337 xkey.x = xkey.y = xkey.x_root = xkey.y_root = 0;
2338 xkey.time = 0;
2339 xkey.same_screen = False;
2340 xkey.subwindow = None;
2341 xkey.window = None;
2342 xkey.root = DefaultRootWindow(display);
2343 xkey.state = ShiftMask;
2344
2345 xkey.keycode = meta_l;
2346 XLookupString(&xkey, buf, 32, &keysym_l, 0);
2347 xkey.keycode = meta_r;
2348 XLookupString(&xkey, buf, 32, &keysym_r, 0);
2349
2350 if ((meta_l == alt_l && keysym_l == XK_Meta_L) || (meta_r == alt_r && keysym_r == XK_Meta_R))
2351 __current_meta_mask = ShiftMask + __current_alt_mask;
2352 else if ((meta_l == ctrl_l && keysym_l == XK_Meta_L) || (meta_r == ctrl_r && keysym_r == XK_Meta_R))
2353 __current_meta_mask = ShiftMask + ControlMask;
2354 }
2355
2356 XFreeModifiermap(mods);
2357}
2358
2359static unsigned int scim_x11_keymask_scim_to_x11(Display *display, uint16 scimkeymask)
2360{
2361 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
2362
2363 unsigned int state = 0;
2364
2365 initialize_modifier_bits(display);
2366
2367 if (scimkeymask & SCIM_KEY_ShiftMask) state |= ShiftMask;
2368 if (scimkeymask & SCIM_KEY_CapsLockMask) state |= LockMask;
2369 if (scimkeymask & SCIM_KEY_ControlMask) state |= ControlMask;
2370 if (scimkeymask & SCIM_KEY_AltMask) state |= __current_alt_mask;
2371 if (scimkeymask & SCIM_KEY_MetaMask) state |= __current_meta_mask;
2372 if (scimkeymask & SCIM_KEY_SuperMask) state |= __current_super_mask;
2373 if (scimkeymask & SCIM_KEY_HyperMask) state |= __current_hyper_mask;
2374 if (scimkeymask & SCIM_KEY_NumLockMask) state |= __current_numlock_mask;
2375
2376 return state;
2377}
2378
2379static XKeyEvent createKeyEvent(Display *display, Window &win,
2380 Window &winRoot, bool press,
2381 int keycode, int modifiers)
2382{
2383 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
2384
2385 XKeyEvent event;
2386
2387 event.display = display;
2388 event.window = win;
2389 event.root = winRoot;
2390 event.subwindow = None;
2391 event.time = CurrentTime;
2392 event.x = 1;
2393 event.y = 1;
2394 event.x_root = 1;
2395 event.y_root = 1;
2396 event.same_screen = EINA_TRUE;
2397 event.state = modifiers;
2398 event.keycode = XKeysymToKeycode(display, keycode);
2399 if (press)
2400 event.type = KeyPress;
2401 else
2402 event.type = KeyRelease;
2403 event.send_event = EINA_FALSE;
2404 event.serial = 0;
2405
2406 return event;
2407}
2408
2409static void _x_send_key_event(const KeyEvent &key)
2410{
2411 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
2412
2413 // Obtain the X11 display.
2414 Display *display = XOpenDisplay(NULL);
2415 if (display == NULL)
2416 {
2417 std::cerr << "XOpenDisplay failed\n";
2418 return;
2419 }
2420
2421 // Get the root window for the current display.
2422 Window winRoot = 0;
2423
2424 // Find the window which has the current keyboard focus.
2425 Window winFocus = 0;
2426 int revert = RevertToParent;
2427
2428 XGetInputFocus(display, &winFocus, &revert);
2429
2430 // Send a fake key press event to the window.
2431 XSelectInput(display, winFocus, FocusChangeMask|KeyPressMask|KeyReleaseMask);
2432 XMapWindow(display, winFocus);
2433
2434 unsigned int modifier = scim_x11_keymask_scim_to_x11(display, key.mask);
2435 XKeyEvent event;
2436 if (key.is_key_press())
2437 {
2438 event = createKeyEvent(display, winFocus, winRoot, true, key.code, modifier);
2439 XSendEvent(event.display, event.window, True, KeyPressMask, (XEvent *)&event);
2440 }
2441 else
2442 {
2443 event = createKeyEvent(display, winFocus, winRoot, false, key.code, modifier);
2444 XSendEvent(event.display, event.window, True, KeyReleaseMask, (XEvent *)&event);
2445 }
2446
2447 XCloseDisplay(display);
2448}
2449
2450static void
2451attach_instance(const IMEngineInstancePointer &si)
2452{
2453 si->signal_connect_show_preedit_string(
2454 slot(slot_show_preedit_string));
2455 si->signal_connect_show_aux_string(
2456 slot(slot_show_aux_string));
2457 si->signal_connect_show_lookup_table(
2458 slot(slot_show_lookup_table));
2459
2460 si->signal_connect_hide_preedit_string(
2461 slot(slot_hide_preedit_string));
2462 si->signal_connect_hide_aux_string(
2463 slot(slot_hide_aux_string));
2464 si->signal_connect_hide_lookup_table(
2465 slot(slot_hide_lookup_table));
2466
2467 si->signal_connect_update_preedit_caret(
2468 slot(slot_update_preedit_caret));
2469 si->signal_connect_update_preedit_string(
2470 slot(slot_update_preedit_string));
2471 si->signal_connect_update_aux_string(
2472 slot(slot_update_aux_string));
2473 si->signal_connect_update_lookup_table(
2474 slot(slot_update_lookup_table));
2475
2476 si->signal_connect_commit_string(
2477 slot(slot_commit_string));
2478
2479 si->signal_connect_forward_key_event(
2480 slot(slot_forward_key_event));
2481
2482 si->signal_connect_register_properties(
2483 slot(slot_register_properties));
2484
2485 si->signal_connect_update_property(
2486 slot(slot_update_property));
2487
2488 si->signal_connect_beep(
2489 slot(slot_beep));
2490
2491 si->signal_connect_start_helper(
2492 slot(slot_start_helper));
2493
2494 si->signal_connect_stop_helper(
2495 slot(slot_stop_helper));
2496
2497 si->signal_connect_send_helper_event(
2498 slot(slot_send_helper_event));
2499
2500 si->signal_connect_get_surrounding_text(
2501 slot(slot_get_surrounding_text));
2502
2503 si->signal_connect_delete_surrounding_text(
2504 slot(slot_delete_surrounding_text));
2505}
2506
2507// Implementation of slot functions
2508static void
2509slot_show_preedit_string(IMEngineInstanceBase *si)
2510{
2511 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
2512
2513 EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
2514
2515 if (ic && ic->impl && _focused_ic == ic)
2516 {
2517 if (ic->impl->use_preedit)
2518 {
2519 if (!ic->impl->preedit_started)
2520 {
2521 ecore_imf_context_preedit_start_event_add(_focused_ic->ctx);
2522 ecore_imf_context_event_callback_call(_focused_ic->ctx, ECORE_IMF_CALLBACK_PREEDIT_START, NULL);
2523 ic->impl->preedit_started = true;
2524 }
2525 }
2526 else
2527 _panel_client.show_preedit_string(ic->id);
2528 }
2529}
2530
2531static void
2532slot_show_aux_string(IMEngineInstanceBase *si)
2533{
2534 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
2535
2536 EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
2537
2538 if (ic && ic->impl && _focused_ic == ic)
2539 _panel_client.show_aux_string(ic->id);
2540}
2541
2542static void
2543slot_show_lookup_table(IMEngineInstanceBase *si)
2544{
2545 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
2546
2547 EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
2548
2549 if (ic && ic->impl && _focused_ic == ic)
2550 _panel_client.show_lookup_table(ic->id);
2551}
2552
2553static void
2554slot_hide_preedit_string(IMEngineInstanceBase *si)
2555{
2556 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
2557
2558 EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
2559
2560 if (ic && ic->impl && _focused_ic == ic)
2561 {
2562 bool emit = false;
2563 if (ic->impl->preedit_string.length())
2564 {
2565 ic->impl->preedit_string = WideString();
2566 ic->impl->preedit_caret = 0;
2567 ic->impl->preedit_attrlist.clear();
2568 emit = true;
2569 }
2570 if (ic->impl->use_preedit)
2571 {
2572 if (emit)
2573 {
2574 ecore_imf_context_preedit_changed_event_add(ic->ctx);
2575 ecore_imf_context_event_callback_call(ic->ctx, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, NULL);
2576 }
2577 if (ic->impl->preedit_started)
2578 {
2579 ecore_imf_context_preedit_end_event_add(ic->ctx);
2580 ecore_imf_context_event_callback_call(ic->ctx, ECORE_IMF_CALLBACK_PREEDIT_END, NULL);
2581 ic->impl->preedit_started = false;
2582 }
2583 }
2584 else
2585 _panel_client.hide_preedit_string(ic->id);
2586 }
2587}
2588
2589static void
2590slot_hide_aux_string(IMEngineInstanceBase *si)
2591{
2592 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
2593
2594 EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
2595
2596 if (ic && ic->impl && _focused_ic == ic)
2597 _panel_client.hide_aux_string(ic->id);
2598}
2599
2600static void
2601slot_hide_lookup_table(IMEngineInstanceBase *si)
2602{
2603 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
2604
2605 EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
2606
2607 if (ic && ic->impl && _focused_ic == ic)
2608 _panel_client.hide_lookup_table(ic->id);
2609}
2610
2611static void
2612slot_update_preedit_caret(IMEngineInstanceBase *si, int caret)
2613{
2614 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
2615
2616 EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
2617
2618 if (ic && ic->impl && _focused_ic == ic && ic->impl->preedit_caret != caret)
2619 {
2620 ic->impl->preedit_caret = caret;
2621 if (ic->impl->use_preedit)
2622 {
2623 if (!ic->impl->preedit_started)
2624 {
2625 ecore_imf_context_preedit_start_event_add(ic->ctx);
2626 ecore_imf_context_event_callback_call(ic->ctx, ECORE_IMF_CALLBACK_PREEDIT_START, NULL);
2627 ic->impl->preedit_started = true;
2628 }
2629 ecore_imf_context_preedit_changed_event_add(ic->ctx);
2630 ecore_imf_context_event_callback_call(ic->ctx, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, NULL);
2631 }
2632 else
2633 _panel_client.update_preedit_caret(ic->id, caret);
2634 }
2635}
2636
2637static void
2638slot_update_preedit_string(IMEngineInstanceBase *si,
2639 const WideString & str,
2640 const AttributeList & attrs)
2641{
2642 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
2643
2644 EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
2645
2646 if (ic && ic->impl && _focused_ic == ic && (ic->impl->preedit_string != str || str.length()))
2647 {
2648 ic->impl->preedit_string = str;
2649 ic->impl->preedit_attrlist = attrs;
2650 if (ic->impl->use_preedit)
2651 {
2652 if (!ic->impl->preedit_started)
2653 {
2654 ecore_imf_context_preedit_start_event_add(_focused_ic->ctx);
2655 ecore_imf_context_event_callback_call(_focused_ic->ctx, ECORE_IMF_CALLBACK_PREEDIT_START, NULL);
2656 ic->impl->preedit_started = true;
2657 }
2658 ic->impl->preedit_caret = str.length();
2659 ic->impl->preedit_updating = true;
2660 ecore_imf_context_preedit_changed_event_add(ic->ctx);
2661 ecore_imf_context_event_callback_call(ic->ctx, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, NULL);
2662 ic->impl->preedit_updating = false;
2663 }
2664 else
2665 {
2666 _panel_client.update_preedit_string(ic->id, str, attrs);
2667 }
2668 }
2669}
2670
2671static void
2672slot_update_aux_string(IMEngineInstanceBase *si,
2673 const WideString & str,
2674 const AttributeList & attrs)
2675{
2676 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
2677
2678 EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
2679
2680 if (ic && ic->impl && _focused_ic == ic)
2681 _panel_client.update_aux_string(ic->id, str, attrs);
2682}
2683
2684static void
2685slot_commit_string(IMEngineInstanceBase *si,
2686 const WideString & str)
2687{
2688 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
2689
2690 EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
2691
2692 if (ic && ic->ctx)
2693 {
2694 ecore_imf_context_commit_event_add(ic->ctx, utf8_wcstombs(str).c_str());
2695 ecore_imf_context_event_callback_call(ic->ctx, ECORE_IMF_CALLBACK_COMMIT, (void *)utf8_wcstombs(str).c_str());
2696 }
2697}
2698
2699static void
2700slot_forward_key_event(IMEngineInstanceBase *si,
2701 const KeyEvent & key)
2702{
2703 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
2704
2705 EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
2706
2707 if (ic && _focused_ic == ic)
2708 {
2709 if (!_fallback_instance->process_key_event(key))
2710 _x_send_key_event(key);
2711 }
2712}
2713
2714static void
2715slot_update_lookup_table(IMEngineInstanceBase *si,
2716 const LookupTable & table)
2717{
2718 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
2719
2720 EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
2721
2722 if (ic && ic->impl && _focused_ic == ic)
2723 _panel_client.update_lookup_table(ic->id, table);
2724}
2725
2726static void
2727slot_register_properties(IMEngineInstanceBase *si,
2728 const PropertyList & properties)
2729{
2730 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
2731
2732 EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
2733
2734 if (ic && ic->impl && _focused_ic == ic)
2735 _panel_client.register_properties(ic->id, properties);
2736}
2737
2738static void
2739slot_update_property(IMEngineInstanceBase *si,
2740 const Property & property)
2741{
2742 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
2743
2744 EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
2745
2746 if (ic && ic->impl && _focused_ic == ic)
2747 _panel_client.update_property(ic->id, property);
2748}
2749
2750static void
2751slot_beep(IMEngineInstanceBase *si __UNUSED__)
2752{
2753 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
2754}
2755
2756static void
2757slot_start_helper(IMEngineInstanceBase *si,
2758 const String &helper_uuid)
2759{
2760 EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
2761
2762 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " helper= " << helper_uuid << " context="
2763 << (ic ? ic->id : -1) << " ic=" << ic
2764 << " ic-uuid=" << ((ic ) ? ic->impl->si->get_factory_uuid() : "") << "...\n";
2765
2766 if (ic && ic->impl)
2767 _panel_client.start_helper(ic->id, helper_uuid);
2768}
2769
2770static void
2771slot_stop_helper(IMEngineInstanceBase *si,
2772 const String &helper_uuid)
2773{
2774 EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
2775
2776 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " helper= " << helper_uuid << " context=" << (ic ? ic->id : -1) << " ic=" << ic << "...\n";
2777
2778 if (ic && ic->impl)
2779 _panel_client.stop_helper(ic->id, helper_uuid);
2780}
2781
2782static void
2783slot_send_helper_event(IMEngineInstanceBase *si,
2784 const String &helper_uuid,
2785 const Transaction &trans)
2786{
2787 EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
2788
2789 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " helper= " << helper_uuid << " context="
2790 << (ic ? ic->id : -1) << " ic=" << ic
2791 << " ic-uuid=" << ((ic) ? ic->impl->si->get_factory_uuid() : "") << "...\n";
2792
2793 if (ic && ic->impl)
2794 _panel_client.send_helper_event(ic->id, helper_uuid, trans);
2795}
2796
2797static bool
2798slot_get_surrounding_text(IMEngineInstanceBase *si,
2799 WideString &text,
2800 int &cursor,
2801 int maxlen_before,
2802 int maxlen_after)
2803{
2804 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
2805
2806 EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
2807
2808 if (ic && ic->impl && _focused_ic == ic)
2809 {
2810 char *surrounding = NULL;
2811 int cursor_index;
2812 if (ecore_imf_context_surrounding_get(_focused_ic->ctx, &surrounding, &cursor_index))
2813 {
2814 SCIM_DEBUG_FRONTEND(2) << "Surrounding text: " << surrounding <<"\n";
2815 SCIM_DEBUG_FRONTEND(2) << "Cursor Index : " << cursor_index <<"\n";
2816 WideString before(utf8_mbstowcs(String(surrounding, surrounding + cursor_index)));
2817 WideString after(utf8_mbstowcs(String(surrounding + cursor_index)));
2818 if (maxlen_before > 0 && ((unsigned int)maxlen_before) < before.length())
2819 before = WideString(before.begin() + (before.length() - maxlen_before), before.end());
2820 else if (maxlen_before == 0) before = WideString();
2821 if (maxlen_after > 0 && ((unsigned int)maxlen_after) < after.length())
2822 after = WideString(after.begin(), after.begin() + maxlen_after);
2823 else if (maxlen_after == 0) after = WideString();
2824 text = before + after;
2825 cursor = before.length();
2826 return true;
2827 }
2828 }
2829 return false;
2830}
2831
2832static bool
2833slot_delete_surrounding_text(IMEngineInstanceBase *si,
2834 int offset,
2835 int len)
2836{
2837 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
2838
2839 EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
2840
2841 if (ic && ic->impl && _focused_ic == ic)
2842 {
2843 Ecore_IMF_Event_Delete_Surrounding ev;
2844 ev.ctx = _focused_ic->ctx;
2845 ev.n_chars = len;
2846 ev.offset = offset;
2847 ecore_imf_context_delete_surrounding_event_add(_focused_ic->ctx, offset, len);
2848 ecore_imf_context_event_callback_call(_focused_ic->ctx, ECORE_IMF_CALLBACK_DELETE_SURROUNDING, &ev);
2849 return true;
2850 }
2851 return false;
2852}
2853
2854static void
2855reload_config_callback(const ConfigPointer &config)
2856{
2857 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
2858
2859 _frontend_hotkey_matcher.load_hotkeys(config);
2860 _imengine_hotkey_matcher.load_hotkeys(config);
2861
2862 KeyEvent key;
2863
2864 scim_string_to_key(key,
2865 config->read(String(SCIM_CONFIG_HOTKEYS_FRONTEND_VALID_KEY_MASK),
2866 String("Shift+Control+Alt+Lock")));
2867
2868 _valid_key_mask = (key.mask > 0)?(key.mask):0xFFFF;
2869 _valid_key_mask |= SCIM_KEY_ReleaseMask;
2870 // Special treatment for two backslash keys on jp106 keyboard.
2871 _valid_key_mask |= SCIM_KEY_QuirkKanaRoMask;
2872
2873 _on_the_spot = config->read(String(SCIM_CONFIG_FRONTEND_ON_THE_SPOT), _on_the_spot);
2874 _shared_input_method = config->read(String(SCIM_CONFIG_FRONTEND_SHARED_INPUT_METHOD), _shared_input_method);
2875
2876 // Get keyboard layout setting
2877 // Flush the global config first, in order to load the new configs from disk.
2878 scim_global_config_flush();
2879
2880 _keyboard_layout = scim_get_default_keyboard_layout();
2881}
2882
2883static void
2884fallback_commit_string_cb(IMEngineInstanceBase *si __UNUSED__,
2885 const WideString &str)
2886{
2887 SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
2888
2889 if (_focused_ic && _focused_ic->impl)
2890 {
2891 ecore_imf_context_commit_event_add(_focused_ic->ctx, utf8_wcstombs(str).c_str());
2892 ecore_imf_context_event_callback_call(_focused_ic->ctx, ECORE_IMF_CALLBACK_COMMIT, (void *)utf8_wcstombs(str).c_str());
2893 }
2894}
2895
diff --git a/libraries/ecore/src/modules/immodules/scim/scim_imcontext.h b/libraries/ecore/src/modules/immodules/scim/scim_imcontext.h
deleted file mode 100644
index 72533e2..0000000
--- a/libraries/ecore/src/modules/immodules/scim/scim_imcontext.h
+++ /dev/null
@@ -1,42 +0,0 @@
1#ifndef __ISF_IMF_CONTEXT_H
2#define __ISF_IMF_CONTEXT_H
3
4#include <Ecore_IMF.h>
5
6typedef struct _EcoreIMFContextISF EcoreIMFContextISF;
7typedef struct _EcoreIMFContextISFImpl EcoreIMFContextISFImpl;
8
9struct _EcoreIMFContextISF {
10 Ecore_IMF_Context *ctx;
11
12 EcoreIMFContextISFImpl *impl;
13
14 int id; /* Input Context id*/
15 struct _EcoreIMFContextISF *next;
16};
17
18void isf_imf_context_add (Ecore_IMF_Context *ctx);
19void isf_imf_context_del (Ecore_IMF_Context *ctx);
20void isf_imf_context_client_window_set (Ecore_IMF_Context *ctx, void *window);
21void isf_imf_context_client_canvas_set (Ecore_IMF_Context *ctx, void *window);
22void isf_imf_context_focus_in (Ecore_IMF_Context *ctx);
23void isf_imf_context_focus_out (Ecore_IMF_Context *ctx);
24void isf_imf_context_reset (Ecore_IMF_Context *ctx);
25void isf_imf_context_cursor_position_set (Ecore_IMF_Context *ctx, int cursor_pos);
26void isf_imf_context_cursor_location_set (Ecore_IMF_Context *ctx, int x, int y, int w, int h);
27void isf_imf_context_input_mode_set (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode);
28void isf_imf_context_preedit_string_get (Ecore_IMF_Context *ctx, char** str, int *cursor_pos);
29void isf_imf_context_preedit_string_with_attributes_get (Ecore_IMF_Context *ctx, char** str, Eina_List **attrs, int *cursor_pos);
30void isf_imf_context_use_preedit_set (Ecore_IMF_Context* ctx, Eina_Bool use_preedit);
31Eina_Bool isf_imf_context_filter_event (Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event);
32void isf_imf_context_prediction_allow_set (Ecore_IMF_Context* ctx, Eina_Bool prediction);
33void isf_imf_context_autocapital_type_set (Ecore_IMF_Context* ctx, Ecore_IMF_Autocapital_Type autocapital_type);
34void isf_imf_context_input_panel_layout_set (Ecore_IMF_Context* ctx, Ecore_IMF_Input_Panel_Layout layout);
35void isf_imf_context_input_panel_show(Ecore_IMF_Context *ctx);
36void isf_imf_context_input_panel_hide(Ecore_IMF_Context *ctx);
37
38EcoreIMFContextISF* isf_imf_context_new (void);
39void isf_imf_context_shutdown (void);
40
41#endif /* __ISF_IMF_CONTEXT_H */
42
diff --git a/libraries/ecore/src/modules/immodules/scim/scim_module.cpp b/libraries/ecore/src/modules/immodules/scim/scim_module.cpp
deleted file mode 100644
index d17e37a..0000000
--- a/libraries/ecore/src/modules/immodules/scim/scim_module.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
1#include <stdio.h>
2#include "scim_imcontext.h"
3
4#ifdef __cplusplus
5extern "C"
6{
7#endif /* __cplusplus */
8
9 static const Ecore_IMF_Context_Info isf_imf_info = {
10 "scim", /* ID */
11 "SCIM immodule for Ecore", /* Description */
12 "*", /* Default locales */
13 NULL, /* Canvas type */
14 0 /* Canvas required */
15 };
16
17 static Ecore_IMF_Context_Class isf_imf_class = {
18 isf_imf_context_add, /* add */
19 isf_imf_context_del, /* del */
20 isf_imf_context_client_window_set, /* client_window_set */
21 isf_imf_context_client_canvas_set, /* client_canvas_set */
22 isf_imf_context_input_panel_show, /* input_panel_show, - show */
23 isf_imf_context_input_panel_hide, /* input_panel_hide, - hide */
24 isf_imf_context_preedit_string_get, /* get_preedit_string */
25 isf_imf_context_focus_in, /* focus_in */
26 isf_imf_context_focus_out, /* focus_out */
27 isf_imf_context_reset, /* reset */
28 isf_imf_context_cursor_position_set, /* cursor_position_set */
29 isf_imf_context_use_preedit_set, /* use_preedit_set */
30 isf_imf_context_input_mode_set, /* input_mode_set */
31 isf_imf_context_filter_event, /* filter_event */
32 isf_imf_context_preedit_string_with_attributes_get, /* preedit_string_with_attribute_get */
33 isf_imf_context_prediction_allow_set, /* prediction_allow_set */
34 isf_imf_context_autocapital_type_set, /* autocapital_type_set */
35 NULL, /* control panel show */
36 NULL, /* control panel hide */
37 NULL, /* input_panel_layout_set */
38 NULL, /* isf_imf_context_input_panel_layout_get, */
39 NULL, /* isf_imf_context_input_panel_language_set, */
40 NULL, /* isf_imf_context_input_panel_language_get, */
41 isf_imf_context_cursor_location_set, /* cursor_location_set */
42 NULL, /* input_panel_imdata_set */
43 NULL, /* input_panel_imdata_get */
44 NULL, /* input_panel_return_key_type_set */
45 NULL, /* input_panel_return_key_disabled_set */
46 NULL /* input_panel_caps_lock_mode_set */
47 };
48
49 static Ecore_IMF_Context *imf_module_create (void);
50 static Ecore_IMF_Context *imf_module_exit (void);
51
52 static Eina_Bool imf_module_init (void)
53 {
54 ecore_imf_module_register (&isf_imf_info, imf_module_create, imf_module_exit);
55 return EINA_TRUE;
56 }
57
58 static void imf_module_shutdown (void)
59 {
60 isf_imf_context_shutdown ();
61 }
62
63 static Ecore_IMF_Context *imf_module_create (void)
64 {
65 Ecore_IMF_Context *ctx = NULL;
66 EcoreIMFContextISF *ctxd = NULL;
67
68 ctxd = isf_imf_context_new ();
69 if (!ctxd)
70 {
71 printf ("isf_imf_context_new () failed!!!\n");
72 return NULL;
73 }
74
75 ctx = ecore_imf_context_new (&isf_imf_class);
76 if (!ctx)
77 {
78 delete ctxd;
79 return NULL;
80 }
81
82 ecore_imf_context_data_set (ctx, ctxd);
83
84 return ctx;
85 }
86
87 static Ecore_IMF_Context *imf_module_exit (void)
88 {
89 return NULL;
90 }
91
92 EINA_MODULE_INIT(imf_module_init);
93 EINA_MODULE_SHUTDOWN(imf_module_shutdown);
94
95#ifdef __cplusplus
96}
97#endif /* __cplusplus */
98