summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Northover <steve>2007-08-23 14:20:14 +0000
committerSteve Northover <steve>2007-08-23 14:20:14 +0000
commit527b69dca92e5f82363cd483daf39ec95c23e8c4 (patch)
tree21f43e03c09c1b42a5b0c44e98857230e8dd06fe
parentb88d48ba0f98e501d3e7833cada4e5f41c1d4d92 (diff)
downloadeclipse.platform.swt-527b69dca92e5f82363cd483daf39ec95c23e8c4.tar.gz
eclipse.platform.swt-527b69dca92e5f82363cd483daf39ec95c23e8c4.tar.xz
eclipse.platform.swt-527b69dca92e5f82363cd483daf39ec95c23e8c4.zip
blur behind for Vista
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c44
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_custom.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.c6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.h2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.c40
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.h12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/DWM_BLURBEHIND.java19
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java5
9 files changed, 128 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 4a6ac01e18..905ff0ff3d 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
@@ -1768,6 +1768,18 @@ JNIEXPORT jint JNICALL OS_NATIVE(DROPFILES_1sizeof)
}
#endif
+#ifndef NO_DWM_1BLURBEHIND_1sizeof
+JNIEXPORT jint JNICALL OS_NATIVE(DWM_1BLURBEHIND_1sizeof)
+ (JNIEnv *env, jclass that)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, DWM_1BLURBEHIND_1sizeof_FUNC);
+ rc = (jint)DWM_BLURBEHIND_sizeof();
+ OS_NATIVE_EXIT(env, that, DWM_1BLURBEHIND_1sizeof_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO_DefFrameProcA
JNIEXPORT jint JNICALL OS_NATIVE(DefFrameProcA)
(JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jint arg4)
@@ -2400,6 +2412,38 @@ fail:
}
#endif
+#ifndef NO_DwmEnableBlurBehindWindow
+JNIEXPORT jint JNICALL OS_NATIVE(DwmEnableBlurBehindWindow)
+ (JNIEnv *env, jclass that, jint arg0, jobject arg1)
+{
+ DWM_BLURBEHIND _arg1, *lparg1=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, DwmEnableBlurBehindWindow_FUNC);
+ if (arg1) if ((lparg1 = getDWM_BLURBEHINDFields(env, arg1, &_arg1)) == NULL) goto fail;
+/*
+ rc = (jint)DwmEnableBlurBehindWindow((HWND)arg0, lparg1);
+*/
+ {
+ static int initialized = 0;
+ static HMODULE hm = NULL;
+ static FARPROC fp = NULL;
+ rc = 0;
+ if (!initialized) {
+ if (!hm) hm = LoadLibrary(DwmEnableBlurBehindWindow_LIB);
+ if (hm) fp = GetProcAddress(hm, "DwmEnableBlurBehindWindow");
+ initialized = 1;
+ }
+ if (fp) {
+ rc = (jint)fp((HWND)arg0, lparg1);
+ }
+ }
+fail:
+ if (arg1 && lparg1) setDWM_BLURBEHINDFields(env, arg1, lparg1);
+ OS_NATIVE_EXIT(env, that, DwmEnableBlurBehindWindow_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO_DwmExtendFrameIntoClientArea
JNIEXPORT jint JNICALL OS_NATIVE(DwmExtendFrameIntoClientArea)
(JNIEnv *env, jclass that, jint arg0, jobject arg1)
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 2db1db83c1..4f6a8c10c1 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
@@ -60,6 +60,7 @@
#define NO_CHOOSEFONT
#define NO_COMBOBOXINFO
#define NO_DOCINFO
+#define NO_DWM_BLURBEHIND
#define NO_EXTLOGPEN
#define NO_GCP_RESULTS
#define NO_GRADIENT_RECT
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 e6f5284d32..f8370ab15d 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
@@ -32,6 +32,7 @@
#define DrawThemeIcon_LIB "uxtheme.dll"
#define DrawThemeParentBackground_LIB "uxtheme.dll"
#define DrawThemeText_LIB "uxtheme.dll"
+#define DwmDwmEnableBlurBehindWindow_LIB "dwmapi.dll"
#define DwmExtendFrameIntoClientArea_LIB "dwmapi.dll"
#define GetThemeInt_LIB "uxtheme.dll"
#define GetThemeMargins_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 af63f0b8d0..f96bc4298d 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 = 905;
-int OS_nativeFunctionCallCount[905];
+int OS_nativeFunctionCount = 907;
+int OS_nativeFunctionCallCount[907];
char * OS_nativeFunctionNames[] = {
"ACCEL_1sizeof",
"ACTCTX_1sizeof",
@@ -119,6 +119,7 @@ char * OS_nativeFunctionNames[] = {
"DOCINFO_1sizeof",
"DRAWITEMSTRUCT_1sizeof",
"DROPFILES_1sizeof",
+ "DWM_1BLURBEHIND_1sizeof",
"DefFrameProcA",
"DefFrameProcW",
"DefMDIChildProcA",
@@ -156,6 +157,7 @@ char * OS_nativeFunctionNames[] = {
"DrawThemeIcon",
"DrawThemeParentBackground",
"DrawThemeText",
+ "DwmEnableBlurBehindWindow",
"DwmExtendFrameIntoClientArea",
"EXTLOGPEN_1sizeof",
"Ellipse",
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 0f86c6f46c..78c6e772ba 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
@@ -127,6 +127,7 @@ typedef enum {
DOCINFO_1sizeof_FUNC,
DRAWITEMSTRUCT_1sizeof_FUNC,
DROPFILES_1sizeof_FUNC,
+ DWM_1BLURBEHIND_1sizeof_FUNC,
DefFrameProcA_FUNC,
DefFrameProcW_FUNC,
DefMDIChildProcA_FUNC,
@@ -164,6 +165,7 @@ typedef enum {
DrawThemeIcon_FUNC,
DrawThemeParentBackground_FUNC,
DrawThemeText_FUNC,
+ DwmEnableBlurBehindWindow_FUNC,
DwmExtendFrameIntoClientArea_FUNC,
EXTLOGPEN_1sizeof_FUNC,
Ellipse_FUNC,
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.c b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.c
index 69633dda85..432e15aad9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.c
@@ -1061,6 +1061,46 @@ void setDROPFILESFields(JNIEnv *env, jobject lpObject, DROPFILES *lpStruct)
}
#endif
+#ifndef NO_DWM_BLURBEHIND
+typedef struct DWM_BLURBEHIND_FID_CACHE {
+ int cached;
+ jclass clazz;
+ jfieldID bdwFlags, bfEnable, hRgnBlur, fTransitionOnMaximized;
+} DWM_BLURBEHIND_FID_CACHE;
+
+DWM_BLURBEHIND_FID_CACHE DWM_BLURBEHINDFc;
+
+void cacheDWM_BLURBEHINDFields(JNIEnv *env, jobject lpObject)
+{
+ if (DWM_BLURBEHINDFc.cached) return;
+ DWM_BLURBEHINDFc.clazz = (*env)->GetObjectClass(env, lpObject);
+ DWM_BLURBEHINDFc.bdwFlags = (*env)->GetFieldID(env, DWM_BLURBEHINDFc.clazz, "bdwFlags", "I");
+ DWM_BLURBEHINDFc.bfEnable = (*env)->GetFieldID(env, DWM_BLURBEHINDFc.clazz, "bfEnable", "Z");
+ DWM_BLURBEHINDFc.hRgnBlur = (*env)->GetFieldID(env, DWM_BLURBEHINDFc.clazz, "hRgnBlur", "I");
+ DWM_BLURBEHINDFc.fTransitionOnMaximized = (*env)->GetFieldID(env, DWM_BLURBEHINDFc.clazz, "fTransitionOnMaximized", "Z");
+ DWM_BLURBEHINDFc.cached = 1;
+}
+
+DWM_BLURBEHIND *getDWM_BLURBEHINDFields(JNIEnv *env, jobject lpObject, DWM_BLURBEHIND *lpStruct)
+{
+ if (!DWM_BLURBEHINDFc.cached) cacheDWM_BLURBEHINDFields(env, lpObject);
+ lpStruct->bdwFlags = (*env)->GetIntField(env, lpObject, DWM_BLURBEHINDFc.bdwFlags);
+ lpStruct->bfEnable = (*env)->GetBooleanField(env, lpObject, DWM_BLURBEHINDFc.bfEnable);
+ lpStruct->hRgnBlur = (*env)->GetIntField(env, lpObject, DWM_BLURBEHINDFc.hRgnBlur);
+ lpStruct->fTransitionOnMaximized = (*env)->GetBooleanField(env, lpObject, DWM_BLURBEHINDFc.fTransitionOnMaximized);
+ return lpStruct;
+}
+
+void setDWM_BLURBEHINDFields(JNIEnv *env, jobject lpObject, DWM_BLURBEHIND *lpStruct)
+{
+ if (!DWM_BLURBEHINDFc.cached) cacheDWM_BLURBEHINDFields(env, lpObject);
+ (*env)->SetIntField(env, lpObject, DWM_BLURBEHINDFc.bdwFlags, (jint)lpStruct->bdwFlags);
+ (*env)->SetBooleanField(env, lpObject, DWM_BLURBEHINDFc.bfEnable, (jboolean)lpStruct->bfEnable);
+ (*env)->SetIntField(env, lpObject, DWM_BLURBEHINDFc.hRgnBlur, (jint)lpStruct->hRgnBlur);
+ (*env)->SetBooleanField(env, lpObject, DWM_BLURBEHINDFc.fTransitionOnMaximized, (jboolean)lpStruct->fTransitionOnMaximized);
+}
+#endif
+
#ifndef NO_EXTLOGPEN
typedef struct EXTLOGPEN_FID_CACHE {
int cached;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.h b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.h
index 3e9bfe48de..ea5164618c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.h
@@ -251,6 +251,18 @@ void setDROPFILESFields(JNIEnv *env, jobject lpObject, DROPFILES *lpStruct);
#define DROPFILES_sizeof() 0
#endif
+#ifndef NO_DWM_BLURBEHIND
+void cacheDWM_BLURBEHINDFields(JNIEnv *env, jobject lpObject);
+DWM_BLURBEHIND *getDWM_BLURBEHINDFields(JNIEnv *env, jobject lpObject, DWM_BLURBEHIND *lpStruct);
+void setDWM_BLURBEHINDFields(JNIEnv *env, jobject lpObject, DWM_BLURBEHIND *lpStruct);
+#define DWM_BLURBEHIND_sizeof() sizeof(DWM_BLURBEHIND)
+#else
+#define cacheDWM_BLURBEHINDFields(a,b)
+#define getDWM_BLURBEHINDFields(a,b,c) NULL
+#define setDWM_BLURBEHINDFields(a,b,c)
+#define DWM_BLURBEHIND_sizeof() 0
+#endif
+
#ifndef NO_EXTLOGPEN
void cacheEXTLOGPENFields(JNIEnv *env, jobject lpObject);
EXTLOGPEN *getEXTLOGPENFields(JNIEnv *env, jobject lpObject, EXTLOGPEN *lpStruct);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/DWM_BLURBEHIND.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/DWM_BLURBEHIND.java
new file mode 100644
index 0000000000..7b73ef2927
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/DWM_BLURBEHIND.java
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.internal.win32;
+
+public class DWM_BLURBEHIND {
+ public int bdwFlags;
+ public boolean bfEnable;
+ public int /*long*/ hRgnBlur;
+ public boolean fTransitionOnMaximized;
+ public static final int sizeof = OS.DWM_BLURBEHIND_sizeof ();
+}
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 8e7ed651f7..6aab9749c6 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
@@ -559,6 +559,9 @@ public class OS extends C {
public static final int DTS_SHORTDATEFORMAT = 0x0000;
public static final int DTS_TIMEFORMAT = 0x0009;
public static final int DTS_UPDOWN = 0x0001;
+ public static final int DWM_BB_ENABLE = 0x1;
+ public static final int DWM_BB_BLURREGION = 0x2;
+ public static final int DWM_BB_TRANSITIONONMAXIMIZED = 0x4;
public static final int E_POINTER = 0x80004003;
public static final int EBP_NORMALGROUPBACKGROUND = 5;
public static final int EBP_NORMALGROUPCOLLAPSE = 6;
@@ -2079,6 +2082,7 @@ public static final native int DOCHOSTUIINFO_sizeof ();
public static final native int DOCINFO_sizeof ();
public static final native int DRAWITEMSTRUCT_sizeof ();
public static final native int DROPFILES_sizeof ();
+public static final native int DWM_BLURBEHIND_sizeof ();
public static final native int EXTLOGPEN_sizeof ();
public static final native int FILETIME_sizeof ();
public static final native int GCP_RESULTS_sizeof ();
@@ -3285,6 +3289,7 @@ public static final native int DrawThemeEdge (int /*long*/ hTheme, int /*long*/
public static final native int DrawThemeIcon (int /*long*/ hTheme, int /*long*/ hdc, int iPartId, int iStateId, RECT pRect, int /*long*/ himl, int iImageIndex);
public static final native int DrawThemeParentBackground (int /*long*/ hwnd, int /*long*/ hdc, RECT prc);
public static final native int DrawThemeText (int /*long*/ hTheme, int /*long*/ hdc, int iPartId, int iStateId, char[] pszText, int iCharCount, int dwTextFlags, int dwTextFlags2, RECT pRect);
+public static final native int DwmEnableBlurBehindWindow (int /*long*/ hWnd, DWM_BLURBEHIND pBlurBehind);
public static final native int DwmExtendFrameIntoClientArea (int /*long*/ hWnd, MARGINS pMarInset);
public static final native boolean Ellipse (int /*long*/ hdc, int nLeftRect, int nTopRect, int nRightRect, int nBottomRect);
public static final native boolean EnableMenuItem (int /*long*/ hMenu, int uIDEnableItem, int uEnable);