]>
git.saurik.com Git - wxWidgets.git/blob - src/x11/dcmemory.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/x11/dcmemory.cpp
3 // Purpose: wxMemoryDC class
4 // Author: Julian Smart
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 // for compilers that support precompilation, includes "wx.h".
12 #include "wx/wxprec.h"
14 #include "wx/dcmemory.h"
18 #include "wx/settings.h"
21 #include "wx/x11/private.h"
22 #include "wx/x11/dcmemory.h"
24 IMPLEMENT_ABSTRACT_CLASS(wxMemoryDCImpl
,wxWindowDCImpl
)
26 wxMemoryDCImpl::wxMemoryDCImpl( wxDC
*owner
)
27 : wxWindowDCImpl( owner
)
32 wxMemoryDCImpl::wxMemoryDCImpl( wxDC
*owner
, wxBitmap
& bitmap
)
33 : wxWindowDCImpl( owner
)
39 wxMemoryDCImpl::wxMemoryDCImpl( wxDC
* owner
, wxDC
*WXUNUSED(dc
) )
40 : wxWindowDCImpl( owner
)
45 void wxMemoryDCImpl::Init()
49 m_display
= (WXDisplay
*) wxGlobalDisplay();
51 int screen
= DefaultScreen( wxGlobalDisplay() );
52 m_cmap
= (WXColormap
) DefaultColormap( wxGlobalDisplay(), screen
);
55 wxMemoryDCImpl::~wxMemoryDCImpl()
59 void wxMemoryDCImpl::DoSelect( const wxBitmap
& bitmap
)
64 if (m_selected
.IsOk())
66 if (m_selected
.GetPixmap())
68 m_x11window
= (WXWindow
) m_selected
.GetPixmap();
72 m_x11window
= m_selected
.GetBitmap();
86 void wxMemoryDCImpl::DoGetSize( int *width
, int *height
) const
88 if (m_selected
.IsOk())
90 if (width
) (*width
) = m_selected
.GetWidth();
91 if (height
) (*height
) = m_selected
.GetHeight();
95 if (width
) (*width
) = 0;
96 if (height
) (*height
) = 0;
100 const wxBitmap
& wxMemoryDCImpl::GetSelectedBitmap() const
105 wxBitmap
& wxMemoryDCImpl::GetSelectedBitmap()