]>
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
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // for compilers that support precompilation, includes "wx.h".
13 #include "wx/wxprec.h"
15 #include "wx/dcmemory.h"
19 #include "wx/settings.h"
22 #include "wx/x11/private.h"
24 IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC
,wxWindowDC
)
26 void wxMemoryDC::Init()
30 m_display
= (WXDisplay
*) wxGlobalDisplay();
32 int screen
= DefaultScreen( wxGlobalDisplay() );
33 m_cmap
= (WXColormap
) DefaultColormap( wxGlobalDisplay(), screen
);
36 wxMemoryDC::wxMemoryDC( wxDC
*WXUNUSED(dc
) )
42 wxMemoryDC::~wxMemoryDC()
46 void wxMemoryDC::DoSelect( const wxBitmap
& bitmap
)
53 if (m_selected
.GetPixmap())
55 m_window
= (WXWindow
) m_selected
.GetPixmap();
59 m_window
= m_selected
.GetBitmap();
73 void wxMemoryDC::DoGetSize( int *width
, int *height
) const
77 if (width
) (*width
) = m_selected
.GetWidth();
78 if (height
) (*height
) = m_selected
.GetHeight();
82 if (width
) (*width
) = 0;
83 if (height
) (*height
) = 0;