summaryrefslogtreecommitdiff
path: root/vcl/source/gdi
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-09-27 14:52:40 +0200
committerNoel Grandin <noel@peralex.com>2014-09-30 09:58:23 +0200
commit8dbde0845a3989528614addb9bd0333f60c522a5 (patch)
treec1f13bfc8e2841427eb6a07e2147445b309b1e9a /vcl/source/gdi
parentb69478acff4f5b7a9d334a765a1a528d44d7b3a4 (diff)
fdo#82577: Handle Region
Put the VCL Region class in the vcl namespace. Avoids clash with the X11 Region typedef. Change-Id: I6e008111df7cf37121fbc3eaabd44a8306338291
Diffstat (limited to 'vcl/source/gdi')
-rw-r--r--vcl/source/gdi/bitmap.cxx4
-rw-r--r--vcl/source/gdi/cvtsvm.cxx10
-rw-r--r--vcl/source/gdi/gdimetafiletools.cxx4
-rw-r--r--vcl/source/gdi/gdimtf.cxx14
-rw-r--r--vcl/source/gdi/impanmvw.cxx4
-rw-r--r--vcl/source/gdi/impanmvw.hxx2
-rw-r--r--vcl/source/gdi/metaact.cxx4
-rw-r--r--vcl/source/gdi/pdfwriter_impl2.cxx4
-rw-r--r--vcl/source/gdi/print.cxx4
-rw-r--r--vcl/source/gdi/print3.cxx2
-rw-r--r--vcl/source/gdi/region.cxx118
-rw-r--r--vcl/source/gdi/salgdilayout.cxx8
12 files changed, 91 insertions, 87 deletions
diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx
index 24fd842036a2..5f6477a00b82 100644
--- a/vcl/source/gdi/bitmap.cxx
+++ b/vcl/source/gdi/bitmap.cxx
@@ -1361,9 +1361,9 @@ Bitmap Bitmap::CreateMask( const Color& rTransColor, sal_uLong nTol ) const
return aNewBmp;
}
-Region Bitmap::CreateRegion( const Color& rColor, const Rectangle& rRect ) const
+vcl::Region Bitmap::CreateRegion( const Color& rColor, const Rectangle& rRect ) const
{
- Region aRegion;
+ vcl::Region aRegion;
Rectangle aRect( rRect );
BitmapReadAccess* pReadAcc = ( (Bitmap*) this )->AcquireReadAccess();
diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx
index 1da9c12da22e..8ee40c3197d0 100644
--- a/vcl/source/gdi/cvtsvm.cxx
+++ b/vcl/source/gdi/cvtsvm.cxx
@@ -1005,7 +1005,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_CLIPREGION_ACTION ):
{
- Region aRegion;
+ vcl::Region aRegion;
sal_Int16 nRegType;
sal_Int16 bIntersect;
bool bClip = false;
@@ -1023,7 +1023,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
Rectangle aRegRect;
ImplReadRect( rIStm, aRegRect );
- aRegion = Region( aRegRect );
+ aRegion = vcl::Region( aRegRect );
bClip = true;
}
break;
@@ -1031,7 +1031,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( 2 ):
{
ImplReadPoly( rIStm, aActionPoly );
- aRegion = Region( aActionPoly );
+ aRegion = vcl::Region( aActionPoly );
bClip = true;
}
break;
@@ -1049,7 +1049,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
aPolyPoly.Insert( aActionPoly );
}
- aRegion = Region( aPolyPoly );
+ aRegion = vcl::Region( aPolyPoly );
bClip = true;
}
break;
@@ -1937,7 +1937,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
case( META_CLIPREGION_ACTION ):
{
const MetaClipRegionAction* pAct = static_cast<const MetaClipRegionAction*>(pAction);
- const Region& rRegion = pAct->GetRegion();
+ const vcl::Region& rRegion = pAct->GetRegion();
Rectangle aClipRect;
rOStm.WriteInt16( GDI_CLIPREGION_ACTION );
diff --git a/vcl/source/gdi/gdimetafiletools.cxx b/vcl/source/gdi/gdimetafiletools.cxx
index a0afe289a93f..97cea08278c3 100644
--- a/vcl/source/gdi/gdimetafiletools.cxx
+++ b/vcl/source/gdi/gdimetafiletools.cxx
@@ -297,7 +297,7 @@ void clipMetafileContentAgainstOwnRegions(GDIMetaFile& rSource)
if(pA->IsClipping())
{
- const Region& rRegion = pA->GetRegion();
+ const vcl::Region& rRegion = pA->GetRegion();
const basegfx::B2DPolyPolygon aNewClip(rRegion.GetAsB2DPolyPolygon());
aClips.back() = aNewClip;
@@ -333,7 +333,7 @@ void clipMetafileContentAgainstOwnRegions(GDIMetaFile& rSource)
case META_ISECTREGIONCLIPREGION_ACTION :
{
const MetaISectRegionClipRegionAction* pA = static_cast< const MetaISectRegionClipRegionAction* >(pAction);
- const Region& rRegion = pA->GetRegion();
+ const vcl::Region& rRegion = pA->GetRegion();
if(!rRegion.IsEmpty() && aClips.size() && aClips.back().count())
{
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index ff71ff3212c9..b631331bad5f 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -531,7 +531,7 @@ void GDIMetaFile::ImplDelegate2PluggableRenderer( const MetaCommentAction* pAct,
void GDIMetaFile::Play( OutputDevice* pOut, const Point& rPos,
const Size& rSize, size_t nPos )
{
- Region aDrawClipRegion;
+ vcl::Region aDrawClipRegion;
MapMode aDrawMap( GetPrefMapMode() );
Size aDestSize( pOut->LogicToPixel( rSize ) );
@@ -843,7 +843,7 @@ void GDIMetaFile::Clip( const Rectangle& i_rClipRect )
else if( nType == META_CLIPREGION_ACTION )
{
MetaClipRegionAction* pOldAct = static_cast<MetaClipRegionAction*>(pAct);
- Region aNewReg( aCurRect );
+ vcl::Region aNewReg( aCurRect );
if( pOldAct->IsClipping() )
aNewReg.Intersect( pOldAct->GetRegion() );
MetaClipRegionAction* pNewAct = new MetaClipRegionAction( aNewReg, true );
@@ -1282,7 +1282,7 @@ void GDIMetaFile::Rotate( long nAngle10 )
MetaClipRegionAction* pAct = static_cast<MetaClipRegionAction*>(pAction);
if( pAct->IsClipping() && pAct->GetRegion().HasPolyPolygonOrB2DPolyPolygon() )
- aMtf.AddAction( new MetaClipRegionAction( Region( ImplGetRotatedPolyPolygon( pAct->GetRegion().GetAsPolyPolygon(), aRotAnchor, aRotOffset, fSin, fCos ) ), true ) );
+ aMtf.AddAction( new MetaClipRegionAction( vcl::Region( ImplGetRotatedPolyPolygon( pAct->GetRegion().GetAsPolyPolygon(), aRotAnchor, aRotOffset, fSin, fCos ) ), true ) );
else
{
pAction->Duplicate();
@@ -1294,7 +1294,7 @@ void GDIMetaFile::Rotate( long nAngle10 )
case( META_ISECTRECTCLIPREGION_ACTION ):
{
MetaISectRectClipRegionAction* pAct = static_cast<MetaISectRectClipRegionAction*>(pAction);
- aMtf.AddAction( new MetaISectRegionClipRegionAction(Region(
+ aMtf.AddAction( new MetaISectRegionClipRegionAction(vcl::Region(
ImplGetRotatedPolygon( pAct->GetRect(), aRotAnchor,
aRotOffset, fSin, fCos )) ) );
}
@@ -1303,10 +1303,10 @@ void GDIMetaFile::Rotate( long nAngle10 )
case( META_ISECTREGIONCLIPREGION_ACTION ):
{
MetaISectRegionClipRegionAction* pAct = static_cast<MetaISectRegionClipRegionAction*>(pAction);
- const Region& rRegion = pAct->GetRegion();
+ const vcl::Region& rRegion = pAct->GetRegion();
if( rRegion.HasPolyPolygonOrB2DPolyPolygon() )
- aMtf.AddAction( new MetaISectRegionClipRegionAction( Region( ImplGetRotatedPolyPolygon( rRegion.GetAsPolyPolygon(), aRotAnchor, aRotOffset, fSin, fCos ) ) ) );
+ aMtf.AddAction( new MetaISectRegionClipRegionAction( vcl::Region( ImplGetRotatedPolyPolygon( rRegion.GetAsPolyPolygon(), aRotAnchor, aRotOffset, fSin, fCos ) ) ) );
else
{
pAction->Duplicate();
@@ -2608,7 +2608,7 @@ sal_uLong GDIMetaFile::GetChecksum() const
case META_CLIPREGION_ACTION :
{
MetaClipRegionAction& rAct = static_cast<MetaClipRegionAction&>(*pAction);
- const Region& rRegion = rAct.GetRegion();
+ const vcl::Region& rRegion = rAct.GetRegion();
if(rRegion.HasPolyPolygonOrB2DPolyPolygon())
{
diff --git a/vcl/source/gdi/impanmvw.cxx b/vcl/source/gdi/impanmvw.cxx
index bf36ae962c1a..293b148e7230 100644
--- a/vcl/source/gdi/impanmvw.cxx
+++ b/vcl/source/gdi/impanmvw.cxx
@@ -155,7 +155,7 @@ void ImplAnimView::ImplGetPosSize( const AnimationBitmap& rAnm, Point& rPosPix,
void ImplAnimView::ImplDrawToPos( sal_uLong nPos )
{
VirtualDevice aVDev;
- boost::scoped_ptr<Region> pOldClip(!maClip.IsNull() ? new Region( mpOut->GetClipRegion() ) : NULL);
+ boost::scoped_ptr<vcl::Region> pOldClip(!maClip.IsNull() ? new vcl::Region( mpOut->GetClipRegion() ) : NULL);
aVDev.SetOutputSizePixel( maSzPix, false );
nPos = std::min( nPos, (sal_uLong) mpParent->Count() - 1UL );
@@ -266,7 +266,7 @@ void ImplAnimView::ImplDraw( sal_uLong nPos, VirtualDevice* pVDev )
if( !pVDev )
{
- boost::scoped_ptr<Region> pOldClip(!maClip.IsNull() ? new Region( mpOut->GetClipRegion() ) : NULL);
+ boost::scoped_ptr<vcl::Region> pOldClip(!maClip.IsNull() ? new vcl::Region( mpOut->GetClipRegion() ) : NULL);
if( pOldClip )
mpOut->SetClipRegion( maClip );
diff --git a/vcl/source/gdi/impanmvw.hxx b/vcl/source/gdi/impanmvw.hxx
index 2cb0aecf264a..82e61e3a6964 100644
--- a/vcl/source/gdi/impanmvw.hxx
+++ b/vcl/source/gdi/impanmvw.hxx
@@ -42,7 +42,7 @@ private:
Size maDispSz;
Size maRestSz;
MapMode maMap;
- Region maClip;
+ vcl::Region maClip;
VirtualDevice* mpBackground;
VirtualDevice* mpRestore;
sal_uLong mnActPos;
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index b1f2f5aac21d..a5c5cf61f400 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -2440,7 +2440,7 @@ MetaClipRegionAction::MetaClipRegionAction() :
MetaClipRegionAction::~MetaClipRegionAction()
{}
-MetaClipRegionAction::MetaClipRegionAction( const Region& rRegion, bool bClip ) :
+MetaClipRegionAction::MetaClipRegionAction( const vcl::Region& rRegion, bool bClip ) :
MetaAction ( META_CLIPREGION_ACTION ),
maRegion ( rRegion ),
mbClip ( bClip )
@@ -2552,7 +2552,7 @@ MetaISectRegionClipRegionAction::MetaISectRegionClipRegionAction() :
MetaISectRegionClipRegionAction::~MetaISectRegionClipRegionAction()
{}
-MetaISectRegionClipRegionAction::MetaISectRegionClipRegionAction( const Region& rRegion ) :
+MetaISectRegionClipRegionAction::MetaISectRegionClipRegionAction( const vcl::Region& rRegion ) :
MetaAction ( META_ISECTREGIONCLIPREGION_ACTION ),
maRegion ( rRegion )
{
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
index 2d0a4d0cf551..686ebd4b1eab 100644
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -879,7 +879,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa
m_rOuterFace.SetClipRegion( basegfx::B2DPolyPolygon() );
else
{
- Region aReg( pA->GetRegion() );
+ vcl::Region aReg( pA->GetRegion() );
m_rOuterFace.SetClipRegion( aReg.GetAsB2DPolyPolygon() );
}
}
@@ -898,7 +898,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa
case( META_ISECTREGIONCLIPREGION_ACTION ):
{
const MetaISectRegionClipRegionAction* pA = static_cast<const MetaISectRegionClipRegionAction*>(pAction);
- Region aReg( pA->GetRegion() );
+ vcl::Region aReg( pA->GetRegion() );
m_rOuterFace.IntersectClipRegion( aReg.GetAsB2DPolyPolygon() );
}
break;
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index a901a312564b..3951e5720da3 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -288,7 +288,7 @@ void Printer::EmulateDrawTransparent ( const PolyPolygon& rPolyPoly,
}
Push( PUSH_CLIPREGION | PUSH_LINECOLOR );
- IntersectClipRegion(Region(rPolyPoly));
+ IntersectClipRegion(vcl::Region(rPolyPoly));
SetLineColor( GetFillColor() );
const bool bOldMap = mbMap;
EnableMapMode( false );
@@ -868,7 +868,7 @@ void Printer::DrawDeviceMask( const Bitmap& rMask, const Color& rMaskColor,
pMapY[ nY ] = aDestPt.Y() + FRound( (double) aDestSz.Height() * nY / nSrcHeight );
// walk through all rectangles of mask
- const Region aWorkRgn(aMask.CreateRegion(COL_BLACK, Rectangle(Point(), aMask.GetSizePixel())));
+ const vcl::Region aWorkRgn(aMask.CreateRegion(COL_BLACK, Rectangle(Point(), aMask.GetSizePixel())));
RectangleVector aRectangles;
aWorkRgn.GetRegionRectangles(aRectangles);
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index b87425f2934c..90969a3f1669 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -1013,7 +1013,7 @@ static void appendSubPage( GDIMetaFile& o_rMtf, const Rectangle& i_rClipRect, GD
o_rMtf.AddAction( new MetaPushAction( PUSH_ALL ) );
// clip to page rect
- o_rMtf.AddAction( new MetaClipRegionAction( Region( i_rClipRect ), true ) );
+ o_rMtf.AddAction( new MetaClipRegionAction( vcl::Region( i_rClipRect ), true ) );
// append the subpage
io_rSubPage.WindStart();
diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx
index 6e9d528ba5ef..cf011f1c37f6 100644
--- a/vcl/source/gdi/region.cxx
+++ b/vcl/source/gdi/region.cxx
@@ -221,7 +221,9 @@ namespace
}
} // end of anonymous namespace
-bool Region::IsEmpty() const
+namespace vcl {
+
+bool vcl::Region::IsEmpty() const
{
return !mbIsNull && !mpB2DPolyPolygon.get() && !mpPolyPolygon.get() && !mpRegionBand.get();
}
@@ -275,7 +277,7 @@ RegionBand* ImplCreateRegionBandFromPolyPolygon(const PolyPolygon& rPolyPolygon)
return pRetval;
}
-PolyPolygon Region::ImplCreatePolyPolygonFromRegionBand() const
+PolyPolygon vcl::Region::ImplCreatePolyPolygonFromRegionBand() const
{
PolyPolygon aRetval;
@@ -297,7 +299,7 @@ PolyPolygon Region::ImplCreatePolyPolygonFromRegionBand() const
return aRetval;
}
-basegfx::B2DPolyPolygon Region::ImplCreateB2DPolyPolygonFromRegionBand() const
+basegfx::B2DPolyPolygon vcl::Region::ImplCreateB2DPolyPolygonFromRegionBand() const
{
PolyPolygon aPoly(ImplCreatePolyPolygonFromRegionBand());
@@ -360,7 +362,7 @@ Region::Region(const basegfx::B2DPolyPolygon& rPolyPoly)
}
}
-Region::Region(const Region& rRegion)
+Region::Region(const vcl::Region& rRegion)
: mpB2DPolyPolygon(rRegion.mpB2DPolyPolygon),
mpPolyPolygon(rRegion.mpPolyPolygon),
mpRegionBand(rRegion.mpRegionBand),
@@ -372,7 +374,7 @@ Region::~Region()
{
}
-void Region::ImplCreatePolyPolyRegion( const PolyPolygon& rPolyPoly )
+void vcl::Region::ImplCreatePolyPolyRegion( const PolyPolygon& rPolyPoly )
{
const sal_uInt16 nPolyCount = rPolyPoly.Count();
@@ -398,7 +400,7 @@ void Region::ImplCreatePolyPolyRegion( const PolyPolygon& rPolyPoly )
}
}
-void Region::ImplCreatePolyPolyRegion( const basegfx::B2DPolyPolygon& rPolyPoly )
+void vcl::Region::ImplCreatePolyPolyRegion( const basegfx::B2DPolyPolygon& rPolyPoly )
{
if(rPolyPoly.count() && !rPolyPoly.getB2DRange().isEmpty())
{
@@ -407,7 +409,7 @@ void Region::ImplCreatePolyPolyRegion( const basegfx::B2DPolyPolygon& rPolyPoly
}
}
-void Region::Move( long nHorzMove, long nVertMove )
+void vcl::Region::Move( long nHorzMove, long nVertMove )
{
if(IsNull() || IsEmpty())
{
@@ -454,7 +456,7 @@ void Region::Move( long nHorzMove, long nVertMove )
}
}
-void Region::Scale( double fScaleX, double fScaleY )
+void vcl::Region::Scale( double fScaleX, double fScaleY )
{
if(IsNull() || IsEmpty())
{
@@ -501,7 +503,7 @@ void Region::Scale( double fScaleX, double fScaleY )
}
}
-bool Region::Union( const Rectangle& rRect )
+bool vcl::Region::Union( const Rectangle& rRect )
{
if(rRect.IsEmpty())
{
@@ -542,7 +544,7 @@ bool Region::Union( const Rectangle& rRect )
basegfx::tools::solvePolygonOperationOr(
aThisPolyPoly,
basegfx::B2DPolyPolygon(aRectPoly)));
- *this = Region(aClip);
+ *this = vcl::Region(aClip);
}
return true;
@@ -583,7 +585,7 @@ bool Region::Union( const Rectangle& rRect )
return true;
}
-bool Region::Intersect( const Rectangle& rRect )
+bool vcl::Region::Intersect( const Rectangle& rRect )
{
if ( rRect.IsEmpty() )
{
@@ -676,7 +678,7 @@ bool Region::Intersect( const Rectangle& rRect )
return true;
}
-bool Region::Exclude( const Rectangle& rRect )
+bool vcl::Region::Exclude( const Rectangle& rRect )
{
if ( rRect.IsEmpty() )
{
@@ -718,7 +720,7 @@ bool Region::Exclude( const Rectangle& rRect )
const basegfx::B2DPolyPolygon aOtherPolyPoly(aRectPoly);
const basegfx::B2DPolyPolygon aClip = basegfx::tools::solvePolygonOperationDiff(aThisPolyPoly, aOtherPolyPoly);
- *this = Region(aClip);
+ *this = vcl::Region(aClip);
return true;
}
@@ -757,7 +759,7 @@ bool Region::Exclude( const Rectangle& rRect )
return true;
}
-bool Region::XOr( const Rectangle& rRect )
+bool vcl::Region::XOr( const Rectangle& rRect )
{
if ( rRect.IsEmpty() )
{
@@ -801,7 +803,7 @@ bool Region::XOr( const Rectangle& rRect )
const basegfx::B2DPolyPolygon aOtherPolyPoly(aRectPoly);
const basegfx::B2DPolyPolygon aClip = basegfx::tools::solvePolygonOperationXor(aThisPolyPoly, aOtherPolyPoly);
- *this = Region(aClip);
+ *this = vcl::Region(aClip);
return true;
}
@@ -842,7 +844,7 @@ bool Region::XOr( const Rectangle& rRect )
return true;
}
-bool Region::Union( const Region& rRegion )
+bool vcl::Region::Union( const vcl::Region& rRegion )
{
if(rRegion.IsEmpty())
{
@@ -853,7 +855,7 @@ bool Region::Union( const Region& rRegion )
if(rRegion.IsNull())
{
// extending with null region -> null region
- *this = Region(true);
+ *this = vcl::Region(true);
return true;
}
@@ -891,7 +893,7 @@ bool Region::Union( const Region& rRegion )
// use logical OR operation
basegfx::B2DPolyPolygon aClip(basegfx::tools::solvePolygonOperationOr(aThisPolyPoly, aOtherPolyPoly));
- *this = Region( aClip );
+ *this = vcl::Region( aClip );
return true;
}
@@ -930,7 +932,7 @@ bool Region::Union( const Region& rRegion )
return true;
}
-bool Region::Intersect( const Region& rRegion )
+bool vcl::Region::Intersect( const vcl::Region& rRegion )
{
// same instance data? -> nothing to do!
if(getB2DPolyPolygon() && getB2DPolyPolygon() == rRegion.getB2DPolyPolygon())
@@ -1001,7 +1003,7 @@ bool Region::Intersect( const Region& rRegion )
aThisPolyPoly,
true,
false));
- *this = Region( aClip );
+ *this = vcl::Region( aClip );
return true;
}
@@ -1027,7 +1029,7 @@ bool Region::Intersect( const Region& rRegion )
if(pCurrent->getRectangleCount() + 2 < pSource->getRectangleCount())
{
// when we have less rectangles, turn around the call
- Region aTempRegion = rRegion;
+ vcl::Region aTempRegion = rRegion;
aTempRegion.Intersect( *this );
*this = aTempRegion;
}
@@ -1052,7 +1054,7 @@ bool Region::Intersect( const Region& rRegion )
return true;
}
-bool Region::Exclude( const Region& rRegion )
+bool vcl::Region::Exclude( const vcl::Region& rRegion )
{
if ( rRegion.IsEmpty() )
{
@@ -1099,7 +1101,7 @@ bool Region::Exclude( const Region& rRegion )
aOtherPolyPoly = basegfx::tools::prepareForPolygonOperation( aOtherPolyPoly );
basegfx::B2DPolyPolygon aClip = basegfx::tools::solvePolygonOperationDiff( aThisPolyPoly, aOtherPolyPoly );
- *this = Region( aClip );
+ *this = vcl::Region( aClip );
return true;
}
@@ -1137,7 +1139,7 @@ bool Region::Exclude( const Region& rRegion )
return true;
}
-bool Region::XOr( const Region& rRegion )
+bool vcl::Region::XOr( const vcl::Region& rRegion )
{
if ( rRegion.IsEmpty() )
{
@@ -1187,7 +1189,7 @@ bool Region::XOr( const Region& rRegion )
aOtherPolyPoly = basegfx::tools::prepareForPolygonOperation( aOtherPolyPoly );
basegfx::B2DPolyPolygon aClip = basegfx::tools::solvePolygonOperationXor( aThisPolyPoly, aOtherPolyPoly );
- *this = Region( aClip );
+ *this = vcl::Region( aClip );
return true;
}
@@ -1227,7 +1229,7 @@ bool Region::XOr( const Region& rRegion )
return true;
}
-Rectangle Region::GetBoundRect() const
+Rectangle vcl::Region::GetBoundRect() const
{
if(IsEmpty())
{
@@ -1274,7 +1276,7 @@ Rectangle Region::GetBoundRect() const
return Rectangle();
}
-const PolyPolygon Region::GetAsPolyPolygon() const
+const PolyPolygon vcl::Region::GetAsPolyPolygon() const
{
if(getPolyPolygon())
{
@@ -1285,7 +1287,7 @@ const PolyPolygon Region::GetAsPolyPolygon() const
{
// the polygon needs to be converted, buffer the down converion
const PolyPolygon aPolyPolgon(*getB2DPolyPolygon());
- const_cast< Region* >(this)->mpPolyPolygon.reset(new PolyPolygon(aPolyPolgon));
+ const_cast< vcl::Region* >(this)->mpPolyPolygon.reset(new PolyPolygon(aPolyPolgon));
return *getPolyPolygon();
}
@@ -1294,7 +1296,7 @@ const PolyPolygon Region::GetAsPolyPolygon() const
{
// the BandRegion needs to be converted, buffer the converion
const PolyPolygon aPolyPolgon(ImplCreatePolyPolygonFromRegionBand());
- const_cast< Region* >(this)->mpPolyPolygon.reset(new PolyPolygon(aPolyPolgon));
+ const_cast< vcl::Region* >(this)->mpPolyPolygon.reset(new PolyPolygon(aPolyPolgon));
return *getPolyPolygon();
}
@@ -1302,7 +1304,7 @@ const PolyPolygon Region::GetAsPolyPolygon() const
return PolyPolygon();
}
-const basegfx::B2DPolyPolygon Region::GetAsB2DPolyPolygon() const
+const basegfx::B2DPolyPolygon vcl::Region::GetAsB2DPolyPolygon() const
{
if(getB2DPolyPolygon())
{
@@ -1313,7 +1315,7 @@ const basegfx::B2DPolyPolygon Region::GetAsB2DPolyPolygon() const
{
// the polygon needs to be converted, buffer the up conversion. This will be preferred from now.
const basegfx::B2DPolyPolygon aB2DPolyPolygon(getPolyPolygon()->getB2DPolyPolygon());
- const_cast< Region* >(this)->mpB2DPolyPolygon.reset(new basegfx::B2DPolyPolygon(aB2DPolyPolygon));
+ const_cast< vcl::Region* >(this)->mpB2DPolyPolygon.reset(new basegfx::B2DPolyPolygon(aB2DPolyPolygon));
return *getB2DPolyPolygon();
}
@@ -1322,7 +1324,7 @@ const basegfx::B2DPolyPolygon Region::GetAsB2DPolyPolygon() const
{
// the BandRegion needs to be converted, buffer the converion
const basegfx::B2DPolyPolygon aB2DPolyPolygon(ImplCreateB2DPolyPolygonFromRegionBand());
- const_cast< Region* >(this)->mpB2DPolyPolygon.reset(new basegfx::B2DPolyPolygon(aB2DPolyPolygon));
+ const_cast< vcl::Region* >(this)->mpB2DPolyPolygon.reset(new basegfx::B2DPolyPolygon(aB2DPolyPolygon));
return *getB2DPolyPolygon();
}
@@ -1330,26 +1332,26 @@ const basegfx::B2DPolyPolygon Region::GetAsB2DPolyPolygon() const
return basegfx::B2DPolyPolygon();
}
-const RegionBand* Region::GetAsRegionBand() const
+const RegionBand* vcl::Region::GetAsRegionBand() const
{
if(!getRegionBand())
{
if(getB2DPolyPolygon())
{
// convert B2DPolyPolygon to RegionBand, buffer it and return it
- const_cast< Region* >(this)->mpRegionBand.reset(ImplCreateRegionBandFromPolyPolygon(PolyPolygon(*getB2DPolyPolygon())));
+ const_cast< vcl::Region* >(this)->mpRegionBand.reset(ImplCreateRegionBandFromPolyPolygon(PolyPolygon(*getB2DPolyPolygon())));
}
else if(getPolyPolygon())
{
// convert B2DPolyPolygon to RegionBand, buffer it and return it
- const_cast< Region* >(this)->mpRegionBand.reset(ImplCreateRegionBandFromPolyPolygon(*getPolyPolygon()));
+ const_cast< vcl::Region* >(this)->mpRegionBand.reset(ImplCreateRegionBandFromPolyPolygon(*getPolyPolygon()));
}
}
return getRegionBand();
}
-bool Region::IsInside( const Point& rPoint ) const
+bool vcl::Region::IsInside( const Point& rPoint ) const
{
if(IsEmpty())
{
@@ -1380,7 +1382,7 @@ bool Region::IsInside( const Point& rPoint ) const
return false;
}
-bool Region::IsInside( const Rectangle& rRect ) const
+bool vcl::Region::IsInside( const Rectangle& rRect ) const
{
if(IsEmpty())
{
@@ -1401,14 +1403,14 @@ bool Region::IsInside( const Rectangle& rRect ) const
}
// create region from rectangle and intersect own region
- Region aRegion(rRect);
+ vcl::Region aRegion(rRect);
aRegion.Exclude(*this);
// rectangle is inside if exclusion is empty
return aRegion.IsEmpty();
}
-bool Region::IsOver( const Rectangle& rRect ) const
+bool vcl::Region::IsOver( const Rectangle& rRect ) const
{
if(IsEmpty())
{
@@ -1425,14 +1427,14 @@ bool Region::IsOver( const Rectangle& rRect ) const
// Can we optimize this ??? - is used in StarDraw for brushes pointers
// Why we have no IsOver for Regions ???
// create region from rectangle and intersect own region
- Region aRegion(rRect);
+ vcl::Region aRegion(rRect);
aRegion.Intersect( *this );
// rectangle is over if include is not empty
return !aRegion.IsEmpty();
}
-void Region::SetNull()
+void vcl::Region::SetNull()
{
// reset all content
mpB2DPolyPolygon.reset();
@@ -1441,7 +1443,7 @@ void Region::SetNull()
mbIsNull = true;
}
-void Region::SetEmpty()
+void vcl::Region::SetEmpty()
{
// reset all content
mpB2DPolyPolygon.reset();
@@ -1450,7 +1452,7 @@ void Region::SetEmpty()
mbIsNull = false;
}
-Region& Region::operator=( const Region& rRegion )
+Region& vcl::Region::operator=( const vcl::Region& rRegion )
{
// reset all content
mpB2DPolyPolygon = rRegion.mpB2DPolyPolygon;
@@ -1461,7 +1463,7 @@ Region& Region::operator=( const Region& rRegion )
return *this;
}
-Region& Region::operator=( const Rectangle& rRect )
+Region& vcl::Region::operator=( const Rectangle& rRect )
{
mpB2DPolyPolygon.reset();
mpPolyPolygon.reset();
@@ -1471,7 +1473,7 @@ Region& Region::operator=( const Rectangle& rRect )
return *this;
}
-bool Region::operator==( const Region& rRegion ) const
+bool vcl::Region::operator==( const vcl::Region& rRegion ) const
{
if(IsNull() && rRegion.IsNull())
{
@@ -1517,8 +1519,8 @@ bool Region::operator==( const Region& rRegion ) const
{
// one of both has a B2DPolyPolygon based region, ensure both have it
// by evtl. conversion
- const_cast< Region* >(this)->GetAsB2DPolyPolygon();
- const_cast< Region& >(rRegion).GetAsB2DPolyPolygon();
+ const_cast< vcl::Region* >(this)->GetAsB2DPolyPolygon();
+ const_cast< vcl::Region& >(rRegion).GetAsB2DPolyPolygon();
return *rRegion.getB2DPolyPolygon() == *getB2DPolyPolygon();
}
@@ -1527,8 +1529,8 @@ bool Region::operator==( const Region& rRegion ) const
{
// one of both has a B2DPolyPolygon based region, ensure both have it
// by evtl. conversion
- const_cast< Region* >(this)->GetAsPolyPolygon();
- const_cast< Region& >(rRegion).GetAsPolyPolygon();
+ const_cast< vcl::Region* >(this)->GetAsPolyPolygon();
+ const_cast< vcl::Region& >(rRegion).GetAsPolyPolygon();
return *rRegion.getPolyPolygon() == *getPolyPolygon();
}
@@ -1545,7 +1547,7 @@ bool Region::operator==( const Region& rRegion ) const
return false;
}
-SvStream& ReadRegion(SvStream& rIStrm, Region& rRegion)
+SvStream& ReadRegion(SvStream& rIStrm, vcl::Region& rRegion)
{
VersionCompat aCompat(rIStrm, STREAM_READ);
sal_uInt16 nVersion(0);
@@ -1604,7 +1606,7 @@ SvStream& ReadRegion(SvStream& rIStrm, Region& rRegion)
return rIStrm;
}
-SvStream& WriteRegion( SvStream& rOStrm, const Region& rRegion )
+SvStream& WriteRegion( SvStream& rOStrm, const vcl::Region& rRegion )
{
const sal_uInt16 nVersion(2);
VersionCompat aCompat(rOStrm, STREAM_WRITE, nVersion);
@@ -1676,7 +1678,7 @@ SvStream& WriteRegion( SvStream& rOStrm, const Region& rRegion )
return rOStrm;
}
-void Region::GetRegionRectangles(RectangleVector& rTarget) const
+void vcl::Region::GetRegionRectangles(RectangleVector& rTarget) const
{
// clear returnvalues
rTarget.clear();
@@ -1744,9 +1746,9 @@ static inline bool ImplPolygonRectTest( const Polygon& rPoly, Rectangle* pRectOu
return bIsRect;
}
-Region Region::GetRegionFromPolyPolygon( const PolyPolygon& rPolyPoly )
+vcl::Region vcl::Region::GetRegionFromPolyPolygon( const PolyPolygon& rPolyPoly )
{
- //return Region( rPolyPoly );
+ //return vcl::Region( rPolyPoly );
// check if it's worth extracting the XOr'ing the Rectangles
// empiricism shows that break even between XOr'ing rectangles separately
@@ -1770,10 +1772,10 @@ Region Region::GetRegionFromPolyPolygon( const PolyPolygon& rPolyPoly )
if( nPolygonPolygons > nPolygonRects )
{
- return Region( rPolyPoly );
+ return vcl::Region( rPolyPoly );
}
- Region aResult;
+ vcl::Region aResult;
Rectangle aRect;
for( sal_uInt16 i = 0; i < nPolygons; i++ )
@@ -1786,11 +1788,13 @@ Region Region::GetRegionFromPolyPolygon( const PolyPolygon& rPolyPoly )
}
else
{
- aResult.XOr( Region(rPoly) );
+ aResult.XOr( vcl::Region(rPoly) );
}
}
return aResult;
}
+} /* namespace vcl */
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx
index 1d9430fc7c2b..a331f0b6fd7c 100644
--- a/vcl/source/gdi/salgdilayout.cxx
+++ b/vcl/source/gdi/salgdilayout.cxx
@@ -238,13 +238,13 @@ bool SalGraphics::mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint *
return false;
}
-void SalGraphics::mirror( Region& rRgn, const OutputDevice *pOutDev, bool bBack ) const
+void SalGraphics::mirror( vcl::Region& rRgn, const OutputDevice *pOutDev, bool bBack ) const
{
if( rRgn.HasPolyPolygonOrB2DPolyPolygon() )
{
const basegfx::B2DPolyPolygon aPolyPoly(mirror(rRgn.GetAsB2DPolyPolygon(), pOutDev, bBack));
- rRgn = Region(aPolyPoly);
+ rRgn = vcl::Region(aPolyPoly);
}
else
{
@@ -368,11 +368,11 @@ basegfx::B2DPolyPolygon SalGraphics::mirror( const basegfx::B2DPolyPolygon& i_rP
return aRet;
}
-bool SalGraphics::SetClipRegion( const Region& i_rClip, const OutputDevice *pOutDev )
+bool SalGraphics::SetClipRegion( const vcl::Region& i_rClip, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
- Region aMirror( i_rClip );
+ vcl::Region aMirror( i_rClip );
mirror( aMirror, pOutDev );
return setClipRegion( aMirror );
}