diff options
author | David Walter Seikel | 2012-01-04 18:41:13 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-04 18:41:13 +1000 |
commit | dd7595a3475407a7fa96a97393bae8c5220e8762 (patch) | |
tree | e341e911d7eb911a51684a7412ef7f7c7605d28e /libraries/ecore/src/modules/immodules/xim | |
parent | Add the skeleton. (diff) | |
download | SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.zip SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.gz SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.bz2 SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.xz |
Add the base Enlightenment Foundation Libraries - eina, eet, evas, ecore, embryo, and edje.
Note that embryo wont be used, but I'm not sure yet if you can build edje without it.
Diffstat (limited to 'libraries/ecore/src/modules/immodules/xim')
-rw-r--r-- | libraries/ecore/src/modules/immodules/xim/Makefile.am | 29 | ||||
-rw-r--r-- | libraries/ecore/src/modules/immodules/xim/Makefile.in | 808 | ||||
-rw-r--r-- | libraries/ecore/src/modules/immodules/xim/ecore_imf_xim.c | 1273 |
3 files changed, 2110 insertions, 0 deletions
diff --git a/libraries/ecore/src/modules/immodules/xim/Makefile.am b/libraries/ecore/src/modules/immodules/xim/Makefile.am new file mode 100644 index 0000000..57a9068 --- /dev/null +++ b/libraries/ecore/src/modules/immodules/xim/Makefile.am | |||
@@ -0,0 +1,29 @@ | |||
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_builddir)/src/lib/ecore \ | ||
10 | -I$(top_builddir)/src/lib/ecore_input \ | ||
11 | -I$(top_builddir)/src/lib/ecore_x \ | ||
12 | -I$(top_builddir)/src/lib/ecore_imf \ | ||
13 | -DPACKAGE_LIB_DIR=\"$(libdir)\" \ | ||
14 | -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ | ||
15 | @x_cflags@ \ | ||
16 | @EINA_CFLAGS@ | ||
17 | |||
18 | pkgdir = $(libdir)/ecore/immodules | ||
19 | |||
20 | pkg_LTLIBRARIES = xim.la | ||
21 | xim_la_SOURCES = \ | ||
22 | ecore_imf_xim.c | ||
23 | xim_la_LIBADD = \ | ||
24 | $(top_builddir)/src/lib/ecore_imf/libecore_imf.la \ | ||
25 | $(top_builddir)/src/lib/ecore_x/libecore_x.la \ | ||
26 | @x_libs@ \ | ||
27 | @EINA_LIBS@ | ||
28 | xim_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version | ||
29 | xim_la_LIBTOOLFLAGS = --tag=disable-static | ||
diff --git a/libraries/ecore/src/modules/immodules/xim/Makefile.in b/libraries/ecore/src/modules/immodules/xim/Makefile.in new file mode 100644 index 0000000..ec58d4b --- /dev/null +++ b/libraries/ecore/src/modules/immodules/xim/Makefile.in | |||
@@ -0,0 +1,808 @@ | |||
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/xim | ||
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/isc-posix.m4 $(top_srcdir)/m4/lib-ld.m4 \ | ||
52 | $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ | ||
53 | $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ | ||
54 | $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ | ||
55 | $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ | ||
56 | $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ | ||
57 | $(top_srcdir)/configure.ac | ||
58 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ | ||
59 | $(ACLOCAL_M4) | ||
60 | mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs | ||
61 | CONFIG_HEADER = $(top_builddir)/config.h | ||
62 | CONFIG_CLEAN_FILES = | ||
63 | CONFIG_CLEAN_VPATH_FILES = | ||
64 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; | ||
65 | am__vpath_adj = case $$p in \ | ||
66 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ | ||
67 | *) f=$$p;; \ | ||
68 | esac; | ||
69 | am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; | ||
70 | am__install_max = 40 | ||
71 | am__nobase_strip_setup = \ | ||
72 | srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` | ||
73 | am__nobase_strip = \ | ||
74 | for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" | ||
75 | am__nobase_list = $(am__nobase_strip_setup); \ | ||
76 | for p in $$list; do echo "$$p $$p"; done | \ | ||
77 | sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ | ||
78 | $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ | ||
79 | if (++n[$$2] == $(am__install_max)) \ | ||
80 | { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ | ||
81 | END { for (dir in files) print dir, files[dir] }' | ||
82 | am__base_list = \ | ||
83 | sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ | ||
84 | sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | ||
85 | am__installdirs = "$(DESTDIR)$(pkgdir)" | ||
86 | LTLIBRARIES = $(pkg_LTLIBRARIES) | ||
87 | xim_la_DEPENDENCIES = \ | ||
88 | $(top_builddir)/src/lib/ecore_imf/libecore_imf.la \ | ||
89 | $(top_builddir)/src/lib/ecore_x/libecore_x.la | ||
90 | am_xim_la_OBJECTS = xim_la-ecore_imf_xim.lo | ||
91 | xim_la_OBJECTS = $(am_xim_la_OBJECTS) | ||
92 | AM_V_lt = $(am__v_lt_$(V)) | ||
93 | am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) | ||
94 | am__v_lt_0 = --silent | ||
95 | xim_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(xim_la_LIBTOOLFLAGS) \ | ||
96 | $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ | ||
97 | $(xim_la_LDFLAGS) $(LDFLAGS) -o $@ | ||
98 | DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) | ||
99 | depcomp = $(SHELL) $(top_srcdir)/depcomp | ||
100 | am__depfiles_maybe = depfiles | ||
101 | am__mv = mv -f | ||
102 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ | ||
103 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | ||
104 | LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ | ||
105 | $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ | ||
106 | $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ | ||
107 | $(AM_CFLAGS) $(CFLAGS) | ||
108 | AM_V_CC = $(am__v_CC_$(V)) | ||
109 | am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) | ||
110 | am__v_CC_0 = @echo " CC " $@; | ||
111 | AM_V_at = $(am__v_at_$(V)) | ||
112 | am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) | ||
113 | am__v_at_0 = @ | ||
114 | CCLD = $(CC) | ||
115 | LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ | ||
116 | $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ | ||
117 | $(AM_LDFLAGS) $(LDFLAGS) -o $@ | ||
118 | AM_V_CCLD = $(am__v_CCLD_$(V)) | ||
119 | am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) | ||
120 | am__v_CCLD_0 = @echo " CCLD " $@; | ||
121 | AM_V_GEN = $(am__v_GEN_$(V)) | ||
122 | am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) | ||
123 | am__v_GEN_0 = @echo " GEN " $@; | ||
124 | SOURCES = $(xim_la_SOURCES) | ||
125 | DIST_SOURCES = $(xim_la_SOURCES) | ||
126 | ETAGS = etags | ||
127 | CTAGS = ctags | ||
128 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) | ||
129 | ACLOCAL = @ACLOCAL@ | ||
130 | ALLOCA = @ALLOCA@ | ||
131 | AMTAR = @AMTAR@ | ||
132 | AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ | ||
133 | AR = @AR@ | ||
134 | AS = @AS@ | ||
135 | AUTOCONF = @AUTOCONF@ | ||
136 | AUTOHEADER = @AUTOHEADER@ | ||
137 | AUTOMAKE = @AUTOMAKE@ | ||
138 | AWK = @AWK@ | ||
139 | CARES_CFLAGS = @CARES_CFLAGS@ | ||
140 | CARES_LIBS = @CARES_LIBS@ | ||
141 | CC = @CC@ | ||
142 | CCDEPMODE = @CCDEPMODE@ | ||
143 | CFLAGS = @CFLAGS@ | ||
144 | CHECK_CFLAGS = @CHECK_CFLAGS@ | ||
145 | CHECK_LIBS = @CHECK_LIBS@ | ||
146 | CPP = @CPP@ | ||
147 | CPPFLAGS = @CPPFLAGS@ | ||
148 | CURL_CFLAGS = @CURL_CFLAGS@ | ||
149 | CURL_LIBS = @CURL_LIBS@ | ||
150 | CXX = @CXX@ | ||
151 | CXXCPP = @CXXCPP@ | ||
152 | CXXDEPMODE = @CXXDEPMODE@ | ||
153 | CXXFLAGS = @CXXFLAGS@ | ||
154 | CYGPATH_W = @CYGPATH_W@ | ||
155 | DEFS = @DEFS@ | ||
156 | DEPDIR = @DEPDIR@ | ||
157 | DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@ | ||
158 | DIRECTFB_LIBS = @DIRECTFB_LIBS@ | ||
159 | DLLTOOL = @DLLTOOL@ | ||
160 | DSYMUTIL = @DSYMUTIL@ | ||
161 | DUMPBIN = @DUMPBIN@ | ||
162 | ECHO_C = @ECHO_C@ | ||
163 | ECHO_N = @ECHO_N@ | ||
164 | ECHO_T = @ECHO_T@ | ||
165 | ECORE_XCB_CFLAGS = @ECORE_XCB_CFLAGS@ | ||
166 | ECORE_XCB_LIBS = @ECORE_XCB_LIBS@ | ||
167 | EFL_ECORE_BUILD = @EFL_ECORE_BUILD@ | ||
168 | EFL_ECORE_CON_BUILD = @EFL_ECORE_CON_BUILD@ | ||
169 | EFL_ECORE_EVAS_BUILD = @EFL_ECORE_EVAS_BUILD@ | ||
170 | EFL_ECORE_FILE_BUILD = @EFL_ECORE_FILE_BUILD@ | ||
171 | EFL_ECORE_IMF_BUILD = @EFL_ECORE_IMF_BUILD@ | ||
172 | EFL_ECORE_IMF_EVAS_BUILD = @EFL_ECORE_IMF_EVAS_BUILD@ | ||
173 | EFL_ECORE_INPUT_BUILD = @EFL_ECORE_INPUT_BUILD@ | ||
174 | EFL_ECORE_INPUT_EVAS_BUILD = @EFL_ECORE_INPUT_EVAS_BUILD@ | ||
175 | EFL_ECORE_IPC_BUILD = @EFL_ECORE_IPC_BUILD@ | ||
176 | EFL_ECORE_PSL1GHT_BUILD = @EFL_ECORE_PSL1GHT_BUILD@ | ||
177 | EFL_ECORE_SDL_BUILD = @EFL_ECORE_SDL_BUILD@ | ||
178 | EFL_ECORE_WIN32_BUILD = @EFL_ECORE_WIN32_BUILD@ | ||
179 | EFL_ECORE_WINCE_BUILD = @EFL_ECORE_WINCE_BUILD@ | ||
180 | EFL_PTHREAD_CFLAGS = @EFL_PTHREAD_CFLAGS@ | ||
181 | EFL_PTHREAD_LIBS = @EFL_PTHREAD_LIBS@ | ||
182 | EGREP = @EGREP@ | ||
183 | EINA_CFLAGS = @EINA_CFLAGS@ | ||
184 | EINA_LIBS = @EINA_LIBS@ | ||
185 | ESCAPE_CFLAGS = @ESCAPE_CFLAGS@ | ||
186 | ESCAPE_LIBS = @ESCAPE_LIBS@ | ||
187 | EVAS_CFLAGS = @EVAS_CFLAGS@ | ||
188 | EVAS_LIBS = @EVAS_LIBS@ | ||
189 | EVIL_CFLAGS = @EVIL_CFLAGS@ | ||
190 | EVIL_LIBS = @EVIL_LIBS@ | ||
191 | EXEEXT = @EXEEXT@ | ||
192 | FGREP = @FGREP@ | ||
193 | GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ | ||
194 | GLIB_CFLAGS = @GLIB_CFLAGS@ | ||
195 | GLIB_LIBS = @GLIB_LIBS@ | ||
196 | GMSGFMT = @GMSGFMT@ | ||
197 | GMSGFMT_015 = @GMSGFMT_015@ | ||
198 | GREP = @GREP@ | ||
199 | INSTALL = @INSTALL@ | ||
200 | INSTALL_DATA = @INSTALL_DATA@ | ||
201 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | ||
202 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | ||
203 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ | ||
204 | INTLLIBS = @INTLLIBS@ | ||
205 | INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ | ||
206 | KEYSYMDEFS = @KEYSYMDEFS@ | ||
207 | LD = @LD@ | ||
208 | LDFLAGS = @LDFLAGS@ | ||
209 | LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ | ||
210 | LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ | ||
211 | LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ | ||
212 | LIBICONV = @LIBICONV@ | ||
213 | LIBINTL = @LIBINTL@ | ||
214 | LIBOBJS = @LIBOBJS@ | ||
215 | LIBS = @LIBS@ | ||
216 | LIBTOOL = @LIBTOOL@ | ||
217 | LIPO = @LIPO@ | ||
218 | LN_S = @LN_S@ | ||
219 | LTLIBICONV = @LTLIBICONV@ | ||
220 | LTLIBINTL = @LTLIBINTL@ | ||
221 | LTLIBOBJS = @LTLIBOBJS@ | ||
222 | MAKEINFO = @MAKEINFO@ | ||
223 | MKDIR_P = @MKDIR_P@ | ||
224 | MSGFMT = @MSGFMT@ | ||
225 | MSGFMT_015 = @MSGFMT_015@ | ||
226 | MSGMERGE = @MSGMERGE@ | ||
227 | NM = @NM@ | ||
228 | NMEDIT = @NMEDIT@ | ||
229 | OBJC = @OBJC@ | ||
230 | OBJCDEPMODE = @OBJCDEPMODE@ | ||
231 | OBJCFLAGS = @OBJCFLAGS@ | ||
232 | OBJDUMP = @OBJDUMP@ | ||
233 | OBJEXT = @OBJEXT@ | ||
234 | OTOOL = @OTOOL@ | ||
235 | OTOOL64 = @OTOOL64@ | ||
236 | PACKAGE = @PACKAGE@ | ||
237 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ | ||
238 | PACKAGE_NAME = @PACKAGE_NAME@ | ||
239 | PACKAGE_STRING = @PACKAGE_STRING@ | ||
240 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ | ||
241 | PACKAGE_URL = @PACKAGE_URL@ | ||
242 | PACKAGE_VERSION = @PACKAGE_VERSION@ | ||
243 | PATH_SEPARATOR = @PATH_SEPARATOR@ | ||
244 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | ||
245 | PIXMAN_LIBS = @PIXMAN_LIBS@ | ||
246 | PKG_CONFIG = @PKG_CONFIG@ | ||
247 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
248 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
249 | POSUB = @POSUB@ | ||
250 | RANLIB = @RANLIB@ | ||
251 | SDL_CFLAGS = @SDL_CFLAGS@ | ||
252 | SDL_CONFIG = @SDL_CONFIG@ | ||
253 | SDL_LIBS = @SDL_LIBS@ | ||
254 | SED = @SED@ | ||
255 | SET_MAKE = @SET_MAKE@ | ||
256 | SHELL = @SHELL@ | ||
257 | SSL_CFLAGS = @SSL_CFLAGS@ | ||
258 | SSL_LIBS = @SSL_LIBS@ | ||
259 | STRIP = @STRIP@ | ||
260 | TLS2_CFLAGS = @TLS2_CFLAGS@ | ||
261 | TLS2_LIBS = @TLS2_LIBS@ | ||
262 | TLS_CFLAGS = @TLS_CFLAGS@ | ||
263 | TLS_LIBS = @TLS_LIBS@ | ||
264 | TSLIB_CFLAGS = @TSLIB_CFLAGS@ | ||
265 | TSLIB_LIBS = @TSLIB_LIBS@ | ||
266 | USE_NLS = @USE_NLS@ | ||
267 | VERSION = @VERSION@ | ||
268 | VMAJ = @VMAJ@ | ||
269 | WIN32_CFLAGS = @WIN32_CFLAGS@ | ||
270 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | ||
271 | WIN32_LIBS = @WIN32_LIBS@ | ||
272 | XCB_COMPOSITE_CFLAGS = @XCB_COMPOSITE_CFLAGS@ | ||
273 | XCB_COMPOSITE_LIBS = @XCB_COMPOSITE_LIBS@ | ||
274 | XCB_CURSOR_CFLAGS = @XCB_CURSOR_CFLAGS@ | ||
275 | XCB_CURSOR_LIBS = @XCB_CURSOR_LIBS@ | ||
276 | XCB_DAMAGE_CFLAGS = @XCB_DAMAGE_CFLAGS@ | ||
277 | XCB_DAMAGE_LIBS = @XCB_DAMAGE_LIBS@ | ||
278 | XCB_DPMS_CFLAGS = @XCB_DPMS_CFLAGS@ | ||
279 | XCB_DPMS_LIBS = @XCB_DPMS_LIBS@ | ||
280 | XCB_RANDR_CFLAGS = @XCB_RANDR_CFLAGS@ | ||
281 | XCB_RANDR_LIBS = @XCB_RANDR_LIBS@ | ||
282 | XCB_RENDER_CFLAGS = @XCB_RENDER_CFLAGS@ | ||
283 | XCB_RENDER_LIBS = @XCB_RENDER_LIBS@ | ||
284 | XCB_SCREENSAVER_CFLAGS = @XCB_SCREENSAVER_CFLAGS@ | ||
285 | XCB_SCREENSAVER_LIBS = @XCB_SCREENSAVER_LIBS@ | ||
286 | XCB_SHAPE_CFLAGS = @XCB_SHAPE_CFLAGS@ | ||
287 | XCB_SHAPE_LIBS = @XCB_SHAPE_LIBS@ | ||
288 | XCB_SYNC_CFLAGS = @XCB_SYNC_CFLAGS@ | ||
289 | XCB_SYNC_LIBS = @XCB_SYNC_LIBS@ | ||
290 | XCB_X11_CFLAGS = @XCB_X11_CFLAGS@ | ||
291 | XCB_X11_LIBS = @XCB_X11_LIBS@ | ||
292 | XCB_XFIXES_CFLAGS = @XCB_XFIXES_CFLAGS@ | ||
293 | XCB_XFIXES_LIBS = @XCB_XFIXES_LIBS@ | ||
294 | XCB_XGESTURE_CFLAGS = @XCB_XGESTURE_CFLAGS@ | ||
295 | XCB_XGESTURE_LIBS = @XCB_XGESTURE_LIBS@ | ||
296 | XCB_XINERAMA_CFLAGS = @XCB_XINERAMA_CFLAGS@ | ||
297 | XCB_XINERAMA_LIBS = @XCB_XINERAMA_LIBS@ | ||
298 | XCB_XINPUT_CFLAGS = @XCB_XINPUT_CFLAGS@ | ||
299 | XCB_XINPUT_LIBS = @XCB_XINPUT_LIBS@ | ||
300 | XCB_XPRINT_CFLAGS = @XCB_XPRINT_CFLAGS@ | ||
301 | XCB_XPRINT_LIBS = @XCB_XPRINT_LIBS@ | ||
302 | XCB_XTEST_CFLAGS = @XCB_XTEST_CFLAGS@ | ||
303 | XCB_XTEST_LIBS = @XCB_XTEST_LIBS@ | ||
304 | XCOMPOSITE_CFLAGS = @XCOMPOSITE_CFLAGS@ | ||
305 | XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ | ||
306 | XDAMAGE_CFLAGS = @XDAMAGE_CFLAGS@ | ||
307 | XDAMAGE_LIBS = @XDAMAGE_LIBS@ | ||
308 | XDPMS_CFLAGS = @XDPMS_CFLAGS@ | ||
309 | XDPMS_LIBS = @XDPMS_LIBS@ | ||
310 | XFIXES_CFLAGS = @XFIXES_CFLAGS@ | ||
311 | XFIXES_LIBS = @XFIXES_LIBS@ | ||
312 | XGESTURE_CFLAGS = @XGESTURE_CFLAGS@ | ||
313 | XGESTURE_LIBS = @XGESTURE_LIBS@ | ||
314 | XGETTEXT = @XGETTEXT@ | ||
315 | XGETTEXT_015 = @XGETTEXT_015@ | ||
316 | XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ | ||
317 | XI2_CFLAGS = @XI2_CFLAGS@ | ||
318 | XI2_LIBS = @XI2_LIBS@ | ||
319 | XINERAMA_CFLAGS = @XINERAMA_CFLAGS@ | ||
320 | XINERAMA_LIBS = @XINERAMA_LIBS@ | ||
321 | XKB_CFLAGS = @XKB_CFLAGS@ | ||
322 | XKB_LIBS = @XKB_LIBS@ | ||
323 | XMKMF = @XMKMF@ | ||
324 | XPRINT_CFLAGS = @XPRINT_CFLAGS@ | ||
325 | XPRINT_LIBS = @XPRINT_LIBS@ | ||
326 | XRANDR_CFLAGS = @XRANDR_CFLAGS@ | ||
327 | XRANDR_LIBS = @XRANDR_LIBS@ | ||
328 | XRENDER_CFLAGS = @XRENDER_CFLAGS@ | ||
329 | XRENDER_LIBS = @XRENDER_LIBS@ | ||
330 | XSS_CFLAGS = @XSS_CFLAGS@ | ||
331 | XSS_LIBS = @XSS_LIBS@ | ||
332 | XTEST_CFLAGS = @XTEST_CFLAGS@ | ||
333 | XTEST_LIBS = @XTEST_LIBS@ | ||
334 | X_CFLAGS = @X_CFLAGS@ | ||
335 | X_EXTRA_LIBS = @X_EXTRA_LIBS@ | ||
336 | X_LIBS = @X_LIBS@ | ||
337 | X_PRE_LIBS = @X_PRE_LIBS@ | ||
338 | Xcursor_cflags = @Xcursor_cflags@ | ||
339 | Xcursor_libs = @Xcursor_libs@ | ||
340 | abs_builddir = @abs_builddir@ | ||
341 | abs_srcdir = @abs_srcdir@ | ||
342 | abs_top_builddir = @abs_top_builddir@ | ||
343 | abs_top_srcdir = @abs_top_srcdir@ | ||
344 | ac_ct_CC = @ac_ct_CC@ | ||
345 | ac_ct_CXX = @ac_ct_CXX@ | ||
346 | ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ | ||
347 | ac_ct_OBJC = @ac_ct_OBJC@ | ||
348 | am__include = @am__include@ | ||
349 | am__leading_dot = @am__leading_dot@ | ||
350 | am__quote = @am__quote@ | ||
351 | am__tar = @am__tar@ | ||
352 | am__untar = @am__untar@ | ||
353 | bindir = @bindir@ | ||
354 | build = @build@ | ||
355 | build_alias = @build_alias@ | ||
356 | build_cpu = @build_cpu@ | ||
357 | build_os = @build_os@ | ||
358 | build_vendor = @build_vendor@ | ||
359 | builddir = @builddir@ | ||
360 | cocoa_ldflags = @cocoa_ldflags@ | ||
361 | datadir = @datadir@ | ||
362 | datarootdir = @datarootdir@ | ||
363 | dlopen_libs = @dlopen_libs@ | ||
364 | docdir = @docdir@ | ||
365 | dvidir = @dvidir@ | ||
366 | ecore_cocoa_cflags = @ecore_cocoa_cflags@ | ||
367 | ecore_cocoa_libs = @ecore_cocoa_libs@ | ||
368 | ecore_con_cflags = @ecore_con_cflags@ | ||
369 | ecore_con_libs = @ecore_con_libs@ | ||
370 | ecore_directfb_cflags = @ecore_directfb_cflags@ | ||
371 | ecore_directfb_libs = @ecore_directfb_libs@ | ||
372 | ecore_evas_cflags = @ecore_evas_cflags@ | ||
373 | ecore_evas_libs = @ecore_evas_libs@ | ||
374 | ecore_fb_cflags = @ecore_fb_cflags@ | ||
375 | ecore_fb_libs = @ecore_fb_libs@ | ||
376 | ecore_file_cflags = @ecore_file_cflags@ | ||
377 | ecore_file_libs = @ecore_file_libs@ | ||
378 | ecore_imf_cflags = @ecore_imf_cflags@ | ||
379 | ecore_imf_evas_cflags = @ecore_imf_evas_cflags@ | ||
380 | ecore_imf_evas_libs = @ecore_imf_evas_libs@ | ||
381 | ecore_imf_libs = @ecore_imf_libs@ | ||
382 | ecore_imf_xim_cflags = @ecore_imf_xim_cflags@ | ||
383 | ecore_imf_xim_libs = @ecore_imf_xim_libs@ | ||
384 | ecore_input_cflags = @ecore_input_cflags@ | ||
385 | ecore_input_evas_cflags = @ecore_input_evas_cflags@ | ||
386 | ecore_input_evas_libs = @ecore_input_evas_libs@ | ||
387 | ecore_input_libs = @ecore_input_libs@ | ||
388 | ecore_ipc_cflags = @ecore_ipc_cflags@ | ||
389 | ecore_ipc_libs = @ecore_ipc_libs@ | ||
390 | ecore_psl1ght_cflags = @ecore_psl1ght_cflags@ | ||
391 | ecore_psl1ght_libs = @ecore_psl1ght_libs@ | ||
392 | ecore_sdl_cflags = @ecore_sdl_cflags@ | ||
393 | ecore_sdl_libs = @ecore_sdl_libs@ | ||
394 | ecore_win32_cflags = @ecore_win32_cflags@ | ||
395 | ecore_win32_libs = @ecore_win32_libs@ | ||
396 | ecore_wince_cflags = @ecore_wince_cflags@ | ||
397 | ecore_wince_libs = @ecore_wince_libs@ | ||
398 | ecore_x_cflags = @ecore_x_cflags@ | ||
399 | ecore_x_libs = @ecore_x_libs@ | ||
400 | ecore_x_libs_private = @ecore_x_libs_private@ | ||
401 | efl_doxygen = @efl_doxygen@ | ||
402 | efl_have_doxygen = @efl_have_doxygen@ | ||
403 | exec_prefix = @exec_prefix@ | ||
404 | have_ecore_x_xcb_define = @have_ecore_x_xcb_define@ | ||
405 | host = @host@ | ||
406 | host_alias = @host_alias@ | ||
407 | host_cpu = @host_cpu@ | ||
408 | host_os = @host_os@ | ||
409 | host_vendor = @host_vendor@ | ||
410 | htmldir = @htmldir@ | ||
411 | includedir = @includedir@ | ||
412 | infodir = @infodir@ | ||
413 | install_sh = @install_sh@ | ||
414 | libdir = @libdir@ | ||
415 | libexecdir = @libexecdir@ | ||
416 | localedir = @localedir@ | ||
417 | localstatedir = @localstatedir@ | ||
418 | lt_ECHO = @lt_ECHO@ | ||
419 | lt_enable_auto_import = @lt_enable_auto_import@ | ||
420 | mandir = @mandir@ | ||
421 | mkdir_p = @mkdir_p@ | ||
422 | oldincludedir = @oldincludedir@ | ||
423 | pdfdir = @pdfdir@ | ||
424 | pkgconfig_requires_private = @pkgconfig_requires_private@ | ||
425 | prefix = @prefix@ | ||
426 | program_transform_name = @program_transform_name@ | ||
427 | psdir = @psdir@ | ||
428 | release_info = @release_info@ | ||
429 | requirements_ecore = @requirements_ecore@ | ||
430 | requirements_ecore_cocoa = @requirements_ecore_cocoa@ | ||
431 | requirements_ecore_con = @requirements_ecore_con@ | ||
432 | requirements_ecore_directfb = @requirements_ecore_directfb@ | ||
433 | requirements_ecore_evas = @requirements_ecore_evas@ | ||
434 | requirements_ecore_fb = @requirements_ecore_fb@ | ||
435 | requirements_ecore_file = @requirements_ecore_file@ | ||
436 | requirements_ecore_imf = @requirements_ecore_imf@ | ||
437 | requirements_ecore_imf_evas = @requirements_ecore_imf_evas@ | ||
438 | requirements_ecore_imf_xim = @requirements_ecore_imf_xim@ | ||
439 | requirements_ecore_input = @requirements_ecore_input@ | ||
440 | requirements_ecore_input_evas = @requirements_ecore_input_evas@ | ||
441 | requirements_ecore_ipc = @requirements_ecore_ipc@ | ||
442 | requirements_ecore_psl1ght = @requirements_ecore_psl1ght@ | ||
443 | requirements_ecore_sdl = @requirements_ecore_sdl@ | ||
444 | requirements_ecore_win32 = @requirements_ecore_win32@ | ||
445 | requirements_ecore_wince = @requirements_ecore_wince@ | ||
446 | requirements_ecore_x = @requirements_ecore_x@ | ||
447 | rt_libs = @rt_libs@ | ||
448 | sbindir = @sbindir@ | ||
449 | sharedstatedir = @sharedstatedir@ | ||
450 | srcdir = @srcdir@ | ||
451 | sysconfdir = @sysconfdir@ | ||
452 | target_alias = @target_alias@ | ||
453 | top_build_prefix = @top_build_prefix@ | ||
454 | top_builddir = @top_builddir@ | ||
455 | top_srcdir = @top_srcdir@ | ||
456 | version_info = @version_info@ | ||
457 | x_cflags = @x_cflags@ | ||
458 | x_includes = @x_includes@ | ||
459 | x_libs = @x_libs@ | ||
460 | MAINTAINERCLEANFILES = Makefile.in | ||
461 | AM_CPPFLAGS = \ | ||
462 | -I$(top_srcdir) \ | ||
463 | -I$(top_srcdir)/src/lib/ecore \ | ||
464 | -I$(top_srcdir)/src/lib/ecore_input \ | ||
465 | -I$(top_srcdir)/src/lib/ecore_x \ | ||
466 | -I$(top_srcdir)/src/lib/ecore_imf \ | ||
467 | -I$(top_builddir)/src/lib/ecore \ | ||
468 | -I$(top_builddir)/src/lib/ecore_input \ | ||
469 | -I$(top_builddir)/src/lib/ecore_x \ | ||
470 | -I$(top_builddir)/src/lib/ecore_imf \ | ||
471 | -DPACKAGE_LIB_DIR=\"$(libdir)\" \ | ||
472 | -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ | ||
473 | @x_cflags@ \ | ||
474 | @EINA_CFLAGS@ | ||
475 | |||
476 | pkgdir = $(libdir)/ecore/immodules | ||
477 | pkg_LTLIBRARIES = xim.la | ||
478 | xim_la_SOURCES = \ | ||
479 | ecore_imf_xim.c | ||
480 | |||
481 | xim_la_LIBADD = \ | ||
482 | $(top_builddir)/src/lib/ecore_imf/libecore_imf.la \ | ||
483 | $(top_builddir)/src/lib/ecore_x/libecore_x.la \ | ||
484 | @x_libs@ \ | ||
485 | @EINA_LIBS@ | ||
486 | |||
487 | xim_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version | ||
488 | xim_la_LIBTOOLFLAGS = --tag=disable-static | ||
489 | all: all-am | ||
490 | |||
491 | .SUFFIXES: | ||
492 | .SUFFIXES: .c .lo .o .obj | ||
493 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) | ||
494 | @for dep in $?; do \ | ||
495 | case '$(am__configure_deps)' in \ | ||
496 | *$$dep*) \ | ||
497 | ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ | ||
498 | && { if test -f $@; then exit 0; else break; fi; }; \ | ||
499 | exit 1;; \ | ||
500 | esac; \ | ||
501 | done; \ | ||
502 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/immodules/xim/Makefile'; \ | ||
503 | $(am__cd) $(top_srcdir) && \ | ||
504 | $(AUTOMAKE) --gnu src/modules/immodules/xim/Makefile | ||
505 | .PRECIOUS: Makefile | ||
506 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status | ||
507 | @case '$?' in \ | ||
508 | *config.status*) \ | ||
509 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ | ||
510 | *) \ | ||
511 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ | ||
512 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ | ||
513 | esac; | ||
514 | |||
515 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) | ||
516 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
517 | |||
518 | $(top_srcdir)/configure: $(am__configure_deps) | ||
519 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
520 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) | ||
521 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
522 | $(am__aclocal_m4_deps): | ||
523 | install-pkgLTLIBRARIES: $(pkg_LTLIBRARIES) | ||
524 | @$(NORMAL_INSTALL) | ||
525 | test -z "$(pkgdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdir)" | ||
526 | @list='$(pkg_LTLIBRARIES)'; test -n "$(pkgdir)" || list=; \ | ||
527 | list2=; for p in $$list; do \ | ||
528 | if test -f $$p; then \ | ||
529 | list2="$$list2 $$p"; \ | ||
530 | else :; fi; \ | ||
531 | done; \ | ||
532 | test -z "$$list2" || { \ | ||
533 | echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkgdir)'"; \ | ||
534 | $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkgdir)"; \ | ||
535 | } | ||
536 | |||
537 | uninstall-pkgLTLIBRARIES: | ||
538 | @$(NORMAL_UNINSTALL) | ||
539 | @list='$(pkg_LTLIBRARIES)'; test -n "$(pkgdir)" || list=; \ | ||
540 | for p in $$list; do \ | ||
541 | $(am__strip_dir) \ | ||
542 | echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkgdir)/$$f'"; \ | ||
543 | $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkgdir)/$$f"; \ | ||
544 | done | ||
545 | |||
546 | clean-pkgLTLIBRARIES: | ||
547 | -test -z "$(pkg_LTLIBRARIES)" || rm -f $(pkg_LTLIBRARIES) | ||
548 | @list='$(pkg_LTLIBRARIES)'; for p in $$list; do \ | ||
549 | dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ | ||
550 | test "$$dir" != "$$p" || dir=.; \ | ||
551 | echo "rm -f \"$${dir}/so_locations\""; \ | ||
552 | rm -f "$${dir}/so_locations"; \ | ||
553 | done | ||
554 | xim.la: $(xim_la_OBJECTS) $(xim_la_DEPENDENCIES) | ||
555 | $(AM_V_CCLD)$(xim_la_LINK) -rpath $(pkgdir) $(xim_la_OBJECTS) $(xim_la_LIBADD) $(LIBS) | ||
556 | |||
557 | mostlyclean-compile: | ||
558 | -rm -f *.$(OBJEXT) | ||
559 | |||
560 | distclean-compile: | ||
561 | -rm -f *.tab.c | ||
562 | |||
563 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xim_la-ecore_imf_xim.Plo@am__quote@ | ||
564 | |||
565 | .c.o: | ||
566 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
567 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
568 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
569 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ | ||
570 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
571 | @am__fastdepCC_FALSE@ $(COMPILE) -c $< | ||
572 | |||
573 | .c.obj: | ||
574 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` | ||
575 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
576 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
577 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ | ||
578 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
579 | @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` | ||
580 | |||
581 | .c.lo: | ||
582 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
583 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo | ||
584 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
585 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ | ||
586 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
587 | @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< | ||
588 | |||
589 | xim_la-ecore_imf_xim.lo: ecore_imf_xim.c | ||
590 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(xim_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xim_la-ecore_imf_xim.lo -MD -MP -MF $(DEPDIR)/xim_la-ecore_imf_xim.Tpo -c -o xim_la-ecore_imf_xim.lo `test -f 'ecore_imf_xim.c' || echo '$(srcdir)/'`ecore_imf_xim.c | ||
591 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xim_la-ecore_imf_xim.Tpo $(DEPDIR)/xim_la-ecore_imf_xim.Plo | ||
592 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
593 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ecore_imf_xim.c' object='xim_la-ecore_imf_xim.lo' libtool=yes @AMDEPBACKSLASH@ | ||
594 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
595 | @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(xim_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xim_la-ecore_imf_xim.lo `test -f 'ecore_imf_xim.c' || echo '$(srcdir)/'`ecore_imf_xim.c | ||
596 | |||
597 | mostlyclean-libtool: | ||
598 | -rm -f *.lo | ||
599 | |||
600 | clean-libtool: | ||
601 | -rm -rf .libs _libs | ||
602 | |||
603 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) | ||
604 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
605 | unique=`for i in $$list; do \ | ||
606 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
607 | done | \ | ||
608 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
609 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
610 | mkid -fID $$unique | ||
611 | tags: TAGS | ||
612 | |||
613 | TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
614 | $(TAGS_FILES) $(LISP) | ||
615 | set x; \ | ||
616 | here=`pwd`; \ | ||
617 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
618 | unique=`for i in $$list; do \ | ||
619 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
620 | done | \ | ||
621 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
622 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
623 | shift; \ | ||
624 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ | ||
625 | test -n "$$unique" || unique=$$empty_fix; \ | ||
626 | if test $$# -gt 0; then \ | ||
627 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
628 | "$$@" $$unique; \ | ||
629 | else \ | ||
630 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
631 | $$unique; \ | ||
632 | fi; \ | ||
633 | fi | ||
634 | ctags: CTAGS | ||
635 | CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
636 | $(TAGS_FILES) $(LISP) | ||
637 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
638 | unique=`for i in $$list; do \ | ||
639 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
640 | done | \ | ||
641 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
642 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
643 | test -z "$(CTAGS_ARGS)$$unique" \ | ||
644 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ | ||
645 | $$unique | ||
646 | |||
647 | GTAGS: | ||
648 | here=`$(am__cd) $(top_builddir) && pwd` \ | ||
649 | && $(am__cd) $(top_srcdir) \ | ||
650 | && gtags -i $(GTAGS_ARGS) "$$here" | ||
651 | |||
652 | distclean-tags: | ||
653 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags | ||
654 | |||
655 | distdir: $(DISTFILES) | ||
656 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
657 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
658 | list='$(DISTFILES)'; \ | ||
659 | dist_files=`for file in $$list; do echo $$file; done | \ | ||
660 | sed -e "s|^$$srcdirstrip/||;t" \ | ||
661 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ | ||
662 | case $$dist_files in \ | ||
663 | */*) $(MKDIR_P) `echo "$$dist_files" | \ | ||
664 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ | ||
665 | sort -u` ;; \ | ||
666 | esac; \ | ||
667 | for file in $$dist_files; do \ | ||
668 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ | ||
669 | if test -d $$d/$$file; then \ | ||
670 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ | ||
671 | if test -d "$(distdir)/$$file"; then \ | ||
672 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ | ||
673 | fi; \ | ||
674 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ | ||
675 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ | ||
676 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ | ||
677 | fi; \ | ||
678 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ | ||
679 | else \ | ||
680 | test -f "$(distdir)/$$file" \ | ||
681 | || cp -p $$d/$$file "$(distdir)/$$file" \ | ||
682 | || exit 1; \ | ||
683 | fi; \ | ||
684 | done | ||
685 | check-am: all-am | ||
686 | check: check-am | ||
687 | all-am: Makefile $(LTLIBRARIES) | ||
688 | installdirs: | ||
689 | for dir in "$(DESTDIR)$(pkgdir)"; do \ | ||
690 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ | ||
691 | done | ||
692 | install: install-am | ||
693 | install-exec: install-exec-am | ||
694 | install-data: install-data-am | ||
695 | uninstall: uninstall-am | ||
696 | |||
697 | install-am: all-am | ||
698 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am | ||
699 | |||
700 | installcheck: installcheck-am | ||
701 | install-strip: | ||
702 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ | ||
703 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ | ||
704 | `test -z '$(STRIP)' || \ | ||
705 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install | ||
706 | mostlyclean-generic: | ||
707 | |||
708 | clean-generic: | ||
709 | |||
710 | distclean-generic: | ||
711 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) | ||
712 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) | ||
713 | |||
714 | maintainer-clean-generic: | ||
715 | @echo "This command is intended for maintainers to use" | ||
716 | @echo "it deletes files that may require special tools to rebuild." | ||
717 | -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) | ||
718 | clean: clean-am | ||
719 | |||
720 | clean-am: clean-generic clean-libtool clean-pkgLTLIBRARIES \ | ||
721 | mostlyclean-am | ||
722 | |||
723 | distclean: distclean-am | ||
724 | -rm -rf ./$(DEPDIR) | ||
725 | -rm -f Makefile | ||
726 | distclean-am: clean-am distclean-compile distclean-generic \ | ||
727 | distclean-tags | ||
728 | |||
729 | dvi: dvi-am | ||
730 | |||
731 | dvi-am: | ||
732 | |||
733 | html: html-am | ||
734 | |||
735 | html-am: | ||
736 | |||
737 | info: info-am | ||
738 | |||
739 | info-am: | ||
740 | |||
741 | install-data-am: install-pkgLTLIBRARIES | ||
742 | |||
743 | install-dvi: install-dvi-am | ||
744 | |||
745 | install-dvi-am: | ||
746 | |||
747 | install-exec-am: | ||
748 | |||
749 | install-html: install-html-am | ||
750 | |||
751 | install-html-am: | ||
752 | |||
753 | install-info: install-info-am | ||
754 | |||
755 | install-info-am: | ||
756 | |||
757 | install-man: | ||
758 | |||
759 | install-pdf: install-pdf-am | ||
760 | |||
761 | install-pdf-am: | ||
762 | |||
763 | install-ps: install-ps-am | ||
764 | |||
765 | install-ps-am: | ||
766 | |||
767 | installcheck-am: | ||
768 | |||
769 | maintainer-clean: maintainer-clean-am | ||
770 | -rm -rf ./$(DEPDIR) | ||
771 | -rm -f Makefile | ||
772 | maintainer-clean-am: distclean-am maintainer-clean-generic | ||
773 | |||
774 | mostlyclean: mostlyclean-am | ||
775 | |||
776 | mostlyclean-am: mostlyclean-compile mostlyclean-generic \ | ||
777 | mostlyclean-libtool | ||
778 | |||
779 | pdf: pdf-am | ||
780 | |||
781 | pdf-am: | ||
782 | |||
783 | ps: ps-am | ||
784 | |||
785 | ps-am: | ||
786 | |||
787 | uninstall-am: uninstall-pkgLTLIBRARIES | ||
788 | |||
789 | .MAKE: install-am install-strip | ||
790 | |||
791 | .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ | ||
792 | clean-libtool clean-pkgLTLIBRARIES ctags distclean \ | ||
793 | distclean-compile distclean-generic distclean-libtool \ | ||
794 | distclean-tags distdir dvi dvi-am html html-am info info-am \ | ||
795 | install install-am install-data install-data-am install-dvi \ | ||
796 | install-dvi-am install-exec install-exec-am install-html \ | ||
797 | install-html-am install-info install-info-am install-man \ | ||
798 | install-pdf install-pdf-am install-pkgLTLIBRARIES install-ps \ | ||
799 | install-ps-am install-strip installcheck installcheck-am \ | ||
800 | installdirs maintainer-clean maintainer-clean-generic \ | ||
801 | mostlyclean mostlyclean-compile mostlyclean-generic \ | ||
802 | mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ | ||
803 | uninstall-am uninstall-pkgLTLIBRARIES | ||
804 | |||
805 | |||
806 | # Tell versions [3.59,3.63) of GNU make to not export all variables. | ||
807 | # Otherwise a system limit (for SysV at least) may be exceeded. | ||
808 | .NOEXPORT: | ||
diff --git a/libraries/ecore/src/modules/immodules/xim/ecore_imf_xim.c b/libraries/ecore/src/modules/immodules/xim/ecore_imf_xim.c new file mode 100644 index 0000000..7c40606 --- /dev/null +++ b/libraries/ecore/src/modules/immodules/xim/ecore_imf_xim.c | |||
@@ -0,0 +1,1273 @@ | |||
1 | #include <Eina.h> | ||
2 | #include <Ecore.h> | ||
3 | #include <Ecore_Input.h> | ||
4 | #include <Ecore_IMF.h> | ||
5 | #include <Ecore_X.h> | ||
6 | #include <X11/Xlib.h> | ||
7 | #include <X11/Xlocale.h> | ||
8 | #include <X11/Xutil.h> | ||
9 | #include <X11/keysym.h> | ||
10 | #include <stdio.h> | ||
11 | #include <stdlib.h> | ||
12 | #include <string.h> | ||
13 | #include <langinfo.h> | ||
14 | #include <assert.h> | ||
15 | #ifdef HAVE_CONFIG_H | ||
16 | # include <config.h> | ||
17 | #endif | ||
18 | |||
19 | #define CLAMP(x, low, high) (x > high) ? high : (x < low) ? low : x | ||
20 | #define _(x) x | ||
21 | |||
22 | #ifdef ENABLE_XIM | ||
23 | static Eina_List *open_ims = NULL; | ||
24 | #endif | ||
25 | |||
26 | typedef struct _XIM_Im_Info XIM_Im_Info; | ||
27 | struct _XIM_Im_Info | ||
28 | { | ||
29 | Ecore_X_Window win; | ||
30 | char *locale; | ||
31 | XIM im; | ||
32 | Eina_List *ics; | ||
33 | Eina_Bool reconnecting; | ||
34 | XIMStyles *xim_styles; | ||
35 | Eina_Bool supports_string_conversion : 1; | ||
36 | Eina_Bool supports_cursor : 1; | ||
37 | }; | ||
38 | |||
39 | typedef struct _Ecore_IMF_Context_Data Ecore_IMF_Context_Data; | ||
40 | struct _Ecore_IMF_Context_Data | ||
41 | { | ||
42 | Ecore_X_Window win; | ||
43 | long mask; | ||
44 | XIC ic; /* Input context for composed characters */ | ||
45 | char *locale; | ||
46 | XIM_Im_Info *im_info; | ||
47 | int preedit_length; | ||
48 | int preedit_cursor; | ||
49 | Eina_Unicode *preedit_chars; | ||
50 | Eina_Bool use_preedit; | ||
51 | Eina_Bool finalizing; | ||
52 | Eina_Bool has_focus; | ||
53 | Eina_Bool in_toplevel; | ||
54 | |||
55 | XIMCallback preedit_start_cb; | ||
56 | XIMCallback preedit_done_cb; | ||
57 | XIMCallback preedit_draw_cb; | ||
58 | XIMCallback preedit_caret_cb; | ||
59 | }; | ||
60 | |||
61 | /* prototype */ | ||
62 | Ecore_IMF_Context_Data *imf_context_data_new(); | ||
63 | void imf_context_data_destroy(Ecore_IMF_Context_Data *imf_context_data); | ||
64 | |||
65 | #ifdef ENABLE_XIM | ||
66 | static void reinitialize_ic(Ecore_IMF_Context *ctx); | ||
67 | static void reinitialize_all_ics(XIM_Im_Info *info); | ||
68 | static void set_ic_client_window(Ecore_IMF_Context *ctx, | ||
69 | Ecore_X_Window window); | ||
70 | static int preedit_start_callback(XIC xic, | ||
71 | XPointer client_data, | ||
72 | XPointer call_data); | ||
73 | static void preedit_done_callback(XIC xic, | ||
74 | XPointer client_data, | ||
75 | XPointer call_data); | ||
76 | static int xim_text_to_utf8(Ecore_IMF_Context *ctx, | ||
77 | XIMText *xim_text, | ||
78 | char **text); | ||
79 | static void preedit_draw_callback(XIC xic, | ||
80 | XPointer client_data, | ||
81 | XIMPreeditDrawCallbackStruct *call_data); | ||
82 | static void preedit_caret_callback(XIC xic, | ||
83 | XPointer client_data, | ||
84 | XIMPreeditCaretCallbackStruct *call_data); | ||
85 | static XVaNestedList preedit_callback_set(Ecore_IMF_Context *ctx); | ||
86 | static XIC get_ic(Ecore_IMF_Context *ctx); | ||
87 | static XIM_Im_Info *get_im(Ecore_X_Window window, | ||
88 | char *locale); | ||
89 | static void xim_info_try_im(XIM_Im_Info *info); | ||
90 | static void xim_info_display_closed(Ecore_X_Display *display, | ||
91 | int is_error, | ||
92 | XIM_Im_Info *info); | ||
93 | static void xim_instantiate_callback(Display *display, | ||
94 | XPointer client_data, | ||
95 | XPointer call_data); | ||
96 | static void setup_im(XIM_Im_Info *info); | ||
97 | static void xim_destroy_callback(XIM xim, | ||
98 | XPointer client_data, | ||
99 | XPointer call_data); | ||
100 | #endif | ||
101 | |||
102 | static void | ||
103 | _ecore_imf_context_xim_add(Ecore_IMF_Context *ctx) | ||
104 | { | ||
105 | EINA_LOG_DBG("in"); | ||
106 | #ifdef ENABLE_XIM | ||
107 | Ecore_IMF_Context_Data *imf_context_data = NULL; | ||
108 | |||
109 | imf_context_data = imf_context_data_new(); | ||
110 | if(!imf_context_data) return; | ||
111 | |||
112 | imf_context_data->use_preedit = EINA_TRUE; | ||
113 | imf_context_data->finalizing = EINA_FALSE; | ||
114 | imf_context_data->has_focus = EINA_FALSE; | ||
115 | imf_context_data->in_toplevel = EINA_FALSE; | ||
116 | |||
117 | ecore_imf_context_data_set(ctx, imf_context_data); | ||
118 | #endif | ||
119 | } | ||
120 | |||
121 | static void | ||
122 | _ecore_imf_context_xim_del(Ecore_IMF_Context *ctx) | ||
123 | { | ||
124 | EINA_LOG_DBG("in"); | ||
125 | #ifdef ENABLE_XIM | ||
126 | Ecore_IMF_Context_Data *imf_context_data; | ||
127 | imf_context_data = ecore_imf_context_data_get(ctx); | ||
128 | |||
129 | imf_context_data->finalizing = EINA_TRUE; | ||
130 | if(imf_context_data->im_info && !imf_context_data->im_info->ics->next) | ||
131 | { | ||
132 | if(imf_context_data->im_info->reconnecting == EINA_TRUE) | ||
133 | { | ||
134 | Ecore_X_Display *dsp; | ||
135 | dsp = ecore_x_display_get(); | ||
136 | XUnregisterIMInstantiateCallback (dsp, | ||
137 | NULL, NULL, NULL, | ||
138 | xim_instantiate_callback, | ||
139 | (XPointer)imf_context_data->im_info); | ||
140 | } | ||
141 | else if(imf_context_data->im_info->im) | ||
142 | { | ||
143 | XIMCallback im_destroy_callback; | ||
144 | im_destroy_callback.client_data = NULL; | ||
145 | im_destroy_callback.callback = NULL; | ||
146 | XSetIMValues (imf_context_data->im_info->im, | ||
147 | XNDestroyCallback, &im_destroy_callback, | ||
148 | NULL); | ||
149 | } | ||
150 | } | ||
151 | |||
152 | set_ic_client_window(ctx, 0); | ||
153 | |||
154 | imf_context_data_destroy(imf_context_data); | ||
155 | #endif | ||
156 | } | ||
157 | |||
158 | static void | ||
159 | _ecore_imf_context_xim_client_window_set(Ecore_IMF_Context *ctx, | ||
160 | void *window) | ||
161 | { | ||
162 | EINA_LOG_DBG("in"); | ||
163 | #ifdef ENABLE_XIM | ||
164 | set_ic_client_window(ctx, (Ecore_X_Window)((Ecore_Window)window)); | ||
165 | #endif | ||
166 | } | ||
167 | |||
168 | static void | ||
169 | _ecore_imf_context_xim_preedit_string_get(Ecore_IMF_Context *ctx, | ||
170 | char **str, | ||
171 | int *cursor_pos) | ||
172 | { | ||
173 | EINA_LOG_DBG("in"); | ||
174 | #ifdef ENABLE_XIM | ||
175 | Ecore_IMF_Context_Data *imf_context_data; | ||
176 | char *utf8; | ||
177 | int len; | ||
178 | imf_context_data = ecore_imf_context_data_get(ctx); | ||
179 | if (imf_context_data->preedit_chars) | ||
180 | { | ||
181 | utf8 = eina_unicode_unicode_to_utf8(imf_context_data->preedit_chars, | ||
182 | &len); | ||
183 | if(str) | ||
184 | *str = utf8; | ||
185 | else | ||
186 | free(utf8); | ||
187 | } | ||
188 | else | ||
189 | { | ||
190 | if(str) | ||
191 | *str = NULL; | ||
192 | if(cursor_pos) | ||
193 | *cursor_pos = 0; | ||
194 | } | ||
195 | |||
196 | if(cursor_pos) | ||
197 | *cursor_pos = imf_context_data->preedit_cursor; | ||
198 | #else | ||
199 | if(str) | ||
200 | *str = NULL; | ||
201 | if(cursor_pos) | ||
202 | *cursor_pos = 0; | ||
203 | #endif | ||
204 | } | ||
205 | |||
206 | static void | ||
207 | _ecore_imf_context_xim_focus_in(Ecore_IMF_Context *ctx) | ||
208 | { | ||
209 | EINA_LOG_DBG("in"); | ||
210 | #ifdef ENABLE_XIM | ||
211 | XIC ic; | ||
212 | Ecore_IMF_Context_Data *imf_context_data; | ||
213 | imf_context_data = ecore_imf_context_data_get(ctx); | ||
214 | ic = imf_context_data->ic; | ||
215 | imf_context_data->has_focus = EINA_TRUE; | ||
216 | if(ic) | ||
217 | { | ||
218 | char *str; | ||
219 | |||
220 | #ifdef X_HAVE_UTF8_STRING | ||
221 | if ((str = Xutf8ResetIC(ic))) | ||
222 | #else | ||
223 | if ((str = XmbResetIC(ic))) | ||
224 | #endif | ||
225 | XFree(str); | ||
226 | |||
227 | XSetICFocus(ic); | ||
228 | } | ||
229 | #endif | ||
230 | } | ||
231 | |||
232 | static void | ||
233 | _ecore_imf_context_xim_focus_out(Ecore_IMF_Context *ctx) | ||
234 | { | ||
235 | EINA_LOG_DBG("%s in", __FUNCTION__); | ||
236 | #ifdef ENABLE_XIM | ||
237 | XIC ic; | ||
238 | Ecore_IMF_Context_Data *imf_context_data; | ||
239 | imf_context_data = ecore_imf_context_data_get(ctx); | ||
240 | if(imf_context_data->has_focus == EINA_TRUE) | ||
241 | { | ||
242 | imf_context_data->has_focus = EINA_FALSE; | ||
243 | ic = imf_context_data->ic; | ||
244 | if(ic) | ||
245 | XUnsetICFocus(ic); | ||
246 | } | ||
247 | #endif | ||
248 | } | ||
249 | |||
250 | static void | ||
251 | _ecore_imf_context_xim_reset(Ecore_IMF_Context *ctx) | ||
252 | { | ||
253 | EINA_LOG_DBG("%s in", __FUNCTION__); | ||
254 | #ifdef ENABLE_XIM | ||
255 | XIC ic; | ||
256 | Ecore_IMF_Context_Data *imf_context_data; | ||
257 | char *result; | ||
258 | |||
259 | /* restore conversion state after resetting ic later */ | ||
260 | XIMPreeditState preedit_state = XIMPreeditUnKnown; | ||
261 | XVaNestedList preedit_attr; | ||
262 | Eina_Bool have_preedit_state = EINA_FALSE; | ||
263 | |||
264 | imf_context_data = ecore_imf_context_data_get(ctx); | ||
265 | ic = imf_context_data->ic; | ||
266 | if(!ic) | ||
267 | return; | ||
268 | |||
269 | if(imf_context_data->preedit_length == 0) | ||
270 | return; | ||
271 | |||
272 | preedit_attr = XVaCreateNestedList(0, | ||
273 | XNPreeditState, &preedit_state, | ||
274 | NULL); | ||
275 | if(!XGetICValues(ic, | ||
276 | XNPreeditAttributes, preedit_attr, | ||
277 | NULL)) | ||
278 | have_preedit_state = EINA_TRUE; | ||
279 | |||
280 | XFree(preedit_attr); | ||
281 | |||
282 | result = XmbResetIC(ic); | ||
283 | |||
284 | preedit_attr = XVaCreateNestedList(0, | ||
285 | XNPreeditState, preedit_state, | ||
286 | NULL); | ||
287 | if(have_preedit_state) | ||
288 | XSetICValues(ic, | ||
289 | XNPreeditAttributes, preedit_attr, | ||
290 | NULL); | ||
291 | |||
292 | XFree(preedit_attr); | ||
293 | |||
294 | if(imf_context_data->preedit_length) | ||
295 | { | ||
296 | imf_context_data->preedit_length = 0; | ||
297 | free(imf_context_data->preedit_chars); | ||
298 | imf_context_data->preedit_chars = NULL; | ||
299 | ecore_imf_context_preedit_changed_event_add(ctx); | ||
300 | } | ||
301 | |||
302 | if(result) | ||
303 | { | ||
304 | char *result_utf8 = strdup(result); | ||
305 | if(result_utf8) | ||
306 | { | ||
307 | ecore_imf_context_commit_event_add(ctx, result_utf8); | ||
308 | free(result_utf8); | ||
309 | } | ||
310 | } | ||
311 | |||
312 | XFree (result); | ||
313 | #endif | ||
314 | } | ||
315 | |||
316 | static void | ||
317 | _ecore_imf_context_xim_use_preedit_set(Ecore_IMF_Context *ctx, | ||
318 | Eina_Bool use_preedit) | ||
319 | { | ||
320 | EINA_LOG_DBG("in"); | ||
321 | #ifdef ENABLE_XIM | ||
322 | Ecore_IMF_Context_Data *imf_context_data; | ||
323 | imf_context_data = ecore_imf_context_data_get(ctx); | ||
324 | |||
325 | use_preedit = use_preedit != EINA_FALSE; | ||
326 | |||
327 | if(imf_context_data->use_preedit != use_preedit) | ||
328 | { | ||
329 | imf_context_data->use_preedit = use_preedit; | ||
330 | reinitialize_ic(ctx); | ||
331 | } | ||
332 | #endif | ||
333 | } | ||
334 | |||
335 | static void | ||
336 | _ecore_imf_context_xim_cursor_location_set (Ecore_IMF_Context *ctx, | ||
337 | int x, int y, int w, int h) | ||
338 | { | ||
339 | EINA_LOG_DBG("%s in", __FUNCTION__); | ||
340 | |||
341 | #ifdef ENABLE_XIM | ||
342 | Ecore_IMF_Context_Data *imf_context_data; | ||
343 | XIC ic; | ||
344 | XVaNestedList preedit_attr; | ||
345 | XPoint spot; | ||
346 | |||
347 | imf_context_data = ecore_imf_context_data_get(ctx); | ||
348 | ic = imf_context_data->ic; | ||
349 | if (!ic) | ||
350 | return; | ||
351 | |||
352 | spot.x = x; | ||
353 | spot.y = y + h; | ||
354 | |||
355 | preedit_attr = XVaCreateNestedList (0, | ||
356 | XNSpotLocation, &spot, | ||
357 | NULL); | ||
358 | XSetICValues (ic, | ||
359 | XNPreeditAttributes, preedit_attr, | ||
360 | NULL); | ||
361 | |||
362 | XFree(preedit_attr); | ||
363 | #endif | ||
364 | (void)(w); // yes w is unused, but only a bi-product of the algorithm | ||
365 | } | ||
366 | |||
367 | #ifdef ENABLE_XIM | ||
368 | static unsigned int | ||
369 | _ecore_x_event_reverse_modifiers(unsigned int state) | ||
370 | { | ||
371 | unsigned int modifiers = 0; | ||
372 | |||
373 | /**< "Control" is pressed */ | ||
374 | if(state & ECORE_IMF_KEYBOARD_MODIFIER_CTRL) | ||
375 | modifiers |= ControlMask; | ||
376 | |||
377 | /**< "Alt" is pressed */ | ||
378 | if(state & ECORE_IMF_KEYBOARD_MODIFIER_ALT) | ||
379 | modifiers |= Mod1Mask; | ||
380 | |||
381 | /**< "Shift" is pressed */ | ||
382 | if(state & ECORE_IMF_KEYBOARD_MODIFIER_SHIFT) | ||
383 | modifiers |= ShiftMask; | ||
384 | |||
385 | /**< "Win" (between "Ctrl" and "A */ | ||
386 | if(state & ECORE_IMF_KEYBOARD_MODIFIER_WIN) | ||
387 | modifiers |= Mod5Mask; | ||
388 | |||
389 | return modifiers; | ||
390 | } | ||
391 | |||
392 | static unsigned int | ||
393 | _ecore_x_event_reverse_locks(unsigned int state) | ||
394 | { | ||
395 | unsigned int locks = 0; | ||
396 | |||
397 | /**< "Num" lock is active */ | ||
398 | if(state & ECORE_IMF_KEYBOARD_LOCK_NUM) | ||
399 | locks |= Mod3Mask; | ||
400 | |||
401 | if(state & ECORE_IMF_KEYBOARD_LOCK_CAPS) | ||
402 | locks |= LockMask; | ||
403 | |||
404 | #if 0 /* FIXME: add mask. */ | ||
405 | if(state & ECORE_IMF_KEYBOARD_LOCK_SCROLL) | ||
406 | ; | ||
407 | #endif | ||
408 | |||
409 | return locks; | ||
410 | } | ||
411 | |||
412 | static KeyCode | ||
413 | _keycode_get(Ecore_X_Display *dsp, | ||
414 | const char *keyname) | ||
415 | { | ||
416 | KeyCode keycode; | ||
417 | |||
418 | // EINA_LOG_DBG("keyname:%s keysym:%lu", keyname, XStringToKeysym(keyname)); | ||
419 | if(strcmp(keyname, "Keycode-0") == 0) | ||
420 | { | ||
421 | keycode = 0; | ||
422 | } | ||
423 | else { | ||
424 | keycode = XKeysymToKeycode(dsp, XStringToKeysym(keyname)); | ||
425 | } | ||
426 | |||
427 | return keycode; | ||
428 | } | ||
429 | |||
430 | #endif | ||
431 | |||
432 | static Eina_Bool | ||
433 | _ecore_imf_context_xim_filter_event(Ecore_IMF_Context *ctx, | ||
434 | Ecore_IMF_Event_Type type, | ||
435 | Ecore_IMF_Event *event) | ||
436 | { | ||
437 | EINA_LOG_DBG("%s in", __FUNCTION__); | ||
438 | #ifdef ENABLE_XIM | ||
439 | Ecore_IMF_Context_Data *imf_context_data; | ||
440 | XIC ic; | ||
441 | |||
442 | Ecore_X_Display *dsp; | ||
443 | Ecore_X_Window win; | ||
444 | |||
445 | int val; | ||
446 | char compose_buffer[256]; | ||
447 | KeySym sym; | ||
448 | char *compose = NULL; | ||
449 | char *tmp = NULL; | ||
450 | Eina_Bool result = EINA_FALSE; | ||
451 | |||
452 | imf_context_data = ecore_imf_context_data_get(ctx); | ||
453 | ic = imf_context_data->ic; | ||
454 | if(!ic) | ||
455 | { | ||
456 | ic = get_ic(ctx); | ||
457 | } | ||
458 | |||
459 | if(type == ECORE_IMF_EVENT_KEY_DOWN) | ||
460 | { | ||
461 | XKeyPressedEvent xev; | ||
462 | Ecore_IMF_Event_Key_Down *ev = (Ecore_IMF_Event_Key_Down *)event; | ||
463 | EINA_LOG_DBG("ECORE_IMF_EVENT_KEY_DOWN"); | ||
464 | |||
465 | dsp = ecore_x_display_get(); | ||
466 | win = imf_context_data->win; | ||
467 | |||
468 | xev.type = KeyPress; | ||
469 | xev.serial = 0; /* hope it doesn't matter */ | ||
470 | xev.send_event = 0; | ||
471 | xev.display = dsp; | ||
472 | xev.window = win; | ||
473 | xev.root = ecore_x_window_root_get(win); | ||
474 | xev.subwindow = win; | ||
475 | xev.time = ev->timestamp; | ||
476 | xev.x = xev.x_root = 0; | ||
477 | xev.y = xev.y_root = 0; | ||
478 | xev.state = 0; | ||
479 | xev.state |= _ecore_x_event_reverse_modifiers(ev->modifiers); | ||
480 | xev.state |= _ecore_x_event_reverse_locks(ev->locks); | ||
481 | xev.keycode = _keycode_get(dsp, ev->keyname); | ||
482 | xev.same_screen = True; | ||
483 | |||
484 | if(ic) | ||
485 | { | ||
486 | Status mbstatus; | ||
487 | #ifdef X_HAVE_UTF8_STRING | ||
488 | val = Xutf8LookupString(ic, | ||
489 | &xev, | ||
490 | compose_buffer, | ||
491 | sizeof(compose_buffer) - 1, | ||
492 | &sym, | ||
493 | &mbstatus); | ||
494 | #else /* ifdef X_HAVE_UTF8_STRING */ | ||
495 | val = XmbLookupString(ic, | ||
496 | &xev, | ||
497 | compose_buffer, | ||
498 | sizeof(compose_buffer) - 1, | ||
499 | &sym, | ||
500 | &mbstatus); | ||
501 | #endif /* ifdef X_HAVE_UTF8_STRING */ | ||
502 | if (mbstatus == XBufferOverflow) | ||
503 | { | ||
504 | tmp = malloc(sizeof (char) * (val + 1)); | ||
505 | if (!tmp) | ||
506 | { | ||
507 | return EINA_FALSE; | ||
508 | } | ||
509 | |||
510 | compose = tmp; | ||
511 | |||
512 | #ifdef X_HAVE_UTF8_STRING | ||
513 | val = Xutf8LookupString(ic, | ||
514 | (XKeyEvent *)&xev, | ||
515 | tmp, | ||
516 | val, | ||
517 | &sym, | ||
518 | &mbstatus); | ||
519 | #else /* ifdef X_HAVE_UTF8_STRING */ | ||
520 | val = XmbLookupString(ic, | ||
521 | (XKeyEvent *)&xev, | ||
522 | tmp, | ||
523 | val, | ||
524 | &sym, | ||
525 | &mbstatus); | ||
526 | #endif /* ifdef X_HAVE_UTF8_STRING */ | ||
527 | if (val > 0) | ||
528 | { | ||
529 | tmp[val] = '\0'; | ||
530 | #ifndef X_HAVE_UTF8_STRING | ||
531 | compose = eina_str_convert(nl_langinfo(CODESET), | ||
532 | "UTF-8", tmp); | ||
533 | free(tmp); | ||
534 | tmp = compose; | ||
535 | #endif /* ifndef X_HAVE_UTF8_STRING */ | ||
536 | } | ||
537 | else | ||
538 | compose = NULL; | ||
539 | } | ||
540 | else if (val > 0) | ||
541 | { | ||
542 | compose_buffer[val] = '\0'; | ||
543 | #ifdef X_HAVE_UTF8_STRING | ||
544 | compose = strdup(compose_buffer); | ||
545 | #else /* ifdef X_HAVE_UTF8_STRING */ | ||
546 | compose = eina_str_convert(nl_langinfo(CODESET), "UTF-8", | ||
547 | compose_buffer); | ||
548 | #endif /* ifdef X_HAVE_UTF8_STRING */ | ||
549 | } | ||
550 | } | ||
551 | else { | ||
552 | XComposeStatus status; | ||
553 | val = XLookupString(&xev, | ||
554 | compose_buffer, | ||
555 | sizeof(compose_buffer), | ||
556 | &sym, | ||
557 | &status); | ||
558 | if (val > 0) | ||
559 | { | ||
560 | compose_buffer[val] = '\0'; | ||
561 | compose = eina_str_convert(nl_langinfo(CODESET), | ||
562 | "UTF-8", compose_buffer); | ||
563 | } | ||
564 | } | ||
565 | |||
566 | if(compose) | ||
567 | { | ||
568 | Eina_Unicode *unicode; | ||
569 | int len; | ||
570 | unicode = eina_unicode_utf8_to_unicode(compose, &len); | ||
571 | if(!unicode) abort(); | ||
572 | if(unicode[0] >= 0x20 && unicode[0] != 0x7f) | ||
573 | { | ||
574 | ecore_imf_context_commit_event_add(ctx, compose); | ||
575 | result = EINA_TRUE; | ||
576 | } | ||
577 | free(compose); | ||
578 | free(unicode); | ||
579 | } | ||
580 | } | ||
581 | |||
582 | return result; | ||
583 | #else | ||
584 | return EINA_FALSE; | ||
585 | #endif | ||
586 | } | ||
587 | |||
588 | static const Ecore_IMF_Context_Info xim_info = { | ||
589 | .id = "xim", | ||
590 | .description = _("X input method"), | ||
591 | .default_locales = "ko:ja:th:zh", | ||
592 | .canvas_type = "evas", | ||
593 | .canvas_required = 1, | ||
594 | }; | ||
595 | |||
596 | static Ecore_IMF_Context_Class xim_class = { | ||
597 | .add = _ecore_imf_context_xim_add, | ||
598 | .del = _ecore_imf_context_xim_del, | ||
599 | .client_window_set = _ecore_imf_context_xim_client_window_set, | ||
600 | .client_canvas_set = NULL, | ||
601 | .show = NULL, | ||
602 | .hide = NULL, | ||
603 | .preedit_string_get = _ecore_imf_context_xim_preedit_string_get, | ||
604 | .focus_in = _ecore_imf_context_xim_focus_in, | ||
605 | .focus_out = _ecore_imf_context_xim_focus_out, | ||
606 | .reset = _ecore_imf_context_xim_reset, | ||
607 | .cursor_position_set = NULL, | ||
608 | .use_preedit_set = _ecore_imf_context_xim_use_preedit_set, | ||
609 | .input_mode_set = NULL, | ||
610 | .filter_event = _ecore_imf_context_xim_filter_event, | ||
611 | .preedit_string_with_attributes_get = NULL, | ||
612 | .prediction_allow_set = NULL, | ||
613 | .autocapital_type_set = NULL, | ||
614 | .control_panel_show = NULL, | ||
615 | .control_panel_hide = NULL, | ||
616 | .input_panel_layout_set = NULL, | ||
617 | .input_panel_layout_get = NULL, | ||
618 | .input_panel_language_set = NULL, | ||
619 | .input_panel_language_get = NULL, | ||
620 | .cursor_location_set = _ecore_imf_context_xim_cursor_location_set, | ||
621 | }; | ||
622 | |||
623 | static Ecore_IMF_Context * | ||
624 | xim_imf_module_create(void) | ||
625 | { | ||
626 | EINA_LOG_DBG("%s in", __FUNCTION__); | ||
627 | Ecore_IMF_Context *ctx = NULL; | ||
628 | |||
629 | ctx = ecore_imf_context_new(&xim_class); | ||
630 | if(!ctx) | ||
631 | goto error; | ||
632 | |||
633 | return ctx; | ||
634 | |||
635 | error: | ||
636 | free(ctx); | ||
637 | return NULL; | ||
638 | } | ||
639 | |||
640 | static Ecore_IMF_Context * | ||
641 | xim_imf_module_exit(void) | ||
642 | { | ||
643 | return NULL; | ||
644 | } | ||
645 | |||
646 | Eina_Bool | ||
647 | ecore_imf_xim_init(void) | ||
648 | { | ||
649 | EINA_LOG_DBG("%s in", __FUNCTION__); | ||
650 | eina_init(); | ||
651 | ecore_x_init(NULL); | ||
652 | ecore_imf_module_register(&xim_info, | ||
653 | xim_imf_module_create, | ||
654 | xim_imf_module_exit); | ||
655 | |||
656 | return EINA_TRUE; | ||
657 | } | ||
658 | |||
659 | void | ||
660 | ecore_imf_xim_shutdown(void) | ||
661 | { | ||
662 | #ifdef ENABLE_XIM | ||
663 | while (open_ims) { | ||
664 | XIM_Im_Info *info = open_ims->data; | ||
665 | Ecore_X_Display *display = ecore_x_display_get(); | ||
666 | |||
667 | xim_info_display_closed(display, EINA_FALSE, info); | ||
668 | } | ||
669 | #endif | ||
670 | |||
671 | ecore_x_shutdown(); | ||
672 | eina_shutdown(); | ||
673 | } | ||
674 | |||
675 | EINA_MODULE_INIT(ecore_imf_xim_init); | ||
676 | EINA_MODULE_SHUTDOWN(ecore_imf_xim_shutdown); | ||
677 | |||
678 | #ifdef ENABLE_XIM | ||
679 | /* | ||
680 | * internal functions | ||
681 | */ | ||
682 | Ecore_IMF_Context_Data * | ||
683 | imf_context_data_new() | ||
684 | { | ||
685 | Ecore_IMF_Context_Data *imf_context_data = NULL; | ||
686 | char *locale; | ||
687 | |||
688 | locale = setlocale(LC_CTYPE, ""); | ||
689 | if(!locale) return NULL; | ||
690 | |||
691 | if(!XSupportsLocale()) return NULL; | ||
692 | |||
693 | imf_context_data = calloc(1, sizeof(Ecore_IMF_Context_Data)); | ||
694 | if(!imf_context_data) return NULL; | ||
695 | |||
696 | imf_context_data->locale = strdup(locale); | ||
697 | if(!imf_context_data->locale) goto error; | ||
698 | |||
699 | return imf_context_data; | ||
700 | error: | ||
701 | imf_context_data_destroy(imf_context_data); | ||
702 | return NULL; | ||
703 | } | ||
704 | |||
705 | void | ||
706 | imf_context_data_destroy(Ecore_IMF_Context_Data *imf_context_data) | ||
707 | { | ||
708 | if(!imf_context_data) | ||
709 | return; | ||
710 | |||
711 | if(imf_context_data->ic) | ||
712 | XDestroyIC(imf_context_data->ic); | ||
713 | |||
714 | free(imf_context_data->preedit_chars); | ||
715 | free(imf_context_data->locale); | ||
716 | free(imf_context_data); | ||
717 | } | ||
718 | |||
719 | static int | ||
720 | preedit_start_callback(XIC xic __UNUSED__, | ||
721 | XPointer client_data, | ||
722 | XPointer call_data __UNUSED__) | ||
723 | { | ||
724 | EINA_LOG_DBG("in"); | ||
725 | Ecore_IMF_Context *ctx = (Ecore_IMF_Context *)client_data; | ||
726 | Ecore_IMF_Context_Data *imf_context_data; | ||
727 | imf_context_data = ecore_imf_context_data_get(ctx); | ||
728 | |||
729 | if(imf_context_data->finalizing == EINA_FALSE) | ||
730 | ecore_imf_context_preedit_start_event_add(ctx); | ||
731 | |||
732 | return -1; | ||
733 | } | ||
734 | |||
735 | static void | ||
736 | preedit_done_callback(XIC xic __UNUSED__, | ||
737 | XPointer client_data, | ||
738 | XPointer call_data __UNUSED__) | ||
739 | { | ||
740 | EINA_LOG_DBG("in"); | ||
741 | Ecore_IMF_Context *ctx = (Ecore_IMF_Context *)client_data; | ||
742 | Ecore_IMF_Context_Data *imf_context_data; | ||
743 | imf_context_data = ecore_imf_context_data_get(ctx); | ||
744 | |||
745 | if(imf_context_data->preedit_length) | ||
746 | { | ||
747 | imf_context_data->preedit_length = 0; | ||
748 | free(imf_context_data->preedit_chars); | ||
749 | imf_context_data->preedit_chars = NULL; | ||
750 | ecore_imf_context_preedit_changed_event_add(ctx); | ||
751 | } | ||
752 | |||
753 | if(imf_context_data->finalizing == EINA_FALSE) | ||
754 | ecore_imf_context_preedit_end_event_add(ctx); | ||
755 | } | ||
756 | |||
757 | /* FIXME */ | ||
758 | static int | ||
759 | xim_text_to_utf8(Ecore_IMF_Context *ctx __UNUSED__, | ||
760 | XIMText *xim_text, | ||
761 | char **text) | ||
762 | { | ||
763 | int text_length = 0; | ||
764 | char *result = NULL; | ||
765 | |||
766 | if(xim_text && xim_text->string.multi_byte) | ||
767 | { | ||
768 | if(xim_text->encoding_is_wchar) | ||
769 | { | ||
770 | EINA_LOG_WARN("Wide character return from Xlib not currently supported"); | ||
771 | *text = NULL; | ||
772 | return 0; | ||
773 | } | ||
774 | |||
775 | /* XXX Convert to UTF-8 */ | ||
776 | result = strdup(xim_text->string.multi_byte); | ||
777 | if(result) | ||
778 | { | ||
779 | text_length = eina_unicode_utf8_get_len(result); | ||
780 | if (text_length != xim_text->length) | ||
781 | { | ||
782 | EINA_LOG_WARN("Size mismatch when converting text from input method: supplied length = %d\n, result length = %d", xim_text->length, text_length); | ||
783 | } | ||
784 | } | ||
785 | else { | ||
786 | EINA_LOG_WARN("Error converting text from IM to UCS-4"); | ||
787 | *text = NULL; | ||
788 | return 0; | ||
789 | } | ||
790 | |||
791 | *text = result; | ||
792 | return text_length; | ||
793 | } | ||
794 | else { | ||
795 | *text = NULL; | ||
796 | return 0; | ||
797 | } | ||
798 | } | ||
799 | |||
800 | static void | ||
801 | preedit_draw_callback(XIC xic __UNUSED__, | ||
802 | XPointer client_data, | ||
803 | XIMPreeditDrawCallbackStruct *call_data) | ||
804 | { | ||
805 | EINA_LOG_DBG("in"); | ||
806 | Eina_Bool ret = EINA_FALSE; | ||
807 | Ecore_IMF_Context *ctx = (Ecore_IMF_Context *)client_data; | ||
808 | Ecore_IMF_Context_Data *imf_context_data = ecore_imf_context_data_get(ctx); | ||
809 | XIMText *t = call_data->text; | ||
810 | char *tmp; | ||
811 | Eina_Unicode *new_text = NULL; | ||
812 | Eina_UStrbuf *preedit_bufs = NULL; | ||
813 | int new_text_length; | ||
814 | |||
815 | preedit_bufs = eina_ustrbuf_new(); | ||
816 | if(imf_context_data->preedit_chars) { | ||
817 | ret = eina_ustrbuf_append(preedit_bufs, imf_context_data->preedit_chars); | ||
818 | if(ret == EINA_FALSE) goto done; | ||
819 | } | ||
820 | |||
821 | new_text_length = xim_text_to_utf8(ctx, t, &tmp); | ||
822 | if(tmp) | ||
823 | { | ||
824 | int tmp_len; | ||
825 | new_text = eina_unicode_utf8_to_unicode((const char *)tmp, &tmp_len); | ||
826 | free(tmp); | ||
827 | } | ||
828 | |||
829 | if(t == NULL) { | ||
830 | /* delete string */ | ||
831 | ret = eina_ustrbuf_remove(preedit_bufs, | ||
832 | call_data->chg_first, call_data->chg_length); | ||
833 | } else if(call_data->chg_length == 0) { | ||
834 | /* insert string */ | ||
835 | ret = eina_ustrbuf_insert(preedit_bufs, new_text, call_data->chg_first); | ||
836 | } else if(call_data->chg_length > 0) { | ||
837 | /* replace string */ | ||
838 | ret = eina_ustrbuf_remove(preedit_bufs, | ||
839 | call_data->chg_first, call_data->chg_length); | ||
840 | if(ret == EINA_FALSE) goto done; | ||
841 | |||
842 | ret = eina_ustrbuf_insert_n(preedit_bufs, new_text, | ||
843 | new_text_length, call_data->chg_first); | ||
844 | if(ret == EINA_FALSE) goto done; | ||
845 | } else { | ||
846 | ret = EINA_FALSE; | ||
847 | } | ||
848 | |||
849 | done: | ||
850 | if(ret == EINA_TRUE) { | ||
851 | free(imf_context_data->preedit_chars); | ||
852 | imf_context_data->preedit_chars = | ||
853 | eina_ustrbuf_string_steal(preedit_bufs); | ||
854 | imf_context_data->preedit_length = | ||
855 | eina_unicode_strlen(imf_context_data->preedit_chars); | ||
856 | |||
857 | ecore_imf_context_preedit_changed_event_add(ctx); | ||
858 | } | ||
859 | |||
860 | free(new_text); | ||
861 | eina_ustrbuf_free(preedit_bufs); | ||
862 | } | ||
863 | |||
864 | static void | ||
865 | preedit_caret_callback(XIC xic __UNUSED__, | ||
866 | XPointer client_data, | ||
867 | XIMPreeditCaretCallbackStruct *call_data) | ||
868 | { | ||
869 | EINA_LOG_DBG("in"); | ||
870 | Ecore_IMF_Context *ctx = (Ecore_IMF_Context *)client_data; | ||
871 | Ecore_IMF_Context_Data *imf_context_data; | ||
872 | imf_context_data = ecore_imf_context_data_get(ctx); | ||
873 | |||
874 | if(call_data->direction == XIMAbsolutePosition) | ||
875 | { | ||
876 | // printf("call_data->position:%d\n", call_data->position); | ||
877 | imf_context_data->preedit_cursor = call_data->position; | ||
878 | if(imf_context_data->finalizing == EINA_FALSE) | ||
879 | ecore_imf_context_preedit_changed_event_add(ctx); | ||
880 | } | ||
881 | } | ||
882 | |||
883 | static XVaNestedList | ||
884 | preedit_callback_set(Ecore_IMF_Context *ctx) | ||
885 | { | ||
886 | Ecore_IMF_Context_Data *imf_context_data; | ||
887 | imf_context_data = ecore_imf_context_data_get(ctx); | ||
888 | |||
889 | imf_context_data->preedit_start_cb.client_data = (XPointer)ctx; | ||
890 | imf_context_data->preedit_start_cb.callback = (XIMProc)preedit_start_callback; | ||
891 | |||
892 | imf_context_data->preedit_done_cb.client_data = (XPointer)ctx; | ||
893 | imf_context_data->preedit_done_cb.callback = (XIMProc)preedit_done_callback; | ||
894 | |||
895 | imf_context_data->preedit_draw_cb.client_data = (XPointer)ctx; | ||
896 | imf_context_data->preedit_draw_cb.callback = (XIMProc)preedit_draw_callback; | ||
897 | |||
898 | imf_context_data->preedit_caret_cb.client_data = (XPointer)ctx; | ||
899 | imf_context_data->preedit_caret_cb.callback = (XIMProc)preedit_caret_callback; | ||
900 | |||
901 | return XVaCreateNestedList(0, | ||
902 | XNPreeditStartCallback, | ||
903 | &imf_context_data->preedit_start_cb, | ||
904 | XNPreeditDoneCallback, | ||
905 | &imf_context_data->preedit_done_cb, | ||
906 | XNPreeditDrawCallback, | ||
907 | &imf_context_data->preedit_draw_cb, | ||
908 | XNPreeditCaretCallback, | ||
909 | &imf_context_data->preedit_caret_cb, | ||
910 | NULL); | ||
911 | } | ||
912 | |||
913 | static XIC | ||
914 | get_ic(Ecore_IMF_Context *ctx) | ||
915 | { | ||
916 | Ecore_IMF_Context_Data *imf_context_data; | ||
917 | XIC ic; | ||
918 | imf_context_data = ecore_imf_context_data_get(ctx); | ||
919 | ic = imf_context_data->ic; | ||
920 | if(!ic) | ||
921 | { | ||
922 | XIM_Im_Info *im_info = imf_context_data->im_info; | ||
923 | XVaNestedList preedit_attr = NULL; | ||
924 | XIMStyle im_style = 0; | ||
925 | XPoint spot = { 0, 0 }; | ||
926 | char *name = NULL; | ||
927 | |||
928 | if (!im_info) | ||
929 | { | ||
930 | EINA_LOG_WARN("Doesn't open XIM."); | ||
931 | return NULL; | ||
932 | } | ||
933 | |||
934 | // supported styles | ||
935 | #if 0 | ||
936 | int i; | ||
937 | if (im_info->xim_styles) | ||
938 | { | ||
939 | for (i = 0; i < im_info->xim_styles->count_styles; i++) | ||
940 | { | ||
941 | printf("%i: ", i); | ||
942 | if (im_info->xim_styles->supported_styles[i] & XIMPreeditCallbacks) | ||
943 | printf("XIMPreeditCallbacks | "); | ||
944 | if (im_info->xim_styles->supported_styles[i] & XIMPreeditPosition) | ||
945 | printf("XIMPreeditPosition | "); | ||
946 | if (im_info->xim_styles->supported_styles[i] & XIMPreeditArea) | ||
947 | printf("XIMPreeditArea | "); | ||
948 | if (im_info->xim_styles->supported_styles[i] & XIMPreeditNothing) | ||
949 | printf("XIMPreeditNothing | "); | ||
950 | if (im_info->xim_styles->supported_styles[i] & XIMPreeditNone) | ||
951 | printf("XIMPreeditNone | "); | ||
952 | if (im_info->xim_styles->supported_styles[i] & XIMStatusArea) | ||
953 | printf("XIMStatusArea | "); | ||
954 | if (im_info->xim_styles->supported_styles[i] & XIMStatusCallbacks) | ||
955 | printf("XIMStatusCallbacks | "); | ||
956 | if (im_info->xim_styles->supported_styles[i] & XIMStatusNothing) | ||
957 | printf("XIMStatusNothing | "); | ||
958 | if (im_info->xim_styles->supported_styles[i] & XIMStatusNone) | ||
959 | printf("XIMStatusNone | "); | ||
960 | printf("\n"); | ||
961 | } | ||
962 | } | ||
963 | #endif | ||
964 | // "OverTheSpot" = XIMPreeditPosition | XIMStatusNothing | ||
965 | // "OffTheSpot" = XIMPreeditArea | XIMStatusArea | ||
966 | // "Root" = XIMPreeditNothing | XIMStatusNothing | ||
967 | |||
968 | if (imf_context_data->use_preedit == EINA_TRUE) | ||
969 | { | ||
970 | if (im_info->supports_cursor) | ||
971 | { | ||
972 | // kinput2 DOES do this... | ||
973 | XFontSet fs; | ||
974 | char **missing_charset_list; | ||
975 | int missing_charset_count; | ||
976 | char *def_string; | ||
977 | |||
978 | im_style |= XIMPreeditPosition; | ||
979 | im_style |= XIMStatusNothing; | ||
980 | fs = XCreateFontSet(ecore_x_display_get(), | ||
981 | "fixed", | ||
982 | &missing_charset_list, | ||
983 | &missing_charset_count, | ||
984 | &def_string); | ||
985 | preedit_attr = XVaCreateNestedList(0, | ||
986 | XNSpotLocation, &spot, | ||
987 | XNFontSet, fs, | ||
988 | NULL); | ||
989 | } | ||
990 | else | ||
991 | { | ||
992 | im_style |= XIMPreeditCallbacks; | ||
993 | im_style |= XIMStatusNothing; | ||
994 | preedit_attr = preedit_callback_set(ctx); | ||
995 | } | ||
996 | name = XNPreeditAttributes; | ||
997 | } | ||
998 | else | ||
999 | { | ||
1000 | im_style |= XIMPreeditNothing; | ||
1001 | im_style |= XIMStatusNothing; | ||
1002 | } | ||
1003 | |||
1004 | if (im_info->im) | ||
1005 | { | ||
1006 | ic = XCreateIC(im_info->im, | ||
1007 | XNInputStyle, im_style, | ||
1008 | XNClientWindow, imf_context_data->win, | ||
1009 | name, preedit_attr, NULL); | ||
1010 | } | ||
1011 | XFree(preedit_attr); | ||
1012 | if(ic) | ||
1013 | { | ||
1014 | unsigned long mask = 0xaaaaaaaa; | ||
1015 | XGetICValues (ic, | ||
1016 | XNFilterEvents, &mask, | ||
1017 | NULL); | ||
1018 | imf_context_data->mask = mask; | ||
1019 | ecore_x_event_mask_set(imf_context_data->win, mask); | ||
1020 | } | ||
1021 | |||
1022 | imf_context_data->ic = ic; | ||
1023 | if(ic && imf_context_data->has_focus == EINA_TRUE) | ||
1024 | XSetICFocus(ic); | ||
1025 | } | ||
1026 | |||
1027 | return ic; | ||
1028 | } | ||
1029 | |||
1030 | static void | ||
1031 | reinitialize_ic(Ecore_IMF_Context *ctx) | ||
1032 | { | ||
1033 | Ecore_IMF_Context_Data *imf_context_data = ecore_imf_context_data_get(ctx); | ||
1034 | XIC ic = imf_context_data->ic; | ||
1035 | if(ic) | ||
1036 | { | ||
1037 | XDestroyIC(ic); | ||
1038 | imf_context_data->ic = NULL; | ||
1039 | if(imf_context_data->preedit_length) | ||
1040 | { | ||
1041 | imf_context_data->preedit_length = 0; | ||
1042 | free(imf_context_data->preedit_chars); | ||
1043 | imf_context_data->preedit_chars = NULL; | ||
1044 | ecore_imf_context_preedit_changed_event_add(ctx); | ||
1045 | } | ||
1046 | } | ||
1047 | } | ||
1048 | |||
1049 | static void | ||
1050 | reinitialize_all_ics(XIM_Im_Info *info) | ||
1051 | { | ||
1052 | Eina_List *tmp_list; | ||
1053 | Ecore_IMF_Context *ctx; | ||
1054 | |||
1055 | EINA_LIST_FOREACH(info->ics, tmp_list, ctx) | ||
1056 | reinitialize_ic(ctx); | ||
1057 | } | ||
1058 | |||
1059 | static void | ||
1060 | set_ic_client_window(Ecore_IMF_Context *ctx, | ||
1061 | Ecore_X_Window window) | ||
1062 | { | ||
1063 | EINA_LOG_DBG("in"); | ||
1064 | Ecore_IMF_Context_Data *imf_context_data = ecore_imf_context_data_get(ctx); | ||
1065 | Ecore_X_Window old_win; | ||
1066 | |||
1067 | /* reinitialize IC */ | ||
1068 | reinitialize_ic(ctx); | ||
1069 | |||
1070 | old_win = imf_context_data->win; | ||
1071 | EINA_LOG_DBG("old_win:%d window:%d ", old_win, window); | ||
1072 | if(old_win != 0 && old_win != window) /* XXX how do check window... */ | ||
1073 | { | ||
1074 | XIM_Im_Info *info; | ||
1075 | info = imf_context_data->im_info; | ||
1076 | info->ics = eina_list_remove(info->ics, imf_context_data); | ||
1077 | imf_context_data->im_info = NULL; | ||
1078 | } | ||
1079 | |||
1080 | imf_context_data->win = window; | ||
1081 | |||
1082 | if(window) /* XXX */ | ||
1083 | { | ||
1084 | XIM_Im_Info *info = NULL; | ||
1085 | info = get_im(window, imf_context_data->locale); | ||
1086 | imf_context_data->im_info = info; | ||
1087 | imf_context_data->im_info->ics = | ||
1088 | eina_list_prepend(imf_context_data->im_info->ics, | ||
1089 | imf_context_data); | ||
1090 | } | ||
1091 | } | ||
1092 | |||
1093 | static XIM_Im_Info * | ||
1094 | get_im(Ecore_X_Window window, | ||
1095 | char *locale) | ||
1096 | { | ||
1097 | EINA_LOG_DBG("in"); | ||
1098 | |||
1099 | Eina_List *l; | ||
1100 | XIM_Im_Info *im_info = NULL; | ||
1101 | XIM_Im_Info *info = NULL; | ||
1102 | EINA_LIST_FOREACH(open_ims, l, im_info) { | ||
1103 | if(strcmp(im_info->locale, locale) == 0) | ||
1104 | { | ||
1105 | if(im_info->im) | ||
1106 | { | ||
1107 | return im_info; | ||
1108 | } | ||
1109 | else { | ||
1110 | info = im_info; | ||
1111 | break; | ||
1112 | } | ||
1113 | } | ||
1114 | } | ||
1115 | |||
1116 | if(!info) | ||
1117 | { | ||
1118 | info = calloc(1, sizeof(XIM_Im_Info)); | ||
1119 | if(!info) return NULL; | ||
1120 | open_ims = eina_list_prepend(open_ims, info); | ||
1121 | info->win = window; | ||
1122 | info->locale = strdup(locale); | ||
1123 | info->reconnecting = EINA_FALSE; | ||
1124 | } | ||
1125 | |||
1126 | xim_info_try_im(info); | ||
1127 | return info; | ||
1128 | } | ||
1129 | |||
1130 | /* initialize info->im */ | ||
1131 | static void | ||
1132 | xim_info_try_im(XIM_Im_Info *info) | ||
1133 | { | ||
1134 | Ecore_X_Display *dsp; | ||
1135 | |||
1136 | assert(info->im == NULL); | ||
1137 | if (info->reconnecting == EINA_TRUE) | ||
1138 | return; | ||
1139 | |||
1140 | if(XSupportsLocale()) | ||
1141 | { | ||
1142 | if (!XSetLocaleModifiers ("")) | ||
1143 | EINA_LOG_WARN("Unable to set locale modifiers with XSetLocaleModifiers()"); | ||
1144 | dsp = ecore_x_display_get(); | ||
1145 | info->im = XOpenIM(dsp, NULL, NULL, NULL); | ||
1146 | if(!info->im) | ||
1147 | { | ||
1148 | XRegisterIMInstantiateCallback(dsp, | ||
1149 | NULL, NULL, NULL, | ||
1150 | xim_instantiate_callback, | ||
1151 | (XPointer)info); | ||
1152 | info->reconnecting = EINA_TRUE; | ||
1153 | return; | ||
1154 | } | ||
1155 | setup_im(info); | ||
1156 | } | ||
1157 | } | ||
1158 | |||
1159 | static void | ||
1160 | xim_info_display_closed(Ecore_X_Display *display __UNUSED__, | ||
1161 | int is_error __UNUSED__, | ||
1162 | XIM_Im_Info *info) | ||
1163 | { | ||
1164 | Eina_List *ics, *tmp_list; | ||
1165 | Ecore_IMF_Context *ctx; | ||
1166 | |||
1167 | open_ims = eina_list_remove(open_ims, info); | ||
1168 | |||
1169 | ics = info->ics; | ||
1170 | info->ics = NULL; | ||
1171 | |||
1172 | EINA_LIST_FOREACH(ics, tmp_list, ctx) | ||
1173 | set_ic_client_window(ctx, 0); | ||
1174 | |||
1175 | EINA_LIST_FREE(ics, ctx) { | ||
1176 | Ecore_IMF_Context_Data *imf_context_data; | ||
1177 | imf_context_data = ecore_imf_context_data_get(ctx); | ||
1178 | imf_context_data_destroy(imf_context_data); | ||
1179 | } | ||
1180 | |||
1181 | free (info->locale); | ||
1182 | |||
1183 | if (info->im) | ||
1184 | XCloseIM (info->im); | ||
1185 | |||
1186 | free (info); | ||
1187 | } | ||
1188 | |||
1189 | static void | ||
1190 | xim_instantiate_callback(Display *display, | ||
1191 | XPointer client_data, | ||
1192 | XPointer call_data __UNUSED__) | ||
1193 | { | ||
1194 | XIM_Im_Info *info = (XIM_Im_Info *)client_data; | ||
1195 | XIM im = NULL; | ||
1196 | |||
1197 | im = XOpenIM(display, NULL, NULL, NULL); | ||
1198 | |||
1199 | if (!im) | ||
1200 | { | ||
1201 | fprintf(stderr, "Failed to connect to IM\n"); | ||
1202 | return; | ||
1203 | } | ||
1204 | |||
1205 | info->im = im; | ||
1206 | setup_im (info); | ||
1207 | |||
1208 | XUnregisterIMInstantiateCallback (display, NULL, NULL, NULL, | ||
1209 | xim_instantiate_callback, | ||
1210 | (XPointer)info); | ||
1211 | info->reconnecting = EINA_FALSE; | ||
1212 | } | ||
1213 | |||
1214 | static void | ||
1215 | setup_im(XIM_Im_Info *info) | ||
1216 | { | ||
1217 | XIMValuesList *ic_values = NULL; | ||
1218 | XIMCallback im_destroy_callback; | ||
1219 | |||
1220 | if(!info->im) | ||
1221 | return; | ||
1222 | |||
1223 | im_destroy_callback.client_data = (XPointer)info; | ||
1224 | im_destroy_callback.callback = (XIMProc)xim_destroy_callback; | ||
1225 | XSetIMValues(info->im, | ||
1226 | XNDestroyCallback, &im_destroy_callback, | ||
1227 | NULL); | ||
1228 | |||
1229 | XGetIMValues(info->im, | ||
1230 | XNQueryInputStyle, &info->xim_styles, | ||
1231 | XNQueryICValuesList, &ic_values, | ||
1232 | NULL); | ||
1233 | |||
1234 | if (ic_values) | ||
1235 | { | ||
1236 | int i; | ||
1237 | |||
1238 | for (i = 0; i < ic_values->count_values; i++) | ||
1239 | { | ||
1240 | if (!strcmp(ic_values->supported_values[i], | ||
1241 | XNStringConversionCallback)) | ||
1242 | info->supports_string_conversion = EINA_TRUE; | ||
1243 | if (!strcmp(ic_values->supported_values[i], | ||
1244 | XNCursor)) | ||
1245 | info->supports_cursor = EINA_TRUE; | ||
1246 | } | ||
1247 | #if 0 | ||
1248 | printf("values........\n"); | ||
1249 | for (i = 0; i < ic_values->count_values; i++) | ||
1250 | printf("%s\n", ic_values->supported_values[i]); | ||
1251 | printf("styles........\n"); | ||
1252 | for (i = 0; i < info->xim_styles->count_styles; i++) | ||
1253 | printf("%lx\n", info->xim_styles->supported_styles[i]); | ||
1254 | #endif | ||
1255 | XFree(ic_values); | ||
1256 | } | ||
1257 | } | ||
1258 | |||
1259 | static void | ||
1260 | xim_destroy_callback(XIM xim __UNUSED__, | ||
1261 | XPointer client_data, | ||
1262 | XPointer call_data __UNUSED__) | ||
1263 | { | ||
1264 | XIM_Im_Info *info = (XIM_Im_Info *)client_data; | ||
1265 | info->im = NULL; | ||
1266 | |||
1267 | reinitialize_all_ics(info); | ||
1268 | xim_info_try_im(info); | ||
1269 | |||
1270 | return; | ||
1271 | } | ||
1272 | |||
1273 | #endif /* ENABLE_XIM */ | ||