]> git.saurik.com Git - wxWidgets.git/blame - src/gtk/dc.cpp
don't define wxCRT_xxprintfW function if the corresponding xxprintfw() standard funct...
[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
d296fd8f 15
d296fd8f
RR
16//-----------------------------------------------------------------------------
17// wxDC
18//-----------------------------------------------------------------------------
19
2970ae54
RR
20#if wxUSE_NEW_DC
21IMPLEMENT_ABSTRACT_CLASS(wxGTKImplDC, wxDC)
22#else
23IMPLEMENT_ABSTRACT_CLASS(wxGTKImplDC, wxDCBase)
24#endif
c801d85f 25
2970ae54 26wxGTKImplDC::wxGTKImplDC()
c801d85f 27{
4bc67cc5 28 m_ok = FALSE;
a23fd0e1 29
4bc67cc5
RR
30 m_pen = *wxBLACK_PEN;
31 m_font = *wxNORMAL_FONT;
41bf0eb3 32 m_brush = *wxWHITE_BRUSH;
ff7b1510 33}
c801d85f 34
2970ae54 35void wxGTKImplDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
c801d85f 36{
4bc67cc5
RR
37 m_clipping = TRUE;
38 m_clipX1 = x;
39 m_clipY1 = y;
40 m_clipX2 = x + width;
41 m_clipY2 = y + height;
ff7b1510 42}
c801d85f 43
a23fd0e1
VZ
44// ---------------------------------------------------------------------------
45// get DC capabilities
46// ---------------------------------------------------------------------------
c801d85f 47
2970ae54 48void wxGTKImplDC::DoGetSizeMM( int* width, int* height ) const
c801d85f 49{
4bc67cc5
RR
50 int w = 0;
51 int h = 0;
52 GetSize( &w, &h );
ce83033f
VZ
53 if (width) *width = int( double(w) / (m_userScaleX*m_mm_to_pix_x) );
54 if (height) *height = int( double(h) / (m_userScaleY*m_mm_to_pix_y) );
7bcb11d3
JS
55}
56
57// Resolution in pixels per logical inch
2970ae54 58wxSize wxGTKImplDC::GetPPI() const
7bcb11d3
JS
59{
60 // TODO (should probably be pure virtual)
61 return wxSize(0, 0);
ff7b1510 62}