diff options
author | Noel Grandin <noel@peralex.com> | 2014-09-27 14:52:40 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-09-30 09:58:23 +0200 |
commit | 8dbde0845a3989528614addb9bd0333f60c522a5 (patch) | |
tree | c1f13bfc8e2841427eb6a07e2147445b309b1e9a /include/vcl/region.hxx | |
parent | b69478acff4f5b7a9d334a765a1a528d44d7b3a4 (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 'include/vcl/region.hxx')
-rw-r--r-- | include/vcl/region.hxx | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/include/vcl/region.hxx b/include/vcl/region.hxx index 6f334f7e11fe..f4d2dd31644a 100644 --- a/include/vcl/region.hxx +++ b/include/vcl/region.hxx @@ -31,18 +31,22 @@ class RegionBand; class Polygon; class PolyPolygon; namespace vcl { class Window; } +class OutputDevice; +class Bitmap; typedef boost::shared_ptr< RegionBand > RegionBandPtr; typedef boost::shared_ptr< PolyPolygon > PolyPolygonPtr; typedef boost::shared_ptr< basegfx::B2DPolyPolygon > B2DPolyPolygonPtr; typedef std::vector< Rectangle > RectangleVector; +namespace vcl { + class VCL_DLLPUBLIC Region { private: - friend class OutputDevice; - friend class vcl::Window; - friend class Bitmap; + friend class ::OutputDevice; + friend class ::vcl::Window; + friend class ::Bitmap; // possible contents B2DPolyPolygonPtr mpB2DPolyPolygon; @@ -66,7 +70,7 @@ public: explicit Region(const Polygon& rPolygon); explicit Region(const PolyPolygon& rPolyPoly); explicit Region(const basegfx::B2DPolyPolygon&); - Region(const Region& rRegion); + Region(const vcl::Region& rRegion); ~Region(); // direct access to contents @@ -87,10 +91,10 @@ public: bool Intersect( const Rectangle& rRegion ); bool Exclude( const Rectangle& rRegion ); bool XOr( const Rectangle& rRegion ); - bool Union( const Region& rRegion ); - bool Intersect( const Region& rRegion ); - bool Exclude( const Region& rRegion ); - bool XOr( const Region& rRegion ); + bool Union( const vcl::Region& rRegion ); + bool Intersect( const vcl::Region& rRegion ); + bool Exclude( const vcl::Region& rRegion ); + bool XOr( const vcl::Region& rRegion ); bool IsEmpty() const; bool IsNull() const { return mbIsNull;} @@ -106,31 +110,32 @@ public: bool IsInside( const Rectangle& rRect ) const; bool IsOver( const Rectangle& rRect ) const; - Region& operator=( const Region& rRegion ); - Region& operator=( const Rectangle& rRect ); + vcl::Region& operator=( const vcl::Region& rRegion ); + vcl::Region& operator=( const Rectangle& rRect ); - bool operator==( const Region& rRegion ) const; - bool operator!=( const Region& rRegion ) const { return !(Region::operator==( rRegion )); } + bool operator==( const vcl::Region& rRegion ) const; + bool operator!=( const vcl::Region& rRegion ) const { return !(Region::operator==( rRegion )); } - friend VCL_DLLPUBLIC SvStream& ReadRegion( SvStream& rIStm, Region& rRegion ); - friend VCL_DLLPUBLIC SvStream& WriteRegion( SvStream& rOStm, const Region& rRegion ); + friend VCL_DLLPUBLIC SvStream& ReadRegion( SvStream& rIStm, vcl::Region& rRegion ); + friend VCL_DLLPUBLIC SvStream& WriteRegion( SvStream& rOStm, const vcl::Region& rRegion ); /* workaround: faster conversion for PolyPolygons * if half of the Polygons contained in rPolyPoly are actually - * rectangles, then the returned Region will be constructed by + * rectangles, then the returned vcl::Region will be constructed by * XOr'ing the contained Polygons together; in the case of * only Rectangles this can be up to eight times faster than * Region( const PolyPolygon& ). - * Caution: this is only useful if the Region is known to be + * Caution: this is only useful if the vcl::Region is known to be * changed to rectangles; e.g. if being set as clip region */ - static Region GetRegionFromPolyPolygon( const PolyPolygon& rPolyPoly ); + static vcl::Region GetRegionFromPolyPolygon( const PolyPolygon& rPolyPoly ); }; +} /* namespace vcl */ template< typename charT, typename traits > inline std::basic_ostream<charT, traits> & operator <<( - std::basic_ostream<charT, traits> & stream, const Region& rRegion) + std::basic_ostream<charT, traits> & stream, const vcl::Region& rRegion) { if (rRegion.IsEmpty()) return stream << "EMPTY"; |