]> git.saurik.com Git - wxWidgets.git/blame - include/wx/dcmemory.h
fix aui crash related to SF bug 1531361
[wxWidgets.git] / include / wx / dcmemory.h
CommitLineData
99d80019
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/dcmemory.h
3// Purpose: wxMemoryDC base header
4// Author: Julian Smart
5// Modified by:
6// Created:
7// Copyright: (c) Julian Smart
8// RCS-ID: $Id$
9// Licence: wxWindows Licence
10/////////////////////////////////////////////////////////////////////////////
11
34138703
JS
12#ifndef _WX_DCMEMORY_H_BASE_
13#define _WX_DCMEMORY_H_BASE_
c801d85f 14
e45689df 15#include "wx/defs.h"
c319bc47 16#include "wx/bitmap.h"
e45689df 17
fea35690
VZ
18// NOTE: different native implementations of wxMemoryDC will derive from
19// different wxDC classes (wxPaintDC, wxWindowDC, etc), so that
20// we cannot derive wxMemoryDCBase from wxDC and then use it as the
21// only base class for native impl of wxMemoryDC...
8c6686ef 22class WXDLLEXPORT wxMemoryDCBase
fea35690
VZ
23{
24public:
25 wxMemoryDCBase() { }
26
27 // avoid warnings about having virtual functions but non virtual dtor
28 virtual ~wxMemoryDCBase() { }
29
30 // select the given bitmap to draw on it
31 void SelectObject(wxBitmap& bmp)
32 {
33 // make sure that the given wxBitmap is not sharing its data with other
34 // wxBitmap instances as its contents will be modified by any drawing
35 // operation done on this DC
36 if (bmp.IsOk())
37 bmp.UnShare();
38
39 DoSelect(bmp);
40 }
41
42 // select the given bitmap for read-only
43 virtual void SelectObjectAsSource(const wxBitmap& bmp)
44 {
45 DoSelect(bmp);
46 }
47
48 virtual void DoSelect(const wxBitmap& bmp) = 0;
49};
50
4055ed82 51#if defined(__WXPALMOS__)
ffecfa5a
JS
52#include "wx/palmos/dcmemory.h"
53#elif defined(__WXMSW__)
c801d85f 54#include "wx/msw/dcmemory.h"
2049ba38 55#elif defined(__WXMOTIF__)
34138703 56#include "wx/motif/dcmemory.h"
1be7a35c 57#elif defined(__WXGTK20__)
c801d85f 58#include "wx/gtk/dcmemory.h"
1be7a35c
MR
59#elif defined(__WXGTK__)
60#include "wx/gtk1/dcmemory.h"
83df96d6
JS
61#elif defined(__WXX11__)
62#include "wx/x11/dcmemory.h"
1e6feb95
VZ
63#elif defined(__WXMGL__)
64#include "wx/mgl/dcmemory.h"
b3c86150
VS
65#elif defined(__WXDFB__)
66#include "wx/dfb/dcmemory.h"
34138703
JS
67#elif defined(__WXMAC__)
68#include "wx/mac/dcmemory.h"
e64df9bc
DE
69#elif defined(__WXCOCOA__)
70#include "wx/cocoa/dcmemory.h"
1777b9bb
DW
71#elif defined(__WXPM__)
72#include "wx/os2/dcmemory.h"
c801d85f
KB
73#endif
74
75#endif
34138703 76 // _WX_DCMEMORY_H_BASE_