diff -BburN awt.1205/src/main/java/common/java/awt/Window.java awt/src/main/java/common/java/awt/Window.java --- awt.1205/src/main/java/common/java/awt/Window.java 2007-12-17 17:37:39.000000000 +0800 +++ awt/src/main/java/common/java/awt/Window.java 2007-12-17 17:47:34.000000000 +0800 @@ -411,7 +411,19 @@ toolkit.lockAWT(); try { if (inputContext == null) { - inputContext = InputContext.getInstance(); + NativeWindow win = getNativeWindow(); + if (win != null) { + long winId = win.getId(); + inputContext = InputContext.getInstance(winId); + } else { + inputContext = InputContext.getInstance(0); + } + } else if (((InputMethodContext)inputContext).getInputMethod() == null) { + NativeWindow win = getNativeWindow(); //Linux nativeIM requires a ready nativeWindow to really create inputMethod + if (win != null) { + long winId = win.getId(); + ((InputMethodContext)inputContext).selectInputMethod(Locale.US, winId); + } } return inputContext; } finally { diff -BburN awt.1205/src/main/java/common/java/awt/im/InputContext.java awt/src/main/java/common/java/awt/im/InputContext.java --- awt.1205/src/main/java/common/java/awt/im/InputContext.java 2007-12-17 17:37:39.000000000 +0800 +++ awt/src/main/java/common/java/awt/im/InputContext.java 2007-12-17 17:43:17.000000000 +0800 @@ -30,8 +30,8 @@ protected InputContext() { } - public static InputContext getInstance() { - return new InputMethodContext(); + public static InputContext getInstance(long windowId) { + return new InputMethodContext(windowId); } public void dispatchEvent(AWTEvent event) { @@ -61,7 +61,7 @@ public void removeNotify(Component client) { } - public boolean selectInputMethod(Locale locale) { + public boolean selectInputMethod(Locale locale, long windowId) { return false; } diff -BburN awt.1205/src/main/java/common/java/awt/im/spi/InputMethodDescriptor.java awt/src/main/java/common/java/awt/im/spi/InputMethodDescriptor.java --- awt.1205/src/main/java/common/java/awt/im/spi/InputMethodDescriptor.java 2007-12-17 17:37:39.000000000 +0800 +++ awt/src/main/java/common/java/awt/im/spi/InputMethodDescriptor.java 2007-12-17 17:44:00.000000000 +0800 @@ -28,7 +28,7 @@ public Locale[] getAvailableLocales() throws AWTException; - public InputMethod createInputMethod() throws Exception; + public InputMethod createInputMethod(long windowId) throws Exception; public String getInputMethodDisplayName(Locale inputLocale, Locale displayLanguage); diff -BburN awt.1205/src/main/java/common/org/apache/harmony/awt/ContextStorage.java awt/src/main/java/common/org/apache/harmony/awt/ContextStorage.java --- awt.1205/src/main/java/common/org/apache/harmony/awt/ContextStorage.java 2007-12-17 17:37:36.000000000 +0800 +++ awt/src/main/java/common/org/apache/harmony/awt/ContextStorage.java 2007-12-17 17:49:32.000000000 +0800 @@ -93,8 +93,8 @@ getCurrentContext().wtk = wtk; } - public static NativeIM getNativeIM() { - return getCurrentContext().wtk.getNativeIM(); + public static NativeIM getNativeIM(long windowId) { + return getCurrentContext().wtk.getNativeIM(windowId); } public static NativeEventQueue getNativeEventQueue() { diff -BburN awt.1205/src/main/java/common/org/apache/harmony/awt/im/IMManager.java awt/src/main/java/common/org/apache/harmony/awt/im/IMManager.java --- awt.1205/src/main/java/common/org/apache/harmony/awt/im/IMManager.java 2007-12-17 17:37:36.000000000 +0800 +++ awt/src/main/java/common/org/apache/harmony/awt/im/IMManager.java 2007-12-17 17:58:30.000000000 +0800 @@ -143,7 +143,8 @@ InputMethodContext imContext; public IMSelection() { - Iterator it = getIMDescriptors().iterator(); + System.out.println("IMSelection"); + Iterator it = getIMDescriptors(0).iterator(); // native IM is always first addNativeIM(it); while (it.hasNext()) { @@ -165,13 +166,14 @@ } public void itemStateChanged(ItemEvent e) { + System.out.println("itemStateChanged"); if (imContext == null) { return; } Object src = e.getSource(); if (src instanceof IMenuItem) { IMenuItem item = (IMenuItem) src; - imContext.selectIM(item.getDesc(), item.getLocale()); + imContext.selectIM(item.getDesc(), item.getLocale(), 0); } } @@ -207,9 +209,9 @@ // last InputMethodContext which had an active IM private static InputMethodContext lastActiveIMC; - static List getIMDescriptors() { + static List getIMDescriptors(long windowId) { if (imd == null) { - imd = loadIMDescriptors(); + imd = loadIMDescriptors(windowId); } return imd; } @@ -221,18 +223,20 @@ * Service.providers(InputMethodDescriptor.class) * @return list of input method descriptors */ - private static List loadIMDescriptors() { + private static List loadIMDescriptors(long windowId) { String nm = SERVICES + InputMethodDescriptor.class.getName(); Enumeration en; LinkedList imdList = new LinkedList(); // first add native IM descriptor(is always present) - NativeIM nativeIM = ContextStorage.getNativeIM(); + NativeIM nativeIM = ContextStorage.getNativeIM(windowId); + if (nativeIM == null) return null; imdList.add(nativeIM); try { en = ClassLoader.getSystemResources(nm); ClassLoader cl = ClassLoader.getSystemClassLoader(); while (en.hasMoreElements()) { URL url = en.nextElement(); + System.out.println("GetnextElement " + url + " in LoadIMDescriptors"); InputStreamReader isr = new InputStreamReader(url.openStream(), "UTF-8"); //$NON-NLS-1$ BufferedReader br = new BufferedReader(isr); @@ -258,7 +262,7 @@ } private static void showIMPopup(InputMethodContext imc, Window parent) { - List descriptors = getIMDescriptors(); + List descriptors = getIMDescriptors(0); if ((descriptors == null) || descriptors.isEmpty()) { // show menu only if some non-native IMs are present return; diff -BburN awt.1205/src/main/java/common/org/apache/harmony/awt/im/InputMethodContext.java awt/src/main/java/common/org/apache/harmony/awt/im/InputMethodContext.java --- awt.1205/src/main/java/common/org/apache/harmony/awt/im/InputMethodContext.java 2007-12-17 17:37:36.000000000 +0800 +++ awt/src/main/java/common/org/apache/harmony/awt/im/InputMethodContext.java 2007-12-17 18:04:13.000000000 +0800 @@ -73,12 +73,12 @@ private final NativeIM nativeIM; - public InputMethodContext() { + public InputMethodContext(long windowId) { notifyIM = new HashSet(); imWindows = new HashSet(); imInstances = new HashMap(); localeIM = new HashMap(); - selectInputMethod(Locale.US); // not default? + selectInputMethod(Locale.US, windowId); // not default? nativeIM = (NativeIM) inputMethod; } @@ -292,7 +292,7 @@ } @Override - public boolean selectInputMethod(Locale locale) { + public boolean selectInputMethod(Locale locale, long windowId) { if ((inputMethod != null) && inputMethod.setLocale(locale)) { return true; @@ -306,8 +306,8 @@ // or create, store new IM instance in descriptor->instance map if (newIM == null) { try { - newIM = getIMInstance(IMManager.getIMDescriptors().iterator(), - locale); + newIM = getIMInstance(IMManager.getIMDescriptors(windowId).iterator(), + locale, windowId); } catch (Exception e) { // ignore exceptions - just return false } @@ -335,9 +335,9 @@ /** * Is called when IM is selected from UI */ - void selectIM(InputMethodDescriptor imd, Locale locale) { + void selectIM(InputMethodDescriptor imd, Locale locale, long windowId) { try { - switchToIM(locale, getIMInstance(imd)); + switchToIM(locale, getIMInstance(imd, windowId)); } catch (Exception e) { e.printStackTrace(); } @@ -352,23 +352,24 @@ * @throws Exception */ private InputMethod getIMInstance(Iterator descriptors, - Locale locale) throws Exception { + Locale locale, long windowId) throws Exception { + if(descriptors == null) return null; while (descriptors.hasNext()) { InputMethodDescriptor desc = descriptors.next(); Locale[] locs = desc.getAvailableLocales(); for (Locale element : locs) { if (locale.equals(element)) { - return getIMInstance(desc); + return getIMInstance(desc, windowId); } } } return null; } - private InputMethod getIMInstance(InputMethodDescriptor imd) throws Exception { + private InputMethod getIMInstance(InputMethodDescriptor imd, long windowId) throws Exception { InputMethod im = imInstances.get(imd); if (im == null) { - im = imd.createInputMethod(); + im = imd.createInputMethod(windowId); im.setInputMethodContext(this); imInstances.put(imd, im); } diff -BburN awt.1205/src/main/java/common/org/apache/harmony/awt/wtk/NativeIM.java awt/src/main/java/common/org/apache/harmony/awt/wtk/NativeIM.java --- awt.1205/src/main/java/common/org/apache/harmony/awt/wtk/NativeIM.java 2007-12-17 17:37:36.000000000 +0800 +++ awt/src/main/java/common/org/apache/harmony/awt/wtk/NativeIM.java 2007-12-17 18:05:09.000000000 +0800 @@ -105,7 +105,7 @@ return new Locale[]{Locale.getDefault(), Locale.ENGLISH}; } - public InputMethod createInputMethod() throws Exception { + public InputMethod createInputMethod(long windowId) throws Exception { return this; } diff -BburN awt.1205/src/main/java/common/org/apache/harmony/awt/wtk/WTK.java awt/src/main/java/common/org/apache/harmony/awt/wtk/WTK.java --- awt.1205/src/main/java/common/org/apache/harmony/awt/wtk/WTK.java 2007-12-17 17:37:36.000000000 +0800 +++ awt/src/main/java/common/org/apache/harmony/awt/wtk/WTK.java 2007-12-17 18:07:08.000000000 +0800 @@ -57,7 +57,7 @@ * class org.apache.harmony.awt.wtk.NativeIM. * @return implementation of NativeIM */ - public abstract NativeIM getNativeIM(); + public abstract NativeIM getNativeIM(long windowId); /** * Perform platform specific operations with locking keys. diff -BburN awt.1205/src/main/java/unix/org/apache/harmony/awt/nativebridge/linux/X11.java awt/src/main/java/unix/org/apache/harmony/awt/nativebridge/linux/X11.java --- awt.1205/src/main/java/unix/org/apache/harmony/awt/nativebridge/linux/X11.java 2007-12-17 17:37:39.000000000 +0800 +++ awt/src/main/java/unix/org/apache/harmony/awt/nativebridge/linux/X11.java 2007-12-17 18:08:10.000000000 +0800 @@ -4705,6 +4705,27 @@ } public final native void Xutf8SetWMProperties(long param_0, long param_1, long param_2, long param_3, long param_4, int param_5, long param_6, long param_7, long param_8); + public final native long XOpenIM(long param_0); + + public final native long XCreateIC(long param_0, long param_1); + + public final native boolean XSupportLocale(); + + public final native long XSetICFocus(long param_0); + + public final native long XUnsetICFocus(long param_0); + + public final boolean XFilterEvent(X11.XEvent param_0) { + long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer(); + boolean tmp_ret = XFilterEvent(tmp_0); + if (param_0 != null) { + param_0.unlock(); + } + return tmp_ret; + } + + public final native boolean XFilterEvent(long param_0); + public final native long XDefaultColormap(long param_0, int param_1); public final native long XAllocSizeHints(); diff -BburN awt.1205/src/main/java/unix/org/apache/harmony/awt/wtk/linux/LinuxEventQueue.java awt/src/main/java/unix/org/apache/harmony/awt/wtk/linux/LinuxEventQueue.java --- awt.1205/src/main/java/unix/org/apache/harmony/awt/wtk/linux/LinuxEventQueue.java 2007-12-17 17:37:39.000000000 +0800 +++ awt/src/main/java/unix/org/apache/harmony/awt/wtk/linux/LinuxEventQueue.java 2007-12-18 09:55:49.000000000 +0800 @@ -99,6 +99,11 @@ } private boolean preprocessEvent(X11.XEvent event) { + if(x11.XFilterEvent(event)) { + if ((event.get_type() == X11Defs.KeyPress) || (event.get_type() == X11Defs.KeyRelease)) + System.out.println("Key Event is filtered by IM"); + return true; + } for (Iterator i = preprocessors.iterator(); i.hasNext(); ) { if (((Preprocessor) i.next()).preprocess(event)) { return true; diff -BburN awt.1205/src/main/java/unix/org/apache/harmony/awt/wtk/linux/LinuxIM.java awt/src/main/java/unix/org/apache/harmony/awt/wtk/linux/LinuxIM.java --- awt.1205/src/main/java/unix/org/apache/harmony/awt/wtk/linux/LinuxIM.java 1970-01-01 08:00:00.000000000 +0800 +++ awt/src/main/java/unix/org/apache/harmony/awt/wtk/linux/LinuxIM.java 2007-12-17 18:10:39.000000000 +0800 @@ -0,0 +1,107 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @author Chunrong Lai + * @version $Revision$ + */ +package org.apache.harmony.awt.wtk.linux; + +import java.awt.im.spi.InputMethod; + +import org.apache.harmony.awt.ContextStorage; +import org.apache.harmony.awt.nativebridge.NativeBridge; +import org.apache.harmony.awt.nativebridge.linux.X11; +import org.apache.harmony.awt.wtk.linux.LinuxWindowFactory; +import org.apache.harmony.awt.wtk.linux.LinuxEventQueue; +import org.apache.harmony.awt.wtk.NativeIM; + + +/** + * Linuxs-specific native input method + * functionality + */ +public class LinuxIM extends NativeIM { + private static final X11 x11 = X11.getInstance(); + private static final NativeBridge nb = NativeBridge.getInstance(); + private static final LinuxWindowFactory factory = (LinuxWindowFactory) ContextStorage.getWindowFactory(); + private static final long display = factory.getDisplay(); + private static final int screen = factory.getScreen(); + + private long hIMC; // private native input context handle + + + LinuxIM(long windowId) { + final long winId = windowId; + //System.out.println("new a LinuxIM " + this + " with winId " + winId); + //LinuxEventQueue.Task task = new LinuxEventQueue.Task() { + // @Override + // public void perform() { + hIMC = 0l; + if (x11.XSupportLocale() == false) { + return; + } + long hIM = x11.XOpenIM(display); + if (hIM == 0l) { + hIMC = 0l; + return; + } + if(winId == 0l) { + return; + } + System.out.println("begin to CreateIC"); + hIMC = x11.XCreateIC(hIM, winId); + System.out.println("XCreateIC returns " + hIMC); + if (hIMC == 0l) return; + // }; + //}; + //((LinuxEventQueue)(ContextStorage.getNativeEventQueue())).performTask(task); + } + + /** + * Must create new instance of this IM for + * every instance of input context + */ + @Override + public InputMethod createInputMethod(long windowId) throws Exception { + if (windowId == 0l) { + return null; + } else { + System.out.println("CreateInputMethod for winId " + windowId); + return new LinuxIM(windowId); + } + } + + @Override + public void activate() { + if(hIMC != 0l) + x11.XSetICFocus(hIMC); + } + + @Override + public void deactivate(boolean isTemporary) { + if(hIMC != 0l) + x11.XUnsetICFocus(hIMC); + } + + /** + * Disables native input method support for the + * focused window + */ + @Override + public void disableIME() { + } +} diff -BburN awt.1205/src/main/java/unix/org/apache/harmony/awt/wtk/linux/LinuxWTK.java awt/src/main/java/unix/org/apache/harmony/awt/wtk/linux/LinuxWTK.java --- awt.1205/src/main/java/unix/org/apache/harmony/awt/wtk/linux/LinuxWTK.java 2007-12-17 17:37:39.000000000 +0800 +++ awt/src/main/java/unix/org/apache/harmony/awt/wtk/linux/LinuxWTK.java 2007-12-18 10:01:27.000000000 +0800 @@ -84,9 +84,12 @@ return robot; } - public NativeIM getNativeIM() { - // TODO implement - return null; + public NativeIM getNativeIM(long windowId) { + if (im == null) { + if (windowId != 0) + im = new LinuxIM(windowId); + } + return im; } public boolean getLockingState(int keyCode) { @@ -105,4 +108,5 @@ private final NativeMouseInfo mouseInfo = new LinuxMouseInfo(windowFactory); private final LinuxSystemProperties systemProperties = new LinuxSystemProperties(windowFactory); private HashMap robots = new HashMap(); //HashMap + private LinuxIM im; } diff -BburN awt.1205/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinWTK.java awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinWTK.java --- awt.1205/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinWTK.java 2007-12-17 17:37:35.000000000 +0800 +++ awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinWTK.java 2007-12-18 09:43:44.000000000 +0800 @@ -95,7 +95,7 @@ } @Override - public NativeIM getNativeIM() { + public NativeIM getNativeIM(long windowId) { if (im == null) { im = new WinIM(); } Binary files awt.1205/src/main/native/x11wrapper/libX11Wrapper.so and awt/src/main/native/x11wrapper/libX11Wrapper.so differ diff -BburN awt.1205/src/main/native/x11wrapper/unix/exports.txt awt/src/main/native/x11wrapper/unix/exports.txt --- awt.1205/src/main/native/x11wrapper/unix/exports.txt 2007-12-17 17:37:33.000000000 +0800 +++ awt/src/main/native/x11wrapper/unix/exports.txt 2007-12-18 09:44:32.000000000 +0800 @@ -115,6 +115,12 @@ Java_org_apache_harmony_awt_nativebridge_linux_X11_XSetSelectionOwner Java_org_apache_harmony_awt_nativebridge_linux_X11_XSetStandardProperties Java_org_apache_harmony_awt_nativebridge_linux_X11_Xutf8SetWMProperties +Java_org_apache_harmony_awt_nativebridge_linux_X11_XOpenIM +Java_org_apache_harmony_awt_nativebridge_linux_X11_XCreateIC +Java_org_apache_harmony_awt_nativebridge_linux_X11_XSupportLocale +Java_org_apache_harmony_awt_nativebridge_linux_X11_XSetICFocus +Java_org_apache_harmony_awt_nativebridge_linux_X11_XUnsetICFocus +Java_org_apache_harmony_awt_nativebridge_linux_X11_XFilterEvent Java_org_apache_harmony_awt_nativebridge_linux_X11_XSetTransientForHint Java_org_apache_harmony_awt_nativebridge_linux_X11_XSetWMHints Java_org_apache_harmony_awt_nativebridge_linux_X11_XSetWMNormalHints diff -BburN awt.1205/src/main/native/x11wrapper/unix/libX11Wrapper.exp awt/src/main/native/x11wrapper/unix/libX11Wrapper.exp --- awt.1205/src/main/native/x11wrapper/unix/libX11Wrapper.exp 2007-12-17 17:37:33.000000000 +0800 +++ awt/src/main/native/x11wrapper/unix/libX11Wrapper.exp 2007-12-18 10:17:50.000000000 +0800 @@ -117,6 +117,12 @@ Java_org_apache_harmony_awt_nativebridge_linux_X11_XSetSelectionOwner; Java_org_apache_harmony_awt_nativebridge_linux_X11_XSetStandardProperties; Java_org_apache_harmony_awt_nativebridge_linux_X11_Xutf8SetWMProperties; + Java_org_apache_harmony_awt_nativebridge_linux_X11_XOpenIM; + Java_org_apache_harmony_awt_nativebridge_linux_X11_XCreateIC; + Java_org_apache_harmony_awt_nativebridge_linux_X11_XSupportLocale; + Java_org_apache_harmony_awt_nativebridge_linux_X11_XSetICFocus; + Java_org_apache_harmony_awt_nativebridge_linux_X11_XUnsetICFocus; + Java_org_apache_harmony_awt_nativebridge_linux_X11_XFilterEvent; Java_org_apache_harmony_awt_nativebridge_linux_X11_XSetTransientForHint; Java_org_apache_harmony_awt_nativebridge_linux_X11_XSetWMHints; Java_org_apache_harmony_awt_nativebridge_linux_X11_XSetWMNormalHints; diff -BburN awt.1205/src/main/native/x11wrapper/unix/org_apache_harmony_awt_nativebridge_linux_X11.cpp awt/src/main/native/x11wrapper/unix/org_apache_harmony_awt_nativebridge_linux_X11.cpp --- awt.1205/src/main/native/x11wrapper/unix/org_apache_harmony_awt_nativebridge_linux_X11.cpp 2007-12-17 17:37:33.000000000 +0800 +++ awt/src/main/native/x11wrapper/unix/org_apache_harmony_awt_nativebridge_linux_X11.cpp 2007-12-18 23:22:44.000000000 +0800 @@ -783,6 +783,90 @@ (* p_nbridge_Xutf8SetWMProperties)((void *) param_0, (long) param_1, (void *) param_2, (void *) param_3, (void *) param_4, (int) param_5, (void *) param_6, (void *) param_7, (void *) param_8); } +void* (* p_nbridge_XOpenIM) (void *, void *, void *, void *) = NULL; + +JNIEXPORT jlong JNICALL Java_org_apache_harmony_awt_nativebridge_linux_X11_XOpenIM( JNIEnv *env, jobject self, jlong param_0) { + if (p_nbridge_XOpenIM == NULL) { + p_nbridge_XOpenIM = (void* (*) (void *, void *, void *, void*)) FindFunction(libX11, "XOpenIM"); + } + //static jlong xdisplay = (jlong) (* p_nbridge_XOpenDisplay)(NULL); + //using the Harmony unique display param_0 leads to hangs, newly createn xdisplay is OK but XIM client can not be triggered + printf("Try to OpenIM with the unique display 0x%x\n", (void *)param_0); + //printf("Try to OpenIM with the new display 0x%x\n", (void *)xdisplay); + //jlong tmp_ret = (jlong)(* p_nbridge_XOpenIM)((void *) xdisplay, NULL, NULL, NULL); + jlong tmp_ret = (jlong)(* p_nbridge_XOpenIM)((void *) param_0, NULL, NULL, NULL); + printf("Finish OpenIM with return 0x%x\n", tmp_ret); + return tmp_ret; +} + +void* (* p_nbridge_XCreateIC) (void *, const void *, unsigned long, const void *, unsigned long, void *) = NULL; + +JNIEXPORT jlong JNICALL Java_org_apache_harmony_awt_nativebridge_linux_X11_XCreateIC( JNIEnv *env, jobject self, jlong param_0, jlong param_1) { + if (p_nbridge_XCreateIC == NULL) { + p_nbridge_XCreateIC = (void* (*) (void *, const void*, unsigned long, const void *, unsigned long, void *)) FindFunction(libX11, "XCreateIC"); + } + printf("XCreateIC with im 0x%x in window 0x%x\n", (void *)param_0, (unsigned long)param_1); + jlong tmp_ret = (jlong)(* p_nbridge_XCreateIC)((void *) param_0, "inputStyle", 0x0408L, "clientWindow", (unsigned long)param_1, NULL); + return tmp_ret; +} + +void* (* p_nbridge_Xsetlocale) (int, const void *) = NULL; +bool (* p_nbridge_XSupportsLocale) () = NULL; +void* (* p_nbridge_XSetLocaleModifiers) (const void *) = NULL; + +JNIEXPORT jboolean JNICALL Java_org_apache_harmony_awt_nativebridge_linux_X11_XSupportLocale( JNIEnv *env, jobject self) { + if (p_nbridge_Xsetlocale == NULL) { + p_nbridge_Xsetlocale = (void* (*) (int, const void *)) FindFunction(libX11, "setlocale"); + } + if (p_nbridge_Xsetlocale == NULL) { + return (jboolean)FALSE; + } + if (((* p_nbridge_Xsetlocale)(0, "")) == NULL) { + return (jboolean)FALSE; + } + if (p_nbridge_XSupportsLocale == NULL) { + p_nbridge_XSupportsLocale = (bool (*) ()) FindFunction(libX11, "XSupportsLocale"); + } + if (((* p_nbridge_XSupportsLocale)()) == FALSE) { + return (jboolean)FALSE; + } + if (p_nbridge_XSetLocaleModifiers == NULL) { + p_nbridge_XSetLocaleModifiers = (void* (*) (const void *)) FindFunction(libX11, "XSetLocaleModifiers"); + } + if (((* p_nbridge_XSetLocaleModifiers)("")) == NULL) { + return (jboolean)FALSE; + } + return (jboolean)TRUE; +} + +void (* p_nbridge_XSetICFocus) (void *) = NULL; + +JNIEXPORT jlong JNICALL Java_org_apache_harmony_awt_nativebridge_linux_X11_XSetICFocus( JNIEnv *env, jobject self, jlong param_0) { + if (p_nbridge_XSetICFocus == NULL) { + p_nbridge_XSetICFocus = (void (*) (void *)) FindFunction(libX11, "XSetICFocus"); + } + (* p_nbridge_XSetICFocus)((void *) param_0); +} + +void (* p_nbridge_XUnsetICFocus) (void *) = NULL; + +JNIEXPORT jlong JNICALL Java_org_apache_harmony_awt_nativebridge_linux_X11_XUnsetICFocus( JNIEnv *env, jobject self, jlong param_0) { + if (p_nbridge_XUnsetICFocus == NULL) { + p_nbridge_XUnsetICFocus = (void (*) (void *)) FindFunction(libX11, "XUnsetICFocus"); + } + (* p_nbridge_XUnsetICFocus)((void *) param_0); +} + +bool (* p_nbridge_XFilterEvent) (void *, long) = NULL; + +JNIEXPORT jboolean JNICALL Java_org_apache_harmony_awt_nativebridge_linux_X11_XFilterEvent( JNIEnv *env, jobject self, jlong param_0) { + if (p_nbridge_XFilterEvent == NULL) { + p_nbridge_XFilterEvent = (bool (*) (void *, long)) FindFunction(libX11, "XFilterEvent"); + } + bool tmp_ret = (bool)(* p_nbridge_XFilterEvent) ((void *)param_0, 0l); + return tmp_ret; +} + unsigned long (* p_nbridge_XDefaultColormap) (void *, int) = NULL; JNIEXPORT jlong JNICALL Java_org_apache_harmony_awt_nativebridge_linux_X11_XDefaultColormap( JNIEnv *env, jobject self, jlong param_0, jint param_1) { diff -BburN awt.1205/src/main/native/x11wrapper/unix/org_apache_harmony_awt_nativebridge_linux_X11.h awt/src/main/native/x11wrapper/unix/org_apache_harmony_awt_nativebridge_linux_X11.h --- awt.1205/src/main/native/x11wrapper/unix/org_apache_harmony_awt_nativebridge_linux_X11.h 2007-12-17 17:37:33.000000000 +0800 +++ awt/src/main/native/x11wrapper/unix/org_apache_harmony_awt_nativebridge_linux_X11.h 2007-12-18 09:56:52.000000000 +0800 @@ -197,6 +197,18 @@ JNIEXPORT void JNICALL Java_org_apache_harmony_awt_nativebridge_linux_X11_Xutf8SetWMProperties(JNIEnv *, jobject, jlong, jlong, jlong, jlong, jlong, jint, jlong, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_apache_harmony_awt_nativebridge_linux_X11_XOpenIM( JNIEnv *, jobject, jlong); + +JNIEXPORT jlong JNICALL Java_org_apache_harmony_awt_nativebridge_linux_X11_XCreateIC( JNIEnv *, jobject, jlong, jlong); + +JNIEXPORT jboolean JNICALL Java_org_apache_harmony_awt_nativebridge_linux_X11_XSupportLocale( JNIEnv *, jobject); + +JNIEXPORT jlong JNICALL Java_org_apache_harmony_awt_nativebridge_linux_X11_XSetICFocus( JNIEnv *, jobject, jlong); + +JNIEXPORT jlong JNICALL Java_org_apache_harmony_awt_nativebridge_linux_X11_XUnsetICFocus( JNIEnv *, jobject, jlong); + +JNIEXPORT jboolean JNICALL Java_org_apache_harmony_awt_nativebridge_linux_X11_XFilterEvent( JNIEnv *, jobject, jlong); + JNIEXPORT jlong JNICALL Java_org_apache_harmony_awt_nativebridge_linux_X11_XDefaultColormap(JNIEnv *, jobject, jlong, jint); JNIEXPORT jlong JNICALL Java_org_apache_harmony_awt_nativebridge_linux_X11_XAllocSizeHints(JNIEnv *, jobject); Binary files awt.1205/src/main/native/x11wrapper/unix/org_apache_harmony_awt_nativebridge_linux_X11.o and awt/src/main/native/x11wrapper/unix/org_apache_harmony_awt_nativebridge_linux_X11.o differ