1662
1663 return (jboolean)(ret == 0);
1664 }
1665
1666 /*
1667 * Class: sun_awt_X11InputMethodBase
1668 * Method: isCompositionEnabledNative
1669 * Signature: ()Z
1670 *
1671 * This method tries to get the XNPreeditState attribute associated with the current XIC.
1672 *
1673 * Return JNI_TRUE if the XNPreeditState is successfully retrieved. Otherwise, if
1674 * XGetICValues fails to get this attribute, java.lang.UnsupportedOperationException
1675 * will be thrown. JNI_FALSE is returned if this method fails due to other reasons.
1676 */
1677 JNIEXPORT jboolean JNICALL Java_sun_awt_X11InputMethodBase_isCompositionEnabledNative
1678 (JNIEnv *env, jobject this)
1679 {
1680 X11InputMethodData *pX11IMData = NULL;
1681 char * ret = NULL;
1682 #if defined(_LP64) && !defined(_LITTLE_ENDIAN)
1683 // XIMPreeditState value which is used for XGetICValues must be 32bit on BigEndian XOrg's xlib
1684 unsigned int state = XIMPreeditUnKnown;
1685 #else
1686 XIMPreeditState state = XIMPreeditUnKnown;
1687 #endif
1688
1689 XVaNestedList pr_atrb;
1690
1691 AWT_LOCK();
1692 pX11IMData = getX11InputMethodData(env, this);
1693
1694 if ((pX11IMData == NULL) || (pX11IMData->current_ic == NULL)) {
1695 AWT_UNLOCK();
1696 return JNI_FALSE;
1697 }
1698
1699 pr_atrb = XVaCreateNestedList(0, XNPreeditState, &state, NULL);
1700 ret = XGetICValues(pX11IMData->current_ic, XNPreeditAttributes, pr_atrb, NULL);
1701 XFree((void *)pr_atrb);
1702 AWT_UNLOCK();
|
1662
1663 return (jboolean)(ret == 0);
1664 }
1665
1666 /*
1667 * Class: sun_awt_X11InputMethodBase
1668 * Method: isCompositionEnabledNative
1669 * Signature: ()Z
1670 *
1671 * This method tries to get the XNPreeditState attribute associated with the current XIC.
1672 *
1673 * Return JNI_TRUE if the XNPreeditState is successfully retrieved. Otherwise, if
1674 * XGetICValues fails to get this attribute, java.lang.UnsupportedOperationException
1675 * will be thrown. JNI_FALSE is returned if this method fails due to other reasons.
1676 */
1677 JNIEXPORT jboolean JNICALL Java_sun_awt_X11InputMethodBase_isCompositionEnabledNative
1678 (JNIEnv *env, jobject this)
1679 {
1680 X11InputMethodData *pX11IMData = NULL;
1681 char * ret = NULL;
1682 #if defined(__linux__) && defined(_LP64) && !defined(_LITTLE_ENDIAN)
1683 // XIMPreeditState value which is used for XGetICValues must be 32bit on BigEndian XOrg's xlib
1684 unsigned int state = XIMPreeditUnKnown;
1685 #else
1686 XIMPreeditState state = XIMPreeditUnKnown;
1687 #endif
1688
1689 XVaNestedList pr_atrb;
1690
1691 AWT_LOCK();
1692 pX11IMData = getX11InputMethodData(env, this);
1693
1694 if ((pX11IMData == NULL) || (pX11IMData->current_ic == NULL)) {
1695 AWT_UNLOCK();
1696 return JNI_FALSE;
1697 }
1698
1699 pr_atrb = XVaCreateNestedList(0, XNPreeditState, &state, NULL);
1700 ret = XGetICValues(pX11IMData->current_ic, XNPreeditAttributes, pr_atrb, NULL);
1701 XFree((void *)pr_atrb);
1702 AWT_UNLOCK();
|