- Timestamp:
- Jan 11, 2004, 1:04:44 PM (22 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 2 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/Makefile
r10222 r10379 1 # $Id: Makefile,v 1.10 8 2003-08-08 15:54:32 sandervl Exp $1 # $Id: Makefile,v 1.109 2004-01-11 12:03:12 sandervl Exp $ 2 2 3 3 # … … 69 69 $(OBJDIR)\windowword.obj \ 70 70 $(OBJDIR)\windowmsg.obj \ 71 $(OBJDIR)\callwrap.obj \ 71 72 $(OBJDIR)\message.obj \ 72 73 $(OBJDIR)\winproc.obj \ -
trunk/src/user32/caret.cpp
r9217 r10379 1 /* $Id: caret.cpp,v 1. 19 2002-09-06 12:31:40sandervl Exp $ */1 /* $Id: caret.cpp,v 1.20 2004-01-11 12:03:13 sandervl Exp $ */ 2 2 3 3 /* … … 119 119 } 120 120 121 /* 122 * The SetCaretPos function moves the caret to the specified coordinates. If 123 * the window that owns the caret was created with the CS_OWNDC class style, 124 * then the specified coordinates are subject to the mapping mode of the device 125 * context associated with that window. 126 * 127 */ 121 128 BOOL WIN32API SetCaretPos (int x, int y) 122 129 { -
trunk/src/user32/dc.cpp
r10316 r10379 1 /* $Id: dc.cpp,v 1.12 2 2003-11-12 14:10:18sandervl Exp $ */1 /* $Id: dc.cpp,v 1.123 2004-01-11 12:03:13 sandervl Exp $ */ 2 2 3 3 /* … … 618 618 //****************************************************************************** 619 619 //****************************************************************************** 620 void releaseOwnDC (HDC hps)621 {622 pDCData pHps = (pDCData)GpiQueryDCData ((HPS)hps);623 624 dprintf2(("releaseOwnDC %x", hps));625 626 if (pHps) {627 if (pHps->hrgnHDC)628 GpiDestroyRegion (pHps->hps, pHps->hrgnHDC);629 630 GpiSetBitmap (pHps->hps, NULL);631 O32_DeleteObject (pHps->nullBitmapHandle);632 GpiDestroyPS(pHps->hps);633 634 if (pHps->hdc)635 DevCloseDC(pHps->hdc);636 }637 }638 //******************************************************************************639 //******************************************************************************640 620 HDC WIN32API BeginPaint (HWND hWnd, PPAINTSTRUCT_W lpps) 641 621 { … … 685 665 } 686 666 hpsPaint = hPS_ownDC; 667 STATS_GetDCEx(hwnd, hpsPaint, 0, 0); 687 668 } 688 669 } … … 865 846 866 847 HWND hwndDC = WindowFromDC(hdc); 867 848 849 //hwndDC can be zero if the window has already been destroyed 868 850 if(hwndDC != hwnd) { 869 851 dprintf(("WARNING: ReleaseDC: wrong window handle specified %x -> %x", hwnd, hwndDC)); … … 908 890 } 909 891 892 STATS_ReleaseDC(hwnd, hdc); 910 893 if(isOwnDC) { 911 894 rc = TRUE; … … 914 897 UnselectGDIObjects(hdc); 915 898 rc = O32_ReleaseDC (0, hdc); 916 STATS_ReleaseDC(hwnd, hdc);917 899 } 918 900 … … 1117 1099 RELEASE_WNDOBJ(wnd); 1118 1100 1119 1120 1101 STATS_GetDCEx(hwnd, pHps->hps, hrgn, flags); 1121 1102 return (HDC)pHps->hps; … … 1620 1601 if (lComplexity == RGN_ERROR) 1621 1602 { 1622 RELEASE_WNDOBJ(window); 1623 return ERROR_W; 1603 goto fail; 1624 1604 } 1625 1605 … … 1646 1626 if(!child) { 1647 1627 dprintf(("ERROR: ScrollWindowEx, child %x not found", hwnd)); 1648 RELEASE_WNDOBJ(window); 1649 return 0; 1628 goto fail; 1650 1629 } 1651 1630 rectChild = *child->getWindowRect(); … … 1712 1691 RELEASE_WNDOBJ(window); 1713 1692 return (regionType); 1693 1694 fail: 1695 if(hrgn) GpiDestroyRegion(hpsScreen, hrgn); 1696 if(hpsScreen) WinReleasePS(hpsScreen); 1697 RELEASE_WNDOBJ(window); 1698 return ERROR_W; 1714 1699 } 1715 1700 //****************************************************************************** -
trunk/src/user32/dc.h
r10316 r10379 1 /* $Id: dc.h,v 1.1 8 2003-11-12 14:10:19sandervl Exp $ */1 /* $Id: dc.h,v 1.19 2004-01-11 12:03:15 sandervl Exp $ */ 2 2 /* 3 3 * public dc functions … … 15 15 extern BOOL isYup (struct _DCData *pHps); 16 16 extern HDC sendEraseBkgnd (Win32BaseWindow *wnd); 17 extern void releaseOwnDC (HDC hps);18 17 BOOL setPageXForm(Win32BaseWindow *wnd, struct _DCData * pHps); 19 18 -
trunk/src/user32/oslibwin.cpp
r10284 r10379 1 /* $Id: oslibwin.cpp,v 1.14 5 2003-10-22 12:43:13sandervl Exp $ */1 /* $Id: oslibwin.cpp,v 1.146 2004-01-11 12:03:15 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 85 85 dwWinStyle = dwWinStyle & ~(WS_TABSTOP | WS_GROUP); 86 86 87 if(fTaskList )87 if(fTaskList || hwndParent == HWND_DESKTOP) 88 88 { 89 89 dwFrameStyle |= FCF_NOMOVEWITHOWNER; … … 280 280 swp[i].cx += minmaxwidth/2; 281 281 } 282 swp[i].cy = minmaxheight; 282 //one pixel more to let PM center the controls properly 283 swp[i].cy = minmaxheight+1; 283 284 swp[i].fl = SWP_SIZE | SWP_MOVE | SWP_SHOW; 284 285 dprintf(("FID_MINMAX (%d,%d)(%d,%d)", swp[i].x, swp[i].y, swp[i].cx, swp[i].cy)); -
trunk/src/user32/pmwindow.cpp
r10328 r10379 1 /* $Id: pmwindow.cpp,v 1.22 5 2003-11-15 12:28:47sandervl Exp $ */1 /* $Id: pmwindow.cpp,v 1.226 2004-01-11 12:03:16 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 44 44 #include <thread.h> 45 45 #include <wprocess.h> 46 #include <objhandle.h> 46 47 #include "caret.h" 47 48 #include "timer.h" … … 64 65 #include "dbglocal.h" 65 66 66 67 #define ODIN_SetExceptionHandler(a)68 #define ODIN_UnsetExceptionHandler(a)69 #define hookInit(a)70 67 71 68 // Notification that focus change has completed (UNDOCUMENTED) … … 332 329 //Create win32 bitmap handles of the OS/2 min, max and restore buttons 333 330 hBmpMinButton = O32_CreateBitmapFromPMHandle(hbmFrameMenu[PMMENU_MINBUTTON]); 331 ObjSetHandleFlag(hBmpMinButton, OBJHANDLE_FLAG_NODELETE, 1); 334 332 hBmpMinButtonDown = O32_CreateBitmapFromPMHandle(hbmFrameMenu[PMMENU_MINBUTTONDOWN]); 333 ObjSetHandleFlag(hBmpMinButtonDown, OBJHANDLE_FLAG_NODELETE, 1); 335 334 hBmpMaxButton = O32_CreateBitmapFromPMHandle(hbmFrameMenu[PMMENU_MAXBUTTON]); 335 ObjSetHandleFlag(hBmpMaxButton, OBJHANDLE_FLAG_NODELETE, 1); 336 336 hBmpMaxButtonDown = O32_CreateBitmapFromPMHandle(hbmFrameMenu[PMMENU_MAXBUTTONDOWN]); 337 ObjSetHandleFlag(hBmpMaxButtonDown, OBJHANDLE_FLAG_NODELETE, 1); 337 338 hBmpRestoreButton = O32_CreateBitmapFromPMHandle(hbmFrameMenu[PMMENU_RESTOREBUTTON]); 339 ObjSetHandleFlag(hBmpRestoreButton, OBJHANDLE_FLAG_NODELETE, 1); 338 340 hBmpRestoreButtonDown = O32_CreateBitmapFromPMHandle(hbmFrameMenu[PMMENU_RESTOREBUTTONDOWN]); 341 ObjSetHandleFlag(hBmpRestoreButtonDown, OBJHANDLE_FLAG_NODELETE, 1); 339 342 hBmpCloseButton = O32_CreateBitmapFromPMHandle(hbmFrameMenu[PMMENU_CLOSEBUTTON]); 343 ObjSetHandleFlag(hBmpCloseButton, OBJHANDLE_FLAG_NODELETE, 1); 340 344 hBmpCloseButtonDown = O32_CreateBitmapFromPMHandle(hbmFrameMenu[PMMENU_CLOSEBUTTONDOWN]); 345 ObjSetHandleFlag(hBmpCloseButtonDown, OBJHANDLE_FLAG_NODELETE, 1); 341 346 DevCloseDC(hdc); 342 347 } … … 2126 2131 2127 2132 dprintf(("PMFRAME:WM_OWNERPOSCHANGE %x %x %x (%s) (%d,%d) (%d,%d)", win32wnd->getWindowHandle(), pswp->hwnd, pswp->fl, DbgGetStringSWPFlags(pswp->fl), pswp->x, pswp->y, pswp->cx, pswp->cy)); 2128 goto RunDefFrameWndProc; 2133 RestoreOS2TIB(); 2134 rc = pfnFrameWndProc(hwnd, msg, mp1, mp2); 2135 SetWin32TIB(); 2136 dprintf(("PMFRAME: DEF WM_OWNERPOSCHANGE %x %x %x (%s) (%d,%d) (%d,%d)", win32wnd->getWindowHandle(), pswp->hwnd, pswp->fl, DbgGetStringSWPFlags(pswp->fl), pswp->x, pswp->y, pswp->cx, pswp->cy)); 2137 break; 2129 2138 } 2130 2139 #endif -
trunk/src/user32/win32dlg.cpp
r10033 r10379 1 /* $Id: win32dlg.cpp,v 1.8 1 2003-04-24 13:59:14sandervl Exp $ */1 /* $Id: win32dlg.cpp,v 1.82 2004-01-11 12:03:17 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Dialog Code for OS/2 … … 426 426 if (!getCharSizeFromDC( hdc, 0, &size )) return FALSE; 427 427 DeleteDC( hdc ); 428 dprintf(("Dialog base unit size (%d,%d)", size.cx, size.cy)); 428 429 xBaseUnit = size.cx; 429 430 yBaseUnit = size.cy; -
trunk/src/user32/win32wbase.cpp
r10332 r10379 1 /* $Id: win32wbase.cpp,v 1.38 2 2003-11-17 13:15:03sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.383 2004-01-11 12:03:18 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 68 68 #include "timer.h" 69 69 #include "user32api.h" 70 #include "callwrap.h" 70 71 71 72 #define DBG_LOCALLOG DBG_win32wbase … … 144 145 DebugInt3(); 145 146 } 147 Win32HwndOrg = Win32Hwnd; 146 148 147 149 posx = posy = 0; … … 249 251 } 250 252 251 /* Decrement class window counter */ 253 // Decrement class window counter 254 // NOTE: Must be done before ReleaseDC call for ownDC! 252 255 if(windowClass) { 253 256 RELEASE_CLASSOBJ(windowClass); 254 257 } 255 258 256 if( isOwnDC())257 releaseOwnDC(ownDC);259 if(ownDC) 260 ReleaseDC(Win32HwndOrg, ownDC); 258 261 259 262 if(Win32Hwnd) … … 670 673 //DC among different windows... DevOpenDC apparently can't be used 671 674 //for window DCs and WinOpenWindowDC must be associated with a window 672 ownDC = GetDCEx(getWindowHandle(), NULL, DCX_USESTYLE);675 ownDC = 0; //GetDCEx(getWindowHandle(), NULL, DCX_USESTYLE); 673 676 } 674 677 /* Set the window menu */ … … 888 891 HwFreeWindowHandle(Win32Hwnd); 889 892 Win32Hwnd = 0; 893 } 894 // Decrement class window counter 895 // NOTE: Must be done before ReleaseDC call for ownDC! 896 if(windowClass) { 897 RELEASE_CLASSOBJ(windowClass); 898 } 899 900 if(ownDC) { 901 ReleaseDC(Win32Hwnd, ownDC); 902 ownDC = 0; 890 903 } 891 904 } … … 2351 2364 2352 2365 case SW_SHOWNOACTIVATE: 2353 swp |= SWP_NOZORDER; 2354 if (GetActiveWindow()) 2355 swp |= SWP_NOACTIVATE; 2366 swp |= SWP_NOZORDER | SWP_NOACTIVATE; 2356 2367 /* fall through */ 2357 2368 case SW_SHOWNORMAL: /* same as SW_NORMAL: */ … … 2539 2550 dprintf(("new window rectangle (%d,%d)(%d,%d)", rectWindow.left, rectWindow.top, rectWindow.right, rectWindow.bottom)); 2540 2551 } 2552 } 2553 2554 // Hack alert: This makes sure the tooltips windows in OpenOffice don't 2555 // activate the owner windows too. 2556 // First condition takes care of SetWindowPos during window 2557 // creation. The 2nd one for calls made by OpenOffice 2558 if(((getStyle() & WS_POPUP) && (getExStyle() & WS_EX_TOPMOST)) || (fuFlags & SWP_NOOWNERZORDER)) 2559 { 2560 //SWP_NOOWNERZORDER means only the z-order of this window changes; it 2561 //should not affect the owner 2562 //PM doesn't support this feature, so this hack might work 2563 wpos.flags |= SWP_NOZORDER; 2541 2564 } 2542 2565 … … 3123 3146 child->addRef(); 3124 3147 unlock(); 3125 if( lpfn(hwnd, lParam) == FALSE)3148 if(WrapCallback2((WNDPROC)lpfn, hwnd, lParam) == FALSE) 3126 3149 { 3127 3150 child->release(); … … 3189 3212 if(dwThreadId == tid) { 3190 3213 dprintf(("EnumThreadWindows: Found Window %x", hwndWin32)); 3191 if((rc = lpfn(hwndWin32, lParam)) == FALSE) {3214 if((rc = WrapCallback2((WNDPROC)lpfn, hwndWin32, lParam)) == FALSE) { 3192 3215 break; 3193 3216 } … … 3223 3246 { 3224 3247 dprintf2(("EnumWindows: Found Window %x", hwnd)); 3225 if((rc = lpfn(hwnd, lParam)) == FALSE) {3248 if((rc = WrapCallback2((WNDPROC)lpfn, hwnd, lParam)) == FALSE) { 3226 3249 break; 3227 3250 } -
trunk/src/user32/win32wbase.h
r10316 r10379 1 /* $Id: win32wbase.h,v 1.15 6 2003-11-12 14:10:21sandervl Exp $ */1 /* $Id: win32wbase.h,v 1.157 2004-01-11 12:03:20 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 258 258 void setOldPMWindowProc(PVOID pfnPMWndProc) { pfnOldPMWndProc = pfnPMWndProc; }; 259 259 260 260 virtual HWND GetWindow(UINT uCmd); 261 261 virtual BOOL EnableWindow(BOOL fEnable); 262 262 BOOL CloseWindow(); … … 377 377 HWND OS2Hwnd, OS2HwndFrame; 378 378 HMENU hSysMenu; 379 HWND Win32Hwnd ;379 HWND Win32Hwnd, Win32HwndOrg; 380 380 381 381 int posx, posy, width, height; … … 520 520 //Temporary hack for CS_CLASSDC style (do the same as for CS_OWNDC) 521 521 #ifndef OS2_INCLUDED 522 BOOL isOwnDC() { return (windowClass && windowClass->getStyle() & (CS_OWNDC|CS_CLASSDC)); }522 BOOL isOwnDC() { return (windowClass && (windowClass->getStyle() & (CS_OWNDC|CS_CLASSDC))); } 523 523 #else 524 BOOL isOwnDC() { return (windowClass && windowClass->getStyle() & (CS_OWNDC_W|CS_CLASSDC_W)); }524 BOOL isOwnDC() { return (windowClass && (windowClass->getStyle() & (CS_OWNDC_W|CS_CLASSDC_W))); } 525 525 #endif 526 526 -
trunk/src/user32/win32wdesktop.cpp
r9523 r10379 1 /* $Id: win32wdesktop.cpp,v 1.2 0 2002-12-18 12:28:07sandervl Exp $ */1 /* $Id: win32wdesktop.cpp,v 1.21 2004-01-11 12:03:21 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Desktop Window for OS/2 … … 90 90 } 91 91 //****************************************************************************** 92 //****************************************************************************** 93 HWND Win32Desktop::GetWindow(UINT uCmd) 94 { 95 HWND hwndRelated = 0; 96 Win32BaseWindow *window; 97 98 switch(uCmd) 99 { 100 case GW_CHILD: 101 //special case for the desktop window. we need to find the first Odin 102 //window in the z-order 103 hwndRelated = OSLibWinQueryWindow(getOS2WindowHandle(), QWOS_TOP); 104 while(hwndRelated) 105 { 106 window = GetWindowFromOS2FrameHandle(hwndRelated); 107 if(window) { 108 hwndRelated = window->getWindowHandle(); 109 RELEASE_WNDOBJ(window); 110 break; 111 } 112 hwndRelated = OSLibWinQueryWindow(hwndRelated, QWOS_NEXT); 113 } 114 break; 115 116 default: 117 return Win32BaseWindow::GetWindow(uCmd); 118 } 119 end: 120 dprintf(("GetWindow %x %d returned %x", getWindowHandle(), uCmd, hwndRelated)); 121 return hwndRelated; 122 } 123 //****************************************************************************** 92 124 //Dummy window procedure. Does nothing. 93 125 //****************************************************************************** -
trunk/src/user32/win32wdesktop.h
r5935 r10379 1 /* $Id: win32wdesktop.h,v 1. 8 2001-06-09 14:50:22sandervl Exp $ */1 /* $Id: win32wdesktop.h,v 1.9 2004-01-11 12:03:21 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Desktop Window for OS/2 … … 25 25 virtual BOOL EnableWindow(BOOL fEnable); 26 26 virtual BOOL DestroyWindow(); 27 virtual BOOL isDesktopWindow(); 27 virtual BOOL isDesktopWindow(); 28 virtual HWND GetWindow(UINT uCmd); 28 29 29 30 protected: -
trunk/src/user32/win32wndhandle.cpp
r10256 r10379 1 /* $Id: win32wndhandle.cpp,v 1.1 8 2003-10-02 10:36:00sandervl Exp $ */1 /* $Id: win32wndhandle.cpp,v 1.19 2004-01-11 12:03:21 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Handle Management Code for OS/2 … … 48 48 { 49 49 if(globalwhandlecritsect.hmtxLock == 0) { 50 dprintf(("InitializeWindowHandles -> create shared critical section"));50 dprintf(("InitializeWindowHandles %x -> create shared critical section", &globalwhandlecritsect)); 51 51 DosInitializeCriticalSection(&globalwhandlecritsect, pszWndHandleSemName); 52 52 } 53 53 else { 54 dprintf(("InitializeWindowHandles -> access shared critical section"));54 dprintf(("InitializeWindowHandles %x -> access shared critical section", &globalwhandlecritsect)); 55 55 DosAccessCriticalSection(&globalwhandlecritsect, pszWndHandleSemName); 56 56 } … … 60 60 void FinalizeWindowHandles() 61 61 { 62 dprintf(("FinalizeWindowHandles %x", &globalwhandlecritsect)); 62 63 DosDeleteCriticalSection(&globalwhandlecritsect); 63 64 }
Note:
See TracChangeset
for help on using the changeset viewer.