X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8a16d7370e3cdc7d583a6f14ab11b3a1d27b73df..465de0be705e52c7f97e9bb6169af9d20a7f72a8:/include/wx/gtk/region.h diff --git a/include/wx/gtk/region.h b/include/wx/gtk/region.h index 3aae6270c4..2069305b71 100644 --- a/include/wx/gtk/region.h +++ b/include/wx/gtk/region.h @@ -10,6 +10,10 @@ #ifndef _WX_GTK_REGION_H_ #define _WX_GTK_REGION_H_ +#ifdef __WXGTK3__ +typedef struct _cairo_region cairo_region_t; +#endif + // ---------------------------------------------------------------------------- // wxRegion // ---------------------------------------------------------------------------- @@ -35,8 +39,10 @@ public: InitRect(rect.x, rect.y, rect.width, rect.height); } - wxRegion( size_t n, const wxPoint *points, int fillStyle = wxODDEVEN_RULE ); + wxRegion( size_t n, const wxPoint *points, + wxPolygonFillMode fillStyle = wxODDEVEN_RULE ); +#if wxUSE_IMAGE wxRegion( const wxBitmap& bmp) { Union(bmp); @@ -46,6 +52,7 @@ public: { Union(bmp, transColour, tolerance); } +#endif // wxUSE_IMAGE virtual ~wxRegion(); @@ -53,17 +60,16 @@ public: virtual void Clear(); virtual bool IsEmpty() const; -public: - // Init with GdkRegion, set ref count to 2 so that - // the C++ class will not destroy the region! - wxRegion( GdkRegion *region ); - +#ifdef __WXGTK3__ + cairo_region_t* GetRegion() const; +#else + wxRegion(const GdkRegion* region); GdkRegion *GetRegion() const; +#endif protected: - // ref counting code - virtual wxObjectRefData *CreateRefData() const; - virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const; + virtual wxGDIRefData *CreateGDIRefData() const; + virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; // wxRegionBase pure virtuals virtual bool DoIsEqual(const wxRegion& region) const; @@ -94,6 +100,10 @@ class WXDLLIMPEXP_CORE wxRegionIterator: public wxObject public: wxRegionIterator(); wxRegionIterator(const wxRegion& region); + wxRegionIterator(const wxRegionIterator& ri) : wxObject(ri) { Init(); *this = ri; } + ~wxRegionIterator(); + + wxRegionIterator& operator=(const wxRegionIterator& ri); void Reset() { m_current = 0u; } void Reset(const wxRegion& region); @@ -113,10 +123,14 @@ public: wxRect GetRect() const; private: - size_t m_current; + void Init(); + void CreateRects( const wxRegion& r ); + wxRegion m_region; + wxRect *m_rects; + int m_numRects; + int m_current; -private: DECLARE_DYNAMIC_CLASS(wxRegionIterator) };