1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxMemoryDC base header
4 // Author: Julian Smart
7 // Copyright: (c) Julian Smart
9 // Licence: wxWindows Licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_DCMEMORY_H_BASE_
13 #define _WX_DCMEMORY_H_BASE_
16 #include "wx/bitmap.h"
21 //-----------------------------------------------------------------------------
23 //-----------------------------------------------------------------------------
25 class WXDLLIMPEXP_CORE wxMemoryImplDCBase
28 wxMemoryImplDCBase() { }
30 virtual void DoSelect(const wxBitmap
& bmp
) = 0;
32 virtual const wxBitmap
& DoGetSelectedBitmap() const = 0;
33 virtual wxBitmap
& DoGetSelectedBitmap() = 0;
37 class WXDLLIMPEXP_CORE wxMemoryDC
: public wxDC
41 wxMemoryDC( wxBitmap
& bitmap
);
42 wxMemoryDC( wxDC
*dc
);
44 // select the given bitmap to draw on it
45 void SelectObject(wxBitmap
& bmp
);
47 // select the given bitmap for read-only
48 void SelectObjectAsSource(const wxBitmap
& bmp
);
50 // get selected bitmap
51 const wxBitmap
& GetSelectedBitmap() const;
52 wxBitmap
& GetSelectedBitmap();
55 DECLARE_DYNAMIC_CLASS(wxMemoryDC
)
62 // NOTE: different native implementations of wxMemoryDC will derive from
63 // different wxDC classes (wxPaintDC, wxWindowDC, etc), so that
64 // we cannot derive wxMemoryDCBase from wxDC and then use it as the
65 // only base class for native impl of wxMemoryDC...
66 class WXDLLEXPORT wxMemoryDCBase
71 // avoid warnings about having virtual functions but non virtual dtor
72 virtual ~wxMemoryDCBase() { }
74 // select the given bitmap to draw on it
75 void SelectObject(wxBitmap
& bmp
)
77 // make sure that the given wxBitmap is not sharing its data with other
78 // wxBitmap instances as its contents will be modified by any drawing
79 // operation done on this DC
86 // select the given bitmap for read-only
87 virtual void SelectObjectAsSource(const wxBitmap
& bmp
)
93 virtual void DoSelect(const wxBitmap
& bmp
) = 0;
100 #if defined(__WXPALMOS__)
101 #include "wx/palmos/dcmemory.h"
102 #elif defined(__WXMSW__)
103 #include "wx/msw/dcmemory.h"
104 #elif defined(__WXMOTIF__)
105 #include "wx/motif/dcmemory.h"
106 #elif defined(__WXGTK20__)
107 #include "wx/gtk/dcmemory.h"
108 #elif defined(__WXGTK__)
109 #include "wx/gtk1/dcmemory.h"
110 #elif defined(__WXX11__)
111 #include "wx/x11/dcmemory.h"
112 #elif defined(__WXMGL__)
113 #include "wx/mgl/dcmemory.h"
114 #elif defined(__WXDFB__)
115 #include "wx/dfb/dcmemory.h"
116 #elif defined(__WXMAC__)
117 #include "wx/mac/dcmemory.h"
118 #elif defined(__WXCOCOA__)
119 #include "wx/cocoa/dcmemory.h"
120 #elif defined(__WXPM__)
121 #include "wx/os2/dcmemory.h"
125 // _WX_DCMEMORY_H_BASE_