From 7ecd4652621dad9b1c0710d895eaa6f500f7ca25 Mon Sep 17 00:00:00 2001 From: Felipe Heidrich Date: Fri, 11 Nov 2011 10:01:13 -0500 Subject: natives for Bug 325795 - support Windows Vista and 7 Aero Glass shells --- .../Eclipse SWT PI/win32/library/os.c | 24 ++++++++++++++++++++++ .../Eclipse SWT PI/win32/library/os.h | 1 + .../Eclipse SWT PI/win32/library/os_custom.h | 1 + .../Eclipse SWT PI/win32/library/os_stats.c | 5 +++-- .../Eclipse SWT PI/win32/library/os_stats.h | 1 + .../win32/org/eclipse/swt/internal/win32/OS.java | 13 ++++++++++++ 6 files changed, 43 insertions(+), 2 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 00454d738b..8f5cc01865 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 @@ -6139,6 +6139,30 @@ fail: } #endif +#ifndef NO_GetThemeBitmap +JNIEXPORT jint JNICALL OS_NATIVE(GetThemeBitmap) + (JNIEnv *env, jclass that, jintLong arg0, jint arg1, jint arg2, jint arg3, jint arg4, jintLongArray arg5) +{ + jintLong *lparg5=NULL; + jint rc = 0; + OS_NATIVE_ENTER(env, that, GetThemeBitmap_FUNC); + if (arg5) if ((lparg5 = (*env)->GetIntLongArrayElements(env, arg5, NULL)) == NULL) goto fail; +/* + rc = (jint)GetThemeBitmap(arg0, arg1, arg2, arg3, arg4, lparg5); +*/ + { + OS_LOAD_FUNCTION(fp, GetThemeBitmap) + if (fp) { + rc = (jint)((jint (CALLING_CONVENTION*)(jintLong, jint, jint, jint, jint, jintLong *))fp)(arg0, arg1, arg2, arg3, arg4, lparg5); + } + } +fail: + if (arg5 && lparg5) (*env)->ReleaseIntLongArrayElements(env, arg5, lparg5, 0); + OS_NATIVE_EXIT(env, that, GetThemeBitmap_FUNC); + return rc; +} +#endif + #ifndef NO_GetThemeColor JNIEXPORT jint JNICALL OS_NATIVE(GetThemeColor) (JNIEnv *env, jclass that, jintLong arg0, jint arg1, jint arg2, jint arg3, jintArray arg4) diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.h b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.h index decc12b8a7..966233be16 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.h @@ -349,6 +349,7 @@ #define NO_GetTextCharset #define NO_GetTextExtentPoint32A #define NO_GetTextMetricsA +#define NO_GetThemeBitmap #define NO_GetThemeColor #define NO_GetThemeTextExtent #define NO_GetThemeInt diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_custom.h b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_custom.h index 22ce0ec683..8a995a3efc 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_custom.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_custom.h @@ -47,6 +47,7 @@ #define GetThemeMargins_LIB "uxtheme.dll" #define GetThemeBackgroundContentRect_LIB "uxtheme.dll" #define GetThemeBackgroundExtent_LIB "uxtheme.dll" +#define GetThemeBitmap_LIB "uxtheme.dll" #define GetThemeColor_LIB "uxtheme.dll" #define GetThemePartSize_LIB "uxtheme.dll" #define GetThemeMetric_LIB "uxtheme.dll" 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 e0932640d5..b788be6c62 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 @@ -14,8 +14,8 @@ #ifdef NATIVE_STATS -int OS_nativeFunctionCount = 1067; -int OS_nativeFunctionCallCount[1067]; +int OS_nativeFunctionCount = 1068; +int OS_nativeFunctionCallCount[1068]; char * OS_nativeFunctionNames[] = { "ACCEL_1sizeof", "ACTCTX_1sizeof", @@ -462,6 +462,7 @@ char * OS_nativeFunctionNames[] = { "GetTextMetricsW", "GetThemeBackgroundContentRect", "GetThemeBackgroundExtent", + "GetThemeBitmap", "GetThemeColor", "GetThemeInt", "GetThemeMargins", 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 617be7433d..55d743839b 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 @@ -470,6 +470,7 @@ typedef enum { GetTextMetricsW_FUNC, GetThemeBackgroundContentRect_FUNC, GetThemeBackgroundExtent_FUNC, + GetThemeBitmap_FUNC, GetThemeColor_FUNC, GetThemeInt_FUNC, GetThemeMargins_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 33aa96a242..84e81097ab 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 @@ -707,6 +707,9 @@ public class OS extends C { public static final int FVIRTKEY = 0x1; public static final int GBS_NORMAL = 1; public static final int GBS_DISABLED = 2; + public static final int GBF_DIRECT = 0x00000001; + public static final int GBF_COPY = 0x00000002; + public static final int GBF_VALIDBITS = 0x00000003; public static final int GCP_REORDER = 0x0002; public static final int GCP_GLYPHSHAPE = 0x0010; public static final int GCP_CLASSIN = 0x00080000; @@ -1410,6 +1413,14 @@ public class OS extends C { public static final int RBN_CHILDSIZE = RBN_FIRST - 8; public static final int RBN_CHEVRONPUSHED = RBN_FIRST - 10; public static final int RBN_HEIGHTCHANGE = 0xfffffcc1; + public static final int RBS_UNCHECKEDNORMAL = 1; + public static final int RBS_UNCHECKEDHOT = 2; + public static final int RBS_UNCHECKEDPRESSED = 3; + public static final int RBS_UNCHECKEDDISABLED = 4; + public static final int RBS_CHECKEDNORMAL = 5; + public static final int RBS_CHECKEDHOT = 6; + public static final int RBS_CHECKEDPRESSED = 7; + public static final int RBS_CHECKEDDISABLED = 8; public static final int RBS_DBLCLKTOGGLE = 0x8000; public static final int RBS_BANDBORDERS = 0x400; public static final int RBS_VARHEIGHT = 0x200; @@ -4422,6 +4433,8 @@ public static final native int GetMessageTime (); */ public static final native int GetMetaRgn (int /*long*/ hdc, int /*long*/ hrgn); /** @method flags=dynamic */ +public static final native int GetThemeBitmap (int /*long*/ hTheme, int iPartId, int iStateId, int iPropId, int dwFlags, int /*long*/[] hBitmap); +/** @method flags=dynamic */ public static final native int GetThemeColor (int /*long*/ hTheme, int iPartId, int iStateId, int iPropId, int[] pColor); /** @method flags=dynamic */ public static final native int GetThemeTextExtent (int /*long*/ hTheme, int /*long*/ hdc, int iPartId, int iStateId, char[] pszText, int iCharCount, int dwTextFlags, RECT pBoundingRect, RECT pExtentRect); -- cgit