< prev index next >

modules/javafx.web/src/main/native/Source/WebCore/platform/java/ScrollbarThemeJava.cpp

Print this page
rev 10218 : 8132675: VBox.setVgrow and HBox.setHgrow corrupt following controls when window resized
rev 10208 : 8166999: Update to newer version of WebKit
Summary: Merge with WebKit trunk r197500
Reviewed-by: ghb, arajkumar, asrivastava
Contributed-by: a.ankit.srivastava@oracle.com, arunprasad.rajkumar@oracle.com, guru.hb@oracle.com, murali.billa@oracle.com
rev 10087 : 8164177: Update copyright header for files modified in 2016
Reviewed-by: ckyang
rev 9951 : 8161705: Rename directories under modules to exactly match the module names
Reviewed-by: kcr, vadim

*** 68,77 **** --- 68,78 ---- { // platformContext() returns 0 when printing if (gc.paintingDisabled() || !gc.platformContext()) { return true; } + JLObject jtheme = getJScrollBarTheme(scrollbar); if (!jtheme) { return false; } JNIEnv* env = WebCore_GetJavaEnv();
*** 108,139 **** return false; } ScrollbarPart ScrollbarThemeJava::hitTest(Scrollbar& scrollbar, const IntPoint& pos) { JLObject jtheme = getJScrollBarTheme(scrollbar); if (!jtheme) { return (ScrollbarPart)0; } JNIEnv* env = WebCore_GetJavaEnv(); static jmethodID mid = env->GetMethodID( getJScrollBarThemeClass(), "hitTest", ! "(IIIIIIII)I"); ASSERT(mid); IntPoint p = scrollbar.convertFromContainingWindow(pos); int part = env->CallIntMethod( jtheme, mid, ! (jint)scrollbar.width(), ! (jint)scrollbar.height(), ! (jint)scrollbar.orientation(), ! (jint)scrollbar.value(), ! (jint)scrollbar.visibleSize(), ! (jint)scrollbar.totalSize(), (jint)p.x(), (jint)p.y()); CheckAndClearException(env); return (ScrollbarPart)part; --- 109,139 ---- return false; } ScrollbarPart ScrollbarThemeJava::hitTest(Scrollbar& scrollbar, const IntPoint& pos) { + if (!scrollbar.enabled()) { + return (ScrollbarPart)0; + } + JLObject jtheme = getJScrollBarTheme(scrollbar); if (!jtheme) { return (ScrollbarPart)0; } JNIEnv* env = WebCore_GetJavaEnv(); static jmethodID mid = env->GetMethodID( getJScrollBarThemeClass(), "hitTest", ! "(JII)I"); ASSERT(mid); IntPoint p = scrollbar.convertFromContainingWindow(pos); int part = env->CallIntMethod( jtheme, mid, ! ptr_to_jlong(&scrollbar), (jint)p.x(), (jint)p.y()); CheckAndClearException(env); return (ScrollbarPart)part;
*** 145,253 **** scrollbar.invalidate(); } int ScrollbarThemeJava::thumbPosition(Scrollbar& scrollbar) { JLObject jtheme = getJScrollBarTheme(scrollbar); if (!jtheme) { return 0; } JNIEnv* env = WebCore_GetJavaEnv(); static jmethodID mid = env->GetMethodID( getJScrollBarThemeClass(), "getThumbPosition", ! "(IIIIII)I"); ASSERT(mid); int pos = env->CallIntMethod( jtheme, mid, ! (jint)scrollbar.width(), ! (jint)scrollbar.height(), ! (jint)scrollbar.orientation(), ! (jint)scrollbar.value(), ! (jint)scrollbar.visibleSize(), ! (jint)scrollbar.totalSize()); CheckAndClearException(env); return pos; } int ScrollbarThemeJava::thumbLength(Scrollbar& scrollbar) { JLObject jtheme = getJScrollBarTheme(scrollbar); if (!jtheme) { return 0; } JNIEnv* env = WebCore_GetJavaEnv(); static jmethodID mid = env->GetMethodID( getJScrollBarThemeClass(), "getThumbLength", ! "(IIIIII)I"); ASSERT(mid); int len = env->CallIntMethod( jtheme, mid, ! (jint)scrollbar.width(), ! (jint)scrollbar.height(), ! (jint)scrollbar.orientation(), ! (jint)scrollbar.value(), ! (jint)scrollbar.visibleSize(), ! (jint)scrollbar.totalSize()); CheckAndClearException(env); return len; } int ScrollbarThemeJava::trackPosition(Scrollbar& scrollbar) { JLObject jtheme = getJScrollBarTheme(scrollbar); if (!jtheme) { return 0; } JNIEnv* env = WebCore_GetJavaEnv(); static jmethodID mid = env->GetMethodID( getJScrollBarThemeClass(), "getTrackPosition", ! "(III)I"); ASSERT(mid); int pos = env->CallIntMethod( jtheme, mid, ! (jint)scrollbar.width(), ! (jint)scrollbar.height(), ! (jint)scrollbar.orientation()); CheckAndClearException(env); return pos; } int ScrollbarThemeJava::trackLength(Scrollbar& scrollbar) { JLObject jtheme = getJScrollBarTheme(scrollbar); if (!jtheme) { return 0; } JNIEnv* env = WebCore_GetJavaEnv(); static jmethodID mid = env->GetMethodID( getJScrollBarThemeClass(), "getTrackLength", ! "(III)I"); ASSERT(mid); int len = env->CallIntMethod( jtheme, mid, ! (jint)scrollbar.width(), ! (jint)scrollbar.height(), ! (jint)scrollbar.orientation()); CheckAndClearException(env); return len; } --- 145,252 ---- scrollbar.invalidate(); } int ScrollbarThemeJava::thumbPosition(Scrollbar& scrollbar) { + if (!scrollbar.enabled()) { + return 0; + } + JLObject jtheme = getJScrollBarTheme(scrollbar); if (!jtheme) { return 0; } JNIEnv* env = WebCore_GetJavaEnv(); static jmethodID mid = env->GetMethodID( getJScrollBarThemeClass(), "getThumbPosition", ! "(J)I"); ASSERT(mid); int pos = env->CallIntMethod( jtheme, mid, ! ptr_to_jlong(&scrollbar)); CheckAndClearException(env); return pos; } int ScrollbarThemeJava::thumbLength(Scrollbar& scrollbar) { + if (!scrollbar.enabled()) { + return 0; + } JLObject jtheme = getJScrollBarTheme(scrollbar); if (!jtheme) { return 0; } JNIEnv* env = WebCore_GetJavaEnv(); static jmethodID mid = env->GetMethodID( getJScrollBarThemeClass(), "getThumbLength", ! "(J)I"); ASSERT(mid); int len = env->CallIntMethod( jtheme, mid, ! ptr_to_jlong(&scrollbar)); CheckAndClearException(env); return len; } int ScrollbarThemeJava::trackPosition(Scrollbar& scrollbar) { + if (!scrollbar.enabled()) { + return 0; + } JLObject jtheme = getJScrollBarTheme(scrollbar); if (!jtheme) { return 0; } JNIEnv* env = WebCore_GetJavaEnv(); static jmethodID mid = env->GetMethodID( getJScrollBarThemeClass(), "getTrackPosition", ! "(J)I"); ASSERT(mid); int pos = env->CallIntMethod( jtheme, mid, ! ptr_to_jlong(&scrollbar)); CheckAndClearException(env); return pos; } int ScrollbarThemeJava::trackLength(Scrollbar& scrollbar) { + if (!scrollbar.enabled()) { + return 0; + } JLObject jtheme = getJScrollBarTheme(scrollbar); if (!jtheme) { return 0; } JNIEnv* env = WebCore_GetJavaEnv(); static jmethodID mid = env->GetMethodID( getJScrollBarThemeClass(), "getTrackLength", ! "(J)I"); ASSERT(mid); int len = env->CallIntMethod( jtheme, mid, ! ptr_to_jlong(&scrollbar)); CheckAndClearException(env); return len; }
< prev index next >