Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikita Nemkin2018-04-17 12:59:21 +0000
committerNiraj Modi2018-05-03 08:18:06 +0000
commit0fcc40f73f7b6cf079f4211b7bab6c91c2bc977e (patch)
treeb0812403deff7513877f87cabd630a08779fe925 /bundles/org.eclipse.swt/Eclipse SWT PI
parent9ee8b1444497d29c83291d4df9544a3f4d627fd3 (diff)
downloadeclipse.platform.swt-0fcc40f73f7b6cf079f4211b7bab6c91c2bc977e.tar.gz
eclipse.platform.swt-0fcc40f73f7b6cf079f4211b7bab6c91c2bc977e.tar.xz
eclipse.platform.swt-0fcc40f73f7b6cf079f4211b7bab6c91c2bc977e.zip
Bug 184951 - [Win32] Tree/Table checkboxes render jagged at a high DPI
DrawThemeBackground stretches the checkbox bitmap to fill the provided rectangle. To avoid stretching artifacts, limit the rectangle to actual checkbox bitmap size. This change also supersedes the fix for bug 489828. Change-Id: Ib227b874716b7858dc52596c5103ceb598e68cbb Signed-off-by: Nikita Nemkin <nikita@nemkin.ru>
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.c1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java7
4 files changed, 35 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c
index 6252d862d8..978d8e67f3 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c
@@ -4963,6 +4963,32 @@ fail:
}
#endif
+#ifndef NO_GetThemePartSize
+JNIEXPORT jint JNICALL OS_NATIVE(GetThemePartSize)
+ (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jint arg2, jint arg3, jobject arg4, jint arg5, jobject arg6)
+{
+ RECT _arg4, *lparg4=NULL;
+ SIZE _arg6, *lparg6=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, GetThemePartSize_FUNC);
+ if (arg4) if ((lparg4 = getRECTFields(env, arg4, &_arg4)) == NULL) goto fail;
+ if (arg6) if ((lparg6 = &_arg6) == NULL) goto fail;
+/*
+ rc = (jint)GetThemePartSize(arg0, arg1, arg2, arg3, lparg4, arg5, lparg6);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, GetThemePartSize)
+ if (fp) {
+ rc = (jint)((jint (CALLING_CONVENTION*)(jintLong, jintLong, jint, jint, RECT *, jint, SIZE *))fp)(arg0, arg1, arg2, arg3, lparg4, arg5, lparg6);
+ }
+ }
+fail:
+ if (arg6 && lparg6) setSIZEFields(env, arg6, lparg6);
+ OS_NATIVE_EXIT(env, that, GetThemePartSize_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO_GetThemeTextExtent
JNIEXPORT jint JNICALL OS_NATIVE(GetThemeTextExtent)
(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jint arg2, jint arg3, jcharArray arg4, jint arg5, jint arg6, jobject arg7, jobject arg8)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.c
index b462daa83c..94d41f5ac9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.c
@@ -390,6 +390,7 @@ char * OS_nativeFunctionNames[] = {
"GetTextExtentPoint32W",
"GetTextMetricsA",
"GetTextMetricsW",
+ "GetThemePartSize",
"GetThemeTextExtent",
"GetTouchInputInfo",
"GetUpdateRect",
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.h
index bbff40fbb1..200c80d163 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.h
@@ -400,6 +400,7 @@ typedef enum {
GetTextExtentPoint32W_FUNC,
GetTextMetricsA_FUNC,
GetTextMetricsW_FUNC,
+ GetThemePartSize_FUNC,
GetThemeTextExtent_FUNC,
GetTouchInputInfo_FUNC,
GetUpdateRect_FUNC,
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java
index e2de419575..f6cd0e8719 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java
@@ -1588,6 +1588,7 @@ public class OS extends C {
public static final int TREIS_NORMAL = 1;
public static final int TREIS_SELECTED = 3;
public static final int TREIS_SELECTEDNOTFOCUS = 5;
+ public static final int TS_TRUE = 1;
public static final int TTDT_AUTOMATIC = 0;
public static final int TTDT_RESHOW = 1;
public static final int TTDT_AUTOPOP = 2;
@@ -3944,6 +3945,12 @@ public static final native int GetMessageTime ();
* @param hrgn cast=(HRGN)
*/
public static final native int GetMetaRgn (long /*int*/ hdc, long /*int*/ hrgn);
+/**
+ * @method flags=dynamic
+ * @param prc flags=no_out
+ * @param psz flags=no_in
+ */
+public static final native int GetThemePartSize(long /*int*/ hTheme, long /*int*/ hdc, int iPartId, int iStateId, RECT prc, int eSize, SIZE psz);
/** @method flags=dynamic */
public static final native int GetThemeTextExtent (long /*int*/ hTheme, long /*int*/ hdc, int iPartId, int iStateId, char[] pszText, int iCharCount, int dwTextFlags, RECT pBoundingRect, RECT pExtentRect);
/**

Back to the top