1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxOverlay class
4 // Author: Stefan Csomor
8 // Copyright: (c) wxWidgets team
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_OVERLAY_H_
13 #define _WX_OVERLAY_H_
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
23 #define wxHAS_NATIVE_OVERLAY 0
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
31 // ----------------------------------------------------------------------------
33 class WXDLLEXPORT wxOverlayImpl
;
34 class WXDLLEXPORT wxWindowDC
;
36 class WXDLLEXPORT wxOverlay
42 // clears the overlay without restoring the former state
43 // to be done eg when the window content has been changed and repainted
46 // returns (port-specific) implementation of the overlay
47 wxOverlayImpl
*GetImpl() { return m_impl
; }
50 friend class WXDLLEXPORT wxDCOverlay
;
52 // returns true if it has been setup
55 void Init(wxWindowDC
* dc
, int x
, int y
, int width
, int height
);
57 void BeginDrawing(wxWindowDC
* dc
);
59 void EndDrawing(wxWindowDC
* dc
);
61 void Clear(wxWindowDC
* dc
);
63 wxOverlayImpl
* m_impl
;
68 DECLARE_NO_COPY_CLASS(wxOverlay
)
72 class WXDLLEXPORT wxDCOverlay
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
);
79 // convenience wrapper that behaves the same using the entire area of the dc
80 wxDCOverlay(wxOverlay
&overlay
, wxWindowDC
*dc
);
82 // removes the connection between the overlay and the dc
83 virtual ~wxDCOverlay();
85 // clears the layer, restoring the state at the last init
89 void Init(wxWindowDC
*dc
, int x
, int y
, int width
, int height
);
96 DECLARE_NO_COPY_CLASS(wxDCOverlay
)
99 #endif // _WX_OVERLAY_H_