X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/81cfe5e13e9b8a2ec8374af1f7806b05a86d4d4b..4ed51f4d1c02f01489df35b25a96a1d5b25c1478:/wxPython/src/_region.i diff --git a/wxPython/src/_region.i b/wxPython/src/_region.i index 55a9cc4834..779e9deaae 100644 --- a/wxPython/src/_region.i +++ b/wxPython/src/_region.i @@ -40,58 +40,73 @@ enum wxRegionContain }; +// // these constants are used with wxRegion::Combine() in the ports which have +// // this method +// enum wxRegionOp +// { +// // Creates the intersection of the two combined regions. +// wxRGN_AND, + +// // Creates a copy of the region +// wxRGN_COPY, + +// // Combines the parts of first region that are not in the second one +// wxRGN_DIFF, + +// // Creates the union of two combined regions. +// wxRGN_OR, + +// // Creates the union of two regions except for any overlapping areas. +// wxRGN_XOR +// }; + + + +MustHaveApp(wxRegion); class wxRegion : public wxGDIObject { public: wxRegion(wxCoord x=0, wxCoord y=0, wxCoord width=0, wxCoord height=0); - %name(RegionFromBitmap)wxRegion(const wxBitmap& bmp, - const wxColour& transColour = wxNullColour, - int tolerance = 0); -#ifndef __WXMAC__ - %name(RegionFromPoints)wxRegion(int points, wxPoint* points_array, - int fillStyle = wxWINDING_RULE); -#else - %extend { - %name(RegionFromPoints)wxRegion(int points, wxPoint* points_array, - int fillStyle = wxWINDING_RULE) { - wxPyRaiseNotImplemented(); - return NULL; - } - } -#endif + %RenameCtor(RegionFromBitmap, wxRegion(const wxBitmap& bmp)); + %RenameCtor(RegionFromBitmapColour, wxRegion(const wxBitmap& bmp, + const wxColour& transColour, + int tolerance = 0)); + %RenameCtor(RegionFromPoints, wxRegion(int points, wxPoint* points_array, + int fillStyle = wxWINDING_RULE)); ~wxRegion(); void Clear(); -#ifndef __WXMAC__ bool Offset(wxCoord x, wxCoord y); -#endif wxRegionContain Contains(wxCoord x, wxCoord y); - %name(ContainsPoint)wxRegionContain Contains(const wxPoint& pt); - %name(ContainsRect)wxRegionContain Contains(const wxRect& rect); - %name(ContainsRectDim)wxRegionContain Contains(wxCoord x, wxCoord y, wxCoord w, wxCoord h); + %Rename(ContainsPoint, wxRegionContain, Contains(const wxPoint& pt)); + %Rename(ContainsRect, wxRegionContain, Contains(const wxRect& rect)); + %Rename(ContainsRectDim, wxRegionContain, Contains(wxCoord x, wxCoord y, wxCoord w, wxCoord h)); wxRect GetBox(); bool Intersect(wxCoord x, wxCoord y, wxCoord width, wxCoord height); - %name(IntersectRect)bool Intersect(const wxRect& rect); - %name(IntersectRegion)bool Intersect(const wxRegion& region); + %Rename(IntersectRect, bool, Intersect(const wxRect& rect)); + %Rename(IntersectRegion, bool, Intersect(const wxRegion& region)); bool IsEmpty(); + // Is region equal (i.e. covers the same area as another one)? + bool IsEqual(const wxRegion& region) const; + bool Union(wxCoord x, wxCoord y, wxCoord width, wxCoord height); - %name(UnionRect)bool Union(const wxRect& rect); - %name(UnionRegion)bool Union(const wxRegion& region); + %Rename(UnionRect, bool, Union(const wxRect& rect)); + %Rename(UnionRegion, bool, Union(const wxRegion& region)); bool Subtract(wxCoord x, wxCoord y, wxCoord width, wxCoord height); - %name(SubtractRect)bool Subtract(const wxRect& rect); - %name(SubtractRegion)bool Subtract(const wxRegion& region); + %Rename(SubtractRect, bool, Subtract(const wxRect& rect)); + %Rename(SubtractRegion, bool, Subtract(const wxRegion& region)); bool Xor(wxCoord x, wxCoord y, wxCoord width, wxCoord height); - %name(XorRect)bool Xor(const wxRect& rect); - %name(XorRegion)bool Xor(const wxRegion& region); + %Rename(XorRect, bool, Xor(const wxRect& rect)); + %Rename(XorRegion, bool, Xor(const wxRegion& region)); // Convert the region to a B&W bitmap with the white pixels being inside // the region. @@ -101,13 +116,23 @@ public: // with this region. If the bitmap has a mask then it will be used, // otherwise the colour to be treated as transparent may be specified, // along with an optional tolerance value. - %name(UnionBitmap)bool Union(const wxBitmap& bmp, - const wxColour& transColour = wxNullColour, - int tolerance = 0); + %Rename(UnionBitmap, bool, Union(const wxBitmap& bmp)); + %Rename(UnionBitmapColour, bool, Union(const wxBitmap& bmp, + const wxColour& transColour, + int tolerance = 0)); + + +// bool Combine(wxCoord x, wxCoord y, wxCoord w, wxCoord h, wxRegionOp op); +// %Rename(CombineRect, bool , Combine(const wxRect& rect, wxRegionOp op)); +// %Rename(CombineRegion, bool , Combine(const wxRegion& region, wxRegionOp op)); + + %property(Box, GetBox, doc="See `GetBox`"); }; +MustHaveApp(wxRegionIterator); + class wxRegionIterator : public wxObject { public: wxRegionIterator(const wxRegion& region); @@ -132,6 +157,14 @@ public: return self->operator bool(); } }; + + %property(H, GetH, doc="See `GetH`"); + %property(Height, GetHeight, doc="See `GetHeight`"); + %property(Rect, GetRect, doc="See `GetRect`"); + %property(W, GetW, doc="See `GetW`"); + %property(Width, GetWidth, doc="See `GetWidth`"); + %property(X, GetX, doc="See `GetX`"); + %property(Y, GetY, doc="See `GetY`"); };