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 #if defined(wxMAC_USE_CORE_GRAPHICS) && wxMAC_USE_CORE_GRAPHICS && wxMAC_USE_QUICKDRAW
18 #define wxHAS_NATIVE_OVERLAY 1
19 #elif defined(__WXDFB__)
20 #define wxHAS_NATIVE_OVERLAY 1
22 // don't define wxHAS_NATIVE_OVERLAY
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
29 // ----------------------------------------------------------------------------
31 class WXDLLIMPEXP_FWD_CORE wxOverlayImpl
;
32 class WXDLLIMPEXP_FWD_CORE wxWindowDC
;
34 class WXDLLEXPORT wxOverlay
40 // clears the overlay without restoring the former state
41 // to be done eg when the window content has been changed and repainted
44 // returns (port-specific) implementation of the overlay
45 wxOverlayImpl
*GetImpl() { return m_impl
; }
48 friend class WXDLLIMPEXP_FWD_CORE wxDCOverlay
;
50 // returns true if it has been setup
53 void Init(wxWindowDC
* dc
, int x
, int y
, int width
, int height
);
55 void BeginDrawing(wxWindowDC
* dc
);
57 void EndDrawing(wxWindowDC
* dc
);
59 void Clear(wxWindowDC
* dc
);
61 wxOverlayImpl
* m_impl
;
66 DECLARE_NO_COPY_CLASS(wxOverlay
)
70 class WXDLLEXPORT wxDCOverlay
73 // connects this overlay to the corresponding drawing dc, if the overlay is
74 // not initialized yet this call will do so
75 wxDCOverlay(wxOverlay
&overlay
, wxWindowDC
*dc
, int x
, int y
, int width
, int height
);
77 // convenience wrapper that behaves the same using the entire area of the dc
78 wxDCOverlay(wxOverlay
&overlay
, wxWindowDC
*dc
);
80 // removes the connection between the overlay and the dc
81 virtual ~wxDCOverlay();
83 // clears the layer, restoring the state at the last init
87 void Init(wxWindowDC
*dc
, int x
, int y
, int width
, int height
);
94 DECLARE_NO_COPY_CLASS(wxDCOverlay
)
97 #endif // _WX_OVERLAY_H_