- Timestamp:
- Jul 22, 2000, 2:51:59 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/dc.cpp
r3864 r3888 1 /* $Id: dc.cpp,v 1.6 8 2000-07-19 19:05:24sandervl Exp $ */1 /* $Id: dc.cpp,v 1.69 2000-07-22 12:51:59 sandervl Exp $ */ 2 2 3 3 /* … … 329 329 //****************************************************************************** 330 330 //****************************************************************************** 331 HRGN selectClientArea(Win32BaseWindow *window, pDCData pHps, PRECTL prclPaint)331 void selectClientArea(Win32BaseWindow *window, pDCData pHps) 332 332 { 333 333 // This function checks to see if the DC needs to be adjusted to a client … … 345 345 { 346 346 //client rectangle = frame rectangle -> no change necessary 347 //only setup the clip region 348 goto setupclipregion; 347 return; 349 348 } 350 349 if(pHps->isClientArea) { 351 350 //TODO: counter 352 351 dprintf(("WARNING: selectClientArea; already selected!!")); 353 goto setupclipregion;352 return; 354 353 } 355 354 pHps->isClient = TRUE; … … 412 411 // Destroy the region now we have finished with it. 413 412 GreDestroyRegion(pHps->hps, hrgnRect); 414 415 setupclipregion:416 if(prclPaint) {417 #if 0418 hrgnClip = GpiQueryClipRegion(pHps->hps);419 if(hrgnClip) {420 rc = GreIntersectClipRectangle(pHps->hps, prclPaint);421 if(rc == RGN_ERROR) {422 dprintf(("selectClientArea: GreIntersectClipRectangle returned RGN_ERROR!"));423 }424 }425 else {426 #endif427 hrgnClip = GreCreateRectRegion(pHps->hps, prclPaint, 1);428 GreSelectClipRegion(pHps->hps, hrgnClip, &hrgnOldClip);429 // }430 }431 432 return hrgnOldClip;433 413 } 434 414 //****************************************************************************** … … 572 552 HPS hPS_ownDC = NULLHANDLE, hpsPaint = 0; 573 553 RECTL rectl = {0, 0, 1, 1}; 574 HRGN hrgn Update, hrgnOld, hrgnOldClip;554 HRGN hrgnOldClip; 575 555 LONG lComplexity; 576 556 RECTL rectlClient; … … 612 592 } 613 593 594 //testest 595 if(hwnd == 0x6800000f) { 596 lComplexity = 1; 597 } 598 614 599 if(WinQueryUpdateRect(hwndClient, &rectl) == FALSE) { 615 600 memset(&rectl, 0, sizeof(rectl)); 616 601 dprintf (("USER32: WARNING: WinQueryUpdateRect failed (error or no update rectangle)!!")); 617 602 618 // mapWin32ToOS2Rect(wnd->getWindowHeight(), wnd->getClientRectPtr(), (PRECTLOS2)&rectlClient); 619 // WinOffsetRect(NULL, &rectlClient, -rectlClient.xLeft, -rectlClient.yBottom); 620 621 hrgnOldClip = selectClientArea(wnd, pHps, &rectl); 603 selectClientArea(wnd, pHps); 604 605 HRGN hrgnClip = GpiCreateRegion(pHps->hps, 1, &rectl); 606 GpiSetClipRegion(pHps->hps, hrgnClip, &hrgnOldClip); 607 622 608 //save old clip region (restored for CS_OWNDC windows in EndPaint) 623 609 wnd->SetClipRegion(hrgnOldClip); … … 625 611 } 626 612 else { 627 WinValidateRect(hwndClient, &rectl, FALSE); 613 rectlClip.yBottom = rectlClip.xLeft = 0; 614 rectlClip.yTop = rectlClip.xRight = 1; 615 616 //Query update region 617 HRGN hrgnClip = GpiCreateRegion(pHps->hps, 1, &rectlClip); 618 WinQueryUpdateRegion(hwndClient, hrgnClip); 619 WinValidateRegion(hwndClient, hrgnClip, FALSE); 628 620 629 621 mapWin32ToOS2Rect(wnd->getWindowHeight(), wnd->getClientRectPtr(), (PRECTLOS2)&rectlClient); 630 622 WinIntersectRect(NULL, &rectlClip, &rectl, &rectlClient); 631 623 WinOffsetRect(NULL, &rectlClip, -rectlClient.xLeft, -rectlClient.yBottom); 632 633 hrgnOldClip = selectClientArea(wnd, pHps, &rectlClip); 624 625 //change presentation space for client window 626 selectClientArea(wnd, pHps); 627 628 //clip update region with client window rectangle 629 HRGN hrgnClient = GpiCreateRegion(pHps->hps, 1, &rectlClient); 630 GpiCombineRegion(pHps->hps, hrgnClip, hrgnClip, hrgnClient, CRGN_AND); 631 GpiDestroyRegion(pHps->hps, hrgnClient); 632 633 //change origin of clip region (window -> client) 634 POINTL point = {-rectlClient.xLeft, -rectlClient.yBottom}; 635 GpiOffsetRegion(pHps->hps, hrgnClip, &point); 636 637 //set clip region 638 GpiSetClipRegion(pHps->hps, hrgnClip, &hrgnOldClip); 634 639 635 640 //save old clip region (restored for CS_OWNDC windows in EndPaint) … … 808 813 goto error; 809 814 810 selectClientArea(wnd, pHps , NULL);815 selectClientArea(wnd, pHps); 811 816 812 817 //TODO: Is this always necessary?? … … 876 881 if(!(flags & DCX_WINDOW_W)) 877 882 { 878 selectClientArea(wnd, pHps , NULL);883 selectClientArea(wnd, pHps); 879 884 } 880 885 else removeClientArea(pHps); … … 1173 1178 if(redraw & RDW_ERASENOW_W && wnd->needsEraseBkgnd()) 1174 1179 wnd->setEraseBkgnd(sendEraseBkgnd(wnd) == 0); 1175 if(redraw & RDW_ALLCHILDREN_W) {1176 EnumChildWindows(wnd->getWindowHandle(), RedrawChildEnumProc, redraw);1177 }1180 // if(redraw & RDW_ALLCHILDREN_W) { 1181 // EnumChildWindows(wnd->getWindowHandle(), RedrawChildEnumProc, redraw); 1182 // } 1178 1183 } 1179 1184 else if((redraw & RDW_INTERNALPAINT_W) && !(redraw & RDW_INVALIDATE_W))
Note:
See TracChangeset
for help on using the changeset viewer.