- Timestamp:
- Jun 8, 2000, 8:10:12 PM (25 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 1 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/Makefile
r3662 r3679 1 # $Id: Makefile,v 1.7 1 2000-06-07 14:51:23sandervl Exp $1 # $Id: Makefile,v 1.72 2000-06-08 18:10:08 sandervl Exp $ 2 2 3 3 # … … 79 79 $(OBJDIR)\oslibres.obj \ 80 80 $(OBJDIR)\dc.obj \ 81 $(OBJDIR)\dcrgn.obj \ 81 82 $(OBJDIR)\timer.obj \ 82 83 $(OBJDIR)\dbglocal.obj \ -
trunk/src/user32/USER32.DEF
r3662 r3679 1 ; $Id: USER32.DEF,v 1.3 2 2000-06-07 14:51:24sandervl Exp $1 ; $Id: USER32.DEF,v 1.33 2000-06-08 18:10:08 sandervl Exp $ 2 2 3 3 ;Created by BLAST for IBM's compiler … … 649 649 _GetClipBox@8 @2014 650 650 _GetClipRgn@8 @2015 651 _ExtSelectClipRgn@12 @2016 652 _ExcludeClipRect@20 @2017 653 _IntersectClipRect@20 @2018 654 _OffsetClipRgn@12 @2019 655 _SelectClipRgn@8 @2020 656 -
trunk/src/user32/dbglocal.cpp
r3496 r3679 1 /* $Id: dbglocal.cpp,v 1. 5 2000-05-05 13:14:07sandervl Exp $ */1 /* $Id: dbglocal.cpp,v 1.6 2000-06-08 18:10:09 sandervl Exp $ */ 2 2 3 3 /* … … 87 87 "win32wdesktop", 88 88 "win32wbasenonclient", 89 "win32wbaseprop" 89 "win32wbaseprop", 90 "dcrgn" 90 91 }; 91 92 //****************************************************************************** -
trunk/src/user32/dbglocal.h
r3493 r3679 1 /* $Id: dbglocal.h,v 1. 4 2000-05-05 11:32:36sandervl Exp $ */1 /* $Id: dbglocal.h,v 1.5 2000-06-08 18:10:09 sandervl Exp $ */ 2 2 3 3 /* … … 87 87 #define DBG_win32wbasenonclient 65 88 88 #define DBG_win32wbaseprop 66 89 #define DBG_MAXFILES 67 89 #define DBG_dcrgn 67 90 #define DBG_MAXFILES 68 90 91 91 92 extern USHORT DbgEnabled[DBG_MAXFILES]; -
trunk/src/user32/dc.cpp
r3662 r3679 1 /* $Id: dc.cpp,v 1. 59 2000-06-07 14:51:25sandervl Exp $ */1 /* $Id: dc.cpp,v 1.60 2000-06-08 18:10:09 sandervl Exp $ */ 2 2 3 3 /* … … 348 348 goto setupclipregion; 349 349 } 350 350 if(pHps->isClientArea) { 351 //TODO: counter 352 dprintf(("WARNING: selectClientArea; already selected!!")); 353 goto setupclipregion; 354 } 351 355 pHps->isClient = TRUE; 352 356 … … 411 415 setupclipregion: 412 416 if(prclPaint) { 417 #if 0 413 418 hrgnClip = GpiQueryClipRegion(pHps->hps); 414 419 if(hrgnClip) { … … 419 424 } 420 425 else { 426 #endif 421 427 hrgnClip = GreCreateRectRegion(pHps->hps, prclPaint, 1); 422 428 GreSelectClipRegion(pHps->hps, hrgnClip, &hrgnOldClip); 423 }429 // } 424 430 } 425 431 … … 610 616 dprintf (("USER32: WARNING: WinQueryUpdateRect failed (error or no update rectangle)!!")); 611 617 612 mapWin32ToOS2Rect(wnd->getWindowHeight(), wnd->getClientRectPtr(), (PRECTLOS2)&rectlClient);613 WinOffsetRect(NULL, &rectlClient, -rectlClient.xLeft, -rectlClient.yBottom);614 615 hrgnOldClip = selectClientArea(wnd, pHps, &rectl Client);618 // mapWin32ToOS2Rect(wnd->getWindowHeight(), wnd->getClientRectPtr(), (PRECTLOS2)&rectlClient); 619 // WinOffsetRect(NULL, &rectlClient, -rectlClient.xLeft, -rectlClient.yBottom); 620 621 hrgnOldClip = selectClientArea(wnd, pHps, &rectl); 616 622 //save old clip region (restored for CS_OWNDC windows in EndPaint) 617 623 wnd->SetClipRegion(hrgnOldClip); … … 619 625 } 620 626 else { 627 #if 0 621 628 HRGN hrgnTmp = GpiCreateRegion(pHps->hps, 1, &rectl); 622 629 … … 627 634 GpiQueryRegionRects(pHps->hps, hrgnTmp, &rcltemp, &rgnrect, &rectls[0]); 628 635 GpiDestroyRegion(pHps->hps, hrgnTmp); 629 636 #endif 630 637 WinValidateRect(hwndClient, &rectl, FALSE); 631 638 … … 696 703 if (pHps && (pHps->hdcType == TYPE_3)) 697 704 { 698 removeClientArea(pHps); 705 GpiSetClipRegion(pHps->hps, wnd->GetClipRegion(), &hrgnOld); 706 wnd->SetClipRegion(0); 699 707 if(hrgnOld) { 700 GpiSetClipRegion(pHps->hps, NULLHANDLE, &hrgnOld);701 708 GpiDestroyRegion(pHps->hps, hrgnOld); 702 709 } 703 if(hwnd == HWND_DESKTOP || !wnd->isOwnDC()) { 704 pHps->hdcType = TYPE_1; //otherwise Open32's ReleaseDC fails 705 ReleaseDC(hwnd, pPaint->hdc); 706 } 707 else 708 if(wnd->GetClipRegion()) { 709 //TODO: What else do we need to restore here??? 710 GpiSetClipRegion(pHps->hps, wnd->GetClipRegion(), &hrgnOld); 711 wnd->SetClipRegion(0); 712 pHps->hdcType = TYPE_1; 713 } 710 pHps->hdcType = TYPE_1; //otherwise Open32's ReleaseDC fails 711 ReleaseDC(hwnd, pPaint->hdc); 714 712 } 715 713 else { … … 723 721 SetLastError(0); 724 722 return TRUE; 725 }726 //******************************************************************************727 //******************************************************************************728 int WIN32API GetClipBox( HDC hdc, PRECT lpRect)729 {730 pDCData pHps = (pDCData)GpiQueryDCData((HPS)hdc);731 RECTL rectl;732 LONG lComplexity;733 int rc;734 735 if(!hdc || !lpRect || !pHps) {736 dprintf(("GDI32: GetClipBox %x %x ERROR_INVALID_PARAMETER", hdc, lpRect));737 SetLastError(ERROR_INVALID_PARAMETER_W);738 return ERROR_W;739 }740 if(pHps->isPrinter)741 {742 lpRect->left = 0;743 lpRect->top = 0;744 lpRect->right = GetDeviceCaps( hdc, HORZRES_W);745 lpRect->bottom = GetDeviceCaps( hdc, VERTRES_W);746 747 rc = SIMPLEREGION_W;748 }749 else {750 lComplexity = GpiQueryClipBox(pHps->hps, &rectl);751 if(lComplexity == RGN_ERROR)752 {753 rc = ERROR_W;754 }755 else756 if(lComplexity == RGN_NULL)757 {758 memset(lpRect, 0, sizeof(*lpRect));759 rc = NULLREGION_W;760 }761 else {762 lpRect->left = rectl.xLeft;763 lpRect->right = rectl.xRight;764 #if 0765 lpRect->top = pHps->height - rectl.yTop;766 lpRect->bottom = pHps->height - rectl.yBottom;767 #else768 //No conversion required as GpiQueryClipBox is affected by769 //the y-inversion of the window770 lpRect->top = rectl.yBottom;771 lpRect->bottom = rectl.yTop;772 #endif773 //Convert including/including to including/excluding774 if(lpRect->left != lpRect->right) {775 lpRect->right++;776 }777 if(lpRect->top != lpRect->bottom) {778 lpRect->bottom++;779 }780 rc = (lComplexity == RGN_RECT) ? SIMPLEREGION_W : COMPLEXREGION_W;781 }782 }783 dprintf(("GDI32: GetClipBox of %X returned %d\n", hdc, rc));784 return rc;785 }786 //******************************************************************************787 //******************************************************************************788 int WIN32API GetClipRgn( HDC hdc, HRGN hRgn)789 {790 int rc;791 792 rc = O32_GetClipRgn(hdc, hRgn);793 dprintf(("GDI32: GetClipRgn %x %x returned %x", hdc, hRgn, rc));794 return rc;795 }796 //******************************************************************************797 //******************************************************************************798 BOOL WIN32API GetUpdateRect (HWND hwnd, LPRECT pRect, BOOL erase)799 {800 if (!hwnd)801 {802 dprintf(("GetUpdateRect %x %x %d -> invalid handle!!", hwnd, pRect, erase));803 SetLastError(ERROR_INVALID_WINDOW_HANDLE_W);804 return FALSE;805 }806 807 RECTL rectl;808 Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle(hwnd);809 810 if (!wnd)811 {812 SetLastError(ERROR_INVALID_WINDOW_HANDLE_W);813 dprintf(("GetUpdateRect %x %x %d -> invalid handle!!", hwnd, pRect, erase));814 return FALSE;815 }816 817 dprintf(("GetUpdateRect %x %x %d", hwnd, pRect, erase));818 819 BOOL updateRegionExists = WinQueryUpdateRect (wnd->getOS2WindowHandle(), pRect ? &rectl : NULL);820 if (!pRect) {821 return (updateRegionExists);822 }823 824 if (updateRegionExists)825 {826 //CB: for PM empty rect is valid827 if ((rectl.xLeft == rectl.xRight) || (rectl.yTop == rectl.yBottom)) {828 if(pRect) {829 pRect->left = pRect->top = pRect->right = pRect->bottom = 0;830 }831 return FALSE;832 }833 #if 0834 //SvL: Hack for memory.exe (doesn't get repainted properly otherwise)835 // if (wnd->isOwnDC() && wnd->getOwnDC())836 if (wnd->isOwnDC())837 {838 pDCData pHps = NULL;839 pHps = (pDCData)GpiQueryDCData(wnd->getOwnDC());840 if (!pHps)841 {842 SetLastError(ERROR_INVALID_HANDLE_W);843 return FALSE;844 }845 GpiConvert (pHps->hps, CVTC_DEVICE, CVTC_WORLD, 2, (PPOINTL)&rectl);846 }847 else848 {849 #endif850 long height = wnd->getClientHeight();851 rectl.yTop = height - rectl.yTop;852 rectl.yBottom = height - rectl.yBottom;853 ////////// }854 855 if (pRect)856 WINRECT_FROM_PMRECT (*pRect, rectl);857 858 if (erase)859 sendEraseBkgnd (wnd);860 }861 else862 {863 if(pRect) {864 pRect->left = pRect->top = pRect->right = pRect->bottom = 0;865 }866 }867 868 return updateRegionExists;869 }870 //******************************************************************************871 //functions for WM_NCPAINT872 //******************************************************************************873 INT SYSTEM GetOS2UpdateRgn(HWND hwnd,HRGN hrgn)874 {875 return O32_GetUpdateRgn(hwnd,hrgn,FALSE);876 }877 //******************************************************************************878 //******************************************************************************879 BOOL GetOS2UpdateRect(Win32BaseWindow *window, LPRECT pRect)880 {881 RECTL rectl;882 BOOL updateRegionExists = WinQueryUpdateRect(window->getOS2WindowHandle(),pRect ? &rectl:NULL);883 884 if (!pRect)885 return (updateRegionExists);886 887 if (updateRegionExists)888 {889 //CB: for PM empty rect is valid890 if ((rectl.xLeft == rectl.xRight) || (rectl.yTop == rectl.yBottom)) return FALSE;891 mapOS2ToWin32Rect(window->getWindowHeight(), (PRECTLOS2)&rectl,pRect);892 }893 else894 pRect->left = pRect->top = pRect->right = pRect->bottom = 0;895 896 return updateRegionExists;897 }898 //******************************************************************************899 //******************************************************************************900 int WIN32API GetUpdateRgn (HWND hwnd, HRGN hrgn, BOOL erase)901 {902 LONG Complexity;903 904 Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle(hwnd);905 906 if (!wnd)907 {908 SetLastError(ERROR_INVALID_WINDOW_HANDLE_W);909 return ERROR_W;910 }911 912 Complexity = O32_GetUpdateRgn (wnd->getOS2WindowHandle(), hrgn, FALSE);913 if (erase && (Complexity > NULLREGION_W)) sendEraseBkgnd(wnd);914 915 return Complexity;916 723 } 917 724 //****************************************************************************** … … 929 736 return 0; 930 737 } 931 //SvL: Hack for memory.exe (doesn't get repainted properly otherwise)932 // isOwnDC = wnd->isOwnDC() && wnd->getOwnDC();933 738 isOwnDC = wnd->isOwnDC() && (wnd->getOwnDC() == hdc); 934 739 if(!isOwnDC) … … 1002 807 1003 808 isWindowOwnDC = (((hWindow == HWND_DESKTOP) ? FALSE : (wnd->isOwnDC())) 1004 && !(flags & DCX_CACHE_W));1005 1006 if(isWindowOwnDC) 809 && !(flags & (DCX_CACHE_W|DCX_WINDOW_W))); 810 811 if(isWindowOwnDC) //own dc always for client area 1007 812 { 1008 813 hps = wnd->getOwnDC(); 1009 814 if (hps) 1010 815 { 1011 1012 816 pDCData pHps = (pDCData)GpiQueryDCData (hps); 817 if (!pHps) 1013 818 goto error; 1014 819 1015 if(flags & DCX_WINDOW_W) 1016 removeClientArea(pHps); 1017 else 1018 selectClientArea(wnd, pHps, NULL); 1019 1020 setPageXForm (wnd, pHps); 1021 pHps->hdcType = TYPE_1; 1022 1023 dprintf (("User32: GetDCEx hwnd %x (%x %x) -> wnd %x hdc %x", hwnd, hrgn, flags, wnd, hps)); 1024 return (HDC)hps; 820 selectClientArea(wnd, pHps, NULL); 821 822 //TODO: Is this always necessary?? 823 setPageXForm (wnd, pHps); 824 pHps->hdcType = TYPE_1; 825 826 //TODO: intersect/exclude clip region? 827 dprintf (("User32: GetDCEx hwnd %x (%x %x) -> wnd %x hdc %x", hwnd, hrgn, flags, wnd, hps)); 828 return (HDC)hps; 1025 829 } 1026 830 else 1027 831 creatingOwnDC = TRUE; 1028 832 } 1029 833 … … 1086 890 else removeClientArea(pHps); 1087 891 1088 1089 892 setMapMode(wnd, pHps, MM_TEXT_W); 1090 893 … … 1200 1003 // RDW_ERASENOW 1201 1004 // RDW_UPDATENOW 1005 // RDW_FRAME 1006 // 1007 //TODO: Work ok for RDW_FRAME?? 1202 1008 //****************************************************************************** 1203 1009 BOOL WIN32API RedrawWindow(HWND hwnd, const RECT* pRect, HRGN hrgn, DWORD redraw) … … 1260 1066 PRECTL pr; 1261 1067 int i; 1262 LONG height = wnd ? wnd->getClientHeight() : OSLibQueryScreenHeight(); 1068 LONG height; 1069 1070 if(wnd) { 1071 height = (redraw & RDW_FRAME_W) ? wnd->getWindowHeight() : wnd->getClientHeight(); 1072 } 1073 else height = OSLibQueryScreenHeight(); 1263 1074 1264 1075 if (!hrgn) … … 1284 1095 else if (pRect) 1285 1096 { 1286 LONG height = wnd ? wnd->getClientHeight() : OSLibQueryScreenHeight(); 1287 1288 PMRECT_FROM_WINRECT (rectl, *pRect); 1289 rectl.yTop = height - rectl.yTop; 1290 rectl.yBottom = height - rectl.yBottom; 1097 if(wnd) { 1098 if(redraw & RDW_FRAME_W) { 1099 mapWin32ToOS2Rect(wnd->getWindowHeight(), (PRECT)pRect, (PRECTLOS2)&rectl); 1100 } 1101 else mapWin32ToOS2RectClientToFrame(wnd, (PRECT)pRect, (PRECTLOS2)&rectl); 1102 } 1103 else mapWin32ToOS2Rect(OSLibQueryScreenHeight(), (PRECT)pRect, (PRECTLOS2)&rectl); 1291 1104 } 1292 1105 … … 1330 1143 //TODO: Does this work if RDW_ALLCHILDREN is set?? 1331 1144 if(redraw & RDW_UPDATENOW_W) { 1332 wnd->MsgPaint (0, FALSE); 1145 wnd->MsgNCPaint(); 1146 wnd->MsgPaint(0, FALSE); 1333 1147 } 1334 1148 else … … 1339 1153 else if((redraw & RDW_INTERNALPAINT_W) && !(redraw & RDW_INVALIDATE_W)) 1340 1154 { 1341 if(redraw & RDW_UPDATENOW_W) 1155 if(redraw & RDW_UPDATENOW_W) { 1156 wnd->MsgNCPaint(); 1342 1157 wnd->MsgPaint (0, FALSE); 1158 } 1343 1159 else PostMessageA(hwnd, WINWM_PAINT, 0, 0); 1344 1160 } … … 1466 1282 //****************************************************************************** 1467 1283 //TODO: Check if this one works correctly... 1284 //Have to check if dc is for frame or client!! 1468 1285 //****************************************************************************** 1469 1286 BOOL WIN32API ScrollDC(HDC hDC, int dx, int dy, const RECT *pScroll, … … 1791 1608 //****************************************************************************** 1792 1609 //****************************************************************************** 1793 INT WIN32API ExcludeUpdateRgn( HDC hDC, HWND hWnd)1794 {1795 dprintf(("USER32: ExcludeUpdateRgn\n"));1796 hWnd = Win32BaseWindow::Win32ToOS2Handle(hWnd);1797 1798 return O32_ExcludeUpdateRgn(hDC,hWnd);1799 }1800 //******************************************************************************1801 //******************************************************************************1802 1610 BOOL WIN32API ValidateRect( HWND hwnd, const RECT * lprc) 1803 1611 { … … 1816 1624 return RedrawWindow( hwnd, NULL, hrgn, RDW_VALIDATE_W | RDW_NOCHILDREN_W | (hwnd==0 ? RDW_UPDATENOW_W : 0)); 1817 1625 } 1818 /***************************************************************************** 1819 * Name : int WIN32API GetWindowRgn 1820 * Purpose : The GetWindowRgn function obtains a copy of the window region of a window. 1821 * Parameters: HWND hWnd handle to window whose window region is to be obtained 1822 * HRGN hRgn handle to region that receives a copy of the window region 1823 * Variables : 1824 * Result : NULLREGION, SIMPLEREGION, COMPLEXREGION, ERROR 1825 * Remark : 1826 * Status : UNTESTED STUB 1827 * 1828 * Author : Patrick Haller [Thu, 1998/02/26 11:55] 1829 *****************************************************************************/ 1830 1831 int WIN32API GetWindowRgn(HWND hwnd, HRGN hRgn) 1832 { 1833 Win32BaseWindow *window; 1834 HRGN hWindowRegion; 1835 1836 window = Win32BaseWindow::GetWindowFromHandle(hwnd); 1837 if(!window) { 1838 dprintf(("SetWindowContextHelpId, window %x not found", hwnd)); 1839 SetLastError(ERROR_INVALID_WINDOW_HANDLE_W); 1840 return 0; 1841 } 1842 dprintf(("USER32:GetWindowRgn (%x,%x)", hwnd, hRgn)); 1843 hWindowRegion = window->GetWindowRegion(); 1844 1845 return O32_CombineRgn(hRgn, hWindowRegion, 0, RGN_COPY_W); 1846 } 1847 /***************************************************************************** 1848 * Name : int WIN32API SetWindowRgn 1849 * Purpose : The SetWindowRgn function sets the window region of a window. The 1850 * window region determines the area within the window where the 1851 * operating system permits drawing. The operating system does not 1852 * display any portion of a window that lies outside of the window region 1853 * When this function is called, the system sends the WM_WINDOWPOSCHANGING and 1854 * WM_WINDOWPOSCHANGED messages to the window. 1855 * 1856 * Parameters: HWND hWnd handle to window whose window region is to be set 1857 * HRGN hRgn handle to region 1858 * BOOL bRedraw window redraw flag 1859 * Variables : 1860 * Result : If the function succeeds, the return value is non-zero. 1861 * If the function fails, the return value is zero. 1862 * Remark : 1863 * Status : UNTESTED STUB 1864 * 1865 * Author : Patrick Haller [Thu, 1998/02/26 11:55] 1866 *****************************************************************************/ 1867 1868 int WIN32API SetWindowRgn(HWND hwnd, 1869 HRGN hRgn, 1870 BOOL bRedraw) 1871 { 1872 Win32BaseWindow *window; 1873 HRGN hWindowRegion; 1874 1875 window = Win32BaseWindow::GetWindowFromHandle(hwnd); 1876 if(!window) { 1877 dprintf(("SetWindowContextHelpId, window %x not found", hwnd)); 1878 SetLastError(ERROR_INVALID_WINDOW_HANDLE_W); 1879 return 0; 1880 } 1881 dprintf(("USER32:SetWindowRgn (%x,%x,%d)", hwnd, hRgn, bRedraw)); 1882 if(window->GetWindowRegion()) { 1883 O32_DeleteObject(window->GetWindowRegion()); 1884 } 1885 window->SetWindowRegion(hRgn); 1886 if(bRedraw) { 1887 RedrawWindow(hwnd, 0, 0, RDW_UPDATENOW_W); 1888 } 1889 //TODO: 1890 // When this function is called, the system sends the WM_WINDOWPOSCHANGING and 1891 // WM_WINDOWPOSCHANGED messages to the window. 1892 return 1; 1893 } 1894 //****************************************************************************** 1895 //****************************************************************************** 1626 //****************************************************************************** 1627 //****************************************************************************** -
trunk/src/user32/dc.h
r3662 r3679 1 /* $Id: dc.h,v 1.1 3 2000-06-07 14:51:25sandervl Exp $ */1 /* $Id: dc.h,v 1.14 2000-06-08 18:10:09 sandervl Exp $ */ 2 2 /* 3 3 * public dc functions … … 463 463 } 464 464 465 int APIENTRY _O32_ExcludeClipRect(HDC a, int b, int c, int d, int e); 466 467 inline int O32_ExcludeClipRect(HDC a, int b, int c, int d, int e) 468 { 469 int yyrc; 470 USHORT sel = RestoreOS2FS(); 471 472 yyrc = _O32_ExcludeClipRect(a, b, c, d, e); 473 SetFS(sel); 474 475 return yyrc; 476 } 477 478 int APIENTRY _O32_IntersectClipRect(HDC a, int b, int c, int d, int e); 479 480 inline int O32_IntersectClipRect(HDC a, int b, int c, int d, int e) 481 { 482 int yyrc; 483 USHORT sel = RestoreOS2FS(); 484 485 yyrc = _O32_IntersectClipRect(a, b, c, d, e); 486 SetFS(sel); 487 488 return yyrc; 489 } 490 491 int APIENTRY _O32_ExtSelectClipRgn(HDC a, HRGN b, int c); 492 493 inline int O32_ExtSelectClipRgn(HDC a, HRGN b, int c) 494 { 495 int yyrc; 496 USHORT sel = RestoreOS2FS(); 497 498 yyrc = _O32_ExtSelectClipRgn(a, b, c); 499 SetFS(sel); 500 501 return yyrc; 502 } 503 504 int APIENTRY _O32_OffsetClipRgn(HDC a, int b, int c); 505 506 inline int O32_OffsetClipRgn(HDC a, int b, int c) 507 { 508 int yyrc; 509 USHORT sel = RestoreOS2FS(); 510 511 yyrc = _O32_OffsetClipRgn(a, b, c); 512 SetFS(sel); 513 514 return yyrc; 515 } 516 465 517 // from pmddi.h: 466 518 /* CopyClipRegion */ -
trunk/src/user32/oslibgdi.cpp
r3662 r3679 1 /* $Id: oslibgdi.cpp,v 1.1 2 2000-06-07 14:51:26sandervl Exp $ */1 /* $Id: oslibgdi.cpp,v 1.13 2000-06-08 18:10:10 sandervl Exp $ */ 2 2 /* 3 3 * Window GDI wrapper functions for OS/2 … … 121 121 } 122 122 //****************************************************************************** 123 //Win32 rectangle in client coordinates (relative to upper left corner of client window) 124 //Convert to frame coordinates (relative to lower left corner of window) 123 125 //****************************************************************************** 124 126 BOOL mapWin32ToOS2RectClientToFrame(Win32BaseWindow *window, PRECT rectWin32,PRECTLOS2 rectOS2) … … 138 140 rectOS2->yBottom = height - (rectWin32->bottom + yclientorg); 139 141 rectOS2->yTop = height - (rectWin32->top + yclientorg); 140 rectOS2->xLeft = rectWin32->left - xclientorg; 141 rectOS2->xRight = rectWin32->right - xclientorg; 142 rectOS2->xLeft = rectWin32->left + xclientorg; 143 rectOS2->xRight = rectWin32->right + xclientorg; 144 145 return TRUE; 146 } 147 //****************************************************************************** 148 //OS/2 rectangle in frame coordinates (relative to lower left corner of window) 149 //Convert to client coordinates (relative to upper left corner of client window) 150 //Note: win32 rectangle can be bigger than client area! 151 //****************************************************************************** 152 BOOL mapOS2ToWin32RectFrameToClient(Win32BaseWindow *window, PRECTLOS2 rectOS2, 153 PRECT rectWin32) 154 { 155 int height; 156 int xclientorg; 157 int yclientorg; 158 159 if(!window || !rectOS2 || !rectWin32) { 160 DebugInt3(); 161 return FALSE; 162 } 163 height = window->getWindowHeight(); 164 xclientorg = window->getClientRectPtr()->left; 165 yclientorg = window->getClientRectPtr()->top; 166 167 rectWin32->bottom = height - (rectOS2->yBottom + yclientorg); 168 rectWin32->top = height - (rectOS2->yTop + yclientorg); 169 rectWin32->left = rectOS2->xLeft - xclientorg; 170 rectWin32->right = rectOS2->xRight - xclientorg; 142 171 143 172 return TRUE; -
trunk/src/user32/oslibgdi.h
r3662 r3679 1 /* $Id: oslibgdi.h,v 1. 6 2000-06-07 14:51:26sandervl Exp $ */1 /* $Id: oslibgdi.h,v 1.7 2000-06-08 18:10:10 sandervl Exp $ */ 2 2 /* 3 3 * Window GDI wrapper functions for OS/2 … … 81 81 82 82 BOOL mapWin32ToOS2RectClientToFrame(Win32BaseWindow *window, PRECT rectWin32,PRECTLOS2 rectOS2); 83 BOOL mapOS2ToWin32RectFrameToClient(Win32BaseWindow *window, PRECTLOS2 rectOS2, PRECT rectWin32); 83 84 84 85 #define mapWin32ToOS2RectFrame(window, rectWin32, rectOS2) \ -
trunk/src/user32/pmwindow.cpp
r3662 r3679 1 /* $Id: pmwindow.cpp,v 1.9 2 2000-06-07 14:51:27sandervl Exp $ */1 /* $Id: pmwindow.cpp,v 1.93 2000-06-08 18:10:10 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 255 255 256 256 dprintf(("OS2: WM_ADJUSTWINDOWPOS %x %x %x (%d,%d) (%d,%d)", win32wnd->getWindowHandle(), pswp->hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy)); 257 257 258 if(pswp->fl & SWP_NOADJUST) { 259 //ignore weird messages (TODO: why are they sent?) 260 break; 261 } 258 262 //CB: show dialog in front of owner 259 263 if (win32wnd->IsModalDialogOwner()) -
trunk/src/user32/win32wbase.cpp
r3663 r3679 1 /* $Id: win32wbase.cpp,v 1. 199 2000-06-07 21:45:50sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.200 2000-06-08 18:10:11 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 716 716 } 717 717 718 if (cs->style & WS_VISIBLE) ShowWindow(sw); 718 if(cs->style & WS_VISIBLE) { 719 dwStyle &= ~WS_VISIBLE; 720 ShowWindow(sw); 721 } 719 722 720 723 /* Call WH_SHELL hook */ … … 2238 2241 MsgFormatFrame(NULL); 2239 2242 UnionRect(&oldClientRect, &oldClientRect, &rectClient); 2243 OffsetRect(&oldClientRect, -rectClient.left, -rectClient.top); 2240 2244 InvalidateRect(getWindowHandle(), &oldClientRect, TRUE); 2241 2245 //TODO: move child windows!! … … 2284 2288 { 2285 2289 UnionRect(&oldClientRect, &oldClientRect, &rectClient); 2290 OffsetRect(&oldClientRect, -rectClient.left, -rectClient.top); 2286 2291 InvalidateRect(getWindowHandle(), &oldClientRect, TRUE); 2287 2292 //TODO: move child windows!! … … 2498 2503 HWND Win32BaseWindow::GetTopWindow() 2499 2504 { 2500 return GetWindow(GW_CHILD); 2505 HWND hwndTop; 2506 Win32BaseWindow *topwindow; 2507 2508 hwndTop = OSLibWinQueryWindow(getOS2WindowHandle(), QWOS_TOP); 2509 if(!isDesktopWindow()) { 2510 topwindow = GetWindowFromOS2Handle(hwndTop); 2511 if(topwindow) { 2512 return topwindow->getWindowHandle(); 2513 } 2514 return 0; 2515 } 2516 while(hwndTop) { 2517 topwindow = GetWindowFromOS2Handle(hwndTop); 2518 if(topwindow) { 2519 return topwindow->getWindowHandle(); 2520 } 2521 hwndTop = OSLibWinQueryWindow(hwndTop, QWOS_NEXT); 2522 } 2523 2524 return 0; 2501 2525 } 2502 2526 //****************************************************************************** -
trunk/src/user32/window.cpp
r3663 r3679 1 /* $Id: window.cpp,v 1. 69 2000-06-07 21:45:52 sandervl Exp $ */1 /* $Id: window.cpp,v 1.70 2000-06-08 18:10:12 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window apis for OS/2 … … 400 400 Win32BaseWindow *window; 401 401 402 window = Win32BaseWindow::GetWindowFromHandle(hwnd); 403 if(!window) { 404 dprintf(("GetTopWindow, window %x not found", hwnd)); 405 SetLastError(ERROR_INVALID_WINDOW_HANDLE); 406 return 0; 402 if(hwnd == HWND_DESKTOP) { 403 window = windowDesktop; 404 } 405 else { 406 window = Win32BaseWindow::GetWindowFromHandle(hwnd); 407 if(!window) { 408 dprintf(("GetTopWindow, window %x not found", hwnd)); 409 SetLastError(ERROR_INVALID_WINDOW_HANDLE); 410 return 0; 411 } 407 412 } 408 413 return window->GetTopWindow();
Note:
See TracChangeset
for help on using the changeset viewer.