diff options
Diffstat (limited to 'vcl/win')
-rw-r--r-- | vcl/win/app/salinfo.cxx | 10 | ||||
-rw-r--r-- | vcl/win/gdi/salfont.cxx | 6 | ||||
-rw-r--r-- | vcl/win/gdi/salnativewidgets-luna.cxx | 60 | ||||
-rw-r--r-- | vcl/win/gdi/winlayout.cxx | 18 | ||||
-rw-r--r-- | vcl/win/window/salframe.cxx | 6 |
5 files changed, 50 insertions, 50 deletions
diff --git a/vcl/win/app/salinfo.cxx b/vcl/win/app/salinfo.cxx index 15a71e3177d9..5b9fa323c528 100644 --- a/vcl/win/app/salinfo.cxx +++ b/vcl/win/app/salinfo.cxx @@ -66,7 +66,7 @@ bool WinSalSystem::handleMonitorCallback( sal_IntPtr hMonitor, sal_IntPtr, sal_I if( it != m_aDeviceNameToMonitor.end() ) { DisplayMonitor& rMon( m_aMonitors[ it->second ] ); - rMon.m_aArea = Rectangle( Point( aInfo.rcMonitor.left, + rMon.m_aArea = tools::Rectangle( Point( aInfo.rcMonitor.left, aInfo.rcMonitor.top ), Size( aInfo.rcMonitor.right - aInfo.rcMonitor.left, aInfo.rcMonitor.bottom - aInfo.rcMonitor.top ) ); @@ -94,7 +94,7 @@ bool WinSalSystem::initMonitors() int w = GetSystemMetrics( SM_CXSCREEN ); int h = GetSystemMetrics( SM_CYSCREEN ); m_aMonitors.push_back( DisplayMonitor( OUString(), - Rectangle( Point(), Size( w, h ) ) ) ); + tools::Rectangle( Point(), Size( w, h ) ) ) ); m_aDeviceNameToMonitor[ OUString() ] = 0; m_nPrimary = 0; } @@ -119,7 +119,7 @@ bool WinSalSystem::initMonitors() aDeviceStringCount[ aDeviceString ]++; m_aDeviceNameToMonitor[ aDeviceName ] = m_aMonitors.size(); m_aMonitors.push_back( DisplayMonitor( aDeviceString, - Rectangle() ) ); + tools::Rectangle() ) ); } } HDC aDesktopRC = GetDC( nullptr ); @@ -159,10 +159,10 @@ unsigned int WinSalSystem::GetDisplayBuiltInScreen() return m_nPrimary; } -Rectangle WinSalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen ) +tools::Rectangle WinSalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen ) { initMonitors(); - return (nScreen < m_aMonitors.size()) ? m_aMonitors[nScreen].m_aArea : Rectangle(); + return (nScreen < m_aMonitors.size()) ? m_aMonitors[nScreen].m_aArea : tools::Rectangle(); } int WinSalSystem::ShowNativeMessageBox(const OUString& rTitle, const OUString& rMessage) diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx index 65b828ad5fa2..aa3eac7c56a5 100644 --- a/vcl/win/gdi/salfont.cxx +++ b/vcl/win/gdi/salfont.cxx @@ -1346,7 +1346,7 @@ void WinSalGraphics::ClearDevFontCache() //anything to do here ? } -bool WinSalGraphics::GetGlyphBoundRect(const GlyphItem& rGlyph, Rectangle& rRect) +bool WinSalGraphics::GetGlyphBoundRect(const GlyphItem& rGlyph, tools::Rectangle& rRect) { HDC hDC = getHDC(); @@ -1365,7 +1365,7 @@ bool WinSalGraphics::GetGlyphBoundRect(const GlyphItem& rGlyph, Rectangle& rRect if( nSize == GDI_ERROR ) return false; - rRect = Rectangle( Point( +aGM.gmptGlyphOrigin.x, -aGM.gmptGlyphOrigin.y ), + rRect = tools::Rectangle( Point( +aGM.gmptGlyphOrigin.x, -aGM.gmptGlyphOrigin.y ), Size( aGM.gmBlackBoxX, aGM.gmBlackBoxY ) ); rRect.Right() += 1; rRect.Bottom() += 1; @@ -1683,7 +1683,7 @@ bool WinSalGraphics::CreateFontSubset( const OUString& rToFile, rInfo.m_aPSName = ImplSalGetUniString( aTTInfo.psname ); rInfo.m_nAscent = aTTInfo.winAscent; rInfo.m_nDescent = aTTInfo.winDescent; - rInfo.m_aFontBBox = Rectangle( Point( aTTInfo.xMin, aTTInfo.yMin ), + rInfo.m_aFontBBox = tools::Rectangle( Point( aTTInfo.xMin, aTTInfo.yMin ), Point( aTTInfo.xMax, aTTInfo.yMax ) ); rInfo.m_nCapHeight = aTTInfo.yMax; // Well ... diff --git a/vcl/win/gdi/salnativewidgets-luna.cxx b/vcl/win/gdi/salnativewidgets-luna.cxx index 0c5e80253e05..b0ea1a9b275d 100644 --- a/vcl/win/gdi/salnativewidgets-luna.cxx +++ b/vcl/win/gdi/salnativewidgets-luna.cxx @@ -335,7 +335,7 @@ bool WinSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP bool WinSalGraphics::hitTestNativeControl( ControlType, ControlPart, - const Rectangle&, + const tools::Rectangle&, const Point&, bool& ) { @@ -358,19 +358,19 @@ bool ImplDrawTheme( HTHEME hTheme, HDC hDC, int iPart, int iState, RECT rc, cons return (hr == S_OK); } -Rectangle ImplGetThemeRect( HTHEME hTheme, HDC hDC, int iPart, int iState, const Rectangle& /* aRect */, THEMESIZE eTS = TS_TRUE ) +tools::Rectangle ImplGetThemeRect( HTHEME hTheme, HDC hDC, int iPart, int iState, const tools::Rectangle& /* aRect */, THEMESIZE eTS = TS_TRUE ) { SIZE aSz; HRESULT hr = vsAPI.GetThemePartSize( hTheme, hDC, iPart, iState, nullptr, eTS, &aSz ); // TS_TRUE returns optimal size if( hr == S_OK ) - return Rectangle( 0, 0, aSz.cx, aSz.cy ); + return tools::Rectangle( 0, 0, aSz.cx, aSz.cy ); else - return Rectangle(); + return tools::Rectangle(); } // Helper functions -void ImplConvertSpinbuttonValues( ControlPart nControlPart, const ControlState& rState, const Rectangle& rRect, +void ImplConvertSpinbuttonValues( ControlPart nControlPart, const ControlState& rState, const tools::Rectangle& rRect, int* pLunaPart, int *pLunaState, RECT *pRect ) { if( nControlPart == ControlPart::ButtonDown ) @@ -1001,7 +1001,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, iPart = (nPart == ControlPart::TrackHorzArea) ? TKP_TRACK : TKP_TRACKVERT; iState = (nPart == ControlPart::TrackHorzArea) ? static_cast<int>(TRS_NORMAL) : static_cast<int>(TRVS_NORMAL); - Rectangle aTrackRect = ImplGetThemeRect( hTheme, hDC, iPart, iState, Rectangle() ); + tools::Rectangle aTrackRect = ImplGetThemeRect( hTheme, hDC, iPart, iState, tools::Rectangle() ); RECT aTRect = rc; if( nPart == ControlPart::TrackHorzArea ) { @@ -1120,8 +1120,8 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, rc.right -= aValue.getNumericVal()+1; else rc.left += aValue.getNumericVal()+1; - Rectangle aRect( ImplGetThemeRect( hTheme, hDC, - MENU_POPUPSEPARATOR, 0, Rectangle( rc.left, rc.top, rc.right, rc.bottom ) ) ); + tools::Rectangle aRect( ImplGetThemeRect( hTheme, hDC, + MENU_POPUPSEPARATOR, 0, tools::Rectangle( rc.left, rc.top, rc.right, rc.bottom ) ) ); // center the separator inside the passed rectangle long nDY = ((rc.bottom - rc.top + 1) - aRect.GetHeight()) / 2; rc.top += nDY; @@ -1136,7 +1136,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, bool WinSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, - const Rectangle& rControlRegion, + const tools::Rectangle& rControlRegion, ControlState nState, const ImplControlValue& aValue, const OUString& aCaption ) @@ -1144,8 +1144,8 @@ bool WinSalGraphics::drawNativeControl( ControlType nType, bool bOk = false; HTHEME hTheme = nullptr; - Rectangle buttonRect = rControlRegion; - Rectangle cacheRect = rControlRegion; + tools::Rectangle buttonRect = rControlRegion; + tools::Rectangle cacheRect = rControlRegion; Size keySize = cacheRect.GetSize(); WinOpenGLSalGraphicsImpl* pImpl = dynamic_cast<WinOpenGLSalGraphicsImpl*>(mpImpl.get()); @@ -1153,8 +1153,8 @@ bool WinSalGraphics::drawNativeControl( ControlType nType, // tdf#95618 - A few controls render outside the region they're given. if (pImpl && nType == ControlType::TabItem) { - Rectangle rNativeBoundingRegion; - Rectangle rNativeContentRegion; + tools::Rectangle rNativeBoundingRegion; + tools::Rectangle rNativeContentRegion; if (getNativeControlRegion(nType, nPart, rControlRegion, nState, aValue, aCaption, rNativeBoundingRegion, rNativeContentRegion)) { @@ -1296,12 +1296,12 @@ bool WinSalGraphics::drawNativeControl( ControlType nType, bool WinSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart, - const Rectangle& rControlRegion, + const tools::Rectangle& rControlRegion, ControlState nState, const ImplControlValue& rControlValue, const OUString&, - Rectangle &rNativeBoundingRegion, - Rectangle &rNativeContentRegion ) + tools::Rectangle &rNativeBoundingRegion, + tools::Rectangle &rNativeContentRegion ) { bool bRet = FALSE; @@ -1320,11 +1320,11 @@ bool WinSalGraphics::getNativeControlRegion( ControlType nType, HTHEME hTheme = getThemeHandle( mhWnd, L"Rebar"); if( hTheme ) { - Rectangle aRect( ImplGetThemeRect( hTheme, hDC, nPart == ControlPart::ThumbHorz ? RP_GRIPPERVERT : RP_GRIPPER, + tools::Rectangle aRect( ImplGetThemeRect( hTheme, hDC, nPart == ControlPart::ThumbHorz ? RP_GRIPPERVERT : RP_GRIPPER, 0, rControlRegion.GetBoundRect() ) ); if( nPart == ControlPart::ThumbHorz && !aRect.IsEmpty() ) { - Rectangle aVertRect( 0, 0, aRect.getHeight(), aRect.getWidth() ); + tools::Rectangle aVertRect( 0, 0, aRect.getHeight(), aRect.getWidth() ); rNativeContentRegion = aVertRect; } else @@ -1340,7 +1340,7 @@ bool WinSalGraphics::getNativeControlRegion( ControlType nType, HTHEME hTheme = getThemeHandle( mhWnd, L"Toolbar"); if( hTheme ) { - Rectangle aRect( ImplGetThemeRect( hTheme, hDC, TP_SPLITBUTTONDROPDOWN, + tools::Rectangle aRect( ImplGetThemeRect( hTheme, hDC, TP_SPLITBUTTONDROPDOWN, TS_HOT, rControlRegion ) ); rNativeContentRegion = aRect; rNativeBoundingRegion = rNativeContentRegion; @@ -1354,7 +1354,7 @@ bool WinSalGraphics::getNativeControlRegion( ControlType nType, HTHEME hTheme = getThemeHandle( mhWnd, L"Progress"); if( hTheme ) { - Rectangle aRect( ImplGetThemeRect( hTheme, hDC, PP_BAR, + tools::Rectangle aRect( ImplGetThemeRect( hTheme, hDC, PP_BAR, 0, rControlRegion ) ); rNativeContentRegion = aRect; rNativeBoundingRegion = rNativeContentRegion; @@ -1367,8 +1367,8 @@ bool WinSalGraphics::getNativeControlRegion( ControlType nType, HTHEME hTheme = getThemeHandle( mhWnd, L"Combobox"); if( hTheme ) { - Rectangle aBoxRect( rControlRegion ); - Rectangle aRect( ImplGetThemeRect( hTheme, hDC, CP_DROPDOWNBUTTON, + tools::Rectangle aBoxRect( rControlRegion ); + tools::Rectangle aRect( ImplGetThemeRect( hTheme, hDC, CP_DROPDOWNBUTTON, CBXS_NORMAL, aBoxRect ) ); if( aRect.GetHeight() > aBoxRect.GetHeight() ) aBoxRect.Bottom() = aBoxRect.Top() + aRect.GetHeight(); @@ -1387,8 +1387,8 @@ bool WinSalGraphics::getNativeControlRegion( ControlType nType, if( hTheme ) { // get border size - Rectangle aBoxRect( rControlRegion ); - Rectangle aRect( ImplGetThemeRect( hTheme, hDC, EP_BACKGROUNDWITHBORDER, + tools::Rectangle aBoxRect( rControlRegion ); + tools::Rectangle aRect( ImplGetThemeRect( hTheme, hDC, EP_BACKGROUNDWITHBORDER, EBWBS_HOT, aBoxRect ) ); // ad app font height NONCLIENTMETRICSW aNonClientMetrics; @@ -1423,8 +1423,8 @@ bool WinSalGraphics::getNativeControlRegion( ControlType nType, nPart == ControlPart::MenuItemRadioMark ) { HTHEME hTheme = getThemeHandle( mhWnd, L"Menu"); - Rectangle aBoxRect( rControlRegion ); - Rectangle aRect( ImplGetThemeRect( hTheme, hDC, + tools::Rectangle aBoxRect( rControlRegion ); + tools::Rectangle aRect( ImplGetThemeRect( hTheme, hDC, MENU_POPUPCHECK, MC_CHECKMARKNORMAL, aBoxRect ) ); @@ -1445,11 +1445,11 @@ bool WinSalGraphics::getNativeControlRegion( ControlType nType, { int iPart = (nPart == ControlPart::ThumbHorz) ? TKP_THUMB : TKP_THUMBVERT; int iState = (nPart == ControlPart::ThumbHorz) ? static_cast<int>(TUS_NORMAL) : static_cast<int>(TUVS_NORMAL); - Rectangle aThumbRect = ImplGetThemeRect( hTheme, hDC, iPart, iState, Rectangle() ); + tools::Rectangle aThumbRect = ImplGetThemeRect( hTheme, hDC, iPart, iState, tools::Rectangle() ); if( nPart == ControlPart::ThumbHorz ) { long nW = aThumbRect.GetWidth(); - Rectangle aRect( rControlRegion ); + tools::Rectangle aRect( rControlRegion ); aRect.Right() = aRect.Left() + nW - 1; rNativeContentRegion = aRect; rNativeBoundingRegion = rNativeContentRegion; @@ -1457,7 +1457,7 @@ bool WinSalGraphics::getNativeControlRegion( ControlType nType, else { long nH = aThumbRect.GetHeight(); - Rectangle aRect( rControlRegion ); + tools::Rectangle aRect( rControlRegion ); aRect.Bottom() = aRect.Top() + nH - 1; rNativeContentRegion = aRect; rNativeBoundingRegion = rNativeContentRegion; @@ -1468,7 +1468,7 @@ bool WinSalGraphics::getNativeControlRegion( ControlType nType, if ( ( nType == ControlType::TabItem ) && ( nPart == ControlPart::Entire ) ) { - Rectangle aControlRect( rControlRegion ); + tools::Rectangle aControlRect( rControlRegion ); rNativeContentRegion = aControlRect; --aControlRect.Bottom(); diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx index b41ad598acbb..3f12664b8d96 100644 --- a/vcl/win/gdi/winlayout.cxx +++ b/vcl/win/gdi/winlayout.cxx @@ -80,7 +80,7 @@ bool WinFontInstance::CacheGlyphToAtlas(HDC hDC, HFONT hFont, int nGlyphIndex, S std::vector<WORD> aGlyphIndices(1); aGlyphIndices[0] = nGlyphIndex; // Fetch the ink boxes and calculate the size of the atlas. - Rectangle bounds(0, 0, 0, 0); + tools::Rectangle bounds(0, 0, 0, 0); auto aInkBoxes = pTxt->GetGlyphInkBoxes(aGlyphIndices.data(), aGlyphIndices.data() + 1); for (auto &box : aInkBoxes) bounds.Union(box + Point(bounds.Right(), 0)); @@ -142,7 +142,7 @@ bool WinFontInstance::CacheGlyphToAtlas(HDC hDC, HFONT hFont, int nGlyphIndex, S aDC.fill(MAKE_SALCOLOR(0xff, 0xff, 0xff)); - pTxt->BindDC(aDC.getCompatibleHDC(), Rectangle(0, 0, nBitmapWidth, nBitmapHeight)); + pTxt->BindDC(aDC.getCompatibleHDC(), tools::Rectangle(0, 0, nBitmapWidth, nBitmapHeight)); auto pRT = pTxt->GetRenderTarget(); ID2D1SolidColorBrush* pBrush = nullptr; @@ -353,7 +353,7 @@ bool D2DWriteTextOutRenderer::operator ()(CommonSalLayout const &rLayout, return ExTextOutRenderer()(rLayout, rGraphics, hDC); } - Rectangle bounds; + tools::Rectangle bounds; bool succeeded = rLayout.GetBoundRect(rGraphics, bounds); succeeded &= BindDC(hDC, bounds); // Update the bounding rect. @@ -435,19 +435,19 @@ bool D2DWriteTextOutRenderer::ReleaseFont() // The inkboxes returned have their origin on the baseline, to a -ve value // of Top() means the glyph extends abs(Top()) many pixels above the // baseline, and +ve means the ink starts that many pixels below. -std::vector<Rectangle> D2DWriteTextOutRenderer::GetGlyphInkBoxes(uint16_t * pGid, uint16_t * pGidEnd) const +std::vector<tools::Rectangle> D2DWriteTextOutRenderer::GetGlyphInkBoxes(uint16_t * pGid, uint16_t * pGidEnd) const { ptrdiff_t nGlyphs = pGidEnd - pGid; - if (nGlyphs < 0) return std::vector<Rectangle>(); + if (nGlyphs < 0) return std::vector<tools::Rectangle>(); DWRITE_FONT_METRICS aFontMetrics; mpFontFace->GetMetrics(&aFontMetrics); std::vector<DWRITE_GLYPH_METRICS> metrics(nGlyphs); if (!SUCCEEDED(mpFontFace->GetDesignGlyphMetrics(pGid, nGlyphs, metrics.data()))) - return std::vector<Rectangle>(); + return std::vector<tools::Rectangle>(); - std::vector<Rectangle> aOut(nGlyphs); + std::vector<tools::Rectangle> aOut(nGlyphs); auto pOut = aOut.begin(); for (auto &m : metrics) { @@ -566,7 +566,7 @@ bool WinSalGraphics::DrawCachedGlyphs(const CommonSalLayout& rLayout) { HDC hDC = getHDC(); - Rectangle aRect; + tools::Rectangle aRect; rLayout.GetBoundRect(*this, aRect); COLORREF color = GetTextColor(hDC); @@ -657,7 +657,7 @@ void WinSalGraphics::DrawTextLayout(const CommonSalLayout& rLayout) // TODO: check the performance of this 2nd approach at some stage and // switch to that if it performs well. - Rectangle aRect; + tools::Rectangle aRect; rLayout.GetBoundRect(*this, aRect); WinOpenGLSalGraphicsImpl *pImpl = dynamic_cast<WinOpenGLSalGraphicsImpl*>(mpImpl.get()); diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx index b0347461a2a2..4932ecdabdac 100644 --- a/vcl/win/window/salframe.cxx +++ b/vcl/win/window/salframe.cxx @@ -766,7 +766,7 @@ static void ImplSalCalcFullScreenSize( const WinSalFrame* pFrame, sal_Int32 nMonitors = Application::GetScreenCount(); if( (pFrame->mnDisplay >= 0) && (pFrame->mnDisplay < nMonitors) ) { - Rectangle aRect = Application::GetScreenPosSizePixel( pFrame->mnDisplay ); + tools::Rectangle aRect = Application::GetScreenPosSizePixel( pFrame->mnDisplay ); nScreenX = aRect.Left(); nScreenY = aRect.Top(); nScreenDX = aRect.getWidth()+1; // difference between java/awt convention and vcl @@ -774,7 +774,7 @@ static void ImplSalCalcFullScreenSize( const WinSalFrame* pFrame, } else { - Rectangle aCombined = Application::GetScreenPosSizePixel( 0 ); + tools::Rectangle aCombined = Application::GetScreenPosSizePixel( 0 ); for( sal_Int32 i = 1 ; i < nMonitors ; i++ ) { aCombined.Union( Application::GetScreenPosSizePixel( i ) ); @@ -1606,7 +1606,7 @@ bool WinSalFrame::SetPluginParent( SystemParentData* pNewParent ) return true; } -void WinSalFrame::GetWorkArea( Rectangle &rRect ) +void WinSalFrame::GetWorkArea( tools::Rectangle &rRect ) { RECT aRect; ImplSalGetWorkArea( mhWnd, &aRect, nullptr ); |