diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-07-20 08:19:52 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-08-02 08:13:15 +0200 |
commit | b6b26421a1029b18b48b69dbdac4bb70fb622604 (patch) | |
tree | 97b9ab25fef28063a3de4e3a67544d2ea13a70e0 /vcl/win/window/salframe.cxx | |
parent | d66ffef8558785f19908c8e526211b8225fa9125 (diff) |
split Point/Size/Rectangle into AbsoluteScreenPixel* types
to attempt to make it obvious in code what kind of coordinate
system we are dealing with.
The idea is that by doing this, the compile-time type checking
will flush out inconsistencies between different code.
I started with vcl::Window::OutputToAbsoluteScreenPixel
and worked outwards from there.
Change-Id: Ia967d7a0bb38886695f3a761b85c8b9340ddb1c0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154676
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/win/window/salframe.cxx')
-rw-r--r-- | vcl/win/window/salframe.cxx | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx index 25c2e2b3b281..c7c0bdd4f328 100644 --- a/vcl/win/window/salframe.cxx +++ b/vcl/win/window/salframe.cxx @@ -793,7 +793,7 @@ static void ImplSalCalcFullScreenSize( const WinSalFrame* pFrame, try { - tools::Rectangle aRect; + AbsoluteScreenPixelRectangle aRect; sal_Int32 nMonitors = Application::GetScreenCount(); if( (pFrame->mnDisplay >= 0) && (pFrame->mnDisplay < nMonitors) ) { @@ -920,7 +920,7 @@ void WinSalFrame::updateScreenNumber() { const std::vector<WinSalSystem::DisplayMonitor>& rMonitors = pSys->getMonitors(); - Point aPoint(maGeometry.pos()); + AbsoluteScreenPixelPoint aPoint(maGeometry.pos()); size_t nMon = rMonitors.size(); for( size_t i = 0; i < nMon; i++ ) { @@ -1587,7 +1587,7 @@ void WinSalFrame::SetPluginParent( SystemParentData* pNewParent ) WinSalFrame::mbInReparent = false; } -void WinSalFrame::GetWorkArea( tools::Rectangle &rRect ) +void WinSalFrame::GetWorkArea( AbsoluteScreenPixelRectangle &rRect ) { RECT aRect; @@ -1785,8 +1785,8 @@ void WinSalFrame::SetScreenNumber( unsigned int nNewScreen ) size_t nMon = rMonitors.size(); if( nNewScreen < nMon ) { - Point aOldMonPos, aNewMonPos( rMonitors[nNewScreen].m_aArea.TopLeft() ); - Point aCurPos(maGeometry.pos()); + AbsoluteScreenPixelPoint aOldMonPos, aNewMonPos( rMonitors[nNewScreen].m_aArea.TopLeft() ); + AbsoluteScreenPixelPoint aCurPos(maGeometry.pos()); for( size_t i = 0; i < nMon; i++ ) { if( rMonitors[i].m_aArea.Contains( aCurPos ) ) @@ -5560,17 +5560,17 @@ static LRESULT ImplHandleIMEQueryCharPosition( HWND hWnd, LPARAM lParam ) { { // For vertical writing, the base line is left edge of the rectangle // and the target position is top-right corner. - pQueryCharPosition->pt.x = aEvt.mnCursorBoundX + aEvt.mnCursorBoundWidth; - pQueryCharPosition->pt.y = aEvt.mnCursorBoundY; - pQueryCharPosition->cLineHeight = aEvt.mnCursorBoundWidth; + pQueryCharPosition->pt.x = aEvt.maCursorBound.getX() + aEvt.maCursorBound.GetWidth(); + pQueryCharPosition->pt.y = aEvt.maCursorBound.getY(); + pQueryCharPosition->cLineHeight = aEvt.maCursorBound.GetWidth(); } else { // For horizontal writing, the base line is the bottom edge of the rectangle. // and the target position is top-left corner. - pQueryCharPosition->pt.x = aEvt.mnCursorBoundX; - pQueryCharPosition->pt.y = aEvt.mnCursorBoundY; - pQueryCharPosition->cLineHeight = aEvt.mnCursorBoundHeight; + pQueryCharPosition->pt.x = aEvt.maCursorBound.getX(); + pQueryCharPosition->pt.y = aEvt.maCursorBound.getY(); + pQueryCharPosition->cLineHeight = aEvt.maCursorBound.GetHeight(); } // Currently not supported but many IMEs usually ignore them. |