]> git.saurik.com Git - wxWidgets.git/blame - src/gtk1/dc.cpp
fixed wxSVGFileDC::write() to output UTF-8 even in ANSI build
[wxWidgets.git] / src / gtk1 / 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
071a2d78
RR
15#include <gdk/gdk.h>
16#include <gtk/gtk.h>
83624f79 17
c801d85f
KB
18//-----------------------------------------------------------------------------
19// wxDC
20//-----------------------------------------------------------------------------
21
a23fd0e1 22IMPLEMENT_ABSTRACT_CLASS(wxDC, wxDCBase)
c801d85f 23
4bc67cc5 24wxDC::wxDC()
c801d85f 25{
4bc67cc5 26 m_ok = FALSE;
a23fd0e1 27
4bc67cc5 28 m_logicalFunction = wxCOPY;
a23fd0e1 29
4bc67cc5
RR
30 m_pen = *wxBLACK_PEN;
31 m_font = *wxNORMAL_FONT;
41bf0eb3 32 m_brush = *wxWHITE_BRUSH;
ff7b1510 33}
c801d85f 34
72cdf4c9 35void wxDC::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
a23fd0e1 48void wxDC::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
a23fd0e1 58wxSize wxDC::GetPPI() const
7bcb11d3
JS
59{
60 // TODO (should probably be pure virtual)
61 return wxSize(0, 0);
ff7b1510 62}
c801d85f 63