]> git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/carbon/dcmemory.h
Added wxMemoryDC::SelectObjectAsSource() and make SelectObject() unshare
[wxWidgets.git] / include / wx / mac / carbon / dcmemory.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: dcmemory.h
3 // Purpose: wxMemoryDC class
4 // Author: Stefan Csomor
5 // Modified by:
6 // Created: 1998-01-01
7 // RCS-ID: $Id$
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_DCMEMORY_H_
13 #define _WX_DCMEMORY_H_
14
15 #include "wx/dcclient.h"
16
17 class WXDLLEXPORT wxMemoryDC: public wxPaintDC, public wxMemoryDCBase
18 {
19 DECLARE_DYNAMIC_CLASS(wxMemoryDC)
20
21 public:
22 wxMemoryDC() { Init(); }
23 wxMemoryDC(wxBitmap& bitmap) { Init(); SelectObject(bitmap); }
24 wxMemoryDC( wxDC *dc ); // Create compatible DC
25 virtual ~wxMemoryDC(void);
26
27 const wxBitmap& GetSelectedBitmap() const { return m_selected; }
28 wxBitmap GetSelectedBitmap() { return m_selected; }
29
30 wxBitmap GetSelectedObject() { return GetSelectedBitmap() ; }
31
32 protected:
33 virtual void DoGetSize( int *width, int *height ) const;
34 virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const
35 { return subrect == NULL ? GetSelectedBitmap() : GetSelectedBitmap().GetSubBitmap(*subrect); }
36 virtual void DoSelect(const wxBitmap& bitmap);
37
38 private:
39 void Init();
40
41 wxBitmap m_selected;
42 };
43
44 #endif
45 // _WX_DCMEMORY_H_