]>
git.saurik.com Git - wxWidgets.git/blob - src/motif/dc.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/motif/dc.cpp
3 // Purpose: wxMotifDCImpl 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"
16 #include "wx/dcmemory.h"
20 #include "wx/motif/dc.h"
22 IMPLEMENT_ABSTRACT_CLASS(wxMotifDCImpl
, wxDCImpl
)
24 //-----------------------------------------------------------------------------
26 //-----------------------------------------------------------------------------
28 wxMotifDCImpl::wxMotifDCImpl(wxDC
*owner
)
33 m_backgroundMode
= wxTRANSPARENT
;
36 void wxMotifDCImpl::DoDrawIcon( const wxIcon
&icon
, wxCoord x
, wxCoord y
)
38 wxCHECK_RET( IsOk(), "invalid dc" );
39 wxCHECK_RET( icon
.Ok(), "invalid icon" );
41 DoDrawBitmap(icon
, x
, y
, true);
44 void wxMotifDCImpl::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 DoBlit(x
, y
, bitmap
.GetWidth(), bitmap
.GetHeight(), &memDC
, 0, 0, wxCOPY
, useMask
);
65 memDC
.SelectObject(wxNullBitmap
);
68 void wxMotifDCImpl::DoSetClippingRegion( wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
)
74 m_clipY2
= y
+ height
;
77 void wxMotifDCImpl::DoGetSize( int* width
, int* height
) const
80 *width
= m_maxX
- m_minX
;
82 *height
= m_maxY
- m_minY
;
85 void wxMotifDCImpl::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
wxMotifDCImpl::GetPPI() const
99 // TODO (should probably be pure virtual)