Changeset 16248
- Timestamp:
- May 11, 2001, 3:31:54 PM (24 years ago)
- Location:
- tags/trunk/src/user32
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified tags/trunk/src/user32/dc.cpp ¶
r16246 r16248 1 /* $Id: dc.cpp,v 1. 99 2001-05-11 08:39:41sandervl Exp $ */1 /* $Id: dc.cpp,v 1.100 2001-05-11 13:31:54 sandervl Exp $ */ 2 2 3 3 /* … … 1336 1336 dprintf (("User32: UpdateWindow hwnd %x: update rectangle (%d,%d)(%d,%d)", hwnd, rectUpdate.left, rectUpdate.top, rectUpdate.right, rectUpdate.bottom)); 1337 1337 } 1338 else dprintf (("User32: UpdateWindow hwnd %x; EMPTY update rectangle (vis=%d/%d )", hwnd, WinIsWindowVisible(wnd->getOS2FrameWindowHandle()), WinIsWindowVisible(wnd->getOS2WindowHandle())));1338 else dprintf (("User32: UpdateWindow hwnd %x; EMPTY update rectangle (vis=%d/%d, show=%d/%d)", hwnd, WinIsWindowVisible(wnd->getOS2FrameWindowHandle()), WinIsWindowVisible(wnd->getOS2WindowHandle()), WinIsWindowShowing(wnd->getOS2FrameWindowHandle()), WinIsWindowShowing(wnd->getOS2WindowHandle()))); 1339 1339 #endif 1340 1340 //SvL: This doesn't work right (Wine uses RDW_NOCHILDREN_W -> doesn't work here) … … 1426 1426 //TODO: Change for client rectangle!!!!! 1427 1427 //****************************************************************************** 1428 BOOL setPMRgnIntoWinRgn (H RGN hrgnPM, HRGN hrgnWin, LONG height)1428 BOOL setPMRgnIntoWinRgn (HPS hps, HRGN hrgnPM, HRGN hrgnWin, LONG height) 1429 1429 { 1430 1430 BOOL rc; 1431 HPS hps = WinGetScreenPS (HWND_DESKTOP);1432 1431 RGNRECT rgnRect; 1433 1432 rgnRect.ircStart = 1; 1434 1433 rgnRect.crc = 0; 1435 rgnRect.ulDirection = RECTDIR_LFRT_TOPBOT; // doesn't make a difference because we're getting them all1434 rgnRect.ulDirection = RECTDIR_LFRT_TOPBOT; 1436 1435 1437 1436 rc = GpiQueryRegionRects (hps, hrgnPM, NULL, &rgnRect, NULL); … … 1447 1446 rc = GpiQueryRegionRects (hps, hrgnPM, NULL, &rgnRect, Rcls); 1448 1447 1449 rc = SetRectRgn(hrgnWin, pRcl->xLeft, 1450 pRcl->xRight, 1451 height - pRcl->yTop, 1452 height - pRcl->yBottom); 1448 rc = SetRectRgn(hrgnWin, pRcl->xLeft, height - pRcl->yTop, 1449 pRcl->xRight, height - pRcl->yBottom); 1453 1450 1454 1451 if (rgnRect.crcReturned > 1) … … 1460 1457 for (i = 1, pRcl++; rc && (i < rgnRect.crcReturned); i++, pRcl++) 1461 1458 { 1462 rc = SetRectRgn (temp, pRcl->xLeft, 1463 pRcl->xRight, 1464 height - pRcl->yTop, 1465 height - pRcl->yBottom); 1459 rc = SetRectRgn (temp, pRcl->xLeft, height - pRcl->yTop, 1460 pRcl->xRight, height - pRcl->yBottom); 1466 1461 rc &= CombineRgn (hrgnWin, hrgnWin, temp, RGN_OR_W); 1467 1462 } … … 1480 1475 } 1481 1476 1482 WinReleasePS (hps);1483 1477 return (rc); 1484 1478 } … … 1490 1484 const RECT *pClip, HRGN hrgnUpdate, LPRECT pRectUpdate) 1491 1485 { 1492 BOOL rc = TRUE; 1493 1494 dprintf (("USER32: ScrollDC %x (%d,%d), %x %x %x %x", hDC, dx, dy, pScroll, pClip, hrgnUpdate, pRectUpdate)); 1495 1496 if (!hDC) 1497 { 1498 return (FALSE); 1499 } 1500 1501 pDCData pHps = (pDCData)GpiQueryDCData ((HPS)hDC); 1502 HWND hwnd = pHps->hwnd; 1503 Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle (hwnd); 1504 1505 if((hwnd == NULLHANDLE) || !wnd) 1506 { 1507 return (FALSE); 1508 } 1509 1510 POINTL ptl[2] = { 0, 0, dx, dy }; 1511 1512 GpiConvert (pHps->hps, CVTC_WORLD, CVTC_DEVICE, 2, ptl); 1513 dx = (int)(ptl[1].x - ptl[0].x); 1514 dy = (int)(ptl[1].y - ptl[0].y); 1515 1516 RECT scrollRect; 1517 RECT clipRect; 1518 1519 if (pClip) 1520 { 1521 memcpy(&clipRect, pClip, sizeof(clipRect)); 1522 1523 if ((pHps->graphicsMode == GM_COMPATIBLE_W) && 1524 (clipRect.left != clipRect.right) && 1525 (clipRect.bottom != clipRect.top)) 1526 { 1527 if (abs((int)pHps->viewportXExt) <= abs((int)pHps->windowExt.cx)) 1528 clipRect.right -= abs(pHps->worldXDeltaFor1Pixel); 1529 else 1530 clipRect.left += abs(pHps->worldXDeltaFor1Pixel); 1531 1532 if (abs((int)pHps->viewportYExt) <= abs((int)pHps->windowExt.cy)) 1533 clipRect.bottom -= abs(pHps->worldYDeltaFor1Pixel); 1534 else 1535 clipRect.top += abs(pHps->worldYDeltaFor1Pixel); 1536 } 1537 GpiConvert(pHps->hps, CVTC_WORLD, CVTC_DEVICE, 2, (PPOINTL)&clipRect); 1538 if (clipRect.right < clipRect.left) { 1539 ULONG temp = clipRect.left; 1540 clipRect.left = clipRect.right; 1541 clipRect.right = temp; 1542 } 1543 if (clipRect.bottom < clipRect.top) { 1544 ULONG temp = clipRect.top; 1545 clipRect.top = clipRect.bottom; 1546 clipRect.bottom = temp; 1547 } 1548 } 1549 1550 if (pScroll) 1551 { 1552 memcpy(&scrollRect, pScroll, sizeof(scrollRect)); 1553 1554 if ((pHps->graphicsMode == GM_COMPATIBLE_W) && 1555 (scrollRect.left != scrollRect.right) && 1556 (scrollRect.top != scrollRect.bottom)) 1557 { 1558 if (abs((int)pHps->viewportXExt) <= abs((int)pHps->windowExt.cx)) 1559 scrollRect.right -= abs(pHps->worldXDeltaFor1Pixel); 1560 else 1561 scrollRect.left += abs(pHps->worldXDeltaFor1Pixel); 1562 1563 if (abs((int)pHps->viewportYExt) <= abs((int)pHps->windowExt.cy)) 1564 scrollRect.bottom -= abs(pHps->worldYDeltaFor1Pixel); 1565 else 1566 scrollRect.top += abs(pHps->worldYDeltaFor1Pixel); 1567 } 1568 GpiConvert (pHps->hps, CVTC_WORLD, CVTC_DEVICE, 2, (PPOINTL)&scrollRect); 1569 if (scrollRect.right < scrollRect.left) { 1570 ULONG temp = scrollRect.left; 1571 scrollRect.left = scrollRect.right; 1572 scrollRect.right = temp; 1573 } 1574 if (scrollRect.bottom < scrollRect.top) { 1575 ULONG temp = scrollRect.top; 1576 scrollRect.top = scrollRect.bottom; 1577 scrollRect.bottom = temp; 1578 } 1579 } 1580 RECTL rectlUpdate; 1581 HRGN hrgn; 1582 RECTL clipOS2; 1583 RECTL scrollOS2; 1584 PRECTL pScrollOS2 = NULL; 1585 PRECTL pClipOS2 = NULL; 1586 1587 if(pScroll) { 1486 Win32BaseWindow *wnd; 1487 BOOL rc = TRUE; 1488 1489 dprintf (("USER32: ScrollDC %x (%d,%d), %x %x %x %x", hDC, dx, dy, pScroll, pClip, hrgnUpdate, pRectUpdate)); 1490 1491 if (!hDC) 1492 { 1493 return (FALSE); 1494 } 1495 1496 pDCData pHps = (pDCData)GpiQueryDCData ((HPS)hDC); 1497 HWND hwnd = pHps->hwnd; 1498 if(pHps->isClient) { 1499 wnd = Win32BaseWindow::GetWindowFromOS2Handle (hwnd); 1500 } 1501 else { 1502 //assume (for now) that this is not allowed (TODO) 1503 dprintf(("ScrollDC used for frame HDC!!")); 1504 DebugInt3(); 1505 return FALSE; 1506 } 1507 1508 if((hwnd == NULLHANDLE) || !wnd) 1509 { 1510 return (FALSE); 1511 } 1512 1513 POINTL ptl[2] = { 0, 0, dx, dy }; 1514 1515 GpiConvert (pHps->hps, CVTC_WORLD, CVTC_DEVICE, 2, ptl); 1516 dx = (int)(ptl[1].x - ptl[0].x); 1517 dy = (int)(ptl[1].y - ptl[0].y); 1518 1519 RECT scrollRect; 1520 RECT clipRect; 1521 1522 if (pClip) 1523 { 1524 memcpy(&clipRect, pClip, sizeof(clipRect)); 1525 1526 if ((pHps->graphicsMode == GM_COMPATIBLE_W) && 1527 (clipRect.left != clipRect.right) && 1528 (clipRect.bottom != clipRect.top)) 1529 { 1530 if (abs((int)pHps->viewportXExt) <= abs((int)pHps->windowExt.cx)) 1531 clipRect.right -= abs(pHps->worldXDeltaFor1Pixel); 1532 else 1533 clipRect.left += abs(pHps->worldXDeltaFor1Pixel); 1534 1535 if (abs((int)pHps->viewportYExt) <= abs((int)pHps->windowExt.cy)) 1536 clipRect.bottom -= abs(pHps->worldYDeltaFor1Pixel); 1537 else 1538 clipRect.top += abs(pHps->worldYDeltaFor1Pixel); 1539 } 1540 GpiConvert(pHps->hps, CVTC_WORLD, CVTC_DEVICE, 2, (PPOINTL)&clipRect); 1541 if (clipRect.right < clipRect.left) { 1542 ULONG temp = clipRect.left; 1543 clipRect.left = clipRect.right; 1544 clipRect.right = temp; 1545 } 1546 if (clipRect.bottom < clipRect.top) { 1547 ULONG temp = clipRect.top; 1548 clipRect.top = clipRect.bottom; 1549 clipRect.bottom = temp; 1550 } 1551 } 1552 1553 if (pScroll) 1554 { 1555 memcpy(&scrollRect, pScroll, sizeof(scrollRect)); 1556 1557 if ((pHps->graphicsMode == GM_COMPATIBLE_W) && 1558 (scrollRect.left != scrollRect.right) && 1559 (scrollRect.top != scrollRect.bottom)) 1560 { 1561 if (abs((int)pHps->viewportXExt) <= abs((int)pHps->windowExt.cx)) 1562 scrollRect.right -= abs(pHps->worldXDeltaFor1Pixel); 1563 else 1564 scrollRect.left += abs(pHps->worldXDeltaFor1Pixel); 1565 1566 if (abs((int)pHps->viewportYExt) <= abs((int)pHps->windowExt.cy)) 1567 scrollRect.bottom -= abs(pHps->worldYDeltaFor1Pixel); 1568 else 1569 scrollRect.top += abs(pHps->worldYDeltaFor1Pixel); 1570 } 1571 GpiConvert (pHps->hps, CVTC_WORLD, CVTC_DEVICE, 2, (PPOINTL)&scrollRect); 1572 if (scrollRect.right < scrollRect.left) { 1573 ULONG temp = scrollRect.left; 1574 scrollRect.left = scrollRect.right; 1575 scrollRect.right = temp; 1576 } 1577 if (scrollRect.bottom < scrollRect.top) { 1578 ULONG temp = scrollRect.top; 1579 scrollRect.top = scrollRect.bottom; 1580 scrollRect.bottom = temp; 1581 } 1582 } 1583 RECTL rectlUpdate; 1584 HRGN hrgn = NULLHANDLE; 1585 RECTL clipOS2; 1586 RECTL scrollOS2; 1587 PRECTL pScrollOS2 = NULL; 1588 PRECTL pClipOS2 = NULL; 1589 HPS hpsScreen = 0; 1590 1591 if(pScroll) { 1588 1592 mapWin32ToOS2Rect(wnd->getClientHeight(), &scrollRect, (PRECTLOS2)&scrollOS2); 1589 1593 pScrollOS2 = &scrollOS2; 1590 }1591 1592 if(pClip) {1594 } 1595 1596 if(pClip) { 1593 1597 mapWin32ToOS2Rect(wnd->getClientHeight(), &clipRect, (PRECTLOS2)&clipOS2); 1594 1598 pClipOS2 = &clipOS2; 1595 } 1596 1597 LONG lComplexity = WinScrollWindow(hwnd, dx, dy, pScrollOS2, 1598 pClipOS2, hrgn, &rectlUpdate, 0); 1599 if (lComplexity == RGN_ERROR) 1600 { 1601 return (FALSE); 1602 } 1603 1604 RECT winRectUpdate; 1605 1606 mapOS2ToWin32Rect(wnd->getClientHeight(), (PRECTLOS2)&rectlUpdate, &winRectUpdate); 1607 1608 if (pRectUpdate) 1609 *pRectUpdate = winRectUpdate; 1610 1611 if (hrgnUpdate) 1612 rc = setPMRgnIntoWinRgn(hrgn, hrgnUpdate, wnd->getClientHeight()); 1613 1614 return (rc); 1599 } 1600 1601 if(hrgnUpdate) { 1602 RECTL rectl = { 1, 1, 2, 2 }; 1603 1604 hpsScreen = WinGetScreenPS (HWND_DESKTOP); 1605 hrgn = GpiCreateRegion(hpsScreen, 1, &rectl); 1606 } 1607 1608 LONG lComplexity = WinScrollWindow(hwnd, dx, dy, pScrollOS2, 1609 pClipOS2, hrgn, &rectlUpdate, 0); 1610 if (lComplexity == RGN_ERROR) 1611 { 1612 return (FALSE); 1613 } 1614 1615 RECT winRectUpdate; 1616 1617 mapOS2ToWin32Rect(wnd->getClientHeight(), (PRECTLOS2)&rectlUpdate, &winRectUpdate); 1618 1619 if (pRectUpdate) 1620 *pRectUpdate = winRectUpdate; 1621 1622 if (hrgnUpdate) { 1623 rc = setPMRgnIntoWinRgn(hpsScreen, hrgn, hrgnUpdate, wnd->getClientHeight()); 1624 GpiDestroyRegion(hpsScreen, hrgn); 1625 WinReleasePS(hpsScreen); 1626 } 1627 1628 return (rc); 1615 1629 } 1616 1630 //****************************************************************************** … … 1654 1668 1655 1669 RECTL rectlUpdate; 1656 HRGN hrgn; 1670 HRGN hrgn = NULLHANDLE; 1671 HPS hpsScreen = 0; 1672 1673 if(hrgnUpdate) { 1674 RECTL rectl = { 1, 1, 2, 2 }; 1675 1676 hpsScreen = WinGetScreenPS (HWND_DESKTOP); 1677 hrgn = GpiCreateRegion(hpsScreen, 1, &rectl); 1678 } 1657 1679 1658 1680 if (scrollFlag & SW_SMOOTHSCROLL_W) 1659 1681 { 1660 INT time = (scrollFlag >> 16) & 0xFFFF;1661 1662 //CB: todo, scroll in several steps1663 // is time in ms? time <-> iteration count?1682 INT time = (scrollFlag >> 16) & 0xFFFF; 1683 1684 //CB: todo, scroll in several steps 1685 // is time in ms? time <-> iteration count? 1664 1686 } 1665 1687 … … 1714 1736 *pRectUpdate = winRectUpdate; 1715 1737 1716 if (hrgnUpdate) 1717 rc = setPMRgnIntoWinRgn(hrgn, hrgnUpdate, window->getClientHeight()); 1738 if (hrgnUpdate) { 1739 rc = setPMRgnIntoWinRgn(hpsScreen, hrgn, hrgnUpdate, window->getClientHeight()); 1740 GpiDestroyRegion(hpsScreen, hrgn); 1741 WinReleasePS(hpsScreen); 1742 } 1718 1743 1719 1744 #if 0 -
TabularUnified tags/trunk/src/user32/dcrgn.cpp ¶
r16246 r16248 1 /* $Id: dcrgn.cpp,v 1. 4 2001-05-11 08:39:42sandervl Exp $ */1 /* $Id: dcrgn.cpp,v 1.5 2001-05-11 13:31:54 sandervl Exp $ */ 2 2 3 3 /* … … 67 67 BOOL updateRegionExists = WinQueryUpdateRect(wnd->getOS2WindowHandle(), pRect ? &rectl : NULL); 68 68 if (!pRect) { 69 dprintf(("GetUpdateRect returned %d", updateRegionExists)); 69 70 return (updateRegionExists); 70 71 } … … 95 96 } 96 97 98 dprintf(("GetUpdateRect returned (%d,%d)(%d,%d)", pRect->left, pRect->top, pRect->right, pRect->bottom)); 97 99 return updateRegionExists; 98 100 }
Note:
See TracChangeset
for help on using the changeset viewer.