]>
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( const wxBitmap
& bitmap
)
31 m_display
= (WXDisplay
*) wxGlobalDisplay();
33 int screen
= DefaultScreen( wxGlobalDisplay() );
34 m_cmap
= (WXColormap
) DefaultColormap( wxGlobalDisplay(), screen
);
40 wxMemoryDC::wxMemoryDC( wxDC
*WXUNUSED(dc
) )
45 m_display
= (WXDisplay
*) wxGlobalDisplay();
47 int screen
= DefaultScreen( wxGlobalDisplay() );
48 m_cmap
= (WXColormap
) DefaultColormap( wxGlobalDisplay(), screen
);
51 wxMemoryDC::~wxMemoryDC()
55 void wxMemoryDC::SelectObject( const wxBitmap
& bitmap
)
62 if (m_selected
.GetPixmap())
64 m_window
= (WXWindow
) m_selected
.GetPixmap();
68 m_window
= m_selected
.GetBitmap();
82 void wxMemoryDC::DoGetSize( int *width
, int *height
) const
86 if (width
) (*width
) = m_selected
.GetWidth();
87 if (height
) (*height
) = m_selected
.GetHeight();
91 if (width
) (*width
) = 0;
92 if (height
) (*height
) = 0;