]> git.saurik.com Git - wxWidgets.git/blame - src/x11/dc.cpp
Fix wxHtmlHelpData::SetTempDir() to behave correctly without trailing slash.
[wxWidgets.git] / src / x11 / dc.cpp
CommitLineData
83df96d6 1/////////////////////////////////////////////////////////////////////////////
7520f3da 2// Name: src/x11/dc.cpp
83df96d6
JS
3// Purpose: wxDC class
4// Author: Julian Smart
5// Modified by:
6// Created: 01/02/97
83df96d6 7// Copyright: (c) Julian Smart
65571936 8// Licence: wxWindows licence
83df96d6
JS
9/////////////////////////////////////////////////////////////////////////////
10
7520f3da
WS
11// for compilers that support precompilation, includes "wx.h".
12#include "wx/wxprec.h"
13
83df96d6 14#include "wx/dc.h"
2b77c3fc 15#include "wx/x11/dc.h"
f38924e8
WS
16
17#ifndef WX_PRECOMP
18 #include "wx/dcmemory.h"
19#endif
83df96d6 20
2b77c3fc 21IMPLEMENT_ABSTRACT_CLASS(wxX11DCImpl, wxDCImpl)
83df96d6 22
83df96d6
JS
23//-----------------------------------------------------------------------------
24// wxDC
25//-----------------------------------------------------------------------------
26
2b77c3fc
RR
27wxX11DCImpl::wxX11DCImpl( wxDC *owner ) :
28 wxDCImpl( owner )
83df96d6 29{
7520f3da 30 m_ok = false;
83df96d6 31
3cd0b8c5
RR
32 m_pen = *wxBLACK_PEN;
33 m_font = *wxNORMAL_FONT;
34 m_brush = *wxWHITE_BRUSH;
83df96d6 35
3cd0b8c5 36 m_backgroundMode = wxTRANSPARENT;
83df96d6
JS
37}
38
2b77c3fc 39void wxX11DCImpl::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
83df96d6 40{
7520f3da 41 m_clipping = true;
83df96d6
JS
42 m_clipX1 = x;
43 m_clipY1 = y;
44 m_clipX2 = x + width;
45 m_clipY2 = y + height;
46}
47
2b77c3fc 48void wxX11DCImpl::DoGetSizeMM( int* width, int* height ) const
83df96d6
JS
49{
50 int w, h;
2b77c3fc 51 DoGetSize( &w, &h );
83df96d6
JS
52
53 if ( width )
54 *width = int( double(w) / (m_scaleX*m_mm_to_pix_x) );
55 if ( height )
56 *height = int( double(h) / (m_scaleY*m_mm_to_pix_y) );
57}
58
59// Resolution in pixels per logical inch
2b77c3fc 60wxSize wxX11DCImpl::GetPPI() const
83df96d6
JS
61{
62 // TODO (should probably be pure virtual)
63 return wxSize(0, 0);
64}