diff options
author | Grant Gayed <ggayed> | 2007-05-15 14:28:52 +0000 |
---|---|---|
committer | Grant Gayed <ggayed> | 2007-05-15 14:28:52 +0000 |
commit | 722c025dd8f468792402e2ab95037be6017f46b8 (patch) | |
tree | ad4edf7f2a29675d85a533532e601f13fb1774d2 | |
parent | 091f7909165636bfda5ab4025af1b28bc5fb0fa7 (diff) | |
download | eclipse.platform.swt-722c025dd8f468792402e2ab95037be6017f46b8.tar.gz eclipse.platform.swt-722c025dd8f468792402e2ab95037be6017f46b8.tar.xz eclipse.platform.swt-722c025dd8f468792402e2ab95037be6017f46b8.zip |
66101
8 files changed, 58 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.win32.OS.properties b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.win32.OS.properties index 80e24a1728..cde01dbe14 100644 --- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.win32.OS.properties +++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.win32.OS.properties @@ -924,6 +924,10 @@ OS_CoCreateInstance_2= OS_CoCreateInstance_3=cast=REFIID OS_CoCreateInstance_4=cast=LPVOID * +OS_CoInternetIsFeatureEnabled=flags=dynamic +OS_CoInternetIsFeatureEnabled_0= +OS_CoInternetIsFeatureEnabled_1= + OS_CoInternetSetFeatureEnabled=flags=dynamic OS_CoInternetSetFeatureEnabled_0= OS_CoInternetSetFeatureEnabled_1= diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/IE.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/IE.java index 0248e0ce8c..cb7425c25b 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/IE.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/IE.java @@ -32,8 +32,6 @@ class IE extends WebBrowser { int globalDispatch; String html; - static boolean Initialized; - static final int BeforeNavigate2 = 0xfa; static final int CommandStateChange = 0x69; static final int DocumentComplete = 0x103; @@ -709,7 +707,16 @@ public boolean setText(String html) { rgvarg[0] = new Variant(ABOUT_BLANK); int[] rgdispidNamedArgs = new int[1]; rgdispidNamedArgs[0] = rgdispid[1]; + boolean oldValue = false; + if (!OS.IsWinCE) { + int hResult = OS.CoInternetIsFeatureEnabled(OS.FEATURE_DISABLE_NAVIGATION_SOUNDS, OS.GET_FEATURE_FROM_PROCESS); + oldValue = hResult == COM.S_OK; + OS.CoInternetSetFeatureEnabled(OS.FEATURE_DISABLE_NAVIGATION_SOUNDS, OS.SET_FEATURE_ON_PROCESS, true); + } Variant pVarResult = auto.invoke(rgdispid[0], rgvarg, rgdispidNamedArgs); + if (!OS.IsWinCE) { + OS.CoInternetSetFeatureEnabled(OS.FEATURE_DISABLE_NAVIGATION_SOUNDS, OS.SET_FEATURE_ON_PROCESS, oldValue); + } rgvarg[0].dispose(); if (pVarResult == null) return false; boolean result = pVarResult.getType() == OLE.VT_EMPTY; @@ -740,7 +747,16 @@ public boolean setUrl(String url) { rgvarg[0] = new Variant(ABOUT_BLANK); int[] rgdispidNamedArgs = new int[1]; rgdispidNamedArgs[0] = rgdispid[1]; + boolean oldValue = false; + if (!OS.IsWinCE) { + int hResult = OS.CoInternetIsFeatureEnabled(OS.FEATURE_DISABLE_NAVIGATION_SOUNDS, OS.GET_FEATURE_FROM_PROCESS); + oldValue = hResult == COM.S_OK; + OS.CoInternetSetFeatureEnabled(OS.FEATURE_DISABLE_NAVIGATION_SOUNDS, OS.SET_FEATURE_ON_PROCESS, true); + } auto.invoke(rgdispid[0], rgvarg, rgdispidNamedArgs); + if (!OS.IsWinCE) { + OS.CoInternetSetFeatureEnabled(OS.FEATURE_DISABLE_NAVIGATION_SOUNDS, OS.SET_FEATURE_ON_PROCESS, oldValue); + } rgvarg[0].dispose(); } int[] rgdispid = auto.getIDsOfNames(new String[] { "Stop" }); //$NON-NLS-1$ 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 f11d25e155..a535d8c927 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 @@ -929,6 +929,34 @@ fail: } #endif +#ifndef NO_CoInternetIsFeatureEnabled +JNIEXPORT jint JNICALL OS_NATIVE(CoInternetIsFeatureEnabled) + (JNIEnv *env, jclass that, jint arg0, jint arg1) +{ + jint rc = 0; + OS_NATIVE_ENTER(env, that, CoInternetIsFeatureEnabled_FUNC); +/* + rc = (jint)CoInternetIsFeatureEnabled(arg0, arg1); +*/ + { + static int initialized = 0; + static HMODULE hm = NULL; + static FARPROC fp = NULL; + rc = 0; + if (!initialized) { + if (!hm) hm = LoadLibrary(CoInternetIsFeatureEnabled_LIB); + if (hm) fp = GetProcAddress(hm, "CoInternetIsFeatureEnabled"); + initialized = 1; + } + if (fp) { + rc = (jint)fp(arg0, arg1); + } + } + OS_NATIVE_EXIT(env, that, CoInternetIsFeatureEnabled_FUNC); + return rc; +} +#endif + #ifndef NO_CoInternetSetFeatureEnabled JNIEXPORT jint JNICALL OS_NATIVE(CoInternetSetFeatureEnabled) (JNIEnv *env, jclass that, jint arg0, jint arg1, jboolean arg2) 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 8aba53d5f3..2b90b09acf 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 @@ -155,6 +155,7 @@ #define NO_ChooseFontW #define NO_CloseThemeData #define NO_CoCreateInstance +#define NO_CoInternetIsFeatureEnabled #define NO_CoInternetSetFeatureEnabled #define NO_CopyImage #define NO_CreateAcceleratorTableA 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 cb3584e383..d3e3ddcfc8 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 @@ -22,6 +22,7 @@ #define BufferedPaintSetAlpha_LIB "uxtheme.dll" #define BeginBufferedPaint_LIB "uxtheme.dll" #define CloseThemeData_LIB "uxtheme.dll" +#define CoInternetIsFeatureEnabled_LIB "urlmon.dll" #define CoInternetSetFeatureEnabled_LIB "urlmon.dll" #define CreateActCtxW_LIB "kernel32.dll" #define CreateActCtxA_LIB "kernel32.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 b069b668a1..029c303185 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 = 872; -int OS_nativeFunctionCallCount[872]; +int OS_nativeFunctionCount = 873; +int OS_nativeFunctionCallCount[873]; char * OS_nativeFunctionNames[] = { "ACCEL_1sizeof", "ACTCTX_1sizeof", @@ -69,6 +69,7 @@ char * OS_nativeFunctionNames[] = { "CloseHandle", "CloseThemeData", "CoCreateInstance", + "CoInternetIsFeatureEnabled", "CoInternetSetFeatureEnabled", "CombineRgn", "CommDlgExtendedError", 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 6b68ad2192..a4520c8dcb 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 @@ -77,6 +77,7 @@ typedef enum { CloseHandle_FUNC, CloseThemeData_FUNC, CoCreateInstance_FUNC, + CoInternetIsFeatureEnabled_FUNC, CoInternetSetFeatureEnabled_FUNC, CombineRgn_FUNC, CommDlgExtendedError_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 4b9c63a691..71a5b2749a 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 @@ -643,6 +643,7 @@ public class OS extends C { public static final int GCS_COMPSTR = 0x8; public static final int GCS_RESULTSTR = 0x800; public static final int GDT_VALID = 0; + public static final int GET_FEATURE_FROM_PROCESS = 0x2; public static final int GLPS_CLOSED = 1; public static final int GLPS_OPENED = 2; public static final int GM_ADVANCED = 2; @@ -3160,6 +3161,7 @@ public static final native boolean CloseClipboard (); public static final native boolean CloseHandle (int /*long*/ hObject); public static final native int CloseThemeData (int /*long*/ hTheme); public static final native int CoCreateInstance (byte[] rclsid, int /*long*/ pUnkOuter, int dwClsContext, byte[] riid, int /*long*/[] ppv); +public static final native int CoInternetIsFeatureEnabled (int FeatureEntry, int dwFlags); public static final native int CoInternetSetFeatureEnabled (int FeatureEntry, int dwFlags, boolean fEnable); public static final native int CombineRgn (int /*long*/ hrgnDest, int /*long*/ hrgnSrc1, int /*long*/ hrgnSrc2, int fnCombineMode); public static final native boolean CommandBar_AddAdornments (int /*long*/ hwndCB, int dwFlags, int dwReserved); |