< prev index next >

jdk/src/java.desktop/windows/native/libawt/windows/awt_List.cpp

Print this page




 807  * WListPeer native methods
 808  *
 809  * This class seems to have numerous bugs in it, but they are all bugs
 810  * which were present before conversion to JNI. -br.
 811  */
 812 
 813 extern "C" {
 814 
 815 /*
 816  * Class:     sun_awt_windows_WListPeer
 817  * Method:    getMaxWidth
 818  * Signature: ()I
 819  */
 820 JNIEXPORT jint JNICALL
 821 Java_sun_awt_windows_WListPeer_getMaxWidth(JNIEnv *env, jobject self)
 822 {
 823     TRY;
 824 
 825     jobject selfGlobalRef = env->NewGlobalRef(self);
 826 
 827     return (jint)AwtToolkit::GetInstance().SyncCall(
 828         (void *(*)(void *))AwtList::_GetMaxWidth,
 829         (void *)selfGlobalRef);
 830     // selfGlobalRef is deleted in _GetMaxWidth
 831 
 832     CATCH_BAD_ALLOC_RET(0);
 833 }
 834 
 835 /*
 836  * Class:     sun_awt_windows_WListPeer
 837  * Method:    updateMaxItemWidth
 838  * Signature: ()V
 839  */
 840 JNIEXPORT void JNICALL
 841 Java_sun_awt_windows_WListPeer_updateMaxItemWidth(JNIEnv *env, jobject self)
 842 {
 843     TRY;
 844 
 845     jobject selfGlobalRef = env->NewGlobalRef(self);
 846 
 847     AwtToolkit::GetInstance().SyncCall(AwtList::_UpdateMaxItemWidth,


1001     JNI_CHECK_PEER_CREATION_RETURN(self);
1002 
1003     CATCH_BAD_ALLOC;
1004 }
1005 
1006 /*
1007  * Class:     sun_awt_windows_WListPeer
1008  * Method:    isSelected
1009  * Signature: (I)Z
1010  */
1011 JNIEXPORT jboolean JNICALL
1012 Java_sun_awt_windows_WListPeer_isSelected(JNIEnv *env, jobject self,
1013                                           jint index)
1014 {
1015     TRY;
1016 
1017     SelectElementStruct *ses = new SelectElementStruct;
1018     ses->list = env->NewGlobalRef(self);
1019     ses->index = index;
1020 
1021     return (jboolean)AwtToolkit::GetInstance().SyncCall(
1022         (void *(*)(void *))AwtList::_IsSelected, ses);
1023     // global ref and ses are deleted in _IsSelected
1024 
1025     CATCH_BAD_ALLOC_RET(FALSE);
1026 }
1027 
1028 } /* extern "C" */


 807  * WListPeer native methods
 808  *
 809  * This class seems to have numerous bugs in it, but they are all bugs
 810  * which were present before conversion to JNI. -br.
 811  */
 812 
 813 extern "C" {
 814 
 815 /*
 816  * Class:     sun_awt_windows_WListPeer
 817  * Method:    getMaxWidth
 818  * Signature: ()I
 819  */
 820 JNIEXPORT jint JNICALL
 821 Java_sun_awt_windows_WListPeer_getMaxWidth(JNIEnv *env, jobject self)
 822 {
 823     TRY;
 824 
 825     jobject selfGlobalRef = env->NewGlobalRef(self);
 826 
 827     return (jint)(uintptr_t)AwtToolkit::GetInstance().SyncCall(
 828         (void *(*)(void *))AwtList::_GetMaxWidth,
 829         (void *)selfGlobalRef);
 830     // selfGlobalRef is deleted in _GetMaxWidth
 831 
 832     CATCH_BAD_ALLOC_RET(0);
 833 }
 834 
 835 /*
 836  * Class:     sun_awt_windows_WListPeer
 837  * Method:    updateMaxItemWidth
 838  * Signature: ()V
 839  */
 840 JNIEXPORT void JNICALL
 841 Java_sun_awt_windows_WListPeer_updateMaxItemWidth(JNIEnv *env, jobject self)
 842 {
 843     TRY;
 844 
 845     jobject selfGlobalRef = env->NewGlobalRef(self);
 846 
 847     AwtToolkit::GetInstance().SyncCall(AwtList::_UpdateMaxItemWidth,


1001     JNI_CHECK_PEER_CREATION_RETURN(self);
1002 
1003     CATCH_BAD_ALLOC;
1004 }
1005 
1006 /*
1007  * Class:     sun_awt_windows_WListPeer
1008  * Method:    isSelected
1009  * Signature: (I)Z
1010  */
1011 JNIEXPORT jboolean JNICALL
1012 Java_sun_awt_windows_WListPeer_isSelected(JNIEnv *env, jobject self,
1013                                           jint index)
1014 {
1015     TRY;
1016 
1017     SelectElementStruct *ses = new SelectElementStruct;
1018     ses->list = env->NewGlobalRef(self);
1019     ses->index = index;
1020 
1021     return (jboolean)(AwtToolkit::GetInstance().SyncCall(
1022         (void *(*)(void *))AwtList::_IsSelected, ses) != NULL);
1023     // global ref and ses are deleted in _IsSelected
1024 
1025     CATCH_BAD_ALLOC_RET(FALSE);
1026 }
1027 
1028 } /* extern "C" */
< prev index next >