Changeset 903 for trunk/src/user32/new/dc.cpp
- Timestamp:
- Sep 10, 1999, 9:00:11 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/dc.cpp
r896 r903 1 /* $Id: dc.cpp,v 1. 1 1999-09-09 18:05:45dengert Exp $ */1 /* $Id: dc.cpp,v 1.2 1999-09-10 19:00:10 dengert Exp $ */ 2 2 3 3 /* … … 250 250 void OPEN32API DeleteHDC (HDC hdc); 251 251 BOOL OPEN32API _O32_EndPaint (HWND hwnd, const PAINTSTRUCT_W *lpps); 252 int OPEN32API _O32_GetUpdateRgn (HWND hwnd, HRGN hrgn, BOOL erase); 252 253 253 254 #define FLOAT_TO_FIXED(x) ((FIXED) ((x) * 65536.0)) … … 728 729 return TRUE; 729 730 } 731 732 BOOL WIN32API GetUpdateRect (HWND hwnd, LPRECT pRect, BOOL erase) 733 { 734 if (hwnd) 735 { 736 // SET_ERROR_WIN( ERROR_INVALID_HANDLE_W ); 737 return FALSE; 738 } 739 740 RECTL rectl; 741 USHORT sel = RestoreOS2FS(); 742 Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle(hwnd); 743 744 BOOL updateRegionExists = WinQueryUpdateRect (hwnd, pRect ? &rectl : NULL); 745 if (!pRect) { 746 SetFS(sel); 747 return (updateRegionExists); 748 } 749 750 if (updateRegionExists) 751 { 752 if (wnd->isOwnDC()) 753 { 754 pDCData pHps = NULL; 755 pHps = (pDCData)GpiQueryDCData(wnd->getOwnDC()); 756 if (!pHps) 757 { 758 // SET_ERROR_WIN(ERROR_INVALID_HANDLE_W); 759 SetFS(sel); 760 return FALSE; 761 } 762 GpiConvert (pHps->hps, CVTC_DEVICE, CVTC_WORLD, 2, (PPOINTL)&rectl); 763 } 764 else 765 { 766 long height = wnd->getWindowHeight(); 767 rectl.yTop = height - rectl.yTop; 768 rectl.yBottom = height - rectl.yBottom; 769 } 770 771 if (pRect) 772 WINRECT_FROM_PMRECT (*pRect, rectl); 773 774 if (erase) 775 sendEraseBkgnd (wnd); 776 } 777 else 778 { 779 if (pRect) 780 pRect->left = pRect->top = pRect->right = pRect->bottom = 0; 781 } 782 783 SetFS(sel); 784 return updateRegionExists; 785 } 786 787 int WIN32API GetUpdateRgn (HWND hwnd, HRGN hrgn, BOOL erase) 788 { 789 USHORT sel = RestoreOS2FS(); 790 LONG Complexity; 791 792 Complexity = _O32_GetUpdateRgn (hwnd, hrgn, FALSE); 793 if (erase && (Complexity > NULLREGION_W)) { 794 Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle(hwnd); 795 sendEraseBkgnd (wnd); 796 } 797 798 SetFS(sel); 799 return Complexity; 800 } 801 730 802 //****************************************************************************** 731 803 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.