summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drawinglayer/source/primitive2d/metafileprimitive2d.cxx4
-rw-r--r--drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx28
-rw-r--r--editeng/source/items/frmitems.cxx50
-rw-r--r--include/vcl/wall.hxx51
-rw-r--r--sfx2/source/dialog/backingwindow.cxx2
-rw-r--r--sfx2/source/doc/frmdescr.cxx2
-rw-r--r--svtools/source/contnr/ivctrl.cxx4
-rw-r--r--toolkit/source/awt/vclxwindows.cxx6
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx24
-rw-r--r--vcl/source/gdi/wall.cxx32
-rw-r--r--vcl/source/outdev/outdevstate.cxx2
-rw-r--r--vcl/source/outdev/wallpaper.cxx26
-rw-r--r--vcl/source/window/dockingarea.cxx6
-rw-r--r--vcl/source/window/menubarwindow.cxx4
-rw-r--r--vcl/workben/vcldemo.cxx2
15 files changed, 111 insertions, 132 deletions
diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
index 25854db1f9c4..09bc2cc99247 100644
--- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
@@ -1149,7 +1149,7 @@ namespace
// if bitmap visualisation is transparent, maybe background
// needs to be filled. Create background
if(aBitmapEx.IsTransparent()
- || (WALLPAPER_TILE != eWallpaperStyle && WALLPAPER_SCALE != eWallpaperStyle))
+ || (WallpaperStyle::Tile != eWallpaperStyle && WallpaperStyle::Scale != eWallpaperStyle))
{
if(rWallpaper.IsGradient())
{
@@ -2375,7 +2375,7 @@ namespace
aWallpaperRectangle.Left(), aWallpaperRectangle.Top(),
aWallpaperRectangle.Right(), aWallpaperRectangle.Bottom());
- if(WALLPAPER_NULL != eWallpaperStyle)
+ if(WallpaperStyle::NONE != eWallpaperStyle)
{
if(rWallpaper.IsBitmap())
{
diff --git a/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx b/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx
index 63d8f7ef02f9..4f631c9788f1 100644
--- a/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx
@@ -44,7 +44,7 @@ namespace drawinglayer
if(rPixelSize.Width() > 0 && rPixelSize.Height() > 0)
{
- if(WALLPAPER_SCALE == getWallpaperStyle())
+ if(WallpaperStyle::Scale == getWallpaperStyle())
{
// shortcut for scale; use simple BitmapPrimitive2D
basegfx::B2DHomMatrix aObjectTransform;
@@ -76,64 +76,64 @@ namespace drawinglayer
switch(getWallpaperStyle())
{
- default: //case WALLPAPER_TILE :, also WALLPAPER_NULL and WALLPAPER_APPLICATIONGRADIENT
+ default: //case WallpaperStyle::Tile :, also WallpaperStyle::NONE and WallpaperStyle::ApplicationGradient
{
bUseTargetTopLeft = false;
break;
}
- case WALLPAPER_SCALE :
+ case WallpaperStyle::Scale :
{
// handled by shortcut above
break;
}
- case WALLPAPER_TOPLEFT :
+ case WallpaperStyle::TopLeft :
{
// nothing to do
break;
}
- case WALLPAPER_TOP :
+ case WallpaperStyle::Top :
{
const basegfx::B2DPoint aCenter(getLocalObjectRange().getCenter());
aTargetTopLeft.setX(aCenter.getX() - (aLogicSize.getX() * 0.5));
break;
}
- case WALLPAPER_TOPRIGHT :
+ case WallpaperStyle::TopRight :
{
aTargetTopLeft.setX(getLocalObjectRange().getMaxX() - aLogicSize.getX());
break;
}
- case WALLPAPER_LEFT :
+ case WallpaperStyle::Left :
{
const basegfx::B2DPoint aCenter(getLocalObjectRange().getCenter());
aTargetTopLeft.setY(aCenter.getY() - (aLogicSize.getY() * 0.5));
break;
}
- case WALLPAPER_CENTER :
+ case WallpaperStyle::Center :
{
const basegfx::B2DPoint aCenter(getLocalObjectRange().getCenter());
aTargetTopLeft = aCenter - (aLogicSize * 0.5);
break;
}
- case WALLPAPER_RIGHT :
+ case WallpaperStyle::Right :
{
const basegfx::B2DPoint aCenter(getLocalObjectRange().getCenter());
aTargetTopLeft.setX(getLocalObjectRange().getMaxX() - aLogicSize.getX());
aTargetTopLeft.setY(aCenter.getY() - (aLogicSize.getY() * 0.5));
break;
}
- case WALLPAPER_BOTTOMLEFT :
+ case WallpaperStyle::BottomLeft :
{
aTargetTopLeft.setY(getLocalObjectRange().getMaxY() - aLogicSize.getY());
break;
}
- case WALLPAPER_BOTTOM :
+ case WallpaperStyle::Bottom :
{
const basegfx::B2DPoint aCenter(getLocalObjectRange().getCenter());
aTargetTopLeft.setX(aCenter.getX() - (aLogicSize.getX() * 0.5));
aTargetTopLeft.setY(getLocalObjectRange().getMaxY() - aLogicSize.getY());
break;
}
- case WALLPAPER_BOTTOMRIGHT :
+ case WallpaperStyle::BottomRight :
{
aTargetTopLeft = getLocalObjectRange().getMaximum() - aLogicSize;
break;
@@ -164,14 +164,14 @@ namespace drawinglayer
}
else
{
- // WALLPAPER_TILE, WALLPAPER_NULL, WALLPAPER_APPLICATIONGRADIENT
+ // WallpaperStyle::Tile, WallpaperStyle::NONE, WallpaperStyle::ApplicationGradient
// convert to relative positions
const basegfx::B2DVector aRelativeSize(
aLogicSize.getX() / (getLocalObjectRange().getWidth() ? getLocalObjectRange().getWidth() : 1.0),
aLogicSize.getY() / (getLocalObjectRange().getHeight() ? getLocalObjectRange().getHeight() : 1.0));
basegfx::B2DPoint aRelativeTopLeft(0.0, 0.0);
- if(WALLPAPER_TILE != getWallpaperStyle())
+ if(WallpaperStyle::Tile != getWallpaperStyle())
{
aRelativeTopLeft.setX(0.5 - aRelativeSize.getX());
aRelativeTopLeft.setY(0.5 - aRelativeSize.getY());
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index b0b61af5d94b..ba042d9a6ed7 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -4069,18 +4069,18 @@ SvxGraphicPosition SvxBrushItem::WallpaperStyle2GraphicPos( WallpaperStyle eStyl
// The switch is not the fastest, but the safest
switch( eStyle )
{
- case WALLPAPER_NULL: eResult = GPOS_NONE; break;
- case WALLPAPER_TILE: eResult = GPOS_TILED; break;
- case WALLPAPER_CENTER: eResult = GPOS_MM; break;
- case WALLPAPER_SCALE: eResult = GPOS_AREA; break;
- case WALLPAPER_TOPLEFT: eResult = GPOS_LT; break;
- case WALLPAPER_TOP: eResult = GPOS_MT; break;
- case WALLPAPER_TOPRIGHT: eResult = GPOS_RT; break;
- case WALLPAPER_LEFT: eResult = GPOS_LM; break;
- case WALLPAPER_RIGHT: eResult = GPOS_RM; break;
- case WALLPAPER_BOTTOMLEFT: eResult = GPOS_LB; break;
- case WALLPAPER_BOTTOM: eResult = GPOS_MB; break;
- case WALLPAPER_BOTTOMRIGHT: eResult = GPOS_RB; break;
+ case WallpaperStyle::NONE: eResult = GPOS_NONE; break;
+ case WallpaperStyle::Tile: eResult = GPOS_TILED; break;
+ case WallpaperStyle::Center: eResult = GPOS_MM; break;
+ case WallpaperStyle::Scale: eResult = GPOS_AREA; break;
+ case WallpaperStyle::TopLeft: eResult = GPOS_LT; break;
+ case WallpaperStyle::Top: eResult = GPOS_MT; break;
+ case WallpaperStyle::TopRight: eResult = GPOS_RT; break;
+ case WallpaperStyle::Left: eResult = GPOS_LM; break;
+ case WallpaperStyle::Right: eResult = GPOS_RM; break;
+ case WallpaperStyle::BottomLeft: eResult = GPOS_LB; break;
+ case WallpaperStyle::Bottom: eResult = GPOS_MB; break;
+ case WallpaperStyle::BottomRight: eResult = GPOS_RB; break;
default: eResult = GPOS_NONE;
}
return eResult;
@@ -4092,19 +4092,19 @@ WallpaperStyle SvxBrushItem::GraphicPos2WallpaperStyle( SvxGraphicPosition ePos
WallpaperStyle eResult;
switch( ePos )
{
- case GPOS_NONE: eResult = WALLPAPER_NULL; break;
- case GPOS_TILED: eResult = WALLPAPER_TILE; break;
- case GPOS_MM: eResult = WALLPAPER_CENTER; break;
- case GPOS_AREA: eResult = WALLPAPER_SCALE; break;
- case GPOS_LT: eResult = WALLPAPER_TOPLEFT; break;
- case GPOS_MT: eResult = WALLPAPER_TOP; break;
- case GPOS_RT: eResult = WALLPAPER_TOPRIGHT; break;
- case GPOS_LM: eResult = WALLPAPER_LEFT; break;
- case GPOS_RM: eResult = WALLPAPER_RIGHT; break;
- case GPOS_LB: eResult = WALLPAPER_BOTTOMLEFT; break;
- case GPOS_MB: eResult = WALLPAPER_BOTTOM; break;
- case GPOS_RB: eResult = WALLPAPER_BOTTOMRIGHT; break;
- default: eResult = WALLPAPER_NULL;
+ case GPOS_NONE: eResult = WallpaperStyle::NONE; break;
+ case GPOS_TILED: eResult = WallpaperStyle::Tile; break;
+ case GPOS_MM: eResult = WallpaperStyle::Center; break;
+ case GPOS_AREA: eResult = WallpaperStyle::Scale; break;
+ case GPOS_LT: eResult = WallpaperStyle::TopLeft; break;
+ case GPOS_MT: eResult = WallpaperStyle::Top; break;
+ case GPOS_RT: eResult = WallpaperStyle::TopRight; break;
+ case GPOS_LM: eResult = WallpaperStyle::Left; break;
+ case GPOS_RM: eResult = WallpaperStyle::Right; break;
+ case GPOS_LB: eResult = WallpaperStyle::BottomLeft; break;
+ case GPOS_MB: eResult = WallpaperStyle::Bottom; break;
+ case GPOS_RB: eResult = WallpaperStyle::BottomRight; break;
+ default: eResult = WallpaperStyle::NONE;
}
return eResult;
}
diff --git a/include/vcl/wall.hxx b/include/vcl/wall.hxx
index 206e5fb88194..f727dc7d27cc 100644
--- a/include/vcl/wall.hxx
+++ b/include/vcl/wall.hxx
@@ -28,45 +28,24 @@ class Gradient;
class BitmapEx;
class ImplWallpaper;
-#define WALLPAPER_NULL WallpaperStyle_NULL
-#define WALLPAPER_TILE WallpaperStyle_TILE
-#define WALLPAPER_CENTER WallpaperStyle_CENTER
-#define WALLPAPER_SCALE WallpaperStyle_SCALE
-#define WALLPAPER_TOPLEFT WallpaperStyle_TOPLEFT
-#define WALLPAPER_TOP WallpaperStyle_TOP
-#define WALLPAPER_TOPRIGHT WallpaperStyle_TOPRIGHT
-#define WALLPAPER_LEFT WallpaperStyle_LEFT
-#define WALLPAPER_RIGHT WallpaperStyle_RIGHT
-#define WALLPAPER_BOTTOMLEFT WallpaperStyle_BOTTOMLEFT
-#define WALLPAPER_BOTTOM WallpaperStyle_BOTTOM
-#define WALLPAPER_BOTTOMRIGHT WallpaperStyle_BOTTOMRIGHT
-#define WALLPAPER_APPLICATIONGRADIENT WallpaperStyle_APPLICATIONGRADIENT
-#define WALLPAPER_FORCE_EQUAL_SIZE WallpaperStyle_FORCE_EQUAL_SIZE
-
-#ifndef ENUM_WALLPAPERSTYLE_DECLARED
-#define ENUM_WALLPAPERSTYLE_DECLARED
-
-enum WallpaperStyle
+enum class WallpaperStyle
{
- WALLPAPER_NULL,
- WALLPAPER_TILE,
- WALLPAPER_CENTER,
- WALLPAPER_SCALE,
- WALLPAPER_TOPLEFT,
- WALLPAPER_TOP,
- WALLPAPER_TOPRIGHT,
- WALLPAPER_LEFT,
- WALLPAPER_RIGHT,
- WALLPAPER_BOTTOMLEFT,
- WALLPAPER_BOTTOM,
- WALLPAPER_BOTTOMRIGHT,
- WALLPAPER_APPLICATIONGRADIENT, // defines a gradient that internally covers the whole application
- // and uses a color derived from the face color
- WALLPAPER_FORCE_EQUAL_SIZE = 0x7fffffff
+ NONE,
+ Tile,
+ Center,
+ Scale,
+ TopLeft,
+ Top,
+ TopRight,
+ Left,
+ Right,
+ BottomLeft,
+ Bottom,
+ BottomRight,
+ ApplicationGradient // defines a gradient that internally covers the whole application
+ // and uses a color derived from the face color
};
-#endif
-
class VCL_DLLPUBLIC Wallpaper
{
private:
diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx
index e26879060bd8..d267e3b97dc6 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -322,7 +322,7 @@ void BackingWindow::initControls()
// motif image under the buttons
Wallpaper aWallpaper(get<FixedImage>("motif")->GetImage().GetBitmapEx());
- aWallpaper.SetStyle(WALLPAPER_BOTTOMRIGHT);
+ aWallpaper.SetStyle(WallpaperStyle::BottomRight);
aWallpaper.SetColor(aButtonsBackground);
mpButtonsBox->SetBackground(aWallpaper);
diff --git a/sfx2/source/doc/frmdescr.cxx b/sfx2/source/doc/frmdescr.cxx
index 3a257c63c30a..d3a2ba07534e 100644
--- a/sfx2/source/doc/frmdescr.cxx
+++ b/sfx2/source/doc/frmdescr.cxx
@@ -139,7 +139,7 @@ void SfxFrameDescriptor::SetWallpaper( const Wallpaper& rWallpaper )
{
DELETEZ( pImp->pWallpaper );
- if ( rWallpaper.GetStyle() != WALLPAPER_NULL )
+ if ( rWallpaper.GetStyle() != WallpaperStyle::NONE )
pImp->pWallpaper = new Wallpaper( rWallpaper );
}
diff --git a/svtools/source/contnr/ivctrl.cxx b/svtools/source/contnr/ivctrl.cxx
index 73e5c5e6959b..01b76a4eb9b9 100644
--- a/svtools/source/contnr/ivctrl.cxx
+++ b/svtools/source/contnr/ivctrl.cxx
@@ -371,7 +371,7 @@ void SvtIconChoiceCtrl::SetBackground( const Wallpaper& rPaper )
Wallpaper aBackground( rPaper );
// HACK, as background might be transparent!
if( !aBackground.IsBitmap() )
- aBackground.SetStyle( WALLPAPER_TILE );
+ aBackground.SetStyle( WallpaperStyle::Tile );
WallpaperStyle eStyle = aBackground.GetStyle();
Color aBack( aBackground.GetColor());
@@ -379,7 +379,7 @@ void SvtIconChoiceCtrl::SetBackground( const Wallpaper& rPaper )
if( aBack == aTrans && (
(!aBackground.IsBitmap() ||
aBackground.GetBitmap().IsTransparent() ||
- (eStyle != WALLPAPER_TILE && eStyle != WALLPAPER_SCALE))))
+ (eStyle != WallpaperStyle::Tile && eStyle != WallpaperStyle::Scale))))
{
aBackground.SetColor( rStyleSettings.GetFieldColor() );
}
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx
index c24324f1b799..ad9f9d2300e7 100644
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@ -2397,7 +2397,7 @@ throw(::com::sun::star::uno::RuntimeException, std::exception)
Image aImage( xGraphic );
Wallpaper aWallpaper( aImage.GetBitmapEx());
- aWallpaper.SetStyle( WALLPAPER_SCALE );
+ aWallpaper.SetStyle( WallpaperStyle::Scale );
pDialog->SetBackground( aWallpaper );
}
else if ( bVoid || !xGraphic.is() )
@@ -2561,7 +2561,7 @@ throw(::com::sun::star::uno::RuntimeException, std::exception)
Image aImage( xGraphic );
Wallpaper aWallpaper( aImage.GetBitmapEx());
- aWallpaper.SetStyle( WALLPAPER_SCALE );
+ aWallpaper.SetStyle( WallpaperStyle::Scale );
pTabControl->SetBackground( aWallpaper );
}
else if ( bVoid || !xGraphic.is() )
@@ -2803,7 +2803,7 @@ throw(::com::sun::star::uno::RuntimeException, std::exception)
Image aImage( xGraphic );
Wallpaper aWallpaper( aImage.GetBitmapEx());
- aWallpaper.SetStyle( WALLPAPER_SCALE );
+ aWallpaper.SetStyle( WallpaperStyle::Scale );
pTabPage->SetBackground( aWallpaper );
}
else if ( bVoid || !xGraphic.is() )
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 70a150263f4b..cd1109189aa0 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -348,7 +348,7 @@ void doTestCode()
aWriter.NewPage( 595, 842 );
aWriter.SetMapMode( MapMode( MAP_100TH_MM ) );
Wallpaper aWall( aTransMask );
- aWall.SetStyle( WALLPAPER_TILE );
+ aWall.SetStyle( WallpaperStyle::Tile );
aWriter.DrawWallpaper( Rectangle( Point( 4400, 4200 ), Size( 10200, 6300 ) ), aWall );
aWriter.NewPage( 595, 842 );
@@ -11823,9 +11823,9 @@ void PDFWriterImpl::drawWallpaper( const Rectangle& rRect, const Wallpaper& rWal
aBmpPos = aRect.TopLeft();
aBmpSize = aRect.GetSize();
}
- if( rWall.GetStyle() != WALLPAPER_SCALE )
+ if( rWall.GetStyle() != WallpaperStyle::Scale )
{
- if( rWall.GetStyle() != WALLPAPER_TILE )
+ if( rWall.GetStyle() != WallpaperStyle::Tile )
{
bDrawBitmap = true;
if( rWall.IsGradient() )
@@ -11834,33 +11834,33 @@ void PDFWriterImpl::drawWallpaper( const Rectangle& rRect, const Wallpaper& rWal
bDrawColor = true;
switch( rWall.GetStyle() )
{
- case WALLPAPER_TOPLEFT:
+ case WallpaperStyle::TopLeft:
break;
- case WALLPAPER_TOP:
+ case WallpaperStyle::Top:
aBmpPos.X() += (aRect.GetWidth()-aBmpSize.Width())/2;
break;
- case WALLPAPER_LEFT:
+ case WallpaperStyle::Left:
aBmpPos.Y() += (aRect.GetHeight()-aBmpSize.Height())/2;
break;
- case WALLPAPER_TOPRIGHT:
+ case WallpaperStyle::TopRight:
aBmpPos.X() += aRect.GetWidth()-aBmpSize.Width();
break;
- case WALLPAPER_CENTER:
+ case WallpaperStyle::Center:
aBmpPos.X() += (aRect.GetWidth()-aBmpSize.Width())/2;
aBmpPos.Y() += (aRect.GetHeight()-aBmpSize.Height())/2;
break;
- case WALLPAPER_RIGHT:
+ case WallpaperStyle::Right:
aBmpPos.X() += aRect.GetWidth()-aBmpSize.Width();
aBmpPos.Y() += (aRect.GetHeight()-aBmpSize.Height())/2;
break;
- case WALLPAPER_BOTTOMLEFT:
+ case WallpaperStyle::BottomLeft:
aBmpPos.Y() += aRect.GetHeight()-aBmpSize.Height();
break;
- case WALLPAPER_BOTTOM:
+ case WallpaperStyle::Bottom:
aBmpPos.X() += (aRect.GetWidth()-aBmpSize.Width())/2;
aBmpPos.Y() += aRect.GetHeight()-aBmpSize.Height();
break;
- case WALLPAPER_BOTTOMRIGHT:
+ case WallpaperStyle::BottomRight:
aBmpPos.X() += aRect.GetWidth()-aBmpSize.Width();
aBmpPos.Y() += aRect.GetHeight()-aBmpSize.Height();
break;
diff --git a/vcl/source/gdi/wall.cxx b/vcl/source/gdi/wall.cxx
index 847a5a1a34be..e462f2d37de5 100644
--- a/vcl/source/gdi/wall.cxx
+++ b/vcl/source/gdi/wall.cxx
@@ -36,7 +36,7 @@ ImplWallpaper::ImplWallpaper() :
mpCache = NULL;
mpGradient = NULL;
mpRect = NULL;
- meStyle = WALLPAPER_NULL;
+ meStyle = WallpaperStyle::NONE;
}
ImplWallpaper::ImplWallpaper( const ImplWallpaper& rImplWallpaper ) :
@@ -148,7 +148,7 @@ SvStream& WriteImplWallpaper( SvStream& rOStm, const ImplWallpaper& rImplWallpap
// version 1
WriteColor( rOStm, rImplWallpaper.maColor );
- rOStm.WriteUInt16( rImplWallpaper.meStyle );
+ rOStm.WriteUInt16( static_cast<sal_uInt16>(rImplWallpaper.meStyle) );
// version 2
rOStm.WriteBool( bRect ).WriteBool( bGrad ).WriteBool( bBmp ).WriteBool( bDummy ).WriteBool( bDummy ).WriteBool( bDummy );
@@ -207,7 +207,7 @@ Wallpaper::Wallpaper( const Color& rColor )
mpImplWallpaper = new ImplWallpaper;
mpImplWallpaper->maColor = rColor;
- mpImplWallpaper->meStyle = WALLPAPER_TILE;
+ mpImplWallpaper->meStyle = WallpaperStyle::Tile;
}
Wallpaper::Wallpaper( const BitmapEx& rBmpEx )
@@ -215,7 +215,7 @@ Wallpaper::Wallpaper( const BitmapEx& rBmpEx )
mpImplWallpaper = new ImplWallpaper;
mpImplWallpaper->mpBitmap = new BitmapEx( rBmpEx );
- mpImplWallpaper->meStyle = WALLPAPER_TILE;
+ mpImplWallpaper->meStyle = WallpaperStyle::Tile;
}
Wallpaper::Wallpaper( const Gradient& rGradient )
@@ -223,7 +223,7 @@ Wallpaper::Wallpaper( const Gradient& rGradient )
mpImplWallpaper = new ImplWallpaper;
mpImplWallpaper->mpGradient = new Gradient( rGradient );
- mpImplWallpaper->meStyle = WALLPAPER_TILE;
+ mpImplWallpaper->meStyle = WallpaperStyle::Tile;
}
Wallpaper::~Wallpaper()
@@ -245,8 +245,8 @@ void Wallpaper::SetColor( const Color& rColor )
ImplMakeUnique();
mpImplWallpaper->maColor = rColor;
- if( WALLPAPER_NULL == mpImplWallpaper->meStyle || WALLPAPER_APPLICATIONGRADIENT == mpImplWallpaper->meStyle )
- mpImplWallpaper->meStyle = WALLPAPER_TILE;
+ if( WallpaperStyle::NONE == mpImplWallpaper->meStyle || WallpaperStyle::ApplicationGradient == mpImplWallpaper->meStyle )
+ mpImplWallpaper->meStyle = WallpaperStyle::Tile;
}
const Color& Wallpaper::GetColor() const
@@ -260,7 +260,7 @@ void Wallpaper::SetStyle( WallpaperStyle eStyle )
ImplMakeUnique( false );
- if( eStyle == WALLPAPER_APPLICATIONGRADIENT )
+ if( eStyle == WallpaperStyle::ApplicationGradient )
// set a dummy gradient, the correct gradient
// will be created dynamically in GetGradient()
SetGradient( ImplGetApplicationGradient() );
@@ -295,8 +295,8 @@ void Wallpaper::SetBitmap( const BitmapEx& rBitmap )
mpImplWallpaper->mpBitmap = new BitmapEx( rBitmap );
}
- if( WALLPAPER_NULL == mpImplWallpaper->meStyle || WALLPAPER_APPLICATIONGRADIENT == mpImplWallpaper->meStyle)
- mpImplWallpaper->meStyle = WALLPAPER_TILE;
+ if( WallpaperStyle::NONE == mpImplWallpaper->meStyle || WallpaperStyle::ApplicationGradient == mpImplWallpaper->meStyle)
+ mpImplWallpaper->meStyle = WallpaperStyle::Tile;
}
BitmapEx Wallpaper::GetBitmap() const
@@ -327,14 +327,14 @@ void Wallpaper::SetGradient( const Gradient& rGradient )
else
mpImplWallpaper->mpGradient = new Gradient( rGradient );
- if( WALLPAPER_NULL == mpImplWallpaper->meStyle || WALLPAPER_APPLICATIONGRADIENT == mpImplWallpaper->meStyle )
- mpImplWallpaper->meStyle = WALLPAPER_TILE;
+ if( WallpaperStyle::NONE == mpImplWallpaper->meStyle || WallpaperStyle::ApplicationGradient == mpImplWallpaper->meStyle )
+ mpImplWallpaper->meStyle = WallpaperStyle::Tile;
}
Gradient Wallpaper::GetGradient() const
{
- if( WALLPAPER_APPLICATIONGRADIENT == mpImplWallpaper->meStyle )
+ if( WallpaperStyle::ApplicationGradient == mpImplWallpaper->meStyle )
return ImplGetApplicationGradient();
else if ( mpImplWallpaper->mpGradient )
return *(mpImplWallpaper->mpGradient);
@@ -407,7 +407,7 @@ bool Wallpaper::IsRect() const
bool Wallpaper::IsFixed() const
{
- if ( mpImplWallpaper->meStyle == WALLPAPER_NULL )
+ if ( mpImplWallpaper->meStyle == WallpaperStyle::NONE )
return false;
else
return (!mpImplWallpaper->mpBitmap && !mpImplWallpaper->mpGradient);
@@ -415,12 +415,12 @@ bool Wallpaper::IsFixed() const
bool Wallpaper::IsScrollable() const
{
- if ( mpImplWallpaper->meStyle == WALLPAPER_NULL )
+ if ( mpImplWallpaper->meStyle == WallpaperStyle::NONE )
return false;
else if ( !mpImplWallpaper->mpBitmap && !mpImplWallpaper->mpGradient )
return true;
else if ( mpImplWallpaper->mpBitmap )
- return (mpImplWallpaper->meStyle == WALLPAPER_TILE);
+ return (mpImplWallpaper->meStyle == WallpaperStyle::Tile);
else
return false;
}
diff --git a/vcl/source/outdev/outdevstate.cxx b/vcl/source/outdev/outdevstate.cxx
index e1c649807a6a..ad8e8aef9f1d 100644
--- a/vcl/source/outdev/outdevstate.cxx
+++ b/vcl/source/outdev/outdevstate.cxx
@@ -466,7 +466,7 @@ void OutputDevice::SetBackground( const Wallpaper& rBackground )
maBackground = rBackground;
- if( rBackground.GetStyle() == WALLPAPER_NULL )
+ if( rBackground.GetStyle() == WallpaperStyle::NONE )
mbBackground = false;
else
mbBackground = true;
diff --git a/vcl/source/outdev/wallpaper.cxx b/vcl/source/outdev/wallpaper.cxx
index adf935a57329..175f0d199eda 100644
--- a/vcl/source/outdev/wallpaper.cxx
+++ b/vcl/source/outdev/wallpaper.cxx
@@ -36,7 +36,7 @@ void OutputDevice::DrawWallpaper( const Rectangle& rRect,
if ( !IsDeviceOutputNecessary() || ImplIsRecordLayout() )
return;
- if ( rWallpaper.GetStyle() != WALLPAPER_NULL )
+ if ( rWallpaper.GetStyle() != WallpaperStyle::NONE )
{
Rectangle aRect = LogicToPixel( rRect );
aRect.Justify();
@@ -150,7 +150,7 @@ void OutputDevice::DrawBitmapWallpaper( long nX, long nY,
bDrawColorBackground = true;
}
}
- else if( eStyle != WALLPAPER_TILE && eStyle != WALLPAPER_SCALE )
+ else if( eStyle != WallpaperStyle::Tile && eStyle != WallpaperStyle::Scale )
{
if( rWallpaper.IsGradient() )
bDrawGradientBackground = true;
@@ -187,7 +187,7 @@ void OutputDevice::DrawBitmapWallpaper( long nX, long nY,
switch( eStyle )
{
- case( WALLPAPER_SCALE ):
+ case( WallpaperStyle::Scale ):
if( !pCached || ( pCached->GetSizePixel() != aSize ) )
{
if( pCached )
@@ -199,41 +199,41 @@ void OutputDevice::DrawBitmapWallpaper( long nX, long nY,
}
break;
- case( WALLPAPER_TOPLEFT ):
+ case( WallpaperStyle::TopLeft ):
break;
- case( WALLPAPER_TOP ):
+ case( WallpaperStyle::Top ):
aPos.X() += ( aSize.Width() - nBmpWidth ) >> 1;
break;
- case( WALLPAPER_TOPRIGHT ):
+ case( WallpaperStyle::TopRight ):
aPos.X() += ( aSize.Width() - nBmpWidth );
break;
- case( WALLPAPER_LEFT ):
+ case( WallpaperStyle::Left ):
aPos.Y() += ( aSize.Height() - nBmpHeight ) >> 1;
break;
- case( WALLPAPER_CENTER ):
+ case( WallpaperStyle::Center ):
aPos.X() += ( aSize.Width() - nBmpWidth ) >> 1;
aPos.Y() += ( aSize.Height() - nBmpHeight ) >> 1;
break;
- case( WALLPAPER_RIGHT ):
+ case( WallpaperStyle::Right ):
aPos.X() += ( aSize.Width() - nBmpWidth );
aPos.Y() += ( aSize.Height() - nBmpHeight ) >> 1;
break;
- case( WALLPAPER_BOTTOMLEFT ):
+ case( WallpaperStyle::BottomLeft ):
aPos.Y() += ( aSize.Height() - nBmpHeight );
break;
- case( WALLPAPER_BOTTOM ):
+ case( WallpaperStyle::Bottom ):
aPos.X() += ( aSize.Width() - nBmpWidth ) >> 1;
aPos.Y() += ( aSize.Height() - nBmpHeight );
break;
- case( WALLPAPER_BOTTOMRIGHT ):
+ case( WallpaperStyle::BottomRight ):
aPos.X() += ( aSize.Width() - nBmpWidth );
aPos.Y() += ( aSize.Height() - nBmpHeight );
break;
@@ -245,7 +245,7 @@ void OutputDevice::DrawBitmapWallpaper( long nX, long nY,
long nFirstX;
long nFirstY;
- if( eStyle == WALLPAPER_TILE )
+ if( eStyle == WallpaperStyle::Tile )
{
nFirstX = aPos.X();
nFirstY = aPos.Y();
diff --git a/vcl/source/window/dockingarea.cxx b/vcl/source/window/dockingarea.cxx
index aa88007b7a40..e847685278e3 100644
--- a/vcl/source/window/dockingarea.cxx
+++ b/vcl/source/window/dockingarea.cxx
@@ -128,9 +128,9 @@ void DockingAreaWindow::ApplySettings(vcl::RenderContext& rRenderContext)
{
Wallpaper aWallpaper(rPersonaBitmap);
if (GetAlign() == WINDOWALIGN_TOP)
- aWallpaper.SetStyle(WALLPAPER_TOPRIGHT);
+ aWallpaper.SetStyle(WallpaperStyle::TopRight);
else
- aWallpaper.SetStyle(WALLPAPER_BOTTOMRIGHT);
+ aWallpaper.SetStyle(WallpaperStyle::BottomRight);
aWallpaper.SetColor(rSetting.GetWorkspaceColor());
// we need to shift the bitmap vertically so that it spans over the
@@ -152,7 +152,7 @@ void DockingAreaWindow::ApplySettings(vcl::RenderContext& rRenderContext)
else if (rRenderContext.IsNativeControlSupported(CTRL_TOOLBAR, PART_ENTIRE_CONTROL))
{
Wallpaper aWallpaper;
- aWallpaper.SetStyle(WALLPAPER_APPLICATIONGRADIENT);
+ aWallpaper.SetStyle(WallpaperStyle::ApplicationGradient);
rRenderContext.SetBackground(aWallpaper);
}
else
diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx
index 87bb541b1636..c6a0783bb2f3 100644
--- a/vcl/source/window/menubarwindow.cxx
+++ b/vcl/source/window/menubarwindow.cxx
@@ -1054,7 +1054,7 @@ void MenuBarWindow::ApplySettings(vcl::RenderContext& rRenderContext)
if (!rPersonaBitmap.IsEmpty())
{
Wallpaper aWallpaper(rPersonaBitmap);
- aWallpaper.SetStyle(WALLPAPER_TOPRIGHT);
+ aWallpaper.SetStyle(WallpaperStyle::TopRight);
aWallpaper.SetColor(Application::GetSettings().GetStyleSettings().GetWorkspaceColor());
rRenderContext.SetBackground(aWallpaper);
@@ -1068,7 +1068,7 @@ void MenuBarWindow::ApplySettings(vcl::RenderContext& rRenderContext)
else
{
Wallpaper aWallpaper;
- aWallpaper.SetStyle(WALLPAPER_APPLICATIONGRADIENT);
+ aWallpaper.SetStyle(WallpaperStyle::ApplicationGradient);
rRenderContext.SetBackground(aWallpaper);
SetPaintTransparent(false);
SetParentClipMode(ParentClipMode::NONE);
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index a61affa0e4bf..4ddeff4a8e34 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -1468,7 +1468,7 @@ public:
SetText("VCL widget demo");
Wallpaper aWallpaper(BitmapEx("sfx2/res/startcenter-logo.png"));
- aWallpaper.SetStyle(WALLPAPER_BOTTOMRIGHT);
+ aWallpaper.SetStyle(WallpaperStyle::BottomRight);
aWallpaper.SetColor(COL_RED);
mpBox->SetBackground(aWallpaper);