]>
git.saurik.com Git - wxWidgets.git/blob - src/motif/dc.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/motif/dc.cpp
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"
18 #include "wx/dcmemory.h"
21 IMPLEMENT_ABSTRACT_CLASS(wxDC
, wxObject
)
23 //-----------------------------------------------------------------------------
25 //-----------------------------------------------------------------------------
31 m_backgroundMode
= wxTRANSPARENT
;
33 m_isInteractive
= false;
36 void wxDC::DoDrawIcon( const wxIcon
&icon
, wxCoord x
, wxCoord y
)
38 wxCHECK_RET( Ok(), "invalid dc" );
39 wxCHECK_RET( icon
.Ok(), "invalid icon" );
41 DoDrawBitmap(icon
, x
, y
, true);
44 void wxDC::DoDrawBitmap( const wxBitmap
& bitmap
, wxCoord x
, wxCoord y
, bool useMask
)
46 wxCHECK_RET( bitmap
.Ok(), "invalid bitmap" );
49 memDC
.SelectObjectAsSource(bitmap
);
52 // Not sure if we need this. The mask should leave the masked areas as per
53 // the original background of this DC.
56 // There might be transparent areas, so make these the same colour as this
58 memDC
.SetBackground(* GetBackground());
63 Blit(x
, y
, bitmap
.GetWidth(), bitmap
.GetHeight(), &memDC
, 0, 0, wxCOPY
, useMask
);
65 memDC
.SelectObject(wxNullBitmap
);
68 void wxDC::DoSetClippingRegion( wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
)
74 m_clipY2
= y
+ height
;
77 void wxDC::DoGetSize( int* width
, int* height
) const
80 *width
= m_maxX
- m_minX
;
82 *height
= m_maxY
- m_minY
;
85 void wxDC::DoGetSizeMM( int* width
, int* height
) const
91 *width
= int( double(w
) / (m_scaleX
*m_mm_to_pix_x
) );
93 *height
= int( double(h
) / (m_scaleY
*m_mm_to_pix_y
) );
96 // Resolution in pixels per logical inch
97 wxSize
wxDC::GetPPI() const
99 // TODO (should probably be pure virtual)