jint AwtScrollPane::_GetOffset(void *param) { JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); GetOffsetStruct *gos = (GetOffsetStruct *)param; jobject self = gos->scrollpane; jint orient = gos->orient; jint result = 0; AwtScrollPane *s = NULL; PDATA pData; JNI_CHECK_PEER_GOTO(self, ret); s = (AwtScrollPane *)pData; if (::IsWindow(s->GetHWnd())) { DTRACE_PRINTLN2("%x: WScrollPanePeer.getOffset(%d)", self, orient); s->VerifyState(); int nBar = (orient == java_awt_Adjustable_HORIZONTAL) ? SB_HORZ : SB_VERT; result = s->GetScrollPos(nBar); } ret: env->DeleteGlobalRef(self); delete gos; return result; }
/* * Class: sun_awt_windows_WScrollPanePeer * Method: getOffset * Signature: (I)I */ JNIEXPORT jint JNICALL Java_sun_awt_windows_WScrollPanePeer_getOffset(JNIEnv *env, jobject self, jint orient) { TRY; DTRACE_PRINTLN2("%x: WScrollPanePeer.getOffset(%d)", self, orient); PDATA pData; JNI_CHECK_PEER_RETURN_NULL(self); AwtScrollPane* pane = (AwtScrollPane *)pData; pane->VerifyState(); int nBar = (orient == java_awt_Adjustable_HORIZONTAL) ? SB_HORZ : SB_VERT; return pane->GetScrollPos(nBar); CATCH_BAD_ALLOC_RET(0); }