Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikita Nemkin2020-01-21 21:22:52 +0000
committerNiraj Modi2020-02-06 19:40:22 +0000
commit3a2c1d63b5030ca10b7e2001ab2210eb232142bf (patch)
tree5c775c6b6007a55431471ac9705568c053181bb5
parent695a478b3de4b484ed4a11b8f9c082e368b152f4 (diff)
downloadeclipse.platform.swt-3a2c1d63b5030ca10b7e2001ab2210eb232142bf.tar.gz
eclipse.platform.swt-3a2c1d63b5030ca10b7e2001ab2210eb232142bf.tar.xz
eclipse.platform.swt-3a2c1d63b5030ca10b7e2001ab2210eb232142bf.zip
Bug 559389 - [Win32] Remove dead code and obsolete comments
Remove the following: * Display.getLastErrorText() - never used. * Canvas.clearArea() - never used. * Control.checkHandle() - pre-XP code to check GWLP_USERDATA. * DirectoryDialog.openCommonFileDialog() - pre-Vista code. * Some "This code is intentionally commented" comments that lost relevance. * All "Use the character encoding for the default locale" comments. * Win98/NT4 code in BidiUtil. Change-Id: I2833d3187656f758e9ee3b854f2458e2739e8fe7 Signed-off-by: Nikita Nemkin <nikita@nemkin.ru>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OLE.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c88
-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.h6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.c54
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.h14
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/BROWSEINFO.java31
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java38
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Printing/win32/org/eclipse/swt/printing/Printer.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Program/win32/org/eclipse/swt/program/Program.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebUIDelegate.java1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Device.java14
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/BidiUtil.java40
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Button.java16
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Canvas.java11
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ColorDialog.java42
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Combo.java7
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java32
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Decorations.java16
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/DirectoryDialog.java148
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java40
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FileDialog.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FontDialog.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MenuItem.java1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MessageBox.java9
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ScrollBar.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scrollable.java15
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java20
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Spinner.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java14
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TaskBar.java3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java20
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java40
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeItem.java8
35 files changed, 13 insertions, 778 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OLE.java b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OLE.java
index c10f62abf5..6e6b314a9b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OLE.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OLE.java
@@ -13,11 +13,11 @@
*******************************************************************************/
package org.eclipse.swt.ole.win32;
+import java.io.*;
+
import org.eclipse.swt.*;
-import java.io.File;
-import org.eclipse.swt.internal.ole.win32.COM;
-import org.eclipse.swt.internal.win32.OS;
-import org.eclipse.swt.internal.win32.TCHAR;
+import org.eclipse.swt.internal.ole.win32.*;
+import org.eclipse.swt.internal.win32.*;
/**
@@ -375,7 +375,6 @@ public static String findProgramID (String extension) {
if (extension.charAt (0) != '.') extension = "." + extension; //$NON-NLS-1$
- /* Use the character encoding for the default locale */
TCHAR extensionKey = new TCHAR(0, extension, true);
String result = getKeyValue(extensionKey);
if (result != null) {
@@ -404,7 +403,6 @@ static String getKeyValue (TCHAR key) {
if (length == 0) {
result = "";
} else {
- /* Use the character encoding for the default locale */
TCHAR lpData = new TCHAR (0, length);
if (OS.RegQueryValueEx (phkResult [0], null, 0, null, lpData, lpcbData) == 0) {
length = Math.max(0, lpData.length () - 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 aa93c83754..4a6ec03282 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
@@ -232,18 +232,6 @@ JNIEXPORT jint JNICALL OS_NATIVE(BP_1PAINTPARAMS_1sizeof)
}
#endif
-#ifndef NO_BROWSEINFO_1sizeof
-JNIEXPORT jint JNICALL OS_NATIVE(BROWSEINFO_1sizeof)
- (JNIEnv *env, jclass that)
-{
- jint rc = 0;
- OS_NATIVE_ENTER(env, that, BROWSEINFO_1sizeof_FUNC);
- rc = (jint)BROWSEINFO_sizeof();
- OS_NATIVE_EXIT(env, that, BROWSEINFO_1sizeof_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO_BUTTON_1IMAGELIST_1sizeof
JNIEXPORT jint JNICALL OS_NATIVE(BUTTON_1IMAGELIST_1sizeof)
(JNIEnv *env, jclass that)
@@ -2136,22 +2124,6 @@ fail:
}
#endif
-#ifndef NO_FormatMessage
-JNIEXPORT jint JNICALL OS_NATIVE(FormatMessage)
- (JNIEnv *env, jclass that, jint arg0, jlong arg1, jint arg2, jint arg3, jlongArray arg4, jint arg5, jlong arg6)
-{
- jlong *lparg4=NULL;
- jint rc = 0;
- OS_NATIVE_ENTER(env, that, FormatMessage_FUNC);
- if (arg4) if ((lparg4 = (*env)->GetLongArrayElements(env, arg4, NULL)) == NULL) goto fail;
- rc = (jint)FormatMessage(arg0, (LPCVOID)arg1, arg2, arg3, (LPWSTR)lparg4, arg5, (va_list*)arg6);
-fail:
- if (arg4 && lparg4) (*env)->ReleaseLongArrayElements(env, arg4, lparg4, 0);
- OS_NATIVE_EXIT(env, that, FormatMessage_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO_GCP_1RESULTS_1sizeof
JNIEXPORT jint JNICALL OS_NATIVE(GCP_1RESULTS_1sizeof)
(JNIEnv *env, jclass that)
@@ -7965,22 +7937,6 @@ JNIEXPORT jint JNICALL OS_NATIVE(SCROLLINFO_1sizeof)
}
#endif
-#ifndef NO_SHBrowseForFolder
-JNIEXPORT jlong JNICALL OS_NATIVE(SHBrowseForFolder)
- (JNIEnv *env, jclass that, jobject arg0)
-{
- BROWSEINFO _arg0, *lparg0=NULL;
- jlong rc = 0;
- OS_NATIVE_ENTER(env, that, SHBrowseForFolder_FUNC);
- if (arg0) if ((lparg0 = getBROWSEINFOFields(env, arg0, &_arg0)) == NULL) goto fail;
- rc = (jlong)SHBrowseForFolder((LPBROWSEINFOW)lparg0);
-fail:
- if (arg0 && lparg0) setBROWSEINFOFields(env, arg0, lparg0);
- OS_NATIVE_EXIT(env, that, SHBrowseForFolder_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO_SHDRAGIMAGE_1sizeof
JNIEXPORT jint JNICALL OS_NATIVE(SHDRAGIMAGE_1sizeof)
(JNIEnv *env, jclass that)
@@ -8036,38 +7992,6 @@ fail:
}
#endif
-#ifndef NO_SHGetMalloc
-JNIEXPORT jint JNICALL OS_NATIVE(SHGetMalloc)
- (JNIEnv *env, jclass that, jlongArray arg0)
-{
- jlong *lparg0=NULL;
- jint rc = 0;
- OS_NATIVE_ENTER(env, that, SHGetMalloc_FUNC);
- if (arg0) if ((lparg0 = (*env)->GetLongArrayElements(env, arg0, NULL)) == NULL) goto fail;
- rc = (jint)SHGetMalloc((LPMALLOC *)lparg0);
-fail:
- if (arg0 && lparg0) (*env)->ReleaseLongArrayElements(env, arg0, lparg0, 0);
- OS_NATIVE_EXIT(env, that, SHGetMalloc_FUNC);
- return rc;
-}
-#endif
-
-#ifndef NO_SHGetPathFromIDList
-JNIEXPORT jboolean JNICALL OS_NATIVE(SHGetPathFromIDList)
- (JNIEnv *env, jclass that, jlong arg0, jcharArray arg1)
-{
- jchar *lparg1=NULL;
- jboolean rc = 0;
- OS_NATIVE_ENTER(env, that, SHGetPathFromIDList_FUNC);
- if (arg1) if ((lparg1 = (*env)->GetCharArrayElements(env, arg1, NULL)) == NULL) goto fail;
- rc = (jboolean)SHGetPathFromIDList((LPCITEMIDLIST)arg0, (LPWSTR)lparg1);
-fail:
- if (arg1 && lparg1) (*env)->ReleaseCharArrayElements(env, arg1, lparg1, 0);
- OS_NATIVE_EXIT(env, that, SHGetPathFromIDList_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO_SIZE_1sizeof
JNIEXPORT jint JNICALL OS_NATIVE(SIZE_1sizeof)
(JNIEnv *env, jclass that)
@@ -9190,18 +9114,6 @@ fail:
}
#endif
-#ifndef NO_SetErrorMode
-JNIEXPORT jint JNICALL OS_NATIVE(SetErrorMode)
- (JNIEnv *env, jclass that, jint arg0)
-{
- jint rc = 0;
- OS_NATIVE_ENTER(env, that, SetErrorMode_FUNC);
- rc = (jint)SetErrorMode(arg0);
- OS_NATIVE_EXIT(env, that, SetErrorMode_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO_SetFocus
JNIEXPORT jlong JNICALL OS_NATIVE(SetFocus)
(JNIEnv *env, jclass that, jlong arg0)
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 a64f6d811c..1c12c8c057 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
@@ -36,7 +36,6 @@ char * OS_nativeFunctionNames[] = {
"BITMAP_1sizeof",
"BLENDFUNCTION_1sizeof",
"BP_1PAINTPARAMS_1sizeof",
- "BROWSEINFO_1sizeof",
"BUTTON_1IMAGELIST_1sizeof",
"BeginBufferedPaint",
"BeginDeferWindowPos",
@@ -173,7 +172,6 @@ char * OS_nativeFunctionNames[] = {
"FLICK_1POINT_1sizeof",
"FileTimeToSystemTime",
"FillRect",
- "FormatMessage",
"GCP_1RESULTS_1sizeof",
"GESTURECONFIG_1sizeof",
"GESTUREINFO_1sizeof",
@@ -597,13 +595,10 @@ char * OS_nativeFunctionNames[] = {
"SCRIPT_1STRING_1ANALYSIS_1sizeof",
"SCROLLBARINFO_1sizeof",
"SCROLLINFO_1sizeof",
- "SHBrowseForFolder",
"SHDRAGIMAGE_1sizeof",
"SHELLEXECUTEINFO_1sizeof",
"SHFILEINFO_1sizeof",
"SHGetFileInfo",
- "SHGetMalloc",
- "SHGetPathFromIDList",
"SIZE_1sizeof",
"STARTUPINFO_1sizeof",
"SYSTEMTIME_1sizeof",
@@ -674,7 +669,6 @@ char * OS_nativeFunctionNames[] = {
"SetCursorPos",
"SetDIBColorTable",
"SetDllDirectory",
- "SetErrorMode",
"SetFocus",
"SetForegroundWindow",
"SetGestureConfig",
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 8390bc4026..0faf8a4aa3 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
@@ -46,7 +46,6 @@ typedef enum {
BITMAP_1sizeof_FUNC,
BLENDFUNCTION_1sizeof_FUNC,
BP_1PAINTPARAMS_1sizeof_FUNC,
- BROWSEINFO_1sizeof_FUNC,
BUTTON_1IMAGELIST_1sizeof_FUNC,
BeginBufferedPaint_FUNC,
BeginDeferWindowPos_FUNC,
@@ -183,7 +182,6 @@ typedef enum {
FLICK_1POINT_1sizeof_FUNC,
FileTimeToSystemTime_FUNC,
FillRect_FUNC,
- FormatMessage_FUNC,
GCP_1RESULTS_1sizeof_FUNC,
GESTURECONFIG_1sizeof_FUNC,
GESTUREINFO_1sizeof_FUNC,
@@ -607,13 +605,10 @@ typedef enum {
SCRIPT_1STRING_1ANALYSIS_1sizeof_FUNC,
SCROLLBARINFO_1sizeof_FUNC,
SCROLLINFO_1sizeof_FUNC,
- SHBrowseForFolder_FUNC,
SHDRAGIMAGE_1sizeof_FUNC,
SHELLEXECUTEINFO_1sizeof_FUNC,
SHFILEINFO_1sizeof_FUNC,
SHGetFileInfo_FUNC,
- SHGetMalloc_FUNC,
- SHGetPathFromIDList_FUNC,
SIZE_1sizeof_FUNC,
STARTUPINFO_1sizeof_FUNC,
SYSTEMTIME_1sizeof_FUNC,
@@ -684,7 +679,6 @@ typedef enum {
SetCursorPos_FUNC,
SetDIBColorTable_FUNC,
SetDllDirectory_FUNC,
- SetErrorMode_FUNC,
SetFocus_FUNC,
SetForegroundWindow_FUNC,
SetGestureConfig_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 3bb1523d8c..0b48b8495f 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2019 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -300,58 +300,6 @@ void setBP_PAINTPARAMSFields(JNIEnv *env, jobject lpObject, BP_PAINTPARAMS *lpSt
}
#endif
-#ifndef NO_BROWSEINFO
-typedef struct BROWSEINFO_FID_CACHE {
- int cached;
- jclass clazz;
- jfieldID hwndOwner, pidlRoot, pszDisplayName, lpszTitle, ulFlags, lpfn, lParam, iImage;
-} BROWSEINFO_FID_CACHE;
-
-BROWSEINFO_FID_CACHE BROWSEINFOFc;
-
-void cacheBROWSEINFOFields(JNIEnv *env, jobject lpObject)
-{
- if (BROWSEINFOFc.cached) return;
- BROWSEINFOFc.clazz = (*env)->GetObjectClass(env, lpObject);
- BROWSEINFOFc.hwndOwner = (*env)->GetFieldID(env, BROWSEINFOFc.clazz, "hwndOwner", "J");
- BROWSEINFOFc.pidlRoot = (*env)->GetFieldID(env, BROWSEINFOFc.clazz, "pidlRoot", "J");
- BROWSEINFOFc.pszDisplayName = (*env)->GetFieldID(env, BROWSEINFOFc.clazz, "pszDisplayName", "J");
- BROWSEINFOFc.lpszTitle = (*env)->GetFieldID(env, BROWSEINFOFc.clazz, "lpszTitle", "J");
- BROWSEINFOFc.ulFlags = (*env)->GetFieldID(env, BROWSEINFOFc.clazz, "ulFlags", "I");
- BROWSEINFOFc.lpfn = (*env)->GetFieldID(env, BROWSEINFOFc.clazz, "lpfn", "J");
- BROWSEINFOFc.lParam = (*env)->GetFieldID(env, BROWSEINFOFc.clazz, "lParam", "J");
- BROWSEINFOFc.iImage = (*env)->GetFieldID(env, BROWSEINFOFc.clazz, "iImage", "I");
- BROWSEINFOFc.cached = 1;
-}
-
-BROWSEINFO *getBROWSEINFOFields(JNIEnv *env, jobject lpObject, BROWSEINFO *lpStruct)
-{
- if (!BROWSEINFOFc.cached) cacheBROWSEINFOFields(env, lpObject);
- lpStruct->hwndOwner = (HWND)(*env)->GetLongField(env, lpObject, BROWSEINFOFc.hwndOwner);
- lpStruct->pidlRoot = (LPCITEMIDLIST)(*env)->GetLongField(env, lpObject, BROWSEINFOFc.pidlRoot);
- lpStruct->pszDisplayName = (LPTSTR)(*env)->GetLongField(env, lpObject, BROWSEINFOFc.pszDisplayName);
- lpStruct->lpszTitle = (LPCTSTR)(*env)->GetLongField(env, lpObject, BROWSEINFOFc.lpszTitle);
- lpStruct->ulFlags = (*env)->GetIntField(env, lpObject, BROWSEINFOFc.ulFlags);
- lpStruct->lpfn = (BFFCALLBACK)(*env)->GetLongField(env, lpObject, BROWSEINFOFc.lpfn);
- lpStruct->lParam = (*env)->GetLongField(env, lpObject, BROWSEINFOFc.lParam);
- lpStruct->iImage = (*env)->GetIntField(env, lpObject, BROWSEINFOFc.iImage);
- return lpStruct;
-}
-
-void setBROWSEINFOFields(JNIEnv *env, jobject lpObject, BROWSEINFO *lpStruct)
-{
- if (!BROWSEINFOFc.cached) cacheBROWSEINFOFields(env, lpObject);
- (*env)->SetLongField(env, lpObject, BROWSEINFOFc.hwndOwner, (jlong)lpStruct->hwndOwner);
- (*env)->SetLongField(env, lpObject, BROWSEINFOFc.pidlRoot, (jlong)lpStruct->pidlRoot);
- (*env)->SetLongField(env, lpObject, BROWSEINFOFc.pszDisplayName, (jlong)lpStruct->pszDisplayName);
- (*env)->SetLongField(env, lpObject, BROWSEINFOFc.lpszTitle, (jlong)lpStruct->lpszTitle);
- (*env)->SetIntField(env, lpObject, BROWSEINFOFc.ulFlags, (jint)lpStruct->ulFlags);
- (*env)->SetLongField(env, lpObject, BROWSEINFOFc.lpfn, (jlong)lpStruct->lpfn);
- (*env)->SetLongField(env, lpObject, BROWSEINFOFc.lParam, (jlong)lpStruct->lParam);
- (*env)->SetIntField(env, lpObject, BROWSEINFOFc.iImage, (jint)lpStruct->iImage);
-}
-#endif
-
#ifndef NO_BUTTON_IMAGELIST
typedef struct BUTTON_IMAGELIST_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 6182b6c01b..9ac559204a 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2019 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -89,18 +89,6 @@ void setBP_PAINTPARAMSFields(JNIEnv *env, jobject lpObject, BP_PAINTPARAMS *lpSt
#define BP_PAINTPARAMS_sizeof() 0
#endif
-#ifndef NO_BROWSEINFO
-void cacheBROWSEINFOFields(JNIEnv *env, jobject lpObject);
-BROWSEINFO *getBROWSEINFOFields(JNIEnv *env, jobject lpObject, BROWSEINFO *lpStruct);
-void setBROWSEINFOFields(JNIEnv *env, jobject lpObject, BROWSEINFO *lpStruct);
-#define BROWSEINFO_sizeof() sizeof(BROWSEINFO)
-#else
-#define cacheBROWSEINFOFields(a,b)
-#define getBROWSEINFOFields(a,b,c) NULL
-#define setBROWSEINFOFields(a,b,c)
-#define BROWSEINFO_sizeof() 0
-#endif
-
#ifndef NO_BUTTON_IMAGELIST
void cacheBUTTON_IMAGELISTFields(JNIEnv *env, jobject lpObject);
BUTTON_IMAGELIST *getBUTTON_IMAGELISTFields(JNIEnv *env, jobject lpObject, BUTTON_IMAGELIST *lpStruct);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/BROWSEINFO.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/BROWSEINFO.java
deleted file mode 100644
index 3a9ee0731b..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/BROWSEINFO.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.internal.win32;
-
-public class BROWSEINFO {
- /** @field cast=(HWND) */
- public long hwndOwner;
- /** @field cast=(LPCITEMIDLIST) */
- public long pidlRoot;
- /** @field cast=(LPTSTR) */
- public long pszDisplayName;
- /** @field cast=(LPCTSTR) */
- public long lpszTitle;
- public int ulFlags;
- /** @field cast=(BFFCALLBACK) */
- public long lpfn;
- public long lParam;
- public int iImage;
- public static final int sizeof = OS.BROWSEINFO_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 2b8352f9d1..e941b2b877 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
@@ -113,19 +113,12 @@ public class OS extends C {
public static final int BDR_INNER = 0x000c;
public static final int BDR_RAISED = 0x0005;
public static final int BDR_SUNKEN = 0x000a;
- public static final int BFFM_INITIALIZED = 0x1;
- public static final int BFFM_SETSELECTION = 0x467;
- public static final int BFFM_VALIDATEFAILED = 0x4;
public static final int BF_ADJUST = 0x2000;
public static final int BF_LEFT = 0x0001;
public static final int BF_TOP = 0x0002;
public static final int BF_RIGHT = 0x0004;
public static final int BF_BOTTOM = 0x0008;
public static final int BF_RECT = (BF_LEFT | BF_TOP | BF_RIGHT | BF_BOTTOM);
- public static final int BIF_EDITBOX = 0x10;
- public static final int BIF_NEWDIALOGSTYLE = 0x40;
- public static final int BIF_RETURNONLYFSDIRS = 0x1;
- public static final int BIF_VALIDATE = 0x20;
public static final int BITSPIXEL = 0xc;
public static final int BI_BITFIELDS = 3;
public static final int BI_RGB = 0;
@@ -347,10 +340,6 @@ public class OS extends C {
public static final int CWP_SKIPINVISIBLE = 0x0001;
public static final String DATETIMEPICK_CLASS = "SysDateTimePick32"; //$NON-NLS-1$
public static final int DCX_CACHE = 0x2;
- public static final int DCX_CLIPCHILDREN = 0x8;
- public static final int DCX_CLIPSIBLINGS = 0x10;
- public static final int DCX_INTERSECTRGN = 0x80;
- public static final int DCX_WINDOW = 0x1;
public static final int DEFAULT_CHARSET = 0x1;
public static final int DEFAULT_GUI_FONT = 0x11;
public static final int DFCS_BUTTONCHECK = 0x0;
@@ -514,9 +503,6 @@ public class OS extends C {
public static final int FLICKDIRECTION_INVALID = 8;
public static final int FNERR_INVALIDFILENAME = 0x3002;
public static final int FNERR_BUFFERTOOSMALL = 0x3003;
- public static final int FORMAT_MESSAGE_ALLOCATE_BUFFER = 0x00000100;
- public static final int FORMAT_MESSAGE_FROM_SYSTEM = 0x00001000;
- public static final int FORMAT_MESSAGE_IGNORE_INSERTS = 0x00000200;
public static final int FOS_NOCHANGEDIR = 0x8;
public static final int FOS_PICKFOLDERS = 0x20;
public static final int FOS_FORCEFILESYSTEM = 0x40;
@@ -718,7 +704,6 @@ public class OS extends C {
public static final int LANG_JAPANESE = 0x11;
public static final int LANG_KOREAN = 0x12;
public static final int LANG_NEUTRAL = 0x0;
- public static final int LANG_USER_DEFAULT = 1 << 10;
public static final int LAYOUT_RTL = 0x1;
public static final int LBN_DBLCLK = 0x2;
public static final int LBN_SELCHANGE = 0x1;
@@ -1259,7 +1244,6 @@ public class OS extends C {
public static final int SCRBS_HOT = 2;
public static final int SCRBS_PRESSED = 3;
public static final int SCRBS_DISABLED = 4;
- public static final int SEM_FAILCRITICALERRORS = 0x1;
public static final int SET_FEATURE_ON_PROCESS = 0x2;
public static final int SHADEBLENDCAPS = 120;
public static final int SHGFI_ICON = 0x000000100;
@@ -1981,7 +1965,6 @@ public static final native int BITMAP_sizeof ();
public static final native int BITMAPINFOHEADER_sizeof ();
public static final native int BLENDFUNCTION_sizeof ();
public static final native int BP_PAINTPARAMS_sizeof ();
-public static final native int BROWSEINFO_sizeof ();
public static final native int BUTTON_IMAGELIST_sizeof ();
public static final native int CANDIDATEFORM_sizeof ();
public static final native int CERT_CONTEXT_sizeof ();
@@ -2348,11 +2331,6 @@ public static final boolean SetWindowText (long hWnd, TCHAR lpString) {
return SetWindowText (hWnd, lpString1);
}
-public static final boolean SHGetPathFromIDList (long pidl, TCHAR pszPath) {
- char [] pszPath1 = pszPath == null ? null : pszPath.chars;
- return SHGetPathFromIDList (pidl, pszPath1);
-}
-
public static final boolean UnregisterClass (TCHAR lpClassName, long hInstance) {
char [] lpClassName1 = lpClassName == null ? null : lpClassName.chars;
return UnregisterClass (lpClassName1, hInstance);
@@ -2751,12 +2729,6 @@ public static final native boolean FileTimeToSystemTime (FILETIME lpFileTime, SY
* @param hbr cast=(HBRUSH)
*/
public static final native int FillRect (long hDC, RECT lprc, long hbr);
-/**
- * @param lpSource cast=(LPCVOID)
- * @param lpBuffer cast=(LPWSTR)
- * @param Arguments cast=(va_list*)
- */
-public static final native int FormatMessage (int dwFlags, long lpSource, int dwMessageId, int dwLanguageId, long [] lpBuffer, int nSize, long Arguments);
/** @param dwLimit cast=(DWORD) */
public static final native int GdiSetBatchLimit (int dwLimit);
public static final native int GET_WHEEL_DELTA_WPARAM(long wParam);
@@ -4359,7 +4331,6 @@ public static final native boolean SetCursorPos (int X, int Y);
*/
public static final native int SetDIBColorTable (long hdc, int uStartIndex, int cEntries, byte[] pColors);
public static final native boolean SetDllDirectory (char [] lpString);
-public static final native int SetErrorMode (int uMode);
/** @param hWnd cast=(HWND) */
public static final native long SetFocus (long hWnd);
/** @param hWnd cast=(HWND) */
@@ -4473,8 +4444,6 @@ public static final native long SetWindowsHookEx (int idHook, long lpfn, long h
* @param lpXform cast=(XFORM *)
*/
public static final native boolean SetWorldTransform(long hdc, float[] lpXform);
-/** @param lpbi cast=(LPBROWSEINFOW) */
-public static final native long SHBrowseForFolder (BROWSEINFO lpbi);
/**
* @param pszPath cast=(LPCWSTR)
* @param psfi cast=(SHFILEINFOW *)
@@ -4483,13 +4452,6 @@ public static final native long SHGetFileInfo (char [] pszPath, int dwFileAttrib
/** @param lpExecInfo cast=(LPSHELLEXECUTEINFOW) */
public static final native boolean ShellExecuteEx (SHELLEXECUTEINFO lpExecInfo);
public static final native boolean Shell_NotifyIcon (int dwMessage, NOTIFYICONDATA lpData);
-/** @param ppMalloc cast=(LPMALLOC *) */
-public static final native int SHGetMalloc (long [] ppMalloc);
-/**
- * @param pidl cast=(LPCITEMIDLIST)
- * @param pszPath cast=(LPWSTR)
- */
-public static final native boolean SHGetPathFromIDList (long pidl, char [] pszPath);
/** @param hWnd cast=(HWND) */
public static final native boolean ShowCaret (long hWnd);
/** @param hWnd cast=(HWND) */
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Printing/win32/org/eclipse/swt/printing/Printer.java b/bundles/org.eclipse.swt/Eclipse SWT Printing/win32/org/eclipse/swt/printing/Printer.java
index 4e68b8bfba..89743c283e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Printing/win32/org/eclipse/swt/printing/Printer.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Printing/win32/org/eclipse/swt/printing/Printer.java
@@ -86,7 +86,6 @@ public final class Printer extends Device {
*/
public static PrinterData[] getPrinterList() {
int length = 1024;
- /* Use the character encoding for the default locale */
TCHAR buf = new TCHAR(0, length);
TCHAR nullBuf = new TCHAR(0, 1);
int n = OS.GetProfileString(profile, null, nullBuf, buf, length);
@@ -134,7 +133,6 @@ public static PrinterData[] getPrinterList() {
public static PrinterData getDefaultPrinterData() {
String deviceName = null;
int length = 1024;
- /* Use the character encoding for the default locale */
TCHAR buf = new TCHAR(0, length);
TCHAR nullBuf = new TCHAR(0, 1);
int n = OS.GetProfileString(appName, keyName, nullBuf, buf, length);
@@ -215,7 +213,6 @@ public Printer(PrinterData data) {
@Override
protected void create(DeviceData deviceData) {
data = (PrinterData)deviceData;
- /* Use the character encoding for the default locale */
TCHAR driver = new TCHAR(0, data.driver, true);
TCHAR device = new TCHAR(0, data.name, true);
long lpInitData = 0;
@@ -360,7 +357,6 @@ public boolean startJob(String jobName) {
long hHeap = OS.GetProcessHeap();
long lpszDocName = 0;
if (jobName != null && jobName.length() != 0) {
- /* Use the character encoding for the default locale */
TCHAR buffer = new TCHAR(0, jobName, true);
int byteCount = buffer.length() * TCHAR.sizeof;
lpszDocName = OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, byteCount);
@@ -373,7 +369,6 @@ public boolean startJob(String jobName) {
/* Prompt the user for a file name. */
data.fileName = "FILE:"; //$NON-NLS-1$
}
- /* Use the character encoding for the default locale */
TCHAR buffer = new TCHAR(0, data.fileName, true);
int byteCount = buffer.length() * TCHAR.sizeof;
lpszOutput = OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, byteCount);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Program/win32/org/eclipse/swt/program/Program.java b/bundles/org.eclipse.swt/Eclipse SWT Program/win32/org/eclipse/swt/program/Program.java
index dd390980cf..c8481e5205 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Program/win32/org/eclipse/swt/program/Program.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Program/win32/org/eclipse/swt/program/Program.java
@@ -84,7 +84,6 @@ public static Program findProgram (String extension) {
if (extension == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
if (extension.length () == 0) return null;
if (extension.charAt (0) != '.') extension = "." + extension; //$NON-NLS-1$
- /* Use the character encoding for the default locale */
TCHAR key = new TCHAR (0, extension, true);
Program program = null;
String command = assocQueryString (OS.ASSOCSTR_COMMAND, key, true);
@@ -139,7 +138,6 @@ public static String [] getExtensions () {
}
static String getKeyValue (String string, boolean expand) {
- /* Use the character encoding for the default locale */
TCHAR key = new TCHAR (0, string, true);
long [] phkResult = new long [1];
if (OS.RegOpenKeyEx (OS.HKEY_CLASSES_ROOT, key, 0, OS.KEY_READ, phkResult) != 0) {
@@ -277,7 +275,6 @@ public static boolean launch (String fileName) {
public static boolean launch (String fileName, String workingDir) {
if (fileName == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- /* Use the character encoding for the default locale */
long hHeap = OS.GetProcessHeap ();
TCHAR buffer = new TCHAR (0, fileName, true);
int byteCount = buffer.length () * TCHAR.sizeof;
@@ -334,7 +331,6 @@ public boolean execute (String fileName) {
if (append) fileName = " \"" + fileName + "\"";
String commandLine = prefix + fileName + suffix;
long hHeap = OS.GetProcessHeap ();
- /* Use the character encoding for the default locale */
TCHAR buffer = new TCHAR (0, commandLine, true);
int byteCount = buffer.length () * TCHAR.sizeof;
long lpCommandLine = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount);
@@ -386,7 +382,6 @@ public ImageData getImageData () {
fileName = fileName.substring (1, length - 1);
}
}
- /* Use the character encoding for the default locale */
TCHAR lpszFile = new TCHAR (0, fileName, true);
long [] phiconSmall = new long[1], phiconLarge = null;
OS.ExtractIconEx (lpszFile, nIconIndex, phiconLarge, phiconSmall, 1);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebUIDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebUIDelegate.java
index ff56a9f9f0..b24a10f389 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebUIDelegate.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebUIDelegate.java
@@ -350,7 +350,6 @@ int printFrame (long webView, long frame) {
long hHeap = OS.GetProcessHeap ();
long lpszDocName = 0;
if (jobName != null && jobName.length () != 0) {
- /* Use the character encoding for the default locale */
TCHAR buffer = new TCHAR (0, jobName, true);
int byteCount = buffer.length () * TCHAR.sizeof;
lpszDocName = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Device.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Device.java
index b9b7a31aae..d803b0a895 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Device.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Device.java
@@ -515,7 +515,6 @@ public FontData [] getFontList (String faceName, boolean scalable) {
OS.EnumFontFamilies (hDC, lf.lfFaceName, lpEnumFontFamProc, scalable ? 1 : 0);
}
} else {
- /* Use the character encoding for the default locale */
TCHAR lpFaceName = new TCHAR (0, faceName, true);
OS.EnumFontFamilies (hDC, lpFaceName.chars, lpEnumFontFamProc, scalable ? 1 : 0);
}
@@ -553,19 +552,6 @@ String getLastError () {
return " [GetLastError=0x" + Integer.toHexString(error) + "]"; //$NON-NLS-1$ //$NON-NLS-2$
}
-String getLastErrorText () {
- int error = OS.GetLastError();
- if (error == 0) return ""; //$NON-NLS-1$
- long [] buffer = new long [1];
- int dwFlags = OS.FORMAT_MESSAGE_ALLOCATE_BUFFER | OS.FORMAT_MESSAGE_FROM_SYSTEM | OS.FORMAT_MESSAGE_IGNORE_INSERTS;
- int length = OS.FormatMessage(dwFlags, 0, error, OS.LANG_USER_DEFAULT, buffer, 0, 0);
- if (length == 0) return " [GetLastError=0x" + Integer.toHexString(error) + "]"; //$NON-NLS-1$ //$NON-NLS-2$
- char [] buffer1 = new char [length];
- OS.MoveMemory(buffer1, buffer[0], length * TCHAR.sizeof);
- if (buffer[0] != 0) OS.LocalFree(buffer[0]);
- return new String(buffer1);
-}
-
/**
* Returns the matching standard color for the given
* constant, which should be one of the color constants
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/BidiUtil.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/BidiUtil.java
index e673953d1b..04edec1b55 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/BidiUtil.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/BidiUtil.java
@@ -43,20 +43,7 @@ public class BidiUtil {
// switching
static Map<LONG, Runnable> languageMap = new HashMap<> ();
static Map<LONG, LONG> oldProcMap = new HashMap<> ();
- /*
- * This code is intentionally commented. In order
- * to support CLDC, .class cannot be used because
- * it does not compile on some Java compilers when
- * they are targeted for CLDC.
- */
- // static Callback callback = new Callback (BidiUtil.class, "windowProc", 4);
- static final String CLASS_NAME = "org.eclipse.swt.internal.BidiUtil"; //$NON-NLS-1$
- static Callback callback;
- static {
- try {
- callback = new Callback (Class.forName (CLASS_NAME), "windowProc", 4); //$NON-NLS-1$
- } catch (ClassNotFoundException e) {}
- }
+ static Callback callback = new Callback (BidiUtil.class, "windowProc", 4); //$NON-NLS-1$
// GetCharacterPlacement constants
static final int GCP_REORDER = 0x0002;
@@ -76,9 +63,6 @@ public class BidiUtil {
static final int LANG_ARABIC = 0x01;
static final int LANG_HEBREW = 0x0d;
static final int LANG_FARSI = 0x29;
- // code page identifiers
- static final String CD_PG_HEBREW = "1255"; //$NON-NLS-1$
- static final String CD_PG_ARABIC = "1256"; //$NON-NLS-1$
// ActivateKeyboard constants
static final int HKL_NEXT = 1;
static final int HKL_PREV = 0;
@@ -439,21 +423,9 @@ public static boolean isBidiPlatform() {
// languages, but only install the Thai keyboard).
if (!isKeyboardBidi()) return false;
- Callback callback = null;
- try {
- callback = new Callback (Class.forName (CLASS_NAME), "EnumSystemLanguageGroupsProc", 5); //$NON-NLS-1$
- OS.EnumSystemLanguageGroups(callback.getAddress (), OS.LGRPID_INSTALLED, 0);
- callback.dispose ();
- } catch (ClassNotFoundException e) {
- //callback can only be null at this point
- }
- if (isBidiPlatform == 1) return true;
- // need to look at system code page for NT & 98 platforms since EnumSystemLanguageGroups is
- // not supported for these platforms
- String codePage = String.valueOf(OS.GetACP());
- if (CD_PG_ARABIC.equals(codePage) || CD_PG_HEBREW.equals(codePage)) {
- isBidiPlatform = 1;
- }
+ Callback callback = new Callback (BidiUtil.class, "EnumSystemLanguageGroupsProc", 5); //$NON-NLS-1$
+ OS.EnumSystemLanguageGroups(callback.getAddress (), OS.LGRPID_INSTALLED, 0);
+ callback.dispose ();
return isBidiPlatform == 1;
}
/**
@@ -503,10 +475,6 @@ public static int resolveTextDirection (String text) {
int length = text.length();
if (length == 0) return SWT.NONE;
char[] rtlProbe = {' ', ' ', '1'};
- /*
- * "Wide" version of win32 API can also run even on non-Unicode Windows,
- * hence need for OS.IsUnicode check here.
- */
char[] ltrProbe = {'\u202b', 'a', ' '};
char[] numberProbe = {'\u05d0', ' ', ' '};
GCP_RESULTS result = new GCP_RESULTS();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Button.java
index 7a75b4f67d..25efa6873f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Button.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Button.java
@@ -733,22 +733,6 @@ int resolveTextDirection() {
}
void selectRadio () {
- /*
- * This code is intentionally commented. When two groups
- * of radio buttons with the same parent are separated by
- * another control, the correct behavior should be that
- * the two groups act independently. This is consistent
- * with radio tool and menu items. The commented code
- * implements this behavior.
- */
-// int index = 0;
-// Control [] children = parent._getChildren ();
-// while (index < children.length && children [index] != this) index++;
-// int i = index - 1;
-// while (i >= 0 && children [i].setRadioSelection (false)) --i;
-// int j = index + 1;
-// while (j < children.length && children [j].setRadioSelection (false)) j++;
-// setSelection (true);
for (Control child : parent._getChildren ()) {
if (this != child) child.setRadioSelection (false);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Canvas.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Canvas.java
index 500dd4da05..ad529fa85b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Canvas.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Canvas.java
@@ -81,17 +81,6 @@ public Canvas (Composite parent, int style) {
super (parent, style);
}
-void clearArea (int x, int y, int width, int height) {
- checkWidget ();
- if (OS.IsWindowVisible (handle)) {
- RECT rect = new RECT ();
- OS.SetRect (rect, x, y, x + width, y + height);
- long hDC = OS.GetDCEx (handle, 0, OS.DCX_CACHE | OS.DCX_CLIPCHILDREN | OS.DCX_CLIPSIBLINGS);
- drawBackground (hDC, rect);
- OS.ReleaseDC (handle, hDC);
- }
-}
-
/**
* Fills the interior of the rectangle specified by the arguments,
* with the receiver's background.
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ColorDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ColorDialog.java
index e710020139..77f7422904 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ColorDialog.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ColorDialog.java
@@ -38,8 +38,6 @@ import org.eclipse.swt.internal.win32.*;
*/
public class ColorDialog extends Dialog {
static final int CUSTOM_COLOR_COUNT = 16; // from the MS spec for CHOOSECOLOR.lpCustColors
- Display display;
- int width, height;
RGB rgb;
RGB [] rgbs;
int [] colors = new int [CUSTOM_COLOR_COUNT];
@@ -101,31 +99,12 @@ public ColorDialog (Shell parent, int style) {
long CCHookProc (long hdlg, long uiMsg, long lParam, long lpData) {
switch ((int)uiMsg) {
case OS.WM_INITDIALOG: {
- RECT rect = new RECT ();
- OS.GetWindowRect (hdlg, rect);
- width = rect.right - rect.left;
- height = rect.bottom - rect.top;
if (title != null && title.length () != 0) {
- /* Use the character encoding for the default locale */
TCHAR buffer = new TCHAR (0, title, true);
OS.SetWindowText (hdlg, buffer);
}
break;
}
- case OS.WM_DESTROY: {
- RECT rect = new RECT ();
- OS.GetWindowRect (hdlg, rect);
- int newWidth = rect.right - rect.left;
- int newHeight = rect.bottom - rect.top;
- if (newWidth < width || newHeight < height) {
- //display.fullOpen = false;
- } else {
- if (newWidth > width || newHeight > height) {
- //display.fullOpen = true;
- }
- }
- break;
- }
}
return 0;
}
@@ -204,7 +183,7 @@ public RGB open () {
long lpfnHook = callback.getAddress ();
/* Allocate the Custom Colors and initialize to white */
- display = parent.display;
+ Display display = parent.display;
if (display.lpCustColors == 0) {
long hHeap = OS.GetProcessHeap ();
display.lpCustColors = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, CUSTOM_COLOR_COUNT * 4);
@@ -234,7 +213,6 @@ public RGB open () {
CHOOSECOLOR lpcc = new CHOOSECOLOR ();
lpcc.lStructSize = CHOOSECOLOR.sizeof;
lpcc.Flags = OS.CC_ANYCOLOR | OS.CC_ENABLEHOOK;
- //if (display.fullOpen) lpcc.Flags |= OS.CC_FULLOPEN;
lpcc.lpfnHook = lpfnHook;
lpcc.hwndOwner = hwndOwner;
lpcc.lpCustColors = display.lpCustColors;
@@ -295,15 +273,6 @@ public RGB open () {
/* Free the CCHookProc */
callback.dispose ();
- /* Free the Custom Colors */
- /*
- * This code is intentionally commented. Currently,
- * there is exactly one set of custom colors per display.
- * The memory associated with these colors is released
- * when the display is disposed.
- */
-// if (lpCustColors != 0) OS.HeapFree (hHeap, 0, lpCustColors);
-
/* Destroy the BIDI orientation window */
if (hwndParent != hwndOwner) {
if (enabled) OS.EnableWindow (hwndParent, true);
@@ -311,15 +280,6 @@ public RGB open () {
OS.DestroyWindow (hwndOwner);
}
- /*
- * This code is intentionally commented. On some
- * platforms, the owner window is repainted right
- * away when a dialog window exits. This behavior
- * is currently unspecified.
- */
-// if (hwndOwner != 0) OS.UpdateWindow (hwndOwner);
-
- display = null;
if (!success) return null;
return rgb;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Combo.java
index 986ba52000..7897fde2ac 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Combo.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Combo.java
@@ -142,8 +142,6 @@ public class Combo extends Composite {
*/
public Combo (Composite parent, int style) {
super (parent, checkStyle (style));
- /* This code is intentionally commented */
- //if ((style & SWT.H_SCROLL) != 0) this.style |= SWT.H_SCROLL;
this.style |= SWT.H_SCROLL;
}
@@ -512,11 +510,6 @@ long CBTProc (long nCode, long wParam, long lParam) {
}
@Override
-boolean checkHandle (long hwnd) {
- return hwnd == handle || hwnd == OS.GetDlgItem (handle, CBID_EDIT) || hwnd == OS.GetDlgItem (handle, CBID_LIST);
-}
-
-@Override
protected void checkSubclass () {
if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java
index deee860ea9..dfeab2eb56 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java
@@ -975,16 +975,6 @@ boolean resizeChildren (boolean defer, WINDOWPOS [] pwp) {
}
for (WINDOWPOS wp : pwp) {
if (wp != null) {
- /*
- * This code is intentionally commented. All widgets that
- * are created by SWT have WS_CLIPSIBLINGS to ensure that
- * application code does not draw outside of the control.
- */
-// int count = parent.getChildrenCount ();
-// if (count > 1) {
-// int bits = OS.GetWindowLong (handle, OS.GWL_STYLE);
-// if ((bits & OS.WS_CLIPSIBLINGS) == 0) wp.flags |= OS.SWP_NOCOPYBITS;
-// }
if (defer) {
hdwp = OS.DeferWindowPos (hdwp, wp.hwnd, 0, wp.x, wp.y, wp.cx, wp.cy, wp.flags);
if (hdwp == 0) return false;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
index 7b5ef3e77f..44c79eda94 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
@@ -582,10 +582,6 @@ void checkComposited () {
/* Do nothing */
}
-boolean checkHandle (long hwnd) {
- return hwnd == handle;
-}
-
void checkMirrored () {
if ((style & SWT.RIGHT_TO_LEFT) != 0) {
int bits = OS.GetWindowLong (handle, OS.GWL_EXSTYLE);
@@ -1114,16 +1110,6 @@ void forceResize () {
for (int i=0; i<lpwp.length; i++) {
WINDOWPOS wp = lpwp [i];
if (wp != null && wp.hwnd == handle) {
- /*
- * This code is intentionally commented. All widgets that
- * are created by SWT have WS_CLIPSIBLINGS to ensure that
- * application code does not draw outside of the control.
- */
-// int count = parent.getChildrenCount ();
-// if (count > 1) {
-// int bits = OS.GetWindowLong (handle, OS.GWL_STYLE);
-// if ((bits & OS.WS_CLIPSIBLINGS) == 0) wp.flags |= OS.SWP_NOCOPYBITS;
-// }
OS.SetWindowPos (wp.hwnd, 0, wp.x, wp.y, wp.cx, wp.cy, wp.flags);
lpwp [i] = null;
return;
@@ -1274,7 +1260,6 @@ String getClipboardText () {
int byteCount = OS.GlobalSize (hMem) / TCHAR.sizeof * TCHAR.sizeof;
long ptr = OS.GlobalLock (hMem);
if (ptr != 0) {
- /* Use the character encoding for the default locale */
TCHAR buffer = new TCHAR (0, byteCount / TCHAR.sizeof);
OS.MoveMemory (buffer, ptr, byteCount);
string = buffer.toString (0, buffer.strlen ());
@@ -4665,9 +4650,6 @@ CREATESTRUCT widgetCreateStruct () {
int widgetExtStyle () {
int bits = 0;
if ((style & SWT.BORDER) != 0) bits |= OS.WS_EX_CLIENTEDGE;
-// if ((style & SWT.BORDER) != 0) {
-// if ((style & SWT.FLAT) == 0) bits |= OS.WS_EX_CLIENTEDGE;
-// }
bits |= OS.WS_EX_NOINHERITLAYOUT;
if ((style & SWT.RIGHT_TO_LEFT) != 0) bits |= OS.WS_EX_LAYOUTRTL;
if ((style & SWT.FLIP_TEXT_DIRECTION) != 0) bits |= OS.WS_EX_RTLREADING;
@@ -4681,21 +4663,7 @@ long widgetParent () {
int widgetStyle () {
/* Force clipping of siblings by setting WS_CLIPSIBLINGS */
int bits = OS.WS_CHILD | OS.WS_VISIBLE | OS.WS_CLIPSIBLINGS;
-// if ((style & SWT.BORDER) != 0) {
-// if ((style & SWT.FLAT) != 0) bits |= OS.WS_BORDER;
-// }
return bits;
-
- /*
- * This code is intentionally commented. When clipping
- * of both siblings and children is not enforced, it is
- * possible for application code to draw outside of the
- * control.
- */
-// int bits = OS.WS_CHILD | OS.WS_VISIBLE;
-// if ((style & SWT.CLIP_SIBLINGS) != 0) bits |= OS.WS_CLIPSIBLINGS;
-// if ((style & SWT.CLIP_CHILDREN) != 0) bits |= OS.WS_CLIPCHILDREN;
-// return bits;
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Decorations.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Decorations.java
index 03f57631ba..4d8ad21228 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Decorations.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Decorations.java
@@ -236,21 +236,6 @@ static int checkStyle (int style) {
*/
if ((style & SWT.CLOSE) != 0) style |= SWT.TITLE;
- /*
- * Bug in Windows. The WS_CAPTION style must be
- * set when the window is resizable or it does not
- * draw properly.
- */
- /*
- * This code is intentionally commented. It seems
- * that this problem originally in Windows 3.11,
- * has been fixed in later versions. Because the
- * exact nature of the drawing problem is unknown,
- * keep the commented code around in case it comes
- * back.
- */
-// if ((style & SWT.RESIZE) != 0) style |= SWT.TITLE;
-
return style;
}
@@ -1235,7 +1220,6 @@ void setSystemMenu () {
public void setText (String string) {
checkWidget ();
if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
- /* Use the character encoding for the default locale */
TCHAR buffer = new TCHAR (0, string, true);
/* Ensure that the title appears in the task bar.*/
if ((state & FOREIGN_HANDLE) != 0) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/DirectoryDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/DirectoryDialog.java
index edcc8e1cf8..c6fe9f7e32 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/DirectoryDialog.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/DirectoryDialog.java
@@ -16,7 +16,6 @@ package org.eclipse.swt.widgets;
import org.eclipse.swt.*;
-import org.eclipse.swt.internal.*;
import org.eclipse.swt.internal.ole.win32.*;
import org.eclipse.swt.internal.win32.*;
@@ -88,32 +87,6 @@ public DirectoryDialog (Shell parent, int style) {
checkSubclass ();
}
-long BrowseCallbackProc (long hwnd, long uMsg, long lParam, long lpData) {
- switch ((int)uMsg) {
- case OS.BFFM_INITIALIZED:
- if (filterPath != null && filterPath.length () != 0) {
- /* Use the character encoding for the default locale */
- TCHAR buffer = new TCHAR (0, filterPath.replace ('/', '\\'), true);
- OS.SendMessage (hwnd, OS.BFFM_SETSELECTION, 1, buffer);
- }
- if (title != null && title.length () != 0) {
- /* Use the character encoding for the default locale */
- TCHAR buffer = new TCHAR (0, title, true);
- OS.SetWindowText (hwnd, buffer);
- }
- break;
- case OS.BFFM_VALIDATEFAILED:
- /* Use the character encoding for the default locale */
- int length = OS.wcslen (lParam);
- TCHAR buffer = new TCHAR (0, length);
- int byteCount = buffer.length () * TCHAR.sizeof;
- OS.MoveMemory (buffer, lParam, byteCount);
- directoryPath = buffer.toString (0, length);
- break;
- }
- return 0;
-}
-
/**
* Returns the path which the dialog will use to filter
* the directories it shows.
@@ -150,127 +123,6 @@ public String getMessage () {
* </ul>
*/
public String open() {
- if (OS.WIN32_VERSION >= OS.VERSION (6, 0)) {
- return openCommonItemDialog();
- }
- return openCommonFileDialog();
-}
-
-private String openCommonFileDialog () {
- long hHeap = OS.GetProcessHeap ();
-
- /* Get the owner HWND for the dialog */
- long hwndOwner = 0;
- if (parent != null) hwndOwner = parent.handle;
-
- /* Copy the message to OS memory */
- long lpszTitle = 0;
- if (message.length () != 0) {
- String string = message;
- if (string.indexOf ('&') != -1) {
- int length = string.length ();
- char [] buffer = new char [length * 2];
- int index = 0;
- for (int i=0; i<length; i++) {
- char ch = string.charAt (i);
- if (ch == '&') buffer [index++] = '&';
- buffer [index++] = ch;
- }
- string = new String (buffer, 0, index);
- }
- /* Use the character encoding for the default locale */
- TCHAR buffer = new TCHAR (0, string, true);
- int byteCount = buffer.length () * TCHAR.sizeof;
- lpszTitle = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount);
- OS.MoveMemory (lpszTitle, buffer, byteCount);
- }
-
- /* Create the BrowseCallbackProc */
- Callback callback = new Callback (this, "BrowseCallbackProc", 4); //$NON-NLS-1$
- long lpfn = callback.getAddress ();
-
- /* Make the parent shell be temporary modal */
- Dialog oldModal = null;
- Display display = parent.getDisplay ();
- if ((style & (SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL)) != 0) {
- oldModal = display.getModalDialog ();
- display.setModalDialog (this);
- }
-
- directoryPath = null;
- BROWSEINFO lpbi = new BROWSEINFO ();
- lpbi.hwndOwner = hwndOwner;
- lpbi.lpszTitle = lpszTitle;
- lpbi.ulFlags = OS.BIF_NEWDIALOGSTYLE | OS.BIF_RETURNONLYFSDIRS | OS.BIF_EDITBOX | OS.BIF_VALIDATE;
- lpbi.lpfn = lpfn;
- /*
- * Bug in Windows. On some hardware configurations, SHBrowseForFolder()
- * causes warning dialogs with the message "There is no disk in the drive
- * Please insert a disk into \Device\Harddisk0\DR0". This is possibly
- * caused by SHBrowseForFolder() calling internally GetVolumeInformation().
- * MSDN for GetVolumeInformation() says:
- *
- * "If you are attempting to obtain information about a floppy drive
- * that does not have a floppy disk or a CD-ROM drive that does not
- * have a compact disc, the system displays a message box asking the
- * user to insert a floppy disk or a compact disc, respectively.
- * To prevent the system from displaying this message box, call the
- * SetErrorMode function with SEM_FAILCRITICALERRORS."
- *
- * The fix is to save and restore the error mode using SetErrorMode()
- * with the SEM_FAILCRITICALERRORS flag around SHBrowseForFolder().
- */
- int oldErrorMode = OS.SetErrorMode (OS.SEM_FAILCRITICALERRORS);
-
- display.sendPreExternalEventDispatchEvent ();
- display.externalEventLoop = true;
- long lpItemIdList = OS.SHBrowseForFolder (lpbi);
- display.externalEventLoop = false;
- display.sendPostExternalEventDispatchEvent ();
- OS.SetErrorMode (oldErrorMode);
-
- /* Clear the temporary dialog modal parent */
- if ((style & (SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL)) != 0) {
- display.setModalDialog (oldModal);
- }
-
- boolean success = lpItemIdList != 0;
- if (success) {
- /* Use the character encoding for the default locale */
- TCHAR buffer = new TCHAR (0, OS.MAX_PATH);
- if (OS.SHGetPathFromIDList (lpItemIdList, buffer)) {
- directoryPath = buffer.toString (0, buffer.strlen ());
- filterPath = directoryPath;
- }
- }
-
- /* Free the BrowseCallbackProc */
- callback.dispose ();
-
- /* Free the OS memory */
- if (lpszTitle != 0) OS.HeapFree (hHeap, 0, lpszTitle);
-
- /* Free the pointer to the ITEMIDLIST */
- long [] ppMalloc = new long [1];
- if (OS.SHGetMalloc (ppMalloc) == OS.S_OK) {
- /* void Free (struct IMalloc *this, void *pv); */
- COM.VtblCall (5, ppMalloc [0], lpItemIdList);
- }
-
- /*
- * This code is intentionally commented. On some
- * platforms, the owner window is repainted right
- * away when a dialog window exits. This behavior
- * is currently unspecified.
- */
-// if (hwndOwner != 0) OS.UpdateWindow (hwndOwner);
-
- /* Return the directory path */
- if (!success) return null;
- return directoryPath;
-}
-
-private String openCommonItemDialog() {
this.directoryPath = null;
long [] ppv = new long [1];
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java
index 45904d462f..808d5fc4fc 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java
@@ -414,17 +414,6 @@ public class Display extends Device {
/* Package Name */
static final String PACKAGE_PREFIX = "org.eclipse.swt.widgets."; //$NON-NLS-1$
- /*
- * This code is intentionally commented. In order
- * to support CLDC, .class cannot be used because
- * it does not compile on some Java compilers when
- * they are targeted for CLDC.
- */
-// static {
-// String name = Display.class.getName ();
-// int index = name.lastIndexOf ('.');
-// PACKAGE_PREFIX = name.substring (0, index + 1);
-// }
/*
* TEMPORARY CODE. Install the runnable that
@@ -1530,20 +1519,8 @@ Control getControl (long handle) {
}
int index = (int)OS.GetProp (handle, SWT_OBJECT_INDEX) - 1;
if (0 <= index && index < controlTable.length) {
- Control control = controlTable [index];
- /*
- * Because GWL_USERDATA can be used by native widgets that
- * do not belong to SWT, it is possible that GWL_USERDATA
- * could return an index that is in the range of the table,
- * but was not put there by SWT. Therefore, it is necessary
- * to check the handle of the control that is in the table
- * against the handle that provided the GWL_USERDATA.
- */
- if (control != null && control.checkHandle (handle)) {
- lastGetHwnd = handle;
- lastGetControl = control;
- return control;
- }
+ lastGetHwnd = handle;
+ return lastGetControl = controlTable [index];
}
return null;
}
@@ -1831,16 +1808,13 @@ public int getIconDepth () {
checkDevice ();
if (getDepth () >= 24) return 32;
- /* Use the character encoding for the default locale */
TCHAR buffer1 = new TCHAR (0, "Control Panel\\Desktop\\WindowMetrics", true); //$NON-NLS-1$
-
long [] phkResult = new long [1];
int result = OS.RegOpenKeyEx (OS.HKEY_CURRENT_USER, buffer1, 0, OS.KEY_READ, phkResult);
if (result != 0) return 4;
int depth = 4;
int [] lpcbData = new int [1];
- /* Use the character encoding for the default locale */
TCHAR buffer2 = new TCHAR (0, "Shell Icon BPP", true); //$NON-NLS-1$
result = OS.RegQueryValueEx (phkResult [0], buffer2, 0, null, (TCHAR) null, lpcbData);
if (result == 0) {
@@ -2649,7 +2623,6 @@ protected void init () {
/* Remember the current thread id */
threadId = OS.GetCurrentThreadId ();
- /* Use the character encoding for the default locale */
windowClass = new TCHAR (0, WindowName + WindowClassCount, true);
windowShadowClass = new TCHAR (0, WindowShadowName + WindowClassCount, true);
windowOwnDCClass = new TCHAR (0, WindowOwnDCName + WindowClassCount, true);
@@ -3141,13 +3114,6 @@ long messageProc (long hwnd, long msg, long wParam, long lParam) {
case OS.WM_ENDSESSION: {
if (wParam != 0) {
dispose ();
- /*
- * When the session is ending, no SWT program can continue
- * to run. In order to avoid running code after the display
- * has been disposed, exit from Java.
- */
- /* This code is intentionally commented */
-// System.exit (0);
}
break;
}
@@ -4012,8 +3978,6 @@ void runSettings () {
if (!sameFont) {
shell.updateFont (oldFont, newFont);
}
- /* This code is intentionally commented */
- //shell.redraw (true);
shell.layout (true, true);
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FileDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FileDialog.java
index c81255d7f3..102183dc6a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FileDialog.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FileDialog.java
@@ -272,7 +272,6 @@ public String open () {
/* Convert the title and copy it into lpstrTitle */
if (title == null) title = "";
- /* Use the character encoding for the default locale */
TCHAR buffer3 = new TCHAR (0, title, true);
int byteCount3 = buffer3.length () * TCHAR.sizeof;
long lpstrTitle = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount3);
@@ -290,7 +289,6 @@ public String open () {
if (filterExtensions.length == 0) {
strFilter = strFilter + FILTER + '\0' + FILTER + '\0';
}
- /* Use the character encoding for the default locale */
TCHAR buffer4 = new TCHAR (0, strFilter, true);
int byteCount4 = buffer4.length () * TCHAR.sizeof;
long lpstrFilter = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount4);
@@ -298,7 +296,6 @@ public String open () {
/* Convert the fileName and filterName to C strings */
if (fileName == null) fileName = "";
- /* Use the character encoding for the default locale */
TCHAR name = new TCHAR (0, fileName, true);
/*
@@ -317,7 +314,6 @@ public String open () {
* the last byte is NULL and the buffer does not overrun.
*/
if (filterPath == null) filterPath = "";
- /* Use the character encoding for the default locale */
TCHAR path = new TCHAR (0, filterPath.replace ('/', '\\'), true);
int byteCount5 = OS.MAX_PATH * TCHAR.sizeof;
long lpstrInitialDir = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount5);
@@ -469,14 +465,6 @@ public String open () {
OS.DestroyWindow (hwndOwner);
}
- /*
- * This code is intentionally commented. On some
- * platforms, the owner window is repainted right
- * away when a dialog window exits. This behavior
- * is currently unspecified.
- */
-// if (hwndOwner != 0) OS.UpdateWindow (hwndOwner);
-
/* Answer the full path or null */
return fullPath;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FontDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FontDialog.java
index 7567914edc..10598c0a1b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FontDialog.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FontDialog.java
@@ -289,14 +289,6 @@ public FontData open () {
OS.DestroyWindow (hwndOwner);
}
- /*
- * This code is intentionally commented. On some
- * platforms, the owner window is repainted right
- * away when a dialog window exits. This behavior
- * is currently unspecified.
- */
-// if (hwndOwner != 0) OS.UpdateWindow (hwndOwner);
-
if (!success) return null;
return fontData;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MenuItem.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MenuItem.java
index 0ec06ed9d2..8868199b13 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MenuItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MenuItem.java
@@ -1014,7 +1014,6 @@ public void setText (String string) {
info.cbSize = MENUITEMINFO.sizeof;
long hMenu = parent.handle;
- /* Use the character encoding for the default locale */
TCHAR buffer = new TCHAR (0, string, true);
int byteCount = buffer.length () * TCHAR.sizeof;
pszText = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MessageBox.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MessageBox.java
index c1fcea2557..cae28106ed 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MessageBox.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MessageBox.java
@@ -196,7 +196,6 @@ public int open () {
/* Open the message box */
display.sendPreExternalEventDispatchEvent ();
- /* Use the character encoding for the default locale */
TCHAR buffer1 = new TCHAR (0, message, true);
TCHAR buffer2 = new TCHAR (0, title, true);
display.externalEventLoop = true;
@@ -209,14 +208,6 @@ public int open () {
display.setModalDialog (oldModal);
}
- /*
- * This code is intentionally commented. On some
- * platforms, the owner window is repainted right
- * away when a dialog window exits. This behavior
- * is currently unspecified.
- */
-// if (hwndOwner != 0) OS.UpdateWindow (hwndOwner);
-
/* Compute and return the result */
if (code != 0) {
int type = bits & 0x0F;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ScrollBar.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ScrollBar.java
index 769bcf010d..347214f2c9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ScrollBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ScrollBar.java
@@ -192,8 +192,6 @@ void destroyWidget () {
OS.ShowScrollBar (hwnd, type, false);
parent.destroyScrollBar (style);
releaseHandle ();
- //This code is intentionally commented
- //parent.sendEvent (SWT.Resize);
}
Rectangle getBounds () {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scrollable.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scrollable.java
index a8e417b39c..0e09c8f294 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scrollable.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scrollable.java
@@ -311,21 +311,6 @@ long scrolledHandle () {
}
@Override
-int widgetExtStyle () {
- return super.widgetExtStyle ();
- /*
- * This code is intentionally commented. In future,
- * we may wish to support different standard Windows
- * edge styles. The issue here is that not all of
- * these styles are available on the other platforms
- * this would need to be a hint.
- */
-// if ((style & SWT.BORDER) != 0) return OS.WS_EX_CLIENTEDGE;
-// if ((style & SWT.SHADOW_IN) != 0) return OS.WS_EX_STATICEDGE;
-// return super.widgetExtStyle ();
-}
-
-@Override
int widgetStyle () {
int bits = super.widgetStyle () | OS.WS_TABSTOP;
if ((style & SWT.H_SCROLL) != 0) bits |= OS.WS_HSCROLL;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java
index 2aa177931d..2b1d12fdfd 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java
@@ -711,26 +711,6 @@ void destroyWidget () {
}
@Override
-public void dispose () {
- /*
- * This code is intentionally commented. On some
- * platforms, the owner window is repainted right
- * away when a dialog window exits. This behavior
- * is currently unspecified.
- */
-// /*
-// * Note: It is valid to attempt to dispose a widget
-// * more than once. If this happens, fail silently.
-// */
-// if (!isValidWidget ()) return;
-// if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS);
-// Display oldDisplay = display;
- super.dispose ();
- // widget is disposed at this point
-// if (oldDisplay != null) oldDisplay.update ();
-}
-
-@Override
void enableWidget (boolean enabled) {
if (enabled) {
state &= ~DISABLED;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Spinner.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Spinner.java
index c559812c2c..aca9275107 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Spinner.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Spinner.java
@@ -134,11 +134,6 @@ static int checkStyle (int style) {
}
@Override
-boolean checkHandle (long hwnd) {
- return hwnd == handle || hwnd == hwndText || hwnd == hwndUpDown;
-}
-
-@Override
protected void checkSubclass () {
if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
index 12bfa311db..5465e56fd7 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
@@ -1168,12 +1168,6 @@ boolean checkData (TableItem item, int index, boolean redraw) {
}
@Override
-boolean checkHandle (long hwnd) {
- if (hwnd == handle) return true;
- return hwnd == OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
-}
-
-@Override
protected void checkSubclass () {
if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
}
@@ -1510,14 +1504,6 @@ void createHandle () {
/* Get the header window handle */
hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
- /*
- * This code is intentionally commented. According to
- * the documentation, setting the default item size is
- * supposed to improve performance. By experimentation,
- * this does not seem to have much of an effect.
- */
-// OS.SendMessage (handle, OS.LVM_SETITEMCOUNT, 1024 * 2, 0);
-
/* Set the checkbox image list */
if ((style & SWT.CHECK) != 0) {
long empty = OS.SendMessage (handle, OS.LVM_APPROXIMATEVIEWRECT, 0, 0);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TaskBar.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TaskBar.java
index 9195530b0a..3048ea18b9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TaskBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TaskBar.java
@@ -206,13 +206,11 @@ IObjectArray createShellLinkArray (MenuItem [] items) {
for (MenuItem item : items) {
IShellLink pLink = createShellLink (item);
if (pLink != null) {
- /*IObjectCollection::AddObject*/
pObjColl.AddObject (pLink);
if (hr != OS.S_OK) error (SWT.ERROR_INVALID_ARGUMENT);
pLink.Release ();
}
}
- /*IUnknown::QueryInterface*/
hr = pObjColl.QueryInterface(COM.IID_IObjectArray, ppv);
if (hr != OS.S_OK) error (SWT.ERROR_NO_HANDLES);
IObjectArray poa = new IObjectArray (ppv [0]);
@@ -417,7 +415,6 @@ void setMenu (Menu menu) {
hr = pDestList.AppendCategory (buffer2, poa2);
if (hr != OS.S_OK) error (SWT.ERROR_INVALID_ARGUMENT);
}
- /*IUnknown::Release*/
poa2.Release ();
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java
index e140cd928f..b9ca4dc157 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java
@@ -95,11 +95,6 @@ public class Text extends Scrollable {
public static final String DELIMITER;
/*
- * This code is intentionally commented.
- */
-// static final char PASSWORD;
-
- /*
* These values can be different on different platforms.
* Therefore they are not initialized in the declaration
* to stop the compiler from inlining.
@@ -115,21 +110,6 @@ public class Text extends Scrollable {
WNDCLASS lpWndClass = new WNDCLASS ();
OS.GetClassInfo (0, EditClass, lpWndClass);
EditProc = lpWndClass.lpfnWndProc;
- /*
- * This code is intentionally commented.
- */
-// long hwndText = OS.CreateWindowEx (0,
-// EditClass,
-// null,
-// OS.WS_OVERLAPPED | OS.ES_PASSWORD,
-// 0, 0, 0, 0,
-// 0,
-// 0,
-// OS.GetModuleHandle (null),
-// null);
-// char echo = (char) OS.SendMessage (hwndText, OS.EM_GETPASSWORDCHAR, 0, 0);
-// OS.DestroyWindow (hwndText);
-// PASSWORD = echo != 0 ? echo : '*';
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
index 64bc795f92..a0702cc1d9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
@@ -205,14 +205,6 @@ void _addListener (int eventType, Listener listener) {
OS.SendMessage (handle, OS.TVM_SETSCROLLTIME, 0, 0);
int bits = OS.GetWindowLong (handle, OS.GWL_STYLE);
if (eventType == SWT.MeasureItem) {
- /*
- * This code is intentionally commented.
- */
-// if (explorerTheme) {
-// int bits1 = (int)OS.SendMessage (handle, OS.TVM_GETEXTENDEDSTYLE, 0, 0);
-// bits1 &= ~OS.TVS_EX_AUTOHSCROLL;
-// OS.SendMessage (handle, OS.TVM_SETEXTENDEDSTYLE, 0, bits1);
-// }
bits |= OS.TVS_NOHSCROLL;
}
/*
@@ -1667,11 +1659,6 @@ boolean checkData (TreeItem item, int index, boolean redraw) {
return true;
}
-@Override
-boolean checkHandle (long hwnd) {
- return hwnd == handle || (hwndParent != 0 && hwnd == hwndParent) || (hwndHeader != 0 && hwnd == hwndHeader);
-}
-
boolean checkScroll (long hItem) {
/*
* Feature in Windows. If redraw is turned off using WM_SETREDRAW
@@ -1863,10 +1850,6 @@ void createHandle () {
OS.SetWindowTheme (handle, Display.EXPLORER, null);
int bits = OS.TVS_EX_DOUBLEBUFFER | OS.TVS_EX_RICHTOOLTIP;
if (ENABLE_TVS_EX_FADEINOUTEXPANDOS) bits |= OS.TVS_EX_FADEINOUTEXPANDOS;
- /*
- * This code is intentionally commented.
- */
-// if ((style & SWT.FULL_SELECTION) == 0) bits |= OS.TVS_EX_AUTOHSCROLL;
OS.SendMessage (handle, OS.TVM_SETEXTENDEDSTYLE, 0, bits);
/*
* Bug in Windows. When the tree is using the explorer
@@ -2112,14 +2095,6 @@ void createItem (TreeItem item, long hParent, long hInsertAfter, long hItem) {
hNewItem = OS.SendMessage (handle, OS.TVM_INSERTITEM, 0, tvInsert);
ignoreCustomDraw = false;
if (hNewItem == 0) error (SWT.ERROR_ITEM_NOT_ADDED);
- /*
- * This code is intentionally commented.
- */
-// if (hParent != 0) {
-// int bits = OS.GetWindowLong (handle, OS.GWL_STYLE);
-// bits |= OS.TVS_LINESATROOT;
-// OS.SetWindowLong (handle, OS.GWL_STYLE, bits);
-// }
} else {
TVITEM tvItem = new TVITEM ();
tvItem.mask = OS.TVIF_HANDLE | OS.TVIF_PARAM;
@@ -2271,14 +2246,6 @@ void createParent () {
null);
if (hwndHeader == 0) error (SWT.ERROR_NO_HANDLES);
OS.SetWindowLongPtr (hwndHeader, OS.GWLP_ID, hwndHeader);
- //This code is intentionally commented
-// if (!OS.IsPPC) {
-// if ((style & SWT.BORDER) != 0) {
-// int oldExStyle = OS.GetWindowLong (handle, OS.GWL_EXSTYLE);
-// oldExStyle &= ~OS.WS_EX_CLIENTEDGE;
-// OS.SetWindowLong (handle, OS.GWL_EXSTYLE, oldExStyle);
-// }
-// }
long hFont = OS.SendMessage (handle, OS.WM_GETFONT, 0, 0);
if (hFont != 0) OS.SendMessage (hwndHeader, OS.WM_SETFONT, hFont, 0);
long hwndInsertAfter = OS.GetWindow (handle, OS.GW_HWNDPREV);
@@ -2574,10 +2541,6 @@ void destroyItem (TreeItem item, long hItem) {
hParent = OS.SendMessage (handle, OS.TVM_GETNEXTITEM, OS.TVGN_PARENT, hItem);
OS.UpdateWindow (handle);
OS.DefWindowProc (handle, OS.WM_SETREDRAW, 0, 0);
- /*
- * This code is intentionally commented.
- */
-// OS.SendMessage (handle, OS.WM_SETREDRAW, 0, 0);
}
ignoreDeselect = ignoreSelect = lockSelection = true;
@@ -5217,9 +5180,6 @@ void showItem (long hItem) {
OS.DefWindowProc (handle, OS.WM_SETREDRAW, 0, 0);
}
OS.SendMessage (handle, OS.TVM_SELECTITEM, OS.TVGN_FIRSTVISIBLE, hItem);
- /* This code is intentionally commented */
- //int hParent = OS.SendMessage (handle, OS.TVM_GETNEXTITEM, OS.TVGN_PARENT, hItem);
- //if (hParent == 0) OS.SendMessage (handle, OS.WM_HSCROLL, OS.SB_TOP, 0);
OS.SendMessage (handle, OS.WM_HSCROLL, OS.SB_TOP, 0);
if (fixScroll) {
OS.DefWindowProc (handle, OS.WM_SETREDRAW, 1, 0);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeItem.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeItem.java
index 680d7d7e61..4c33e37e27 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeItem.java
@@ -1246,10 +1246,6 @@ public void setExpanded (boolean expanded) {
OS.UpdateWindow (hwnd);
OS.DefWindowProc (hwnd, OS.WM_SETREDRAW, 0, 0);
}
- /*
- * This code is intentionally commented.
- */
-// OS.SendMessage (hwnd, OS.WM_SETREDRAW, 0, 0);
}
}
}
@@ -1325,10 +1321,6 @@ public void setExpanded (boolean expanded) {
if (hwnd != topHandle) {
OS.DefWindowProc (hwnd, OS.WM_SETREDRAW, 1, 0);
}
- /*
- * This code is intentionally commented.
- */
-// OS.SendMessage (hwnd, OS.WM_SETREDRAW, 1, 0);
if (fixScroll) {
parent.updateScrollBar ();
SCROLLINFO info = new SCROLLINFO ();

Back to the top