]>
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" 
  23 #include "wx/x11/dcmemory.h" 
  25 IMPLEMENT_ABSTRACT_CLASS(wxMemoryDCImpl
,wxWindowDCImpl
) 
  27 wxMemoryDCImpl::wxMemoryDCImpl( wxDC 
*owner 
) 
  28   : wxWindowDCImpl( owner 
) 
  33 wxMemoryDCImpl::wxMemoryDCImpl(  wxDC 
*owner
, wxBitmap
& bitmap 
) 
  34   : wxWindowDCImpl( owner 
) 
  40 wxMemoryDCImpl::wxMemoryDCImpl( wxDC
* owner
, wxDC 
*WXUNUSED(dc
) ) 
  41   : wxWindowDCImpl( owner 
) 
  46 void wxMemoryDCImpl::Init() 
  50     m_display 
= (WXDisplay 
*) wxGlobalDisplay(); 
  52     int screen 
= DefaultScreen( wxGlobalDisplay() ); 
  53     m_cmap 
= (WXColormap
) DefaultColormap( wxGlobalDisplay(), screen 
); 
  56 wxMemoryDCImpl::~wxMemoryDCImpl() 
  60 void wxMemoryDCImpl::DoSelect( const wxBitmap
& bitmap 
) 
  67         if (m_selected
.GetPixmap()) 
  69             m_x11window 
= (WXWindow
) m_selected
.GetPixmap(); 
  73             m_x11window 
= m_selected
.GetBitmap(); 
  87 void wxMemoryDCImpl::DoGetSize( int *width
, int *height 
) const 
  91         if (width
) (*width
) = m_selected
.GetWidth(); 
  92         if (height
) (*height
) = m_selected
.GetHeight(); 
  96         if (width
) (*width
) = 0; 
  97         if (height
) (*height
) = 0; 
 101 const wxBitmap
& wxMemoryDCImpl::GetSelectedBitmap() const 
 106 wxBitmap
& wxMemoryDCImpl::GetSelectedBitmap()