[259250] reduce dependency on swt.internal
diff --git a/plugins/org.eclipse.actf.model.ui.editors.ie/src/org/eclipse/actf/model/internal/ui/editors/ie/WebBrowserIEControlSite.java b/plugins/org.eclipse.actf.model.ui.editors.ie/src/org/eclipse/actf/model/internal/ui/editors/ie/WebBrowserIEControlSite.java
index f096f82..87e266c 100644
--- a/plugins/org.eclipse.actf.model.ui.editors.ie/src/org/eclipse/actf/model/internal/ui/editors/ie/WebBrowserIEControlSite.java
+++ b/plugins/org.eclipse.actf.model.ui.editors.ie/src/org/eclipse/actf/model/internal/ui/editors/ie/WebBrowserIEControlSite.java
@@ -25,6 +25,15 @@
public class WebBrowserIEControlSite extends OleControlSite {
+
+ private static final int S_OK = COM.S_OK;
+ private static final int S_FALSE = COM.S_FALSE;
+ private static final int E_INVALIDARG = COM.E_INVALIDARG;
+ private static final int E_NOTIMPL = COM.E_NOTIMPL;
+ private static final int E_NOINTERFACE = COM.E_NOINTERFACE;
+ private static final int E_NOTSUPPORTED = COM.E_NOTSUPPORTED;
+
+
COMObject iDocHostUIHandler;
COMObject iOleCommandTarget;
@@ -81,22 +90,22 @@
protected int QueryInterface(int riid, int ppvObject) {
int result = super.QueryInterface(riid, ppvObject);
- if (result == COM.S_OK) return result;
- if (riid == 0 || ppvObject == 0) return COM.E_INVALIDARG;
+ if (result == S_OK) return result;
+ if (riid == 0 || ppvObject == 0) return E_INVALIDARG;
GUID guid = new GUID();
COM.MoveMemory(guid, riid, GUID.sizeof);
if (COM.IsEqualGUID(guid, COM.IIDIDocHostUIHandler)) {
- COM.MoveMemory(ppvObject, new int[] {iDocHostUIHandler.getAddress()}, 4);
+ MemoryUtil.MoveMemory(ppvObject, new int[] {iDocHostUIHandler.getAddress()}, 4);
AddRef();
- return COM.S_OK;
+ return S_OK;
}
if (COM.IsEqualGUID(guid, COM.IIDIOleCommandTarget)) {
- COM.MoveMemory(ppvObject, new int[] {iOleCommandTarget.getAddress()}, 4);
+ MemoryUtil.MoveMemory(ppvObject, new int[] {iOleCommandTarget.getAddress()}, 4);
AddRef();
- return COM.S_OK;
+ return S_OK;
}
- COM.MoveMemory(ppvObject, new int[] {0}, 4);
- return COM.E_NOINTERFACE;
+ MemoryUtil.MoveMemory(ppvObject, new int[] {0}, 4);
+ return E_NOINTERFACE;
}
protected int AddRef() {
@@ -110,20 +119,20 @@
/* IDocHostUIHandler */
int EnableModeless(int EnableModeless) {
- return COM.E_NOTIMPL;
+ return E_NOTIMPL;
}
int FilterDataObject(int pDO, int ppDORet) {
- return COM.E_NOTIMPL;
+ return E_NOTIMPL;
}
int GetDropTarget(int pDropTarget, int ppDropTarget) {
- return COM.E_NOTIMPL;
+ return E_NOTIMPL;
}
int GetExternal(int ppDispatch) {
MemoryUtil.MoveMemory(ppDispatch, new int[] {0}, 4);
- return COM.S_FALSE;
+ return S_FALSE;
}
int GetHostInfo(int pInfo) {
@@ -131,36 +140,36 @@
int info = 0x00040000;
// if ((style & SWT.BORDER) == 0) info |= 0x00200000;
MemoryUtil.MoveMemory(pInfo + 4, new int[] {info}, 4);
- return COM.S_OK;
+ return S_OK;
}
int GetOptionKeyPath(int pchKey, int dw) {
- return COM.E_NOTIMPL;
+ return E_NOTIMPL;
}
int HideUI() {
- return COM.E_NOTIMPL;
+ return E_NOTIMPL;
}
int OnDocWindowActivate(int fActivate) {
- return COM.E_NOTIMPL;
+ return E_NOTIMPL;
}
int OnFrameWindowActivate(int fActivate) {
- return COM.E_NOTIMPL;
+ return E_NOTIMPL;
}
int ResizeBorder(int prcBorder, int pUIWindow, int fFrameWindow) {
- return COM.E_NOTIMPL;
+ return E_NOTIMPL;
}
int ShowContextMenu(int dwID, int ppt, int pcmdtReserved, int pdispReserved) {
/* Show default IE popup menu */
- return COM.S_FALSE;
+ return S_FALSE;
}
int ShowUI(int dwID, int pActiveObject, int pCommandTarget, int pFrame, int pDoc) {
- return COM.E_NOTIMPL;
+ return E_NOTIMPL;
}
int TranslateAccelerator(int lpMsg, int pguidCmdGroup, int nCmdID) {
@@ -176,7 +185,7 @@
MSG msg = new MSG();
OS.MoveMemory(msg, lpMsg, MSG.sizeof);
if (OS.TranslateAccelerator(hwnd, hAccel, msg) != 0) {
- return COM.S_OK;
+ return S_OK;
}
}
}
@@ -186,22 +195,22 @@
MSG msg = new MSG();
OS.MoveMemory(msg, lpMsg, MSG.sizeof);
if (msg.message == OS.WM_KEYDOWN && msg.wParam == OS.VK_N && OS.GetKeyState (OS.VK_CONTROL) < 0) {
- return COM.S_OK;
+ return S_OK;
}
- return COM.S_FALSE;
+ return S_FALSE;
}
int TranslateUrl(int dwTranslate, int pchURLIn, int ppchURLOut) {
- return COM.E_NOTIMPL;
+ return E_NOTIMPL;
}
int UpdateUI() {
- return COM.E_NOTIMPL;
+ return E_NOTIMPL;
}
/* IOleCommandTarget */
int QueryStatus(int pguidCmdGroup, int cCmds, int prgCmds, int pCmdText) {
- return COM.E_NOTSUPPORTED;
+ return E_NOTSUPPORTED;
}
int Exec(int pguidCmdGroup, int nCmdID, int nCmdExecOpt, int pvaIn, int pvaOut) {
@@ -215,10 +224,10 @@
GUID guid = new GUID();
COM.MoveMemory(guid, pguidCmdGroup, GUID.sizeof);
if (COM.IsEqualGUID(guid, COM.CGID_DocHostCommandHandler)) {
- return COM.S_OK;
+ return S_OK;
}
}
}
- return COM.E_NOTSUPPORTED;
+ return E_NOTSUPPORTED;
}
}
diff --git a/plugins/org.eclipse.actf.util.win32/src/org/eclipse/actf/util/win32/COMUtil.java b/plugins/org.eclipse.actf.util.win32/src/org/eclipse/actf/util/win32/COMUtil.java
index 1767344..f234e40 100644
--- a/plugins/org.eclipse.actf.util.win32/src/org/eclipse/actf/util/win32/COMUtil.java
+++ b/plugins/org.eclipse.actf.util.win32/src/org/eclipse/actf/util/win32/COMUtil.java
@@ -20,8 +20,8 @@
* dispatch object from GUID.
*/
@SuppressWarnings("restriction")
-public class COMUtil {
-
+public class COMUtil {
+
static {
try {
System.loadLibrary("AccessibiltyWin32Library"); //$NON-NLS-1$
diff --git a/plugins/org.eclipse.actf.util.win32/src/org/eclipse/actf/util/win32/FlashMSAAObject.java b/plugins/org.eclipse.actf.util.win32/src/org/eclipse/actf/util/win32/FlashMSAAObject.java
index d148e65..f97d258 100644
--- a/plugins/org.eclipse.actf.util.win32/src/org/eclipse/actf/util/win32/FlashMSAAObject.java
+++ b/plugins/org.eclipse.actf.util.win32/src/org/eclipse/actf/util/win32/FlashMSAAObject.java
@@ -28,7 +28,7 @@
* @param iacc
* native wrapped IAccessible object
*/
- public FlashMSAAObject(IAccessible iacc) {
+ FlashMSAAObject(IAccessible iacc) {
this.iacc = iacc;
}
@@ -38,7 +38,7 @@
* the child ID to be used to obtain the actual child object from
* the parent.
*/
- public FlashMSAAObject(FlashMSAAObject parent, int childId) {
+ FlashMSAAObject(FlashMSAAObject parent, int childId) {
this.parent = parent;
this.childId = childId;
}
diff --git a/plugins/org.eclipse.actf.util.win32/src/org/eclipse/actf/util/win32/WindowUtil.java b/plugins/org.eclipse.actf.util.win32/src/org/eclipse/actf/util/win32/WindowUtil.java
index 14cd8ea..d86ae6c 100644
--- a/plugins/org.eclipse.actf.util.win32/src/org/eclipse/actf/util/win32/WindowUtil.java
+++ b/plugins/org.eclipse.actf.util.win32/src/org/eclipse/actf/util/win32/WindowUtil.java
@@ -21,6 +21,14 @@
@SuppressWarnings("restriction")
public class WindowUtil {
+ public static final int HWND_TOP = OS.HWND_TOP;
+ public static final int HWND_TOPMOST = OS.HWND_TOPMOST;
+ public static final int HWND_NOTOPMOST = OS.HWND_NOTOPMOST;
+ public static final int HWND_BOTTOM = OS.HWND_BOTTOM;
+
+ public static final int SWP_NOSIZE = OS.SWP_NOSIZE;
+ public static final int SWP_NOMOVE = OS.SWP_NOMOVE;
+
/**
* Get window text.
*
@@ -156,7 +164,7 @@
return OS.FindWindow(new TCHAR(0, windowClass, true), new TCHAR(0,
windowName, true));
}
-
+
/**
* Bring target Window to top
*
@@ -168,6 +176,32 @@
return OS.BringWindowToTop(hWnd);
}
+ /**
+ * Change size, position and Z order of a target Window.
+ *
+ * @param hWnd
+ * target window
+ * @param hWndInsertAfter
+ * the window to precede the positioned window in the Z order, or
+ * one of the following values (HWND_BOTTOM, HWND_NOTOPMOST,
+ * HWND_TOP, HWND_TOPMOST)
+ * @param X
+ * new position X
+ * @param Y
+ * new position Y
+ * @param cx
+ * new width
+ * @param cy
+ * new height
+ * @param uFlags
+ * window sizing and positioning flags.
+ * @return true if succeeded
+ */
+ public static boolean SetWindowPos(int hWnd, int hWndInsertAfter, int X,
+ int Y, int cx, int cy, int uFlags) {
+ return OS.SetWindowPos(hWnd, hWndInsertAfter, X, Y, cx, cy, uFlags);
+ }
+
static {
try {
System.loadLibrary("AccessibiltyWin32Library"); //$NON-NLS-1$