1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxOverlay class
4 // Author: Stefan Csomor
7 // Copyright: (c) wxWidgets team
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_OVERLAY_H_
12 #define _WX_OVERLAY_H_
16 #if defined(__WXMAC__) && wxOSX_USE_CARBON
17 #define wxHAS_NATIVE_OVERLAY 1
18 #elif defined(__WXDFB__)
19 #define wxHAS_NATIVE_OVERLAY 1
21 // don't define wxHAS_NATIVE_OVERLAY
24 // ----------------------------------------------------------------------------
25 // creates an overlay over an existing window, allowing for manipulations like
26 // rubberbanding etc. This API is not stable yet, not to be used outside wx
28 // ----------------------------------------------------------------------------
30 class WXDLLIMPEXP_FWD_CORE wxOverlayImpl
;
31 class WXDLLIMPEXP_FWD_CORE wxDC
;
33 class WXDLLIMPEXP_CORE wxOverlay
39 // clears the overlay without restoring the former state
40 // to be done eg when the window content has been changed and repainted
43 // returns (port-specific) implementation of the overlay
44 wxOverlayImpl
*GetImpl() { return m_impl
; }
47 friend class WXDLLIMPEXP_FWD_CORE wxDCOverlay
;
49 // returns true if it has been setup
52 void Init(wxDC
* dc
, int x
, int y
, int width
, int height
);
54 void BeginDrawing(wxDC
* dc
);
56 void EndDrawing(wxDC
* dc
);
60 wxOverlayImpl
* m_impl
;
65 wxDECLARE_NO_COPY_CLASS(wxOverlay
);
69 class WXDLLIMPEXP_CORE wxDCOverlay
72 // connects this overlay to the corresponding drawing dc, if the overlay is
73 // not initialized yet this call will do so
74 wxDCOverlay(wxOverlay
&overlay
, wxDC
*dc
, int x
, int y
, int width
, int height
);
76 // convenience wrapper that behaves the same using the entire area of the dc
77 wxDCOverlay(wxOverlay
&overlay
, wxDC
*dc
);
79 // removes the connection between the overlay and the dc
80 virtual ~wxDCOverlay();
82 // clears the layer, restoring the state at the last init
86 void Init(wxDC
*dc
, int x
, int y
, int width
, int height
);
93 wxDECLARE_NO_COPY_CLASS(wxDCOverlay
);
96 #endif // _WX_OVERLAY_H_