Changeset 10316 for trunk/src/user32/dcrgn.cpp
- Timestamp:
- Nov 12, 2003, 3:13:26 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/dcrgn.cpp
r9933 r10316 1 /* $Id: dcrgn.cpp,v 1. 8 2003-03-22 20:27:11sandervl Exp $ */1 /* $Id: dcrgn.cpp,v 1.9 2003-11-12 14:10:19 sandervl Exp $ */ 2 2 3 3 /* … … 42 42 #include "dbglocal.h" 43 43 44 #ifdef DEBUG 45 //#define dprintfRegion(a,b,c) if(DbgEnabledLvl2USER32[DBG_LOCALLOG] == 1) dprintfRegion1(a,b,c) 46 //#define dprintfRegion(a,b,c) dprintfRegion1(a,b,c) 47 48 static void dprintfRegion(HWND hWnd, HRGN hrgnClip) 49 { 50 RGNRECT rgnRect = {0, 16, 0, RECTDIR_LFRT_TOPBOT}; 51 RECTL rectRegion[16]; 52 APIRET rc; 53 HDC hdc; 54 55 hdc = GetDCEx(hWnd, NULL, DCX_CACHE_W|DCX_USESTYLE_W); 56 dprintf(("dprintfRegion %x %x", hWnd, hdc)); 57 rc = GpiQueryRegionRects(hdc, hrgnClip, NULL, &rgnRect, &rectRegion[0]); 58 for(int i=0;i<rgnRect.crcReturned;i++) { 59 dprintf(("(%d,%d)(%d,%d)", rectRegion[i].xLeft, rectRegion[i].yBottom, rectRegion[i].xRight, rectRegion[i].yTop)); 60 } 61 ReleaseDC(hWnd, hdc); 62 } 63 #else 64 #define dprintfRegion(b,c) 65 #endif 66 44 67 //****************************************************************************** 45 68 //****************************************************************************** … … 134 157 if(lComplexity != RGN_NULL) 135 158 { 159 dprintfRegion(hwnd, hrgn); 136 160 if(!setWinDeviceRegionFromPMDeviceRegion(hrgn, hrgn, NULL, wnd->getOS2WindowHandle())) 137 161 { … … 142 166 } 143 167 if(erase) sendEraseBkgnd(wnd); 168 } 169 RELEASE_WNDOBJ(wnd); 170 return lComplexity; 171 } 172 //****************************************************************************** 173 //TODO: Seems to return region in window coordinates instead of client coordinates 174 //****************************************************************************** 175 int WIN32API GetUpdateRgnFrame(HWND hwnd, HRGN hrgn) 176 { 177 LONG lComplexity; 178 Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle(hwnd); 179 180 hrgn = ObjWinToOS2Region(hrgn); 181 if(!wnd || !hrgn) 182 { 183 dprintf(("WARNING: GetUpdateRgnFrame %x %x invalid handle", hwnd, hrgn)); 184 SetLastError(ERROR_INVALID_WINDOW_HANDLE_W); 185 if(wnd) RELEASE_WNDOBJ(wnd); 186 return ERROR_W; 187 } 188 lComplexity = WinQueryUpdateRegion(wnd->getOS2FrameWindowHandle(), hrgn); 189 if(lComplexity == RGN_ERROR) { 190 dprintf(("WARNING: GetUpdateRgnFrame %x %x RGN_ERROR", hwnd, hrgn)); 191 SetLastError(ERROR_INVALID_WINDOW_HANDLE_W); 192 RELEASE_WNDOBJ(wnd); 193 return ERROR_W; 194 } 195 196 if(lComplexity != RGN_NULL) 197 { 198 dprintfRegion(hwnd, hrgn); 199 if(!setWinDeviceRegionFromPMDeviceRegion(hrgn, hrgn, NULL, wnd->getOS2FrameWindowHandle())) 200 { 201 dprintf(("WARNING: GetUpdateRgnFrame %x %x; setWinDeviceRegionFromPMDeviceRegion failed!", hwnd, hrgn)); 202 SetLastError(ERROR_INVALID_WINDOW_HANDLE_W); 203 RELEASE_WNDOBJ(wnd); 204 return ERROR_W; 205 } 144 206 } 145 207 RELEASE_WNDOBJ(wnd);
Note:
See TracChangeset
for help on using the changeset viewer.