summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2014-04-25 12:39:54 +1000
committerChris Sherlock <chris.sherlock79@gmail.com>2014-04-25 13:01:36 +1000
commitda8aa9385153893d8da666b490825aecb6fe87dc (patch)
tree5f1d47329d72ab2e3dbeef31e2c0db12f4bc7014
parent927617d69a25cffffd96aed8aa14a738b2ba6983 (diff)
VCL: Reorganize and rename wallpaper functions
Grouped wallpaper functions in outdev.hxx, also changed the function names: + ImplDrawColorWallpaper -> DrawColorWallpaper + ImplDrawBitmapWallpaper -> DrawBitmapWallpaper + ImplDrawWallpaper -> DrawWallpaper Change-Id: I0eb9c21bf2f6a336df22cd27cd1557f2c795f792
-rw-r--r--include/vcl/outdev.hxx21
-rw-r--r--vcl/source/outdev/outdev.cxx2
-rw-r--r--vcl/source/outdev/wallpaper.cxx92
-rw-r--r--vcl/source/window/window.cxx4
4 files changed, 62 insertions, 57 deletions
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index e4b40ce3393c..82f6df21ada6 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -534,15 +534,19 @@ protected:
SAL_DLLPRIVATE void ImplDrawPolyPolygonWithB2DPolyPolygon(const basegfx::B2DPolyPolygon& rB2DPolyPoly);
///@}
-public:
/** @name Wallpaper functions
*/
///@{
- SAL_DLLPRIVATE void ImplDrawWallpaper( 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 );
+public:
+ void DrawWallpaper( const Rectangle& rRect, const Wallpaper& rWallpaper );
+
+private:
+ SAL_DLLPRIVATE void DrawWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
+ SAL_DLLPRIVATE void DrawColorWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
+ SAL_DLLPRIVATE void DrawBitmapWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
///@}
+private:
SAL_DLLPRIVATE void ImplDrawOutDevDirect ( const OutputDevice* pSrcDev, SalTwoRect& rPosAry );
SAL_DLLPRIVATE void ImplPrintTransparent ( const Bitmap& rBmp, const Bitmap& rMask,
@@ -553,6 +557,7 @@ public:
/** @name Frame functions
*/
///@{
+private:
SAL_DLLPRIVATE void ImplGetFrameDev ( const Point& rPt, const Point& rDevPt, const Size& rDevSize,
OutputDevice& rOutDev );
SAL_DLLPRIVATE void ImplDrawFrameDev ( const Point& rPt, const Point& rDevPt, const Size& rDevSize,
@@ -562,11 +567,13 @@ public:
/** @name Layout functions
*/
///@{
- SAL_DLLPRIVATE bool ImplIsRecordLayout() const;
- virtual bool HasMirroredGraphics() const;
+public:
+ SAL_DLLPRIVATE bool ImplIsAntiparallel() const ;
SAL_DLLPRIVATE void ReMirror( Point &rPoint ) const;
SAL_DLLPRIVATE void ReMirror( Rectangle &rRect ) const;
SAL_DLLPRIVATE void ReMirror( Region &rRegion ) const;
+ SAL_DLLPRIVATE bool ImplIsRecordLayout() const;
+ virtual bool HasMirroredGraphics() const;
SAL_DLLPRIVATE SalLayout* ImplLayout( const OUString&, sal_Int32 nIndex, sal_Int32 nLen,
const Point& rLogicPos = Point(0,0), long nLogicWidth=0,
const sal_Int32* pLogicDXArray=NULL ) const;
@@ -574,7 +581,6 @@ public:
long nPixelWidth, const sal_Int32* pPixelDXArray ) const;
SAL_DLLPRIVATE SalLayout* ImplGlyphFallbackLayout( SalLayout*, ImplLayoutArgs& ) const;
// tells whether this output device is RTL in an LTR UI or LTR in a RTL UI
- SAL_DLLPRIVATE bool ImplIsAntiparallel() const ;
SAL_DLLPRIVATE SalLayout* getFallbackFont(ImplFontEntry &rFallbackFont,
FontSelectPattern &rFontSelData, int nFallbackLevel,
ImplLayoutArgs& rLayoutArgs) const;
@@ -1486,7 +1492,6 @@ public:
///@}
public:
- void DrawWallpaper( const Rectangle& rRect, const Wallpaper& rWallpaper );
void DrawWaveLine( const Point& rStartPos, const Point& rEndPos );
void DrawGrid( const Rectangle& rRect, const Size& rDist, sal_uLong nFlags );
diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx
index 84650595b0dc..77265fb3402c 100644
--- a/vcl/source/outdev/outdev.cxx
+++ b/vcl/source/outdev/outdev.cxx
@@ -1303,7 +1303,7 @@ void OutputDevice::Erase()
RasterOp eRasterOp = GetRasterOp();
if ( eRasterOp != ROP_OVERPAINT )
SetRasterOp( ROP_OVERPAINT );
- ImplDrawWallpaper( 0, 0, mnOutWidth, mnOutHeight, maBackground );
+ DrawWallpaper( 0, 0, mnOutWidth, mnOutHeight, maBackground );
if ( eRasterOp != ROP_OVERPAINT )
SetRasterOp( eRasterOp );
}
diff --git a/vcl/source/outdev/wallpaper.cxx b/vcl/source/outdev/wallpaper.cxx
index c6624e98ec7f..757b0b25c272 100644
--- a/vcl/source/outdev/wallpaper.cxx
+++ b/vcl/source/outdev/wallpaper.cxx
@@ -22,9 +22,46 @@
#include <wall2.hxx>
-void OutputDevice::ImplDrawColorWallpaper( long nX, long nY,
- long nWidth, long nHeight,
- const Wallpaper& rWallpaper )
+void OutputDevice::DrawWallpaper( const Rectangle& rRect,
+ const Wallpaper& rWallpaper )
+{
+ if ( mpMetaFile )
+ mpMetaFile->AddAction( new MetaWallpaperAction( rRect, rWallpaper ) );
+
+ if ( !IsDeviceOutputNecessary() || ImplIsRecordLayout() )
+ return;
+
+ if ( rWallpaper.GetStyle() != WALLPAPER_NULL )
+ {
+ Rectangle aRect = LogicToPixel( rRect );
+ aRect.Justify();
+
+ if ( !aRect.IsEmpty() )
+ {
+ DrawWallpaper( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(),
+ rWallpaper );
+ }
+ }
+
+ if( mpAlphaVDev )
+ mpAlphaVDev->DrawWallpaper( rRect, rWallpaper );
+}
+
+void OutputDevice::DrawWallpaper( long nX, long nY,
+ long nWidth, long nHeight,
+ const Wallpaper& rWallpaper )
+{
+ if( rWallpaper.IsBitmap() )
+ DrawBitmapWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
+ else if( rWallpaper.IsGradient() )
+ DrawGradientWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
+ else
+ DrawColorWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
+}
+
+void OutputDevice::DrawColorWallpaper( long nX, long nY,
+ long nWidth, long nHeight,
+ const Wallpaper& rWallpaper )
{
// draw wallpaper without border
Color aOldLineColor = GetLineColor();
@@ -39,7 +76,7 @@ void OutputDevice::ImplDrawColorWallpaper( long nX, long nY,
EnableMapMode( bMap );
}
-void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY,
+void OutputDevice::DrawBitmapWallpaper( long nX, long nY,
long nWidth, long nHeight,
const Wallpaper& rWallpaper )
{
@@ -95,7 +132,7 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY,
DrawGradientWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
else if( bDrawColorBackground && bTransparent )
{
- ImplDrawColorWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
+ DrawColorWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
bDrawColorBackground = false;
}
@@ -234,7 +271,7 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY,
aWorkRect.Intersection( aColRect );
if( !aWorkRect.IsEmpty() )
{
- ImplDrawColorWallpaper( aWorkRect.Left(), aWorkRect.Top(),
+ DrawColorWallpaper( aWorkRect.Left(), aWorkRect.Top(),
aWorkRect.GetWidth(), aWorkRect.GetHeight(),
rWallpaper );
}
@@ -244,7 +281,7 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY,
aWorkRect.Intersection( aColRect );
if( !aWorkRect.IsEmpty() )
{
- ImplDrawColorWallpaper( aWorkRect.Left(), aWorkRect.Top(),
+ DrawColorWallpaper( aWorkRect.Left(), aWorkRect.Top(),
aWorkRect.GetWidth(), aWorkRect.GetHeight(),
rWallpaper );
}
@@ -254,7 +291,7 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY,
aWorkRect.Intersection( aColRect );
if( !aWorkRect.IsEmpty() )
{
- ImplDrawColorWallpaper( aWorkRect.Left(), aWorkRect.Top(),
+ DrawColorWallpaper( aWorkRect.Left(), aWorkRect.Top(),
aWorkRect.GetWidth(), aWorkRect.GetHeight(),
rWallpaper );
}
@@ -264,7 +301,7 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY,
aWorkRect.Intersection( aColRect );
if( !aWorkRect.IsEmpty() )
{
- ImplDrawColorWallpaper( aWorkRect.Left(), aWorkRect.Top(),
+ DrawColorWallpaper( aWorkRect.Left(), aWorkRect.Top(),
aWorkRect.GetWidth(), aWorkRect.GetHeight(),
rWallpaper );
}
@@ -302,41 +339,4 @@ void OutputDevice::DrawGradientWallpaper( long nX, long nY,
mpMetaFile = pOldMetaFile;
}
-void OutputDevice::ImplDrawWallpaper( long nX, long nY,
- long nWidth, long nHeight,
- const Wallpaper& rWallpaper )
-{
- if( rWallpaper.IsBitmap() )
- ImplDrawBitmapWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
- else if( rWallpaper.IsGradient() )
- DrawGradientWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
- else
- ImplDrawColorWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
-}
-
-void OutputDevice::DrawWallpaper( const Rectangle& rRect,
- const Wallpaper& rWallpaper )
-{
- if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaWallpaperAction( rRect, rWallpaper ) );
-
- if ( !IsDeviceOutputNecessary() || ImplIsRecordLayout() )
- return;
-
- if ( rWallpaper.GetStyle() != WALLPAPER_NULL )
- {
- Rectangle aRect = LogicToPixel( rRect );
- aRect.Justify();
-
- if ( !aRect.IsEmpty() )
- {
- ImplDrawWallpaper( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(),
- rWallpaper );
- }
- }
-
- if( mpAlphaVDev )
- mpAlphaVDev->DrawWallpaper( rRect, rWallpaper );
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 05875e5057e9..2747c4547de1 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -9446,7 +9446,7 @@ void Window::DrawGradientWallpaper( long nX, long nY,
if( gradientWidth > 1024 )
gradientWidth = 1024;
if( mnOutOffX+nWidth > gradientWidth )
- ImplDrawColorWallpaper( nX, nY, nWidth, nHeight, rWallpaper.GetGradient().GetEndColor() );
+ DrawColorWallpaper( nX, nY, nWidth, nHeight, rWallpaper.GetGradient().GetEndColor() );
if( mnOutOffX > gradientWidth )
bNeedGradient = false;
else
@@ -9486,7 +9486,7 @@ void Window::Erase()
RasterOp eRasterOp = GetRasterOp();
if ( eRasterOp != ROP_OVERPAINT )
SetRasterOp( ROP_OVERPAINT );
- ImplDrawWallpaper( 0, 0, mnOutWidth, mnOutHeight, maBackground );
+ DrawWallpaper( 0, 0, mnOutWidth, mnOutHeight, maBackground );
if ( eRasterOp != ROP_OVERPAINT )
SetRasterOp( eRasterOp );
}