]>
git.saurik.com Git - wxWidgets.git/blob - src/x11/dcmemory.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxMemoryDC class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #include "wx/dcmemory.h"
13 #include "wx/settings.h"
16 #include "wx/x11/private.h"
18 IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC
,wxWindowDC
)
20 wxMemoryDC::wxMemoryDC() : wxWindowDC()
24 m_display
= (WXDisplay
*) wxGlobalDisplay();
26 int screen
= DefaultScreen( wxGlobalDisplay() );
27 m_cmap
= (WXColormap
) DefaultColormap( wxGlobalDisplay(), screen
);
30 wxMemoryDC::wxMemoryDC( wxDC
*WXUNUSED(dc
) )
35 m_display
= (WXDisplay
*) wxGlobalDisplay();
37 int screen
= DefaultScreen( wxGlobalDisplay() );
38 m_cmap
= (WXColormap
) DefaultColormap( wxGlobalDisplay(), screen
);
41 wxMemoryDC::~wxMemoryDC()
45 void wxMemoryDC::SelectObject( const wxBitmap
& bitmap
)
52 if (m_selected
.GetPixmap())
54 m_window
= (WXWindow
) m_selected
.GetPixmap();
58 m_window
= m_selected
.GetBitmap();
72 void wxMemoryDC::DoGetSize( int *width
, int *height
) const
76 if (width
) (*width
) = m_selected
.GetWidth();
77 if (height
) (*height
) = m_selected
.GetHeight();
81 if (width
) (*width
) = 0;
82 if (height
) (*height
) = 0;