1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: region.h
|
|
|
|
// Purpose: wxRegion class
|
1999-10-15 17:00:38 -04:00
|
|
|
// Author: David Webster
|
1999-07-29 01:11:30 -04:00
|
|
|
// Modified by:
|
1999-10-15 17:00:38 -04:00
|
|
|
// Created: 10/15/99
|
1999-07-29 01:11:30 -04:00
|
|
|
// RCS-ID: $Id$
|
1999-10-15 17:00:38 -04:00
|
|
|
// Copyright: (c) David Webster
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2006-09-25 07:47:23 -04:00
|
|
|
#ifndef _WX_OS2_REGION_H_
|
|
|
|
#define _WX_OS2_REGION_H_
|
1999-07-29 01:11:30 -04:00
|
|
|
|
|
|
|
#include "wx/list.h"
|
2003-08-31 17:00:00 -04:00
|
|
|
#include "wx/os2/private.h"
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2006-09-25 07:47:23 -04:00
|
|
|
class WXDLLEXPORT wxRegion : public wxRegionWithCombine
|
2000-12-18 00:32:32 -05:00
|
|
|
{
|
1999-07-29 01:11:30 -04:00
|
|
|
public:
|
2000-12-18 00:32:32 -05:00
|
|
|
wxRegion( wxCoord x
|
|
|
|
,wxCoord y
|
|
|
|
,wxCoord vWidth
|
|
|
|
,wxCoord vHeight
|
|
|
|
);
|
|
|
|
wxRegion( const wxPoint& rTopLeft
|
|
|
|
,const wxPoint& rBottomRight
|
|
|
|
);
|
|
|
|
wxRegion(const wxRect& rRect);
|
2001-10-17 18:25:56 -04:00
|
|
|
wxRegion(WXHRGN hRegion, WXHDC hPS); // Hangs on to this region
|
2004-06-03 17:13:52 -04:00
|
|
|
wxRegion( const wxBitmap& bmp)
|
|
|
|
{
|
|
|
|
Union(bmp);
|
|
|
|
}
|
|
|
|
wxRegion( const wxBitmap& bmp,
|
|
|
|
const wxColour& transColour, int tolerance = 0)
|
|
|
|
{
|
|
|
|
Union(bmp, transColour, tolerance);
|
|
|
|
}
|
1999-10-15 17:00:38 -04:00
|
|
|
|
|
|
|
wxRegion();
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxRegion();
|
1999-10-15 17:00:38 -04:00
|
|
|
|
2000-12-18 00:32:32 -05:00
|
|
|
//
|
|
|
|
// Modify region
|
|
|
|
//
|
|
|
|
|
|
|
|
//
|
1999-10-15 17:00:38 -04:00
|
|
|
// Clear current region
|
2000-12-18 00:32:32 -05:00
|
|
|
//
|
2006-09-25 07:47:23 -04:00
|
|
|
virtual void Clear();
|
2000-12-18 00:32:32 -05:00
|
|
|
|
|
|
|
//
|
1999-10-15 17:00:38 -04:00
|
|
|
// Is region empty?
|
2000-12-18 00:32:32 -05:00
|
|
|
//
|
2006-09-25 07:47:23 -04:00
|
|
|
virtual bool IsEmpty() const;
|
2000-12-18 00:32:32 -05:00
|
|
|
|
|
|
|
//
|
1999-10-15 17:00:38 -04:00
|
|
|
// Get internal region handle
|
2000-12-18 00:32:32 -05:00
|
|
|
//
|
2006-09-25 07:47:23 -04:00
|
|
|
WXHRGN GetHRGN() const;
|
|
|
|
|
2000-12-18 00:32:32 -05:00
|
|
|
void SetPS(HPS hPS);
|
2002-02-03 23:19:14 -05:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual wxObjectRefData* CreateData(void) const;
|
2002-02-04 09:09:12 -05:00
|
|
|
virtual wxObjectRefData* CloneData(const wxObjectRefData* pData) const;
|
|
|
|
|
2006-09-25 07:47:23 -04:00
|
|
|
virtual bool DoIsEqual(const wxRegion& region) const;
|
|
|
|
virtual bool DoGetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const;
|
|
|
|
virtual wxRegionContain DoContainsPoint(wxCoord x, wxCoord y) const;
|
|
|
|
virtual wxRegionContain DoContainsRect(const wxRect& rect) const;
|
|
|
|
|
|
|
|
virtual bool DoOffset(wxCoord x, wxCoord y);
|
|
|
|
virtual bool DoCombine(const wxRegion& region, wxRegionOp op);
|
|
|
|
|
2002-02-03 23:19:14 -05:00
|
|
|
friend class WXDLLEXPORT wxRegionIterator;
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxRegion);
|
|
|
|
|
2000-12-18 00:32:32 -05:00
|
|
|
}; // end of CLASS wxRegion
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2000-12-18 00:32:32 -05:00
|
|
|
class WXDLLEXPORT wxRegionIterator : public wxObject
|
|
|
|
{
|
1999-07-29 01:11:30 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxRegionIterator);
|
|
|
|
public:
|
1999-10-15 17:00:38 -04:00
|
|
|
wxRegionIterator();
|
2000-12-18 00:32:32 -05:00
|
|
|
wxRegionIterator(const wxRegion& rRegion);
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxRegionIterator();
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2000-12-18 00:32:32 -05:00
|
|
|
void Reset(void) { m_lCurrent = 0; }
|
|
|
|
void Reset(const wxRegion& rRegion);
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2000-12-18 00:32:32 -05:00
|
|
|
operator bool (void) const { return m_lCurrent < m_lNumRects; }
|
|
|
|
bool HaveRects(void) const { return m_lCurrent < m_lNumRects; }
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2000-12-18 00:32:32 -05:00
|
|
|
void operator ++ (void);
|
1999-10-15 17:00:38 -04:00
|
|
|
void operator ++ (int);
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2000-12-18 00:32:32 -05:00
|
|
|
wxCoord GetX(void) const;
|
|
|
|
wxCoord GetY(void) const;
|
|
|
|
wxCoord GetW(void) const;
|
|
|
|
wxCoord GetWidth(void) const { return GetW(); }
|
|
|
|
wxCoord GetH(void) const;
|
|
|
|
wxCoord GetHeight(void) const { return GetH(); }
|
|
|
|
wxRect GetRect(void) const { return wxRect(GetX(), GetY(), GetWidth(), GetHeight()); }
|
1999-07-29 01:11:30 -04:00
|
|
|
|
|
|
|
private:
|
2000-12-18 00:32:32 -05:00
|
|
|
long m_lCurrent;
|
|
|
|
long m_lNumRects;
|
|
|
|
wxRegion m_vRegion;
|
|
|
|
wxRect* m_pRects;
|
|
|
|
}; // end of wxRegionIterator
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2006-09-25 07:47:23 -04:00
|
|
|
#endif // _WX_OS2_REGION_H_
|