summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleFrame.java
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleFrame.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleFrame.java102
1 files changed, 51 insertions, 51 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleFrame.java b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleFrame.java
index 560d7927e5..403b7d47e3 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleFrame.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleFrame.java
@@ -133,9 +133,9 @@ private static void initCheckFocus (final Display display) {
public void run() {
if (lastFocus[0] instanceof OleClientSite && !lastFocus[0].isDisposed()) {
// ignore popup menus and dialogs
- int /*long*/ hwnd = OS.GetFocus();
+ long /*int*/ hwnd = OS.GetFocus();
while (hwnd != 0) {
- int /*long*/ ownerHwnd = OS.GetWindow(hwnd, OS.GW_OWNER);
+ long /*int*/ ownerHwnd = OS.GetWindow(hwnd, OS.GW_OWNER);
if (ownerHwnd != 0) {
display.timerExec(time, timer[0]);
return;
@@ -168,10 +168,10 @@ private static void initCheckFocus (final Display display) {
private static void initMsgHook(Display display) {
if (display.getData(HHOOK) != null) return;
final Callback callback = new Callback(OleFrame.class, "getMsgProc", 3); //$NON-NLS-1$
- int /*long*/ address = callback.getAddress();
+ long /*int*/ address = callback.getAddress();
if (address == 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS);
int threadId = OS.GetCurrentThreadId();
- final int /*long*/ hHook = OS.SetWindowsHookEx(OS.WH_GETMESSAGE, address, 0, threadId);
+ final long /*int*/ hHook = OS.SetWindowsHookEx(OS.WH_GETMESSAGE, address, 0, threadId);
if (hHook == 0) {
callback.dispose();
return;
@@ -185,7 +185,7 @@ private static void initMsgHook(Display display) {
}
});
}
-static int /*long*/ getMsgProc(int /*long*/ code, int /*long*/ wParam, int /*long*/ lParam) {
+static long /*int*/ getMsgProc(long /*int*/ code, long /*int*/ wParam, long /*int*/ lParam) {
Display display = Display.getCurrent();
if (display == null) return 0;
LONG hHook = (LONG)display.getData(HHOOK);
@@ -199,7 +199,7 @@ static int /*long*/ getMsgProc(int /*long*/ code, int /*long*/ wParam, int /*lon
if (OS.WM_KEYFIRST <= message && message <= OS.WM_KEYLAST) {
if (display != null) {
Widget widget = null;
- int /*long*/ hwnd = msg.hwnd;
+ long /*int*/ hwnd = msg.hwnd;
while (hwnd != 0) {
widget = display.findWidget (hwnd);
if (widget != null) break;
@@ -274,7 +274,7 @@ static int /*long*/ getMsgProc(int /*long*/ code, int /*long*/ wParam, int /*lon
}
/* Allow OleClientSite to process key events before activeX control */
if (!consumed && !accentKey && !ignoreNextKey) {
- int /*long*/ hwndOld = msg.hwnd;
+ long /*int*/ hwndOld = msg.hwnd;
msg.hwnd = site.handle;
consumed = OS.DispatchMessage (msg) == 1;
msg.hwnd = hwndOld;
@@ -327,27 +327,27 @@ private int ContextSensitiveHelp(int fEnterMode) {
private void createCOMInterfaces() {
// Create each of the interfaces that this object implements
iUnknown = new COMObject(new int[]{2, 0, 0}){
- public int /*long*/ method0(int /*long*/[] args) {return QueryInterface(args[0], args[1]);}
- public int /*long*/ method1(int /*long*/[] args) {return AddRef();}
- public int /*long*/ method2(int /*long*/[] args) {return Release();}
+ public long /*int*/ method0(long /*int*/[] args) {return QueryInterface(args[0], args[1]);}
+ public long /*int*/ method1(long /*int*/[] args) {return AddRef();}
+ public long /*int*/ method2(long /*int*/[] args) {return Release();}
};
iOleInPlaceFrame = new COMObject(new int[]{2, 0, 0, 1, 1, 1, 1, 1, 2, 2, 3, 1, 1, 1, 2}){
- public int /*long*/ method0(int /*long*/[] args) {return QueryInterface(args[0], args[1]);}
- public int /*long*/ method1(int /*long*/[] args) {return AddRef();}
- public int /*long*/ method2(int /*long*/[] args) {return Release();}
- public int /*long*/ method3(int /*long*/[] args) {return GetWindow(args[0]);}
- public int /*long*/ method4(int /*long*/[] args) {return ContextSensitiveHelp((int)/*64*/args[0]);}
- public int /*long*/ method5(int /*long*/[] args) {return GetBorder(args[0]);}
- public int /*long*/ method6(int /*long*/[] args) {return RequestBorderSpace(args[0]);}
- public int /*long*/ method7(int /*long*/[] args) {return SetBorderSpace(args[0]);}
- public int /*long*/ method8(int /*long*/[] args) {return SetActiveObject(args[0], args[1]);}
- public int /*long*/ method9(int /*long*/[] args) {return InsertMenus(args[0], args[1]);}
- public int /*long*/ method10(int /*long*/[] args) {return SetMenu(args[0], args[1], args[2]);}
- public int /*long*/ method11(int /*long*/[] args) {return RemoveMenus(args[0]);}
+ public long /*int*/ method0(long /*int*/[] args) {return QueryInterface(args[0], args[1]);}
+ public long /*int*/ method1(long /*int*/[] args) {return AddRef();}
+ public long /*int*/ method2(long /*int*/[] args) {return Release();}
+ public long /*int*/ method3(long /*int*/[] args) {return GetWindow(args[0]);}
+ public long /*int*/ method4(long /*int*/[] args) {return ContextSensitiveHelp((int)/*64*/args[0]);}
+ public long /*int*/ method5(long /*int*/[] args) {return GetBorder(args[0]);}
+ public long /*int*/ method6(long /*int*/[] args) {return RequestBorderSpace(args[0]);}
+ public long /*int*/ method7(long /*int*/[] args) {return SetBorderSpace(args[0]);}
+ public long /*int*/ method8(long /*int*/[] args) {return SetActiveObject(args[0], args[1]);}
+ public long /*int*/ method9(long /*int*/[] args) {return InsertMenus(args[0], args[1]);}
+ public long /*int*/ method10(long /*int*/[] args) {return SetMenu(args[0], args[1], args[2]);}
+ public long /*int*/ method11(long /*int*/[] args) {return RemoveMenus(args[0]);}
// method12 SetStatusText - not implemented
// method13 EnableModeless - not implemented
- public int /*long*/ method14(int /*long*/[] args) {return TranslateAccelerator(args[0], (int)/*64*/args[1]);}
+ public long /*int*/ method14(long /*int*/[] args) {return TranslateAccelerator(args[0], (int)/*64*/args[1]);}
};
}
private void disposeCOMInterfaces () {
@@ -360,7 +360,7 @@ private void disposeCOMInterfaces () {
iOleInPlaceFrame.dispose();
iOleInPlaceFrame = null;
}
-private int GetBorder(int /*long*/ lprectBorder) {
+private int GetBorder(long /*int*/ lprectBorder) {
/*
The IOleInPlaceUIWindow::GetBorder function, when called on a document or frame window
object, returns the outer rectangle (relative to the window) where the object can put
@@ -409,11 +409,11 @@ public MenuItem[] getContainerMenus(){
public MenuItem[] getFileMenus(){
return fileMenuItems;
}
-int /*long*/ getIOleInPlaceFrame() {
+long /*int*/ getIOleInPlaceFrame() {
return iOleInPlaceFrame.getAddress();
}
-private int /*long*/ getMenuItemID(int /*long*/ hMenu, int index) {
- int /*long*/ id = 0;
+private long /*int*/ getMenuItemID(long /*int*/ hMenu, int index) {
+ long /*int*/ id = 0;
MENUITEMINFO lpmii = new MENUITEMINFO();
lpmii.cbSize = MENUITEMINFO.sizeof;
lpmii.fMask = OS.MIIM_STATE | OS.MIIM_SUBMENU | OS.MIIM_ID;
@@ -425,9 +425,9 @@ private int /*long*/ getMenuItemID(int /*long*/ hMenu, int index) {
}
return id;
}
-private int GetWindow(int /*long*/ phwnd) {
+private int GetWindow(long /*int*/ phwnd) {
if (phwnd != 0) {
- COM.MoveMemory(phwnd, new int /*long*/[] {handle}, OS.PTR_SIZEOF);
+ COM.MoveMemory(phwnd, new long /*int*/[] {handle}, OS.PTR_SIZEOF);
}
return COM.S_OK;
}
@@ -449,22 +449,22 @@ private int GetWindow(int /*long*/ phwnd) {
public MenuItem[] getWindowMenus(){
return windowMenuItems;
}
-private int InsertMenus(int /*long*/ hmenuShared, int /*long*/ lpMenuWidths) {
+private int InsertMenus(long /*int*/ hmenuShared, long /*int*/ lpMenuWidths) {
// locate menu bar
Menu menubar = getShell().getMenuBar();
if (menubar == null || menubar.isDisposed()) {
COM.MoveMemory(lpMenuWidths, new int[] {0}, 4);
return COM.S_OK;
}
- int /*long*/ hMenu = menubar.handle;
+ long /*int*/ hMenu = menubar.handle;
// Create a holder for menu information. This will be passed down to
// the OS and the OS will fill in the requested information for each menu.
MENUITEMINFO lpmii = new MENUITEMINFO();
- int /*long*/ hHeap = OS.GetProcessHeap();
+ long /*int*/ hHeap = OS.GetProcessHeap();
int cch = 128;
int byteCount = cch * TCHAR.sizeof;
- int /*long*/ pszText = OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, byteCount);
+ long /*int*/ pszText = OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, byteCount);
lpmii.cbSize = MENUITEMINFO.sizeof;
lpmii.fMask = OS.MIIM_STATE | OS.MIIM_ID | OS.MIIM_TYPE | OS.MIIM_SUBMENU | OS.MIIM_DATA;
lpmii.dwTypeData = pszText;
@@ -580,19 +580,19 @@ private void onResize(Event e) {
objIOleInPlaceActiveObject.ResizeBorder(lpRect, iOleInPlaceFrame.getAddress(), true);
}
}
-private int QueryInterface(int /*long*/ riid, int /*long*/ ppvObject) {
+private int QueryInterface(long /*int*/ riid, long /*int*/ ppvObject) {
// implements IUnknown, IOleInPlaceFrame, IOleContainer, IOleInPlaceUIWindow
if (riid == 0 || ppvObject == 0)
return COM.E_INVALIDARG;
GUID guid = new GUID();
COM.MoveMemory(guid, riid, GUID.sizeof);
if (COM.IsEqualGUID(guid, COM.IIDIUnknown) || COM.IsEqualGUID(guid, COM.IIDIOleInPlaceFrame) ) {
- COM.MoveMemory(ppvObject, new int /*long*/ [] {iOleInPlaceFrame.getAddress()}, OS.PTR_SIZEOF);
+ COM.MoveMemory(ppvObject, new long /*int*/ [] {iOleInPlaceFrame.getAddress()}, OS.PTR_SIZEOF);
AddRef();
return COM.S_OK;
}
- COM.MoveMemory(ppvObject, new int /*long*/ [] {0}, OS.PTR_SIZEOF);
+ COM.MoveMemory(ppvObject, new long /*int*/ [] {0}, OS.PTR_SIZEOF);
return COM.E_NOINTERFACE;
}
/**
@@ -616,12 +616,12 @@ private void releaseObjectInterfaces() {
}
objIOleInPlaceActiveObject = null;
}
-private int RemoveMenus(int /*long*/ hmenuShared) {
+private int RemoveMenus(long /*int*/ hmenuShared) {
Menu menubar = getShell().getMenuBar();
if (menubar == null || menubar.isDisposed()) return COM.S_FALSE;
- int /*long*/ hMenu = menubar.handle;
+ long /*int*/ hMenu = menubar.handle;
Vector ids = new Vector();
if (this.fileMenuItems != null) {
@@ -630,7 +630,7 @@ private int RemoveMenus(int /*long*/ hmenuShared) {
if (item != null && !item.isDisposed()) {
int index = item.getParent().indexOf(item);
// get Id from original menubar
- int /*long*/ id = getMenuItemID(hMenu, index);
+ long /*int*/ id = getMenuItemID(hMenu, index);
ids.addElement(new LONG(id));
}
}
@@ -640,7 +640,7 @@ private int RemoveMenus(int /*long*/ hmenuShared) {
MenuItem item = this.containerMenuItems[i];
if (item != null && !item.isDisposed()) {
int index = item.getParent().indexOf(item);
- int /*long*/ id = getMenuItemID(hMenu, index);
+ long /*int*/ id = getMenuItemID(hMenu, index);
ids.addElement(new LONG(id));
}
}
@@ -650,24 +650,24 @@ private int RemoveMenus(int /*long*/ hmenuShared) {
MenuItem item = this.windowMenuItems[i];
if (item != null && !item.isDisposed()) {
int index = item.getParent().indexOf(item);
- int /*long*/ id = getMenuItemID(hMenu, index);
+ long /*int*/ id = getMenuItemID(hMenu, index);
ids.addElement(new LONG(id));
}
}
}
int index = OS.GetMenuItemCount(hmenuShared) - 1;
for (int i = index; i >= 0; i--) {
- int /*long*/ id = getMenuItemID(hmenuShared, i);
+ long /*int*/ id = getMenuItemID(hmenuShared, i);
if (ids.contains(new LONG(id))){
OS.RemoveMenu(hmenuShared, i, OS.MF_BYPOSITION);
}
}
return COM.S_OK;
}
-private int RequestBorderSpace(int /*long*/ pborderwidths) {
+private int RequestBorderSpace(long /*int*/ pborderwidths) {
return COM.S_OK;
}
-int SetActiveObject(int /*long*/ pActiveObject, int /*long*/ pszObjName) {
+int SetActiveObject(long /*int*/ pActiveObject, long /*int*/ pszObjName) {
if (objIOleInPlaceActiveObject != null) {
objIOleInPlaceActiveObject.Release();
objIOleInPlaceActiveObject = null;
@@ -679,7 +679,7 @@ int SetActiveObject(int /*long*/ pActiveObject, int /*long*/ pszObjName) {
return COM.S_OK;
}
-private int SetBorderSpace(int /*long*/ pborderwidths) {
+private int SetBorderSpace(long /*int*/ pborderwidths) {
// A Control/Document can :
// Use its own toolbars, requesting border space of a specific size, or,
// Use no toolbars, but force the container to remove its toolbars by passing a
@@ -747,8 +747,8 @@ void setCurrentDocument(OleClientSite doc) {
public void setFileMenus(MenuItem[] fileMenus){
fileMenuItems = fileMenus;
}
-private int SetMenu(int /*long*/ hmenuShared, int /*long*/ holemenu, int /*long*/ hwndActiveObject) {
- int /*long*/ inPlaceActiveObject = 0;
+private int SetMenu(long /*int*/ hmenuShared, long /*int*/ holemenu, long /*int*/ hwndActiveObject) {
+ long /*int*/ inPlaceActiveObject = 0;
if (objIOleInPlaceActiveObject != null)
inPlaceActiveObject = objIOleInPlaceActiveObject.getAddress();
@@ -757,7 +757,7 @@ private int SetMenu(int /*long*/ hmenuShared, int /*long*/ holemenu, int /*long*
return COM.OleSetMenuDescriptor(0, getShell().handle, hwndActiveObject, iOleInPlaceFrame.getAddress(), inPlaceActiveObject);
}
- int /*long*/ handle = menubar.getShell().handle;
+ long /*int*/ handle = menubar.getShell().handle;
if (hmenuShared == 0 && holemenu == 0) {
// re-instate the original menu - this occurs on deactivation
@@ -795,14 +795,14 @@ private boolean translateOleAccelerator(MSG msg) {
int result = objIOleInPlaceActiveObject.TranslateAccelerator(msg);
return (result != COM.S_FALSE && result != COM.E_NOTIMPL);
}
-private int TranslateAccelerator(int /*long*/ lpmsg, int wID){
+private int TranslateAccelerator(long /*int*/ lpmsg, int wID){
Menu menubar = getShell().getMenuBar();
if (menubar == null || menubar.isDisposed() || !menubar.isEnabled()) return COM.S_FALSE;
if (wID < 0) return COM.S_FALSE;
Shell shell = menubar.getShell();
- int /*long*/ hwnd = shell.handle;
- int /*long*/ hAccel = OS.SendMessage(hwnd, OS.WM_APP+1, 0, 0);
+ long /*int*/ hwnd = shell.handle;
+ long /*int*/ hAccel = OS.SendMessage(hwnd, OS.WM_APP+1, 0, 0);
if (hAccel == 0) return COM.S_FALSE;
MSG msg = new MSG();