1456 finally: 1457 AWT_UNLOCK(); 1458 } 1459 1460 static void OpenXIMCallback(Display *display, XPointer client_data, XPointer call_data) { 1461 XIMCallback ximCallback; 1462 1463 X11im = XOpenIM(display, NULL, NULL, NULL); 1464 if (X11im == NULL) { 1465 return; 1466 } 1467 1468 ximCallback.callback = (XIMProc)DestroyXIMCallback; 1469 ximCallback.client_data = NULL; 1470 XSetIMValues(X11im, XNDestroyCallback, &ximCallback, NULL); 1471 } 1472 1473 static void DestroyXIMCallback(XIM im, XPointer client_data, XPointer call_data) { 1474 /* mark that XIM server was destroyed */ 1475 X11im = NULL; 1476 } 1477 1478 /* 1479 * Class: java_sun_awt_motif_X11InputMethod 1480 * Method: initIDs 1481 * Signature: ()V 1482 */ 1483 1484 /* This function gets called from the static initializer for 1485 X11InputMethod.java 1486 to initialize the fieldIDs for fields that may be accessed from C */ 1487 JNIEXPORT void JNICALL 1488 Java_sun_awt_X11InputMethod_initIDs(JNIEnv *env, jclass cls) 1489 { 1490 x11InputMethodIDs.pData = (*env)->GetFieldID(env, cls, "pData", "J"); 1491 } 1492 1493 1494 JNIEXPORT jboolean JNICALL 1495 #ifdef XAWT | 1456 finally: 1457 AWT_UNLOCK(); 1458 } 1459 1460 static void OpenXIMCallback(Display *display, XPointer client_data, XPointer call_data) { 1461 XIMCallback ximCallback; 1462 1463 X11im = XOpenIM(display, NULL, NULL, NULL); 1464 if (X11im == NULL) { 1465 return; 1466 } 1467 1468 ximCallback.callback = (XIMProc)DestroyXIMCallback; 1469 ximCallback.client_data = NULL; 1470 XSetIMValues(X11im, XNDestroyCallback, &ximCallback, NULL); 1471 } 1472 1473 static void DestroyXIMCallback(XIM im, XPointer client_data, XPointer call_data) { 1474 /* mark that XIM server was destroyed */ 1475 X11im = NULL; 1476 JNIEnv* env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); 1477 /* free the old pX11IMData and set it to null. this also avoids crashing 1478 * the jvm if the XIM server reappears */ 1479 X11InputMethodData *pX11IMData = getX11InputMethodData(env, currentX11InputMethodInstance); 1480 } 1481 1482 /* 1483 * Class: java_sun_awt_motif_X11InputMethod 1484 * Method: initIDs 1485 * Signature: ()V 1486 */ 1487 1488 /* This function gets called from the static initializer for 1489 X11InputMethod.java 1490 to initialize the fieldIDs for fields that may be accessed from C */ 1491 JNIEXPORT void JNICALL 1492 Java_sun_awt_X11InputMethod_initIDs(JNIEnv *env, jclass cls) 1493 { 1494 x11InputMethodIDs.pData = (*env)->GetFieldID(env, cls, "pData", "J"); 1495 } 1496 1497 1498 JNIEXPORT jboolean JNICALL 1499 #ifdef XAWT |