]>
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"
29 #include "wx/gdicmn.h"
31 IMPLEMENT_DYNAMIC_CLASS(wxRegion
, wxGDIObject
)
32 IMPLEMENT_DYNAMIC_CLASS(wxRegionIterator
, wxObject
)
34 // ----------------------------------------------------------------------------
35 // wxRegionRefData implementation
36 // ----------------------------------------------------------------------------
38 // ============================================================================
39 // wxRegion implementation
40 // ============================================================================
42 // ----------------------------------------------------------------------------
44 // ----------------------------------------------------------------------------
50 wxRegion::wxRegion(WXHRGN hRegion
)
54 wxRegion::wxRegion(wxCoord x
, wxCoord y
, wxCoord w
, wxCoord h
)
58 wxRegion::wxRegion(const wxPoint
& topLeft
, const wxPoint
& bottomRight
)
62 wxRegion::wxRegion(const wxRect
& rect
)
66 wxRegion::wxRegion(size_t n
, const wxPoint
*points
, int fillStyle
)
74 wxObjectRefData
*wxRegion::CreateRefData() const
79 wxObjectRefData
*wxRegion::CloneRefData(const wxObjectRefData
*data
) const
84 // ----------------------------------------------------------------------------
85 // wxRegion operations
86 // ----------------------------------------------------------------------------
88 // Clear current region
89 void wxRegion::Clear()
93 bool wxRegion::Offset(wxCoord x
, wxCoord y
)
98 // combine another region with this one
99 bool wxRegion::Combine(const wxRegion
& rgn
, wxRegionOp op
)
104 // Combine rectangle (x, y, w, h) with this.
105 bool wxRegion::Combine(wxCoord x
, wxCoord y
,
106 wxCoord width
, wxCoord height
,
112 bool wxRegion::Combine(const wxRect
& rect
, wxRegionOp op
)
117 // ----------------------------------------------------------------------------
118 // wxRegion bounding box
119 // ----------------------------------------------------------------------------
121 // Outer bounds of region
122 void wxRegion::GetBox(wxCoord
& x
, wxCoord
& y
, wxCoord
&w
, wxCoord
&h
) const
126 wxRect
wxRegion::GetBox() const
128 return wxRect(0, 0, 0, 0);
132 bool wxRegion::Empty() const
137 // ----------------------------------------------------------------------------
138 // wxRegion hit testing
139 // ----------------------------------------------------------------------------
141 // Does the region contain the point (x,y)?
142 wxRegionContain
wxRegion::Contains(wxCoord x
, wxCoord y
) const
147 // Does the region contain the point pt?
148 wxRegionContain
wxRegion::Contains(const wxPoint
& pt
) const
153 // Does the region contain the rectangle (x, y, w, h)?
154 wxRegionContain
wxRegion::Contains(wxCoord x
, wxCoord y
,
155 wxCoord w
, wxCoord h
) const
160 // Does the region contain the rectangle rect
161 wxRegionContain
wxRegion::Contains(const wxRect
& rect
) const
166 // Get internal region handle
167 WXHRGN
wxRegion::GetHRGN() const
172 // ============================================================================
173 // wxRegionIterator implementation
174 // ============================================================================
176 // ----------------------------------------------------------------------------
177 // wxRegionIterator ctors/dtor
178 // ----------------------------------------------------------------------------
180 void wxRegionIterator::Init()
184 wxRegionIterator::~wxRegionIterator()
188 // Initialize iterator for region
189 wxRegionIterator::wxRegionIterator(const wxRegion
& region
)
193 wxRegionIterator
& wxRegionIterator::operator=(const wxRegionIterator
& ri
)
198 // ----------------------------------------------------------------------------
199 // wxRegionIterator operations
200 // ----------------------------------------------------------------------------
202 // Reset iterator for a new region.
203 void wxRegionIterator::Reset(const wxRegion
& region
)
207 wxRegionIterator
& wxRegionIterator::operator++()
212 wxRegionIterator
wxRegionIterator::operator ++ (int)
217 // ----------------------------------------------------------------------------
218 // wxRegionIterator accessors
219 // ----------------------------------------------------------------------------
221 wxCoord
wxRegionIterator::GetX() const
226 wxCoord
wxRegionIterator::GetY() const
231 wxCoord
wxRegionIterator::GetW() const
236 wxCoord
wxRegionIterator::GetH() const