]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/dcmemory.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxMemoryDC class
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "dcmemory.h"
16 #include "wx/dcmemory.h"
18 //-----------------------------------------------------------------------------
20 //-----------------------------------------------------------------------------
22 IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC
,wxPaintDC
)
24 wxMemoryDC::wxMemoryDC(void)
27 SetBackground(*wxWHITE_BRUSH
);
28 SetBrush(*wxWHITE_BRUSH
);
33 wxMemoryDC::wxMemoryDC( wxDC
*WXUNUSED(dc
) )
36 SetBackground(*wxWHITE_BRUSH
);
37 SetBrush(*wxWHITE_BRUSH
);
42 wxMemoryDC::~wxMemoryDC()
44 if ( m_selected
.Ok() )
46 UnlockPixels( GetGWorldPixMap(m_selected
.GetHBITMAP()) );
50 void wxMemoryDC::SelectObject( const wxBitmap
& bitmap
)
52 if ( m_selected
.Ok() )
54 UnlockPixels( GetGWorldPixMap(m_selected
.GetHBITMAP()) );
59 if ( m_selected
.GetHBITMAP() )
61 m_macPort
= (GrafPtr
) m_selected
.GetHBITMAP() ;
62 LockPixels( GetGWorldPixMap( (CGrafPtr
) m_macPort
) ) ;
63 wxMask
* mask
= bitmap
.GetMask() ;
66 m_macMask
= mask
->GetMaskBitmap() ;
81 void wxMemoryDC::DoGetSize( int *width
, int *height
) const
85 if (width
) (*width
) = m_selected
.GetWidth();
86 if (height
) (*height
) = m_selected
.GetHeight();
90 if (width
) (*width
) = 0;
91 if (height
) (*height
) = 0;