X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dfc5454127ac2195e10deebb216d82c674e757df..4a33eba645f96bf7a89397d7dbadd7d62ee2fde1:/src/motif/dc.cpp diff --git a/src/motif/dc.cpp b/src/motif/dc.cpp index a7508a94ba..8502eb79e4 100644 --- a/src/motif/dc.cpp +++ b/src/motif/dc.cpp @@ -14,6 +14,7 @@ #endif #include "wx/dc.h" +#include "wx/dcmemory.h" #if !USE_SHARED_LIBRARY IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject) @@ -80,6 +81,8 @@ wxDC::wxDC(void) m_font = *wxNORMAL_FONT; m_brush = *wxTRANSPARENT_BRUSH; m_backgroundBrush = *wxWHITE_BRUSH; + + m_isInteractive = FALSE; // m_palette = wxAPP_COLOURMAP; }; @@ -92,6 +95,31 @@ void wxDC::DrawIcon( const wxIcon &WXUNUSED(icon), long WXUNUSED(x), long WXUNUS { }; +void wxDC::DrawBitmap( const wxBitmap& bitmap, long x, long y, bool useMask ) +{ + if (!bitmap.Ok()) + return; + + wxMemoryDC memDC; + memDC.SelectObject(bitmap); + +/* Not sure if we need this. The mask should leave the + * masked areas as per the original background of this DC. + if (useMask) + { + // There might be transparent areas, so make these + // the same colour as this DC + memDC.SetBackground(* GetBackground()); + memDC.Clear(); + } +*/ + + Blit(x, y, bitmap.GetWidth(), bitmap.GetHeight(), & memDC, 0, 0, wxCOPY, useMask); + + memDC.SelectObject(wxNullBitmap); +}; + + void wxDC::DrawPoint( wxPoint& point ) { DrawPoint( point.x, point.y ); @@ -145,11 +173,6 @@ void wxDC::DrawSpline( long x1, long y1, long x2, long y2, long x3, long y3 ) }; }; -void wxDC::DrawSpline( wxList *points ) -{ - DrawOpenSpline( points ); -}; - void wxDC::DrawSpline( int n, wxPoint points[] ) { wxList list; @@ -380,10 +403,10 @@ void wxDC::ComputeScaleAndOrigin(void) { // this is a bit artificial, but we need to force wxDC to think // the pen has changed - wxPen* pen = GetPen(); + wxPen* pen = & GetPen(); wxPen tempPen; m_pen = tempPen; - SetPen(pen); + SetPen(* pen); } };