Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikita Nemkin2018-02-16 21:12:22 +0000
committerLars Vogel2018-03-28 15:22:36 +0000
commit84c9e305cb087110cb300a5e58f86583cf80914d (patch)
tree5666f707b70a6e756d3ba9e8e51470cbd95fd522 /bundles/org.eclipse.swt/Eclipse SWT Browser
parent4b0412b94e47be8f2c5480568a36ec71809a148f (diff)
downloadeclipse.platform.swt-84c9e305cb087110cb300a5e58f86583cf80914d.tar.gz
eclipse.platform.swt-84c9e305cb087110cb300a5e58f86583cf80914d.tar.xz
eclipse.platform.swt-84c9e305cb087110cb300a5e58f86583cf80914d.zip
Bug 531097 - [Win32] Remove support for Windows before Vista
Remove code paths specific to WinCE, Win9x, WinNT4, Win2k, WinXP. Remove uses of obsolete flag=no_wince JNI annotation. The following OS variables indicate dead code: * WIN32_VERSION is awlays >= 6.0 * COMCTL32_VERSION is always 6.10; * SHELL32_VERSION is always >= 6.0; * IsWinNT and IsUnicode are always true; * IsWin32s, IsWin95, IsWinCE, IsPPC, IsHPC, IsSP are always false. Change-Id: I4e700a89b22cd879e7c46f1493115a77e2ade1c9 Signed-off-by: Nikita Nemkin <nikita@nemkin.ru>
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Browser')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/IE.java15
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/WebSite.java57
2 files changed, 31 insertions, 41 deletions
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 8613d61248..ccdac16da5 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
@@ -147,12 +147,10 @@ class IE extends WebBrowser {
static {
NativeClearSessions = () -> {
- if (OS.IsPPC) return;
OS.InternetSetOption (0, OS.INTERNET_OPTION_END_BROWSER_SESSION, 0, 0);
};
NativeGetCookie = () -> {
- if (OS.IsPPC) return;
TCHAR url = new TCHAR (0, CookieUrl, true);
TCHAR cookieData = new TCHAR (0, 8192);
int[] size = new int[] {cookieData.length ()};
@@ -178,7 +176,6 @@ class IE extends WebBrowser {
};
NativeSetCookie = () -> {
- if (OS.IsPPC) return;
TCHAR url = new TCHAR (0, CookieUrl, true);
TCHAR value = new TCHAR (0, CookieValue, true);
CookieResult = OS.InternetSetCookie (url, null, value);
@@ -500,7 +497,7 @@ public void create(Composite parent, int style) {
TCHAR filePath1 = new TCHAR(0, url1, true);
TCHAR urlResult1 = new TCHAR(0, OS.INTERNET_MAX_URL_LENGTH);
int[] size1 = new int[] {urlResult1.length()};
- if (!OS.IsWinCE && OS.UrlCreateFromPath(filePath1, urlResult1, size1, 0) == COM.S_OK) {
+ if (OS.UrlCreateFromPath(filePath1, urlResult1, size1, 0) == COM.S_OK) {
url1 = urlResult1.toString(0, size1[0]);
} else {
url1 = PROTOCOL_FILE + url1.replace('\\', '/');
@@ -584,7 +581,7 @@ public void create(Composite parent, int style) {
TCHAR filePath2 = new TCHAR(0, url2, true);
TCHAR urlResult2 = new TCHAR(0, OS.INTERNET_MAX_URL_LENGTH);
int[] size2 = new int[] {urlResult2.length()};
- if (!OS.IsWinCE && OS.UrlCreateFromPath(filePath2, urlResult2, size2, 0) == COM.S_OK) {
+ if (OS.UrlCreateFromPath(filePath2, urlResult2, size2, 0) == COM.S_OK) {
url2 = urlResult2.toString(0, size2[0]);
} else {
url2 = PROTOCOL_FILE + url2.replace('\\', '/');
@@ -1339,13 +1336,13 @@ boolean navigate(String url, String postData, String headers[], boolean silent)
rgdispidNamedArgs[index++] = rgdispid[3];
}
boolean oldValue = false;
- if (silent && !OS.IsWinCE && IEVersion >= 7) {
+ if (silent && IEVersion >= 7) {
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 (silent && !OS.IsWinCE && IEVersion >= 7) {
+ if (silent && IEVersion >= 7) {
OS.CoInternetSetFeatureEnabled(OS.FEATURE_DISABLE_NAVIGATION_SOUNDS, OS.SET_FEATURE_ON_PROCESS, oldValue);
}
for (int i = 0; i < count; i++) {
@@ -1497,13 +1494,13 @@ public boolean setText(final String html, boolean trusted) {
int[] rgdispidNamedArgs = new int[1];
rgdispidNamedArgs[0] = rgdispid[1];
boolean oldValue = false;
- if (!OS.IsWinCE && IEVersion >= 7) {
+ if (IEVersion >= 7) {
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 && IEVersion >= 7) {
+ if (IEVersion >= 7) {
OS.CoInternetSetFeatureEnabled(OS.FEATURE_DISABLE_NAVIGATION_SOUNDS, OS.SET_FEATURE_ON_PROCESS, oldValue);
}
rgvarg[0].dispose();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/WebSite.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/WebSite.java
index 0266918897..a0827a36fc 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/WebSite.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/WebSite.java
@@ -436,45 +436,38 @@ int TranslateAccelerator(long /*int*/ lpMsg, long /*int*/ pguidCmdGroup, int nCm
switch (msg.message) {
case OS.WM_KEYDOWN:
case OS.WM_KEYUP: {
- if (!OS.IsWinCE) {
- boolean isAccent = false;
- switch ((int)/*64*/msg.wParam) {
- case OS.VK_SHIFT:
- case OS.VK_MENU:
- case OS.VK_CONTROL:
- case OS.VK_CAPITAL:
- case OS.VK_NUMLOCK:
- case OS.VK_SCROLL:
- break;
- default: {
- /*
- * Bug in Windows. The high bit in the result of MapVirtualKey() on
- * Windows NT is bit 32 while the high bit on Windows 95 is bit 16.
- * They should both be bit 32. The fix is to test the right bit.
- */
- int mapKey = OS.MapVirtualKey ((int)/*64*/msg.wParam, 2);
- if (mapKey != 0) {
- isAccent = (mapKey & (OS.IsWinNT ? 0x80000000 : 0x8000)) != 0;
- if (!isAccent) {
- for (int i=0; i<ACCENTS.length; i++) {
- int value = OS.VkKeyScan (ACCENTS [i]);
- if (value != -1 && (value & 0xFF) == msg.wParam) {
- int state = value >> 8;
- if ((OS.GetKeyState (OS.VK_SHIFT) < 0) == ((state & 0x1) != 0) &&
- (OS.GetKeyState (OS.VK_CONTROL) < 0) == ((state & 0x2) != 0) &&
- (OS.GetKeyState (OS.VK_MENU) < 0) == ((state & 0x4) != 0)) {
- if ((state & 0x7) != 0) isAccent = true;
- break;
- }
+ boolean isAccent = false;
+ switch ((int)/*64*/msg.wParam) {
+ case OS.VK_SHIFT:
+ case OS.VK_MENU:
+ case OS.VK_CONTROL:
+ case OS.VK_CAPITAL:
+ case OS.VK_NUMLOCK:
+ case OS.VK_SCROLL:
+ break;
+ default: {
+ int mapKey = OS.MapVirtualKey ((int)/*64*/msg.wParam, 2);
+ if (mapKey != 0) {
+ isAccent = (mapKey & 0x80000000) != 0;
+ if (!isAccent) {
+ for (int i=0; i<ACCENTS.length; i++) {
+ int value = OS.VkKeyScan (ACCENTS [i]);
+ if (value != -1 && (value & 0xFF) == msg.wParam) {
+ int state = value >> 8;
+ if ((OS.GetKeyState (OS.VK_SHIFT) < 0) == ((state & 0x1) != 0) &&
+ (OS.GetKeyState (OS.VK_CONTROL) < 0) == ((state & 0x2) != 0) &&
+ (OS.GetKeyState (OS.VK_MENU) < 0) == ((state & 0x4) != 0)) {
+ if ((state & 0x7) != 0) isAccent = true;
+ break;
}
}
}
}
- break;
}
+ break;
}
- if (isAccent) result = COM.S_OK;
}
+ if (isAccent) result = COM.S_OK;
}
}
return result;

Back to the top