Kaydet (Commit) 1edf28e0 authored tarafından Matteo Casalin's avatar Matteo Casalin Kaydeden (comit) Tor Lillqvist

DecoView cleanup - Embed OutputDevice::ImplDraw2ColorFrame

üst 7a6941d7
...@@ -489,7 +489,6 @@ public: ...@@ -489,7 +489,6 @@ public:
SAL_DLLPRIVATE void ImplDrawColorWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper ); 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 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 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 ImplDrawOutDevDirect( const OutputDevice* pSrcDev, void* pPosAry );
SAL_DLLPRIVATE void ImplDrawBitmap( const Point& rDestPt, const Size& rDestSize, SAL_DLLPRIVATE void ImplDrawBitmap( const Point& rDestPt, const Size& rDestSize,
......
...@@ -1170,20 +1170,6 @@ void OutputDevice::Erase() ...@@ -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, bool OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize,
const GfxLink& rGfxLink, GDIMetaFile* pSubst ) const GfxLink& rGfxLink, GDIMetaFile* pSubst )
{ {
......
...@@ -481,6 +481,18 @@ void ImplDrawDPILineRect( OutputDevice *const pDev, Rectangle& rRect, ...@@ -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, void ImplDrawButton( OutputDevice *const pDev, Rectangle aFillRect,
const sal_uInt16 nStyle ) const sal_uInt16 nStyle )
{ {
...@@ -599,7 +611,7 @@ void ImplDrawButton( OutputDevice *const pDev, Rectangle aFillRect, ...@@ -599,7 +611,7 @@ void ImplDrawButton( OutputDevice *const pDev, Rectangle aFillRect,
pDev->SetLineColor(); pDev->SetLineColor();
pDev->ImplDraw2ColorFrame( aFillRect, aColor1, aColor2 ); ImplDraw2ColorFrame( pDev, aFillRect, aColor1, aColor2 );
++aFillRect.Left(); ++aFillRect.Left();
++aFillRect.Top(); ++aFillRect.Top();
--aFillRect.Right(); --aFillRect.Right();
...@@ -620,7 +632,7 @@ void ImplDrawButton( OutputDevice *const pDev, Rectangle aFillRect, ...@@ -620,7 +632,7 @@ void ImplDrawButton( OutputDevice *const pDev, Rectangle aFillRect,
aColor1 = rStyleSettings.GetLightBorderColor(); aColor1 = rStyleSettings.GetLightBorderColor();
aColor2 = rStyleSettings.GetShadowColor(); aColor2 = rStyleSettings.GetShadowColor();
} }
pDev->ImplDraw2ColorFrame( aFillRect, aColor1, aColor2 ); ImplDraw2ColorFrame( pDev, aFillRect, aColor1, aColor2 );
++aFillRect.Left(); ++aFillRect.Left();
++aFillRect.Top(); ++aFillRect.Top();
--aFillRect.Right(); --aFillRect.Right();
...@@ -698,7 +710,7 @@ void DecorationView::DrawFrame( const Rectangle& rRect, ...@@ -698,7 +710,7 @@ void DecorationView::DrawFrame( const Rectangle& rRect,
sal_Bool bOldMapMode = mpOutDev->IsMapModeEnabled(); sal_Bool bOldMapMode = mpOutDev->IsMapModeEnabled();
mpOutDev->EnableMapMode( sal_False ); mpOutDev->EnableMapMode( sal_False );
mpOutDev->SetLineColor(); mpOutDev->SetLineColor();
mpOutDev->ImplDraw2ColorFrame( aRect, rLeftTopColor, rRightBottomColor ); ImplDraw2ColorFrame( mpOutDev, aRect, rLeftTopColor, rRightBottomColor );
mpOutDev->SetLineColor( aOldLineColor ); mpOutDev->SetLineColor( aOldLineColor );
mpOutDev->SetFillColor( aOldFillColor ); mpOutDev->SetFillColor( aOldFillColor );
mpOutDev->EnableMapMode( bOldMapMode ); mpOutDev->EnableMapMode( bOldMapMode );
...@@ -903,15 +915,15 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect, ...@@ -903,15 +915,15 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
{ {
if ( nFrameStyle == FRAME_DRAW_IN ) if ( nFrameStyle == FRAME_DRAW_IN )
{ {
pDev->ImplDraw2ColorFrame( rRect, ImplDraw2ColorFrame( pDev, rRect,
rStyleSettings.GetShadowColor(), rStyleSettings.GetShadowColor(),
rStyleSettings.GetLightColor() ); rStyleSettings.GetLightColor() );
} }
else else
{ {
pDev->ImplDraw2ColorFrame( rRect, ImplDraw2ColorFrame( pDev, rRect,
rStyleSettings.GetLightColor(), rStyleSettings.GetLightColor(),
rStyleSettings.GetShadowColor() ); rStyleSettings.GetShadowColor() );
} }
rRect.Left()++; rRect.Left()++;
...@@ -924,26 +936,26 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect, ...@@ -924,26 +936,26 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
if ( nFrameStyle == FRAME_DRAW_DOUBLEIN ) if ( nFrameStyle == FRAME_DRAW_DOUBLEIN )
{ {
if( bFlatBorders ) // no 3d effect if( bFlatBorders ) // no 3d effect
pDev->ImplDraw2ColorFrame( rRect, ImplDraw2ColorFrame( pDev, rRect,
rStyleSettings.GetShadowColor(), rStyleSettings.GetShadowColor(),
rStyleSettings.GetShadowColor() ); rStyleSettings.GetShadowColor() );
else else
pDev->ImplDraw2ColorFrame( rRect, ImplDraw2ColorFrame( pDev, rRect,
rStyleSettings.GetShadowColor(), rStyleSettings.GetShadowColor(),
rStyleSettings.GetLightColor() ); rStyleSettings.GetLightColor() );
} }
else else
{ {
if( bMenuStyle ) if( bMenuStyle )
pDev->ImplDraw2ColorFrame( rRect, ImplDraw2ColorFrame( pDev, rRect,
rStyleSettings.GetMenuBorderColor(), rStyleSettings.GetMenuBorderColor(),
rStyleSettings.GetDarkShadowColor() ); rStyleSettings.GetDarkShadowColor() );
else else
pDev->ImplDraw2ColorFrame( rRect, ImplDraw2ColorFrame( pDev, rRect,
bFlatBorders ? // no 3d effect bFlatBorders ? // no 3d effect
rStyleSettings.GetDarkShadowColor() : rStyleSettings.GetDarkShadowColor() :
rStyleSettings.GetLightBorderColor(), rStyleSettings.GetLightBorderColor(),
rStyleSettings.GetDarkShadowColor() ); rStyleSettings.GetDarkShadowColor() );
} }
...@@ -956,21 +968,21 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect, ...@@ -956,21 +968,21 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
if ( nFrameStyle == FRAME_DRAW_DOUBLEIN ) if ( nFrameStyle == FRAME_DRAW_DOUBLEIN )
{ {
if( bFlatBorders ) // no 3d effect if( bFlatBorders ) // no 3d effect
pDev->ImplDraw2ColorFrame( rRect, ImplDraw2ColorFrame( pDev, rRect,
rStyleSettings.GetFaceColor(), rStyleSettings.GetFaceColor(),
rStyleSettings.GetFaceColor() ); rStyleSettings.GetFaceColor() );
else else
pDev->ImplDraw2ColorFrame( rRect, ImplDraw2ColorFrame( pDev, rRect,
rStyleSettings.GetDarkShadowColor(), rStyleSettings.GetDarkShadowColor(),
rStyleSettings.GetLightBorderColor() ); rStyleSettings.GetLightBorderColor() );
} }
else else
{ {
// flat menues have no shadow border // flat menues have no shadow border
if( !bMenuStyle || !rStyleSettings.GetUseFlatMenues() ) if( !bMenuStyle || !rStyleSettings.GetUseFlatMenues() )
pDev->ImplDraw2ColorFrame( rRect, ImplDraw2ColorFrame( pDev, rRect,
rStyleSettings.GetLightColor(), rStyleSettings.GetLightColor(),
rStyleSettings.GetShadowColor() ); rStyleSettings.GetShadowColor() );
else else
bDrawn = sal_False; bDrawn = sal_False;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment