]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk1/dc.cpp
53b451a8f345cd3e5810e5e88cf52f6c93cac259
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 // For compilers that support precompilation, includes "wx.h".
11 #include "wx/wxprec.h"
18 //-----------------------------------------------------------------------------
20 //-----------------------------------------------------------------------------
22 IMPLEMENT_ABSTRACT_CLASS(wxDC
, wxDCBase
)
28 m_mm_to_pix_x
= (double)wxGetDisplaySize().GetWidth() /
29 (double)wxGetDisplaySizeMM().GetWidth();
30 m_mm_to_pix_y
= (double)wxGetDisplaySize().GetHeight() /
31 (double)wxGetDisplaySizeMM().GetHeight();
33 m_needComputeScaleX
= FALSE
; /* not used yet */
34 m_needComputeScaleY
= FALSE
; /* not used yet */
36 m_logicalFunction
= wxCOPY
;
39 m_font
= *wxNORMAL_FONT
;
40 m_brush
= *wxWHITE_BRUSH
;
43 void wxDC::DoSetClippingRegion( wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
)
49 m_clipY2
= y
+ height
;
52 // ---------------------------------------------------------------------------
53 // get DC capabilities
54 // ---------------------------------------------------------------------------
56 void wxDC::DoGetSizeMM( int* width
, int* height
) const
61 if (width
) *width
= int( double(w
) / (m_userScaleX
*m_mm_to_pix_x
) );
62 if (height
) *height
= int( double(h
) / (m_userScaleY
*m_mm_to_pix_y
) );
65 // Resolution in pixels per logical inch
66 wxSize
wxDC::GetPPI() const
68 // TODO (should probably be pure virtual)