convert WALLPAPER constants to scoped enum

Change-Id: I3b4b4e8a94904e22823a263bd5446a2e1aa47661
This commit is contained in:
Noel Grandin 2015-07-23 12:43:02 +02:00
parent 7bf70574e1
commit dc7fc2074d
15 changed files with 111 additions and 132 deletions

View File

@ -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())
{

View File

@ -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());

View File

@ -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;
}

View File

@ -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
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
WALLPAPER_FORCE_EQUAL_SIZE = 0x7fffffff
};
#endif
class VCL_DLLPUBLIC Wallpaper
{
private:

View File

@ -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);

View File

@ -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 );
}

View File

@ -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() );
}

View File

@ -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() )

View File

@ -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;

View File

@ -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;
}

View File

@ -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;

View File

@ -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();

View File

@ -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

View File

@ -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);

View File

@ -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);