- Timestamp:
- Jan 13, 2000, 2:54:55 PM (26 years ago)
- Location:
- trunk/src/user32/new
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/makefile
r2415 r2426 1 # $Id: makefile,v 1.5 7 2000-01-12 12:40:41 sandervl Exp $1 # $Id: makefile,v 1.58 2000-01-13 13:54:51 sandervl Exp $ 2 2 3 3 # … … 144 144 oslibutil.obj: oslibutil.cpp oslibutil.h $(PDWIN32_INCLUDE)\wprocess.h oslibmsg.h 145 145 oslibmsg.obj: oslibmsg.cpp oslibmsg.h timer.h win32wbase.h win32wnd.h $(PDWIN32_INCLUDE)\win\thread.h 146 oslibmsgtranslate.obj: oslibmsgtranslate.cpp oslibmsg.h timer.h win32wbase.h win32wnd.h $(PDWIN32_INCLUDE)\win\thread.h 146 oslibmsgtranslate.obj: oslibmsgtranslate.cpp oslibmsg.h timer.h win32wbase.h win32wnd.h $(PDWIN32_INCLUDE)\win\thread.h win32wdesktop.h 147 147 oslibgdi.obj: oslibgdi.cpp oslibgdi.h win32wbase.h 148 148 oslibres.obj: oslibres.cpp oslibwin.h oslibres.h $(PDWIN32_INCLUDE)\winconst.h -
trunk/src/user32/new/oslibmsgtranslate.cpp
r2418 r2426 1 /* $Id: oslibmsgtranslate.cpp,v 1.1 2 2000-01-12 15:14:15sandervl Exp $ */1 /* $Id: oslibmsgtranslate.cpp,v 1.13 2000-01-13 13:54:52 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 23 23 #include <misc.h> 24 24 #include "oslibmsg.h" 25 #include <win32wnd.h> 25 #include "win32wnd.h" 26 #include "win32wdesktop.h" 26 27 #include "oslibutil.h" 27 28 #include "timer.h" … … 104 105 ULONG GetMouseKeyState() 105 106 { 106 ULONG keystate ;107 ULONG keystate = 0; 107 108 108 109 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON1) & 0x8000) … … 349 350 if(WinQueryWindowULong(hwndActivate, OFFSET_WIN32PM_MAGIC) != WIN32PM_MAGIC) { 350 351 //another (non-win32) application's window 351 //set to NULL (allowed according to win32 SDK) to avoid problems352 hwndActivate = NULL;352 //set to desktop window handle 353 hwndActivate = windowDesktop->getWindowHandle(); 353 354 } 354 355 else hwndActivate = Win32BaseWindow::OS2ToWin32Handle(hwndActivate); … … 441 442 winMsg->wParam = (WPARAM)hittest; 442 443 winMsg->lParam = MAKELONG(winMsg->pt.x,winMsg->pt.y); 443 } else 444 } 445 else 444 446 { 445 447 winMsg->message = WINWM_MOUSEMOVE; -
trunk/src/user32/new/pmframe.cpp
r2425 r2426 1 /* $Id: pmframe.cpp,v 1.1 4 2000-01-12 22:07:28 cbratschiExp $ */1 /* $Id: pmframe.cpp,v 1.15 2000-01-13 13:54:52 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Frame Managment Code for OS/2 … … 263 263 if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) 264 264 { 265 swpClient.hwnd = win32wnd->getOS2WindowHandle(); 266 swpClient.hwndInsertBehind = 0; 267 swpClient.x = 0; 268 swpClient.y = 0; 269 swpClient.cx = 0; 270 swpClient.cy = 0; 271 swpClient.fl = pswp->fl & ~SWP_ZORDER; 272 WinSetMultWindowPos(thdb->hab, &swpClient, 1); 273 goto PosChangedEnd; 265 goto RunDefFrameProc; 274 266 } 275 267 … … 284 276 OSLibMapSWPtoWINDOWPOSFrame(pswp, &wp, &swpOld, hParent, hwnd); 285 277 278 if(pswp->fl & SWP_ACTIVATE) 279 { 280 WinSendMsg(hwnd, WM_ACTIVATE, (MPARAM)TRUE, (MPARAM)hwnd); 281 } 282 286 283 if(pswp->fl & (SWP_MOVE | SWP_SIZE)) 287 284 { 288 win32wnd->setWindowRect(wp.x, wp.y, wp.x+wp.cx, wp.y+wp.cy); 289 290 win32wnd->MsgFormatFrame(); 285 //Note: Also updates the new window rectangle 286 win32wnd->MsgFormatFrame(&wp); 287 291 288 //CB: todo: use result for WM_CALCVALIDRECTS 292 289 mapWin32ToOS2Rect(WinQueryWindow(hwnd,QW_PARENT),hwnd,win32wnd->getClientRectPtr(),(PRECTLOS2)&rect); … … 328 325 { 329 326 WinInvalidateRect(hwnd,NULL,TRUE); 330 } else 327 } 328 else 331 329 { 332 330 HPS hps = WinGetPS(hwnd); … … 362 360 } 363 361 } 364 } else 362 } 363 else 365 364 { 366 365 //update child positions: rectWindow is in window coordinates … … 390 389 USHORT flags = WinQueryWindowUShort(hwnd,QWS_FLAGS); 391 390 391 dprintf(("PMFRAME: WM_ACTIVATE %x %x", hwnd, mp2)); 392 392 if (win32wnd->IsWindowCreated()) 393 393 { … … 449 449 SWP swpClient = {0}; 450 450 451 win32wnd->MsgFormatFrame( );451 win32wnd->MsgFormatFrame(NULL); 452 452 //CB: todo: use result for WM_CALCVALIDRECTS 453 453 mapWin32ToOS2Rect(WinQueryWindow(win32wnd->getOS2FrameWindowHandle(),QW_PARENT),win32wnd->getOS2FrameWindowHandle(),win32wnd->getClientRectPtr(),(PRECTLOS2)&rect); -
trunk/src/user32/new/pmwindow.cpp
r2425 r2426 1 /* $Id: pmwindow.cpp,v 1. 39 2000-01-12 22:07:28 cbratschiExp $ */1 /* $Id: pmwindow.cpp,v 1.40 2000-01-13 13:54:52 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 259 259 case WM_ACTIVATE: 260 260 { 261 HWND hwndActivate = (HWND)mp2; 262 BOOL fMinimized = FALSE; 263 264 dprintf(("OS2: WM_ACTIVATE %x %x", hwnd, hwndActivate)); 265 if(WinQueryWindowULong(hwndActivate, OFFSET_WIN32PM_MAGIC) != WIN32PM_MAGIC) { 266 //another (non-win32) application's window 267 //set to NULL (allowed according to win32 SDK) to avoid problems 268 hwndActivate = NULL; 269 } 270 if(WinQueryWindowULong(hwnd, QWL_STYLE) & WS_MINIMIZED) 271 { 272 fMinimized = TRUE; 273 } 274 275 win32wnd->MsgActivate(SHORT1FROMMP(mp1), fMinimized, Win32BaseWindow::OS2ToWin32Handle(hwndActivate)); 261 dprintf(("OS2: WM_ACTIVATE %x %x", hwnd, mp2)); 262 263 if(win32wnd->IsWindowCreated()) 264 win32wnd->MsgActivate((LOWORD(pWinMsg->wParam) == WA_ACTIVE_W) ? 1 : 0, HIWORD(pWinMsg->wParam), pWinMsg->lParam, (HWND)mp2); 265 276 266 break; 277 267 } -
trunk/src/user32/new/scroll.cpp
r2418 r2426 1 /* $Id: scroll.cpp,v 1. 9 2000-01-12 15:14:16sandervl Exp $ */1 /* $Id: scroll.cpp,v 1.10 2000-01-13 13:54:53 sandervl Exp $ */ 2 2 /* 3 3 * Scrollbar control … … 125 125 if (!win32wnd) return FALSE; 126 126 rectClient = *win32wnd->getClientRectPtr(); 127 mapWin32Rect(win32wnd->getParent() ? win32wnd->getParent()->getOS2WindowHandle():OSLIB_HWND_DESKTOP,win32wnd->getOS2FrameWindowHandle(),&rectClient); 127 if(win32wnd->getParent()) 128 mapWin32Rect(win32wnd->getParent() ? win32wnd->getParent()->getOS2WindowHandle():OSLIB_HWND_DESKTOP,win32wnd->getOS2FrameWindowHandle(),&rectClient); 128 129 lprect->left = rectClient.left; 129 130 lprect->top = rectClient.bottom; … … 147 148 if (!win32wnd) return FALSE; 148 149 rectClient = *win32wnd->getClientRectPtr(); 149 mapWin32Rect(win32wnd->getParent() ? win32wnd->getParent()->getOS2WindowHandle():OSLIB_HWND_DESKTOP,win32wnd->getOS2FrameWindowHandle(),&rectClient); 150 if(win32wnd->getParent()) 151 mapWin32Rect(win32wnd->getParent() ? win32wnd->getParent()->getOS2WindowHandle():OSLIB_HWND_DESKTOP,win32wnd->getOS2FrameWindowHandle(),&rectClient); 150 152 lprect->left = rectClient.right; 151 153 lprect->top = rectClient.top; -
trunk/src/user32/new/win32wbase.cpp
r2421 r2426 1 /* $Id: win32wbase.cpp,v 1.3 7 2000-01-12 17:37:29 cbratschiExp $ */1 /* $Id: win32wbase.cpp,v 1.38 2000-01-13 13:54:53 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 834 834 //****************************************************************************** 835 835 //****************************************************************************** 836 ULONG Win32BaseWindow::MsgActivate(BOOL fActivate, BOOL fMinimized, HWND hwnd )837 { 838 ULONG rc, curprocid,procidhwnd = -1, threadidhwnd = 0;836 ULONG Win32BaseWindow::MsgActivate(BOOL fActivate, BOOL fMinimized, HWND hwnd, HWND hwndOS2Win) 837 { 838 ULONG rc, procidhwnd = -1, threadidhwnd = 0; 839 839 840 840 … … 842 842 //default processing is cancelled 843 843 //TODO: According to Wine we should proceed anyway if window is sysmodal 844 #if 0 844 845 if(SendInternalMessageA(WM_NCACTIVATE, fActivate, 0) == FALSE && !fActivate) 845 846 { 846 847 return 0; 847 848 } 849 #endif 848 850 rc = SendInternalMessageA(WM_ACTIVATE, MAKELONG((fActivate) ? WA_ACTIVE : WA_INACTIVE, fMinimized), hwnd); 849 851 850 curprocid = GetCurrentProcessId();851 if(hwnd) {852 threadidhwnd = GetWindowThreadProcessId(hwnd, &procidhwnd);853 } 854 855 if(curprocid != procidhwnd && fActivate) {856 SendInternalMessageA(WM_ACTIVATEAPP, 1, threadidhwnd);857 }852 if(hwndOS2Win) { 853 threadidhwnd = O32_GetWindowThreadProcessId(hwndOS2Win, &procidhwnd); 854 } 855 856 if(fActivate) { 857 SendInternalMessageA(WM_ACTIVATEAPP, 1, dwThreadId); //activate; specify window thread id 858 } 859 else SendInternalMessageA(WM_ACTIVATEAPP, 0, threadidhwnd); //deactivate; specify thread id of other process 858 860 return rc; 859 861 } … … 1051 1053 } 1052 1054 //****************************************************************************** 1053 //****************************************************************************** 1054 ULONG Win32BaseWindow::MsgFormatFrame() 1055 { 1056 RECT window = rectWindow,client = rectClient,rect; 1055 //Called when either the frame's size or position has changed (lpWndPos != NULL) 1056 //or when the frame layout has changed (i.e. scrollbars added/removed) (lpWndPos == NULL) 1057 //****************************************************************************** 1058 ULONG Win32BaseWindow::MsgFormatFrame(WINDOWPOS *lpWndPos) 1059 { 1060 RECT oldWindowRect = rectWindow, client = rectClient, newWindowRect; 1057 1061 WINDOWPOS wndPos; 1058 1062 1059 wndPos.hwnd = Win32Hwnd; 1060 wndPos.hwndInsertAfter = 0; 1061 rect = rectWindow; 1062 if (getParent()) mapWin32Rect(OSLIB_HWND_DESKTOP,getParent()->getOS2WindowHandle(),&rect); 1063 wndPos.x = rect.left; 1064 wndPos.y = rect.top; 1065 wndPos.cx = rect.right-rect.left; 1066 wndPos.cy = rect.bottom-rect.top; 1067 wndPos.flags = 0; //dummy 1068 1069 return SendNCCalcSize(TRUE,&window,&window,&client,&wndPos,&rectClient); 1063 if(lpWndPos) { 1064 //set new window rectangle 1065 setWindowRect(lpWndPos->x, lpWndPos->y, lpWndPos->x + lpWndPos->cx, lpWndPos->y + lpWndPos->cy); 1066 newWindowRect = rectWindow; 1067 } 1068 else { 1069 wndPos.hwnd = Win32Hwnd; 1070 wndPos.hwndInsertAfter = 0; 1071 newWindowRect= rectWindow; 1072 if (getParent()) mapWin32Rect(OSLIB_HWND_DESKTOP,getParent()->getOS2WindowHandle(),&newWindowRect); 1073 wndPos.x = newWindowRect.left; 1074 wndPos.y = newWindowRect.top; 1075 wndPos.cx = newWindowRect.right - newWindowRect.left; 1076 wndPos.cy = newWindowRect.bottom - newWindowRect.top; 1077 wndPos.flags = SWP_FRAMECHANGED; 1078 lpWndPos = &wndPos; 1079 } 1080 1081 return SendNCCalcSize(TRUE, &oldWindowRect, &newWindowRect, &client, &wndPos, &rectClient); 1070 1082 } 1071 1083 //****************************************************************************** … … 2537 2549 ULONG magic; 2538 2550 2539 hwndActive = OSLibWinSetActiveWindow(OS2HwndFrame); 2540 win32wnd = (Win32BaseWindow *)OSLibWinGetWindowULong(hwndActive, OFFSET_WIN32WNDPTR); 2541 magic = OSLibWinGetWindowULong(hwndActive, OFFSET_WIN32PM_MAGIC); 2542 if(CheckMagicDword(magic) && win32wnd) 2543 { 2551 dprintf(("SetActiveWindow %x", getWindowHandle())); 2552 hwndActive = OSLibWinSetActiveWindow(OS2HwndFrame); 2553 win32wnd = (Win32BaseWindow *)OSLibWinGetWindowULong(hwndActive, OFFSET_WIN32WNDPTR); 2554 magic = OSLibWinGetWindowULong(hwndActive, OFFSET_WIN32PM_MAGIC); 2555 if(CheckMagicDword(magic) && win32wnd) 2556 { 2544 2557 return win32wnd->getWindowHandle(); 2545 }2546 return 0;2558 } 2559 return windowDesktop->getWindowHandle(); //pretend the desktop was active 2547 2560 } 2548 2561 //****************************************************************************** -
trunk/src/user32/new/win32wbase.h
r2415 r2426 1 /* $Id: win32wbase.h,v 1.2 5 2000-01-12 12:40:49sandervl Exp $ */1 /* $Id: win32wbase.h,v 1.26 2000-01-13 13:54:54 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 107 107 ULONG MsgPosChanging(LPARAM lp); 108 108 ULONG MsgPosChanged(LPARAM lp); 109 virtual ULONG MsgActivate(BOOL fActivate, BOOL fMinimized, HWND hwnd );109 virtual ULONG MsgActivate(BOOL fActivate, BOOL fMinimized, HWND hwnd, HWND hwndOS2Win); 110 110 ULONG MsgSetFocus(HWND hwnd); 111 111 ULONG MsgKillFocus(HWND hwnd); … … 117 117 ULONG MsgHitTest(ULONG x, ULONG y); 118 118 ULONG MsgNCPaint(); 119 ULONG MsgFormatFrame( );119 ULONG MsgFormatFrame(WINDOWPOS *lpWndPos); 120 120 ULONG DispatchMsgA(MSG *msg); 121 121 ULONG DispatchMsgW(MSG *msg); -
trunk/src/user32/new/win32wbasenonclient.cpp
r2411 r2426 1 /* $Id: win32wbasenonclient.cpp,v 1. 3 2000-01-11 18:32:07 cbratschiExp $ */1 /* $Id: win32wbasenonclient.cpp,v 1.4 2000-01-13 13:54:54 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 (non-client methods) … … 586 586 width = GetSystemMetrics(SM_CXDLGFRAME) - GetSystemMetrics(SM_CXEDGE); 587 587 height = GetSystemMetrics(SM_CYDLGFRAME) - GetSystemMetrics(SM_CYEDGE); 588 } else 588 } 589 else 589 590 { 590 591 width = GetSystemMetrics(SM_CXFRAME) - GetSystemMetrics(SM_CXEDGE); … … 595 596 596 597 /* Draw frame */ 597 598 PatBlt(hdc,rect->left,rect->top,rect->right-rect->left,height,PATCOPY); 599 PatBlt(hdc,rect->left,rect->top,width,rect->bottom-rect->top,PATCOPY); 600 PatBlt(hdc,rect->left,rect->bottom-1,rect->right-rect->left,-height,PATCOPY); 601 PatBlt(hdc,rect->right-1,rect->top,-width,rect->bottom-rect->top,PATCOPY); 598 PatBlt(hdc,rect->left, rect->top, rect->right-rect->left, height,PATCOPY); 599 PatBlt(hdc,rect->left, rect->top, width, rect->bottom-rect->top,PATCOPY); 600 PatBlt(hdc,rect->left, rect->bottom, rect->right-rect->left,-height,PATCOPY); 601 //SvL: Was PatBlt(hdc,rect->left, rect->bottom-1, rect->right-rect->left,-height,PATCOPY); 602 PatBlt(hdc,rect->right, rect->top, -width, rect->bottom-rect->top,PATCOPY); 603 //SvL: Was PatBlt(hdc,rect->right-1, rect->top, -width, rect->bottom-rect->top,PATCOPY); 602 604 SelectObject(hdc,oldBrush); 603 605 … … 1144 1146 1145 1147 case SC_MOVE: 1146 FrameTrackFrame(this,TFOS_MOVE);1147 break;1148 FrameTrackFrame(this,TFOS_MOVE); 1149 break; 1148 1150 1149 1151 case SC_MINIMIZE: -
trunk/src/user32/new/win32wmdichild.cpp
r2292 r2426 1 /* $Id: win32wmdichild.cpp,v 1. 7 2000-01-02 19:30:45 cbratschiExp $ */1 /* $Id: win32wmdichild.cpp,v 1.8 2000-01-13 13:54:55 sandervl Exp $ */ 2 2 /* 3 3 * Win32 MDI Child Window Class for OS/2 … … 57 57 //****************************************************************************** 58 58 //****************************************************************************** 59 ULONG Win32MDIChildWindow::MsgActivate(BOOL fActivate, BOOL fMinimized, HWND hwnd )60 { 61 ULONG rc, curprocid,procidhwnd = -1, threadidhwnd = 0;59 ULONG Win32MDIChildWindow::MsgActivate(BOOL fActivate, BOOL fMinimized, HWND hwnd, HWND hwndOS2Win) 60 { 61 ULONG rc, procidhwnd = -1, threadidhwnd = 0; 62 62 63 63 //According to SDK docs, if app returns FALSE & window is being deactivated, 64 64 //default processing is cancelled 65 65 //TODO: According to Wine we should proceed anyway if window is sysmodal 66 #if 0 66 67 if(SendInternalMessageA(WM_NCACTIVATE, fActivate, 0) == FALSE && !fActivate) 67 68 { 68 69 return 0; 69 70 } 71 #endif 72 70 73 if(fActivate) 71 74 { 72 75 rc = SendInternalMessageA(WM_CHILDACTIVATE, MAKELONG((fActivate) ? WA_ACTIVE : WA_INACTIVE, fMinimized), hwnd); 73 curprocid = GetCurrentProcessId();74 if(hwnd) {75 threadidhwnd = GetWindowThreadProcessId(hwnd, &procidhwnd);76 } 77 78 if(curprocid != procidhwnd && fActivate) {79 SendInternalMessageA(WM_ACTIVATEAPP, 1, threadidhwnd);80 }76 if(hwndOS2Win) { 77 threadidhwnd = O32_GetWindowThreadProcessId(hwndOS2Win, &procidhwnd); 78 } 79 80 if(fActivate) { 81 SendInternalMessageA(WM_ACTIVATEAPP, 1, dwThreadId); //activate; specify window thread id 82 } 83 else SendInternalMessageA(WM_ACTIVATEAPP, 0, threadidhwnd); //deactivate; specify thread id of other process 81 84 return rc; 82 85 } -
trunk/src/user32/new/win32wmdichild.h
r2290 r2426 1 /* $Id: win32wmdichild.h,v 1. 4 2000-01-01 14:54:56 cbratschiExp $ */1 /* $Id: win32wmdichild.h,v 1.5 2000-01-13 13:54:55 sandervl Exp $ */ 2 2 /* 3 3 * Win32 MDI Client Window Class for OS/2 … … 24 24 virtual ~Win32MDIChildWindow(); 25 25 26 virtual ULONG MsgActivate(BOOL fActivate, BOOL fMinimized, HWND hwnd );26 virtual ULONG MsgActivate(BOOL fActivate, BOOL fMinimized, HWND hwnd, HWND hwndOS2Win); 27 27 28 28 static HWND createChild(Win32MDIClientWindow *client, LPMDICREATESTRUCTA cs); -
trunk/src/user32/new/window.cpp
r2410 r2426 1 /* $Id: window.cpp,v 1.3 0 2000-01-11 17:34:44 cbratschiExp $ */1 /* $Id: window.cpp,v 1.31 2000-01-13 13:54:55 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window apis for OS/2 … … 328 328 return 0; 329 329 } 330 dprintf(("SetActiveWindow %x", hwnd));331 330 return window->SetActiveWindow(); 332 331 }
Note:
See TracChangeset
for help on using the changeset viewer.