Repository navigation
Expand file tree
/
Copy pathdc.cpp
More file actions
65 lines (53 loc) · 1.58 KB
/
Copy pathdc.cpp
File metadata and controls
65 lines (53 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/////////////////////////////////////////////////////////////////////////////
// Name: src/x11/dc.cpp
// Purpose: wxDC class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// for compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#include "wx/dc.h"
#include "wx/x11/dc.h"
#ifndef WX_PRECOMP
#include "wx/dcmemory.h"
#endif
IMPLEMENT_ABSTRACT_CLASS(wxX11DCImpl, wxDCImpl)
//-----------------------------------------------------------------------------
// wxDC
//-----------------------------------------------------------------------------
wxX11DCImpl::wxX11DCImpl( wxDC *owner ) :
wxDCImpl( owner )
{
m_ok = false;
m_pen = *wxBLACK_PEN;
m_font = *wxNORMAL_FONT;
m_brush = *wxWHITE_BRUSH;
m_backgroundMode = wxTRANSPARENT;
}
void wxX11DCImpl::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
{
m_clipping = true;
m_clipX1 = x;
m_clipY1 = y;
m_clipX2 = x + width;
m_clipY2 = y + height;
}
void wxX11DCImpl::DoGetSizeMM( int* width, int* height ) const
{
int w, h;
DoGetSize( &w, &h );
if ( width )
*width = int( double(w) / (m_scaleX*m_mm_to_pix_x) );
if ( height )
*height = int( double(h) / (m_scaleY*m_mm_to_pix_y) );
}
// Resolution in pixels per logical inch
wxSize wxX11DCImpl::GetPPI() const
{
// TODO (should probably be pure virtual)
return wxSize(0, 0);
}