summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-05-19 10:43:01 +0200
committerNoel Grandin <noel@peralex.com>2015-05-20 09:52:08 +0200
commit3cbdf64ad5240e6d9a73d4f7e005f7110d5e4002 (patch)
tree87ecd744320ba70cd784a2aac82aa436ea5d0c13 /vcl
parent662700703bebad38ca7ad74ca4eb040fe8b5b676 (diff)
convert DRAWMODE constants to scoped enum
Change-Id: I36cbe8057d09226f8b302963bdd94dc5600b686f
Diffstat (limited to 'vcl')
-rw-r--r--vcl/osx/printaccessoryview.mm4
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx4
-rw-r--r--vcl/source/gdi/pdfwriter_impl2.cxx8
-rw-r--r--vcl/source/gdi/print3.cxx12
-rw-r--r--vcl/source/outdev/bitmap.cxx38
-rw-r--r--vcl/source/outdev/gradient.cxx24
-rw-r--r--vcl/source/outdev/hatch.cxx16
-rw-r--r--vcl/source/outdev/outdev.cxx2
-rw-r--r--vcl/source/outdev/outdevstate.cxx48
-rw-r--r--vcl/source/outdev/text.cxx34
-rw-r--r--vcl/source/outdev/textline.cxx32
-rw-r--r--vcl/source/outdev/transparent.cxx34
-rw-r--r--vcl/source/window/printdlg.cxx6
13 files changed, 131 insertions, 131 deletions
diff --git a/vcl/osx/printaccessoryview.mm b/vcl/osx/printaccessoryview.mm
index cd37d5fc4119..d936c4ac576d 100644
--- a/vcl/osx/printaccessoryview.mm
+++ b/vcl/osx/printaccessoryview.mm
@@ -301,8 +301,8 @@ class ControllerProperties
PrinterController::PageSize aPageSize( mpController->getFilteredPageFile( i_nPage, aMtf, false ) );
auto aDev(VclPtr<VirtualDevice>::Create());
if( mpController->getPrinter()->GetPrinterOptions().IsConvertToGreyscales() )
- aDev->SetDrawMode( aDev->GetDrawMode() | ( DRAWMODE_GRAYLINE | DRAWMODE_GRAYFILL | DRAWMODE_GRAYTEXT |
- DRAWMODE_GRAYBITMAP | DRAWMODE_GRAYGRADIENT ) );
+ aDev->SetDrawMode( aDev->GetDrawMode() | ( DrawModeFlags::GrayLine | DrawModeFlags::GrayFill | DrawModeFlags::GrayText |
+ DrawModeFlags::GrayBitmap | DrawModeFlags::GrayGradient ) );
// see salprn.cxx, currently we pretend to be a 720dpi device on printers
aDev->SetReferenceDevice( 720, 720 );
aDev->EnableOutput( TRUE );
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index f995b78f1583..cdfccbb41a37 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -10943,8 +10943,8 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit& rObject )
aDev->SetMapMode( MapMode( MAP_PIXEL ) );
if( m_aContext.ColorMode == PDFWriter::DrawGreyscale )
aDev->SetDrawMode( aDev->GetDrawMode() |
- ( DRAWMODE_GRAYLINE | DRAWMODE_GRAYFILL | DRAWMODE_GRAYTEXT |
- DRAWMODE_GRAYBITMAP | DRAWMODE_GRAYGRADIENT ) );
+ ( DrawModeFlags::GrayLine | DrawModeFlags::GrayFill | DrawModeFlags::GrayText |
+ DrawModeFlags::GrayBitmap | DrawModeFlags::GrayGradient ) );
aDev->DrawGradient( Rectangle( Point( 0, 0 ), rObject.m_aSize ), rObject.m_aGradient );
Bitmap aSample = aDev->GetBitmap( Point( 0, 0 ), rObject.m_aSize );
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
index 9dc93114ff95..1bea52978961 100644
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -465,8 +465,8 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa
xVDev->SetLineColor( COL_BLACK );
xVDev->SetFillColor( COL_BLACK );
xVDev->DrawRect( Rectangle( aPoint, aDstSize ) );
- xVDev->SetDrawMode( DRAWMODE_WHITELINE | DRAWMODE_WHITEFILL | DRAWMODE_WHITETEXT |
- DRAWMODE_WHITEBITMAP | DRAWMODE_WHITEGRADIENT );
+ xVDev->SetDrawMode( DrawModeFlags::WhiteLine | DrawModeFlags::WhiteFill | DrawModeFlags::WhiteText |
+ DrawModeFlags::WhiteBitmap | DrawModeFlags::WhiteGradient );
aTmpMtf.WindStart();
aTmpMtf.Play( xVDev.get(), aPoint, aDstSize );
aTmpMtf.WindStart();
@@ -475,9 +475,9 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa
xVDev->EnableMapMode( true );
// create alpha mask from gradient
- xVDev->SetDrawMode( DRAWMODE_GRAYGRADIENT );
+ xVDev->SetDrawMode( DrawModeFlags::GrayGradient );
xVDev->DrawGradient( Rectangle( aPoint, aDstSize ), rTransparenceGradient );
- xVDev->SetDrawMode( DRAWMODE_DEFAULT );
+ xVDev->SetDrawMode( DrawModeFlags::Default );
xVDev->EnableMapMode( false );
xVDev->DrawMask( aPoint, aDstSizePixel, aMask, Color( COL_WHITE ) );
aAlpha = xVDev->GetBitmap( aPoint, aDstSizePixel );
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index b8ed8d5afb9d..e29d1cc72b19 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -1202,9 +1202,9 @@ int PrinterController::getFilteredPageCount()
return (getPageCountProtected() * mpImplData->maMultiPage.nRepeat + (nDiv-1)) / nDiv;
}
-sal_uLong PrinterController::removeTransparencies( GDIMetaFile& i_rIn, GDIMetaFile& o_rOut )
+DrawModeFlags PrinterController::removeTransparencies( GDIMetaFile& i_rIn, GDIMetaFile& o_rOut )
{
- sal_uLong nRestoreDrawMode = mpImplData->mxPrinter->GetDrawMode();
+ DrawModeFlags nRestoreDrawMode = mpImplData->mxPrinter->GetDrawMode();
sal_Int32 nMaxBmpDPIX = mpImplData->mxPrinter->GetDPIX();
sal_Int32 nMaxBmpDPIY = mpImplData->mxPrinter->GetDPIY();
@@ -1237,14 +1237,14 @@ sal_uLong PrinterController::removeTransparencies( GDIMetaFile& i_rIn, GDIMetaFi
if( rPrinterOptions.IsConvertToGreyscales() )
{
mpImplData->mxPrinter->SetDrawMode( mpImplData->mxPrinter->GetDrawMode() |
- ( DRAWMODE_GRAYLINE | DRAWMODE_GRAYFILL | DRAWMODE_GRAYTEXT |
- DRAWMODE_GRAYBITMAP | DRAWMODE_GRAYGRADIENT ) );
+ ( DrawModeFlags::GrayLine | DrawModeFlags::GrayFill | DrawModeFlags::GrayText |
+ DrawModeFlags::GrayBitmap | DrawModeFlags::GrayGradient ) );
}
// disable transparency output
if( rPrinterOptions.IsReduceTransparency() && ( PRINTER_TRANSPARENCY_NONE == rPrinterOptions.GetReducedTransparencyMode() ) )
{
- mpImplData->mxPrinter->SetDrawMode( mpImplData->mxPrinter->GetDrawMode() | DRAWMODE_NOTRANSPARENCY );
+ mpImplData->mxPrinter->SetDrawMode( mpImplData->mxPrinter->GetDrawMode() | DrawModeFlags::NoTransparency );
}
Color aBg( COL_TRANSPARENT ); // default: let RemoveTransparenciesFromMetaFile do its own background logic
@@ -1306,7 +1306,7 @@ void PrinterController::printFilteredPage( int i_nPage )
}
GDIMetaFile aCleanedFile;
- sal_uLong nRestoreDrawMode = removeTransparencies( aPageFile, aCleanedFile );
+ DrawModeFlags nRestoreDrawMode = removeTransparencies( aPageFile, aCleanedFile );
mpImplData->mxPrinter->EnableOutput( true );
diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx
index b39dbb2bbc9d..a924d5bf45f7 100644
--- a/vcl/source/outdev/bitmap.cxx
+++ b/vcl/source/outdev/bitmap.cxx
@@ -52,7 +52,7 @@ void OutputDevice::DrawBitmap( const Point& rDestPt, const Size& rDestSize,
if( ImplIsRecordLayout() )
return;
- if ( ( mnDrawMode & DRAWMODE_NOBITMAP ) )
+ if ( ( mnDrawMode & DrawModeFlags::NoBitmap ) )
{
return;
}
@@ -64,15 +64,15 @@ void OutputDevice::DrawBitmap( const Point& rDestPt, const Size& rDestSize,
Bitmap aBmp( rBitmap );
- if ( mnDrawMode & ( DRAWMODE_BLACKBITMAP | DRAWMODE_WHITEBITMAP |
- DRAWMODE_GRAYBITMAP | DRAWMODE_GHOSTEDBITMAP ) )
+ if ( mnDrawMode & ( DrawModeFlags::BlackBitmap | DrawModeFlags::WhiteBitmap |
+ DrawModeFlags::GrayBitmap | DrawModeFlags::GhostedBitmap ) )
{
- if ( mnDrawMode & ( DRAWMODE_BLACKBITMAP | DRAWMODE_WHITEBITMAP ) )
+ if ( mnDrawMode & ( DrawModeFlags::BlackBitmap | DrawModeFlags::WhiteBitmap ) )
{
sal_uInt8 cCmpVal;
- if ( mnDrawMode & DRAWMODE_BLACKBITMAP )
- cCmpVal = ( mnDrawMode & DRAWMODE_GHOSTEDBITMAP ) ? 0x80 : 0;
+ if ( mnDrawMode & DrawModeFlags::BlackBitmap )
+ cCmpVal = ( mnDrawMode & DrawModeFlags::GhostedBitmap ) ? 0x80 : 0;
else
cCmpVal = 255;
@@ -86,10 +86,10 @@ void OutputDevice::DrawBitmap( const Point& rDestPt, const Size& rDestSize,
}
else if( !!aBmp )
{
- if ( mnDrawMode & DRAWMODE_GRAYBITMAP )
+ if ( mnDrawMode & DrawModeFlags::GrayBitmap )
aBmp.Convert( BMP_CONVERSION_8BIT_GREYS );
- if ( mnDrawMode & DRAWMODE_GHOSTEDBITMAP )
+ if ( mnDrawMode & DrawModeFlags::GhostedBitmap )
aBmp.Convert( BMP_CONVERSION_GHOSTED );
}
}
@@ -274,7 +274,7 @@ void OutputDevice::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
}
else
{
- if ( mnDrawMode & DRAWMODE_NOBITMAP )
+ if ( mnDrawMode & DrawModeFlags::NoBitmap )
return;
if ( ROP_INVERT == meRasterOp )
@@ -285,16 +285,16 @@ void OutputDevice::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
BitmapEx aBmpEx( rBitmapEx );
- if ( mnDrawMode & ( DRAWMODE_BLACKBITMAP | DRAWMODE_WHITEBITMAP |
- DRAWMODE_GRAYBITMAP | DRAWMODE_GHOSTEDBITMAP ) )
+ if ( mnDrawMode & ( DrawModeFlags::BlackBitmap | DrawModeFlags::WhiteBitmap |
+ DrawModeFlags::GrayBitmap | DrawModeFlags::GhostedBitmap ) )
{
- if ( mnDrawMode & ( DRAWMODE_BLACKBITMAP | DRAWMODE_WHITEBITMAP ) )
+ if ( mnDrawMode & ( DrawModeFlags::BlackBitmap | DrawModeFlags::WhiteBitmap ) )
{
- Bitmap aColorBmp( aBmpEx.GetSizePixel(), ( mnDrawMode & DRAWMODE_GHOSTEDBITMAP ) ? 4 : 1 );
+ Bitmap aColorBmp( aBmpEx.GetSizePixel(), ( mnDrawMode & DrawModeFlags::GhostedBitmap ) ? 4 : 1 );
sal_uInt8 cCmpVal;
- if ( mnDrawMode & DRAWMODE_BLACKBITMAP )
- cCmpVal = ( mnDrawMode & DRAWMODE_GHOSTEDBITMAP ) ? 0x80 : 0;
+ if ( mnDrawMode & DrawModeFlags::BlackBitmap )
+ cCmpVal = ( mnDrawMode & DrawModeFlags::GhostedBitmap ) ? 0x80 : 0;
else
cCmpVal = 255;
@@ -318,10 +318,10 @@ void OutputDevice::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
}
else if( !!aBmpEx )
{
- if ( mnDrawMode & DRAWMODE_GRAYBITMAP )
+ if ( mnDrawMode & DrawModeFlags::GrayBitmap )
aBmpEx.Convert( BMP_CONVERSION_8BIT_GREYS );
- if ( mnDrawMode & DRAWMODE_GHOSTEDBITMAP )
+ if ( mnDrawMode & DrawModeFlags::GhostedBitmap )
aBmpEx.Convert( BMP_CONVERSION_GHOSTED );
}
}
@@ -1143,7 +1143,7 @@ void OutputDevice::DrawTransformedBitmapEx(
if(rBitmapEx.IsEmpty())
return;
- if ( mnDrawMode & DRAWMODE_NOBITMAP )
+ if ( mnDrawMode & DrawModeFlags::NoBitmap )
return;
// decompose matrix to check rotation and shear
@@ -1174,7 +1174,7 @@ void OutputDevice::DrawTransformedBitmapEx(
// we have rotation,shear or mirror, check if some crazy mode needs the
// created transformed bitmap
const bool bInvert(ROP_INVERT == meRasterOp);
- const bool bBitmapChangedColor(mnDrawMode & (DRAWMODE_BLACKBITMAP | DRAWMODE_WHITEBITMAP | DRAWMODE_GRAYBITMAP | DRAWMODE_GHOSTEDBITMAP));
+ const bool bBitmapChangedColor(mnDrawMode & (DrawModeFlags::BlackBitmap | DrawModeFlags::WhiteBitmap | DrawModeFlags::GrayBitmap | DrawModeFlags::GhostedBitmap));
const bool bMetafile(mpMetaFile);
bool bDone(false);
const basegfx::B2DHomMatrix aFullTransform(GetViewTransformation() * rTransformation);
diff --git a/vcl/source/outdev/gradient.cxx b/vcl/source/outdev/gradient.cxx
index 2c6e27f9c710..981cfac58a6b 100644
--- a/vcl/source/outdev/gradient.cxx
+++ b/vcl/source/outdev/gradient.cxx
@@ -41,7 +41,7 @@ void OutputDevice::DrawGradient( const Rectangle& rRect,
void OutputDevice::DrawGradient( const tools::PolyPolygon& rPolyPoly,
const Gradient& rGradient )
{
- if ( mnDrawMode & DRAWMODE_NOGRADIENT )
+ if ( mnDrawMode & DrawModeFlags::NoGradient )
return; // nothing to draw!
if ( mbInitClipRegion )
@@ -52,7 +52,7 @@ void OutputDevice::DrawGradient( const tools::PolyPolygon& rPolyPoly,
if ( rPolyPoly.Count() && rPolyPoly[ 0 ].GetSize() )
{
- if ( mnDrawMode & ( DRAWMODE_BLACKGRADIENT | DRAWMODE_WHITEGRADIENT | DRAWMODE_SETTINGSGRADIENT) )
+ if ( mnDrawMode & ( DrawModeFlags::BlackGradient | DrawModeFlags::WhiteGradient | DrawModeFlags::SettingsGradient) )
{
Color aColor = GetSingleColorGradientFill();
@@ -66,7 +66,7 @@ void OutputDevice::DrawGradient( const tools::PolyPolygon& rPolyPoly,
Gradient aGradient( rGradient );
- if ( mnDrawMode & ( DRAWMODE_GRAYGRADIENT | DRAWMODE_GHOSTEDGRADIENT ) )
+ if ( mnDrawMode & ( DrawModeFlags::GrayGradient | DrawModeFlags::GhostedGradient ) )
{
SetGrayscaleColors( aGradient );
}
@@ -174,7 +174,7 @@ void OutputDevice::DrawGradientToMetafile ( const tools::PolyPolygon& rPolyPoly,
{
Gradient aGradient( rGradient );
- if ( mnDrawMode & ( DRAWMODE_GRAYGRADIENT | DRAWMODE_GHOSTEDGRADIENT ) )
+ if ( mnDrawMode & ( DrawModeFlags::GrayGradient | DrawModeFlags::GhostedGradient ) )
{
SetGrayscaleColors( aGradient );
}
@@ -941,16 +941,16 @@ Color OutputDevice::GetSingleColorGradientFill()
Color aColor;
// we should never call on this function if any of these aren't set!
- assert( mnDrawMode & ( DRAWMODE_BLACKGRADIENT | DRAWMODE_WHITEGRADIENT | DRAWMODE_SETTINGSGRADIENT) );
+ assert( mnDrawMode & ( DrawModeFlags::BlackGradient | DrawModeFlags::WhiteGradient | DrawModeFlags::SettingsGradient) );
- if ( mnDrawMode & DRAWMODE_BLACKGRADIENT )
+ if ( mnDrawMode & DrawModeFlags::BlackGradient )
aColor = Color( COL_BLACK );
- else if ( mnDrawMode & DRAWMODE_WHITEGRADIENT )
+ else if ( mnDrawMode & DrawModeFlags::WhiteGradient )
aColor = Color( COL_WHITE );
- else if ( mnDrawMode & DRAWMODE_SETTINGSGRADIENT )
+ else if ( mnDrawMode & DrawModeFlags::SettingsGradient )
aColor = GetSettings().GetStyleSettings().GetWindowColor();
- if ( mnDrawMode & DRAWMODE_GHOSTEDGRADIENT )
+ if ( mnDrawMode & DrawModeFlags::GhostedGradient )
{
aColor = Color( ( aColor.GetRed() >> 1 ) | 0x80,
( aColor.GetGreen() >> 1 ) | 0x80,
@@ -963,19 +963,19 @@ Color OutputDevice::GetSingleColorGradientFill()
void OutputDevice::SetGrayscaleColors( Gradient &rGradient )
{
// this should only be called with the drawing mode is for grayscale or ghosted gradients
- assert ( mnDrawMode & ( DRAWMODE_GRAYGRADIENT | DRAWMODE_GHOSTEDGRADIENT ) );
+ assert ( mnDrawMode & ( DrawModeFlags::GrayGradient | DrawModeFlags::GhostedGradient ) );
Color aStartCol( rGradient.GetStartColor() );
Color aEndCol( rGradient.GetEndColor() );
- if ( mnDrawMode & DRAWMODE_GRAYGRADIENT )
+ if ( mnDrawMode & DrawModeFlags::GrayGradient )
{
sal_uInt8 cStartLum = aStartCol.GetLuminance(), cEndLum = aEndCol.GetLuminance();
aStartCol = Color( cStartLum, cStartLum, cStartLum );
aEndCol = Color( cEndLum, cEndLum, cEndLum );
}
- if ( mnDrawMode & DRAWMODE_GHOSTEDGRADIENT )
+ if ( mnDrawMode & DrawModeFlags::GhostedGradient )
{
aStartCol = Color( ( aStartCol.GetRed() >> 1 ) | 0x80,
( aStartCol.GetGreen() >> 1 ) | 0x80,
diff --git a/vcl/source/outdev/hatch.cxx b/vcl/source/outdev/hatch.cxx
index 834c6e73953b..928c07f7b088 100644
--- a/vcl/source/outdev/hatch.cxx
+++ b/vcl/source/outdev/hatch.cxx
@@ -46,27 +46,27 @@ void OutputDevice::DrawHatch( const tools::PolyPolygon& rPolyPoly, const Hatch&
Hatch aHatch( rHatch );
- if ( mnDrawMode & ( DRAWMODE_BLACKLINE | DRAWMODE_WHITELINE |
- DRAWMODE_GRAYLINE | DRAWMODE_GHOSTEDLINE |
- DRAWMODE_SETTINGSLINE ) )
+ if ( mnDrawMode & ( DrawModeFlags::BlackLine | DrawModeFlags::WhiteLine |
+ DrawModeFlags::GrayLine | DrawModeFlags::GhostedLine |
+ DrawModeFlags::SettingsLine ) )
{
Color aColor( rHatch.GetColor() );
- if ( mnDrawMode & DRAWMODE_BLACKLINE )
+ if ( mnDrawMode & DrawModeFlags::BlackLine )
aColor = Color( COL_BLACK );
- else if ( mnDrawMode & DRAWMODE_WHITELINE )
+ else if ( mnDrawMode & DrawModeFlags::WhiteLine )
aColor = Color( COL_WHITE );
- else if ( mnDrawMode & DRAWMODE_GRAYLINE )
+ else if ( mnDrawMode & DrawModeFlags::GrayLine )
{
const sal_uInt8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
- else if( mnDrawMode & DRAWMODE_SETTINGSLINE )
+ else if( mnDrawMode & DrawModeFlags::SettingsLine )
{
aColor = GetSettings().GetStyleSettings().GetFontColor();
}
- if ( mnDrawMode & DRAWMODE_GHOSTEDLINE )
+ if ( mnDrawMode & DrawModeFlags::GhostedLine )
{
aColor = Color( ( aColor.GetRed() >> 1 ) | 0x80,
( aColor.GetGreen() >> 1 ) | 0x80,
diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx
index 0fb1d342a560..5724a8647b73 100644
--- a/vcl/source/outdev/outdev.cxx
+++ b/vcl/source/outdev/outdev.cxx
@@ -117,7 +117,7 @@ OutputDevice::OutputDevice() :
mnOutOffLogicY = 0;
mnEmphasisAscent = 0;
mnEmphasisDescent = 0;
- mnDrawMode = 0;
+ mnDrawMode = DrawModeFlags::Default;
mnTextLayoutMode = TEXT_LAYOUT_DEFAULT;
if( AllSettings::GetLayoutRTL() ) //#i84553# tip BiDi preference to RTL
diff --git a/vcl/source/outdev/outdevstate.cxx b/vcl/source/outdev/outdevstate.cxx
index 155efed74888..a6cf8982a48f 100644
--- a/vcl/source/outdev/outdevstate.cxx
+++ b/vcl/source/outdev/outdevstate.cxx
@@ -284,7 +284,7 @@ void OutputDevice::SetAntialiasing( sal_uInt16 nMode )
mpAlphaVDev->SetAntialiasing( nMode );
}
-void OutputDevice::SetDrawMode( sal_uLong nDrawMode )
+void OutputDevice::SetDrawMode( DrawModeFlags nDrawMode )
{
mnDrawMode = nDrawMode;
@@ -357,35 +357,35 @@ void OutputDevice::SetFillColor( const Color& rColor )
Color aColor( rColor );
- if( mnDrawMode & ( DRAWMODE_BLACKFILL | DRAWMODE_WHITEFILL |
- DRAWMODE_GRAYFILL | DRAWMODE_NOFILL |
- DRAWMODE_GHOSTEDFILL | DRAWMODE_SETTINGSFILL ) )
+ if( mnDrawMode & ( DrawModeFlags::BlackFill | DrawModeFlags::WhiteFill |
+ DrawModeFlags::GrayFill | DrawModeFlags::NoFill |
+ DrawModeFlags::GhostedFill | DrawModeFlags::SettingsFill ) )
{
if( !ImplIsColorTransparent( aColor ) )
{
- if( mnDrawMode & DRAWMODE_BLACKFILL )
+ if( mnDrawMode & DrawModeFlags::BlackFill )
{
aColor = Color( COL_BLACK );
}
- else if( mnDrawMode & DRAWMODE_WHITEFILL )
+ else if( mnDrawMode & DrawModeFlags::WhiteFill )
{
aColor = Color( COL_WHITE );
}
- else if( mnDrawMode & DRAWMODE_GRAYFILL )
+ else if( mnDrawMode & DrawModeFlags::GrayFill )
{
const sal_uInt8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
- else if( mnDrawMode & DRAWMODE_NOFILL )
+ else if( mnDrawMode & DrawModeFlags::NoFill )
{
aColor = Color( COL_TRANSPARENT );
}
- else if( mnDrawMode & DRAWMODE_SETTINGSFILL )
+ else if( mnDrawMode & DrawModeFlags::SettingsFill )
{
aColor = GetSettings().GetStyleSettings().GetWindowColor();
}
- if( mnDrawMode & DRAWMODE_GHOSTEDFILL )
+ if( mnDrawMode & DrawModeFlags::GhostedFill )
{
aColor = Color( (aColor.GetRed() >> 1) | 0x80,
(aColor.GetGreen() >> 1) | 0x80,
@@ -497,25 +497,25 @@ void OutputDevice::SetFont( const vcl::Font& rNewFont )
vcl::Font aFont( rNewFont );
aFont.SetLanguage(rNewFont.GetLanguage());
- if ( mnDrawMode & (DRAWMODE_BLACKTEXT | DRAWMODE_WHITETEXT | DRAWMODE_GRAYTEXT | DRAWMODE_GHOSTEDTEXT | DRAWMODE_SETTINGSTEXT |
- DRAWMODE_BLACKFILL | DRAWMODE_WHITEFILL | DRAWMODE_GRAYFILL | DRAWMODE_NOFILL |
- DRAWMODE_GHOSTEDFILL | DRAWMODE_SETTINGSFILL ) )
+ if ( mnDrawMode & (DrawModeFlags::BlackText | DrawModeFlags::WhiteText | DrawModeFlags::GrayText | DrawModeFlags::GhostedText | DrawModeFlags::SettingsText |
+ DrawModeFlags::BlackFill | DrawModeFlags::WhiteFill | DrawModeFlags::GrayFill | DrawModeFlags::NoFill |
+ DrawModeFlags::GhostedFill | DrawModeFlags::SettingsFill ) )
{
Color aTextColor( aFont.GetColor() );
- if ( mnDrawMode & DRAWMODE_BLACKTEXT )
+ if ( mnDrawMode & DrawModeFlags::BlackText )
aTextColor = Color( COL_BLACK );
- else if ( mnDrawMode & DRAWMODE_WHITETEXT )
+ else if ( mnDrawMode & DrawModeFlags::WhiteText )
aTextColor = Color( COL_WHITE );
- else if ( mnDrawMode & DRAWMODE_GRAYTEXT )
+ else if ( mnDrawMode & DrawModeFlags::GrayText )
{
const sal_uInt8 cLum = aTextColor.GetLuminance();
aTextColor = Color( cLum, cLum, cLum );
}
- else if ( mnDrawMode & DRAWMODE_SETTINGSTEXT )
+ else if ( mnDrawMode & DrawModeFlags::SettingsText )
aTextColor = GetSettings().GetStyleSettings().GetFontColor();
- if ( mnDrawMode & DRAWMODE_GHOSTEDTEXT )
+ if ( mnDrawMode & DrawModeFlags::GhostedText )
{
aTextColor = Color( (aTextColor.GetRed() >> 1 ) | 0x80,
(aTextColor.GetGreen() >> 1 ) | 0x80,
@@ -529,24 +529,24 @@ void OutputDevice::SetFont( const vcl::Font& rNewFont )
{
Color aTextFillColor( aFont.GetFillColor() );
- if ( mnDrawMode & DRAWMODE_BLACKFILL )
+ if ( mnDrawMode & DrawModeFlags::BlackFill )
aTextFillColor = Color( COL_BLACK );
- else if ( mnDrawMode & DRAWMODE_WHITEFILL )
+ else if ( mnDrawMode & DrawModeFlags::WhiteFill )
aTextFillColor = Color( COL_WHITE );
- else if ( mnDrawMode & DRAWMODE_GRAYFILL )
+ else if ( mnDrawMode & DrawModeFlags::GrayFill )
{
const sal_uInt8 cLum = aTextFillColor.GetLuminance();
aTextFillColor = Color( cLum, cLum, cLum );
}
- else if( mnDrawMode & DRAWMODE_SETTINGSFILL )
+ else if( mnDrawMode & DrawModeFlags::SettingsFill )
aTextFillColor = GetSettings().GetStyleSettings().GetWindowColor();
- else if ( mnDrawMode & DRAWMODE_NOFILL )
+ else if ( mnDrawMode & DrawModeFlags::NoFill )
{
aTextFillColor = Color( COL_TRANSPARENT );
bTransFill = true;
}
- if ( !bTransFill && (mnDrawMode & DRAWMODE_GHOSTEDFILL) )
+ if ( !bTransFill && (mnDrawMode & DrawModeFlags::GhostedFill) )
{
aTextFillColor = Color( (aTextFillColor.GetRed() >> 1) | 0x80,
(aTextFillColor.GetGreen() >> 1) | 0x80,
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index e860df14073c..fbef3085fc57 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -706,23 +706,23 @@ void OutputDevice::SetTextColor( const Color& rColor )
Color aColor( rColor );
- if ( mnDrawMode & ( DRAWMODE_BLACKTEXT | DRAWMODE_WHITETEXT |
- DRAWMODE_GRAYTEXT | DRAWMODE_GHOSTEDTEXT |
- DRAWMODE_SETTINGSTEXT ) )
+ if ( mnDrawMode & ( DrawModeFlags::BlackText | DrawModeFlags::WhiteText |
+ DrawModeFlags::GrayText | DrawModeFlags::GhostedText |
+ DrawModeFlags::SettingsText ) )
{
- if ( mnDrawMode & DRAWMODE_BLACKTEXT )
+ if ( mnDrawMode & DrawModeFlags::BlackText )
aColor = Color( COL_BLACK );
- else if ( mnDrawMode & DRAWMODE_WHITETEXT )
+ else if ( mnDrawMode & DrawModeFlags::WhiteText )
aColor = Color( COL_WHITE );
- else if ( mnDrawMode & DRAWMODE_GRAYTEXT )
+ else if ( mnDrawMode & DrawModeFlags::GrayText )
{
const sal_uInt8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
- else if ( mnDrawMode & DRAWMODE_SETTINGSTEXT )
+ else if ( mnDrawMode & DrawModeFlags::SettingsText )
aColor = GetSettings().GetStyleSettings().GetFontColor();
- if ( mnDrawMode & DRAWMODE_GHOSTEDTEXT )
+ if ( mnDrawMode & DrawModeFlags::GhostedText )
{
aColor = Color( (aColor.GetRed() >> 1) | 0x80,
(aColor.GetGreen() >> 1) | 0x80,
@@ -767,28 +767,28 @@ void OutputDevice::SetTextFillColor( const Color& rColor )
if ( !bTransFill )
{
- if ( mnDrawMode & ( DRAWMODE_BLACKFILL | DRAWMODE_WHITEFILL |
- DRAWMODE_GRAYFILL | DRAWMODE_NOFILL |
- DRAWMODE_GHOSTEDFILL | DRAWMODE_SETTINGSFILL ) )
+ if ( mnDrawMode & ( DrawModeFlags::BlackFill | DrawModeFlags::WhiteFill |
+ DrawModeFlags::GrayFill | DrawModeFlags::NoFill |
+ DrawModeFlags::GhostedFill | DrawModeFlags::SettingsFill ) )
{
- if ( mnDrawMode & DRAWMODE_BLACKFILL )
+ if ( mnDrawMode & DrawModeFlags::BlackFill )
aColor = Color( COL_BLACK );
- else if ( mnDrawMode & DRAWMODE_WHITEFILL )
+ else if ( mnDrawMode & DrawModeFlags::WhiteFill )
aColor = Color( COL_WHITE );
- else if ( mnDrawMode & DRAWMODE_GRAYFILL )
+ else if ( mnDrawMode & DrawModeFlags::GrayFill )
{
const sal_uInt8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
- else if( mnDrawMode & DRAWMODE_SETTINGSFILL )
+ else if( mnDrawMode & DrawModeFlags::SettingsFill )
aColor = GetSettings().GetStyleSettings().GetWindowColor();
- else if ( mnDrawMode & DRAWMODE_NOFILL )
+ else if ( mnDrawMode & DrawModeFlags::NoFill )
{
aColor = Color( COL_TRANSPARENT );
bTransFill = true;
}
- if ( !bTransFill && (mnDrawMode & DRAWMODE_GHOSTEDFILL) )
+ if ( !bTransFill && (mnDrawMode & DrawModeFlags::GhostedFill) )
{
aColor = Color( (aColor.GetRed() >> 1) | 0x80,
(aColor.GetGreen() >> 1) | 0x80,
diff --git a/vcl/source/outdev/textline.cxx b/vcl/source/outdev/textline.cxx
index 8b680809dceb..9f3820f3d8ca 100644
--- a/vcl/source/outdev/textline.cxx
+++ b/vcl/source/outdev/textline.cxx
@@ -837,29 +837,29 @@ void OutputDevice::SetTextLineColor( const Color& rColor )
Color aColor( rColor );
- if ( mnDrawMode & ( DRAWMODE_BLACKTEXT | DRAWMODE_WHITETEXT |
- DRAWMODE_GRAYTEXT | DRAWMODE_GHOSTEDTEXT |
- DRAWMODE_SETTINGSTEXT ) )
+ if ( mnDrawMode & ( DrawModeFlags::BlackText | DrawModeFlags::WhiteText |
+ DrawModeFlags::GrayText | DrawModeFlags::GhostedText |
+ DrawModeFlags::SettingsText ) )
{
- if ( mnDrawMode & DRAWMODE_BLACKTEXT )
+ if ( mnDrawMode & DrawModeFlags::BlackText )
{
aColor = Color( COL_BLACK );
}
- else if ( mnDrawMode & DRAWMODE_WHITETEXT )
+ else if ( mnDrawMode & DrawModeFlags::WhiteText )
{
aColor = Color( COL_WHITE );
}
- else if ( mnDrawMode & DRAWMODE_GRAYTEXT )
+ else if ( mnDrawMode & DrawModeFlags::GrayText )
{
const sal_uInt8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
- else if ( mnDrawMode & DRAWMODE_SETTINGSTEXT )
+ else if ( mnDrawMode & DrawModeFlags::SettingsText )
{
aColor = GetSettings().GetStyleSettings().GetFontColor();
}
- if( (mnDrawMode & DRAWMODE_GHOSTEDTEXT) &&
+ if( (mnDrawMode & DrawModeFlags::GhostedText) &&
(aColor.GetColor() != COL_TRANSPARENT) )
{
aColor = Color( (aColor.GetRed() >> 1) | 0x80,
@@ -894,29 +894,29 @@ void OutputDevice::SetOverlineColor( const Color& rColor )
Color aColor( rColor );
- if ( mnDrawMode & ( DRAWMODE_BLACKTEXT | DRAWMODE_WHITETEXT |
- DRAWMODE_GRAYTEXT | DRAWMODE_GHOSTEDTEXT |
- DRAWMODE_SETTINGSTEXT ) )
+ if ( mnDrawMode & ( DrawModeFlags::BlackText | DrawModeFlags::WhiteText |
+ DrawModeFlags::GrayText | DrawModeFlags::GhostedText |
+ DrawModeFlags::SettingsText ) )
{
- if ( mnDrawMode & DRAWMODE_BLACKTEXT )
+ if ( mnDrawMode & DrawModeFlags::BlackText )
{
aColor = Color( COL_BLACK );
}
- else if ( mnDrawMode & DRAWMODE_WHITETEXT )
+ else if ( mnDrawMode & DrawModeFlags::WhiteText )
{
aColor = Color( COL_WHITE );
}
- else if ( mnDrawMode & DRAWMODE_GRAYTEXT )
+ else if ( mnDrawMode & DrawModeFlags::GrayText )
{
const sal_uInt8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
- else if ( mnDrawMode & DRAWMODE_SETTINGSTEXT )
+ else if ( mnDrawMode & DrawModeFlags::SettingsText )
{
aColor = GetSettings().GetStyleSettings().GetFontColor();
}
- if( (mnDrawMode & DRAWMODE_GHOSTEDTEXT) &&
+ if( (mnDrawMode & DrawModeFlags::GhostedText) &&
(aColor.GetColor() != COL_TRANSPARENT) )
{
aColor = Color( (aColor.GetRed() >> 1) | 0x80,
diff --git a/vcl/source/outdev/transparent.cxx b/vcl/source/outdev/transparent.cxx
index 17eccc28748f..52d245d13cf0 100644
--- a/vcl/source/outdev/transparent.cxx
+++ b/vcl/source/outdev/transparent.cxx
@@ -72,33 +72,33 @@ namespace
Color OutputDevice::ImplDrawModeToColor( const Color& rColor ) const
{
Color aColor( rColor );
- sal_uLong nDrawMode = GetDrawMode();
+ DrawModeFlags nDrawMode = GetDrawMode();
- if( nDrawMode & ( DRAWMODE_BLACKLINE | DRAWMODE_WHITELINE |
- DRAWMODE_GRAYLINE | DRAWMODE_GHOSTEDLINE |
- DRAWMODE_SETTINGSLINE ) )
+ if( nDrawMode & ( DrawModeFlags::BlackLine | DrawModeFlags::WhiteLine |
+ DrawModeFlags::GrayLine | DrawModeFlags::GhostedLine |
+ DrawModeFlags::SettingsLine ) )
{
if( !ImplIsColorTransparent( aColor ) )
{
- if( nDrawMode & DRAWMODE_BLACKLINE )
+ if( nDrawMode & DrawModeFlags::BlackLine )
{
aColor = Color( COL_BLACK );
}
- else if( nDrawMode & DRAWMODE_WHITELINE )
+ else if( nDrawMode & DrawModeFlags::WhiteLine )
{
aColor = Color( COL_WHITE );
}
- else if( nDrawMode & DRAWMODE_GRAYLINE )
+ else if( nDrawMode & DrawModeFlags::GrayLine )
{
const sal_uInt8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
- else if( nDrawMode & DRAWMODE_SETTINGSLINE )
+ else if( nDrawMode & DrawModeFlags::SettingsLine )
{
aColor = GetSettings().GetStyleSettings().GetFontColor();
}
- if( nDrawMode & DRAWMODE_GHOSTEDLINE )
+ if( nDrawMode & DrawModeFlags::GhostedLine )
{
aColor = Color( ( aColor.GetRed() >> 1 ) | 0x80,
( aColor.GetGreen() >> 1 ) | 0x80,
@@ -601,7 +601,7 @@ void OutputDevice::DrawTransparent( const tools::PolyPolygon& rPolyPoly,
sal_uInt16 nTransparencePercent )
{
// short circuit for drawing an opaque polygon
- if( (nTransparencePercent < 1) || ((mnDrawMode & DRAWMODE_NOTRANSPARENCY) != 0) )
+ if( (nTransparencePercent < 1) || (mnDrawMode & DrawModeFlags::NoTransparency) )
{
DrawPolyPolygon( rPolyPoly );
return;
@@ -663,7 +663,7 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos,
return;
if( ( rTransparenceGradient.GetStartColor() == aBlack && rTransparenceGradient.GetEndColor() == aBlack ) ||
- ( mnDrawMode & ( DRAWMODE_NOTRANSPARENCY ) ) )
+ ( mnDrawMode & ( DrawModeFlags::NoTransparency ) ) )
{
( (GDIMetaFile&) rMtf ).WindStart();
( (GDIMetaFile&) rMtf ).Play( this, rPos, rSize );
@@ -731,9 +731,9 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos,
// create alpha mask from gradient and get as Bitmap
xVDev->EnableMapMode(bBufferMapModeEnabled);
- xVDev->SetDrawMode(DRAWMODE_GRAYGRADIENT);
+ xVDev->SetDrawMode(DrawModeFlags::GrayGradient);
xVDev->DrawGradient(Rectangle(rPos, rSize), rTransparenceGradient);
- xVDev->SetDrawMode(DRAWMODE_DEFAULT);
+ xVDev->SetDrawMode(DrawModeFlags::Default);
xVDev->EnableMapMode(false);
const AlphaMask aAlpha(xVDev->GetBitmap(aPoint, xVDev->GetOutputSizePixel()));
@@ -768,8 +768,8 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos,
xVDev->SetLineColor( COL_BLACK );
xVDev->SetFillColor( COL_BLACK );
xVDev->DrawRect( Rectangle( xVDev->PixelToLogic( Point() ), xVDev->GetOutputSize() ) );
- xVDev->SetDrawMode( DRAWMODE_WHITELINE | DRAWMODE_WHITEFILL | DRAWMODE_WHITETEXT |
- DRAWMODE_WHITEBITMAP | DRAWMODE_WHITEGRADIENT );
+ xVDev->SetDrawMode( DrawModeFlags::WhiteLine | DrawModeFlags::WhiteFill | DrawModeFlags::WhiteText |
+ DrawModeFlags::WhiteBitmap | DrawModeFlags::WhiteGradient );
( (GDIMetaFile&) rMtf ).WindStart();
( (GDIMetaFile&) rMtf ).Play( xVDev.get(), rPos, rSize );
( (GDIMetaFile&) rMtf ).WindStart();
@@ -778,9 +778,9 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos,
xVDev->EnableMapMode( bVDevOldMap ); // #i35331#: MUST NOT use EnableMapMode( sal_True ) here!
// create alpha mask from gradient
- xVDev->SetDrawMode( DRAWMODE_GRAYGRADIENT );
+ xVDev->SetDrawMode( DrawModeFlags::GrayGradient );
xVDev->DrawGradient( Rectangle( rPos, rSize ), rTransparenceGradient );
- xVDev->SetDrawMode( DRAWMODE_DEFAULT );
+ xVDev->SetDrawMode( DrawModeFlags::Default );
xVDev->EnableMapMode( false );
xVDev->DrawMask( Point(), xVDev->GetOutputSizePixel(), aMask, Color( COL_WHITE ) );
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 9901843401ca..65afa5908434 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -280,11 +280,11 @@ void PrintDialog::PrintPreviewWindow::preparePreviewBitmap()
maPageVDev->Erase();
maPageVDev->Push();
maPageVDev->SetMapMode( MAP_100TH_MM );
- sal_uLong nOldDrawMode = maPageVDev->GetDrawMode();
+ DrawModeFlags nOldDrawMode = maPageVDev->GetDrawMode();
if( mbGreyscale )
maPageVDev->SetDrawMode( maPageVDev->GetDrawMode() |
- ( DRAWMODE_GRAYLINE | DRAWMODE_GRAYFILL | DRAWMODE_GRAYTEXT |
- DRAWMODE_GRAYBITMAP | DRAWMODE_GRAYGRADIENT ) );
+ ( DrawModeFlags::GrayLine | DrawModeFlags::GrayFill | DrawModeFlags::GrayText |
+ DrawModeFlags::GrayBitmap | DrawModeFlags::GrayGradient ) );
aMtf.WindStart();
aMtf.Scale( fScale, fScale );
aMtf.WindStart();