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