]>
Commit | Line | Data |
---|---|---|
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 | ||
d296fd8f | 15 | |
d296fd8f RR |
16 | //----------------------------------------------------------------------------- |
17 | // wxDC | |
18 | //----------------------------------------------------------------------------- | |
19 | ||
2970ae54 | 20 | #if wxUSE_NEW_DC |
ab171e95 | 21 | IMPLEMENT_ABSTRACT_CLASS(wxGTKImplDC, wxImplDC) |
2970ae54 RR |
22 | #else |
23 | IMPLEMENT_ABSTRACT_CLASS(wxGTKImplDC, wxDCBase) | |
24 | #endif | |
c801d85f | 25 | |
ab171e95 RR |
26 | #if wxUSE_NEW_DC |
27 | wxGTKImplDC::wxGTKImplDC( wxDC *owner ) | |
28 | : wxImplDC( owner ) | |
29 | #else | |
30 | wxDC::wxDC() | |
31 | #endif | |
c801d85f | 32 | { |
4bc67cc5 | 33 | m_ok = FALSE; |
a23fd0e1 | 34 | |
4bc67cc5 RR |
35 | m_pen = *wxBLACK_PEN; |
36 | m_font = *wxNORMAL_FONT; | |
41bf0eb3 | 37 | m_brush = *wxWHITE_BRUSH; |
ff7b1510 | 38 | } |
c801d85f | 39 | |
ab171e95 RR |
40 | wxGTKImplDC::~wxGTKImplDC() |
41 | { | |
42 | } | |
43 | ||
2970ae54 | 44 | void wxGTKImplDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height ) |
c801d85f | 45 | { |
4bc67cc5 RR |
46 | m_clipping = TRUE; |
47 | m_clipX1 = x; | |
48 | m_clipY1 = y; | |
49 | m_clipX2 = x + width; | |
50 | m_clipY2 = y + height; | |
ff7b1510 | 51 | } |
c801d85f | 52 | |
a23fd0e1 VZ |
53 | // --------------------------------------------------------------------------- |
54 | // get DC capabilities | |
55 | // --------------------------------------------------------------------------- | |
c801d85f | 56 | |
2970ae54 | 57 | void wxGTKImplDC::DoGetSizeMM( int* width, int* height ) const |
c801d85f | 58 | { |
4bc67cc5 RR |
59 | int w = 0; |
60 | int h = 0; | |
ab171e95 | 61 | GetOwner()->GetSize( &w, &h ); |
ce83033f VZ |
62 | if (width) *width = int( double(w) / (m_userScaleX*m_mm_to_pix_x) ); |
63 | if (height) *height = int( double(h) / (m_userScaleY*m_mm_to_pix_y) ); | |
7bcb11d3 JS |
64 | } |
65 | ||
66 | // Resolution in pixels per logical inch | |
2970ae54 | 67 | wxSize wxGTKImplDC::GetPPI() const |
7bcb11d3 JS |
68 | { |
69 | // TODO (should probably be pure virtual) | |
70 | return wxSize(0, 0); | |
ff7b1510 | 71 | } |