]>
git.saurik.com Git - wxWidgets.git/blob - src/palmos/region.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: palmos/region.cpp
3 // Purpose: wxRegion implementation
4 // Author: William Osborne
8 // Copyright: (c) William Osborne
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
21 #pragma implementation "region.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
31 #include "wx/region.h"
32 #include "wx/gdicmn.h"
34 IMPLEMENT_DYNAMIC_CLASS(wxRegion
, wxGDIObject
)
35 IMPLEMENT_DYNAMIC_CLASS(wxRegionIterator
, wxObject
)
37 // ----------------------------------------------------------------------------
38 // wxRegionRefData implementation
39 // ----------------------------------------------------------------------------
41 // ============================================================================
42 // wxRegion implementation
43 // ============================================================================
45 // ----------------------------------------------------------------------------
47 // ----------------------------------------------------------------------------
53 wxRegion::wxRegion(WXHRGN hRegion
)
57 wxRegion::wxRegion(wxCoord x
, wxCoord y
, wxCoord w
, wxCoord h
)
61 wxRegion::wxRegion(const wxPoint
& topLeft
, const wxPoint
& bottomRight
)
65 wxRegion::wxRegion(const wxRect
& rect
)
69 wxRegion::wxRegion(size_t n
, const wxPoint
*points
, int fillStyle
)
77 wxObjectRefData
*wxRegion::CreateRefData() const
82 wxObjectRefData
*wxRegion::CloneRefData(const wxObjectRefData
*data
) const
87 // ----------------------------------------------------------------------------
88 // wxRegion operations
89 // ----------------------------------------------------------------------------
91 // Clear current region
92 void wxRegion::Clear()
96 bool wxRegion::Offset(wxCoord x
, wxCoord y
)
101 // combine another region with this one
102 bool wxRegion::Combine(const wxRegion
& rgn
, wxRegionOp op
)
107 // Combine rectangle (x, y, w, h) with this.
108 bool wxRegion::Combine(wxCoord x
, wxCoord y
,
109 wxCoord width
, wxCoord height
,
115 bool wxRegion::Combine(const wxRect
& rect
, wxRegionOp op
)
120 // ----------------------------------------------------------------------------
121 // wxRegion bounding box
122 // ----------------------------------------------------------------------------
124 // Outer bounds of region
125 void wxRegion::GetBox(wxCoord
& x
, wxCoord
& y
, wxCoord
&w
, wxCoord
&h
) const
129 wxRect
wxRegion::GetBox() const
131 return wxRect(0, 0, 0, 0);
135 bool wxRegion::Empty() const
140 // ----------------------------------------------------------------------------
141 // wxRegion hit testing
142 // ----------------------------------------------------------------------------
144 // Does the region contain the point (x,y)?
145 wxRegionContain
wxRegion::Contains(wxCoord x
, wxCoord y
) const
150 // Does the region contain the point pt?
151 wxRegionContain
wxRegion::Contains(const wxPoint
& pt
) const
156 // Does the region contain the rectangle (x, y, w, h)?
157 wxRegionContain
wxRegion::Contains(wxCoord x
, wxCoord y
,
158 wxCoord w
, wxCoord h
) const
163 // Does the region contain the rectangle rect
164 wxRegionContain
wxRegion::Contains(const wxRect
& rect
) const
169 // Get internal region handle
170 WXHRGN
wxRegion::GetHRGN() const
175 // ============================================================================
176 // wxRegionIterator implementation
177 // ============================================================================
179 // ----------------------------------------------------------------------------
180 // wxRegionIterator ctors/dtor
181 // ----------------------------------------------------------------------------
183 void wxRegionIterator::Init()
187 wxRegionIterator::~wxRegionIterator()
191 // Initialize iterator for region
192 wxRegionIterator::wxRegionIterator(const wxRegion
& region
)
196 wxRegionIterator
& wxRegionIterator::operator=(const wxRegionIterator
& ri
)
201 // ----------------------------------------------------------------------------
202 // wxRegionIterator operations
203 // ----------------------------------------------------------------------------
205 // Reset iterator for a new region.
206 void wxRegionIterator::Reset(const wxRegion
& region
)
210 wxRegionIterator
& wxRegionIterator::operator++()
215 wxRegionIterator
wxRegionIterator::operator ++ (int)
220 // ----------------------------------------------------------------------------
221 // wxRegionIterator accessors
222 // ----------------------------------------------------------------------------
224 wxCoord
wxRegionIterator::GetX() const
229 wxCoord
wxRegionIterator::GetY() const
234 wxCoord
wxRegionIterator::GetW() const
239 wxCoord
wxRegionIterator::GetH() const