]>
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"
21 #include "wx/settings.h"
23 #include "wx/x11/private.h"
25 IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC
,wxWindowDC
)
27 wxMemoryDC::wxMemoryDC() : wxWindowDC()
31 m_display
= (WXDisplay
*) wxGlobalDisplay();
33 int screen
= DefaultScreen( wxGlobalDisplay() );
34 m_cmap
= (WXColormap
) DefaultColormap( wxGlobalDisplay(), screen
);
37 wxMemoryDC::wxMemoryDC( wxDC
*WXUNUSED(dc
) )
42 m_display
= (WXDisplay
*) wxGlobalDisplay();
44 int screen
= DefaultScreen( wxGlobalDisplay() );
45 m_cmap
= (WXColormap
) DefaultColormap( wxGlobalDisplay(), screen
);
48 wxMemoryDC::~wxMemoryDC()
52 void wxMemoryDC::SelectObject( const wxBitmap
& bitmap
)
59 if (m_selected
.GetPixmap())
61 m_window
= (WXWindow
) m_selected
.GetPixmap();
65 m_window
= m_selected
.GetBitmap();
79 void wxMemoryDC::DoGetSize( int *width
, int *height
) const
83 if (width
) (*width
) = m_selected
.GetWidth();
84 if (height
) (*height
) = m_selected
.GetHeight();
88 if (width
) (*width
) = 0;
89 if (height
) (*height
) = 0;