| 1 | ///////////////////////////////////////////////////////////////////////////// |
| 2 | // Name: src/x11/dc.cpp |
| 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 |
| 9 | // Licence: wxWindows licence |
| 10 | ///////////////////////////////////////////////////////////////////////////// |
| 11 | |
| 12 | // for compilers that support precompilation, includes "wx.h". |
| 13 | #include "wx/wxprec.h" |
| 14 | |
| 15 | #include "wx/dc.h" |
| 16 | #include "wx/x11/dc.h" |
| 17 | |
| 18 | #ifndef WX_PRECOMP |
| 19 | #include "wx/dcmemory.h" |
| 20 | #endif |
| 21 | |
| 22 | IMPLEMENT_ABSTRACT_CLASS(wxX11DCImpl, wxDCImpl) |
| 23 | |
| 24 | //----------------------------------------------------------------------------- |
| 25 | // wxDC |
| 26 | //----------------------------------------------------------------------------- |
| 27 | |
| 28 | wxX11DCImpl::wxX11DCImpl( wxDC *owner ) : |
| 29 | wxDCImpl( owner ) |
| 30 | { |
| 31 | m_ok = false; |
| 32 | |
| 33 | m_pen = *wxBLACK_PEN; |
| 34 | m_font = *wxNORMAL_FONT; |
| 35 | m_brush = *wxWHITE_BRUSH; |
| 36 | |
| 37 | m_backgroundMode = wxTRANSPARENT; |
| 38 | } |
| 39 | |
| 40 | void wxX11DCImpl::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height ) |
| 41 | { |
| 42 | m_clipping = true; |
| 43 | m_clipX1 = x; |
| 44 | m_clipY1 = y; |
| 45 | m_clipX2 = x + width; |
| 46 | m_clipY2 = y + height; |
| 47 | } |
| 48 | |
| 49 | void wxX11DCImpl::DoGetSizeMM( int* width, int* height ) const |
| 50 | { |
| 51 | int w, h; |
| 52 | DoGetSize( &w, &h ); |
| 53 | |
| 54 | if ( width ) |
| 55 | *width = int( double(w) / (m_scaleX*m_mm_to_pix_x) ); |
| 56 | if ( height ) |
| 57 | *height = int( double(h) / (m_scaleY*m_mm_to_pix_y) ); |
| 58 | } |
| 59 | |
| 60 | // Resolution in pixels per logical inch |
| 61 | wxSize wxX11DCImpl::GetPPI() const |
| 62 | { |
| 63 | // TODO (should probably be pure virtual) |
| 64 | return wxSize(0, 0); |
| 65 | } |