Changeset 2257 for trunk/src/user32/dc.cpp
- Timestamp:
- Dec 29, 1999, 11:54:04 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/dc.cpp
r2202 r2257 1 /* $Id: dc.cpp,v 1.3 0 1999-12-24 21:44:03 sandervlExp $ */1 /* $Id: dc.cpp,v 1.31 1999-12-29 22:53:59 cbratschi Exp $ */ 2 2 3 3 /* … … 302 302 { 303 303 if (wnd) 304 return (wnd->get WindowHeight());304 return (wnd->getClientHeight()); 305 305 else 306 306 return OSLibQueryScreenHeight(); … … 437 437 438 438 if(hWnd == 0x6800003a) { 439 hwnd = 0x6800003a; 439 hwnd = 0x6800003a; 440 440 } 441 441 Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle(hwnd); … … 443 443 if ((hwnd != HWND_DESKTOP) && wnd->isOwnDC()) 444 444 { 445 446 447 448 449 450 451 452 453 454 445 hPS_ownDC = wnd->getOwnDC(); 446 //SvL: Hack for memory.exe (doesn't get repainted properly otherwise) 447 if(hPS_ownDC) { 448 pHps = (pDCData)GpiQueryDCData(hPS_ownDC); 449 if (!pHps) 450 { 451 O32_SetLastError (ERROR_INVALID_PARAMETER); 452 return (HDC)NULLHANDLE; 453 } 454 } 455 455 } 456 456 … … 473 473 474 474 if(!wnd->isSuppressErase()) { 475 475 wnd->setSuppressErase(TRUE); 476 476 wnd->setEraseBkgnd (FALSE, !wnd->MsgEraseBackGround(lpps->hdc)); 477 477 } … … 480 480 if (!hPS_ownDC) 481 481 { 482 long height = wnd->get WindowHeight();482 long height = wnd->getClientHeight(); 483 483 rect.yTop = height - rect.yTop; 484 484 rect.yBottom = height - rect.yBottom; … … 531 531 BOOL WIN32API GetUpdateRect (HWND hwnd, LPRECT pRect, BOOL erase) 532 532 { 533 if ( hwnd)533 if (!hwnd) 534 534 { 535 535 O32_SetLastError (ERROR_INVALID_HANDLE); … … 540 540 Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle(hwnd); 541 541 542 BOOL updateRegionExists = WinQueryUpdateRect (hwnd, pRect ? &rectl : NULL); 542 if (!wnd) 543 { 544 O32_SetLastError (ERROR_INVALID_HANDLE); 545 return FALSE; 546 } 547 548 BOOL updateRegionExists = WinQueryUpdateRect (wnd->getOS2WindowHandle(), pRect ? &rectl : NULL); 543 549 if (!pRect) { 544 550 return (updateRegionExists); … … 562 568 else 563 569 { 564 long height = wnd->get WindowHeight();570 long height = wnd->getClientHeight(); 565 571 rectl.yTop = height - rectl.yTop; 566 572 rectl.yBottom = height - rectl.yBottom; … … 586 592 LONG Complexity; 587 593 588 Complexity = O32_GetUpdateRgn (hwnd, hrgn, FALSE); 589 if (erase && (Complexity > NULLREGION_W)) { 590 Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle(hwnd); 591 sendEraseBkgnd (wnd); 592 } 594 Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle(hwnd); 595 596 if (!wnd) 597 { 598 O32_SetLastError (ERROR_INVALID_HANDLE); 599 return ERROR_W; 600 } 601 602 Complexity = O32_GetUpdateRgn (wnd->getOS2WindowHandle(), hrgn, FALSE); 603 if (erase && (Complexity > NULLREGION_W)) sendEraseBkgnd (wnd); 593 604 594 605 return Complexity; … … 615 626 if (hwnd) 616 627 { 617 618 619 620 621 622 628 wnd = Win32BaseWindow::GetWindowFromHandle(hwnd); 629 if(wnd == NULL) { 630 dprintf (("ERROR: User32: GetDCEx bad window handle %X!!!!!", hwnd)); 631 O32_SetLastError(ERROR_INVALID_WINDOW_HANDLE_W); 632 return 0; 633 } 623 634 //SvL: Experimental change (doesn't work right) 624 635 #if 0 625 626 627 636 if(wnd->fHasParentDC() && wnd->getParent()) { 637 wnd = wnd->getParent(); 638 } 628 639 #endif 629 630 631 632 640 if (flags & DCX_WINDOW_W) 641 hWindow = wnd->getOS2FrameWindowHandle(); 642 else 643 hWindow = wnd->getOS2WindowHandle(); 633 644 } 634 645 else … … 906 917 PRECTL pr; 907 918 int i; 908 LONG height = wnd ? wnd->get WindowHeight() : OSLibQueryScreenHeight();919 LONG height = wnd ? wnd->getClientHeight() : OSLibQueryScreenHeight(); 909 920 910 921 if (!hrgn) … … 930 941 else if (pRect) 931 942 { 932 LONG height = wnd ? wnd->get WindowHeight() : OSLibQueryScreenHeight();943 LONG height = wnd ? wnd->getClientHeight() : OSLibQueryScreenHeight(); 933 944 934 945 PMRECT_FROM_WINRECT (rectl, *pRect); … … 1197 1208 1198 1209 RECT winRectUpdate; 1199 LONG height = wnd->get WindowHeight();1210 LONG height = wnd->getClientHeight(); 1200 1211 1201 1212 winRectUpdate.left = rectlUpdate.xLeft; … … 1232 1243 } 1233 1244 dprintf(("ScrollWindow %x %d %d %x %x", hwnd, dx, dy, pScroll, pClip)); 1234 MapWin32ToOS2Rectl(window->getOS2WindowHandle(),window->getClientRect(), (PRECTLOS2)&clientRect);1245 mapWin32ToOS2Rect(window,window->getClientRect(), (PRECTLOS2)&clientRect); 1235 1246 //Rectangle could be relative to parent window, so fix this 1236 1247 if(clientRect.yBottom != 0) { … … 1243 1254 } 1244 1255 if(pScroll) { 1245 MapWin32ToOS2Rectl(window->getOS2WindowHandle(),(RECT *)pScroll, (PRECTLOS2)&scrollRect);1256 mapWin32ToOS2Rect(window,(RECT *)pScroll, (PRECTLOS2)&scrollRect); 1246 1257 pScrollRect = &scrollRect; 1247 1258 … … 1256 1267 1257 1268 if(pClip) { 1258 MapWin32ToOS2Rectl(window->getOS2WindowHandle(),(RECT *)pClip, (PRECTLOS2)&clipRect);1269 mapWin32ToOS2Rect(window,(RECT *)pClip, (PRECTLOS2)&clipRect); 1259 1270 pClipRect = &clipRect; 1260 1271 … … 1300 1311 if (scrollFlag & SW_SCROLLCHILDREN_W) scrollFlags |= SW_SCROLLCHILDREN; 1301 1312 1302 if(pScroll) MapWin32ToOS2Rectl(window->getOS2WindowHandle(),(RECT *)pScroll, (PRECTLOS2)&scrollRect);1303 if(pClip) MapWin32ToOS2Rectl(window->getOS2WindowHandle(),(RECT *)pClip, (PRECTLOS2)&clipRect);1313 if(pScroll) mapWin32ToOS2Rect(window,(RECT *)pScroll, (PRECTLOS2)&scrollRect); 1314 if(pClip) mapWin32ToOS2Rect(window,(RECT *)pClip, (PRECTLOS2)&clipRect); 1304 1315 1305 1316 RECTL rectlUpdate; … … 1324 1335 1325 1336 RECT winRectUpdate; 1326 LONG height = window->get WindowHeight();1337 LONG height = window->getClientHeight(); 1327 1338 1328 1339 winRectUpdate.left = rectlUpdate.xLeft; … … 1391 1402 { 1392 1403 if(lprc) { 1393 1394 } 1395 else dprintf(("USER32: ValidateRect %x", hwnd)); 1396 1404 dprintf(("USER32: ValidateRect %x (%d,%d)(%d,%d)", hwnd, lprc->left, lprc->top, lprc->right, lprc->bottom)); 1405 } 1406 else dprintf(("USER32: ValidateRect %x", hwnd)); 1407 1397 1408 return RedrawWindow( hwnd, lprc, 0, RDW_VALIDATE_W | RDW_NOCHILDREN_W | (hwnd==0 ? RDW_UPDATENOW_W : 0)); 1398 1409 }
Note:
See TracChangeset
for help on using the changeset viewer.