]>
git.saurik.com Git - wxWidgets.git/blob - src/palmos/region.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/palmos/region.cpp
3 // Purpose: wxRegion implementation
4 // Author: William Osborne - minimal working wxPalmOS port
8 // Copyright: (c) William Osborne
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 // For compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
27 #include "wx/region.h"
30 #include "wx/gdicmn.h"
33 IMPLEMENT_DYNAMIC_CLASS(wxRegion
, wxGDIObject
)
34 IMPLEMENT_DYNAMIC_CLASS(wxRegionIterator
, wxObject
)
36 // ----------------------------------------------------------------------------
37 // wxRegionRefData implementation
38 // ----------------------------------------------------------------------------
40 // ============================================================================
41 // wxRegion implementation
42 // ============================================================================
44 // ----------------------------------------------------------------------------
46 // ----------------------------------------------------------------------------
52 wxRegion::wxRegion(WXHRGN hRegion
)
56 wxRegion::wxRegion(wxCoord x
, wxCoord y
, wxCoord w
, wxCoord h
)
60 wxRegion::wxRegion(const wxPoint
& topLeft
, const wxPoint
& bottomRight
)
64 wxRegion::wxRegion(const wxRect
& rect
)
68 wxRegion::wxRegion(size_t n
, const wxPoint
*points
, int fillStyle
)
76 wxObjectRefData
*wxRegion::CreateRefData() const
81 wxObjectRefData
*wxRegion::CloneRefData(const wxObjectRefData
*data
) const
86 // ----------------------------------------------------------------------------
87 // wxRegion operations
88 // ----------------------------------------------------------------------------
90 // Clear current region
91 void wxRegion::Clear()
95 bool wxRegion::Offset(wxCoord x
, wxCoord y
)
100 // combine another region with this one
101 bool wxRegion::Combine(const wxRegion
& rgn
, wxRegionOp op
)
106 // Combine rectangle (x, y, w, h) with this.
107 bool wxRegion::Combine(wxCoord x
, wxCoord y
,
108 wxCoord width
, wxCoord height
,
114 bool wxRegion::Combine(const wxRect
& rect
, wxRegionOp op
)
119 // ----------------------------------------------------------------------------
120 // wxRegion bounding box
121 // ----------------------------------------------------------------------------
123 // Outer bounds of region
124 void wxRegion::GetBox(wxCoord
& x
, wxCoord
& y
, wxCoord
&w
, wxCoord
&h
) const
128 wxRect
wxRegion::GetBox() const
130 return wxRect(0, 0, 0, 0);
134 bool wxRegion::Empty() const
139 // ----------------------------------------------------------------------------
140 // wxRegion hit testing
141 // ----------------------------------------------------------------------------
143 // Does the region contain the point (x,y)?
144 wxRegionContain
wxRegion::Contains(wxCoord x
, wxCoord y
) const
149 // Does the region contain the point pt?
150 wxRegionContain
wxRegion::Contains(const wxPoint
& pt
) const
155 // Does the region contain the rectangle (x, y, w, h)?
156 wxRegionContain
wxRegion::Contains(wxCoord x
, wxCoord y
,
157 wxCoord w
, wxCoord h
) const
162 // Does the region contain the rectangle rect
163 wxRegionContain
wxRegion::Contains(const wxRect
& rect
) const
168 // Get internal region handle
169 WXHRGN
wxRegion::GetHRGN() const
174 // ============================================================================
175 // wxRegionIterator implementation
176 // ============================================================================
178 // ----------------------------------------------------------------------------
179 // wxRegionIterator ctors/dtor
180 // ----------------------------------------------------------------------------
182 void wxRegionIterator::Init()
186 wxRegionIterator::~wxRegionIterator()
190 // Initialize iterator for region
191 wxRegionIterator::wxRegionIterator(const wxRegion
& region
)
195 wxRegionIterator
& wxRegionIterator::operator=(const wxRegionIterator
& ri
)
200 // ----------------------------------------------------------------------------
201 // wxRegionIterator operations
202 // ----------------------------------------------------------------------------
204 // Reset iterator for a new region.
205 void wxRegionIterator::Reset(const wxRegion
& region
)
209 wxRegionIterator
& wxRegionIterator::operator++()
214 wxRegionIterator
wxRegionIterator::operator ++ (int)
219 // ----------------------------------------------------------------------------
220 // wxRegionIterator accessors
221 // ----------------------------------------------------------------------------
223 wxCoord
wxRegionIterator::GetX() const
228 wxCoord
wxRegionIterator::GetY() const
233 wxCoord
wxRegionIterator::GetW() const
238 wxCoord
wxRegionIterator::GetH() const