]>
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 wxMemoryDC::wxMemoryDC() : wxWindowDC()
30 m_display
= (WXDisplay
*) wxGlobalDisplay();
32 int screen
= DefaultScreen( wxGlobalDisplay() );
33 m_cmap
= (WXColormap
) DefaultColormap( wxGlobalDisplay(), screen
);
36 wxMemoryDC::wxMemoryDC( wxDC
*WXUNUSED(dc
) )
41 m_display
= (WXDisplay
*) wxGlobalDisplay();
43 int screen
= DefaultScreen( wxGlobalDisplay() );
44 m_cmap
= (WXColormap
) DefaultColormap( wxGlobalDisplay(), screen
);
47 wxMemoryDC::~wxMemoryDC()
51 void wxMemoryDC::SelectObject( const wxBitmap
& bitmap
)
58 if (m_selected
.GetPixmap())
60 m_window
= (WXWindow
) m_selected
.GetPixmap();
64 m_window
= m_selected
.GetBitmap();
78 void wxMemoryDC::DoGetSize( int *width
, int *height
) const
82 if (width
) (*width
) = m_selected
.GetWidth();
83 if (height
) (*height
) = m_selected
.GetHeight();
87 if (width
) (*width
) = 0;
88 if (height
) (*height
) = 0;