]> git.saurik.com Git - wxWidgets.git/blob - src/gtk/dc.cpp
fix compilation in wxUSE_MENUS==0 case
[wxWidgets.git] / src / gtk / dc.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: dc.cpp
3 // Purpose:
4 // Author: Robert Roebling
5 // RCS-ID: $Id$
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 // For compilers that support precompilation, includes "wx.h".
11 #include "wx/wxprec.h"
12
13 #include "wx/dc.h"
14
15 //-----------------------------------------------------------------------------
16 // wxDC
17 //-----------------------------------------------------------------------------
18
19 IMPLEMENT_ABSTRACT_CLASS(wxDC, wxDCBase)
20
21 wxDC::wxDC()
22 {
23 m_ok = FALSE;
24
25 m_pen = *wxBLACK_PEN;
26 m_font = *wxNORMAL_FONT;
27 m_brush = *wxWHITE_BRUSH;
28 }
29
30 void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
31 {
32 m_clipping = TRUE;
33 m_clipX1 = x;
34 m_clipY1 = y;
35 m_clipX2 = x + width;
36 m_clipY2 = y + height;
37 }
38
39 // ---------------------------------------------------------------------------
40 // get DC capabilities
41 // ---------------------------------------------------------------------------
42
43 void wxDC::DoGetSizeMM( int* width, int* height ) const
44 {
45 int w = 0;
46 int h = 0;
47 GetSize( &w, &h );
48 if (width) *width = int( double(w) / (m_userScaleX*m_mm_to_pix_x) );
49 if (height) *height = int( double(h) / (m_userScaleY*m_mm_to_pix_y) );
50 }
51
52 // Resolution in pixels per logical inch
53 wxSize wxDC::GetPPI() const
54 {
55 // TODO (should probably be pure virtual)
56 return wxSize(0, 0);
57 }