]> git.saurik.com Git - wxWidgets.git/blame - src/gtk1/dc.cpp
Avoid using wxHtmlTag::HasParam() unnecessarily.
[wxWidgets.git] / src / gtk1 / dc.cpp
CommitLineData
c801d85f 1/////////////////////////////////////////////////////////////////////////////
80fdcdb9 2// Name: src/gtk1/dc.cpp
c801d85f
KB
3// Purpose:
4// Author: Robert Roebling
6c9a19aa 5// Copyright: (c) 1998 Robert Roebling
65571936 6// Licence: wxWindows licence
c801d85f
KB
7/////////////////////////////////////////////////////////////////////////////
8
14f355c2
VS
9// For compilers that support precompilation, includes "wx.h".
10#include "wx/wxprec.h"
c801d85f 11
10d30222 12#include "wx/gtk1/dc.h"
c801d85f 13
071a2d78
RR
14#include <gdk/gdk.h>
15#include <gtk/gtk.h>
83624f79 16
c801d85f 17//-----------------------------------------------------------------------------
10d30222 18// wxGTKDCImpl
c801d85f
KB
19//-----------------------------------------------------------------------------
20
10d30222 21IMPLEMENT_ABSTRACT_CLASS(wxGTKDCImpl, wxDCImpl)
c801d85f 22
10d30222
VZ
23wxGTKDCImpl::wxGTKDCImpl(wxDC *owner)
24 : wxDCImpl(owner)
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
10d30222 35void wxGTKDCImpl::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
10d30222 48void wxGTKDCImpl::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
10d30222 58wxSize wxGTKDCImpl::GetPPI() const
7bcb11d3
JS
59{
60 // TODO (should probably be pure virtual)
61 return wxSize(0, 0);
ff7b1510 62}
c801d85f 63