]>
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
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 // For compilers that support precompilation, includes "wx.h".
12 #include "wx/wxprec.h"
15 #include "wx/dcmemory.h"
19 #include "wx/motif/dc.h"
21 IMPLEMENT_ABSTRACT_CLASS(wxMotifDCImpl
, wxDCImpl
)
23 //-----------------------------------------------------------------------------
25 //-----------------------------------------------------------------------------
27 wxMotifDCImpl::wxMotifDCImpl(wxDC
*owner
)
32 m_backgroundMode
= wxTRANSPARENT
;
35 void wxMotifDCImpl::DoDrawIcon( const wxIcon
&icon
, wxCoord x
, wxCoord y
)
37 wxCHECK_RET( IsOk(), "invalid dc" );
38 wxCHECK_RET( icon
.IsOk(), "invalid icon" );
40 DoDrawBitmap(icon
, x
, y
, true);
43 void wxMotifDCImpl::DoDrawBitmap( const wxBitmap
& bitmap
, wxCoord x
, wxCoord y
, bool useMask
)
45 wxCHECK_RET( bitmap
.IsOk(), "invalid bitmap" );
48 memDC
.SelectObjectAsSource(bitmap
);
51 // Not sure if we need this. The mask should leave the masked areas as per
52 // the original background of this DC.
55 // There might be transparent areas, so make these the same colour as this
57 memDC
.SetBackground(* GetBackground());
62 DoBlit(x
, y
, bitmap
.GetWidth(), bitmap
.GetHeight(), &memDC
, 0, 0, wxCOPY
, useMask
);
64 memDC
.SelectObject(wxNullBitmap
);
67 void wxMotifDCImpl::DoSetClippingRegion( wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
)
73 m_clipY2
= y
+ height
;
76 void wxMotifDCImpl::DoGetSize( int* width
, int* height
) const
79 *width
= m_maxX
- m_minX
;
81 *height
= m_maxY
- m_minY
;
84 void wxMotifDCImpl::DoGetSizeMM( int* width
, int* height
) const
90 *width
= int( double(w
) / (m_scaleX
*m_mm_to_pix_x
) );
92 *height
= int( double(h
) / (m_scaleY
*m_mm_to_pix_y
) );
95 // Resolution in pixels per logical inch
96 wxSize
wxMotifDCImpl::GetPPI() const
98 // TODO (should probably be pure virtual)