- Timestamp:
- Nov 1, 1999, 8:11:46 PM (26 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/Makefile
r1491 r1540 1 # $Id: Makefile,v 1. 39 1999-10-28 15:20:24sandervl Exp $1 # $Id: Makefile,v 1.40 1999-11-01 19:11:38 sandervl Exp $ 2 2 3 3 # … … 125 125 pmframe.obj: pmframe.cpp win32class.h win32wbase.h pmframe.h win32wndchild.h 126 126 win32class.obj: win32class.cpp win32class.h win32wbase.h win32dlg.h gen_object.h $(PDWIN32_INCLUDE)\heapshared.h oslibwin.h win32wndchild.h 127 win32wbase.obj: win32wbase.cpp win32class.h win32wbase.h win32dlg.h gen_object.h $(PDWIN32_INCLUDE)\heapshared.h oslibwin.h win32wndchild.h $(PDWIN32_INCLUDE)\winres.h oslibres.h win32wndhandle.h oslibdos.h dc.h pmframe.h win32wdesktop.h 127 win32wbase.obj: win32wbase.cpp win32class.h win32wbase.h win32dlg.h gen_object.h $(PDWIN32_INCLUDE)\heapshared.h oslibwin.h win32wndchild.h $(PDWIN32_INCLUDE)\winres.h oslibres.h win32wndhandle.h oslibdos.h dc.h pmframe.h win32wdesktop.h controls.h 128 128 win32wbasepos.obj: win32wbasepos.cpp win32class.h win32wbase.h win32dlg.h gen_object.h $(PDWIN32_INCLUDE)\heapshared.h oslibwin.h win32wndchild.h $(PDWIN32_INCLUDE)\winres.h oslibres.h win32wndhandle.h oslibdos.h dc.h pmframe.h win32wdesktop.h 129 129 win32wnd.obj: win32wnd.cpp win32class.h win32wbase.h win32wnd.h win32dlg.h gen_object.h $(PDWIN32_INCLUDE)\heapshared.h oslibwin.h win32wndchild.h $(PDWIN32_INCLUDE)\winres.h oslibres.h win32wndhandle.h oslibdos.h oslibmenu.h -
trunk/src/user32/gen_object.cpp
r949 r1540 1 /* $Id: gen_object.cpp,v 1. 1 1999-09-15 23:18:50sandervl Exp $ */1 /* $Id: gen_object.cpp,v 1.2 1999-11-01 19:11:39 sandervl Exp $ */ 2 2 /* 3 3 * Generic Object Class for OS/2 … … 68 68 //****************************************************************************** 69 69 //****************************************************************************** 70 void GenericObject::DestroyAll(GenericObject *head) 71 { 72 GenericObject *cur, *next; 73 74 cur = head; 75 while(cur) { 76 next = cur->next; 77 delete cur; 78 cur = next; 79 } 80 } 81 //****************************************************************************** 82 //****************************************************************************** 70 83 void GenericObject::enterMutex() 71 84 { -
trunk/src/user32/gen_object.h
r1490 r1540 1 /* $Id: gen_object.h,v 1. 2 1999-10-28 12:00:33sandervl Exp $ */1 /* $Id: gen_object.h,v 1.3 1999-11-01 19:11:39 sandervl Exp $ */ 2 2 /* 3 3 * Generic Object Class for OS/2 … … 40 40 static void leaveMutex(DWORD objType); 41 41 42 static void DestroyAll(GenericObject *head); 43 42 44 #ifdef __DEBUG_ALLOC__ 43 45 void *operator new(size_t size, const char *filename, size_t lineno) -
trunk/src/user32/initterm.cpp
r1490 r1540 1 /* $Id: initterm.cpp,v 1.1 4 1999-10-28 12:00:34sandervl Exp $ */1 /* $Id: initterm.cpp,v 1.15 1999-11-01 19:11:39 sandervl Exp $ */ 2 2 3 3 /* … … 49 49 /*-------------------------------------------------------------------*/ 50 50 static void APIENTRY cleanup(ULONG reason); 51 static void APIENTRY cleanupQueue(ULONG ulReason);52 51 53 52 extern "C" { … … 96 95 /*******************************************************************/ 97 96 98 rc = DosExitList(0x0000F000|EXLST_ADD, cleanup); 99 if(rc) 100 return 0UL; 101 102 rc = DosExitList(0x00008000|EXLST_ADD, cleanupQueue); 97 rc = DosExitList(0x00008000|EXLST_ADD, cleanup); 103 98 if(rc) 104 99 return 0UL; … … 135 130 } 136 131 137 static void APIENTRY cleanupQueue(ULONG ulReason)138 {139 CloseSpyQueue();140 DosExitList(EXLST_EXIT, cleanupQueue);141 }142 143 132 static void APIENTRY cleanup(ULONG ulReason) 144 133 { 145 134 dprintf(("user32 exit\n")); 135 DestroyDesktopWindow(); 136 Win32BaseWindow::DestroyAll(); 137 UnregisterSystemClasses(); 138 Win32WndClass::DestroyAll(); 146 139 SYSCOLOR_Save(); 147 DestroyDesktopWindow(); 148 UnregisterSystemClasses(); 140 CloseSpyQueue(); 149 141 _ctordtorTerm(); 150 142 dprintf(("user32 exit done\n")); 143 151 144 DosExitList(EXLST_EXIT, cleanup); 152 return ;153 145 } 146 -
trunk/src/user32/oslibwin.cpp
r1523 r1540 1 /* $Id: oslibwin.cpp,v 1.4 0 1999-10-30 18:08:19 dengertExp $ */1 /* $Id: oslibwin.cpp,v 1.41 1999-11-01 19:11:40 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 50 50 //****************************************************************************** 51 51 HWND OSLibWinCreateWindow(HWND hwndParent, ULONG dwWinStyle, ULONG dwFrameStyle, 52 char *pszName, HWND Owner, ULONG f HWND_BOTTOM, HWND *hwndFrame,52 char *pszName, HWND Owner, ULONG fBottom, HWND *hwndFrame, 53 53 ULONG id) 54 54 { … … 69 69 ULONG dwClientStyle; 70 70 71 #if 072 // if(dwFrameStyle || hwndParent == HWND_DESKTOP) {73 dwClientStyle = dwWinStyle & ~(WS_TABSTOP | WS_GROUP | WS_CLIPSIBLINGS);74 75 dwFrameStyle |= FCF_NOBYTEALIGN;76 if (hwndParent == HWND_DESKTOP && dwFrameStyle & FCF_TITLEBAR)77 dwFrameStyle |= FCF_TASKLIST | FCF_NOMOVEWITHOWNER;78 79 dwWinStyle &= ~(WS_CLIPCHILDREN | WS_CLIPSIBLINGS);80 81 *hwndFrame = WinCreateStdWindow(hwndParent, dwWinStyle,82 &dwFrameStyle, WIN32_STDCLASS,83 "", dwClientStyle, 0, id, &hwndClient);84 if(*hwndFrame) {85 if(pszName) {86 WinSetWindowText(*hwndFrame, pszName);87 }88 return hwndClient;89 }90 dprintf(("OSLibWinCreateWindow: (FRAME) WinCreateStdWindow failed (%x)", WinGetLastError(GetThreadHAB())));91 return 0;92 #else93 71 BOOL TopLevel = hwndParent == HWND_DESKTOP; 94 72 FRAMECDATA FCData = {sizeof (FRAMECDATA), 0, 0, 0}; … … 107 85 TopLevel ? WC_FRAME : WIN32_INNERFRAME, 108 86 pszName, dwWinStyle, 0, 0, 50, 30, 109 hwndParent, HWND_TOP, id, &FCData, NULL); 87 hwndParent, HWND_TOP, 88 id, &FCData, NULL); 110 89 if (*hwndFrame) { 111 90 hwndClient = WinCreateWindow (*hwndFrame, WIN32_STDCLASS, … … 114 93 if (hwndClient != NULLHANDLE) 115 94 WinSendMsg (*hwndFrame, WM_UPDATEFRAME, 0, 0); 95 116 96 return hwndClient; 117 97 } 118 98 dprintf(("OSLibWinCreateWindow: (FRAME) WinCreateStdWindow failed (%x)", WinGetLastError(GetThreadHAB()))); 119 99 return 0; 120 #endif121 122 #if 0123 }124 hwndClient = WinCreateWindow(hwndParent, WIN32_STDCLASS, pszName, dwWinStyle, 0, 0, 0, 0,125 Owner, (fHWND_BOTTOM) ? HWND_BOTTOM :HWND_TOP, 0, NULL,126 NULL);127 *hwndFrame = hwndClient;128 return hwndClient;129 #endif130 100 } 131 101 //****************************************************************************** … … 378 348 if(rc == 0) 379 349 dprintf(("WinShowWindow %x failed %x", hwnd, WinGetLastError(GetThreadHAB()))); 380 rc = WinSetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, fl);350 rc = WinSetWindowPos(hwnd, 0, 0, 0, 0, 0, fl); 381 351 if(rc == 0) 382 352 dprintf(("WinShowWindow %x failed %x", hwnd, WinGetLastError(GetThreadHAB()))); -
trunk/src/user32/oslibwin.h
r1511 r1540 1 /* $Id: oslibwin.h,v 1.2 2 1999-10-29 16:06:55 cbratschiExp $ */1 /* $Id: oslibwin.h,v 1.23 1999-11-01 19:11:41 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 38 38 39 39 HWND OSLibWinCreateWindow(HWND hwndParent, ULONG dwWinStyle, ULONG dwFrameStyle, 40 char *pszName, HWND Owner, ULONG f HWND_BOTTOM,40 char *pszName, HWND Owner, ULONG fBottom, 41 41 HWND *hwndFrame, ULONG id); 42 42 -
trunk/src/user32/pmframe.cpp
r1530 r1540 1 /* $Id: pmframe.cpp,v 1.1 5 1999-10-31 17:53:51 cbratschiExp $ */1 /* $Id: pmframe.cpp,v 1.16 1999-11-01 19:11:41 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Frame Managment Code for OS/2 … … 232 232 switch(msg) 233 233 { 234 #if 1235 234 case WM_ADJUSTWINDOWPOS: 236 235 { … … 390 389 return rc; 391 390 } 392 #if 0393 case WM_ENABLE:394 dprintf(("PMFRAME: WM_ENABLE %x", win32wnd->getWindowHandle()));395 win32wnd->MsgEnable(SHORT1FROMMP(mp1));396 goto RunDefFrameProc;397 398 case WM_SHOW:399 dprintf(("PMFRAME: WM_SHOW %x %d", win32wnd->getWindowHandle(), mp1));400 win32wnd->MsgShow((ULONG)mp1);401 goto RunDefFrameProc;402 403 391 case WM_ACTIVATE: 404 392 { 405 HWND hwndActivate = (HWND)mp2;406 BOOL fMinimized = FALSE;407 408 dprintf(("PMFRAME: WM_ACTIVATE %x %x", hwnd, hwndActivate));409 if(WinQueryWindowULong(hwndActivate, OFFSET_WIN32PM_MAGIC) != WIN32PM_MAGIC) {410 //another (non-win32) application's window411 //set to NULL (allowed according to win32 SDK) to avoid problems412 hwndActivate = NULL;413 }414 if(WinQueryWindowULong(hwnd, QWL_STYLE) & WS_MINIMIZED)415 {416 fMinimized = TRUE;417 }418 419 win32wnd->MsgActivate(SHORT1FROMMP(mp1), fMinimized, Win32BaseWindow::OS2ToWin32Handle(hwndActivate));420 421 RestoreOS2TIB();422 MRESULT rc = OldFrameProc(hwnd,msg,mp1,mp2);423 DrawActivate(win32wnd, hwnd);424 return rc;425 }426 #else427 case WM_ACTIVATE:428 {429 393 HWND hwndTitle; 430 394 USHORT flags = WinQueryWindowUShort(hwnd,QWS_FLAGS); … … 440 404 RestoreOS2TIB(); 441 405 return 0; 442 }443 444 #endif445 #else446 case WM_ADJUSTWINDOWPOS:447 {448 PSWP pswp = (PSWP)mp1;449 Win32BaseWindow *wndchild;450 451 wndchild = Win32BaseWindow::GetWindowFromOS2FrameHandle(pswp->hwnd);452 if(wndchild && wndchild->isChild())453 {454 #if 0455 SWP swp = *pswp;456 457 MRESULT rc = OldFrameProc(hwnd, msg, mp1, mp2);458 pswp->x = swp.x;459 pswp->y = swp.y;460 pswp->fl = swp.fl;461 #endif462 dprintf(("PMFRAME: WM_ADJUSTWINDOWPOS %x %x %x (%d,%d) (%d,%d)", hwnd, pswp->hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));463 RestoreOS2TIB();464 return (MRESULT)0;465 }466 goto RunDefFrameProc;467 406 } 468 469 case WM_ACTIVATE:470 DrawActivate(win32wnd, hwnd);471 goto RunDefFrameProc;472 #endif473 407 474 408 case WM_DESTROY: -
trunk/src/user32/win32class.cpp
r1490 r1540 1 /* $Id: win32class.cpp,v 1. 4 1999-10-28 12:00:34sandervl Exp $ */1 /* $Id: win32class.cpp,v 1.5 1999-11-01 19:11:42 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Class Managment Code for OS/2 … … 24 24 #include <win32wnd.h> 25 25 26 static fDestroyAll = FALSE; 27 26 28 //****************************************************************************** 27 29 //Win32WndClass methods: … … 123 125 Win32WndClass::~Win32WndClass() 124 126 { 127 if(classNameA) { 128 dprintf(("Win32WndClass dtor, destroy class %s\n", classNameA)); 129 } 130 125 131 //SvL: Don't delete global classes 126 132 if(classNameA && !(windowStyle & CS_GLOBALCLASS)) { … … 136 142 free(menuNameW); 137 143 } 144 } 145 //****************************************************************************** 146 //****************************************************************************** 147 void Win32WndClass::DestroyAll() 148 { 149 fDestroyAll = TRUE; 150 GenericObject::DestroyAll(wndclasses); 138 151 } 139 152 //****************************************************************************** … … 449 462 Win32WndClass *wndclass; 450 463 451 dprintf(("::UnregisterClass, destroy class %X!!\n", id));452 464 wndclass = FindClass(hinst, id); 453 465 if(wndclass) { -
trunk/src/user32/win32class.h
r1433 r1540 1 /* $Id: win32class.h,v 1. 3 1999-10-24 22:56:09sandervl Exp $ */1 /* $Id: win32class.h,v 1.4 1999-11-01 19:11:43 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Class Managment Code for OS/2 … … 62 62 63 63 static Win32WndClass *FindClass(HINSTANCE hinst, LPSTR id); 64 static void DestroyAll(); 64 65 65 66 private: -
trunk/src/user32/win32wbase.cpp
r1526 r1540 1 /* $Id: win32wbase.cpp,v 1.7 0 1999-10-31 01:14:42sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.71 1999-11-01 19:11:43 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 39 39 #include "win32wdesktop.h" 40 40 #include "pmwindow.h" 41 #include "controls.h" 41 42 #include <wprocess.h> 42 43 … … 75 76 76 77 void PrintWindowStyle(DWORD dwStyle, DWORD dwExStyle); 78 79 static fDestroyAll = FALSE; 77 80 78 81 //****************************************************************************** … … 199 202 OSLibWinSetWindowULong(OS2Hwnd, OFFSET_WIN32PM_MAGIC, 0); 200 203 201 if( getParent() && getParent()->getFirstChild() == this && getNextChild() == NULL)204 if(!fDestroyAll && getParent() && getParent()->getFirstChild() == this && getNextChild() == NULL) 202 205 { 203 206 //if we're the last child that's being destroyed and our … … 210 213 } 211 214 } 215 else 216 if(fDestroyAll) { 217 dprintf(("Destroying window %x %s", getWindowHandle(), windowNameA)); 218 setParent(NULL); //or else we'll crash in the dtor of the ChildWindow class 219 } 220 212 221 if (isOwnDC()) 213 222 releaseOwnDC (ownDC); … … 234 243 horzScrollInfo = NULL; 235 244 } 245 } 246 //****************************************************************************** 247 //****************************************************************************** 248 void Win32BaseWindow::DestroyAll() 249 { 250 fDestroyAll = TRUE; 251 GenericObject::DestroyAll(windows); 236 252 } 237 253 //****************************************************************************** … … 414 430 dwExStyle = cs->dwExStyle; 415 431 416 #if 1417 //SvL: Messes up Z-order of dialog controls418 432 hwndLinkAfter = HWND_TOP; 419 #else 420 hwndLinkAfter = ((cs->style & (WS_CHILD|WS_MAXIMIZE)) == WS_CHILD) 421 ? HWND_BOTTOM : HWND_TOP; 422 #endif 433 if(WIDGETS_IsControl(this, BUTTON_CONTROL) && ((dwStyle & 0x0f) == BS_GROUPBOX)) 434 { 435 hwndLinkAfter = HWND_BOTTOM; 436 dwStyle |= WS_CLIPSIBLINGS; 437 } 438 else 439 if(WIDGETS_IsControl(this, STATIC_CONTROL) && !(dwStyle & WS_GROUP)) { 440 dwStyle |= WS_CLIPSIBLINGS; 441 } 423 442 424 443 /* Increment class window counter */ … … 524 543 return FALSE; 525 544 } 545 526 546 SetLastError(0); 527 547 return TRUE; … … 622 642 623 643 if(getParent()) { 624 SetWindowPos( getParent()->getWindowHandle(), rectClient.left, rectClient.top,644 SetWindowPos(hwndLinkAfter, rectClient.left, rectClient.top, 625 645 rectClient.right-rectClient.left, 626 646 rectClient.bottom-rectClient.top, 627 SWP_NOACTIVATE | SWP_NO ZORDER | SWP_NOREDRAW);647 SWP_NOACTIVATE | SWP_NOREDRAW); 628 648 } 629 649 else { 630 SetWindowPos( HWND_TOP, rectClient.left, rectClient.top,650 SetWindowPos(hwndLinkAfter, rectClient.left, rectClient.top, 631 651 rectClient.right-rectClient.left, 632 652 rectClient.bottom-rectClient.top, … … 810 830 { 811 831 lastHitTestVal = SendInternalMessageA(WM_NCHITTEST, 0, MAKELONG((USHORT)x, (USHORT)y)); 832 dprintf(("MsgHitTest returned %x", lastHitTestVal)); 812 833 return 1; //TODO: May need to change this 813 834 } … … 1095 1116 && hwndTop != GetForegroundWindow() ) 1096 1117 { 1097 SetActiveWindow();1118 ::SetActiveWindow(hwndTop); 1098 1119 } 1099 1120 } … … 1421 1442 case WM_MOUSEACTIVATE: 1422 1443 { 1423 DWORD dwStyle = GetWindowLongA(GWL_STYLE);1424 DWORD dwExStyle = GetWindowLongA(GWL_EXSTYLE);1425 1444 dprintf(("DefWndProc: WM_MOUSEACTIVATE for %x Msg %s", Win32Hwnd, GetMsgText(HIWORD(lParam)))); 1426 if( dwStyle & WS_CHILD && !(dwExStyle& WS_EX_NOPARENTNOTIFY) )1445 if(getStyle() & WS_CHILD && !(getExStyle() & WS_EX_NOPARENTNOTIFY) ) 1427 1446 { 1428 1447 if(getParent()) { … … 1435 1454 case WM_SETCURSOR: 1436 1455 { 1437 DWORD dwStyle = GetWindowLongA(GWL_STYLE);1438 DWORD dwExStyle = GetWindowLongA(GWL_EXSTYLE);1439 1456 dprintf(("DefWndProc: WM_SETCURSOR for %x Msg %s", Win32Hwnd, GetMsgText(HIWORD(lParam)))); 1440 if( dwStyle & WS_CHILD && !(dwExStyle& WS_EX_NOPARENTNOTIFY) )1457 if(getStyle() & WS_CHILD && !(getExStyle() & WS_EX_NOPARENTNOTIFY) ) 1441 1458 { 1442 1459 if(getParent()) { … … 1905 1922 { 1906 1923 ULONG showstate = 0; 1924 HWND hWinAfter; 1907 1925 1908 1926 dprintf(("ShowWindow %x %x", getWindowHandle(), nCmdShow)); … … 1972 1990 } 1973 1991 1992 /* We can't activate a child window (WINE) */ 1993 if(getStyle() & WS_CHILD) 1994 showstate &= ~SWPOS_ACTIVATE; 1995 1974 1996 if(showstate & SWPOS_SHOW) { 1975 1997 setStyle(getStyle() | WS_VISIBLE); -
trunk/src/user32/win32wbase.h
r1526 r1540 1 /* $Id: win32wbase.h,v 1.3 7 1999-10-31 01:14:43sandervl Exp $ */1 /* $Id: win32wbase.h,v 1.38 1999-11-01 19:11:45 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 216 216 static Win32BaseWindow *GetWindowFromOS2FrameHandle(HWND hwnd); 217 217 218 static void DestroyAll(); 219 218 220 PVOID getOldFrameProc() { return pOldFrameProc; }; 219 221 VOID setOldFrameProc(PVOID aOldFrameProc) { pOldFrameProc = aOldFrameProc; }; … … 258 260 HWND hwndLinkAfter; 259 261 DWORD flags; 260 DWORDlastHitTestVal; //Last value returned by WM_NCHITTEST handler262 LONG lastHitTestVal; //Last value returned by WM_NCHITTEST handler 261 263 262 264 BOOL isIcon; -
trunk/src/user32/window.cpp
r1537 r1540 1 /* $Id: window.cpp,v 1.3 1 1999-11-01 16:18:05 dengertExp $ */1 /* $Id: window.cpp,v 1.32 1999-11-01 19:11:45 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window apis for OS/2 … … 87 87 } 88 88 #endif 89 if ((!strcmpi(className, "BUTTON") && ((style & 0x0f) == BS_GROUPBOX)) ||90 ((!strcmpi(className, "STATIC")) && !(style & WS_GROUP)))91 style |= WS_CLIPSIBLINGS;92 89 93 90 /* Create the window */ … … 190 187 else dprintf(("CreateWindowExW: class %d parent %x (%d,%d) (%d,%d), %x %x", className, parent, x, y, width, height, style, exStyle)); 191 188 192 if (!lstrcmpiW(className,(LPCWSTR)L"BUTTON") && ((style & 0x0f) == BS_GROUPBOX))193 style |= WS_CLIPSIBLINGS;194 195 189 /* Create the window */ 196 190 cs.lpCreateParams = data; … … 462 456 if(!window) { 463 457 dprintf(("ShowWindow, window %x not found", hwnd)); 464 SetLastError(ERROR_INVALID_WINDOW_HANDLE);458 SetLastError(ERROR_INVALID_WINDOW_HANDLE); 465 459 return 0; 466 460 } -
trunk/src/user32/windowclass.cpp
r1495 r1540 1 /* $Id: windowclass.cpp,v 1. 3 1999-10-28 18:22:31sandervl Exp $ */1 /* $Id: windowclass.cpp,v 1.4 1999-11-01 19:11:46 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Class Code for OS/2 … … 115 115 BOOL WIN32API UnregisterClassA(LPCSTR lpszClassName, HINSTANCE hinst) 116 116 { 117 dprintf(("USER32: UnregisterClassA\n"));118 117 Win32WndClass::UnregisterClassA(hinst, (LPSTR)lpszClassName); 119 118
Note:
See TracChangeset
for help on using the changeset viewer.