diff options
Diffstat (limited to 'vcl/osx/salnativewidgets.cxx')
-rw-r--r-- | vcl/osx/salnativewidgets.cxx | 86 |
1 files changed, 43 insertions, 43 deletions
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; } |