]> git.saurik.com Git - wxWidgets.git/blob - include/wx/overlay.h
Added GetTempDir change log
[wxWidgets.git] / include / wx / overlay.h
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
17 #ifndef wxHAS_NATIVE_OVERLAY
18 #if defined(wxMAC_USE_CORE_GRAPHICS) && wxMAC_USE_CORE_GRAPHICS
19 #define wxHAS_NATIVE_OVERLAY 1
20 #elif defined(__WXDFB__)
21 #define wxHAS_NATIVE_OVERLAY 1
22 #else
23 #define wxHAS_NATIVE_OVERLAY 0
24 #endif
25 #endif
26
27 // ----------------------------------------------------------------------------
28 // creates an overlay over an existing window, allowing for manipulations like
29 // rubberbanding etc. This API is not stable yet, not to be used outside wx
30 // internal code
31 // ----------------------------------------------------------------------------
32
33 class WXDLLEXPORT wxOverlayImpl;
34 class WXDLLEXPORT wxWindowDC;
35
36 class WXDLLEXPORT wxOverlay
37 {
38 public:
39 wxOverlay();
40 ~wxOverlay();
41
42 // clears the overlay without restoring the former state
43 // to be done eg when the window content has been changed and repainted
44 void Reset();
45
46 // returns (port-specific) implementation of the overlay
47 wxOverlayImpl *GetImpl() { return m_impl; }
48
49 private:
50 friend class WXDLLEXPORT wxDCOverlay;
51
52 // returns true if it has been setup
53 bool IsOk();
54
55 void Init(wxWindowDC* dc, int x , int y , int width , int height);
56
57 void BeginDrawing(wxWindowDC* dc);
58
59 void EndDrawing(wxWindowDC* dc);
60
61 void Clear(wxWindowDC* dc);
62
63 wxOverlayImpl* m_impl;
64
65 bool m_inDrawing;
66
67
68 DECLARE_NO_COPY_CLASS(wxOverlay)
69 };
70
71
72 class WXDLLEXPORT wxDCOverlay
73 {
74 public:
75 // connects this overlay to the corresponding drawing dc, if the overlay is
76 // not initialized yet this call will do so
77 wxDCOverlay(wxOverlay &overlay, wxWindowDC *dc, int x , int y , int width , int height);
78
79 // convenience wrapper that behaves the same using the entire area of the dc
80 wxDCOverlay(wxOverlay &overlay, wxWindowDC *dc);
81
82 // removes the connection between the overlay and the dc
83 virtual ~wxDCOverlay();
84
85 // clears the layer, restoring the state at the last init
86 void Clear();
87
88 private:
89 void Init(wxWindowDC *dc, int x , int y , int width , int height);
90
91 wxOverlay& m_overlay;
92
93 wxWindowDC* m_dc;
94
95
96 DECLARE_NO_COPY_CLASS(wxDCOverlay)
97 };
98
99 #endif // _WX_OVERLAY_H_