Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikita Nemkin2019-06-16 08:27:26 +0000
committerNikita Nemkin2019-06-26 08:50:55 +0000
commit5f55db66f904fe4c6264217625772833dfd44a97 (patch)
tree2bf14cc33fbfd608ef337f634297f26d040bc71a
parentac892d9652c55b8840e2c8a22040e54486ef3bfb (diff)
downloadeclipse.platform.swt-5f55db66f904fe4c6264217625772833dfd44a97.tar.gz
eclipse.platform.swt-5f55db66f904fe4c6264217625772833dfd44a97.tar.xz
eclipse.platform.swt-5f55db66f904fe4c6264217625772833dfd44a97.zip
Bug 548457 - [Win32] Replace direct vtable calls with interface wrappers
Also, move all GUID constants to COM. Change-Id: I57cc0e1cfdadcaac459323010aec4efbc726417b Signed-off-by: Nikita Nemkin <nikita@nemkin.ru>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/com.c66
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/com_stats.c3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/com_stats.h3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.c1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/com/win32/FileDialogVtbl.java47
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/com/win32/ShellItemVtbl.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/COM.java34
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/ICustomDestinationList.java48
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IEnumTfDisplayAttributeInfo.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IFileDialog.java60
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IMLangFontLink2.java40
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IObjectArray.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IObjectCollection.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IPropertyStore.java32
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IShellItem.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IShellLink.java40
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/ITaskbarList3.java36
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/ITfDisplayAttributeInfo.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/ITfDisplayAttributeProvider.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/ITfInputProcessorProfiles.java26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java34
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/DirectoryDialog.java44
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/IME.java53
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TaskBar.java149
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TaskItem.java35
29 files changed, 666 insertions, 320 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/com.c b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/com.c
index 7954807364..11d2eff2fc 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/com.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/com.c
@@ -947,6 +947,28 @@ JNIEXPORT jint JNICALL COM_NATIVE(RevokeDragDrop)
}
#endif
+#ifndef NO_SHCreateItemFromParsingName
+JNIEXPORT jint JNICALL COM_NATIVE(SHCreateItemFromParsingName)
+ (JNIEnv *env, jclass that, jcharArray arg0, jlong arg1, jobject arg2, jlongArray arg3)
+{
+ jchar *lparg0=NULL;
+ GUID _arg2, *lparg2=NULL;
+ jlong *lparg3=NULL;
+ jint rc = 0;
+ COM_NATIVE_ENTER(env, that, SHCreateItemFromParsingName_FUNC);
+ if (arg0) if ((lparg0 = (*env)->GetCharArrayElements(env, arg0, NULL)) == NULL) goto fail;
+ if (arg2) if ((lparg2 = getGUIDFields(env, arg2, &_arg2)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = (*env)->GetLongArrayElements(env, arg3, NULL)) == NULL) goto fail;
+ rc = (jint)SHCreateItemFromParsingName((PCWSTR)lparg0, (IBindCtx *)arg1, (REFIID)lparg2, (void **)lparg3);
+fail:
+ if (arg3 && lparg3) (*env)->ReleaseLongArrayElements(env, arg3, lparg3, 0);
+ if (arg2 && lparg2) setGUIDFields(env, arg2, lparg2);
+ if (arg0 && lparg0) (*env)->ReleaseCharArrayElements(env, arg0, lparg0, 0);
+ COM_NATIVE_EXIT(env, that, SHCreateItemFromParsingName_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO_SHDoDragDrop
JNIEXPORT jint JNICALL COM_NATIVE(SHDoDragDrop)
(JNIEnv *env, jclass that, jlong arg0, jlong arg1, jlong arg2, jint arg3, jintArray arg4)
@@ -1473,6 +1495,28 @@ fail:
}
#endif
+#ifndef NO_VtblCall__IJILorg_eclipse_swt_internal_ole_win32_GUID_2Lorg_eclipse_swt_internal_ole_win32_GUID_2Lorg_eclipse_swt_internal_ole_win32_GUID_2
+JNIEXPORT jint JNICALL COM_NATIVE(VtblCall__IJILorg_eclipse_swt_internal_ole_win32_GUID_2Lorg_eclipse_swt_internal_ole_win32_GUID_2Lorg_eclipse_swt_internal_ole_win32_GUID_2)
+ (JNIEnv *env, jclass that, jint arg0, jlong arg1, jint arg2, jobject arg3, jobject arg4, jobject arg5)
+{
+ GUID _arg3, *lparg3=NULL;
+ GUID _arg4, *lparg4=NULL;
+ GUID _arg5, *lparg5=NULL;
+ jint rc = 0;
+ COM_NATIVE_ENTER(env, that, VtblCall__IJILorg_eclipse_swt_internal_ole_win32_GUID_2Lorg_eclipse_swt_internal_ole_win32_GUID_2Lorg_eclipse_swt_internal_ole_win32_GUID_2_FUNC);
+ if (arg3) if ((lparg3 = getGUIDFields(env, arg3, &_arg3)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = getGUIDFields(env, arg4, &_arg4)) == NULL) goto fail;
+ if (arg5) if ((lparg5 = getGUIDFields(env, arg5, &_arg5)) == NULL) goto fail;
+ rc = (jint)((jint (STDMETHODCALLTYPE *)(jlong, jint, GUID *, GUID *, GUID *))(*(jlong **)arg1)[arg0])(arg1, arg2, lparg3, lparg4, lparg5);
+fail:
+ if (arg5 && lparg5) setGUIDFields(env, arg5, lparg5);
+ if (arg4 && lparg4) setGUIDFields(env, arg4, lparg4);
+ if (arg3 && lparg3) setGUIDFields(env, arg3, lparg3);
+ COM_NATIVE_EXIT(env, that, VtblCall__IJILorg_eclipse_swt_internal_ole_win32_GUID_2Lorg_eclipse_swt_internal_ole_win32_GUID_2Lorg_eclipse_swt_internal_ole_win32_GUID_2_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO_VtblCall__IJILorg_eclipse_swt_internal_ole_win32_STATSTG_2_3I
JNIEXPORT jint JNICALL COM_NATIVE(VtblCall__IJILorg_eclipse_swt_internal_ole_win32_STATSTG_2_3I)
(JNIEnv *env, jclass that, jint arg0, jlong arg1, jint arg2, jobject arg3, jintArray arg4)
@@ -2497,6 +2541,28 @@ fail:
}
#endif
+#ifndef NO_VtblCall__IJ_3ILorg_eclipse_swt_internal_ole_win32_GUID_2_3J
+JNIEXPORT jint JNICALL COM_NATIVE(VtblCall__IJ_3ILorg_eclipse_swt_internal_ole_win32_GUID_2_3J)
+ (JNIEnv *env, jclass that, jint arg0, jlong arg1, jintArray arg2, jobject arg3, jlongArray arg4)
+{
+ jint *lparg2=NULL;
+ GUID _arg3, *lparg3=NULL;
+ jlong *lparg4=NULL;
+ jint rc = 0;
+ COM_NATIVE_ENTER(env, that, VtblCall__IJ_3ILorg_eclipse_swt_internal_ole_win32_GUID_2_3J_FUNC);
+ if (arg2) if ((lparg2 = (*env)->GetIntArrayElements(env, arg2, NULL)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getGUIDFields(env, arg3, &_arg3)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = (*env)->GetLongArrayElements(env, arg4, NULL)) == NULL) goto fail;
+ rc = (jint)((jint (STDMETHODCALLTYPE *)(jlong, jint *, GUID *, jlong *))(*(jlong **)arg1)[arg0])(arg1, lparg2, lparg3, lparg4);
+fail:
+ if (arg4 && lparg4) (*env)->ReleaseLongArrayElements(env, arg4, lparg4, 0);
+ if (arg3 && lparg3) setGUIDFields(env, arg3, lparg3);
+ if (arg2 && lparg2) (*env)->ReleaseIntArrayElements(env, arg2, lparg2, 0);
+ COM_NATIVE_EXIT(env, that, VtblCall__IJ_3ILorg_eclipse_swt_internal_ole_win32_GUID_2_3J_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO_WriteClassStg
JNIEXPORT jint JNICALL COM_NATIVE(WriteClassStg)
(JNIEnv *env, jclass that, jlong arg0, jobject arg1)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/com_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/com_stats.c
index 04270f9363..407a2b5da8 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/com_stats.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/com_stats.c
@@ -82,6 +82,7 @@ char * COM_nativeFunctionNames[] = {
"RegisterDragDrop",
"ReleaseStgMedium",
"RevokeDragDrop",
+ "SHCreateItemFromParsingName",
"SHDoDragDrop",
"STATSTG_1sizeof",
"STGMEDIUM_1sizeof",
@@ -116,6 +117,7 @@ char * COM_nativeFunctionNames[] = {
"VtblCall__IJILorg_eclipse_swt_internal_ole_win32_GUID_2IILorg_eclipse_swt_internal_ole_win32_DISPPARAMS_2ILorg_eclipse_swt_internal_ole_win32_EXCEPINFO_2_3I",
"VtblCall__IJILorg_eclipse_swt_internal_ole_win32_GUID_2IILorg_eclipse_swt_internal_ole_win32_DISPPARAMS_2JLorg_eclipse_swt_internal_ole_win32_EXCEPINFO_2_3I",
"VtblCall__IJILorg_eclipse_swt_internal_ole_win32_GUID_2JJ",
+ "VtblCall__IJILorg_eclipse_swt_internal_ole_win32_GUID_2Lorg_eclipse_swt_internal_ole_win32_GUID_2Lorg_eclipse_swt_internal_ole_win32_GUID_2",
"VtblCall__IJILorg_eclipse_swt_internal_ole_win32_STATSTG_2_3I",
"VtblCall__IJILorg_eclipse_swt_internal_win32_MSG_2IIILorg_eclipse_swt_internal_win32_RECT_2",
"VtblCall__IJILorg_eclipse_swt_internal_win32_MSG_2JIJLorg_eclipse_swt_internal_win32_RECT_2",
@@ -175,6 +177,7 @@ char * COM_nativeFunctionNames[] = {
"VtblCall__IJ_3CJII_3J",
"VtblCall__IJ_3C_3C",
"VtblCall__IJ_3C_3I_3I",
+ "VtblCall__IJ_3ILorg_eclipse_swt_internal_ole_win32_GUID_2_3J",
"WriteClassStg",
};
#define NATIVE_FUNCTION_COUNT sizeof(COM_nativeFunctionNames) / sizeof(char*)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/com_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/com_stats.h
index d765f066a2..8f6070dd67 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/com_stats.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/com_stats.h
@@ -92,6 +92,7 @@ typedef enum {
RegisterDragDrop_FUNC,
ReleaseStgMedium_FUNC,
RevokeDragDrop_FUNC,
+ SHCreateItemFromParsingName_FUNC,
SHDoDragDrop_FUNC,
STATSTG_1sizeof_FUNC,
STGMEDIUM_1sizeof_FUNC,
@@ -126,6 +127,7 @@ typedef enum {
VtblCall__IJILorg_eclipse_swt_internal_ole_win32_GUID_2IILorg_eclipse_swt_internal_ole_win32_DISPPARAMS_2ILorg_eclipse_swt_internal_ole_win32_EXCEPINFO_2_3I_FUNC,
VtblCall__IJILorg_eclipse_swt_internal_ole_win32_GUID_2IILorg_eclipse_swt_internal_ole_win32_DISPPARAMS_2JLorg_eclipse_swt_internal_ole_win32_EXCEPINFO_2_3I_FUNC,
VtblCall__IJILorg_eclipse_swt_internal_ole_win32_GUID_2JJ_FUNC,
+ VtblCall__IJILorg_eclipse_swt_internal_ole_win32_GUID_2Lorg_eclipse_swt_internal_ole_win32_GUID_2Lorg_eclipse_swt_internal_ole_win32_GUID_2_FUNC,
VtblCall__IJILorg_eclipse_swt_internal_ole_win32_STATSTG_2_3I_FUNC,
VtblCall__IJILorg_eclipse_swt_internal_win32_MSG_2IIILorg_eclipse_swt_internal_win32_RECT_2_FUNC,
VtblCall__IJILorg_eclipse_swt_internal_win32_MSG_2JIJLorg_eclipse_swt_internal_win32_RECT_2_FUNC,
@@ -185,5 +187,6 @@ typedef enum {
VtblCall__IJ_3CJII_3J_FUNC,
VtblCall__IJ_3C_3C_FUNC,
VtblCall__IJ_3C_3I_3I_FUNC,
+ VtblCall__IJ_3ILorg_eclipse_swt_internal_ole_win32_GUID_2_3J_FUNC,
WriteClassStg_FUNC,
} COM_FUNCS;
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 859652e700..416a2eee99 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
@@ -7966,28 +7966,6 @@ fail:
}
#endif
-#ifndef NO_SHCreateItemFromParsingName
-JNIEXPORT jint JNICALL OS_NATIVE(SHCreateItemFromParsingName)
- (JNIEnv *env, jclass that, jcharArray arg0, jlong arg1, jbyteArray arg2, jlongArray arg3)
-{
- jchar *lparg0=NULL;
- jbyte *lparg2=NULL;
- jlong *lparg3=NULL;
- jint rc = 0;
- OS_NATIVE_ENTER(env, that, SHCreateItemFromParsingName_FUNC);
- if (arg0) if ((lparg0 = (*env)->GetCharArrayElements(env, arg0, NULL)) == NULL) goto fail;
- if (arg2) if ((lparg2 = (*env)->GetByteArrayElements(env, arg2, NULL)) == NULL) goto fail;
- if (arg3) if ((lparg3 = (*env)->GetLongArrayElements(env, arg3, NULL)) == NULL) goto fail;
- rc = (jint)SHCreateItemFromParsingName(lparg0, (IBindCtx *)arg1, (REFIID)lparg2, (void **)lparg3);
-fail:
- if (arg3 && lparg3) (*env)->ReleaseLongArrayElements(env, arg3, lparg3, 0);
- if (arg2 && lparg2) (*env)->ReleaseByteArrayElements(env, arg2, lparg2, 0);
- if (arg0 && lparg0) (*env)->ReleaseCharArrayElements(env, arg0, lparg0, 0);
- OS_NATIVE_EXIT(env, that, SHCreateItemFromParsingName_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO_SHDRAGIMAGE_1sizeof
JNIEXPORT jint JNICALL OS_NATIVE(SHDRAGIMAGE_1sizeof)
(JNIEnv *env, jclass that)
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 3b814c2ff7..19895a44cc 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
@@ -597,7 +597,6 @@ char * OS_nativeFunctionNames[] = {
"SCROLLBARINFO_1sizeof",
"SCROLLINFO_1sizeof",
"SHBrowseForFolder",
- "SHCreateItemFromParsingName",
"SHDRAGIMAGE_1sizeof",
"SHELLEXECUTEINFO_1sizeof",
"SHFILEINFO_1sizeof",
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 4efa95d342..ab3155cf1a 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
@@ -607,7 +607,6 @@ typedef enum {
SCROLLBARINFO_1sizeof_FUNC,
SCROLLINFO_1sizeof_FUNC,
SHBrowseForFolder_FUNC,
- SHCreateItemFromParsingName_FUNC,
SHDRAGIMAGE_1sizeof_FUNC,
SHELLEXECUTEINFO_1sizeof_FUNC,
SHFILEINFO_1sizeof_FUNC,
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/com/win32/FileDialogVtbl.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/com/win32/FileDialogVtbl.java
deleted file mode 100644
index 9ee7198fc5..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/com/win32/FileDialogVtbl.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2017 Martin Karpisek 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:
- * Martin Karpisek <martin.karpisek@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.internal.com.win32;
-
-/**
- * Function number constants for IFileDialog COM interface
- */
-public class FileDialogVtbl{
- public static final int QUERY_INTERFACE = 0;
- public static final int ADD_REF = 1;
- public static final int RELEASE = 2;
- public static final int SHOW = 3;
- public static final int SET_FILE_TYPES = 4;
- public static final int SET_FILE_TYPE_INDEX = 5;
- public static final int GET_FILE_TYPE_INDEX = 6;
- public static final int ADVISE = 7;
- public static final int UNADVISE = 8;
- public static final int SET_OPTIONS = 9;
- public static final int GET_OPTIONS = 10;
- public static final int SET_DEFAULT_FOLDER = 11;
- public static final int SET_FOLDER = 12;
- public static final int GET_FOLDER = 13;
- public static final int GET_CURRENT_SELECTION = 14;
- public static final int SET_FILE_NAME = 15;
- public static final int GET_FILE_NAME = 16;
- public static final int SET_TITLE = 17;
- public static final int SET_OK_BUTTON_LABEL = 18;
- public static final int SET_FILE_NAME_LABEL = 19;
- public static final int GET_RESULT = 20;
- public static final int ADD_PLACE = 21;
- public static final int SET_DEFAULT_EXTENSION = 22;
- public static final int CLOSE = 23;
- public static final int SET_CLIENT_GUID = 24;
- public static final int CLEAR_CLIENT_DATA = 25;
- public static final int SET_FILTER = 26;
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/com/win32/ShellItemVtbl.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/com/win32/ShellItemVtbl.java
deleted file mode 100644
index f9f7fadf1b..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/com/win32/ShellItemVtbl.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2017 Martin Karpisek 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:
- * Martin Karpisek <martin.karpisek@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.internal.com.win32;
-
-/**
- * Function number constants for IShellItem COM interface
- */
-public class ShellItemVtbl{
- public static final int QUERY_INTERFACE = 0;
- public static final int ADD_REF = 1;
- public static final int RELEASE = 2;
- public static final int BIND_TO_HANDLER = 3;
- public static final int GET_PARENT = 4;
- public static final int GET_DISPLAY_NAME = 5;
- public static final int GET_ATTRIBUTES = 6;
- public static final int COMPARE = 7;
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/COM.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/COM.java
index bb25295ad8..db75d0c91d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/COM.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/COM.java
@@ -17,10 +17,31 @@ import org.eclipse.swt.internal.win32.*;
public class COM extends OS {
/** GUID Constants */
+ public static final GUID CLSID_CMultiLanguage = IIDFromString("{275c23e2-3747-11d0-9fea-00aa003f8646}");
+ public static final GUID CLSID_DestinationList = IIDFromString ("{77f10cf0-3db5-4966-b520-b7c54fd35ed6}"); //$NON-NLS-1$
public static final GUID CLSID_DragDropHelper = COM.IIDFromString("{4657278A-411B-11d2-839A-00C04FD918D0}"); //$NON-NLS-1$
- public static final GUID IID_IDropTargetHelper = COM.IIDFromString("{4657278B-411B-11d2-839A-00C04FD918D0}"); //$NON-NLS-1$
+ public static final GUID CLSID_EnumerableObjectCollection = IIDFromString ("{2d3468c1-36a7-43b6-ac24-d3f02fd9607a}"); //$NON-NLS-1$
+ public static final GUID CLSID_FileOpenDialog = IIDFromString("{DC1C5A9C-E88A-4dde-A5A1-60F82A20AEF7}"); //$NON-NLS-1$
+ public static final GUID CLSID_FileSaveDialog = IIDFromString("{84bccd23-5fde-4cdb-aea4-af64b83d78ab}"); //$NON-NLS-1$
+ public static final GUID CLSID_ShellLink = IIDFromString ("{00021401-0000-0000-C000-000000000046}"); //$NON-NLS-1$
+ public static final GUID CLSID_TaskbarList = IIDFromString ("{56FDF344-FD6D-11d0-958A-006097C9A090}"); //$NON-NLS-1$
+ public static final GUID CLSID_TF_InputProcessorProfiles = IIDFromString("{33C53A50-F456-4884-B049-85FD643ECFED}"); //$NON-NLS-1$
+ public static final GUID GUID_TFCAT_TIP_KEYBOARD = IIDFromString("{34745C63-B2F0-4784-8B67-5E12C8701A31}"); //$NON-NLS-1$
+ public static final GUID IID_ICustomDestinationList = IIDFromString ("{6332debf-87b5-4670-90c0-5e57b408a49e}"); //$NON-NLS-1$
public static final GUID IID_IDragSourceHelper = COM.IIDFromString("{DE5BF786-477A-11d2-839D-00C04FD918D0}"); //$NON-NLS-1$
public static final GUID IID_IDragSourceHelper2 = COM.IIDFromString("{83E07D0D-0C5F-4163-BF1A-60B274051E40}"); //$NON-NLS-1$
+ public static final GUID IID_IDropTargetHelper = COM.IIDFromString("{4657278B-411B-11D2-839A-00C04FD918D0}"); //$NON-NLS-1$
+ public static final GUID IID_IFileOpenDialog = IIDFromString("{d57c7288-d4ad-4768-be02-9d969532d960}"); //$NON-NLS-1$
+ public static final GUID IID_IFileSaveDialog = IIDFromString("{84bccd23-5fde-4cdb-aea4-af64b83d78ab}"); //$NON-NLS-1$
+ public static final GUID IID_IMLangFontLink2 = IIDFromString("{DCCFC162-2B38-11d2-B7EC-00C04F8F5D9A}");
+ public static final GUID IID_IObjectArray = IIDFromString ("{92CA9DCD-5622-4bba-A805-5E9F541BD8C9}"); //$NON-NLS-1$
+ public static final GUID IID_IObjectCollection = IIDFromString ("{5632b1a4-e38a-400a-928a-d4cd63230295}"); //$NON-NLS-1$
+ public static final GUID IID_IPropertyStore = IIDFromString ("{886d8eeb-8cf2-4446-8d02-cdba1dbdcf99}"); //$NON-NLS-1$
+ public static final GUID IID_IShellItem = IIDFromString("{43826d1e-e718-42ee-bc55-a1e261c37bfe}"); //$NON-NLS-1$
+ public static final GUID IID_IShellLinkW = IIDFromString ("{000214F9-0000-0000-C000-000000000046}"); //$NON-NLS-1$
+ public static final GUID IID_ITaskbarList3 = IIDFromString ("{ea1afb91-9e28-4b86-90e9-9e9f8a5eefaf}"); //$NON-NLS-1$
+ public static final GUID IID_ITfDisplayAttributeProvider = IIDFromString("{fee47777-163c-4769-996a-6e9c50ad8f54}"); //$NON-NLS-1$
+ public static final GUID IID_ITfInputProcessorProfiles = IIDFromString("{1F02B6C5-7842-4EE6-8A0B-9A24183A95CA}"); //$NON-NLS-1$
public static final GUID IIDJavaBeansBridge = COM.IIDFromString("{8AD9C840-044E-11D1-B3E9-00805F499D93}"); //$NON-NLS-1$
public static final GUID IIDShockwaveActiveXControl = COM.IIDFromString("{166B1BCA-3F9C-11CF-8075-444553540000}"); //$NON-NLS-1$
public static final GUID IIDIEditorSiteTime = IIDFromString("{6BD2AEFE-7876-45e6-A6E7-3BFCDF6540AA}"); //$NON-NLS-1$
@@ -624,6 +645,13 @@ public static final native void ReleaseStgMedium(long pmedium);
/** @param hwnd cast=(HWND) */
public static final native int RevokeDragDrop(long hwnd);
/**
+ * @param pszName cast=(PCWSTR)
+ * @param pbc cast=(IBindCtx *)
+ * @param riid cast=(REFIID)
+ * @param ppv cast=(void **)
+ */
+public static final native int SHCreateItemFromParsingName (char [] pszName, long pbc, GUID riid, long [] ppv);
+/**
* @param hwnd cast=(HWND)
* @param pDataObject cast=(IDataObject *)
* @param pDropSource cast=(IDropSource *)
@@ -667,6 +695,7 @@ public static final native int VtblCall(int fnNumber, long ppVtbl, char[] arg0,
public static final native int VtblCall(int fnNumber, long ppVtbl, int arg0, int arg1, POINT arg2, int arg3);
public static final native int VtblCall(int fnNumber, long ppVtbl, long arg0, long arg1, POINT arg2, int arg3);
public static final native int VtblCall(int fnNumber, long ppVtbl, int arg0, POINT arg1, int arg2);
+public static final native int VtblCall(int fnNumber, long ppVtbl, int[] arg0, GUID arg1, long[] arg2);
public static final native int VtblCall(int fnNumber, long ppVtbl, long arg0, POINT arg1, long arg2);
public static final native int VtblCall(int fnNumber, long ppVtbl, POINT arg0, int arg1);
public static final native int VtblCall(int fnNumber, long ppVtbl, SHDRAGIMAGE arg0, int arg1);
@@ -744,6 +773,8 @@ public static final native int VtblCall(int fnNumber, long ppVtbl, GUID arg0, in
public static final native int VtblCall(int fnNumber, long ppVtbl, GUID arg0, int arg1, OLECMD arg2, OLECMDTEXT arg3);
+public static final native int VtblCall(int fnNumber, long ppVtbl, int arg0, GUID arg1, GUID arg2, GUID arg3);
+
public static final native int VtblCall(int fnNumber, long ppVtbl, LICINFO arg0);
public static final native int VtblCall(int fnNumber, long ppVtbl, RECT arg0, int arg1, boolean arg2);
@@ -996,4 +1027,5 @@ public static final native int TYPEATTR_sizeof();
public static final native int TYPEDESC_sizeof();
public static final native int VARDESC_sizeof();
public static final native int VARIANT_sizeof();
+
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/ICustomDestinationList.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/ICustomDestinationList.java
new file mode 100644
index 0000000000..da7d4f0d2a
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/ICustomDestinationList.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2019 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:
+ * Nikita Nemkin <nikita@nemkin.ru> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.internal.ole.win32;
+
+import org.eclipse.swt.internal.win32.*;
+
+public class ICustomDestinationList extends IUnknown {
+
+public ICustomDestinationList(long address) {
+ super(address);
+}
+
+public int SetAppID(char[] pszAppID) {
+ return OS.VtblCall(3, address, pszAppID);
+}
+
+public int BeginList(int[] pcMinSlots, GUID riid, long[] ppv) {
+ return COM.VtblCall(4, address, pcMinSlots, riid, ppv);
+}
+
+public int AppendCategory(char[] pszCategory, IObjectArray poa) {
+ return OS.VtblCall(5, address, pszCategory, poa.address);
+}
+
+public int AddUserTasks(IUnknown poa) {
+ return OS.VtblCall(7, address, poa.address);
+}
+
+public int CommitList() {
+ return OS.VtblCall(8, address);
+}
+
+public int DeleteList(char[] pszAppID) {
+ return OS.VtblCall(10, address, pszAppID);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IEnumTfDisplayAttributeInfo.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IEnumTfDisplayAttributeInfo.java
new file mode 100644
index 0000000000..5d56fe7503
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IEnumTfDisplayAttributeInfo.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2019 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:
+ * Nikita Nemkin <nikita@nemkin.ru> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.internal.ole.win32;
+
+import org.eclipse.swt.internal.win32.*;
+
+public class IEnumTfDisplayAttributeInfo extends IUnknown {
+
+public IEnumTfDisplayAttributeInfo(long address) {
+ super(address);
+}
+
+public int Next(int celt, long[] rgelt, int[] pceltFetched) {
+ return OS.VtblCall(4, address, celt, rgelt, pceltFetched);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IFileDialog.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IFileDialog.java
new file mode 100644
index 0000000000..28f2709b7a
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IFileDialog.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2019 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:
+ * Nikita Nemkin <nikita@nemkin.ru> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.internal.ole.win32;
+
+import org.eclipse.swt.internal.win32.*;
+
+public class IFileDialog extends IUnknown {
+
+public IFileDialog(long address) {
+ super(address);
+}
+
+// IModalWindow
+
+public int Show(long hwndOwner) {
+ return OS.VtblCall(3, address, hwndOwner);
+}
+
+// IFileDialog
+
+public int SetOptions(int fos) {
+ return OS.VtblCall(9, address, fos);
+}
+
+public int GetOptions(int[] pfos) {
+ return OS.VtblCall(10, address, pfos);
+}
+
+public int SetDefaultFolder(IShellItem psi) {
+ return OS.VtblCall(11, address, psi.address);
+}
+
+public int SetFolder(IShellItem psi) {
+ return OS.VtblCall(12, address, psi.address);
+}
+
+public int SetTitle(char[] pszTitle) {
+ return OS.VtblCall(17, address, pszTitle);
+}
+
+public int GetResult(long[] ppsi) {
+ return OS.VtblCall(20, address, ppsi);
+}
+
+public int ClearClientData() {
+ return OS.VtblCall(25, address);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IMLangFontLink2.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IMLangFontLink2.java
new file mode 100644
index 0000000000..1c139fec1b
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IMLangFontLink2.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2019 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:
+ * Nikita Nemkin <nikita@nemkin.ru> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.internal.ole.win32;
+
+import org.eclipse.swt.internal.win32.*;
+
+public class IMLangFontLink2 extends IUnknown {
+
+public IMLangFontLink2(long address) {
+ super(address);
+}
+
+// IMLangCodePages
+
+public int GetStrCodePages(char[] pszSrc, int cchSrc, int dwPriorityCodePages, int[] pdwCodePages, int[] pcchCodePages) {
+ return OS.VtblCall(4, address, pszSrc, cchSrc, dwPriorityCodePages, pdwCodePages, pcchCodePages);
+}
+
+// IMLangFontLink2
+
+public int ReleaseFont(long hFont) {
+ return OS.VtblCall(8, address, hFont);
+}
+
+public int MapFont(long hDC, int dwCodePages, char chSrc, long[] phDestFont) {
+ return OS.VtblCall(10, address, hDC, dwCodePages, chSrc, phDestFont);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IObjectArray.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IObjectArray.java
new file mode 100644
index 0000000000..84b893deed
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IObjectArray.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2019 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:
+ * Nikita Nemkin <nikita@nemkin.ru> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.internal.ole.win32;
+
+import org.eclipse.swt.internal.win32.*;
+
+public class IObjectArray extends IUnknown {
+
+public IObjectArray(long address) {
+ super(address);
+}
+
+public int GetCount(int[] count) {
+ return OS.VtblCall(3, address, count);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IObjectCollection.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IObjectCollection.java
new file mode 100644
index 0000000000..f76a7b7f76
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IObjectCollection.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2019 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:
+ * Nikita Nemkin <nikita@nemkin.ru> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.internal.ole.win32;
+
+import org.eclipse.swt.internal.win32.*;
+
+public class IObjectCollection extends IObjectArray {
+
+public IObjectCollection(long address) {
+ super(address);
+}
+
+public int AddObject(IUnknown punk) {
+ return OS.VtblCall(5, address, punk.address);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IPropertyStore.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IPropertyStore.java
new file mode 100644
index 0000000000..6e0e896154
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IPropertyStore.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2019 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:
+ * Nikita Nemkin <nikita@nemkin.ru> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.internal.ole.win32;
+
+import org.eclipse.swt.internal.win32.*;
+
+public class IPropertyStore extends IUnknown {
+
+public IPropertyStore(long address) {
+ super(address);
+}
+
+public int SetValue(PROPERTYKEY key, long propvar) {
+ return OS.VtblCall(6, address, key, propvar);
+}
+
+public int Commit() {
+ return OS.VtblCall(7, address);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IShellItem.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IShellItem.java
new file mode 100644
index 0000000000..a6c0c40abd
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IShellItem.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2019 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:
+ * Nikita Nemkin <nikita@nemkin.ru> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.internal.ole.win32;
+
+import org.eclipse.swt.internal.win32.*;
+
+public class IShellItem extends IUnknown {
+
+public IShellItem(long address) {
+ super(address);
+}
+
+public int GetDisplayName(int sigdnName, long[] ppszName) {
+ return OS.VtblCall(5, address, sigdnName, ppszName);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IShellLink.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IShellLink.java
new file mode 100644
index 0000000000..ee3be08df9
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IShellLink.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2019 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:
+ * Nikita Nemkin <nikita@nemkin.ru> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.internal.ole.win32;
+
+import org.eclipse.swt.internal.win32.*;
+
+public class IShellLink extends IUnknown {
+
+public IShellLink(long address) {
+ super(address);
+}
+
+public int SetDescription(char[] pszName) {
+ return OS.VtblCall(7, address, pszName);
+}
+
+public int SetArguments(char[] pszArgs) {
+ return OS.VtblCall(11, address, pszArgs);
+}
+
+public int SetIconLocation(char[] pszIconPath, int iIcon) {
+ return OS.VtblCall(17, address, pszIconPath, iIcon);
+}
+
+public int SetPath(char[] pszFile) {
+ return OS.VtblCall(20, address, pszFile);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/ITaskbarList3.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/ITaskbarList3.java
new file mode 100644
index 0000000000..70e2864119
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/ITaskbarList3.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2019 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:
+ * Nikita Nemkin <nikita@nemkin.ru> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.internal.ole.win32;
+
+import org.eclipse.swt.internal.win32.*;
+
+public class ITaskbarList3 extends IUnknown {
+
+public ITaskbarList3(long address) {
+ super(address);
+}
+
+public int SetProgressValue(long hwnd, long ullCompleted, long ullTotal) {
+ return OS.VtblCall(9, address, hwnd, ullCompleted, ullTotal);
+}
+
+public int SetProgressState(long hwnd, int tbpFlags) {
+ return OS.VtblCall(10, address, hwnd, tbpFlags);
+}
+
+public int SetOverlayIcon(long hwnd, long hIcon, long pszDescription) {
+ return OS.VtblCall(18, address, hwnd, hIcon, pszDescription);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/ITfDisplayAttributeInfo.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/ITfDisplayAttributeInfo.java
new file mode 100644
index 0000000000..d3c20eeb2c
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/ITfDisplayAttributeInfo.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2019 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:
+ * Nikita Nemkin <nikita@nemkin.ru> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.internal.ole.win32;
+
+import org.eclipse.swt.internal.win32.*;
+
+public class ITfDisplayAttributeInfo extends IUnknown {
+
+public ITfDisplayAttributeInfo(long address) {
+ super(address);
+}
+
+public int GetAttributeInfo(TF_DISPLAYATTRIBUTE pda) {
+ return OS.VtblCall(5, address, pda);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/ITfDisplayAttributeProvider.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/ITfDisplayAttributeProvider.java
new file mode 100644
index 0000000000..3926f67fe4
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/ITfDisplayAttributeProvider.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2019 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:
+ * Nikita Nemkin <nikita@nemkin.ru> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.internal.ole.win32;
+
+import org.eclipse.swt.internal.win32.*;
+
+public class ITfDisplayAttributeProvider extends IUnknown {
+
+public ITfDisplayAttributeProvider(long address) {
+ super(address);
+}
+
+public int EnumDisplayAttributeInfo(long [] ppEnum) {
+ return OS.VtblCall(3, address, ppEnum);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/ITfInputProcessorProfiles.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/ITfInputProcessorProfiles.java
new file mode 100644
index 0000000000..29e06c9e68
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/ITfInputProcessorProfiles.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2019 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:
+ * Nikita Nemkin <nikita@nemkin.ru> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.internal.ole.win32;
+
+public class ITfInputProcessorProfiles extends IUnknown {
+
+public ITfInputProcessorProfiles(long address) {
+ super(address);
+}
+
+public int GetDefaultLanguageProfile(int langid, GUID catid, GUID pclsid, GUID pguidProfile) {
+ return COM.VtblCall(8, address, langid, catid, pclsid, pguidProfile);
+}
+
+}
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 e2f3dffefc..739dc438f4 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
@@ -4466,12 +4466,6 @@ public static final native int SHGetMalloc (long [] ppMalloc);
* @param pszPath cast=(LPWSTR)
*/
public static final native boolean SHGetPathFromIDList (long pidl, char [] pszPath);
-/**
- * @param pbc cast=(IBindCtx *)
- * @param riid cast=(REFIID)
- * @param ppv cast=(void **)
- */
-public static final native int SHCreateItemFromParsingName (char [] pszName, long pbc, byte [] riid, long [] ppv);
/** @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/win32/org/eclipse/swt/graphics/TextLayout.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java
index 711240ee36..52778ace81 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java
@@ -18,6 +18,7 @@ import java.util.*;
import org.eclipse.swt.*;
import org.eclipse.swt.internal.*;
import org.eclipse.swt.internal.gdip.*;
+import org.eclipse.swt.internal.ole.win32.*;
import org.eclipse.swt.internal.win32.*;
/**
@@ -60,19 +61,12 @@ public final class TextLayout extends Resource {
StyleItem[] allRuns;
StyleItem[][] runs;
int[] lineOffset, lineY, lineWidth;
- long mLangFontLink2;
+ IMLangFontLink2 mLangFontLink2;
int verticalIndentInPoints;
static final char LTR_MARK = '\u200E', RTL_MARK = '\u200F';
static final int SCRIPT_VISATTR_SIZEOF = 2;
static final int GOFFSET_SIZEOF = 8;
- static final byte[] CLSID_CMultiLanguage = new byte[16];
- static final byte[] IID_IMLangFontLink2 = new byte[16];
- static {
- OS.IIDFromString("{275c23e2-3747-11d0-9fea-00aa003f8646}\0".toCharArray(), CLSID_CMultiLanguage);
- OS.IIDFromString("{DCCFC162-2B38-11d2-B7EC-00C04F8F5D9A}\0".toCharArray(), IID_IMLangFontLink2);
- }
-
static final int MERGE_MAX = 512;
static final int TOO_MANY_RUNS = 1024;
@@ -192,8 +186,8 @@ public TextLayout (Device device) {
text = ""; //$NON-NLS-1$
long[] ppv = new long[1];
OS.OleInitialize(0);
- if (OS.CoCreateInstance(CLSID_CMultiLanguage, 0, OS.CLSCTX_INPROC_SERVER, IID_IMLangFontLink2, ppv) == OS.S_OK) {
- mLangFontLink2 = ppv[0];
+ if (COM.CoCreateInstance(COM.CLSID_CMultiLanguage, 0, COM.CLSCTX_INPROC_SERVER, COM.IID_IMLangFontLink2, ppv) == OS.S_OK) {
+ mLangFontLink2 = new IMLangFontLink2(ppv[0]);
}
init();
}
@@ -491,10 +485,9 @@ void destroy () {
lineWidth = null;
segments = null;
segmentsChars = null;
- if (mLangFontLink2 != 0) {
- /* Release() */
- OS.VtblCall(2, mLangFontLink2);
- mLangFontLink2 = 0;
+ if (mLangFontLink2 != null) {
+ mLangFontLink2.Release();
+ mLangFontLink2 = null;
}
OS.OleUninitialize();
}
@@ -3614,17 +3607,14 @@ void shape (final long hdc, final StyleItem run) {
}
}
if (!shapeSucceed) {
- if (mLangFontLink2 != 0) {
- long[] hNewFont = new long[1];
+ if (mLangFontLink2 != null) {
+ long [] hNewFont = new long [1];
int[] dwCodePages = new int[1], cchCodePages = new int[1];
- /* GetStrCodePages() */
- OS.VtblCall(4, mLangFontLink2, chars, chars.length, 0, dwCodePages, cchCodePages);
- /* MapFont() */
- if (OS.VtblCall(10, mLangFontLink2, hdc, dwCodePages[0], chars[0], hNewFont) == OS.S_OK) {
+ mLangFontLink2.GetStrCodePages(chars, chars.length, 0, dwCodePages, cchCodePages);
+ if (mLangFontLink2.MapFont(hdc, dwCodePages[0], chars[0], hNewFont) == OS.S_OK) {
LOGFONT logFont = new LOGFONT ();
OS.GetObject(hNewFont[0], LOGFONT.sizeof, logFont);
- /* ReleaseFont() */
- OS.VtblCall(8, mLangFontLink2, hNewFont[0]);
+ mLangFontLink2.ReleaseFont(hNewFont[0]);
long mLangFont = OS.CreateFontIndirect(logFont);
long oldFont = OS.SelectObject(hdc, mLangFont);
if (shapeSucceed = shape(hdc, run, chars, buffer, maxGlyphs, sp)) {
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 9e355f98e3..faef4b639c 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
@@ -17,7 +17,7 @@ package org.eclipse.swt.widgets;
import org.eclipse.swt.*;
import org.eclipse.swt.internal.*;
-import org.eclipse.swt.internal.com.win32.*;
+import org.eclipse.swt.internal.ole.win32.*;
import org.eclipse.swt.internal.win32.*;
/**
@@ -39,15 +39,6 @@ import org.eclipse.swt.internal.win32.*;
* @noextend This class is not intended to be subclassed by clients.
*/
public class DirectoryDialog extends Dialog {
- static final byte[] CLSID_FileOpenDialog = new byte[16];
- static final byte[] IID_IFileOpenDialog = new byte[16];
- static final byte[] IID_IShellItem = new byte[16];
- static {
- OS.IIDFromString("{DC1C5A9C-E88A-4dde-A5A1-60F82A20AEF7}\0".toCharArray(), CLSID_FileOpenDialog); //$NON-NLS-1$
- OS.IIDFromString("{d57c7288-d4ad-4768-be02-9d969532d960}\0".toCharArray(), IID_IFileOpenDialog); //$NON-NLS-1$
- OS.IIDFromString("{43826d1e-e718-42ee-bc55-a1e261c37bfe}\0".toCharArray(), IID_IShellItem); //$NON-NLS-1$
- }
-
String message = "", filterPath = ""; //$NON-NLS-1$//$NON-NLS-2$
String directoryPath;
@@ -282,45 +273,44 @@ private String openCommonItemDialog() {
this.directoryPath = null;
long [] ppv = new long [1];
- if (OS.CoCreateInstance(CLSID_FileOpenDialog, 0, OS.CLSCTX_INPROC_SERVER, IID_IFileOpenDialog, ppv) == OS.S_OK) {
- long fileDialog = ppv[0];
+ if (COM.CoCreateInstance(COM.CLSID_FileOpenDialog, 0, COM.CLSCTX_INPROC_SERVER, COM.IID_IFileOpenDialog, ppv) == OS.S_OK) {
+ IFileDialog fileDialog = new IFileDialog(ppv[0]);
int[] options = new int[1];
- if ((OS.VtblCall(FileDialogVtbl.GET_OPTIONS, fileDialog, options)) == OS.S_OK) {
+ if (fileDialog.GetOptions(options) == OS.S_OK) {
options[0] |= OS.FOS_PICKFOLDERS | OS.FOS_FORCEFILESYSTEM | OS.FOS_NOCHANGEDIR;
-
- OS.VtblCall(FileDialogVtbl.SET_OPTIONS, fileDialog, options[0]);
+ fileDialog.SetOptions(options[0]);
}
if (title == null) title = "";
if (title.length() > 0) {
char[] buffer = new char[title.length() + 1];
title.getChars(0, title.length(), buffer, 0);
- OS.VtblCall(FileDialogVtbl.SET_TITLE, fileDialog, buffer);
+ fileDialog.SetTitle(buffer);
}
if (filterPath != null && filterPath.length() > 0) {
String path = filterPath.replace('/', '\\');
char[] buffer = new char[path.length() + 1];
path.getChars(0, path.length(), buffer, 0);
- if (OS.SHCreateItemFromParsingName(buffer, 0, IID_IShellItem, ppv) == OS.S_OK) {
- long psi = ppv[0];
+ if (COM.SHCreateItemFromParsingName(buffer, 0, COM.IID_IShellItem, ppv) == OS.S_OK) {
+ IShellItem psi = new IShellItem(ppv[0]);
/*
* SetDefaultDirectory does not work if the dialog has
* persisted recently used folder. The fix is to clear the
* persisted data.
*/
- OS.VtblCall(FileDialogVtbl.CLEAR_CLIENT_DATA, fileDialog);
- OS.VtblCall(FileDialogVtbl.SET_DEFAULT_FOLDER, fileDialog, psi);
- OS.VtblCall(FileDialogVtbl.RELEASE, psi);
+ fileDialog.ClearClientData();
+ fileDialog.SetDefaultFolder(psi);
+ psi.Release();
}
}
long hwndOwner = parent.handle;
- if (OS.VtblCall(FileDialogVtbl.SHOW, fileDialog, hwndOwner) == OS.S_OK) {
- if (OS.VtblCall(FileDialogVtbl.GET_RESULT, fileDialog, ppv) == OS.S_OK) {
- long psi = ppv[0];
- if (OS.VtblCall(ShellItemVtbl.GET_DISPLAY_NAME, psi, OS.SIGDN_FILESYSPATH, ppv) == OS.S_OK) {
+ if (fileDialog.Show(hwndOwner) == OS.S_OK) {
+ if (fileDialog.GetResult(ppv) == OS.S_OK) {
+ IShellItem psi = new IShellItem(ppv[0]);
+ if (psi.GetDisplayName(OS.SIGDN_FILESYSPATH, ppv) == OS.S_OK) {
long wstr = ppv[0];
int length = OS.wcslen(wstr);
char[] buffer = new char[length];
@@ -329,11 +319,11 @@ private String openCommonItemDialog() {
directoryPath = new String(buffer);
}
- OS.VtblCall(FileDialogVtbl.RELEASE, psi);
+ psi.Release();
}
}
- OS.VtblCall(FileDialogVtbl.RELEASE, fileDialog);
+ fileDialog.Release();
}
return directoryPath;
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 20fb7fb183..04a4cacef3 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
@@ -20,6 +20,7 @@ import java.util.function.*;
import org.eclipse.swt.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.internal.*;
+import org.eclipse.swt.internal.ole.win32.*;
import org.eclipse.swt.internal.win32.*;
/**
@@ -2698,12 +2699,11 @@ protected void init () {
if (appName != null) {
/* Delete any old jump list set for the ID */
long [] ppv = new long [1];
- int hr = OS.CoCreateInstance (TaskBar.CLSID_DestinationList, 0, OS.CLSCTX_INPROC_SERVER, TaskBar.IID_ICustomDestinationList, ppv);
+ int hr = COM.CoCreateInstance (COM.CLSID_DestinationList, 0, COM.CLSCTX_INPROC_SERVER, COM.IID_ICustomDestinationList, ppv);
if (hr == OS.S_OK) {
- /*ICustomDestinationList::DeleteList*/
- OS.VtblCall (10, ppv [0], appName);
- /*IUnknown::Release*/
- OS.VtblCall (2, ppv [0]);
+ ICustomDestinationList pList = new ICustomDestinationList (ppv [0]);
+ pList.DeleteList (appName);
+ pList.Release ();
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/IME.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/IME.java
index 8216567bdd..8468050917 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/IME.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/IME.java
@@ -16,6 +16,7 @@ package org.eclipse.swt.widgets;
import org.eclipse.swt.*;
import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.internal.ole.win32.*;
import org.eclipse.swt.internal.win32.*;
/**
@@ -50,17 +51,6 @@ public class IME extends Widget {
static final int WM_MSIME_MOUSE = OS.RegisterWindowMessage (new TCHAR (0, "MSIMEMouseOperation", true)); //$NON-NLS-1$
- static final byte [] IID_ITfInputProcessorProfiles = new byte [16];
- static final byte [] IID_ITfDisplayAttributeProvider = new byte [16];
- static final byte [] CLSID_TF_InputProcessorProfiles = new byte [16];
- static final byte [] GUID_TFCAT_TIP_KEYBOARD = new byte [16];
- static {
- OS.IIDFromString ("{1F02B6C5-7842-4EE6-8A0B-9A24183A95CA}\0".toCharArray (), IID_ITfInputProcessorProfiles); //$NON-NLS-1$
- OS.IIDFromString ("{fee47777-163c-4769-996a-6e9c50ad8f54}\0".toCharArray (), IID_ITfDisplayAttributeProvider); //$NON-NLS-1$
- OS.IIDFromString ("{33C53A50-F456-4884-B049-85FD643ECFED}\0".toCharArray (), CLSID_TF_InputProcessorProfiles); //$NON-NLS-1$
- OS.IIDFromString ("{34745C63-B2F0-4784-8B67-5E12C8701A31}\0".toCharArray (), GUID_TFCAT_TIP_KEYBOARD); //$NON-NLS-1$
- }
-
/* TextLayout has a copy of these constants */
static final int UNDERLINE_IME_DOT = 1 << 16;
static final int UNDERLINE_IME_DASH = 2 << 16;
@@ -169,44 +159,37 @@ public int getCompositionOffset () {
}
TF_DISPLAYATTRIBUTE getDisplayAttribute (short langid, int attInfo) {
- long [] pProfiles = new long [1];
- int hr = OS.CoCreateInstance (CLSID_TF_InputProcessorProfiles, 0, OS.CLSCTX_INPROC_SERVER, IID_ITfInputProcessorProfiles, pProfiles);
+ long [] ppv = new long [1];
+ int hr = COM.CoCreateInstance (COM.CLSID_TF_InputProcessorProfiles, 0, COM.CLSCTX_INPROC_SERVER, COM.IID_ITfInputProcessorProfiles, ppv);
TF_DISPLAYATTRIBUTE pda = null;
if (hr == OS.S_OK) {
- byte [] pclsid = new byte [16];
- byte [] pguidProfile = new byte [16];
- /* pProfiles.GetDefaultLanguageProfile () */
- hr = OS.VtblCall (8, pProfiles [0], langid, GUID_TFCAT_TIP_KEYBOARD, pclsid, pguidProfile);
+ ITfInputProcessorProfiles pProfiles = new ITfInputProcessorProfiles (ppv [0]);
+ GUID pclsid = new GUID ();
+ GUID pguidProfile = new GUID ();
+ hr = pProfiles.GetDefaultLanguageProfile (langid, COM.GUID_TFCAT_TIP_KEYBOARD, pclsid, pguidProfile);
if (hr == OS.S_OK) {
- long [] pProvider = new long [1];
- hr = OS.CoCreateInstance (pclsid, 0, OS.CLSCTX_INPROC_SERVER, IID_ITfDisplayAttributeProvider, pProvider);
+ hr = COM.CoCreateInstance (pclsid, 0, COM.CLSCTX_INPROC_SERVER, COM.IID_ITfDisplayAttributeProvider, ppv);
if (hr == OS.S_OK) {
- long [] pEnum = new long [1];
- /* pProvider.EnumDisplayAttributeInfo () */
- hr = OS.VtblCall (3, pProvider [0], pEnum);
+ ITfDisplayAttributeProvider pProvider = new ITfDisplayAttributeProvider (ppv [0]);
+ hr = pProvider.EnumDisplayAttributeInfo (ppv);
if (hr == OS.S_OK) {
- long [] pDispInfo = new long [1];
+ IEnumTfDisplayAttributeInfo pEnum = new IEnumTfDisplayAttributeInfo (ppv [0]);
TF_DISPLAYATTRIBUTE tempPda = new TF_DISPLAYATTRIBUTE ();
- /* pEnum.Next () */
- while ((hr = OS.VtblCall (4, pEnum [0], 1, pDispInfo, (int[])null)) == OS.S_OK) {
- /* pDispInfo.GetAttributeInfo(); */
- OS.VtblCall (5, pDispInfo [0], tempPda);
- /* pDispInfo.Release () */
- OS.VtblCall (2, pDispInfo [0]);
+ while ((hr = pEnum.Next (1, ppv, null)) == OS.S_OK) {
+ ITfDisplayAttributeInfo pDispInfo = new ITfDisplayAttributeInfo (ppv [0]);
+ pDispInfo.GetAttributeInfo (tempPda);
+ pDispInfo.Release ();
if (tempPda.bAttr == attInfo) {
pda = tempPda;
break;
}
}
- /* pEnum.Release () */
- hr = OS.VtblCall (2, pEnum [0]);
+ pEnum.Release ();
}
- /* pProvider.Release () */
- hr = OS.VtblCall (2, pProvider [0]);
+ pProvider.Release ();
}
}
- /* pProfiles.Release () */
- hr = OS.VtblCall (2, pProfiles [0]);
+ pProfiles.Release ();
}
if (pda == null) {
pda = new TF_DISPLAYATTRIBUTE ();
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 369eeddaee..fb00a320d0 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
@@ -20,6 +20,7 @@ import java.io.*;
import org.eclipse.swt.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.internal.*;
+import org.eclipse.swt.internal.ole.win32.*;
import org.eclipse.swt.internal.win32.*;
/**
@@ -42,7 +43,7 @@ import org.eclipse.swt.internal.win32.*;
public class TaskBar extends Widget {
int itemCount;
TaskItem [] items = new TaskItem [4];
- long mTaskbarList3;
+ ITaskbarList3 mTaskbarList3;
String iconsDir;
static final char [] EXE_PATH;
@@ -52,29 +53,7 @@ public class TaskBar extends Widget {
static final String EXE_ARGS_KEY = "org.eclipse.swt.win32.taskbar.arguments"; //$NON-NLS-1$
static final String ICON_KEY = "org.eclipse.swt.win32.taskbar.icon"; //$NON-NLS-1$
static final String ICON_INDEX_KEY = "org.eclipse.swt.win32.taskbar.icon.index"; //$NON-NLS-1$
- static final byte [] CLSID_TaskbarList = new byte [16];
- static final byte [] CLSID_DestinationList = new byte[16];
- static final byte [] CLSID_EnumerableObjectCollection = new byte[16];
- static final byte [] CLSID_ShellLink = new byte[16];
- static final byte [] IID_ITaskbarList3 = new byte [16];
- static final byte [] IID_ICustomDestinationList = new byte[16];
- static final byte [] IID_IObjectArray = new byte[16];
- static final byte [] IID_IObjectCollection = new byte[16];
- static final byte [] IID_IShellLinkW = new byte[16];
- static final byte [] IID_IPropertyStore = new byte[16];
- static final byte [] IID_IShellItem = new byte [16];
static {
- OS.IIDFromString ("{56FDF344-FD6D-11d0-958A-006097C9A090}\0".toCharArray (), CLSID_TaskbarList); //$NON-NLS-1$
- OS.IIDFromString ("{77f10cf0-3db5-4966-b520-b7c54fd35ed6}\0".toCharArray (), CLSID_DestinationList); //$NON-NLS-1$
- OS.IIDFromString ("{2d3468c1-36a7-43b6-ac24-d3f02fd9607a}\0".toCharArray (), CLSID_EnumerableObjectCollection); //$NON-NLS-1$
- OS.IIDFromString ("{00021401-0000-0000-C000-000000000046}\0".toCharArray (), CLSID_ShellLink); //$NON-NLS-1$
- OS.IIDFromString ("{EA1AFB91-9E28-4B86-90E9-9E9F8A5EEFAF}\0".toCharArray (), IID_ITaskbarList3); //$NON-NLS-1$
- OS.IIDFromString ("{6332debf-87b5-4670-90c0-5e57b408a49e}\0".toCharArray (), IID_ICustomDestinationList); //$NON-NLS-1$
- OS.IIDFromString ("{92CA9DCD-5622-4bba-A805-5E9F541BD8C9}\0".toCharArray (), IID_IObjectArray); //$NON-NLS-1$
- OS.IIDFromString ("{5632b1a4-e38a-400a-928a-d4cd63230295}\0".toCharArray (), IID_IObjectCollection); //$NON-NLS-1$
- OS.IIDFromString ("{000214F9-0000-0000-C000-000000000046}\0".toCharArray (), IID_IShellLinkW); //$NON-NLS-1$
- OS.IIDFromString ("{886d8eeb-8cf2-4446-8d02-cdba1dbdcf99}\0".toCharArray (), IID_IPropertyStore); //$NON-NLS-1$
- OS.IIDFromString ("{43826d1e-e718-42ee-bc55-a1e261c37bfe}\0".toCharArray (), IID_IShellItem); //$NON-NLS-1$
OS.PSPropertyKeyFromString ("{F29F85E0-4FF9-1068-AB91-08002B27B3D9} 2\0".toCharArray (), PKEY_Title); //$NON-NLS-1$
OS.PSPropertyKeyFromString ("{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}, 6\0".toCharArray (), PKEY_AppUserModel_IsDestListSeparator); //$NON-NLS-1$
char [] buffer = new char [OS.MAX_PATH];
@@ -92,9 +71,9 @@ TaskBar (Display display, int style) {
void createHandle () {
long[] ppv = new long [1];
- int hr = OS.CoCreateInstance (CLSID_TaskbarList, 0, OS.CLSCTX_INPROC_SERVER, IID_ITaskbarList3, ppv);
+ int hr = COM.CoCreateInstance (COM.CLSID_TaskbarList, 0, COM.CLSCTX_INPROC_SERVER, COM.IID_ITaskbarList3, ppv);
if (hr != OS.S_OK) error (SWT.ERROR_NO_HANDLES);
- mTaskbarList3 = ppv [0];
+ mTaskbarList3 = new ITaskbarList3 (ppv [0]);
}
void createItem (TaskItem item, int index) {
@@ -117,13 +96,13 @@ void createItems () {
getItem (null);
}
-long createShellLink (MenuItem item) {
+IShellLink createShellLink (MenuItem item) {
int style = item.getStyle ();
- if ((style & SWT.CASCADE) != 0) return 0;
+ if ((style & SWT.CASCADE) != 0) return null;
long [] ppv = new long [1];
- int hr = OS.CoCreateInstance (CLSID_ShellLink, 0, OS.CLSCTX_INPROC_SERVER, IID_IShellLinkW, ppv);
+ int hr = COM.CoCreateInstance (COM.CLSID_ShellLink, 0, COM.CLSCTX_INPROC_SERVER, COM.IID_IShellLinkW, ppv);
if (hr != OS.S_OK) error (SWT.ERROR_NO_HANDLES);
- long pLink = ppv [0];
+ IShellLink pLink = new IShellLink (ppv [0]);
long hHeap = OS.GetProcessHeap ();
long pv = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, OS.PROPVARIANT_sizeof());
@@ -144,7 +123,6 @@ long createShellLink (MenuItem item) {
OS.MoveMemory (pv + 8, new long [] {titlePtr}, C.PTR_SIZEOF);
key = PKEY_Title;
- /*IShellLink::SetPath*/
String exePath = (String)item.getData (EXE_PATH_KEY);
if (exePath != null) {
length = exePath.length ();
@@ -153,16 +131,15 @@ long createShellLink (MenuItem item) {
} else {
buffer = EXE_PATH;
}
- hr = OS.VtblCall (20, pLink, buffer);
+ hr = pLink.SetPath(buffer);
if (hr != OS.S_OK) error (SWT.ERROR_INVALID_ARGUMENT);
- text = (String)item.getData (EXE_ARGS_KEY);
+ text = (String)item.getData (EXE_ARGS_KEY);
if (text == null) text = Display.LAUNCHER_PREFIX + Display.TASKBAR_EVENT + item.id;
length = text.length ();
buffer = new char [length + 1];
text.getChars (0, length, buffer, 0);
- /*IShellLink::SetArguments*/
- hr = OS.VtblCall (11, pLink, buffer);
+ hr = pLink.SetArguments(buffer);
if (hr != OS.S_OK) error (SWT.ERROR_INVALID_ARGUMENT);
/* This code is intentionally commented */
@@ -171,8 +148,7 @@ long createShellLink (MenuItem item) {
// length = tooltip.length ();
// buffer = new char [length + 1];
// tooltip.getChars (0, length, buffer, 0);
-// /*IShellLink::SetDescription*/
-// hr = OS.VtblCall (7, pLink, buffer);
+// hr = pLink.SetDescription (buffer);
// if (hr != OS.S_OK) error (SWT.ERROR_INVALID_ARGUMENT);
// }
@@ -203,52 +179,45 @@ long createShellLink (MenuItem item) {
length = icon.length ();
buffer = new char [length + 1];
icon.getChars (0, length, buffer, 0);
- /*IShellLink::SetIconLocation*/
- hr = OS.VtblCall (17, pLink, buffer, index);
+ hr = pLink.SetIconLocation(buffer, index);
if (hr != OS.S_OK) error (SWT.ERROR_INVALID_ARGUMENT);
}
}
- /*IUnknown::QueryInterface*/
- hr = OS.VtblCall (0, pLink, IID_IPropertyStore, ppv);
+ hr = pLink.QueryInterface(COM.IID_IPropertyStore, ppv);
if (hr != OS.S_OK) error (SWT.ERROR_NO_HANDLES);
- long pPropStore = ppv [0];
- /*IPropertyStore::SetValue*/
- hr = OS.VtblCall (6, pPropStore, key, pv);
+ IPropertyStore pPropStore = new IPropertyStore (ppv [0]);
+ hr = pPropStore.SetValue(key, pv);
if (hr != OS.S_OK) error (SWT.ERROR_INVALID_ARGUMENT);
- /*IPropertyStore::Commit*/
- OS.VtblCall (7, pPropStore);
- /*IUnknown::Release*/
- OS.VtblCall (2, pPropStore);
+ pPropStore.Commit();
+ pPropStore.Release();
OS.HeapFree (hHeap, 0, pv);
if (titlePtr != 0) OS.HeapFree (hHeap, 0, titlePtr);
return pLink;
}
-long createShellLinkArray (MenuItem [] items) {
- if (items == null) return 0;
- if (items.length == 0) return 0;
+IObjectArray createShellLinkArray (MenuItem [] items) {
+ if (items == null) return null;
+ if (items.length == 0) return null;
long [] ppv = new long [1];
- int hr = OS.CoCreateInstance (CLSID_EnumerableObjectCollection, 0, OS.CLSCTX_INPROC_SERVER, IID_IObjectCollection, ppv);
+ int hr = COM.CoCreateInstance (COM.CLSID_EnumerableObjectCollection, 0, COM.CLSCTX_INPROC_SERVER, COM.IID_IObjectCollection, ppv);
if (hr != OS.S_OK) error (SWT.ERROR_NO_HANDLES);
- long pObjColl = ppv [0];
+ IObjectCollection pObjColl = new IObjectCollection (ppv [0]);
for (int i = 0; i < items.length; i++) {
- long pLink = createShellLink (items[i]);
- if (pLink != 0) {
+ IShellLink pLink = createShellLink (items[i]);
+ if (pLink != null) {
/*IObjectCollection::AddObject*/
- hr = OS.VtblCall (5, pObjColl, pLink);
+ pObjColl.AddObject (pLink);
if (hr != OS.S_OK) error (SWT.ERROR_INVALID_ARGUMENT);
- /*IUnknown::Release*/
- OS.VtblCall (2, pLink);
+ pLink.Release ();
}
}
/*IUnknown::QueryInterface*/
- hr = OS.VtblCall (0, pObjColl, IID_IObjectArray, ppv);
+ hr = pObjColl.QueryInterface(COM.IID_IObjectArray, ppv);
if (hr != OS.S_OK) error (SWT.ERROR_NO_HANDLES);
- long poa = ppv [0];
- /*IUnknown::Release*/
- OS.VtblCall (2, pObjColl);
+ IObjectArray poa = new IObjectArray (ppv [0]);
+ pObjColl.Release ();
return poa;
}
@@ -389,11 +358,8 @@ void releaseParent () {
@Override
void releaseWidget () {
super.releaseWidget ();
- if (mTaskbarList3 != 0) {
- /* Release() */
- OS.VtblCall (2, mTaskbarList3);
- mTaskbarList3 = 0;
- }
+ mTaskbarList3.Release();
+ mTaskbarList3 = null;
}
@Override
@@ -409,9 +375,9 @@ void reskinChildren (int flags) {
void setMenu (Menu menu) {
long [] ppv = new long [1];
- int hr = OS.CoCreateInstance (CLSID_DestinationList, 0, OS.CLSCTX_INPROC_SERVER, IID_ICustomDestinationList, ppv);
+ int hr = COM.CoCreateInstance (COM.CLSID_DestinationList, 0, COM.CLSCTX_INPROC_SERVER, COM.IID_ICustomDestinationList, ppv);
if (hr != OS.S_OK) error (SWT.ERROR_NO_HANDLES);
- long pDestList = ppv[0];
+ ICustomDestinationList pDestList = new ICustomDestinationList (ppv [0]);
String appName = Display.APP_NAME;
char [] buffer = {'S', 'W', 'T', '\0'};
if (appName != null && appName.length () > 0) {
@@ -421,24 +387,20 @@ void setMenu (Menu menu) {
}
MenuItem [] items = null;
if (menu != null && (items = menu.getItems ()).length != 0) {
- long poa = createShellLinkArray (items);
- if (poa != 0) {
- /*ICustomDestinationList::SetAppID*/
- hr = OS.VtblCall (3, pDestList, buffer);
+ IObjectArray poa = createShellLinkArray (items);
+ if (poa != null) {
+ hr = pDestList.SetAppID (buffer);
if (hr != OS.S_OK) error (SWT.ERROR_INVALID_ARGUMENT);
- /*ICustomDestinationList::BeginList*/
int [] cMaxSlots = new int [1];
- OS.VtblCall (4, pDestList, cMaxSlots, IID_IObjectArray, ppv);
+ pDestList.BeginList(cMaxSlots, COM.IID_IObjectArray, ppv);
if (hr != OS.S_OK) error (SWT.ERROR_INVALID_ARGUMENT);
- long pRemovedItems = ppv [0];
+ IObjectArray pRemovedItems = new IObjectArray (ppv [0]);
int [] count = new int [1];
- /*IObjectArray::GetCount*/
- OS.VtblCall (3, poa, count);
+ poa.GetCount (count);
if (count [0] != 0) {
- /*ICustomDestinationList::AddUserTasks*/
- hr = OS.VtblCall (7, pDestList, poa);
+ hr = pDestList.AddUserTasks (poa);
if (hr != OS.S_OK) error (SWT.ERROR_INVALID_ARGUMENT);
}
@@ -448,42 +410,33 @@ void setMenu (Menu menu) {
Menu subMenu = item.getMenu ();
if (subMenu != null) {
MenuItem [] subItems = subMenu.getItems ();
- long poa2 = createShellLinkArray (subItems);
- if (poa2 != 0) {
- /*IObjectArray::GetCount*/
- OS.VtblCall (3, poa2, count);
+ IObjectArray poa2 = createShellLinkArray (subItems);
+ if (poa2 != null) {
+ poa2.GetCount (count);
if (count [0] != 0) {
String text = item.getText ();
int length = text.length ();
char [] buffer2 = new char [length + 1];
text.getChars (0, length, buffer2, 0);
- /*ICustomDestinationList::AppendCategory*/
- hr = OS.VtblCall (5, pDestList, buffer2, poa2);
+ hr = pDestList.AppendCategory (buffer2, poa2);
if (hr != OS.S_OK) error (SWT.ERROR_INVALID_ARGUMENT);
}
/*IUnknown::Release*/
- OS.VtblCall (2, poa2);
+ poa2.Release ();
}
}
}
+ poa.Release();
}
-
- /*ICustomDestinationList::CommitList*/
- hr = OS.VtblCall (8, pDestList);
+ hr = pDestList.CommitList ();
if (hr != OS.S_OK) error (SWT.ERROR_INVALID_ARGUMENT);
-
- /*IUnknown::Release*/
- if (pRemovedItems != 0) OS.VtblCall (2, pRemovedItems);
- /*IUnknown::Release*/
- OS.VtblCall (2, poa);
+ pRemovedItems.Release ();
}
} else {
- /*ICustomDestinationList::DeleteList*/
- hr = OS.VtblCall (10, pDestList, buffer);
+ hr = pDestList.DeleteList (buffer);
if (hr != OS.S_OK) error (SWT.ERROR_INVALID_ARGUMENT);
}
- /*IUnknown::Release*/
- OS.VtblCall (2, pDestList);
+ pDestList.Release ();
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TaskItem.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TaskItem.java
index 42153c82a2..e1c26b5a82 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TaskItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TaskItem.java
@@ -15,9 +15,9 @@
package org.eclipse.swt.widgets;
-import org.eclipse.swt.internal.win32.*;
import org.eclipse.swt.*;
import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.internal.win32.*;
/**
* Instances of this class represent a task item.
@@ -293,10 +293,7 @@ public void setOverlayImage (Image overlayImage) {
if (overlayText.length () != 0) {
updateText ();
} else {
- long mTaskbarList3 = parent.mTaskbarList3;
- long hwnd = shell.handle;
- /* ITaskbarList3::SetOverlayIcon */
- OS.VtblCall (18, mTaskbarList3, hwnd, 0, 0);
+ parent.mTaskbarList3.SetOverlayIcon(shell.handle, 0, 0);
}
}
}
@@ -338,10 +335,7 @@ public void setOverlayText (String overlayText) {
if (overlayImage != null) {
updateImage ();
} else {
- long mTaskbarList3 = parent.mTaskbarList3;
- long hwnd = shell.handle;
- /* ITaskbarList3::SetOverlayIcon */
- OS.VtblCall (18, mTaskbarList3, hwnd, 0, 0);
+ parent.mTaskbarList3.SetOverlayIcon(shell.handle, 0, 0);
}
}
}
@@ -447,20 +441,14 @@ void updateImage () {
hIcon = overlayImage.handle;
break;
}
- long mTaskbarList3 = parent.mTaskbarList3;
- long hwnd = shell.handle;
- /* ITaskbarList3::SetOverlayIcon */
- OS.VtblCall (18, mTaskbarList3, hwnd, hIcon, 0);
+ parent.mTaskbarList3.SetOverlayIcon(shell.handle, hIcon, 0);
if (image2 != null) image2.dispose ();
}
void updateProgress () {
if (progressState == SWT.INDETERMINATE) return;
if (progressState == SWT.DEFAULT) return;
- long mTaskbarList3 = parent.mTaskbarList3;
- long hwnd = shell.handle;
- /* ITaskbarList3::SetProgressValue */
- OS.VtblCall (9, mTaskbarList3, hwnd, (long)progress, (long)PROGRESS_MAX);
+ parent.mTaskbarList3.SetProgressValue(shell.handle, progress, PROGRESS_MAX);
}
void updateProgressState () {
@@ -471,12 +459,8 @@ void updateProgressState () {
case SWT.PAUSED: tbpFlags = OS.TBPF_PAUSED; break;
case SWT.INDETERMINATE: tbpFlags = OS.TBPF_INDETERMINATE; break;
}
- long mTaskbarList3 = parent.mTaskbarList3;
- long hwnd = shell.handle;
- /* ITaskbarList3::SetProgressValue */
- OS.VtblCall (9, mTaskbarList3, hwnd, (long)progress, (long)PROGRESS_MAX);
- /* ITaskbarList3::SetProgressState */
- OS.VtblCall (10, mTaskbarList3, hwnd, tbpFlags);
+ parent.mTaskbarList3.SetProgressValue(shell.handle, progress, PROGRESS_MAX);
+ parent.mTaskbarList3.SetProgressState(shell.handle, tbpFlags);
}
void updateText () {
@@ -563,10 +547,7 @@ void updateText () {
OS.DeleteObject (hBitmap);
OS.DeleteObject (hMask);
- long mTaskbarList3 = parent.mTaskbarList3;
- long hwnd = shell.handle;
- /* ITaskbarList3::SetOverlayIcon */
- OS.VtblCall (18, mTaskbarList3, hwnd, hIcon, 0);
+ parent.mTaskbarList3.SetOverlayIcon(shell.handle, hIcon, 0);
OS.DestroyIcon (hIcon);
}

Back to the top