summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-05-18 15:41:24 +0200
committerNoel Grandin <noel@peralex.com>2015-05-20 09:52:08 +0200
commitdcefc97c8bd5be9ba229098c32d2a5c73d084163 (patch)
tree860caac40b5c15ddb3cd1297316975d7034b260e /vcl
parent953f327818f565969b8de5d9b956bd6b9a7c64b2 (diff)
convert IMAGE_DRAW_ constants to scoped enum
Change-Id: I75619eeb902af4953a5ac1525605cf3f0f15e2c0
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/image.h2
-rw-r--r--vcl/source/control/button.cxx12
-rw-r--r--vcl/source/control/fixed.cxx4
-rw-r--r--vcl/source/control/ilstbox.cxx2
-rw-r--r--vcl/source/control/imgctrl.cxx4
-rw-r--r--vcl/source/control/tabctrl.cxx2
-rw-r--r--vcl/source/gdi/impimage.cxx14
-rw-r--r--vcl/source/gdi/print.cxx4
-rw-r--r--vcl/source/outdev/bitmap.cxx6
-rw-r--r--vcl/source/window/menu.cxx4
-rw-r--r--vcl/source/window/toolbox.cxx6
11 files changed, 30 insertions, 30 deletions
diff --git a/vcl/inc/image.h b/vcl/inc/image.h
index ced9debcc6a6..3aa942418bb6 100644
--- a/vcl/inc/image.h
+++ b/vcl/inc/image.h
@@ -35,7 +35,7 @@ public:
void Create( const BitmapEx& rBmpEx, long nItemWidth, long nItemHeight,sal_uInt16 nInitSize );
void ColorTransform();
- void Draw( sal_uInt16 nPos, OutputDevice* pDev, const Point& rPos, sal_uInt16 nStyle, const Size* pSize = NULL );
+ void Draw( sal_uInt16 nPos, OutputDevice* pDev, const Point& rPos, DrawImageFlags nStyle, const Size* pSize = NULL );
private:
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index f66067237494..7714c240ed02 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -485,11 +485,11 @@ void Button::ImplDrawAlignedImage( OutputDevice* pDev, Point& rPos,
}
}
- sal_uInt16 nStyle = 0;
+ DrawImageFlags nStyle = DrawImageFlags::NONE;
if ( ! ( nDrawFlags & WINDOW_DRAW_NODISABLE ) &&
! IsEnabled() )
- nStyle |= IMAGE_DRAW_DISABLE;
+ nStyle |= DrawImageFlags::Disable;
if ( IsZoom() )
pDev->DrawImage( aImagePos, aImageSize, *pImage, nStyle );
@@ -1937,9 +1937,9 @@ void RadioButton::ImplDrawRadioButtonState(vcl::RenderContext& rRenderContext)
rRenderContext.DrawRect(aImageRect);
// display image
- sal_uInt16 nImageStyle = 0;
+ DrawImageFlags nImageStyle = DrawImageFlags::NONE;
if (!bEnabled)
- nImageStyle |= IMAGE_DRAW_DISABLE;
+ nImageStyle |= DrawImageFlags::Disable;
Image* pImage = &maImage;
@@ -3890,9 +3890,9 @@ void DisclosureButton::ImplDrawCheckBoxState(vcl::RenderContext& rRenderContext)
if (!pImg)
return;
- sal_uInt16 nStyle = 0;
+ DrawImageFlags nStyle = DrawImageFlags::NONE;
if (!IsEnabled())
- nStyle |= IMAGE_DRAW_DISABLE;
+ nStyle |= DrawImageFlags::Disable;
Size aSize(aStateRect.GetSize());
Size aImgSize(pImg->GetSizePixel());
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index edeb7baeac54..dd7c27e7b352 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -919,11 +919,11 @@ FixedImage::FixedImage( vcl::Window* pParent, const ResId& rResId ) :
void FixedImage::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
const Point& rPos, const Size& rSize )
{
- sal_uInt16 nStyle = 0;
+ DrawImageFlags nStyle = DrawImageFlags::NONE;
if ( !(nDrawFlags & WINDOW_DRAW_NODISABLE) )
{
if ( !IsEnabled() )
- nStyle |= IMAGE_DRAW_DISABLE;
+ nStyle |= DrawImageFlags::Disable;
}
Image *pImage = &maImage;
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index 47bf65fccd59..beca62b2268e 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -2847,7 +2847,7 @@ void ImplWin::DrawEntry( bool bDrawImage, bool bDrawText, bool bDrawTextAtImageP
bool bImage = !!maImage;
if( bDrawImage && bImage && !bLayout )
{
- sal_uInt16 nStyle = 0;
+ DrawImageFlags nStyle = DrawImageFlags::NONE;
Size aImgSz = maImage.GetSizePixel();
Point aPtImg( nBorder, ( ( aOutSz.Height() - aImgSz.Height() ) / 2 ) );
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
diff --git a/vcl/source/control/imgctrl.cxx b/vcl/source/control/imgctrl.cxx
index 1ba4fcbf535b..6da20c0cde53 100644
--- a/vcl/source/control/imgctrl.cxx
+++ b/vcl/source/control/imgctrl.cxx
@@ -69,11 +69,11 @@ namespace
void ImageControl::ImplDraw(OutputDevice& rDev, sal_uLong nDrawFlags, const Point& rPos, const Size& rSize) const
{
- sal_uInt16 nStyle = 0;
+ DrawImageFlags nStyle = DrawImageFlags::NONE;
if ( !(nDrawFlags & WINDOW_DRAW_NODISABLE) )
{
if ( !IsEnabled() )
- nStyle |= IMAGE_DRAW_DISABLE;
+ nStyle |= DrawImageFlags::Disable;
}
const Image& rImage( GetModeImage() );
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 86915d956f01..1558b7304e6d 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -965,7 +965,7 @@ void TabControl::ImplDrawItem(vcl::RenderContext& rRenderContext, ImplTabItem* p
Point aImgTL( nXPos, aRect.Top() );
if (aImageSize.Height() < aRect.GetHeight())
aImgTL.Y() += (aRect.GetHeight() - aImageSize.Height()) / 2;
- rRenderContext.DrawImage(aImgTL, pItem->maTabImage, pItem->mbEnabled ? 0 : IMAGE_DRAW_DISABLE );
+ rRenderContext.DrawImage(aImgTL, pItem->maTabImage, pItem->mbEnabled ? DrawImageFlags::NONE : DrawImageFlags::Disable );
}
}
diff --git a/vcl/source/gdi/impimage.cxx b/vcl/source/gdi/impimage.cxx
index 184e5b192e85..067b6e8ab95e 100644
--- a/vcl/source/gdi/impimage.cxx
+++ b/vcl/source/gdi/impimage.cxx
@@ -170,7 +170,7 @@ void ImplImageBmp::Create( const BitmapEx& rBmpEx, long nItemWidth, long nItemHe
}
void ImplImageBmp::Draw( sal_uInt16 nPos, OutputDevice* pOutDev,
- const Point& rPos, sal_uInt16 nStyle,
+ const Point& rPos, DrawImageFlags nStyle,
const Size* pSize )
{
if( pOutDev->IsDeviceOutputNecessary() )
@@ -180,15 +180,15 @@ void ImplImageBmp::Draw( sal_uInt16 nPos, OutputDevice* pOutDev,
aOutSize = ( pSize ? *pSize : pOutDev->PixelToLogic( maSize ) );
- if( nStyle & IMAGE_DRAW_DISABLE )
+ if( nStyle & DrawImageFlags::Disable )
{
ImplUpdateDisabledBmpEx( nPos);
pOutDev->DrawBitmapEx( rPos, aOutSize, aSrcPos, maSize, maDisabledBmpEx );
}
else
{
- if( nStyle & ( IMAGE_DRAW_COLORTRANSFORM |
- IMAGE_DRAW_HIGHLIGHT | IMAGE_DRAW_DEACTIVE | IMAGE_DRAW_SEMITRANSPARENT ) )
+ if( nStyle & ( DrawImageFlags::ColorTransform |
+ DrawImageFlags::Highlight | DrawImageFlags::Deactive | DrawImageFlags::SemiTransparent ) )
{
BitmapEx aTmpBmpEx;
const Rectangle aCropRect( aSrcPos, maSize );
@@ -202,7 +202,7 @@ void ImplImageBmp::Draw( sal_uInt16 nPos, OutputDevice* pOutDev,
Bitmap aTmpBmp( aTmpBmpEx.GetBitmap() );
- if( nStyle & ( IMAGE_DRAW_HIGHLIGHT | IMAGE_DRAW_DEACTIVE ) )
+ if( nStyle & ( DrawImageFlags::Highlight | DrawImageFlags::Deactive ) )
{
BitmapWriteAccess* pAcc = aTmpBmp.AcquireWriteAccess();
@@ -218,7 +218,7 @@ void ImplImageBmp::Draw( sal_uInt16 nPos, OutputDevice* pOutDev,
boost::scoped_array<sal_uInt8> pMapB(new sal_uInt8[ 256 ]);
long nX, nY;
- if( nStyle & IMAGE_DRAW_HIGHLIGHT )
+ if( nStyle & DrawImageFlags::Highlight )
aColor = rSettings.GetHighlightColor();
else
aColor = rSettings.GetDeactiveColor();
@@ -278,7 +278,7 @@ void ImplImageBmp::Draw( sal_uInt16 nPos, OutputDevice* pOutDev,
}
}
- if( nStyle & IMAGE_DRAW_SEMITRANSPARENT )
+ if( nStyle & DrawImageFlags::SemiTransparent )
{
if( aTmpBmpEx.IsTransparent() )
{
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index 3b0c145f617c..b971e1c28b4b 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -1851,13 +1851,13 @@ void Printer::SetFontOrientation( ImplFontEntry* const pFontEntry ) const
pFontEntry->mnOrientation = pFontEntry->maMetric.mnOrientation;
}
-void Printer::DrawImage( const Point&, const Image&, sal_uInt16 )
+void Printer::DrawImage( const Point&, const Image&, DrawImageFlags )
{
SAL_WARN ("vcl.gdi", "DrawImage(): Images can't be drawn on any Printer instance");
assert(false);
}
-void Printer::DrawImage( const Point&, const Size&, const Image&, sal_uInt16 )
+void Printer::DrawImage( const Point&, const Size&, const Image&, DrawImageFlags )
{
SAL_WARN ("vcl.gdi", "DrawImage(): Images can't be drawn on any Printer instance");
assert(false);
diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx
index b94b8f170eb1..b39dbb2bbc9d 100644
--- a/vcl/source/outdev/bitmap.cxx
+++ b/vcl/source/outdev/bitmap.cxx
@@ -1306,13 +1306,13 @@ namespace
}
}
-void OutputDevice::DrawImage( const Point& rPos, const Image& rImage, sal_uInt16 nStyle )
+void OutputDevice::DrawImage( const Point& rPos, const Image& rImage, DrawImageFlags nStyle )
{
DrawImage( rPos, Size(), rImage, nStyle );
}
void OutputDevice::DrawImage( const Point& rPos, const Size& rSize,
- const Image& rImage, sal_uInt16 nStyle )
+ const Image& rImage, DrawImageFlags nStyle )
{
bool bIsSizeValid = rSize.getWidth() != 0 && rSize.getHeight() != 0;
@@ -1323,7 +1323,7 @@ void OutputDevice::DrawImage( const Point& rPos, const Size& rSize,
case IMAGETYPE_BITMAP:
{
const Bitmap &rBitmap = *static_cast< Bitmap* >( rImage.mpImplData->mpData );
- if( nStyle & IMAGE_DRAW_DISABLE )
+ if( nStyle & DrawImageFlags::Disable )
{
if ( bIsSizeValid )
DrawBitmapEx( rPos, rSize, makeDisabledBitmap(rBitmap) );
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 9cefd27c8f7d..9d1dee066889 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -1863,7 +1863,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext,
nTextOffsetY += (aOutSz.Height()-pData->aSz.Height()) / 2;
DrawTextFlags nTextStyle = DrawTextFlags::NONE;
DrawSymbolFlags nSymbolStyle = DrawSymbolFlags::NONE;
- sal_uInt16 nImageStyle = 0;
+ DrawImageFlags nImageStyle = DrawImageFlags::NONE;
// submenus without items are not disabled when no items are
// contained. The application itself should check for this!
@@ -1873,7 +1873,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext,
{
nTextStyle |= DrawTextFlags::Disable;
nSymbolStyle |= DrawSymbolFlags::Disable;
- nImageStyle |= IMAGE_DRAW_DISABLE;
+ nImageStyle |= DrawImageFlags::Disable;
}
// Separator
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 438a405290cc..76051f8eabbc 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -3164,10 +3164,10 @@ void ToolBox::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos,
aImageSize = pImage->GetSizePixel();
// determine drawing flags
- sal_uInt16 nImageStyle = 0;
+ DrawImageFlags nImageStyle = DrawImageFlags::NONE;
if ( !pItem->mbEnabled || !IsEnabled() )
- nImageStyle |= IMAGE_DRAW_DISABLE;
+ nImageStyle |= DrawImageFlags::Disable;
// #i35563# the dontknow state indicates different states at the same time
// which should not be rendered disabled but normal
@@ -3198,7 +3198,7 @@ void ToolBox::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos,
if( nHighlight != 0 )
{
if( bHighContrastWhite )
- nImageStyle |= IMAGE_DRAW_COLORTRANSFORM;
+ nImageStyle |= DrawImageFlags::ColorTransform;
}
}
rRenderContext.DrawImage(Point( nImageOffX, nImageOffY ), *pImage, nImageStyle);