diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-03-30 20:27:55 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-03-31 06:27:11 +0000 |
commit | a5a571307fb3306b74ab46b085cde6388270a770 (patch) | |
tree | 66d4ce12bb5236c50ab6a5d253bc8c6d8b5d292d /vcl/osx | |
parent | 17d821af6bb9df93569836a92f6bed975587fc6c (diff) |
tdf#82580 tools: rename Rectangle to tools::Rectangle
Mostly generated using
make check COMPILER_EXTERNAL_TOOL=1 CCACHE_PREFIX=clang-rename-wrapper RENAME_ARGS="-qualified-name=Rectangle -new-name=tools::Rectangle"
Except some modules have their own foo::tools namespace, so there have
to use ::tools::Rectangle. This commit just moves the class from the
global namespace, it does not update pre/postwin.h yet.
Change-Id: I42b2de3c6f769fcf28cfe086f98eb31e42a305f2
Reviewed-on: https://gerrit.libreoffice.org/35923
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'vcl/osx')
-rw-r--r-- | vcl/osx/salframe.cxx | 8 | ||||
-rw-r--r-- | vcl/osx/salmenu.cxx | 16 | ||||
-rw-r--r-- | vcl/osx/salnativewidgets.cxx | 86 | ||||
-rw-r--r-- | vcl/osx/salsys.cxx | 6 |
4 files changed, 58 insertions, 58 deletions
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx index ca4a5d9928d7..28284b4a73fc 100644 --- a/vcl/osx/salframe.cxx +++ b/vcl/osx/salframe.cxx @@ -364,7 +364,7 @@ void AquaSalFrame::initShow() mbInitShow = false; if( ! mbPositioned && ! mbFullScreen ) { - Rectangle aScreenRect; + tools::Rectangle aScreenRect; GetWorkArea( aScreenRect ); if( mpParent ) // center relative to parent { @@ -396,7 +396,7 @@ void AquaSalFrame::initShow() [AquaA11yFactory registerView: mpNSView]; } -void AquaSalFrame::SendPaintEvent( const Rectangle* pRect ) +void AquaSalFrame::SendPaintEvent( const tools::Rectangle* pRect ) { SalPaintEvent aPaintEvt( 0, 0, maGeometry.nWidth, maGeometry.nHeight, true ); if( pRect ) @@ -905,7 +905,7 @@ void AquaSalFrame::Flush() } } -void AquaSalFrame::Flush( const Rectangle& rRect ) +void AquaSalFrame::Flush( const tools::Rectangle& rRect ) { if( !(mbGraphics && mpGraphics && mpNSView && mbShown) ) return; @@ -1336,7 +1336,7 @@ void AquaSalFrame::SetPosSize(long nX, long nY, long nWidth, long nHeight, sal_u } } -void AquaSalFrame::GetWorkArea( Rectangle& rRect ) +void AquaSalFrame::GetWorkArea( tools::Rectangle& rRect ) { if ( !mpNSWindow ) return; diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx index c567f9ecbed2..1915cc3e8e32 100644 --- a/vcl/osx/salmenu.cxx +++ b/vcl/osx/salmenu.cxx @@ -319,7 +319,7 @@ AquaSalMenu::~AquaSalMenu() } } -bool AquaSalMenu::ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rRect, FloatWinPopupFlags nFlags) +bool AquaSalMenu::ShowNativePopupMenu(FloatingWindow * pWin, const tools::Rectangle& rRect, FloatWinPopupFlags nFlags) { // do not use native popup menu when AQUA_NATIVE_MENUS is set to false if( ! VisibleMenuBar() ) { @@ -854,26 +854,26 @@ void AquaSalMenu::RemoveMenuBarButton( sal_uInt16 i_nId ) statusLayout(); } -Rectangle AquaSalMenu::GetMenuBarButtonRectPixel( sal_uInt16 i_nItemId, SalFrame* i_pReferenceFrame ) +tools::Rectangle AquaSalMenu::GetMenuBarButtonRectPixel( sal_uInt16 i_nItemId, SalFrame* i_pReferenceFrame ) { if( ! i_pReferenceFrame || ! AquaSalFrame::isAlive( static_cast<AquaSalFrame*>(i_pReferenceFrame) ) ) - return Rectangle(); + return tools::Rectangle(); MenuBarButtonEntry* pEntry = findButtonItem( i_nItemId ); if( ! pEntry ) - return Rectangle(); + return tools::Rectangle(); NSStatusItem* pItem = SalData::getStatusItem(); if( ! pItem ) - return Rectangle(); + return tools::Rectangle(); NSView* pNSView = [pItem view]; if( ! pNSView ) - return Rectangle(); + return tools::Rectangle(); NSWindow* pNSWin = [pNSView window]; if( ! pNSWin ) - return Rectangle(); + return tools::Rectangle(); NSRect aRect = [pNSWin convertRectToScreen:[pNSWin frame]]; @@ -882,7 +882,7 @@ Rectangle AquaSalMenu::GetMenuBarButtonRectPixel( sal_uInt16 i_nItemId, SalFrame aRect.origin.x -= i_pReferenceFrame->maGeometry.nX; aRect.origin.y -= i_pReferenceFrame->maGeometry.nY + aRect.size.height; - return Rectangle( Point(static_cast<long int>(aRect.origin.x), + return tools::Rectangle( Point(static_cast<long int>(aRect.origin.x), static_cast<long int>(aRect.origin.y) ), Size( static_cast<long int>(aRect.size.width), diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx index 31824cd754a1..7c91d058c292 100644 --- a/vcl/osx/salnativewidgets.cxx +++ b/vcl/osx/salnativewidgets.cxx @@ -47,9 +47,9 @@ class AquaBlinker : public Timer { AquaSalFrame* mpFrame; - Rectangle maInvalidateRect; + tools::Rectangle maInvalidateRect; - AquaBlinker( AquaSalFrame* pFrame, const Rectangle& rRect ) + AquaBlinker( AquaSalFrame* pFrame, const tools::Rectangle& rRect ) : mpFrame( pFrame ), maInvalidateRect( rRect ) { mpFrame->maBlinkers.push_back( this ); @@ -57,7 +57,7 @@ class AquaBlinker : public Timer public: - static void Blink( AquaSalFrame*, const Rectangle&, int nTimeout = 80 ); + static void Blink( AquaSalFrame*, const tools::Rectangle&, int nTimeout = 80 ); virtual void Invoke() override { @@ -71,7 +71,7 @@ class AquaBlinker : public Timer } }; -void AquaBlinker::Blink( AquaSalFrame* pFrame, const Rectangle& rRect, int nTimeout ) +void AquaBlinker::Blink( AquaSalFrame* pFrame, const tools::Rectangle& rRect, int nTimeout ) { // prevent repeated paints from triggering themselves all the time for( std::list< AquaBlinker* >::const_iterator it = pFrame->maBlinkers.begin(); @@ -87,7 +87,7 @@ void AquaBlinker::Blink( AquaSalFrame* pFrame, const Rectangle& rRect, int nTime // Helper returns an HIRect -static HIRect ImplGetHIRectFromRectangle(Rectangle aRect) +static HIRect ImplGetHIRectFromRectangle(tools::Rectangle aRect) { HIRect aHIRect; aHIRect.origin.x = static_cast<float>(aRect.Left()); @@ -118,7 +118,7 @@ static ThemeButtonValue ImplGetButtonValue( ButtonValue aButtonValue ) } static bool AquaGetScrollRect( /* TODO: int nScreen, */ ControlPart nPart, - const Rectangle& rControlRect, Rectangle& rResultRect ) + const tools::Rectangle& rControlRect, tools::Rectangle& rResultRect ) { bool bRetVal = true; rResultRect = rControlRect; @@ -285,12 +285,12 @@ bool AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart n return bOk; } -bool AquaSalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, +bool AquaSalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, const tools::Rectangle& rControlRegion, const Point& rPos, bool& rIsInside ) { if ( nType == ControlType::Scrollbar ) { - Rectangle aRect; + tools::Rectangle aRect; bool bValid = AquaGetScrollRect( /* TODO: m_nScreen */ nPart, rControlRegion, aRect ); rIsInside = bValid && aRect.IsInside( rPos ); return bValid; @@ -334,7 +334,7 @@ UInt32 AquaSalGraphics::getTrackState( ControlState nState ) bool AquaSalGraphics::drawNativeControl(ControlType nType, ControlPart nPart, - const Rectangle& rControlRegion, + const tools::Rectangle& rControlRegion, ControlState nState, const ImplControlValue& aValue, const OUString& ) @@ -346,7 +346,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, CGContextSaveGState( mrContext ); - Rectangle buttonRect = rControlRegion; + tools::Rectangle buttonRect = rControlRegion; HIRect rc = ImplGetHIRectFromRectangle(buttonRect); switch( nType ) @@ -938,7 +938,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, else if((nUpperState & ControlState::ROLLOVER)||(nLowerState & ControlState::ROLLOVER)) aSpinInfo.state = kThemeStateRollover; - Rectangle aSpinRect( pSpinButtonVal->maUpperRect ); + tools::Rectangle aSpinRect( pSpinButtonVal->maUpperRect ); aSpinRect.Union( pSpinButtonVal->maLowerRect ); HIRect buttonRc = ImplGetHIRectFromRectangle(aSpinRect); @@ -1034,7 +1034,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, if( mxClipPath ) aRect = CGPathGetBoundingBox( mxClipPath ); if( aRect.size.width != 0 && aRect.size.height != 0 ) - buttonRect.Intersection( Rectangle( Point( static_cast<long int>(aRect.origin.x), + buttonRect.Intersection( tools::Rectangle( Point( static_cast<long int>(aRect.origin.x), static_cast<long int>(aRect.origin.y) ), Size( static_cast<long int>(aRect.size.width), static_cast<long int>(aRect.size.height) ) ) ); @@ -1045,14 +1045,14 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, return bOK; } -bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState /*nState*/, +bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart, const tools::Rectangle& rControlRegion, ControlState /*nState*/, const ImplControlValue& aValue, const OUString&, - Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion ) + tools::Rectangle &rNativeBoundingRegion, tools::Rectangle &rNativeContentRegion ) { bool toReturn = false; - Rectangle aCtrlBoundRect( rControlRegion ); + tools::Rectangle aCtrlBoundRect( rControlRegion ); short x = aCtrlBoundRect.Left(); short y = aCtrlBoundRect.Top(); short w, h; @@ -1067,14 +1067,14 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa { w = 19; // taken from HIG h = aCtrlBoundRect.GetHeight(); - rNativeBoundingRegion = rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h ) ); + rNativeBoundingRegion = rNativeContentRegion = tools::Rectangle( Point( x, y ), Size( w, h ) ); toReturn = true; } else if( nPart == ControlPart::ThumbVert ) { w = aCtrlBoundRect.GetWidth(); h = 18; // taken from HIG - rNativeBoundingRegion = rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h ) ); + rNativeBoundingRegion = rNativeContentRegion = tools::Rectangle( Point( x, y ), Size( w, h ) ); toReturn = true; } } @@ -1082,7 +1082,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa case ControlType::Scrollbar: { - Rectangle aRect; + tools::Rectangle aRect; if( AquaGetScrollRect( /* m_nScreen */ nPart, aCtrlBoundRect, aRect ) ) { toReturn = true; @@ -1112,15 +1112,15 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa } - rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h + nBorderCleanup) ); - rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h ) ); + rNativeContentRegion = tools::Rectangle( Point( x, y ), Size( w, h + nBorderCleanup) ); + rNativeBoundingRegion = tools::Rectangle( Point( x, y ), Size( w, h ) ); toReturn = true; } break; case ControlType::Progress: { - Rectangle aRect( aCtrlBoundRect ); + tools::Rectangle aRect( aCtrlBoundRect ); if( aRect.GetHeight() < 16 ) aRect.Bottom() = aRect.Top() + 9; // values taken from HIG for medium progress else @@ -1133,7 +1133,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa case ControlType::IntroProgress: { - Rectangle aRect( aCtrlBoundRect ); + tools::Rectangle aRect( aCtrlBoundRect ); aRect.Bottom() = aRect.Top() + INTRO_PROGRESS_HEIGHT; // values taken from HIG for medium progress rNativeBoundingRegion = aRect; rNativeContentRegion = aRect; @@ -1146,8 +1146,8 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa w = aCtrlBoundRect.GetWidth() + 2*TAB_TEXT_OFFSET - 2*VCL_TAB_TEXT_OFFSET; h = TAB_HEIGHT_NORMAL+2; - rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h ) ); - rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h ) ); + rNativeContentRegion = tools::Rectangle( Point( x, y ), Size( w, h ) ); + rNativeBoundingRegion = tools::Rectangle( Point( x, y ), Size( w, h ) ); toReturn = true; @@ -1162,8 +1162,8 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa if( h < aCtrlBoundRect.GetHeight() ) h = aCtrlBoundRect.GetHeight(); - rNativeContentRegion = Rectangle( Point( x+FOCUS_RING_WIDTH, y+FOCUS_RING_WIDTH ), Size( w-2*(FOCUS_RING_WIDTH+1), h-2*(FOCUS_RING_WIDTH+1) ) ); - rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h ) ); + rNativeContentRegion = tools::Rectangle( Point( x+FOCUS_RING_WIDTH, y+FOCUS_RING_WIDTH ), Size( w-2*(FOCUS_RING_WIDTH+1), h-2*(FOCUS_RING_WIDTH+1) ) ); + rNativeBoundingRegion = tools::Rectangle( Point( x, y ), Size( w, h ) ); toReturn = true; } @@ -1176,8 +1176,8 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa w = aCtrlBoundRect.GetWidth(); h = COMBOBOX_HEIGHT_NORMAL;//listboxes and comboxes have the same height - rNativeContentRegion = Rectangle( Point( x+FOCUS_RING_WIDTH, y+FOCUS_RING_WIDTH ), Size( w-2*FOCUS_RING_WIDTH, h ) ); - rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h+2*FOCUS_RING_WIDTH ) ); + rNativeContentRegion = tools::Rectangle( Point( x+FOCUS_RING_WIDTH, y+FOCUS_RING_WIDTH ), Size( w-2*FOCUS_RING_WIDTH, h ) ); + rNativeBoundingRegion = tools::Rectangle( Point( x, y ), Size( w, h+2*FOCUS_RING_WIDTH ) ); toReturn = true; } @@ -1192,8 +1192,8 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa y += FOCUS_RING_WIDTH; w = DROPDOWN_BUTTON_WIDTH; - rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h ) ); - rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w+FOCUS_RING_WIDTH, h+2*FOCUS_RING_WIDTH ) ); + rNativeContentRegion = tools::Rectangle( Point( x, y ), Size( w, h ) ); + rNativeBoundingRegion = tools::Rectangle( Point( x, y ), Size( w+FOCUS_RING_WIDTH, h+2*FOCUS_RING_WIDTH ) ); toReturn = true; } @@ -1211,8 +1211,8 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa w -= 9; // HIG specifies 9 units distance between dropdown button area and content h -= 4; // don't draw into lower border - rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h ) ); - rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w+FOCUS_RING_WIDTH, h+2*FOCUS_RING_WIDTH ) ); + rNativeContentRegion = tools::Rectangle( Point( x, y ), Size( w, h ) ); + rNativeBoundingRegion = tools::Rectangle( Point( x, y ), Size( w+FOCUS_RING_WIDTH, h+2*FOCUS_RING_WIDTH ) ); toReturn = true; } @@ -1225,8 +1225,8 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa w = 3+2*FOCUS_RING_WIDTH+SPIN_BUTTON_SPACE+SPIN_BUTTON_WIDTH; h = TEXT_EDIT_HEIGHT_NORMAL; - rNativeContentRegion = Rectangle( Point( x+FOCUS_RING_WIDTH, y ), Size( w-2*FOCUS_RING_WIDTH, h ) ); - rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h+2*FOCUS_RING_WIDTH ) ); + rNativeContentRegion = tools::Rectangle( Point( x+FOCUS_RING_WIDTH, y ), Size( w-2*FOCUS_RING_WIDTH, h ) ); + rNativeBoundingRegion = tools::Rectangle( Point( x, y ), Size( w, h+2*FOCUS_RING_WIDTH ) ); toReturn = true; } @@ -1238,8 +1238,8 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa w -= 8; // offset for left and right rounded border h -= 4; // don't draw into upper or lower border - rNativeContentRegion = Rectangle( Point( x + FOCUS_RING_WIDTH, y + FOCUS_RING_WIDTH ), Size( w - 2* FOCUS_RING_WIDTH, h ) ); - rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h+2*FOCUS_RING_WIDTH ) ); + rNativeContentRegion = tools::Rectangle( Point( x + FOCUS_RING_WIDTH, y + FOCUS_RING_WIDTH ), Size( w - 2* FOCUS_RING_WIDTH, h ) ); + rNativeBoundingRegion = tools::Rectangle( Point( x, y ), Size( w, h+2*FOCUS_RING_WIDTH ) ); toReturn = true; } @@ -1252,8 +1252,8 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa w = SPIN_BUTTON_WIDTH + 2*CLIP_FUZZ; h = SPIN_UPPER_BUTTON_HEIGHT + 2*CLIP_FUZZ; - rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h ) ); - rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h ) ); + rNativeContentRegion = tools::Rectangle( Point( x, y ), Size( w, h ) ); + rNativeBoundingRegion = tools::Rectangle( Point( x, y ), Size( w, h ) ); toReturn = true; } @@ -1263,8 +1263,8 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa w = SPIN_BUTTON_WIDTH + 2*CLIP_FUZZ; h = SPIN_LOWER_BUTTON_HEIGHT + 2*CLIP_FUZZ; - rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h ) ); - rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h ) ); + rNativeContentRegion = tools::Rectangle( Point( x, y ), Size( w, h ) ); + rNativeBoundingRegion = tools::Rectangle( Point( x, y ), Size( w, h ) ); toReturn = true; } @@ -1276,7 +1276,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa if( ( nPart == ControlPart::Border ) && !( nFlags & (DrawFrameFlags::Menu | DrawFrameFlags::WindowBorder | DrawFrameFlags::BorderWindowBorder) ) ) { - Rectangle aRect(aCtrlBoundRect); + tools::Rectangle aRect(aCtrlBoundRect); if( nStyle == DrawFrameStyle::DoubleIn ) { aRect.Left() += 1; @@ -1308,8 +1308,8 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa w=10; h=10;//dimensions of the mark (10px font) - rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h ) ); - rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h ) ); + rNativeContentRegion = tools::Rectangle( Point( x, y ), Size( w, h ) ); + rNativeBoundingRegion = tools::Rectangle( Point( x, y ), Size( w, h ) ); toReturn = true; } diff --git a/vcl/osx/salsys.cxx b/vcl/osx/salsys.cxx index c4d454abed93..e7870ef79bd3 100644 --- a/vcl/osx/salsys.cxx +++ b/vcl/osx/salsys.cxx @@ -38,10 +38,10 @@ unsigned int AquaSalSystem::GetDisplayScreenCount() return pScreens ? [pScreens count] : 1; } -Rectangle AquaSalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen ) +tools::Rectangle AquaSalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen ) { NSArray* pScreens = [NSScreen screens]; - Rectangle aRet; + tools::Rectangle aRet; NSScreen* pScreen = nil; if( pScreens && nScreen < [pScreens count] ) pScreen = [pScreens objectAtIndex: nScreen]; @@ -51,7 +51,7 @@ Rectangle AquaSalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen ) if( pScreen ) { NSRect aFrame = [pScreen frame]; - aRet = Rectangle( Point( static_cast<long int>(aFrame.origin.x), static_cast<long int>(aFrame.origin.y) ), + aRet = tools::Rectangle( Point( static_cast<long int>(aFrame.origin.x), static_cast<long int>(aFrame.origin.y) ), Size( static_cast<long int>(aFrame.size.width), static_cast<long int>(aFrame.size.height) ) ); } return aRet; |