Changeset 4452 for trunk/src/user32/dc.cpp
- Timestamp:
- Oct 8, 2000, 4:03:49 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/dc.cpp
r4434 r4452 1 /* $Id: dc.cpp,v 1.7 1 2000-10-05 18:37:25sandervl Exp $ */1 /* $Id: dc.cpp,v 1.72 2000-10-08 14:03:48 sandervl Exp $ */ 2 2 3 3 /* … … 72 72 LONG clientHeight(Win32BaseWindow *wnd, HWND hwnd, pDCData pHps); 73 73 74 #ifdef DEBUG 75 #define dprintfRegion(a,b,c) if(DbgEnabledLvl2[DBG_LOCALLOG] == 1) dprintfRegion1(a,b,c) 76 77 void dprintfRegion1(HPS hps, HWND hWnd, HRGN hrgnClip) 78 { 79 RGNRECT rgnRect = {0, 16, 0, RECTDIR_LFRT_TOPBOT}; 80 RECTL rectRegion[16]; 81 APIRET rc; 82 83 dprintf(("dprintfRegion %x %x", hWnd, hps)); 84 rc = GpiQueryRegionRects(hps, hrgnClip, NULL, &rgnRect, &rectRegion[0]); 85 for(int i=0;i<rgnRect.crcReturned;i++) { 86 dprintf(("(%d,%d)(%d,%d)", rectRegion[i].xLeft, rectRegion[i].yBottom, rectRegion[i].xRight, rectRegion[i].yTop)); 87 } 88 } 89 #else 90 #define dprintfRegion(a,b,c) 91 #endif 92 74 93 //****************************************************************************** 75 94 //****************************************************************************** … … 302 321 //****************************************************************************** 303 322 //****************************************************************************** 304 VOID removeClientArea( pDCData pHps)323 VOID removeClientArea(Win32BaseWindow *window, pDCData pHps) 305 324 { 306 325 POINTL point; … … 315 334 if(pHps->isClientArea) 316 335 { 317 dprintf2(("removeClientArea : (%d,%d) -> (%d,%d)", point.x, point.y, pHps->ptlOrigin.x, pHps->ptlOrigin.y));336 dprintf2(("removeClientArea %x: (%d,%d) -> (%d,%d)", window->getWindowHandle(), point.x, point.y, pHps->ptlOrigin.x, pHps->ptlOrigin.y)); 318 337 pHps->isClientArea = FALSE; 319 338 GreSetupDC(pHps->hps, … … 324 343 SETUPDC_ORIGIN | SETUPDC_VISRGN | SETUPDC_RECALCCLIP); 325 344 } 326 else dprintf(("removeClientArea: (%d,%d)", point.x, point.y));345 else dprintf(("removeClientArea: %x (%d,%d)", window->getWindowHandle(), point.x, point.y)); 327 346 328 347 } … … 347 366 return; 348 367 } 349 if(pHps->isClientArea) {350 //TODO: counter351 dprintf(("WARNING: selectClientArea; already selected!!"));352 return;353 }354 368 pHps->isClient = TRUE; 355 369 … … 360 374 //convert to screen coordinates 361 375 GreGetDCOrigin(pHps->hps, (PPOINTL)&rcltemp); 362 rcl.xLeft += rcltemp.xLeft; 363 rcl.xRight += rcltemp.xLeft; 364 rcl.yTop += rcltemp.yBottom; 365 rcl.yBottom += rcltemp.yBottom; 366 376 377 if(pHps->isClientArea) 378 { 379 //TODO: counter 380 dprintf(("WARNING: selectClientArea %x; already selected! origin (%d,%d) original origin (%d,%d)", window->getWindowHandle(), rcltemp.xLeft, rcltemp.yBottom, pHps->ptlOrigin.x, pHps->ptlOrigin.y)); 381 RECT rectWindow; 382 RECTL rectWindowOS2; 383 GetWindowRect(window->getWindowHandle(), &rectWindow); 384 mapWin32ToOS2Rect(OSLibGetScreenHeight(), &rectWindow, (PRECTLOS2)&rectWindowOS2); 385 if(rectWindowOS2.xLeft + rcl.xLeft != rcltemp.xLeft || 386 rectWindowOS2.yBottom + rcl.yBottom != rcltemp.yBottom) 387 { 388 dprintf(("WARNING: origin changed (%d,%d) instead of (%d,%d)!", rcltemp.xLeft, rcltemp.yBottom, rectWindowOS2.xLeft + rcl.xLeft, rectWindowOS2.yBottom + rcl.yBottom)); 389 rcl.xLeft += rectWindowOS2.xLeft; 390 rcl.xRight += rectWindowOS2.xLeft; 391 rcl.yTop += rectWindowOS2.yBottom; 392 rcl.yBottom += rectWindowOS2.yBottom; 393 } 394 else return; 395 } 396 else { 397 rcl.xLeft += rcltemp.xLeft; 398 rcl.xRight += rcltemp.xLeft; 399 rcl.yTop += rcltemp.yBottom; 400 rcl.yBottom += rcltemp.yBottom; 401 } 367 402 pHps->ptlOrigin.x = rcltemp.xLeft; 368 403 pHps->ptlOrigin.y = rcltemp.yBottom; 369 404 370 dprintf2(("selectClientArea : (%d,%d) -> (%d,%d)", rcltemp.xLeft, rcltemp.yBottom, rcl.xLeft, rcl.yBottom));405 dprintf2(("selectClientArea %x: (%d,%d) -> (%d,%d)", window->getWindowHandle(), rcltemp.xLeft, rcltemp.yBottom, rcl.xLeft, rcl.yBottom)); 371 406 372 407 if(pHps->hrgnVis == 0) … … 390 425 SETUPDC_ORIGIN | SETUPDC_VISRGN | SETUPDC_RECALCCLIP); 391 426 392 /*393 GpiQueryRegionBox(pHps->hps, hrgnClip, &rcltemp);394 GpiQueryRegionBox(pHps->hps, hrgnOldClip, &rcltemp);395 396 GpiQueryRegionBox(pHps->hps, hrgnRect, &rcltemp);397 398 GreGetDCOrigin(pHps->hps, (PPOINTL)&rcltemp);399 400 GreCopyClipRegion(pHps->hps, hrgnRect, 0, COPYCRGN_VISRGN);401 GpiQueryRegionBox(pHps->hps, hrgnRect, &rcltemp);402 403 GreCopyClipRegion(pHps->hps, hrgnRect, 0, COPYCRGN_ALLINTERSECT);404 GpiQueryRegionBox(pHps->hps, hrgnRect, &rcltemp);405 406 GreCopyClipRegion(pHps->hps, hrgnRect, 0, COPYCRGN_CLIPRGN);407 GpiQueryRegionBox(pHps->hps, hrgnRect, &rcltemp);408 */409 427 pHps->isClientArea = TRUE; 410 428 … … 531 549 { 532 550 pDCData pHps = (pDCData)GpiQueryDCData ((HPS)hps); 551 552 dprintf2(("releaseOwnDC %x", hps)); 533 553 534 554 if (pHps) { … … 544 564 } 545 565 } 546 //******************************************************************************547 //******************************************************************************548 #ifdef DEBUG549 #define dprintfRegion(a,b,c) if(DbgEnabledLvl2[DBG_LOCALLOG] == 1) dprintfRegion1(a,b,c)550 551 void dprintfRegion1(HPS hps, HWND hWnd, HRGN hrgnClip)552 {553 RGNRECT rgnRect = {0, 16, 0, RECTDIR_LFRT_TOPBOT};554 RECTL rectRegion[16];555 APIRET rc;556 557 dprintf(("dprintfRegion %x %x", hWnd, hps));558 rc = GpiQueryRegionRects(hps, hrgnClip, NULL, &rgnRect, &rectRegion[0]);559 for(int i=0;i<rgnRect.crcReturned;i++) {560 dprintf(("(%d,%d)(%d,%d)", rectRegion[i].xLeft, rectRegion[i].yBottom, rectRegion[i].xRight, rectRegion[i].yTop));561 }562 }563 #else564 #define dprintfRegion(a,b,c)565 #endif566 566 //****************************************************************************** 567 567 //****************************************************************************** … … 751 751 pDCData pHps = (pDCData)GpiQueryDCData((HPS)hdc); 752 752 if(pHps && pHps->psType == MICRO_CACHED) { 753 removeClientArea( pHps);753 removeClientArea(wnd, pHps); 754 754 if(pHps->hrgnVis) { 755 755 GreDestroyRegion(pHps->hps, pHps->hrgnVis); … … 762 762 } 763 763 } 764 else { 765 dprintf2(("ReleaseDC: CS_OWNDC, not released")); 766 } 764 767 } 765 768 … … 898 901 selectClientArea(wnd, pHps); 899 902 } 900 else removeClientArea( pHps);903 else removeClientArea(wnd, pHps); 901 904 902 905 setMapMode(wnd, pHps, MM_TEXT_W);
Note:
See TracChangeset
for help on using the changeset viewer.