summaryrefslogtreecommitdiff
path: root/vcl
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 /vcl
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
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/outdev/outdev.cxx2
-rw-r--r--vcl/source/outdev/wallpaper.cxx92
-rw-r--r--vcl/source/window/window.cxx4
3 files changed, 49 insertions, 49 deletions
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 );
}