]> git.saurik.com Git - wxWidgets.git/blob - src/gtk1/dc.cpp
Applied patch [ 1736135 ] AUI: Clicking caption ignored on centered panel
[wxWidgets.git] / src / gtk1 / dc.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: dc.cpp
3 // Purpose:
4 // Author: Robert Roebling
5 // RCS-ID: $Id$
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 // For compilers that support precompilation, includes "wx.h".
11 #include "wx/wxprec.h"
12
13 #include "wx/dc.h"
14
15 #include <gdk/gdk.h>
16 #include <gtk/gtk.h>
17
18 //-----------------------------------------------------------------------------
19 // wxDC
20 //-----------------------------------------------------------------------------
21
22 IMPLEMENT_ABSTRACT_CLASS(wxDC, wxDCBase)
23
24 wxDC::wxDC()
25 {
26 m_ok = FALSE;
27
28 m_logicalFunction = wxCOPY;
29
30 m_pen = *wxBLACK_PEN;
31 m_font = *wxNORMAL_FONT;
32 m_brush = *wxWHITE_BRUSH;
33 }
34
35 void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
36 {
37 m_clipping = TRUE;
38 m_clipX1 = x;
39 m_clipY1 = y;
40 m_clipX2 = x + width;
41 m_clipY2 = y + height;
42 }
43
44 // ---------------------------------------------------------------------------
45 // get DC capabilities
46 // ---------------------------------------------------------------------------
47
48 void wxDC::DoGetSizeMM( int* width, int* height ) const
49 {
50 int w = 0;
51 int h = 0;
52 GetSize( &w, &h );
53 if (width) *width = int( double(w) / (m_userScaleX*m_mm_to_pix_x) );
54 if (height) *height = int( double(h) / (m_userScaleY*m_mm_to_pix_y) );
55 }
56
57 // Resolution in pixels per logical inch
58 wxSize wxDC::GetPPI() const
59 {
60 // TODO (should probably be pure virtual)
61 return wxSize(0, 0);
62 }
63