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
, wxPolygonFillMode fillStyle
)
76 wxGDIRefData
*wxRegion::CreateGDIRefData() const
81 wxGDIRefData
*wxRegion::CloneGDIRefData(const wxGDIRefData
*data
) const
86 // ----------------------------------------------------------------------------
87 // wxRegion operations
88 // ----------------------------------------------------------------------------
90 // Clear current region
91 void wxRegion::Clear()
95 bool wxRegion::DoOffset(wxCoord x
, wxCoord y
)
100 // combine another region with this one
101 bool wxRegion::DoCombine(const wxRegion
& rgn
, wxRegionOp op
)
106 // ----------------------------------------------------------------------------
107 // wxRegion bounding box
108 // ----------------------------------------------------------------------------
110 // Outer bounds of region
111 bool wxRegion::DoGetBox(wxCoord
& x
, wxCoord
& y
, wxCoord
&w
, wxCoord
&h
) const
117 bool wxRegion::IsEmpty() const
122 bool wxRegion::DoIsEqual(const wxRegion
& region
) const
127 // ----------------------------------------------------------------------------
128 // wxRegion hit testing
129 // ----------------------------------------------------------------------------
131 // Does the region contain the point (x,y)?
132 wxRegionContain
wxRegion::DoContainsPoint(wxCoord x
, wxCoord y
) const
137 // Does the region contain the rectangle rect
138 wxRegionContain
wxRegion::DoContainsRect(const wxRect
& rect
) const
143 // Get internal region handle
144 WXHRGN
wxRegion::GetHRGN() const
149 // ============================================================================
150 // wxRegionIterator implementation
151 // ============================================================================
153 // ----------------------------------------------------------------------------
154 // wxRegionIterator ctors/dtor
155 // ----------------------------------------------------------------------------
157 void wxRegionIterator::Init()
161 wxRegionIterator::~wxRegionIterator()
165 // Initialize iterator for region
166 wxRegionIterator::wxRegionIterator(const wxRegion
& region
)
170 wxRegionIterator
& wxRegionIterator::operator=(const wxRegionIterator
& ri
)
175 // ----------------------------------------------------------------------------
176 // wxRegionIterator operations
177 // ----------------------------------------------------------------------------
179 // Reset iterator for a new region.
180 void wxRegionIterator::Reset(const wxRegion
& region
)
184 wxRegionIterator
& wxRegionIterator::operator++()
189 wxRegionIterator
wxRegionIterator::operator ++ (int)
194 // ----------------------------------------------------------------------------
195 // wxRegionIterator accessors
196 // ----------------------------------------------------------------------------
198 wxCoord
wxRegionIterator::GetX() const
203 wxCoord
wxRegionIterator::GetY() const
208 wxCoord
wxRegionIterator::GetW() const
213 wxCoord
wxRegionIterator::GetH() const