X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ca65c0440a7163e4e37e48b1c4329709d722db47..538f3830191e25eaf0edb0a379e08d4f85ee49bc:/include/wx/generic/region.h diff --git a/include/wx/generic/region.h b/include/wx/generic/region.h index 1657415892..7580f863e3 100644 --- a/include/wx/generic/region.h +++ b/include/wx/generic/region.h @@ -18,12 +18,6 @@ class WXDLLEXPORT wxRect; class WXDLLEXPORT wxPoint; -enum wxRegionContain -{ wxOutRegion = 0 -, wxPartRegion = 1 -, wxInRegion = 2 -}; - class WXDLLEXPORT wxRegionGeneric : public wxGDIObject { // DECLARE_DYNAMIC_CLASS(wxRegionGeneric); @@ -33,19 +27,12 @@ public: wxRegionGeneric(const wxPoint& topLeft, const wxPoint& bottomRight); wxRegionGeneric(const wxRect& rect); wxRegionGeneric(); - ~wxRegionGeneric(); - - //# Copying - wxRegionGeneric(const wxRegionGeneric& r) - : wxGDIObject() - { Ref(r); } - wxRegionGeneric& operator= (const wxRegionGeneric& r) - { Ref(r); return (*this); } + virtual ~wxRegionGeneric(); bool Ok() const { return m_refData != NULL; } - bool operator == ( const wxRegionGeneric& region ); - bool operator != ( const wxRegionGeneric& region ) { return !(*this == region); } + bool operator == ( const wxRegionGeneric& region ) const; + bool operator != ( const wxRegionGeneric& region ) const { return !(*this == region); } //# Modify region // Clear current region @@ -97,6 +84,19 @@ public: // Does the region contain the rectangle rect? wxRegionContain Contains(const wxRect& rect) const; + // Use the non-transparent pixels of a wxBitmap for the region to combine + // with this region. First version takes transparency from bitmap's mask, + // second lets the user specify the colour to be treated as transparent + // along with an optional tolerance value. + // NOTE: implemented in common/rgncmn.cpp + bool Union(const wxBitmap& bmp); + bool Union(const wxBitmap& bmp, + const wxColour& transColour, int tolerance = 0); + + // Convert the region to a B&W bitmap with the white pixels being inside + // the region. + wxBitmap ConvertToBitmap() const; + protected: virtual wxObjectRefData *CreateRefData() const; virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const; @@ -109,7 +109,7 @@ public: wxRegionIteratorGeneric(); wxRegionIteratorGeneric(const wxRegionGeneric& region); wxRegionIteratorGeneric(const wxRegionIteratorGeneric& iterator); - ~wxRegionIteratorGeneric(); + virtual ~wxRegionIteratorGeneric(); wxRegionIteratorGeneric& operator=(const wxRegionIteratorGeneric& iterator);