diff options
author | David Walter Seikel | 2013-01-13 17:29:19 +1000 |
---|---|---|
committer | David Walter Seikel | 2013-01-13 17:29:19 +1000 |
commit | 07274513e984f0b5544586c74508ccd16e7dcafa (patch) | |
tree | b32ff2a9136fbc1a4a6a0ed1e4d79cde0f5f16d9 /libraries/ecore/src/modules/immodules/scim | |
parent | Added Irrlicht 1.8, but without all the Windows binaries. (diff) | |
download | SledjHamr-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')
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 @@ | |||
1 | MAINTAINERCLEANFILES = Makefile.in | ||
2 | |||
3 | AM_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 | |||
21 | pkgdir = $(libdir)/ecore/immodules | ||
22 | |||
23 | pkg_LTLIBRARIES = scim.la | ||
24 | scim_la_SOURCES = \ | ||
25 | scim_imcontext.cpp \ | ||
26 | scim_module.cpp \ | ||
27 | scim_imcontext.h | ||
28 | |||
29 | scim_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@ | ||
35 | scim_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version | ||
36 | scim_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 | |||
18 | VPATH = @srcdir@ | ||
19 | pkgdatadir = $(datadir)/@PACKAGE@ | ||
20 | pkgincludedir = $(includedir)/@PACKAGE@ | ||
21 | pkglibdir = $(libdir)/@PACKAGE@ | ||
22 | pkglibexecdir = $(libexecdir)/@PACKAGE@ | ||
23 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd | ||
24 | install_sh_DATA = $(install_sh) -c -m 644 | ||
25 | install_sh_PROGRAM = $(install_sh) -c | ||
26 | install_sh_SCRIPT = $(install_sh) -c | ||
27 | INSTALL_HEADER = $(INSTALL_DATA) | ||
28 | transform = $(program_transform_name) | ||
29 | NORMAL_INSTALL = : | ||
30 | PRE_INSTALL = : | ||
31 | POST_INSTALL = : | ||
32 | NORMAL_UNINSTALL = : | ||
33 | PRE_UNINSTALL = : | ||
34 | POST_UNINSTALL = : | ||
35 | build_triplet = @build@ | ||
36 | host_triplet = @host@ | ||
37 | subdir = src/modules/immodules/scim | ||
38 | DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in | ||
39 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 | ||
40 | am__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 | ||
57 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ | ||
58 | $(ACLOCAL_M4) | ||
59 | mkinstalldirs = $(install_sh) -d | ||
60 | CONFIG_HEADER = $(top_builddir)/config.h | ||
61 | CONFIG_CLEAN_FILES = | ||
62 | CONFIG_CLEAN_VPATH_FILES = | ||
63 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; | ||
64 | am__vpath_adj = case $$p in \ | ||
65 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ | ||
66 | *) f=$$p;; \ | ||
67 | esac; | ||
68 | am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; | ||
69 | am__install_max = 40 | ||
70 | am__nobase_strip_setup = \ | ||
71 | srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` | ||
72 | am__nobase_strip = \ | ||
73 | for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" | ||
74 | am__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] }' | ||
81 | am__base_list = \ | ||
82 | sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ | ||
83 | sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | ||
84 | am__installdirs = "$(DESTDIR)$(pkgdir)" | ||
85 | LTLIBRARIES = $(pkg_LTLIBRARIES) | ||
86 | scim_la_DEPENDENCIES = \ | ||
87 | $(top_builddir)/src/lib/ecore_imf/libecore_imf.la \ | ||
88 | $(top_builddir)/src/lib/ecore_x/libecore_x.la | ||
89 | am_scim_la_OBJECTS = scim_la-scim_imcontext.lo scim_la-scim_module.lo | ||
90 | scim_la_OBJECTS = $(am_scim_la_OBJECTS) | ||
91 | AM_V_lt = $(am__v_lt_$(V)) | ||
92 | am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) | ||
93 | am__v_lt_0 = --silent | ||
94 | scim_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 $@ | ||
97 | DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) | ||
98 | depcomp = $(SHELL) $(top_srcdir)/depcomp | ||
99 | am__depfiles_maybe = depfiles | ||
100 | am__mv = mv -f | ||
101 | CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ | ||
102 | $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) | ||
103 | LTCXXCOMPILE = $(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) | ||
107 | AM_V_CXX = $(am__v_CXX_$(V)) | ||
108 | am__v_CXX_ = $(am__v_CXX_$(AM_DEFAULT_VERBOSITY)) | ||
109 | am__v_CXX_0 = @echo " CXX " $@; | ||
110 | AM_V_at = $(am__v_at_$(V)) | ||
111 | am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) | ||
112 | am__v_at_0 = @ | ||
113 | CXXLD = $(CXX) | ||
114 | CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ | ||
115 | $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ | ||
116 | $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ | ||
117 | AM_V_CXXLD = $(am__v_CXXLD_$(V)) | ||
118 | am__v_CXXLD_ = $(am__v_CXXLD_$(AM_DEFAULT_VERBOSITY)) | ||
119 | am__v_CXXLD_0 = @echo " CXXLD " $@; | ||
120 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ | ||
121 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | ||
122 | LTCOMPILE = $(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) | ||
126 | AM_V_CC = $(am__v_CC_$(V)) | ||
127 | am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) | ||
128 | am__v_CC_0 = @echo " CC " $@; | ||
129 | CCLD = $(CC) | ||
130 | LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ | ||
131 | $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ | ||
132 | $(AM_LDFLAGS) $(LDFLAGS) -o $@ | ||
133 | AM_V_CCLD = $(am__v_CCLD_$(V)) | ||
134 | am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) | ||
135 | am__v_CCLD_0 = @echo " CCLD " $@; | ||
136 | AM_V_GEN = $(am__v_GEN_$(V)) | ||
137 | am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) | ||
138 | am__v_GEN_0 = @echo " GEN " $@; | ||
139 | SOURCES = $(scim_la_SOURCES) | ||
140 | DIST_SOURCES = $(scim_la_SOURCES) | ||
141 | ETAGS = etags | ||
142 | CTAGS = ctags | ||
143 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) | ||
144 | ACLOCAL = @ACLOCAL@ | ||
145 | ALLOCA = @ALLOCA@ | ||
146 | AMTAR = @AMTAR@ | ||
147 | AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ | ||
148 | AR = @AR@ | ||
149 | AS = @AS@ | ||
150 | AUTOCONF = @AUTOCONF@ | ||
151 | AUTOHEADER = @AUTOHEADER@ | ||
152 | AUTOMAKE = @AUTOMAKE@ | ||
153 | AWK = @AWK@ | ||
154 | CARES_CFLAGS = @CARES_CFLAGS@ | ||
155 | CARES_LIBS = @CARES_LIBS@ | ||
156 | CC = @CC@ | ||
157 | CCDEPMODE = @CCDEPMODE@ | ||
158 | CFLAGS = @CFLAGS@ | ||
159 | CHECK_CFLAGS = @CHECK_CFLAGS@ | ||
160 | CHECK_LIBS = @CHECK_LIBS@ | ||
161 | CPP = @CPP@ | ||
162 | CPPFLAGS = @CPPFLAGS@ | ||
163 | CURL_CFLAGS = @CURL_CFLAGS@ | ||
164 | CURL_LIBS = @CURL_LIBS@ | ||
165 | CXX = @CXX@ | ||
166 | CXXCPP = @CXXCPP@ | ||
167 | CXXDEPMODE = @CXXDEPMODE@ | ||
168 | CXXFLAGS = @CXXFLAGS@ | ||
169 | CYGPATH_W = @CYGPATH_W@ | ||
170 | DEFS = @DEFS@ | ||
171 | DEPDIR = @DEPDIR@ | ||
172 | DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@ | ||
173 | DIRECTFB_LIBS = @DIRECTFB_LIBS@ | ||
174 | DLLTOOL = @DLLTOOL@ | ||
175 | DSYMUTIL = @DSYMUTIL@ | ||
176 | DUMPBIN = @DUMPBIN@ | ||
177 | ECHO_C = @ECHO_C@ | ||
178 | ECHO_N = @ECHO_N@ | ||
179 | ECHO_T = @ECHO_T@ | ||
180 | ECORE_XCB_CFLAGS = @ECORE_XCB_CFLAGS@ | ||
181 | ECORE_XCB_LIBS = @ECORE_XCB_LIBS@ | ||
182 | EFL_ECORE_BUILD = @EFL_ECORE_BUILD@ | ||
183 | EFL_ECORE_CON_BUILD = @EFL_ECORE_CON_BUILD@ | ||
184 | EFL_ECORE_EVAS_BUILD = @EFL_ECORE_EVAS_BUILD@ | ||
185 | EFL_ECORE_FILE_BUILD = @EFL_ECORE_FILE_BUILD@ | ||
186 | EFL_ECORE_IMF_BUILD = @EFL_ECORE_IMF_BUILD@ | ||
187 | EFL_ECORE_IMF_EVAS_BUILD = @EFL_ECORE_IMF_EVAS_BUILD@ | ||
188 | EFL_ECORE_INPUT_BUILD = @EFL_ECORE_INPUT_BUILD@ | ||
189 | EFL_ECORE_INPUT_EVAS_BUILD = @EFL_ECORE_INPUT_EVAS_BUILD@ | ||
190 | EFL_ECORE_IPC_BUILD = @EFL_ECORE_IPC_BUILD@ | ||
191 | EFL_ECORE_PSL1GHT_BUILD = @EFL_ECORE_PSL1GHT_BUILD@ | ||
192 | EFL_ECORE_SDL_BUILD = @EFL_ECORE_SDL_BUILD@ | ||
193 | EFL_ECORE_WIN32_BUILD = @EFL_ECORE_WIN32_BUILD@ | ||
194 | EFL_ECORE_WINCE_BUILD = @EFL_ECORE_WINCE_BUILD@ | ||
195 | EFL_PTHREAD_CFLAGS = @EFL_PTHREAD_CFLAGS@ | ||
196 | EFL_PTHREAD_LIBS = @EFL_PTHREAD_LIBS@ | ||
197 | EGREP = @EGREP@ | ||
198 | EINA_CFLAGS = @EINA_CFLAGS@ | ||
199 | EINA_LIBS = @EINA_LIBS@ | ||
200 | ESCAPE_CFLAGS = @ESCAPE_CFLAGS@ | ||
201 | ESCAPE_LIBS = @ESCAPE_LIBS@ | ||
202 | EVAS_CFLAGS = @EVAS_CFLAGS@ | ||
203 | EVAS_LIBS = @EVAS_LIBS@ | ||
204 | EVIL_CFLAGS = @EVIL_CFLAGS@ | ||
205 | EVIL_LIBS = @EVIL_LIBS@ | ||
206 | EXEEXT = @EXEEXT@ | ||
207 | EXOTIC_CFLAGS = @EXOTIC_CFLAGS@ | ||
208 | EXOTIC_LIBS = @EXOTIC_LIBS@ | ||
209 | FGREP = @FGREP@ | ||
210 | GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ | ||
211 | GLIB_CFLAGS = @GLIB_CFLAGS@ | ||
212 | GLIB_LIBS = @GLIB_LIBS@ | ||
213 | GMSGFMT = @GMSGFMT@ | ||
214 | GMSGFMT_015 = @GMSGFMT_015@ | ||
215 | GREP = @GREP@ | ||
216 | INSTALL = @INSTALL@ | ||
217 | INSTALL_DATA = @INSTALL_DATA@ | ||
218 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | ||
219 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | ||
220 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ | ||
221 | INTLLIBS = @INTLLIBS@ | ||
222 | INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ | ||
223 | KEYSYMDEFS = @KEYSYMDEFS@ | ||
224 | LD = @LD@ | ||
225 | LDFLAGS = @LDFLAGS@ | ||
226 | LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ | ||
227 | LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ | ||
228 | LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ | ||
229 | LIBICONV = @LIBICONV@ | ||
230 | LIBINTL = @LIBINTL@ | ||
231 | LIBOBJS = @LIBOBJS@ | ||
232 | LIBS = @LIBS@ | ||
233 | LIBTOOL = @LIBTOOL@ | ||
234 | LIPO = @LIPO@ | ||
235 | LN_S = @LN_S@ | ||
236 | LTLIBICONV = @LTLIBICONV@ | ||
237 | LTLIBINTL = @LTLIBINTL@ | ||
238 | LTLIBOBJS = @LTLIBOBJS@ | ||
239 | MAKEINFO = @MAKEINFO@ | ||
240 | MKDIR_P = @MKDIR_P@ | ||
241 | MSGFMT = @MSGFMT@ | ||
242 | MSGFMT_015 = @MSGFMT_015@ | ||
243 | MSGMERGE = @MSGMERGE@ | ||
244 | NM = @NM@ | ||
245 | NMEDIT = @NMEDIT@ | ||
246 | OBJC = @OBJC@ | ||
247 | OBJCDEPMODE = @OBJCDEPMODE@ | ||
248 | OBJCFLAGS = @OBJCFLAGS@ | ||
249 | OBJDUMP = @OBJDUMP@ | ||
250 | OBJEXT = @OBJEXT@ | ||
251 | OTOOL = @OTOOL@ | ||
252 | OTOOL64 = @OTOOL64@ | ||
253 | PACKAGE = @PACKAGE@ | ||
254 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ | ||
255 | PACKAGE_NAME = @PACKAGE_NAME@ | ||
256 | PACKAGE_STRING = @PACKAGE_STRING@ | ||
257 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ | ||
258 | PACKAGE_URL = @PACKAGE_URL@ | ||
259 | PACKAGE_VERSION = @PACKAGE_VERSION@ | ||
260 | PATH_SEPARATOR = @PATH_SEPARATOR@ | ||
261 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | ||
262 | PIXMAN_LIBS = @PIXMAN_LIBS@ | ||
263 | PKG_CONFIG = @PKG_CONFIG@ | ||
264 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
265 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
266 | POSUB = @POSUB@ | ||
267 | RANLIB = @RANLIB@ | ||
268 | SCIM_CFLAGS = @SCIM_CFLAGS@ | ||
269 | SCIM_LIBS = @SCIM_LIBS@ | ||
270 | SDL_CFLAGS = @SDL_CFLAGS@ | ||
271 | SDL_CONFIG = @SDL_CONFIG@ | ||
272 | SDL_LIBS = @SDL_LIBS@ | ||
273 | SED = @SED@ | ||
274 | SET_MAKE = @SET_MAKE@ | ||
275 | SHELL = @SHELL@ | ||
276 | SHM_OPEN_LIBS = @SHM_OPEN_LIBS@ | ||
277 | SSL_CFLAGS = @SSL_CFLAGS@ | ||
278 | SSL_LIBS = @SSL_LIBS@ | ||
279 | STRIP = @STRIP@ | ||
280 | TLS2_CFLAGS = @TLS2_CFLAGS@ | ||
281 | TLS2_LIBS = @TLS2_LIBS@ | ||
282 | TLS_CFLAGS = @TLS_CFLAGS@ | ||
283 | TLS_LIBS = @TLS_LIBS@ | ||
284 | TSLIB_CFLAGS = @TSLIB_CFLAGS@ | ||
285 | TSLIB_LIBS = @TSLIB_LIBS@ | ||
286 | USE_NLS = @USE_NLS@ | ||
287 | VERSION = @VERSION@ | ||
288 | VMAJ = @VMAJ@ | ||
289 | WAYLAND_CFLAGS = @WAYLAND_CFLAGS@ | ||
290 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
291 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
292 | WAYLAND_LIBS = @WAYLAND_LIBS@ | ||
293 | WIN32_CFLAGS = @WIN32_CFLAGS@ | ||
294 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | ||
295 | WIN32_LIBS = @WIN32_LIBS@ | ||
296 | XCB_COMPOSITE_CFLAGS = @XCB_COMPOSITE_CFLAGS@ | ||
297 | XCB_COMPOSITE_LIBS = @XCB_COMPOSITE_LIBS@ | ||
298 | XCB_CURSOR_CFLAGS = @XCB_CURSOR_CFLAGS@ | ||
299 | XCB_CURSOR_LIBS = @XCB_CURSOR_LIBS@ | ||
300 | XCB_DAMAGE_CFLAGS = @XCB_DAMAGE_CFLAGS@ | ||
301 | XCB_DAMAGE_LIBS = @XCB_DAMAGE_LIBS@ | ||
302 | XCB_DPMS_CFLAGS = @XCB_DPMS_CFLAGS@ | ||
303 | XCB_DPMS_LIBS = @XCB_DPMS_LIBS@ | ||
304 | XCB_RANDR_CFLAGS = @XCB_RANDR_CFLAGS@ | ||
305 | XCB_RANDR_LIBS = @XCB_RANDR_LIBS@ | ||
306 | XCB_RENDER_CFLAGS = @XCB_RENDER_CFLAGS@ | ||
307 | XCB_RENDER_LIBS = @XCB_RENDER_LIBS@ | ||
308 | XCB_SCREENSAVER_CFLAGS = @XCB_SCREENSAVER_CFLAGS@ | ||
309 | XCB_SCREENSAVER_LIBS = @XCB_SCREENSAVER_LIBS@ | ||
310 | XCB_SHAPE_CFLAGS = @XCB_SHAPE_CFLAGS@ | ||
311 | XCB_SHAPE_LIBS = @XCB_SHAPE_LIBS@ | ||
312 | XCB_SYNC_CFLAGS = @XCB_SYNC_CFLAGS@ | ||
313 | XCB_SYNC_LIBS = @XCB_SYNC_LIBS@ | ||
314 | XCB_X11_CFLAGS = @XCB_X11_CFLAGS@ | ||
315 | XCB_X11_LIBS = @XCB_X11_LIBS@ | ||
316 | XCB_XFIXES_CFLAGS = @XCB_XFIXES_CFLAGS@ | ||
317 | XCB_XFIXES_LIBS = @XCB_XFIXES_LIBS@ | ||
318 | XCB_XGESTURE_CFLAGS = @XCB_XGESTURE_CFLAGS@ | ||
319 | XCB_XGESTURE_LIBS = @XCB_XGESTURE_LIBS@ | ||
320 | XCB_XINERAMA_CFLAGS = @XCB_XINERAMA_CFLAGS@ | ||
321 | XCB_XINERAMA_LIBS = @XCB_XINERAMA_LIBS@ | ||
322 | XCB_XINPUT_CFLAGS = @XCB_XINPUT_CFLAGS@ | ||
323 | XCB_XINPUT_LIBS = @XCB_XINPUT_LIBS@ | ||
324 | XCB_XPRINT_CFLAGS = @XCB_XPRINT_CFLAGS@ | ||
325 | XCB_XPRINT_LIBS = @XCB_XPRINT_LIBS@ | ||
326 | XCB_XTEST_CFLAGS = @XCB_XTEST_CFLAGS@ | ||
327 | XCB_XTEST_LIBS = @XCB_XTEST_LIBS@ | ||
328 | XCOMPOSITE_CFLAGS = @XCOMPOSITE_CFLAGS@ | ||
329 | XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ | ||
330 | XDAMAGE_CFLAGS = @XDAMAGE_CFLAGS@ | ||
331 | XDAMAGE_LIBS = @XDAMAGE_LIBS@ | ||
332 | XDPMS_CFLAGS = @XDPMS_CFLAGS@ | ||
333 | XDPMS_LIBS = @XDPMS_LIBS@ | ||
334 | XFIXES_CFLAGS = @XFIXES_CFLAGS@ | ||
335 | XFIXES_LIBS = @XFIXES_LIBS@ | ||
336 | XGESTURE_CFLAGS = @XGESTURE_CFLAGS@ | ||
337 | XGESTURE_LIBS = @XGESTURE_LIBS@ | ||
338 | XGETTEXT = @XGETTEXT@ | ||
339 | XGETTEXT_015 = @XGETTEXT_015@ | ||
340 | XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ | ||
341 | XI2_CFLAGS = @XI2_CFLAGS@ | ||
342 | XI2_LIBS = @XI2_LIBS@ | ||
343 | XINERAMA_CFLAGS = @XINERAMA_CFLAGS@ | ||
344 | XINERAMA_LIBS = @XINERAMA_LIBS@ | ||
345 | XKB_CFLAGS = @XKB_CFLAGS@ | ||
346 | XKB_LIBS = @XKB_LIBS@ | ||
347 | XMKMF = @XMKMF@ | ||
348 | XPRINT_CFLAGS = @XPRINT_CFLAGS@ | ||
349 | XPRINT_LIBS = @XPRINT_LIBS@ | ||
350 | XRANDR_CFLAGS = @XRANDR_CFLAGS@ | ||
351 | XRANDR_LIBS = @XRANDR_LIBS@ | ||
352 | XRENDER_CFLAGS = @XRENDER_CFLAGS@ | ||
353 | XRENDER_LIBS = @XRENDER_LIBS@ | ||
354 | XSS_CFLAGS = @XSS_CFLAGS@ | ||
355 | XSS_LIBS = @XSS_LIBS@ | ||
356 | XTEST_CFLAGS = @XTEST_CFLAGS@ | ||
357 | XTEST_LIBS = @XTEST_LIBS@ | ||
358 | X_CFLAGS = @X_CFLAGS@ | ||
359 | X_EXTRA_LIBS = @X_EXTRA_LIBS@ | ||
360 | X_LIBS = @X_LIBS@ | ||
361 | X_PRE_LIBS = @X_PRE_LIBS@ | ||
362 | Xcursor_cflags = @Xcursor_cflags@ | ||
363 | Xcursor_libs = @Xcursor_libs@ | ||
364 | abs_builddir = @abs_builddir@ | ||
365 | abs_srcdir = @abs_srcdir@ | ||
366 | abs_top_builddir = @abs_top_builddir@ | ||
367 | abs_top_srcdir = @abs_top_srcdir@ | ||
368 | ac_ct_CC = @ac_ct_CC@ | ||
369 | ac_ct_CXX = @ac_ct_CXX@ | ||
370 | ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ | ||
371 | ac_ct_OBJC = @ac_ct_OBJC@ | ||
372 | am__include = @am__include@ | ||
373 | am__leading_dot = @am__leading_dot@ | ||
374 | am__quote = @am__quote@ | ||
375 | am__tar = @am__tar@ | ||
376 | am__untar = @am__untar@ | ||
377 | bindir = @bindir@ | ||
378 | build = @build@ | ||
379 | build_alias = @build_alias@ | ||
380 | build_cpu = @build_cpu@ | ||
381 | build_os = @build_os@ | ||
382 | build_vendor = @build_vendor@ | ||
383 | builddir = @builddir@ | ||
384 | cocoa_ldflags = @cocoa_ldflags@ | ||
385 | datadir = @datadir@ | ||
386 | datarootdir = @datarootdir@ | ||
387 | dlopen_libs = @dlopen_libs@ | ||
388 | docdir = @docdir@ | ||
389 | dvidir = @dvidir@ | ||
390 | ecore_cocoa_cflags = @ecore_cocoa_cflags@ | ||
391 | ecore_cocoa_libs = @ecore_cocoa_libs@ | ||
392 | ecore_con_cflags = @ecore_con_cflags@ | ||
393 | ecore_con_libs = @ecore_con_libs@ | ||
394 | ecore_directfb_cflags = @ecore_directfb_cflags@ | ||
395 | ecore_directfb_libs = @ecore_directfb_libs@ | ||
396 | ecore_evas_cflags = @ecore_evas_cflags@ | ||
397 | ecore_evas_libs = @ecore_evas_libs@ | ||
398 | ecore_fb_cflags = @ecore_fb_cflags@ | ||
399 | ecore_fb_libs = @ecore_fb_libs@ | ||
400 | ecore_file_cflags = @ecore_file_cflags@ | ||
401 | ecore_file_libs = @ecore_file_libs@ | ||
402 | ecore_imf_cflags = @ecore_imf_cflags@ | ||
403 | ecore_imf_evas_cflags = @ecore_imf_evas_cflags@ | ||
404 | ecore_imf_evas_libs = @ecore_imf_evas_libs@ | ||
405 | ecore_imf_libs = @ecore_imf_libs@ | ||
406 | ecore_imf_scim_cflags = @ecore_imf_scim_cflags@ | ||
407 | ecore_imf_scim_libs = @ecore_imf_scim_libs@ | ||
408 | ecore_imf_xim_cflags = @ecore_imf_xim_cflags@ | ||
409 | ecore_imf_xim_libs = @ecore_imf_xim_libs@ | ||
410 | ecore_input_cflags = @ecore_input_cflags@ | ||
411 | ecore_input_evas_cflags = @ecore_input_evas_cflags@ | ||
412 | ecore_input_evas_libs = @ecore_input_evas_libs@ | ||
413 | ecore_input_libs = @ecore_input_libs@ | ||
414 | ecore_ipc_cflags = @ecore_ipc_cflags@ | ||
415 | ecore_ipc_libs = @ecore_ipc_libs@ | ||
416 | ecore_psl1ght_cflags = @ecore_psl1ght_cflags@ | ||
417 | ecore_psl1ght_libs = @ecore_psl1ght_libs@ | ||
418 | ecore_sdl_cflags = @ecore_sdl_cflags@ | ||
419 | ecore_sdl_libs = @ecore_sdl_libs@ | ||
420 | ecore_wayland_cflags = @ecore_wayland_cflags@ | ||
421 | ecore_wayland_libs = @ecore_wayland_libs@ | ||
422 | ecore_win32_cflags = @ecore_win32_cflags@ | ||
423 | ecore_win32_libs = @ecore_win32_libs@ | ||
424 | ecore_wince_cflags = @ecore_wince_cflags@ | ||
425 | ecore_wince_libs = @ecore_wince_libs@ | ||
426 | ecore_x_cflags = @ecore_x_cflags@ | ||
427 | ecore_x_libs = @ecore_x_libs@ | ||
428 | ecore_x_libs_private = @ecore_x_libs_private@ | ||
429 | efl_doxygen = @efl_doxygen@ | ||
430 | efl_have_doxygen = @efl_have_doxygen@ | ||
431 | exec_prefix = @exec_prefix@ | ||
432 | have_ecore_x_xcb_define = @have_ecore_x_xcb_define@ | ||
433 | host = @host@ | ||
434 | host_alias = @host_alias@ | ||
435 | host_cpu = @host_cpu@ | ||
436 | host_os = @host_os@ | ||
437 | host_vendor = @host_vendor@ | ||
438 | htmldir = @htmldir@ | ||
439 | includedir = @includedir@ | ||
440 | infodir = @infodir@ | ||
441 | install_sh = @install_sh@ | ||
442 | libdir = @libdir@ | ||
443 | libexecdir = @libexecdir@ | ||
444 | localedir = @localedir@ | ||
445 | localstatedir = @localstatedir@ | ||
446 | lt_ECHO = @lt_ECHO@ | ||
447 | lt_enable_auto_import = @lt_enable_auto_import@ | ||
448 | mandir = @mandir@ | ||
449 | mkdir_p = @mkdir_p@ | ||
450 | oldincludedir = @oldincludedir@ | ||
451 | pdfdir = @pdfdir@ | ||
452 | pkgconfig_requires_private = @pkgconfig_requires_private@ | ||
453 | prefix = @prefix@ | ||
454 | program_transform_name = @program_transform_name@ | ||
455 | psdir = @psdir@ | ||
456 | release_info = @release_info@ | ||
457 | requirements_ecore = @requirements_ecore@ | ||
458 | requirements_ecore_cocoa = @requirements_ecore_cocoa@ | ||
459 | requirements_ecore_con = @requirements_ecore_con@ | ||
460 | requirements_ecore_directfb = @requirements_ecore_directfb@ | ||
461 | requirements_ecore_evas = @requirements_ecore_evas@ | ||
462 | requirements_ecore_fb = @requirements_ecore_fb@ | ||
463 | requirements_ecore_file = @requirements_ecore_file@ | ||
464 | requirements_ecore_imf = @requirements_ecore_imf@ | ||
465 | requirements_ecore_imf_evas = @requirements_ecore_imf_evas@ | ||
466 | requirements_ecore_imf_scim = @requirements_ecore_imf_scim@ | ||
467 | requirements_ecore_imf_xim = @requirements_ecore_imf_xim@ | ||
468 | requirements_ecore_input = @requirements_ecore_input@ | ||
469 | requirements_ecore_input_evas = @requirements_ecore_input_evas@ | ||
470 | requirements_ecore_ipc = @requirements_ecore_ipc@ | ||
471 | requirements_ecore_psl1ght = @requirements_ecore_psl1ght@ | ||
472 | requirements_ecore_sdl = @requirements_ecore_sdl@ | ||
473 | requirements_ecore_wayland = @requirements_ecore_wayland@ | ||
474 | requirements_ecore_win32 = @requirements_ecore_win32@ | ||
475 | requirements_ecore_wince = @requirements_ecore_wince@ | ||
476 | requirements_ecore_x = @requirements_ecore_x@ | ||
477 | rt_libs = @rt_libs@ | ||
478 | sbindir = @sbindir@ | ||
479 | sharedstatedir = @sharedstatedir@ | ||
480 | srcdir = @srcdir@ | ||
481 | sysconfdir = @sysconfdir@ | ||
482 | target_alias = @target_alias@ | ||
483 | top_build_prefix = @top_build_prefix@ | ||
484 | top_builddir = @top_builddir@ | ||
485 | top_srcdir = @top_srcdir@ | ||
486 | version_info = @version_info@ | ||
487 | x_cflags = @x_cflags@ | ||
488 | x_includes = @x_includes@ | ||
489 | x_libs = @x_libs@ | ||
490 | MAINTAINERCLEANFILES = Makefile.in | ||
491 | AM_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 | |||
509 | pkgdir = $(libdir)/ecore/immodules | ||
510 | pkg_LTLIBRARIES = scim.la | ||
511 | scim_la_SOURCES = \ | ||
512 | scim_imcontext.cpp \ | ||
513 | scim_module.cpp \ | ||
514 | scim_imcontext.h | ||
515 | |||
516 | scim_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 | |||
523 | scim_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version | ||
524 | scim_la_LIBTOOLFLAGS = --tag=disable-static | ||
525 | all: 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 | ||
542 | Makefile: $(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): | ||
559 | install-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 | |||
573 | uninstall-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 | |||
582 | clean-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 | ||
590 | scim.la: $(scim_la_OBJECTS) $(scim_la_DEPENDENCIES) | ||
591 | $(AM_V_CXXLD)$(scim_la_LINK) -rpath $(pkgdir) $(scim_la_OBJECTS) $(scim_la_LIBADD) $(LIBS) | ||
592 | |||
593 | mostlyclean-compile: | ||
594 | -rm -f *.$(OBJEXT) | ||
595 | |||
596 | distclean-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 | |||
626 | scim_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 | |||
634 | scim_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 | |||
642 | mostlyclean-libtool: | ||
643 | -rm -f *.lo | ||
644 | |||
645 | clean-libtool: | ||
646 | -rm -rf .libs _libs | ||
647 | |||
648 | ID: $(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 | ||
656 | tags: TAGS | ||
657 | |||
658 | TAGS: $(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 | ||
679 | ctags: CTAGS | ||
680 | CTAGS: $(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 | |||
692 | GTAGS: | ||
693 | here=`$(am__cd) $(top_builddir) && pwd` \ | ||
694 | && $(am__cd) $(top_srcdir) \ | ||
695 | && gtags -i $(GTAGS_ARGS) "$$here" | ||
696 | |||
697 | distclean-tags: | ||
698 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags | ||
699 | |||
700 | distdir: $(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 | ||
730 | check-am: all-am | ||
731 | check: check-am | ||
732 | all-am: Makefile $(LTLIBRARIES) | ||
733 | installdirs: | ||
734 | for dir in "$(DESTDIR)$(pkgdir)"; do \ | ||
735 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ | ||
736 | done | ||
737 | install: install-am | ||
738 | install-exec: install-exec-am | ||
739 | install-data: install-data-am | ||
740 | uninstall: uninstall-am | ||
741 | |||
742 | install-am: all-am | ||
743 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am | ||
744 | |||
745 | installcheck: installcheck-am | ||
746 | install-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 | ||
751 | mostlyclean-generic: | ||
752 | |||
753 | clean-generic: | ||
754 | |||
755 | distclean-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 | |||
759 | maintainer-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) | ||
763 | clean: clean-am | ||
764 | |||
765 | clean-am: clean-generic clean-libtool clean-pkgLTLIBRARIES \ | ||
766 | mostlyclean-am | ||
767 | |||
768 | distclean: distclean-am | ||
769 | -rm -rf ./$(DEPDIR) | ||
770 | -rm -f Makefile | ||
771 | distclean-am: clean-am distclean-compile distclean-generic \ | ||
772 | distclean-tags | ||
773 | |||
774 | dvi: dvi-am | ||
775 | |||
776 | dvi-am: | ||
777 | |||
778 | html: html-am | ||
779 | |||
780 | html-am: | ||
781 | |||
782 | info: info-am | ||
783 | |||
784 | info-am: | ||
785 | |||
786 | install-data-am: install-pkgLTLIBRARIES | ||
787 | |||
788 | install-dvi: install-dvi-am | ||
789 | |||
790 | install-dvi-am: | ||
791 | |||
792 | install-exec-am: | ||
793 | |||
794 | install-html: install-html-am | ||
795 | |||
796 | install-html-am: | ||
797 | |||
798 | install-info: install-info-am | ||
799 | |||
800 | install-info-am: | ||
801 | |||
802 | install-man: | ||
803 | |||
804 | install-pdf: install-pdf-am | ||
805 | |||
806 | install-pdf-am: | ||
807 | |||
808 | install-ps: install-ps-am | ||
809 | |||
810 | install-ps-am: | ||
811 | |||
812 | installcheck-am: | ||
813 | |||
814 | maintainer-clean: maintainer-clean-am | ||
815 | -rm -rf ./$(DEPDIR) | ||
816 | -rm -f Makefile | ||
817 | maintainer-clean-am: distclean-am maintainer-clean-generic | ||
818 | |||
819 | mostlyclean: mostlyclean-am | ||
820 | |||
821 | mostlyclean-am: mostlyclean-compile mostlyclean-generic \ | ||
822 | mostlyclean-libtool | ||
823 | |||
824 | pdf: pdf-am | ||
825 | |||
826 | pdf-am: | ||
827 | |||
828 | ps: ps-am | ||
829 | |||
830 | ps-am: | ||
831 | |||
832 | uninstall-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 | |||
29 | using namespace scim; | ||
30 | |||
31 | struct _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. */ | ||
58 | static EcoreIMFContextISFImpl *new_ic_impl (EcoreIMFContextISF *parent); | ||
59 | static void delete_ic_impl (EcoreIMFContextISFImpl *impl); | ||
60 | static void delete_all_ic_impl (void); | ||
61 | |||
62 | static EcoreIMFContextISF *find_ic (int id); | ||
63 | |||
64 | |||
65 | /* private functions */ | ||
66 | static void panel_slot_reload_config (int context); | ||
67 | static void panel_slot_exit (int context); | ||
68 | static void panel_slot_update_lookup_table_page_size(int context, | ||
69 | int page_size); | ||
70 | static void panel_slot_lookup_table_page_up (int context); | ||
71 | static void panel_slot_lookup_table_page_down (int context); | ||
72 | static void panel_slot_trigger_property (int context, | ||
73 | const String &property); | ||
74 | static void panel_slot_process_helper_event (int context, | ||
75 | const String &target_uuid, | ||
76 | const String &helper_uuid, | ||
77 | const Transaction &trans); | ||
78 | static void panel_slot_move_preedit_caret (int context, | ||
79 | int caret_pos); | ||
80 | static void panel_slot_select_candidate (int context, | ||
81 | int cand_index); | ||
82 | static void panel_slot_process_key_event (int context, | ||
83 | const KeyEvent &key); | ||
84 | static void panel_slot_commit_string (int context, | ||
85 | const WideString &wstr); | ||
86 | static void panel_slot_forward_key_event (int context, | ||
87 | const KeyEvent &key); | ||
88 | static void panel_slot_request_help (int context); | ||
89 | static void panel_slot_request_factory_menu (int context); | ||
90 | static void panel_slot_change_factory (int context, | ||
91 | const String &uuid); | ||
92 | |||
93 | static void panel_req_focus_in (EcoreIMFContextISF *ic); | ||
94 | static void panel_req_update_factory_info (EcoreIMFContextISF *ic); | ||
95 | static void panel_req_update_spot_location (EcoreIMFContextISF *ic); | ||
96 | static void panel_req_show_help (EcoreIMFContextISF *ic); | ||
97 | static void panel_req_show_factory_menu (EcoreIMFContextISF *ic); | ||
98 | |||
99 | /* Panel iochannel handler*/ | ||
100 | static bool panel_initialize (void); | ||
101 | static void panel_finalize (void); | ||
102 | static Eina_Bool panel_iochannel_handler (void *data, | ||
103 | Ecore_Fd_Handler *fd_handler); | ||
104 | |||
105 | /* utility functions */ | ||
106 | static bool filter_hotkeys (EcoreIMFContextISF *ic, | ||
107 | const KeyEvent &key); | ||
108 | static void turn_on_ic (EcoreIMFContextISF *ic); | ||
109 | static void turn_off_ic (EcoreIMFContextISF *ic); | ||
110 | static void set_ic_capabilities (EcoreIMFContextISF *ic); | ||
111 | |||
112 | static void initialize (void); | ||
113 | static void finalize (void); | ||
114 | |||
115 | static void open_next_factory (EcoreIMFContextISF *ic); | ||
116 | static void open_previous_factory (EcoreIMFContextISF *ic); | ||
117 | static void open_specific_factory (EcoreIMFContextISF *ic, | ||
118 | const String &uuid); | ||
119 | static void initialize_modifier_bits (Display *display); | ||
120 | static unsigned int scim_x11_keymask_scim_to_x11 (Display *display, uint16 scimkeymask); | ||
121 | static XKeyEvent createKeyEvent (Display *display, Window &win, | ||
122 | Window &winRoot, bool press, | ||
123 | int keycode, int modifiers); | ||
124 | static void _x_send_key_event (const KeyEvent &key); | ||
125 | |||
126 | static void attach_instance (const IMEngineInstancePointer &si); | ||
127 | |||
128 | /* slot functions */ | ||
129 | static void slot_show_preedit_string (IMEngineInstanceBase *si); | ||
130 | static void slot_show_aux_string (IMEngineInstanceBase *si); | ||
131 | static void slot_show_lookup_table (IMEngineInstanceBase *si); | ||
132 | |||
133 | static void slot_hide_preedit_string (IMEngineInstanceBase *si); | ||
134 | static void slot_hide_aux_string (IMEngineInstanceBase *si); | ||
135 | static void slot_hide_lookup_table (IMEngineInstanceBase *si); | ||
136 | |||
137 | static void slot_update_preedit_caret (IMEngineInstanceBase *si, | ||
138 | int caret); | ||
139 | static void slot_update_preedit_string (IMEngineInstanceBase *si, | ||
140 | const WideString &str, | ||
141 | const AttributeList &attrs); | ||
142 | static void slot_update_aux_string (IMEngineInstanceBase *si, | ||
143 | const WideString &str, | ||
144 | const AttributeList &attrs); | ||
145 | static void slot_commit_string (IMEngineInstanceBase *si, | ||
146 | const WideString &str); | ||
147 | static void slot_forward_key_event (IMEngineInstanceBase *si, | ||
148 | const KeyEvent &key); | ||
149 | static void slot_update_lookup_table (IMEngineInstanceBase *si, | ||
150 | const LookupTable &table); | ||
151 | |||
152 | static void slot_register_properties (IMEngineInstanceBase *si, | ||
153 | const PropertyList &properties); | ||
154 | static void slot_update_property (IMEngineInstanceBase *si, | ||
155 | const Property &property); | ||
156 | static void slot_beep (IMEngineInstanceBase *si); | ||
157 | static void slot_start_helper (IMEngineInstanceBase *si, | ||
158 | const String &helper_uuid); | ||
159 | static void slot_stop_helper (IMEngineInstanceBase *si, | ||
160 | const String &helper_uuid); | ||
161 | static void slot_send_helper_event (IMEngineInstanceBase *si, | ||
162 | const String &helper_uuid, | ||
163 | const Transaction &trans); | ||
164 | static bool slot_get_surrounding_text (IMEngineInstanceBase *si, | ||
165 | WideString &text, | ||
166 | int &cursor, | ||
167 | int maxlen_before, | ||
168 | int maxlen_after); | ||
169 | static bool slot_delete_surrounding_text (IMEngineInstanceBase *si, | ||
170 | int offset, | ||
171 | int len); | ||
172 | |||
173 | static void reload_config_callback (const ConfigPointer &config); | ||
174 | |||
175 | static void fallback_commit_string_cb (IMEngineInstanceBase *si, | ||
176 | const WideString &str); | ||
177 | |||
178 | static void caps_mode_check (Ecore_IMF_Context *ctx, Eina_Bool force); | ||
179 | |||
180 | /* Local variables declaration */ | ||
181 | static String _language; | ||
182 | static EcoreIMFContextISFImpl *_used_ic_impl_list = 0; | ||
183 | static EcoreIMFContextISFImpl *_free_ic_impl_list = 0; | ||
184 | static EcoreIMFContextISF *_ic_list = 0; | ||
185 | |||
186 | static KeyboardLayout _keyboard_layout = SCIM_KEYBOARD_Default; | ||
187 | static int _valid_key_mask = SCIM_KEY_AllMasks; | ||
188 | |||
189 | static FrontEndHotkeyMatcher _frontend_hotkey_matcher; | ||
190 | static IMEngineHotkeyMatcher _imengine_hotkey_matcher; | ||
191 | |||
192 | static IMEngineInstancePointer _default_instance; | ||
193 | |||
194 | static ConfigModule *_config_module = 0; | ||
195 | static ConfigPointer _config; | ||
196 | static BackEndPointer _backend; | ||
197 | |||
198 | static EcoreIMFContextISF *_focused_ic = 0; | ||
199 | |||
200 | static bool _scim_initialized = false; | ||
201 | |||
202 | static int _instance_count = 0; | ||
203 | static int _context_count = 0; | ||
204 | |||
205 | static IMEngineFactoryPointer _fallback_factory; | ||
206 | static IMEngineInstancePointer _fallback_instance; | ||
207 | static PanelClient _panel_client; | ||
208 | |||
209 | static Ecore_Fd_Handler *_panel_iochannel_read_handler = 0; | ||
210 | static Ecore_Fd_Handler *_panel_iochannel_err_handler = 0; | ||
211 | |||
212 | static Ecore_X_Window _client_window = 0; | ||
213 | |||
214 | static bool _on_the_spot = true; | ||
215 | static bool _shared_input_method = false; | ||
216 | |||
217 | static Eina_Bool autocap_allow = EINA_FALSE; | ||
218 | |||
219 | static Display *__current_display = 0; | ||
220 | static int __current_alt_mask = Mod1Mask; | ||
221 | static int __current_meta_mask = 0; | ||
222 | static int __current_super_mask = 0; | ||
223 | static int __current_hyper_mask = 0; | ||
224 | static int __current_numlock_mask = Mod2Mask; | ||
225 | |||
226 | // A hack to shutdown the immodule cleanly even if im_module_exit() is not called when exiting. | ||
227 | class FinalizeHandler | ||
228 | { | ||
229 | public: | ||
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 | |||
241 | static FinalizeHandler _finalize_handler; | ||
242 | |||
243 | static unsigned int | ||
244 | utf8_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 | |||
256 | static unsigned int | ||
257 | get_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 */ | ||
270 | static EcoreIMFContextISFImpl * | ||
271 | new_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 | |||
297 | static void | ||
298 | delete_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 | |||
325 | static void | ||
326 | delete_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 | |||
346 | static EcoreIMFContextISF * | ||
347 | find_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 | |||
361 | static Eina_Bool | ||
362 | analyze_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 | |||
449 | done: | ||
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 | |||
460 | static void | ||
461 | caps_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 | |||
488 | static void | ||
489 | feed_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 | |||
511 | static void | ||
512 | window_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 | */ | ||
544 | EAPI EcoreIMFContextISF * | ||
545 | isf_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 | */ | ||
578 | EAPI void | ||
579 | isf_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 | |||
590 | EAPI void | ||
591 | isf_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 | |||
671 | EAPI void | ||
672 | isf_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 | */ | ||
758 | EAPI void | ||
759 | isf_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 | */ | ||
782 | EAPI void | ||
783 | isf_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 | */ | ||
809 | EAPI void | ||
810 | isf_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 | */ | ||
845 | EAPI void | ||
846 | isf_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 | */ | ||
960 | EAPI void | ||
961 | isf_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 | */ | ||
1009 | EAPI void | ||
1010 | isf_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 | */ | ||
1065 | EAPI void | ||
1066 | isf_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 | |||
1093 | EAPI void | ||
1094 | isf_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 | */ | ||
1240 | EAPI void | ||
1241 | isf_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 | */ | ||
1281 | EAPI void | ||
1282 | isf_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 | */ | ||
1312 | EAPI void | ||
1313 | isf_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 | */ | ||
1331 | EAPI void | ||
1332 | isf_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 | |||
1342 | EAPI void | ||
1343 | isf_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 | |||
1369 | EAPI Eina_Bool | ||
1370 | isf_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 | |||
1425 | EAPI void | ||
1426 | isf_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 | |||
1438 | EAPI void | ||
1439 | isf_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 */ | ||
1452 | static void | ||
1453 | panel_slot_reload_config(int context __UNUSED__) | ||
1454 | { | ||
1455 | SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n"; | ||
1456 | _config->reload(); | ||
1457 | } | ||
1458 | |||
1459 | static void | ||
1460 | panel_slot_exit(int /* context */) | ||
1461 | { | ||
1462 | SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n"; | ||
1463 | |||
1464 | finalize(); | ||
1465 | } | ||
1466 | |||
1467 | static void | ||
1468 | panel_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 | |||
1480 | static void | ||
1481 | panel_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 | |||
1493 | static void | ||
1494 | panel_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 | |||
1506 | static void | ||
1507 | panel_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 | |||
1519 | static void | ||
1520 | panel_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 | |||
1535 | static void | ||
1536 | panel_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 | |||
1548 | static void | ||
1549 | panel_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 | |||
1561 | static void | ||
1562 | panel_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 | |||
1571 | static void | ||
1572 | panel_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 | |||
1587 | static void | ||
1588 | panel_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 | |||
1597 | static void | ||
1598 | panel_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 | |||
1611 | static void | ||
1612 | panel_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 | |||
1625 | static void | ||
1626 | panel_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. */ | ||
1641 | static void | ||
1642 | panel_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 | |||
1669 | static void | ||
1670 | panel_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 | |||
1692 | static void | ||
1693 | panel_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 | |||
1714 | static void | ||
1715 | panel_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 | |||
1722 | static void | ||
1723 | panel_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 | |||
1730 | static bool | ||
1731 | filter_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 | |||
1786 | static bool | ||
1787 | panel_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 | |||
1811 | static void | ||
1812 | panel_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 | |||
1831 | static Eina_Bool | ||
1832 | panel_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 | |||
1854 | static void | ||
1855 | turn_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 | |||
1890 | static void | ||
1891 | turn_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 | |||
1922 | static void | ||
1923 | set_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 | |||
1938 | static bool | ||
1939 | check_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 | |||
1963 | void | ||
1964 | initialize(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 | |||
2090 | static void | ||
2091 | finalize(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 | |||
2134 | static void | ||
2135 | open_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 | |||
2161 | static void | ||
2162 | open_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 | |||
2191 | static void | ||
2192 | open_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 | |||
2260 | static 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 | |||
2359 | static 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 | |||
2379 | static 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 | |||
2409 | static 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 | |||
2450 | static void | ||
2451 | attach_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 | ||
2508 | static void | ||
2509 | slot_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 | |||
2531 | static void | ||
2532 | slot_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 | |||
2542 | static void | ||
2543 | slot_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 | |||
2553 | static void | ||
2554 | slot_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 | |||
2589 | static void | ||
2590 | slot_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 | |||
2600 | static void | ||
2601 | slot_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 | |||
2611 | static void | ||
2612 | slot_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 | |||
2637 | static void | ||
2638 | slot_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 | |||
2671 | static void | ||
2672 | slot_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 | |||
2684 | static void | ||
2685 | slot_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 | |||
2699 | static void | ||
2700 | slot_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 | |||
2714 | static void | ||
2715 | slot_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 | |||
2726 | static void | ||
2727 | slot_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 | |||
2738 | static void | ||
2739 | slot_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 | |||
2750 | static void | ||
2751 | slot_beep(IMEngineInstanceBase *si __UNUSED__) | ||
2752 | { | ||
2753 | SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n"; | ||
2754 | } | ||
2755 | |||
2756 | static void | ||
2757 | slot_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 | |||
2770 | static void | ||
2771 | slot_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 | |||
2782 | static void | ||
2783 | slot_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 | |||
2797 | static bool | ||
2798 | slot_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 | |||
2832 | static bool | ||
2833 | slot_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 | |||
2854 | static void | ||
2855 | reload_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 | |||
2883 | static void | ||
2884 | fallback_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 | |||
6 | typedef struct _EcoreIMFContextISF EcoreIMFContextISF; | ||
7 | typedef struct _EcoreIMFContextISFImpl EcoreIMFContextISFImpl; | ||
8 | |||
9 | struct _EcoreIMFContextISF { | ||
10 | Ecore_IMF_Context *ctx; | ||
11 | |||
12 | EcoreIMFContextISFImpl *impl; | ||
13 | |||
14 | int id; /* Input Context id*/ | ||
15 | struct _EcoreIMFContextISF *next; | ||
16 | }; | ||
17 | |||
18 | void isf_imf_context_add (Ecore_IMF_Context *ctx); | ||
19 | void isf_imf_context_del (Ecore_IMF_Context *ctx); | ||
20 | void isf_imf_context_client_window_set (Ecore_IMF_Context *ctx, void *window); | ||
21 | void isf_imf_context_client_canvas_set (Ecore_IMF_Context *ctx, void *window); | ||
22 | void isf_imf_context_focus_in (Ecore_IMF_Context *ctx); | ||
23 | void isf_imf_context_focus_out (Ecore_IMF_Context *ctx); | ||
24 | void isf_imf_context_reset (Ecore_IMF_Context *ctx); | ||
25 | void isf_imf_context_cursor_position_set (Ecore_IMF_Context *ctx, int cursor_pos); | ||
26 | void isf_imf_context_cursor_location_set (Ecore_IMF_Context *ctx, int x, int y, int w, int h); | ||
27 | void isf_imf_context_input_mode_set (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode); | ||
28 | void isf_imf_context_preedit_string_get (Ecore_IMF_Context *ctx, char** str, int *cursor_pos); | ||
29 | void isf_imf_context_preedit_string_with_attributes_get (Ecore_IMF_Context *ctx, char** str, Eina_List **attrs, int *cursor_pos); | ||
30 | void isf_imf_context_use_preedit_set (Ecore_IMF_Context* ctx, Eina_Bool use_preedit); | ||
31 | Eina_Bool isf_imf_context_filter_event (Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event); | ||
32 | void isf_imf_context_prediction_allow_set (Ecore_IMF_Context* ctx, Eina_Bool prediction); | ||
33 | void isf_imf_context_autocapital_type_set (Ecore_IMF_Context* ctx, Ecore_IMF_Autocapital_Type autocapital_type); | ||
34 | void isf_imf_context_input_panel_layout_set (Ecore_IMF_Context* ctx, Ecore_IMF_Input_Panel_Layout layout); | ||
35 | void isf_imf_context_input_panel_show(Ecore_IMF_Context *ctx); | ||
36 | void isf_imf_context_input_panel_hide(Ecore_IMF_Context *ctx); | ||
37 | |||
38 | EcoreIMFContextISF* isf_imf_context_new (void); | ||
39 | void 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 | ||
5 | extern "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 | |||