]> git.saurik.com Git - wxWidgets.git/blob - src/dfb/dcmemory.cpp
Move code that does not need realized GdkWinow out of realize handler
[wxWidgets.git] / src / dfb / dcmemory.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/dfb/dcmemory.cpp
3 // Purpose: wxMemoryDCImpl implementation
4 // Author: Vaclav Slavik
5 // Created: 2006-08-16
6 // Copyright: (c) 2006 REA Elektronik GmbH
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 // ===========================================================================
11 // declarations
12 // ===========================================================================
13
14 // ---------------------------------------------------------------------------
15 // headers
16 // ---------------------------------------------------------------------------
17
18 // For compilers that support precompilation, includes "wx.h".
19 #include "wx/wxprec.h"
20
21 #ifndef WX_PRECOMP
22 #include "wx/bitmap.h"
23 #endif
24
25 #include "wx/dcmemory.h"
26 #include "wx/dfb/dcmemory.h"
27 #include "wx/dfb/private.h"
28
29 // ===========================================================================
30 // implementation
31 // ===========================================================================
32
33 //-----------------------------------------------------------------------------
34 // wxMemoryDCImpl
35 //-----------------------------------------------------------------------------
36
37 #warning "FIXME: verify/fix that wxMemoryDCImpl works correctly with mono bitmaps"
38
39 IMPLEMENT_ABSTRACT_CLASS(wxMemoryDCImpl, wxDFBDCImpl)
40
41 void wxMemoryDCImpl::Init()
42 {
43 }
44
45 wxMemoryDCImpl::wxMemoryDCImpl(wxMemoryDC *owner)
46 : wxDFBDCImpl(owner)
47 {
48 Init();
49 }
50
51 wxMemoryDCImpl::wxMemoryDCImpl(wxMemoryDC *owner, wxBitmap& bitmap)
52 : wxDFBDCImpl(owner)
53 {
54 Init();
55 DoSelect(bitmap);
56 }
57
58 wxMemoryDCImpl::wxMemoryDCImpl(wxMemoryDC *owner, wxDC *WXUNUSED(dc))
59 : wxDFBDCImpl(owner)
60 {
61 }
62
63 void wxMemoryDCImpl::DoSelect(const wxBitmap& bitmap)
64 {
65 m_bmp = bitmap;
66
67 if ( !bitmap.IsOk() )
68 {
69 // select the bitmap out of the DC
70 m_surface = NULL;
71 return;
72 }
73
74 // init the DC for drawing to this bitmap
75 DFBInit(bitmap.GetDirectFBSurface());
76 }