< prev index next >

src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c

Print this page
rev 50172 : 8201429: Support AIX Input Method Editor (IME) for AWT Input Method Framework (IMF)

*** 1,7 **** /* ! * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 21,45 **** * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ ! #ifdef HEADLESS ! #error This file should not be included in headless library ! #endif #include <stdio.h> #include <stdlib.h> - #include <X11/Xlib.h> - #include <X11/keysym.h> #include <sys/time.h> ! #include "awt.h" ! #include "awt_p.h" ! ! #include <sun_awt_X11InputMethod.h> ! #include <sun_awt_X11_XInputMethod.h> #define THROW_OUT_OF_MEMORY_ERROR() \ JNU_ThrowOutOfMemoryError((JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2), NULL) struct X11InputMethodIDs { --- 21,45 ---- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ ! #include "awt.h" ! #include "awt_p.h" ! ! #include <sun_awt_X11InputMethodBase.h> ! #include <sun_awt_X11_XInputMethod.h> #include <stdio.h> #include <stdlib.h> #include <sys/time.h> + #include <X11/keysym.h> + #include <X11/Xlib.h> ! #ifdef HEADLESS ! #error This file should not be included in headless library ! #endif #define THROW_OUT_OF_MEMORY_ERROR() \ JNU_ThrowOutOfMemoryError((JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2), NULL) struct X11InputMethodIDs {
*** 534,547 **** } } composing = False; /*FALLTHRU*/ case XLookupChars: ! /* ! printf("lookupString: status=XLookupChars, type=%d, state=%x, keycode=%x, keysym=%x\n", ! event->type, event->state, event->keycode, keysym); ! */ javastr = JNU_NewStringPlatform(env, (const char *)pX11IMData->lookup_buf); if (javastr != NULL) { JNU_CallMethodByName(env, NULL, currentX11InputMethodInstance, "dispatchCommittedText", --- 534,547 ---- } } composing = False; /*FALLTHRU*/ case XLookupChars: ! /* ! printf("lookupString: status=XLookupChars, type=%d, state=%x, keycode=%x, keysym=%x\n", ! event->type, event->state, event->keycode, keysym); ! */ javastr = JNU_NewStringPlatform(env, (const char *)pX11IMData->lookup_buf); if (javastr != NULL) { JNU_CallMethodByName(env, NULL, currentX11InputMethodInstance, "dispatchCommittedText",
*** 550,585 **** event->time); } break; case XLookupKeySym: ! /* ! printf("lookupString: status=XLookupKeySym, type=%d, state=%x, keycode=%x, keysym=%x\n", ! event->type, event->state, event->keycode, keysym); ! */ if (keysym == XK_Multi_key) composing = True; if (! composing) { *keysymp = keysym; result = False; } break; case XLookupNone: ! /* ! printf("lookupString: status=XLookupNone, type=%d, state=%x, keycode=%x, keysym=%x\n", ! event->type, event->state, event->keycode, keysym); ! */ break; } return result; } #if defined(__linux__) || defined(MACOSX) ! static StatusWindow *createStatusWindow( ! Window parent) { StatusWindow *statusWindow; XSetWindowAttributes attrib; unsigned long attribmask; Window containerWindow; Window status; --- 550,584 ---- event->time); } break; case XLookupKeySym: ! /* ! printf("lookupString: status=XLookupKeySym, type=%d, state=%x, keycode=%x, keysym=%x\n", ! event->type, event->state, event->keycode, keysym); ! */ if (keysym == XK_Multi_key) composing = True; if (! composing) { *keysymp = keysym; result = False; } break; case XLookupNone: ! /* ! printf("lookupString: status=XLookupNone, type=%d, state=%x, keycode=%x, keysym=%x\n", ! event->type, event->state, event->keycode, keysym); ! */ break; } return result; } #if defined(__linux__) || defined(MACOSX) ! static StatusWindow *createStatusWindow(Window parent) { StatusWindow *statusWindow; XSetWindowAttributes attrib; unsigned long attribmask; Window containerWindow; Window status;
*** 598,608 **** int screen = 0; int i; AwtGraphicsConfigDataPtr adata; extern int awt_numScreens; /*hardcode the size right now, should get the size base on font*/ ! int width=80, height=22; Window rootWindow; Window *ignoreWindowPtr; unsigned int ignoreUnit; XGetGeometry(dpy, parent, &rootWindow, &x, &y, &w, &h, &bw, &depth); --- 597,607 ---- int screen = 0; int i; AwtGraphicsConfigDataPtr adata; extern int awt_numScreens; /*hardcode the size right now, should get the size base on font*/ ! int width=80, height=22; Window rootWindow; Window *ignoreWindowPtr; unsigned int ignoreUnit; XGetGeometry(dpy, parent, &rootWindow, &x, &y, &w, &h, &bw, &depth);
*** 650,663 **** xx = x - off_x; yy = y + xwa.height - off_y; if (xx < 0 ){ xx = 0; } ! if (xx + width > xxwa.width){ xx = xxwa.width - width; } ! if (yy + height > xxwa.height){ yy = xxwa.height - height; } status = XCreateWindow(dpy, xwa.root, --- 649,662 ---- xx = x - off_x; yy = y + xwa.height - off_y; if (xx < 0 ){ xx = 0; } ! if (xx + width > xxwa.width) { xx = xxwa.width - width; } ! if (yy + height > xxwa.height) { yy = xxwa.height - height; } status = XCreateWindow(dpy, xwa.root,
*** 722,763 **** NULL == pX11IMData || NULL == (statusWindow = pX11IMData->statusWindow)){ return; } ! if (ON == False){ XUnmapWindow(dpy, statusWindow->w); statusWindow->on = False; return; } parent = JNU_CallMethodByName(GetJNIEnv(), NULL, pX11IMData->x11inputmethod, "getCurrentParentWindow", "()J").j; ! if (statusWindow->parent != parent){ statusWindow->parent = parent; } XGetWindowAttributes(dpy, parent, &xwa); XTranslateCoordinates(dpy, parent, xwa.root, xwa.x, xwa.y, &x, &y, &child); ! if (statusWindow->x != x ! || statusWindow->y != y ! || statusWindow->height != xwa.height){ statusWindow->x = x; statusWindow->y = y; statusWindow->height = xwa.height; x = statusWindow->x - statusWindow->off_x; y = statusWindow->y + statusWindow->height - statusWindow->off_y; ! if (x < 0 ){ x = 0; } ! if (x + statusWindow->statusW > statusWindow->rootW){ x = statusWindow->rootW - statusWindow->statusW; } ! if (y + statusWindow->statusH > statusWindow->rootH){ y = statusWindow->rootH - statusWindow->statusH; } XMoveWindow(dpy, statusWindow->w, x, y); } statusWindow->on = True; --- 721,763 ---- NULL == pX11IMData || NULL == (statusWindow = pX11IMData->statusWindow)){ return; } ! if (ON == False) { XUnmapWindow(dpy, statusWindow->w); statusWindow->on = False; return; } parent = JNU_CallMethodByName(GetJNIEnv(), NULL, pX11IMData->x11inputmethod, "getCurrentParentWindow", "()J").j; ! if (statusWindow->parent != parent) { statusWindow->parent = parent; } XGetWindowAttributes(dpy, parent, &xwa); XTranslateCoordinates(dpy, parent, xwa.root, xwa.x, xwa.y, &x, &y, &child); ! if (statusWindow->x != x || ! statusWindow->y != y || ! statusWindow->height != xwa.height) ! { statusWindow->x = x; statusWindow->y = y; statusWindow->height = xwa.height; x = statusWindow->x - statusWindow->off_x; y = statusWindow->y + statusWindow->height - statusWindow->off_y; ! if (x < 0 ) { x = 0; } ! if (x + statusWindow->statusW > statusWindow->rootW) { x = statusWindow->rootW - statusWindow->statusW; } ! if (y + statusWindow->statusH > statusWindow->rootH) { y = statusWindow->rootH - statusWindow->statusH; } XMoveWindow(dpy, statusWindow->w, x, y); } statusWindow->on = True;
*** 788,863 **** XDrawLine(dpy, win, dimgc, 2, 2, 2, height-3); XDrawLine(dpy, win, dimgc, 2, height-3, width-bwidth-1, height-3); XDrawLine(dpy, win, dimgc, 2, 2, width-bwidth-2, 2); XDrawLine(dpy, win, dimgc, width-bwidth, 2, width-bwidth, height-3); ! if (statusWindow->fontset){ XmbDrawString(dpy, win, statusWindow->fontset, fggc, bwidth + 2, height - bwidth - 4, statusWindow->status, strlen(statusWindow->status)); ! } ! else{ /*too bad we failed to create a fontset for this locale*/ XDrawString(dpy, win, fggc, bwidth + 2, height - bwidth - 4, "[InputMethod ON]", strlen("[InputMethod ON]")); } } ! void statusWindowEventHandler(XEvent event){ ! JNIEnv *env = GetJNIEnv(); ! X11InputMethodData *pX11IMData = NULL; ! StatusWindow *statusWindow; ! ! if (!isX11InputMethodGRefInList(currentX11InputMethodInstance)) { ! currentX11InputMethodInstance = NULL; ! return; ! } ! ! if (NULL == currentX11InputMethodInstance ! || NULL == (pX11IMData = getX11InputMethodData(env, currentX11InputMethodInstance)) ! || NULL == (statusWindow = pX11IMData->statusWindow) ! || statusWindow->w != event.xany.window){ ! return; ! } ! ! switch (event.type){ ! case Expose: ! paintStatusWindow(statusWindow); ! break; ! case MapNotify: ! case ConfigureNotify: ! { ! /*need to reset the stackMode...*/ ! XWindowChanges xwc; ! int value_make = CWStackMode; ! xwc.stack_mode = TopIf; ! XConfigureWindow(dpy, statusWindow->w, value_make, &xwc); ! } ! break; ! /* ! case UnmapNotify: ! case VisibilityNotify: ! break; ! */ ! default: ! break; ! } ! } ! ! static void adjustStatusWindow(Window shell){ JNIEnv *env = GetJNIEnv(); X11InputMethodData *pX11IMData = NULL; StatusWindow *statusWindow; if (NULL == currentX11InputMethodInstance || !isX11InputMethodGRefInList(currentX11InputMethodInstance) || NULL == (pX11IMData = getX11InputMethodData(env,currentX11InputMethodInstance)) || NULL == (statusWindow = pX11IMData->statusWindow) ! || !statusWindow->on) { return; } { XWindowAttributes xwa; int x, y; Window child; XGetWindowAttributes(dpy, shell, &xwa); --- 788,823 ---- XDrawLine(dpy, win, dimgc, 2, 2, 2, height-3); XDrawLine(dpy, win, dimgc, 2, height-3, width-bwidth-1, height-3); XDrawLine(dpy, win, dimgc, 2, 2, width-bwidth-2, 2); XDrawLine(dpy, win, dimgc, width-bwidth, 2, width-bwidth, height-3); ! if (statusWindow->fontset) { XmbDrawString(dpy, win, statusWindow->fontset, fggc, bwidth + 2, height - bwidth - 4, statusWindow->status, strlen(statusWindow->status)); ! } else { /*too bad we failed to create a fontset for this locale*/ XDrawString(dpy, win, fggc, bwidth + 2, height - bwidth - 4, "[InputMethod ON]", strlen("[InputMethod ON]")); } } ! static void adjustStatusWindow(Window shell) { JNIEnv *env = GetJNIEnv(); X11InputMethodData *pX11IMData = NULL; StatusWindow *statusWindow; if (NULL == currentX11InputMethodInstance || !isX11InputMethodGRefInList(currentX11InputMethodInstance) || NULL == (pX11IMData = getX11InputMethodData(env,currentX11InputMethodInstance)) || NULL == (statusWindow = pX11IMData->statusWindow) ! || !statusWindow->on) ! { return; } + { XWindowAttributes xwa; int x, y; Window child; XGetWindowAttributes(dpy, shell, &xwa);
*** 873,883 **** statusWindow->y = y; statusWindow->height = xwa.height; x = statusWindow->x - statusWindow->off_x; y = statusWindow->y + statusWindow->height - statusWindow->off_y; ! if (x < 0 ){ x = 0; } if (x + statusWindow->statusW > statusWindow->rootW){ x = statusWindow->rootW - statusWindow->statusW; } --- 833,843 ---- statusWindow->y = y; statusWindow->height = xwa.height; x = statusWindow->x - statusWindow->off_x; y = statusWindow->y + statusWindow->height - statusWindow->off_y; ! if (x < 0 ) { x = 0; } if (x + statusWindow->statusW > statusWindow->rootW){ x = statusWindow->rootW - statusWindow->statusW; }
*** 887,896 **** --- 847,857 ---- XMoveWindow(dpy, statusWindow->w, x, y); } } } #endif /* __linux__ || MACOSX */ + /* * Creates two XICs, one for active clients and the other for passive * clients. All information on those XICs are stored in the * X11InputMethodData given by the pX11IMData parameter. *
*** 929,953 **** if (ret != NULL) { jio_fprintf(stderr,"XGetIMValues: %s\n",ret); return FALSE ; } - #if defined(__linux__) || defined(MACOSX) on_the_spot_styles |= XIMStatusNothing; /*kinput does not support XIMPreeditCallbacks and XIMStatusArea at the same time, so use StatusCallback to draw the status ourself */ for (i = 0; i < im_styles->count_styles; i++) { if (im_styles->supported_styles[i] == (XIMPreeditCallbacks | XIMStatusCallbacks)) { on_the_spot_styles = (XIMPreeditCallbacks | XIMStatusCallbacks); break; } } - #else /*! __linux__ && !MACOSX */ - on_the_spot_styles |= XIMStatusNothing; #endif /* __linux__ || MACOSX */ for (i = 0; i < im_styles->count_styles; i++) { active_styles |= im_styles->supported_styles[i] & on_the_spot_styles; passive_styles |= im_styles->supported_styles[i] & ROOT_WINDOW_STYLES; --- 890,912 ---- if (ret != NULL) { jio_fprintf(stderr,"XGetIMValues: %s\n",ret); return FALSE ; } on_the_spot_styles |= XIMStatusNothing; + #if defined(__linux__) || defined(MACOSX) /*kinput does not support XIMPreeditCallbacks and XIMStatusArea at the same time, so use StatusCallback to draw the status ourself */ for (i = 0; i < im_styles->count_styles; i++) { if (im_styles->supported_styles[i] == (XIMPreeditCallbacks | XIMStatusCallbacks)) { on_the_spot_styles = (XIMPreeditCallbacks | XIMStatusCallbacks); break; } } #endif /* __linux__ || MACOSX */ for (i = 0; i < im_styles->count_styles; i++) { active_styles |= im_styles->supported_styles[i] & on_the_spot_styles; passive_styles |= im_styles->supported_styles[i] & ROOT_WINDOW_STYLES;
*** 1021,1036 **** NULL); XFree((void *)status); XFree((void *)preedit); } #else /* !__linux__ && !MACOSX */ ! pX11IMData->ic_active = XCreateIC(X11im, ! XNClientWindow, w, ! XNFocusWindow, w, ! XNInputStyle, active_styles, ! XNPreeditAttributes, preedit, ! NULL); XFree((void *)preedit); #endif /* __linux__ || MACOSX */ } else { pX11IMData->ic_active = XCreateIC(X11im, XNClientWindow, w, --- 980,995 ---- NULL); XFree((void *)status); XFree((void *)preedit); } #else /* !__linux__ && !MACOSX */ ! pX11IMData->ic_active = XCreateIC(X11im, ! XNClientWindow, w, ! XNFocusWindow, w, ! XNInputStyle, active_styles, ! XNPreeditAttributes, preedit, ! NULL); XFree((void *)preedit); #endif /* __linux__ || MACOSX */ } else { pX11IMData->ic_active = XCreateIC(X11im, XNClientWindow, w,
*** 1073,1090 **** static void PreeditStartCallback(XIC ic, XPointer client_data, XPointer call_data) { /*ARGSUSED*/ ! /* printf("Native: PreeditCaretCallback\n"); */ } static void PreeditDoneCallback(XIC ic, XPointer client_data, XPointer call_data) { /*ARGSUSED*/ ! /* printf("Native: StatusStartCallback\n"); */ } /* * Translate the preedit draw callback items to Java values and invoke * X11InputMethod.dispatchComposedText(). --- 1032,1049 ---- static void PreeditStartCallback(XIC ic, XPointer client_data, XPointer call_data) { /*ARGSUSED*/ ! /* printf("Native: PreeditStartCallback\n"); */ } static void PreeditDoneCallback(XIC ic, XPointer client_data, XPointer call_data) { /*ARGSUSED*/ ! /* printf("Native: PreeditDoneCallback\n"); */ } /* * Translate the preedit draw callback items to Java values and invoke * X11InputMethod.dispatchComposedText().
*** 1185,1212 **** PreeditCaretCallback(XIC ic, XPointer client_data, XIMPreeditCaretCallbackStruct *pre_caret) { /*ARGSUSED*/ /* printf("Native: PreeditCaretCallback\n"); */ - } #if defined(__linux__) || defined(MACOSX) static void StatusStartCallback(XIC ic, XPointer client_data, XPointer call_data) { /*ARGSUSED*/ /*printf("StatusStartCallback:\n"); */ - } static void StatusDoneCallback(XIC ic, XPointer client_data, XPointer call_data) { /*ARGSUSED*/ /*printf("StatusDoneCallback:\n"); */ - } static void StatusDrawCallback(XIC ic, XPointer client_data, XIMStatusDrawCallbackStruct *status_draw) --- 1144,1168 ----
*** 1228,1256 **** if (NULL == (pX11IMData = getX11InputMethodData(env, (jobject)client_data)) || NULL == (statusWindow = pX11IMData->statusWindow)){ goto finally; } ! currentX11InputMethodInstance = (jobject)client_data; ! if (status_draw->type == XIMTextType){ XIMText *text = (status_draw->data).text; ! if (text != NULL){ ! if (text->string.multi_byte != NULL) { ! strncpy(statusWindow->status, text->string.multi_byte, MAX_STATUS_LEN); ! statusWindow->status[MAX_STATUS_LEN - 1] = '\0'; ! } ! else { ! char *mbstr = wcstombsdmp(text->string.wide_char, text->length); ! strncpy(statusWindow->status, mbstr, MAX_STATUS_LEN); ! statusWindow->status[MAX_STATUS_LEN - 1] = '\0'; ! } ! statusWindow->on = True; ! onoffStatusWindow(pX11IMData, statusWindow->parent, True); ! paintStatusWindow(statusWindow); ! } ! else { statusWindow->on = False; /*just turnoff the status window paintStatusWindow(statusWindow); */ onoffStatusWindow(pX11IMData, 0, False); --- 1184,1210 ---- if (NULL == (pX11IMData = getX11InputMethodData(env, (jobject)client_data)) || NULL == (statusWindow = pX11IMData->statusWindow)){ goto finally; } ! currentX11InputMethodInstance = (jobject)client_data; ! if (status_draw->type == XIMTextType) { XIMText *text = (status_draw->data).text; ! if (text != NULL) { ! if (text->string.multi_byte != NULL) { ! strncpy(statusWindow->status, text->string.multi_byte, MAX_STATUS_LEN); ! statusWindow->status[MAX_STATUS_LEN - 1] = '\0'; ! } else { ! char *mbstr = wcstombsdmp(text->string.wide_char, text->length); ! strncpy(statusWindow->status, mbstr, MAX_STATUS_LEN); ! statusWindow->status[MAX_STATUS_LEN - 1] = '\0'; ! } ! statusWindow->on = True; ! onoffStatusWindow(pX11IMData, statusWindow->parent, True); ! paintStatusWindow(statusWindow); ! } else { statusWindow->on = False; /*just turnoff the status window paintStatusWindow(statusWindow); */ onoffStatusWindow(pX11IMData, 0, False);
*** 1325,1354 **** /* free the old pX11IMData and set it to null. this also avoids crashing * the jvm if the XIM server reappears */ X11InputMethodData *pX11IMData = getX11InputMethodData(env, currentX11InputMethodInstance); } - /* - * Class: sun_awt_X11InputMethod - * Method: initIDs - * Signature: ()V - */ - - /* This function gets called from the static initializer for - X11InputMethod.java - to initialize the fieldIDs for fields that may be accessed from C */ - JNIEXPORT void JNICALL - Java_sun_awt_X11InputMethod_initIDs(JNIEnv *env, jclass cls) - { - x11InputMethodIDs.pData = (*env)->GetFieldID(env, cls, "pData", "J"); - } - - JNIEXPORT jboolean JNICALL Java_sun_awt_X11_XInputMethod_openXIMNative(JNIEnv *env, ! jobject this, ! jlong display) { Bool registered; AWT_LOCK(); --- 1279,1292 ---- /* free the old pX11IMData and set it to null. this also avoids crashing * the jvm if the XIM server reappears */ X11InputMethodData *pX11IMData = getX11InputMethodData(env, currentX11InputMethodInstance); } JNIEXPORT jboolean JNICALL Java_sun_awt_X11_XInputMethod_openXIMNative(JNIEnv *env, ! jobject this, ! jlong display) { Bool registered; AWT_LOCK();
*** 1373,1384 **** return JNI_TRUE; } JNIEXPORT jboolean JNICALL Java_sun_awt_X11_XInputMethod_createXICNative(JNIEnv *env, ! jobject this, ! jlong window) { X11InputMethodData *pX11IMData; jobject globalRef; XIC ic; --- 1311,1322 ---- return JNI_TRUE; } JNIEXPORT jboolean JNICALL Java_sun_awt_X11_XInputMethod_createXICNative(JNIEnv *env, ! jobject this, ! jlong window) { X11InputMethodData *pX11IMData; jobject globalRef; XIC ic;
*** 1421,1434 **** return (pX11IMData != NULL); } JNIEXPORT void JNICALL Java_sun_awt_X11_XInputMethod_setXICFocusNative(JNIEnv *env, ! jobject this, ! jlong w, ! jboolean req, ! jboolean active) { X11InputMethodData *pX11IMData; AWT_LOCK(); pX11IMData = getX11InputMethodData(env, this); if (pX11IMData == NULL) { --- 1359,1372 ---- return (pX11IMData != NULL); } JNIEXPORT void JNICALL Java_sun_awt_X11_XInputMethod_setXICFocusNative(JNIEnv *env, ! jobject this, ! jlong w, ! jboolean req, ! jboolean active) { X11InputMethodData *pX11IMData; AWT_LOCK(); pX11IMData = getX11InputMethodData(env, this); if (pX11IMData == NULL) {
*** 1469,1481 **** XFlush(dpy); AWT_UNLOCK(); } ! JNIEXPORT void JNICALL ! Java_sun_awt_X11InputMethod_turnoffStatusWindow(JNIEnv *env, ! jobject this) { #if defined(__linux__) || defined(MACOSX) X11InputMethodData *pX11IMData; StatusWindow *statusWindow; --- 1407,1437 ---- XFlush(dpy); AWT_UNLOCK(); } ! /* ! * Class: sun_awt_X11InputMethodBase ! * Method: initIDs ! * Signature: ()V ! * This function gets called from the static initializer for ! * X11InputMethod.java to initialize the fieldIDs for fields ! * that may be accessed from C ! */ ! JNIEXPORT void JNICALL Java_sun_awt_X11InputMethodBase_initIDs ! (JNIEnv *env, jclass cls) ! { ! x11InputMethodIDs.pData = (*env)->GetFieldID(env, cls, "pData", "J"); ! } ! ! /* ! * Class: sun_awt_X11InputMethodBase ! * Method: turnoffStatusWindow ! * Signature: ()V ! */ ! JNIEXPORT void JNICALL Java_sun_awt_X11InputMethodBase_turnoffStatusWindow ! (JNIEnv *env, jobject this) { #if defined(__linux__) || defined(MACOSX) X11InputMethodData *pX11IMData; StatusWindow *statusWindow;
*** 1493,1505 **** AWT_UNLOCK(); #endif } ! JNIEXPORT void JNICALL ! Java_sun_awt_X11InputMethod_disposeXIC(JNIEnv *env, ! jobject this) { X11InputMethodData *pX11IMData = NULL; AWT_LOCK(); pX11IMData = getX11InputMethodData(env, this); --- 1449,1465 ---- AWT_UNLOCK(); #endif } ! /* ! * Class: sun_awt_X11InputMethodBase ! * Method: disposeXIC ! * Signature: ()V ! */ ! JNIEXPORT void JNICALL Java_sun_awt_X11InputMethodBase_disposeXIC ! (JNIEnv *env, jobject this) { X11InputMethodData *pX11IMData = NULL; AWT_LOCK(); pX11IMData = getX11InputMethodData(env, this);
*** 1516,1528 **** } destroyX11InputMethodData(env, pX11IMData); AWT_UNLOCK(); } ! JNIEXPORT jstring JNICALL ! Java_sun_awt_X11InputMethod_resetXIC(JNIEnv *env, ! jobject this) { X11InputMethodData *pX11IMData; char *xText = NULL; jstring jText = (jstring)0; --- 1476,1492 ---- } destroyX11InputMethodData(env, pX11IMData); AWT_UNLOCK(); } ! /* ! * Class: sun_awt_X11InputMethodBase ! * Method: resetXIC ! * Signature: ()Ljava/lang/String; ! */ ! JNIEXPORT jstring JNICALL Java_sun_awt_X11InputMethodBase_resetXIC ! (JNIEnv *env, jobject this) { X11InputMethodData *pX11IMData; char *xText = NULL; jstring jText = (jstring)0;
*** 1562,1585 **** AWT_UNLOCK(); return jText; } /* ! * Class: sun_awt_X11InputMethod * Method: setCompositionEnabledNative ! * Signature: (ZJ)V * * This method tries to set the XNPreeditState attribute associated with the current * XIC to the passed in 'enable' state. * * Return JNI_TRUE if XNPreeditState attribute is successfully changed to the * 'enable' state; Otherwise, if XSetICValues fails to set this attribute, * java.lang.UnsupportedOperationException will be thrown. JNI_FALSE is returned if this * method fails due to other reasons. - * */ ! JNIEXPORT jboolean JNICALL Java_sun_awt_X11InputMethod_setCompositionEnabledNative (JNIEnv *env, jobject this, jboolean enable) { X11InputMethodData *pX11IMData; char * ret = NULL; --- 1526,1548 ---- AWT_UNLOCK(); return jText; } /* ! * Class: sun_awt_X11InputMethodBase * Method: setCompositionEnabledNative ! * Signature: (Z)Z * * This method tries to set the XNPreeditState attribute associated with the current * XIC to the passed in 'enable' state. * * Return JNI_TRUE if XNPreeditState attribute is successfully changed to the * 'enable' state; Otherwise, if XSetICValues fails to set this attribute, * java.lang.UnsupportedOperationException will be thrown. JNI_FALSE is returned if this * method fails due to other reasons. */ ! JNIEXPORT jboolean JNICALL Java_sun_awt_X11InputMethodBase_setCompositionEnabledNative (JNIEnv *env, jobject this, jboolean enable) { X11InputMethodData *pX11IMData; char * ret = NULL;
*** 1601,1622 **** return (jboolean)(ret == 0); } /* ! * Class: sun_awt_X11InputMethod * Method: isCompositionEnabledNative ! * Signature: (J)Z * * This method tries to get the XNPreeditState attribute associated with the current XIC. * * Return JNI_TRUE if the XNPreeditState is successfully retrieved. Otherwise, if * XGetICValues fails to get this attribute, java.lang.UnsupportedOperationException * will be thrown. JNI_FALSE is returned if this method fails due to other reasons. - * */ ! JNIEXPORT jboolean JNICALL Java_sun_awt_X11InputMethod_isCompositionEnabledNative (JNIEnv *env, jobject this) { X11InputMethodData *pX11IMData = NULL; char * ret = NULL; XIMPreeditState state; --- 1564,1584 ---- return (jboolean)(ret == 0); } /* ! * Class: sun_awt_X11InputMethodBase * Method: isCompositionEnabledNative ! * Signature: ()Z * * This method tries to get the XNPreeditState attribute associated with the current XIC. * * Return JNI_TRUE if the XNPreeditState is successfully retrieved. Otherwise, if * XGetICValues fails to get this attribute, java.lang.UnsupportedOperationException * will be thrown. JNI_FALSE is returned if this method fails due to other reasons. */ ! JNIEXPORT jboolean JNICALL Java_sun_awt_X11InputMethodBase_isCompositionEnabledNative (JNIEnv *env, jobject this) { X11InputMethodData *pX11IMData = NULL; char * ret = NULL; XIMPreeditState state;
< prev index next >