#include "wx/list.h"
#include "wx/gdiobj.h"
+#include "wx/gdicmn.h"
+
+// ----------------------------------------------------------------------------
+// A list of rectangles type used by wxRegion and wxWindow
+// ----------------------------------------------------------------------------
+
+WX_DECLARE_LIST(wxRect, wxRectList);
-class WXDLLEXPORT wxRect;
-class WXDLLEXPORT wxPoint;
enum wxRegionContain {
wxOutRegion = 0, wxPartRegion = 1, wxInRegion = 2
// Is region empty?
bool Empty() const;
- inline bool IsEmpty() const { return Empty(); }
+ inline bool IsEmpty() const { return Empty(); }
+ bool Ok() const { return (m_refData != NULL) ; }
//# Tests
// Does the region contain the point (x,y)?
bool Combine(long x, long y, long width, long height, wxRegionOp op);
bool Combine(const wxRegion& region, wxRegionOp op);
bool Combine(const wxRect& rect, wxRegionOp op);
+
+ // Get the internal Region handle
+ WXRegion GetXRegion() const;
+
+// 'Naughty' functions that allow wxWindows to use a list of rects
+// instead of the region, in certain circumstances (e.g. when
+// making a region out of the update rectangles).
+// These are used by wxPaintDC::wxPaintDC and wxRegionIterator::Reset.
+ bool UsingRects() const;
+ wxRect* GetRects();
+ int GetRectCount() const;
+ void SetRects(const wxRectList& rectList);
+ void SetRects(int count, const wxRect* rects);
};
class WXDLLEXPORT wxRegionIterator : public wxObject {
long GetWidth() const { return GetW(); }
long GetH() const;
long GetHeight() const { return GetH(); }
+ wxRect GetRect() const { return wxRect(GetX(), GetY(), GetWidth(), GetHeight()); }
private:
long m_current;
long m_numRects;
wxRegion m_region;
- wxRect* m_rects;
+ wxRect* m_rects;
};
#endif