]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk1/dcmemory.cpp
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
7 // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
12 #pragma implementation "dcmemory.h"
15 #include "wx/dcmemory.h"
17 #ifdef wxUSE_GDK_IMLIB
18 #include "../gdk_imlib/gdk_imlib.h"
21 //-----------------------------------------------------------------------------
23 //-----------------------------------------------------------------------------
25 IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC
,wxPaintDC
)
27 wxMemoryDC::wxMemoryDC(void)
31 #ifdef wxUSE_GDK_IMLIB
32 m_cmap
= gdk_imlib_get_colormap();
34 m_cmap
= gdk_colormap_get_system();
38 wxMemoryDC::wxMemoryDC( wxDC
*WXUNUSED(dc
) )
42 #ifdef wxUSE_GDK_IMLIB
43 m_cmap
= gdk_imlib_get_colormap();
45 m_cmap
= gdk_colormap_get_system();
49 wxMemoryDC::~wxMemoryDC(void)
53 void wxMemoryDC::SelectObject( const wxBitmap
& bitmap
)
58 if (m_selected
.GetPixmap())
60 m_window
= m_selected
.GetPixmap();
64 m_window
= m_selected
.GetBitmap();
74 m_window
= (GdkWindow
*) NULL
;
78 void wxMemoryDC::GetSize( 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;