]>
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 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "dcmemory.h"
16 #include "wx/dcmemory.h"
17 #include "wx/settings.h"
20 #include "wx/x11/private.h"
22 IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC
,wxWindowDC
)
24 wxMemoryDC::wxMemoryDC() : wxWindowDC()
28 m_display
= (WXDisplay
*) wxGlobalDisplay();
30 int screen
= DefaultScreen( wxGlobalDisplay() );
31 m_cmap
= (WXColormap
) DefaultColormap( wxGlobalDisplay(), screen
);
34 wxMemoryDC::wxMemoryDC( wxDC
*WXUNUSED(dc
) )
39 m_display
= (WXDisplay
*) wxGlobalDisplay();
41 int screen
= DefaultScreen( wxGlobalDisplay() );
42 m_cmap
= (WXColormap
) DefaultColormap( wxGlobalDisplay(), screen
);
45 wxMemoryDC::~wxMemoryDC()
49 void wxMemoryDC::SelectObject( const wxBitmap
& bitmap
)
56 if (m_selected
.GetPixmap())
58 m_window
= (WXWindow
) m_selected
.GetPixmap();
62 m_window
= m_selected
.GetBitmap();
76 void wxMemoryDC::DoGetSize( int *width
, int *height
) const
80 if (width
) (*width
) = m_selected
.GetWidth();
81 if (height
) (*height
) = m_selected
.GetHeight();
85 if (width
) (*width
) = 0;
86 if (height
) (*height
) = 0;