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