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