]> git.saurik.com Git - wxWidgets.git/blame - src/os2/region.cpp
don't call SelectObject() twice in SetBrush() nor SetFont() neither
[wxWidgets.git] / src / os2 / region.cpp
CommitLineData
0e320a79
DW
1/////////////////////////////////////////////////////////////////////////////
2// File: region.cpp
3// Purpose: Region class
409c9842
DW
4// Author: David Webster
5// Modified by:
6// Created: 10/15/99
19193a2c 7// RCS-ID: $Id$
409c9842 8// Copyright: (c) Davdi Webster
0e320a79
DW
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
409c9842
DW
12// For compilers that support precompilation, includes "wx.h".
13#include "wx/wxprec.h"
0e320a79 14
3417f661 15#include "wx/app.h"
409c9842 16#include "wx/os2/region.h"
0e320a79
DW
17#include "wx/gdicmn.h"
18
409c9842
DW
19#include "wx/window.h"
20#include "wx/os2/private.h"
21
19193a2c
KB
22 IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject)
23 IMPLEMENT_DYNAMIC_CLASS(wxRegionIterator, wxObject)
0e320a79
DW
24
25//-----------------------------------------------------------------------------
26// wxRegionRefData implementation
27//-----------------------------------------------------------------------------
28
29class WXDLLEXPORT wxRegionRefData : public wxGDIRefData {
30public:
409c9842
DW
31 wxRegionRefData()
32 {
8d854fa9 33 m_hRegion = 0;
19193a2c 34 m_hPS = 0;
409c9842 35 }
0e320a79 36
8d854fa9 37 wxRegionRefData(const wxRegionRefData& rData)
409c9842 38 {
8d854fa9
DW
39 RGNRECT vRgnData;
40 PRECTL pRect = NULL;
41
53e8757b 42 vRgnData.ulDirection = RECTDIR_LFRT_TOPBOT;
8d854fa9
DW
43 if (::GpiQueryRegionRects( rData.m_hPS // Pres space
44 ,rData.m_hRegion // Handle of region to query
45 ,NULL // Return all RECTs
46 ,&vRgnData // Will contain number or RECTs in region
47 ,NULL // NULL to return number of RECTs
48 ))
49 {
50 pRect = new RECTL[vRgnData.crcReturned];
51 vRgnData.crc = vRgnData.crcReturned;
52 vRgnData.ircStart = 1;
53 if (::GpiQueryRegionRects( rData.m_hPS // Pres space of source
54 ,rData.m_hRegion // Handle of source region
55 ,NULL // Return all RECTs
56 ,&vRgnData // Operations set to return rects
57 ,pRect // Will contain the actual RECTS
58 ))
59 {
60 m_hRegion = ::GpiCreateRegion( rData.m_hPS
61 ,vRgnData.crcReturned
62 ,pRect
63 );
64 m_hPS = rData.m_hPS;
65 }
66 delete [] pRect;
67 }
409c9842 68 }
0e320a79 69
409c9842
DW
70 ~wxRegionRefData()
71 {
8d854fa9 72 ::GpiDestroyRegion(m_hPS, m_hRegion);
409c9842 73 }
04701dd9 74
8d854fa9
DW
75 HRGN m_hRegion;
76 HPS m_hPS;
0e320a79
DW
77};
78
8d854fa9 79#define M_REGION (((wxRegionRefData*)m_refData)->m_hRegion)
6ed98c6a 80#define M_REGION_OF(rgn) (((wxRegionRefData*)(rgn.m_refData))->m_hRegion)
0e320a79
DW
81
82//-----------------------------------------------------------------------------
83// wxRegion
84//-----------------------------------------------------------------------------
85
86/*!
87 * Create an empty region.
88 */
89wxRegion::wxRegion()
90{
91 m_refData = new wxRegionRefData;
8d854fa9 92} // end of wxRegion::wxRegion
0e320a79 93
8d854fa9 94wxRegion::wxRegion(
19193a2c
KB
95 WXHRGN hRegion,
96 WXHDC hPS
8d854fa9 97)
409c9842
DW
98{
99 m_refData = new wxRegionRefData;
100 M_REGION = (HRGN) hRegion;
19193a2c 101 (((wxRegionRefData*)m_refData)->m_hPS) = hPS;
8d854fa9
DW
102} // end of wxRegion::wxRegion
103
104wxRegion::wxRegion(
105 wxCoord x
106, wxCoord y
107, wxCoord vWidth
108, wxCoord vHeight
109)
0e320a79 110{
8d854fa9
DW
111 RECTL vRect;
112 SIZEL vSize = {0, 0};
113 DEVOPENSTRUC vDop = {0L, "DISPLAY", NULL, 0L, 0L, 0L, 0L, 0L, 0L};
114 HDC hDC = ::DevOpenDC( vHabmain
115 ,OD_MEMORY
116 ,"*"
117 ,5L
118 ,(PDEVOPENDATA)&vDop
119 ,NULLHANDLE
120 );
121
122
123 vRect.xLeft = x;
124 vRect.xRight = x + vWidth;
125 vRect.yBottom = y;
126 vRect.yTop = y + vHeight;
127
128 m_refData = new wxRegionRefData;
129
130 //
131 // Need a PS to create a Region
132 //
133 ((wxRegionRefData*)m_refData)->m_hPS = ::GpiCreatePS( vHabmain
134 ,hDC
135 ,&vSize
136 ,PU_PELS | GPIT_MICRO | GPIA_ASSOC
137 );
138 M_REGION = ::GpiCreateRegion( ((wxRegionRefData*)m_refData)->m_hPS
139 ,1
140 ,&vRect
141 );
142} // end of wxRegion::wxRegion
143
144wxRegion::wxRegion(
145 const wxPoint& rTopLeft
146, const wxPoint& rBottomRight
147)
0e320a79 148{
8d854fa9
DW
149 RECTL vRect;
150 SIZEL vSize = {0, 0};
151 DEVOPENSTRUC vDop = {0L, "DISPLAY", NULL, 0L, 0L, 0L, 0L, 0L, 0L};
152 HDC hDC = ::DevOpenDC( vHabmain
153 ,OD_MEMORY
154 ,"*"
155 ,5L
156 ,(PDEVOPENDATA)&vDop
157 ,NULLHANDLE
158 );
159
160 vRect.xLeft = rTopLeft.x;
161 vRect.xRight = rBottomRight.x;
162 vRect.yBottom = rBottomRight.y;
163 vRect.yTop = rTopLeft.y;
164
165 m_refData = new wxRegionRefData;
166
167 //
168 // Need a PS to create a Region
169 //
170 ((wxRegionRefData*)m_refData)->m_hPS = ::GpiCreatePS( vHabmain
171 ,hDC
172 ,&vSize
173 ,PU_PELS | GPIT_MICRO | GPIA_ASSOC
174 );
175 M_REGION = ::GpiCreateRegion( ((wxRegionRefData*)m_refData)->m_hPS
176 ,1
177 ,&vRect
178 );
179} // end of wxRegion::wxRegion
180
181wxRegion::wxRegion(
182 const wxRect& rRect
183)
0e320a79 184{
8d854fa9
DW
185 RECTL vRect;
186 SIZEL vSize = {0, 0};
187 DEVOPENSTRUC vDop = {0L, "DISPLAY", NULL, 0L, 0L, 0L, 0L, 0L, 0L};
188 HDC hDC = ::DevOpenDC( vHabmain
189 ,OD_MEMORY
190 ,"*"
191 ,5L
192 ,(PDEVOPENDATA)&vDop
193 ,NULLHANDLE
194 );
195
196
197 vRect.xLeft = rRect.x;
198 vRect.xRight = rRect.x + rRect.width;
199 vRect.yBottom = rRect.y;
200 vRect.yTop = rRect.y + rRect.height;
201
202 m_refData = new wxRegionRefData;
203
204 //
205 // Need a PS to create a Region
206 //
207 ((wxRegionRefData*)m_refData)->m_hPS = ::GpiCreatePS( vHabmain
208 ,hDC
209 ,&vSize
210 ,PU_PELS | GPIT_MICRO | GPIA_ASSOC
211 );
212 M_REGION = ::GpiCreateRegion( ((wxRegionRefData*)m_refData)->m_hPS
213 ,1
214 ,&vRect
215 );
216} // end of wxRegion::wxRegion
217
218//
219// Destroy the region.
220//
0e320a79
DW
221wxRegion::~wxRegion()
222{
8d854fa9 223} // end of wxRegion::~wxRegion
0e320a79 224
58238121
DW
225wxObjectRefData *wxRegion::CreateData() const
226{
227 return new wxRegionRefData;
228}
229
70b7bcd1 230wxObjectRefData *wxRegion::CloneData(const wxObjectRefData *data) const
58238121
DW
231{
232 return new wxRegionRefData(*(wxRegionRefData *)data);
233}
234
0e320a79
DW
235//-----------------------------------------------------------------------------
236//# Modify region
237//-----------------------------------------------------------------------------
238
58238121
DW
239bool wxRegion::Offset(
240 wxCoord x
241, wxCoord y
242)
243{
244 if ( !x && !y )
245 {
246 // nothing to do
247 return TRUE;
248 }
249
250 AllocExclusive();
251
252#if 0
253 if ( ::OffsetRgn(GetHrgn(), x, y) == ERROR )
254 {
255 wxLogLastError(_T("OffsetRgn"));
256
257 return FALSE;
258 }
259#endif
260 return TRUE;
261}
262
8d854fa9
DW
263//
264// Clear current region
265//
0e320a79
DW
266void wxRegion::Clear()
267{
268 UnRef();
8d854fa9
DW
269} // end of wxRegion::Clear
270
271//
272// Combine rectangle (x, y, w, h) with this.
273//
274bool wxRegion::Combine(
275 wxCoord x
276, wxCoord y
277, wxCoord vWidth
278, wxCoord vHeight
279, wxRegionOp eOp
280)
0e320a79 281{
6ed98c6a 282 return Combine(wxRegion(x, y, vWidth, vHeight), eOp);
8d854fa9
DW
283} // end of wxRegion::Combine
284
285//
286// Union region with this.
287//
288bool wxRegion::Combine(
289 const wxRegion& rRegion
290, wxRegionOp eOp
291)
0e320a79 292{
6ed98c6a
DW
293 //
294 // We can't use the API functions if we don't have a valid region handle
295 //
296 if (!m_refData)
297 {
298 // combining with an empty/invalid region works differently depending
299 // on the operation
300 switch (eOp)
301 {
302 case wxRGN_COPY:
303 case wxRGN_OR:
304 case wxRGN_XOR:
305 *this = rRegion;
306 break;
307
308 default:
309 wxFAIL_MSG( _T("unknown region operation") );
310 // fall through
311
312 case wxRGN_AND:
313 case wxRGN_DIFF:
314 // leave empty/invalid
315 return FALSE;
316 }
317 }
318 else // we have a valid region
319 {
0e320a79 320
6ed98c6a 321 LONG lMode = 0;
8d854fa9 322
6ed98c6a
DW
323 switch (eOp)
324 {
325 case wxRGN_AND:
326 lMode = CRGN_AND;
327 break;
328
329 case wxRGN_OR:
330 lMode = CRGN_OR;
331 break;
332
333 case wxRGN_XOR:
334 lMode = CRGN_XOR;
335 break;
336
337 case wxRGN_DIFF:
338 lMode = CRGN_DIFF;
339 break;
340
341 case wxRGN_COPY:
342 default:
343 lMode = CRGN_COPY;
344 break;
345 }
346 return (::GpiCombineRegion( ((wxRegionRefData*)rRegion.m_refData)->m_hPS
347 ,M_REGION
348 ,M_REGION
349 ,((wxRegionRefData*)rRegion.m_refData)->m_hRegion
350 ,lMode
351 ) != RGN_ERROR);
0e320a79 352 }
6ed98c6a 353 return TRUE;
8d854fa9
DW
354} // end of wxRegion::Combine
355
356bool wxRegion::Combine(
357 const wxRect& rRect
358, wxRegionOp eOp
359)
0e320a79 360{
8d854fa9
DW
361 return Combine( rRect.GetLeft()
362 ,rRect.GetTop()
363 ,rRect.GetWidth()
364 ,rRect.GetHeight()
365 ,eOp
366 );
367} // end of wxRegion::Combine
0e320a79
DW
368
369//-----------------------------------------------------------------------------
370//# Information on region
371//-----------------------------------------------------------------------------
372
8d854fa9 373//
0e320a79 374// Outer bounds of region
8d854fa9
DW
375//
376void wxRegion::GetBox(
377 wxCoord& x
378, wxCoord& y
379, wxCoord& vWidth
380, wxCoord& vHeight
381) const
0e320a79 382{
8d854fa9
DW
383 if (m_refData)
384 {
385 RECTL vRect;
19193a2c 386 APIRET rc;
8d854fa9 387
19193a2c 388 rc = ::GpiQueryRegionBox( ((wxRegionRefData*)m_refData)->m_hPS
8d854fa9
DW
389 ,M_REGION
390 ,&vRect
391 );
392 x = vRect.xLeft;
4a46a5df 393 y = vRect.yBottom;
8d854fa9
DW
394 vWidth = vRect.xRight - vRect.xLeft;
395 vHeight = vRect.yTop - vRect.yBottom;
409c9842 396 }
8d854fa9
DW
397 else
398 {
399 x = y = vWidth = vHeight = 0L;
400 }
401} // end of wxRegion::GetBox
0e320a79
DW
402
403wxRect wxRegion::GetBox() const
404{
0b7e7739 405 wxCoord x, y, w, h;
0e320a79
DW
406 GetBox(x, y, w, h);
407 return wxRect(x, y, w, h);
408}
409
8d854fa9 410//
0e320a79 411// Is region empty?
8d854fa9 412//
0e320a79
DW
413bool wxRegion::Empty() const
414{
8d854fa9
DW
415 wxCoord x;
416 wxCoord y;
417 wxCoord vWidth;
418 wxCoord vHeight;
419
420 if (M_REGION == 0)
421 return TRUE;
422
423 GetBox( x
424 ,y
425 ,vWidth
426 ,vHeight
427 );
428 return ((vWidth == 0) && (vHeight == 0));
429} // end of wxRegion::Empty
0e320a79
DW
430
431//-----------------------------------------------------------------------------
8d854fa9 432// Tests
0e320a79
DW
433//-----------------------------------------------------------------------------
434
8d854fa9 435//
0e320a79 436// Does the region contain the point (x,y)?
8d854fa9
DW
437wxRegionContain wxRegion::Contains(
438 wxCoord x
439, wxCoord y
440) const
0e320a79 441{
8d854fa9
DW
442 bool bOK = FALSE;
443 POINTL vPoint;
444
445 vPoint.x = x;
446 vPoint.y = y;
447
409c9842
DW
448 if (!m_refData)
449 return wxOutRegion;
0e320a79 450
8d854fa9
DW
451 LONG lInside = ::GpiPtInRegion( ((wxRegionRefData*)m_refData)->m_hPS
452 ,M_REGION
453 ,&vPoint
454 );
455 if (lInside == PRGN_INSIDE)
0e320a79
DW
456 return wxInRegion;
457 return wxOutRegion;
8d854fa9 458} // end of wxRegion::Contains
0e320a79 459
8d854fa9 460//
0e320a79 461// Does the region contain the point pt?
8d854fa9
DW
462//
463wxRegionContain wxRegion::Contains(
464 const wxPoint& rPoint
465) const
0e320a79 466{
8d854fa9
DW
467 POINTL vPoint = { rPoint.x, rPoint.y };
468
409c9842
DW
469 if (!m_refData)
470 return wxOutRegion;
0e320a79 471
8d854fa9
DW
472 LONG lInside = ::GpiPtInRegion( ((wxRegionRefData*)m_refData)->m_hPS
473 ,M_REGION
474 ,&vPoint
475 );
476 if (lInside == PRGN_INSIDE)
0e320a79
DW
477 return wxInRegion;
478 else
479 return wxOutRegion;
8d854fa9 480} // end of wxRegion::Contains
0e320a79 481
8d854fa9 482//
0e320a79 483// Does the region contain the rectangle (x, y, w, h)?
8d854fa9
DW
484//
485wxRegionContain wxRegion::Contains(
486 wxCoord x
487, wxCoord y
488, wxCoord vWidth
489, wxCoord vHeight
490) const
0e320a79 491{
8d854fa9
DW
492 RECTL vRect;
493
409c9842
DW
494 if (!m_refData)
495 return wxOutRegion;
0e320a79 496
8d854fa9
DW
497 vRect.xLeft = x;
498 vRect.yTop = y;
499 vRect.xRight = x + vWidth;
500 vRect.yBottom = y + vHeight;
501
502 if (PRGN_INSIDE == ::GpiRectInRegion( ((wxRegionRefData*)m_refData)->m_hPS
503 ,M_REGION
504 ,&vRect
505 ))
0e320a79
DW
506 return wxInRegion;
507 else
508 return wxOutRegion;
8d854fa9 509} // end of wxRegion::Contains
0e320a79 510
8d854fa9 511//
0e320a79 512// Does the region contain the rectangle rect
8d854fa9
DW
513//
514wxRegionContain wxRegion::Contains(
515 const wxRect& rRect
516) const
0e320a79 517{
409c9842
DW
518 if (!m_refData)
519 return wxOutRegion;
0e320a79 520
8d854fa9
DW
521 wxCoord x;
522 wxCoord y;
523 wxCoord vWidth;
524 wxCoord vHeight;
525
526 x = rRect.x;
527 y = rRect.y;
528 vWidth = rRect.GetWidth();
529 vHeight = rRect.GetHeight();
530 return Contains( x
531 ,y
532 ,vWidth
533 ,vHeight
534 );
535} // end of wxRegion::Contains
536
537//
409c9842 538// Get internal region handle
8d854fa9 539//
409c9842
DW
540WXHRGN wxRegion::GetHRGN() const
541{
542 if (!m_refData)
543 return (WXHRGN) 0;
544 return (WXHRGN) M_REGION;
545}
546
44227537
DW
547//
548// Set a new PS, this means we have to recreate the old region in the new
549// PS
550//
551void wxRegion::SetPS(
552 HPS hPS
553)
554{
555 RGNRECT vRgnData;
556 PRECTL pRect = NULL;
557
53e8757b 558 vRgnData.ulDirection = RECTDIR_LFRT_TOPBOT;
44227537
DW
559 if (::GpiQueryRegionRects( ((wxRegionRefData*)m_refData)->m_hPS
560 ,((wxRegionRefData*)m_refData)->m_hRegion
561 ,NULL
562 ,&vRgnData
563 ,NULL
564 ))
565 {
566 pRect = new RECTL[vRgnData.crcReturned];
567 vRgnData.crc = vRgnData.crcReturned;
568 vRgnData.ircStart = 1;
569 if (::GpiQueryRegionRects( ((wxRegionRefData*)m_refData)->m_hPS
570 ,((wxRegionRefData*)m_refData)->m_hRegion
571 ,NULL
572 ,&vRgnData
573 ,pRect
574 ))
575 {
576 //
577 // First destroy the region out of the old PS
578 // and then create it in the new and set the new to current
579 //
580 ::GpiDestroyRegion( ((wxRegionRefData*)m_refData)->m_hPS
581 ,M_REGION
582 );
583 ((wxRegionRefData*)m_refData)->m_hRegion = ::GpiCreateRegion( hPS
584 ,vRgnData.crcReturned
585 ,pRect
586 );
587 ((wxRegionRefData*)m_refData)->m_hPS = hPS;
588 }
589 delete [] pRect;
590 }
591} // end of wxRegion::SetPS
592
0e320a79 593///////////////////////////////////////////////////////////////////////////////
409c9842
DW
594// //
595// wxRegionIterator //
596// //
0e320a79
DW
597///////////////////////////////////////////////////////////////////////////////
598
8d854fa9
DW
599//
600// Initialize empty iterator
601//
602wxRegionIterator::wxRegionIterator()
603: m_lCurrent(0)
604, m_lNumRects(0)
605, m_pRects(NULL)
0e320a79 606{
8d854fa9 607} // end of wxRegionIterator::wxRegionIterator
0e320a79
DW
608
609wxRegionIterator::~wxRegionIterator()
610{
8d854fa9
DW
611 if (m_pRects)
612 delete[] m_pRects;
613} // end of wxRegionIterator::~wxRegionIterator
614
615//
616// Initialize iterator for region
617//
618wxRegionIterator::wxRegionIterator(
619 const wxRegion& rRegion
620)
0e320a79 621{
8d854fa9
DW
622 m_pRects = NULL;
623 Reset(rRegion);
624} // end of wxRegionIterator::wxRegionIterator
625
626//
627// Reset iterator for a new /e region.
628//
629void wxRegionIterator::Reset(
630 const wxRegion& rRegion
631)
0e320a79 632{
8d854fa9 633 m_lCurrent = 0;
0b483d6e 634 m_lNumRects = 0;
8d854fa9 635 m_vRegion = rRegion;
0e320a79 636
8d854fa9
DW
637 if (m_pRects)
638 delete[] m_pRects;
0e320a79 639
8d854fa9 640 m_pRects = NULL;
0e320a79 641
8d854fa9
DW
642 if (m_vRegion.Empty())
643 m_lNumRects = 0;
409c9842 644 else
0e320a79 645 {
8d854fa9
DW
646 RGNRECT vRgnData;
647 PRECTL pRect;
648
53e8757b 649 vRgnData.ulDirection = RECTDIR_LFRT_TOPBOT;
8d854fa9
DW
650 if (::GpiQueryRegionRects( ((wxRegionRefData*)rRegion.m_refData)->m_hPS // Pres space
651 ,((wxRegionRefData*)rRegion.m_refData)->m_hRegion // Handle of region to query
652 ,NULL // Return all RECTs
653 ,&vRgnData // Will contain number or RECTs in region
654 ,NULL // NULL to return number of RECTs
655 ))
656 {
657 pRect = new RECTL[vRgnData.crcReturned];
658 m_pRects = new wxRect[vRgnData.crcReturned];
659 vRgnData.crc = vRgnData.crcReturned;
660 m_lNumRects = vRgnData.crcReturned;
661 vRgnData.ircStart = 1;
662 if (::GpiQueryRegionRects( ((wxRegionRefData*)rRegion.m_refData)->m_hPS // Pres space of source
663 ,((wxRegionRefData*)rRegion.m_refData)->m_hRegion // Handle of source region
664 ,NULL // Return all RECTs
665 ,&vRgnData // Operations set to return rects
666 ,pRect // Will contain the actual RECTS
667 ))
668 {
53e8757b 669#if 0
8d854fa9
DW
670 M_REGION = ::GpiCreateRegion( ((wxRegionRefData*)rRegion.m_refData)->m_hPS
671 ,vRgnData.crcReturned
672 ,pRect
673 );
53e8757b 674#endif
8d854fa9
DW
675 for( LONG i = 0; i < m_lNumRects; i++)
676 {
677 m_pRects[i].x = pRect[i].xLeft;
678 m_pRects[i].width = pRect[i].xRight - pRect[i].xLeft;
679 m_pRects[i].y = pRect[i].yBottom;
680 m_pRects[i].height = pRect[i].yTop - pRect[i].yBottom;
681 }
53e8757b 682#if 0
8d854fa9 683 ((wxRegionRefData*)m_refData)->m_hPS = ((wxRegionRefData*)rRegion.m_refData)->m_hPS;
53e8757b 684#endif
8d854fa9
DW
685 }
686 }
0e320a79 687 }
8d854fa9 688} // end of wxRegionIterator::Reset
0e320a79 689
8d854fa9
DW
690//
691// Increment iterator. The rectangle returned is the one after the
692// incrementation.
693//
694void wxRegionIterator::operator++ ()
0e320a79 695{
8d854fa9
DW
696 if (m_lCurrent < m_lNumRects)
697 ++m_lCurrent;
698} // end of wxRegionIterator::operator ++
699
700//
701// Increment iterator. The rectangle returned is the one before the
702// incrementation.
703//
704void wxRegionIterator::operator++ (int)
0e320a79 705{
8d854fa9
DW
706 if (m_lCurrent < m_lNumRects)
707 ++m_lCurrent;
708} // end of wxRegionIterator::operator++
0e320a79 709
0b7e7739 710wxCoord wxRegionIterator::GetX() const
0e320a79 711{
8d854fa9
DW
712 if (m_lCurrent < m_lNumRects)
713 return m_pRects[m_lCurrent].x;
714 return 0L;
715} // end of wxRegionIterator::GetX
0e320a79 716
0b7e7739 717wxCoord wxRegionIterator::GetY() const
0e320a79 718{
8d854fa9
DW
719 if (m_lCurrent < m_lNumRects)
720 return m_pRects[m_lCurrent].y;
721 return 0L;
722} // end of wxRegionIterator::GetY
0e320a79 723
0b7e7739 724wxCoord wxRegionIterator::GetW() const
0e320a79 725{
8d854fa9
DW
726 if (m_lCurrent < m_lNumRects)
727 return m_pRects[m_lCurrent].width ;
728 return 0L;
729} // end of wxRegionIterator::GetW
0e320a79 730
0b7e7739 731wxCoord wxRegionIterator::GetH() const
0e320a79 732{
8d854fa9
DW
733 if (m_lCurrent < m_lNumRects)
734 return m_pRects[m_lCurrent].height;
735 return 0L;
736} // end of wxRegionIterator::GetH
0e320a79 737