diff options
author | Matteo Casalin <matteo.casalin@poste.it> | 2011-12-04 15:25:04 +0100 |
---|---|---|
committer | Tor Lillqvist <tlillqvist@suse.com> | 2011-12-05 12:30:47 +0200 |
commit | 1edf28e073a5088a7d26c61f509fc654be56696b (patch) | |
tree | 9334322ae6c62df0090f8a1f46e6ae0cf1c5e97a /vcl | |
parent | Decoview cleanup - DrawButton (diff) | |
download | core-1edf28e073a5088a7d26c61f509fc654be56696b.tar.gz core-1edf28e073a5088a7d26c61f509fc654be56696b.zip |
DecoView cleanup - Embed OutputDevice::ImplDraw2ColorFrame
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/vcl/outdev.hxx | 1 | ||||
-rw-r--r-- | vcl/source/gdi/outdev6.cxx | 14 | ||||
-rw-r--r-- | vcl/source/window/decoview.cxx | 76 |
3 files changed, 44 insertions, 47 deletions
diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx index 17b94dbab5c5..d2d3809b3db8 100644 --- a/vcl/inc/vcl/outdev.hxx +++ b/vcl/inc/vcl/outdev.hxx @@ -489,7 +489,6 @@ public: SAL_DLLPRIVATE void ImplDrawColorWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper ); SAL_DLLPRIVATE void ImplDrawBitmapWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper ); SAL_DLLPRIVATE void ImplDrawGradientWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper ); - SAL_DLLPRIVATE void ImplDraw2ColorFrame( const Rectangle& rRect, const Color& rLeftTopColor, const Color& rRightBottomColor ); SAL_DLLPRIVATE void ImplDrawOutDevDirect( const OutputDevice* pSrcDev, void* pPosAry ); SAL_DLLPRIVATE void ImplDrawBitmap( const Point& rDestPt, const Size& rDestSize, diff --git a/vcl/source/gdi/outdev6.cxx b/vcl/source/gdi/outdev6.cxx index 8800fd40ae2e..098d36de3ba4 100644 --- a/vcl/source/gdi/outdev6.cxx +++ b/vcl/source/gdi/outdev6.cxx @@ -1170,20 +1170,6 @@ void OutputDevice::Erase() // ----------------------------------------------------------------------- -void OutputDevice::ImplDraw2ColorFrame( const Rectangle& rRect, - const Color& rLeftTopColor, - const Color& rRightBottomColor ) -{ - SetFillColor( rLeftTopColor ); - DrawRect( Rectangle( rRect.TopLeft(), Point( rRect.Left(), rRect.Bottom()-1 ) ) ); - DrawRect( Rectangle( rRect.TopLeft(), Point( rRect.Right()-1, rRect.Top() ) ) ); - SetFillColor( rRightBottomColor ); - DrawRect( Rectangle( rRect.BottomLeft(), rRect.BottomRight() ) ); - DrawRect( Rectangle( rRect.TopRight(), rRect.BottomRight() ) ); -} - -// ----------------------------------------------------------------------- - bool OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize, const GfxLink& rGfxLink, GDIMetaFile* pSubst ) { diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx index 452bbb46de61..58f425c85c7e 100644 --- a/vcl/source/window/decoview.cxx +++ b/vcl/source/window/decoview.cxx @@ -481,6 +481,18 @@ void ImplDrawDPILineRect( OutputDevice *const pDev, Rectangle& rRect, } +void ImplDraw2ColorFrame( OutputDevice *const pDev, const Rectangle& rRect, + const Color& rLeftTopColor, const Color& rRightBottomColor ) +{ + pDev->SetFillColor( rLeftTopColor ); + pDev->DrawRect( Rectangle( rRect.TopLeft(), Point( rRect.Left(), rRect.Bottom()-1 ) ) ); + pDev->DrawRect( Rectangle( rRect.TopLeft(), Point( rRect.Right()-1, rRect.Top() ) ) ); + pDev->SetFillColor( rRightBottomColor ); + pDev->DrawRect( Rectangle( rRect.BottomLeft(), rRect.BottomRight() ) ); + pDev->DrawRect( Rectangle( rRect.TopRight(), rRect.BottomRight() ) ); +} + + void ImplDrawButton( OutputDevice *const pDev, Rectangle aFillRect, const sal_uInt16 nStyle ) { @@ -599,7 +611,7 @@ void ImplDrawButton( OutputDevice *const pDev, Rectangle aFillRect, pDev->SetLineColor(); - pDev->ImplDraw2ColorFrame( aFillRect, aColor1, aColor2 ); + ImplDraw2ColorFrame( pDev, aFillRect, aColor1, aColor2 ); ++aFillRect.Left(); ++aFillRect.Top(); --aFillRect.Right(); @@ -620,7 +632,7 @@ void ImplDrawButton( OutputDevice *const pDev, Rectangle aFillRect, aColor1 = rStyleSettings.GetLightBorderColor(); aColor2 = rStyleSettings.GetShadowColor(); } - pDev->ImplDraw2ColorFrame( aFillRect, aColor1, aColor2 ); + ImplDraw2ColorFrame( pDev, aFillRect, aColor1, aColor2 ); ++aFillRect.Left(); ++aFillRect.Top(); --aFillRect.Right(); @@ -698,7 +710,7 @@ void DecorationView::DrawFrame( const Rectangle& rRect, sal_Bool bOldMapMode = mpOutDev->IsMapModeEnabled(); mpOutDev->EnableMapMode( sal_False ); mpOutDev->SetLineColor(); - mpOutDev->ImplDraw2ColorFrame( aRect, rLeftTopColor, rRightBottomColor ); + ImplDraw2ColorFrame( mpOutDev, aRect, rLeftTopColor, rRightBottomColor ); mpOutDev->SetLineColor( aOldLineColor ); mpOutDev->SetFillColor( aOldFillColor ); mpOutDev->EnableMapMode( bOldMapMode ); @@ -903,15 +915,15 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect, { if ( nFrameStyle == FRAME_DRAW_IN ) { - pDev->ImplDraw2ColorFrame( rRect, - rStyleSettings.GetShadowColor(), - rStyleSettings.GetLightColor() ); + ImplDraw2ColorFrame( pDev, rRect, + rStyleSettings.GetShadowColor(), + rStyleSettings.GetLightColor() ); } else { - pDev->ImplDraw2ColorFrame( rRect, - rStyleSettings.GetLightColor(), - rStyleSettings.GetShadowColor() ); + ImplDraw2ColorFrame( pDev, rRect, + rStyleSettings.GetLightColor(), + rStyleSettings.GetShadowColor() ); } rRect.Left()++; @@ -924,26 +936,26 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect, if ( nFrameStyle == FRAME_DRAW_DOUBLEIN ) { if( bFlatBorders ) // no 3d effect - pDev->ImplDraw2ColorFrame( rRect, - rStyleSettings.GetShadowColor(), - rStyleSettings.GetShadowColor() ); + ImplDraw2ColorFrame( pDev, rRect, + rStyleSettings.GetShadowColor(), + rStyleSettings.GetShadowColor() ); else - pDev->ImplDraw2ColorFrame( rRect, - rStyleSettings.GetShadowColor(), - rStyleSettings.GetLightColor() ); + ImplDraw2ColorFrame( pDev, rRect, + rStyleSettings.GetShadowColor(), + rStyleSettings.GetLightColor() ); } else { if( bMenuStyle ) - pDev->ImplDraw2ColorFrame( rRect, - rStyleSettings.GetMenuBorderColor(), - rStyleSettings.GetDarkShadowColor() ); + ImplDraw2ColorFrame( pDev, rRect, + rStyleSettings.GetMenuBorderColor(), + rStyleSettings.GetDarkShadowColor() ); else - pDev->ImplDraw2ColorFrame( rRect, - bFlatBorders ? // no 3d effect - rStyleSettings.GetDarkShadowColor() : - rStyleSettings.GetLightBorderColor(), - rStyleSettings.GetDarkShadowColor() ); + ImplDraw2ColorFrame( pDev, rRect, + bFlatBorders ? // no 3d effect + rStyleSettings.GetDarkShadowColor() : + rStyleSettings.GetLightBorderColor(), + rStyleSettings.GetDarkShadowColor() ); } @@ -956,21 +968,21 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect, if ( nFrameStyle == FRAME_DRAW_DOUBLEIN ) { if( bFlatBorders ) // no 3d effect - pDev->ImplDraw2ColorFrame( rRect, - rStyleSettings.GetFaceColor(), - rStyleSettings.GetFaceColor() ); + ImplDraw2ColorFrame( pDev, rRect, + rStyleSettings.GetFaceColor(), + rStyleSettings.GetFaceColor() ); else - pDev->ImplDraw2ColorFrame( rRect, - rStyleSettings.GetDarkShadowColor(), - rStyleSettings.GetLightBorderColor() ); + ImplDraw2ColorFrame( pDev, rRect, + rStyleSettings.GetDarkShadowColor(), + rStyleSettings.GetLightBorderColor() ); } else { // flat menues have no shadow border if( !bMenuStyle || !rStyleSettings.GetUseFlatMenues() ) - pDev->ImplDraw2ColorFrame( rRect, - rStyleSettings.GetLightColor(), - rStyleSettings.GetShadowColor() ); + ImplDraw2ColorFrame( pDev, rRect, + rStyleSettings.GetLightColor(), + rStyleSettings.GetShadowColor() ); else bDrawn = sal_False; } |