]>
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 | ||
071a2d78 RR |
15 | #include <gdk/gdk.h> |
16 | #include <gtk/gtk.h> | |
83624f79 | 17 | |
c801d85f KB |
18 | //----------------------------------------------------------------------------- |
19 | // wxDC | |
20 | //----------------------------------------------------------------------------- | |
21 | ||
a23fd0e1 | 22 | IMPLEMENT_ABSTRACT_CLASS(wxDC, wxDCBase) |
c801d85f | 23 | |
4bc67cc5 | 24 | wxDC::wxDC() |
c801d85f | 25 | { |
4bc67cc5 | 26 | m_ok = FALSE; |
a23fd0e1 | 27 | |
ce83033f VZ |
28 | m_mm_to_pix_x = (double)wxGetDisplaySize().GetWidth() / |
29 | (double)wxGetDisplaySizeMM().GetWidth(); | |
30 | m_mm_to_pix_y = (double)wxGetDisplaySize().GetHeight() / | |
31 | (double)wxGetDisplaySizeMM().GetHeight(); | |
a23fd0e1 | 32 | |
ea6f44b5 RR |
33 | m_needComputeScaleX = FALSE; /* not used yet */ |
34 | m_needComputeScaleY = FALSE; /* not used yet */ | |
c801d85f | 35 | |
4bc67cc5 | 36 | m_logicalFunction = wxCOPY; |
a23fd0e1 | 37 | |
4bc67cc5 RR |
38 | m_pen = *wxBLACK_PEN; |
39 | m_font = *wxNORMAL_FONT; | |
41bf0eb3 | 40 | m_brush = *wxWHITE_BRUSH; |
ff7b1510 | 41 | } |
c801d85f | 42 | |
72cdf4c9 | 43 | void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height ) |
c801d85f | 44 | { |
4bc67cc5 RR |
45 | m_clipping = TRUE; |
46 | m_clipX1 = x; | |
47 | m_clipY1 = y; | |
48 | m_clipX2 = x + width; | |
49 | m_clipY2 = y + height; | |
ff7b1510 | 50 | } |
c801d85f | 51 | |
a23fd0e1 VZ |
52 | // --------------------------------------------------------------------------- |
53 | // get DC capabilities | |
54 | // --------------------------------------------------------------------------- | |
c801d85f | 55 | |
a23fd0e1 | 56 | void wxDC::DoGetSizeMM( int* width, int* height ) const |
c801d85f | 57 | { |
4bc67cc5 RR |
58 | int w = 0; |
59 | int h = 0; | |
60 | GetSize( &w, &h ); | |
ce83033f VZ |
61 | if (width) *width = int( double(w) / (m_userScaleX*m_mm_to_pix_x) ); |
62 | if (height) *height = int( double(h) / (m_userScaleY*m_mm_to_pix_y) ); | |
7bcb11d3 JS |
63 | } |
64 | ||
65 | // Resolution in pixels per logical inch | |
a23fd0e1 | 66 | wxSize wxDC::GetPPI() const |
7bcb11d3 JS |
67 | { |
68 | // TODO (should probably be pure virtual) | |
69 | return wxSize(0, 0); | |
ff7b1510 | 70 | } |
c801d85f | 71 |