]> git.saurik.com Git - wxWidgets.git/blame - include/wx/overlay.h
Define wxUSE_CAIRO in wx/chkconf.h to ensure that it's always defined.
[wxWidgets.git] / include / wx / overlay.h
CommitLineData
30c841c8
VS
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/overlay.h
3// Purpose: wxOverlay class
4// Author: Stefan Csomor
5// Modified by:
6// Created: 2006-10-20
7// RCS-ID: $Id$
8// Copyright: (c) wxWidgets team
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_OVERLAY_H_
13#define _WX_OVERLAY_H_
14
15#include "wx/defs.h"
16
da712b51 17#if defined(__WXMAC__) && wxOSX_USE_CARBON
69a5bc23
VS
18 #define wxHAS_NATIVE_OVERLAY 1
19#elif defined(__WXDFB__)
20 #define wxHAS_NATIVE_OVERLAY 1
21#else
22 // don't define wxHAS_NATIVE_OVERLAY
30c841c8
VS
23#endif
24
25// ----------------------------------------------------------------------------
26// creates an overlay over an existing window, allowing for manipulations like
27// rubberbanding etc. This API is not stable yet, not to be used outside wx
28// internal code
29// ----------------------------------------------------------------------------
30
b5dbe15d 31class WXDLLIMPEXP_FWD_CORE wxOverlayImpl;
30d54e27 32class WXDLLIMPEXP_FWD_CORE wxDC;
30c841c8 33
53a2db12 34class WXDLLIMPEXP_CORE wxOverlay
30c841c8
VS
35{
36public:
37 wxOverlay();
38 ~wxOverlay();
39
40 // clears the overlay without restoring the former state
41 // to be done eg when the window content has been changed and repainted
42 void Reset();
43
44 // returns (port-specific) implementation of the overlay
45 wxOverlayImpl *GetImpl() { return m_impl; }
46
47private:
b5dbe15d 48 friend class WXDLLIMPEXP_FWD_CORE wxDCOverlay;
30c841c8
VS
49
50 // returns true if it has been setup
51 bool IsOk();
52
30d54e27 53 void Init(wxDC* dc, int x , int y , int width , int height);
30c841c8 54
30d54e27 55 void BeginDrawing(wxDC* dc);
30c841c8 56
30d54e27 57 void EndDrawing(wxDC* dc);
30c841c8 58
30d54e27 59 void Clear(wxDC* dc);
30c841c8
VS
60
61 wxOverlayImpl* m_impl;
62
63 bool m_inDrawing;
64
65
c0c133e1 66 wxDECLARE_NO_COPY_CLASS(wxOverlay);
30c841c8
VS
67};
68
69
53a2db12 70class WXDLLIMPEXP_CORE wxDCOverlay
30c841c8
VS
71{
72public:
73 // connects this overlay to the corresponding drawing dc, if the overlay is
74 // not initialized yet this call will do so
30d54e27 75 wxDCOverlay(wxOverlay &overlay, wxDC *dc, int x , int y , int width , int height);
30c841c8
VS
76
77 // convenience wrapper that behaves the same using the entire area of the dc
30d54e27 78 wxDCOverlay(wxOverlay &overlay, wxDC *dc);
30c841c8
VS
79
80 // removes the connection between the overlay and the dc
81 virtual ~wxDCOverlay();
82
83 // clears the layer, restoring the state at the last init
84 void Clear();
85
86private:
30d54e27 87 void Init(wxDC *dc, int x , int y , int width , int height);
30c841c8
VS
88
89 wxOverlay& m_overlay;
90
30d54e27 91 wxDC* m_dc;
30c841c8
VS
92
93
c0c133e1 94 wxDECLARE_NO_COPY_CLASS(wxDCOverlay);
30c841c8
VS
95};
96
97#endif // _WX_OVERLAY_H_