]>
Commit | Line | Data |
---|---|---|
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 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Julian Smart | |
65571936 | 9 | // Licence: wxWindows licence |
83df96d6 JS |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
7520f3da WS |
12 | // for compilers that support precompilation, includes "wx.h". |
13 | #include "wx/wxprec.h" | |
14 | ||
83df96d6 | 15 | #include "wx/dc.h" |
f38924e8 WS |
16 | |
17 | #ifndef WX_PRECOMP | |
18 | #include "wx/dcmemory.h" | |
19 | #endif | |
83df96d6 | 20 | |
bc797f4c | 21 | IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject) |
83df96d6 | 22 | |
83df96d6 JS |
23 | //----------------------------------------------------------------------------- |
24 | // wxDC | |
25 | //----------------------------------------------------------------------------- | |
26 | ||
27 | wxDC::wxDC() | |
28 | { | |
7520f3da | 29 | m_ok = false; |
83df96d6 | 30 | |
3cd0b8c5 RR |
31 | m_pen = *wxBLACK_PEN; |
32 | m_font = *wxNORMAL_FONT; | |
33 | m_brush = *wxWHITE_BRUSH; | |
83df96d6 | 34 | |
3cd0b8c5 | 35 | m_backgroundMode = wxTRANSPARENT; |
83df96d6 JS |
36 | } |
37 | ||
38 | void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height ) | |
39 | { | |
7520f3da | 40 | m_clipping = true; |
83df96d6 JS |
41 | m_clipX1 = x; |
42 | m_clipY1 = y; | |
43 | m_clipX2 = x + width; | |
44 | m_clipY2 = y + height; | |
45 | } | |
46 | ||
83df96d6 JS |
47 | void wxDC::DoGetSizeMM( int* width, int* height ) const |
48 | { | |
49 | int w, h; | |
50 | GetSize( &w, &h ); | |
51 | ||
52 | if ( width ) | |
53 | *width = int( double(w) / (m_scaleX*m_mm_to_pix_x) ); | |
54 | if ( height ) | |
55 | *height = int( double(h) / (m_scaleY*m_mm_to_pix_y) ); | |
56 | } | |
57 | ||
58 | // Resolution in pixels per logical inch | |
59 | wxSize wxDC::GetPPI() const | |
60 | { | |
61 | // TODO (should probably be pure virtual) | |
62 | return wxSize(0, 0); | |
63 | } |