]>
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"
28 #include "wx/gdicmn.h"
30 IMPLEMENT_DYNAMIC_CLASS(wxRegion
, wxGDIObject
)
31 IMPLEMENT_DYNAMIC_CLASS(wxRegionIterator
, wxObject
)
33 // ----------------------------------------------------------------------------
34 // wxRegionRefData implementation
35 // ----------------------------------------------------------------------------
37 // ============================================================================
38 // wxRegion implementation
39 // ============================================================================
41 // ----------------------------------------------------------------------------
43 // ----------------------------------------------------------------------------
49 wxRegion::wxRegion(WXHRGN hRegion
)
53 wxRegion::wxRegion(wxCoord x
, wxCoord y
, wxCoord w
, wxCoord h
)
57 wxRegion::wxRegion(const wxPoint
& topLeft
, const wxPoint
& bottomRight
)
61 wxRegion::wxRegion(const wxRect
& rect
)
65 wxRegion::wxRegion(size_t n
, const wxPoint
*points
, int fillStyle
)
73 wxObjectRefData
*wxRegion::CreateRefData() const
78 wxObjectRefData
*wxRegion::CloneRefData(const wxObjectRefData
*data
) const
83 // ----------------------------------------------------------------------------
84 // wxRegion operations
85 // ----------------------------------------------------------------------------
87 // Clear current region
88 void wxRegion::Clear()
92 bool wxRegion::Offset(wxCoord x
, wxCoord y
)
97 // combine another region with this one
98 bool wxRegion::Combine(const wxRegion
& rgn
, wxRegionOp op
)
103 // Combine rectangle (x, y, w, h) with this.
104 bool wxRegion::Combine(wxCoord x
, wxCoord y
,
105 wxCoord width
, wxCoord height
,
111 bool wxRegion::Combine(const wxRect
& rect
, wxRegionOp op
)
116 // ----------------------------------------------------------------------------
117 // wxRegion bounding box
118 // ----------------------------------------------------------------------------
120 // Outer bounds of region
121 void wxRegion::GetBox(wxCoord
& x
, wxCoord
& y
, wxCoord
&w
, wxCoord
&h
) const
125 wxRect
wxRegion::GetBox() const
127 return wxRect(0, 0, 0, 0);
131 bool wxRegion::Empty() const
136 // ----------------------------------------------------------------------------
137 // wxRegion hit testing
138 // ----------------------------------------------------------------------------
140 // Does the region contain the point (x,y)?
141 wxRegionContain
wxRegion::Contains(wxCoord x
, wxCoord y
) const
146 // Does the region contain the point pt?
147 wxRegionContain
wxRegion::Contains(const wxPoint
& pt
) const
152 // Does the region contain the rectangle (x, y, w, h)?
153 wxRegionContain
wxRegion::Contains(wxCoord x
, wxCoord y
,
154 wxCoord w
, wxCoord h
) const
159 // Does the region contain the rectangle rect
160 wxRegionContain
wxRegion::Contains(const wxRect
& rect
) const
165 // Get internal region handle
166 WXHRGN
wxRegion::GetHRGN() const
171 // ============================================================================
172 // wxRegionIterator implementation
173 // ============================================================================
175 // ----------------------------------------------------------------------------
176 // wxRegionIterator ctors/dtor
177 // ----------------------------------------------------------------------------
179 void wxRegionIterator::Init()
183 wxRegionIterator::~wxRegionIterator()
187 // Initialize iterator for region
188 wxRegionIterator::wxRegionIterator(const wxRegion
& region
)
192 wxRegionIterator
& wxRegionIterator::operator=(const wxRegionIterator
& ri
)
197 // ----------------------------------------------------------------------------
198 // wxRegionIterator operations
199 // ----------------------------------------------------------------------------
201 // Reset iterator for a new region.
202 void wxRegionIterator::Reset(const wxRegion
& region
)
206 wxRegionIterator
& wxRegionIterator::operator++()
211 wxRegionIterator
wxRegionIterator::operator ++ (int)
216 // ----------------------------------------------------------------------------
217 // wxRegionIterator accessors
218 // ----------------------------------------------------------------------------
220 wxCoord
wxRegionIterator::GetX() const
225 wxCoord
wxRegionIterator::GetY() const
230 wxCoord
wxRegionIterator::GetW() const
235 wxCoord
wxRegionIterator::GetH() const