1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_GTK_DCMEMORY_H_
11 #define _WX_GTK_DCMEMORY_H_
13 #include "wx/dcclient.h"
15 //-----------------------------------------------------------------------------
17 //-----------------------------------------------------------------------------
19 class WXDLLIMPEXP_CORE wxMemoryDC
: public wxWindowDC
, public wxMemoryDCBase
22 wxMemoryDC() : wxWindowDC() { Init(); }
23 wxMemoryDC(wxBitmap
& bitmap
) : wxWindowDC() { Init(); SelectObject(bitmap
); }
24 wxMemoryDC( wxDC
*dc
); // Create compatible DC
25 virtual ~wxMemoryDC();
27 // these get reimplemented for mono-bitmaps to behave
28 // more like their Win32 couterparts. They now interpret
29 // wxWHITE, wxWHITE_BRUSH and wxWHITE_PEN as drawing 0
30 // and everything else as drawing 1.
31 virtual void SetPen( const wxPen
&pen
);
32 virtual void SetBrush( const wxBrush
&brush
);
33 virtual void SetBackground( const wxBrush
&brush
);
34 virtual void SetTextForeground( const wxColour
&col
);
35 virtual void SetTextBackground( const wxColour
&col
);
38 wxBitmap
GetSelectedBitmap() const { return m_selected
; }
42 void DoGetSize( int *width
, int *height
) const;
43 virtual void DoSelect(const wxBitmap
& bitmap
);
44 virtual wxBitmap
DoGetAsBitmap(const wxRect
*subrect
) const
46 wxBitmap bmp
= GetSelectedBitmap();
47 return subrect
? bmp
.GetSubBitmap(*subrect
) : bmp
;
53 DECLARE_DYNAMIC_CLASS(wxMemoryDC
)
56 #endif // _WX_GTK_DCMEMORY_H_