]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/region.h
fix memory leak; allocate the DC before SetFont() is called on the status bar
[wxWidgets.git] / include / wx / generic / region.h
CommitLineData
4c3c3844
DE
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/generic/region.h
3// Purpose: generic wxRegion class
4// Author: David Elliott
5// Modified by:
6// Created: 2004/04/12
7// RCS-ID: $Id$
8// Copyright: (c) 2004 David Elliott
ca65c044 9// Licence: wxWindows licence
4c3c3844
DE
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_GENERIC_REGION_H__
13#define _WX_GENERIC_REGION_H__
14
53a2db12 15class WXDLLIMPEXP_CORE wxRegionGeneric : public wxRegionBase
4c3c3844 16{
4c3c3844
DE
17public:
18 wxRegionGeneric(wxCoord x, wxCoord y, wxCoord w, wxCoord h);
19 wxRegionGeneric(const wxPoint& topLeft, const wxPoint& bottomRight);
20 wxRegionGeneric(const wxRect& rect);
b916f712
KO
21 wxRegionGeneric(size_t n, const wxPoint *points, wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
22 wxRegionGeneric(const wxBitmap& bmp);
23 wxRegionGeneric(const wxBitmap& bmp, const wxColour& transp, int tolerance = 0);
4c3c3844 24 wxRegionGeneric();
d3c7fc99 25 virtual ~wxRegionGeneric();
4c3c3844 26
8a16d737
VZ
27 // wxRegionBase pure virtuals
28 virtual void Clear();
29 virtual bool IsEmpty() const;
9a6384ca 30
4c3c3844 31protected:
8f884a0d
VZ
32 virtual wxGDIRefData *CreateGDIRefData() const;
33 virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
8a16d737
VZ
34
35 // wxRegionBase pure virtuals
36 virtual bool DoIsEqual(const wxRegion& region) const;
37 virtual bool DoGetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const;
38 virtual wxRegionContain DoContainsPoint(wxCoord x, wxCoord y) const;
39 virtual wxRegionContain DoContainsRect(const wxRect& rect) const;
40
41 virtual bool DoOffset(wxCoord x, wxCoord y);
42 virtual bool DoUnionWithRect(const wxRect& rect);
43 virtual bool DoUnionWithRegion(const wxRegion& region);
44 virtual bool DoIntersect(const wxRegion& region);
45 virtual bool DoSubtract(const wxRegion& region);
46 virtual bool DoXor(const wxRegion& region);
47
b5dbe15d 48 friend class WXDLLIMPEXP_FWD_CORE wxRegionIteratorGeneric;
4c3c3844
DE
49};
50
53a2db12 51class WXDLLIMPEXP_CORE wxRegionIteratorGeneric : public wxObject
4c3c3844 52{
4c3c3844
DE
53public:
54 wxRegionIteratorGeneric();
55 wxRegionIteratorGeneric(const wxRegionGeneric& region);
56 wxRegionIteratorGeneric(const wxRegionIteratorGeneric& iterator);
d3c7fc99 57 virtual ~wxRegionIteratorGeneric();
4c3c3844
DE
58
59 wxRegionIteratorGeneric& operator=(const wxRegionIteratorGeneric& iterator);
60
61 void Reset() { m_current = 0; }
62 void Reset(const wxRegionGeneric& region);
63
64 operator bool () const { return HaveRects(); }
65 bool HaveRects() const;
66
67 wxRegionIteratorGeneric& operator++();
68 wxRegionIteratorGeneric operator++(int);
69
70 long GetX() const;
71 long GetY() const;
72 long GetW() const;
73 long GetWidth() const { return GetW(); }
74 long GetH() const;
75 long GetHeight() const { return GetH(); }
76 wxRect GetRect() const;
77private:
78 long m_current;
79 wxRegionGeneric m_region;
80};
81
8a16d737 82#endif // _WX_GENERIC_REGION_H__