]> git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/dc.h
added maxDepth parameter to WalkFromException() (patch 1759239)
[wxWidgets.git] / include / wx / motif / dc.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/motif/dc.h
3 // Purpose: wxDC class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 17/09/98
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_DC_H_
13 #define _WX_DC_H_
14
15 #include "wx/pen.h"
16 #include "wx/brush.h"
17 #include "wx/icon.h"
18 #include "wx/font.h"
19 #include "wx/gdicmn.h"
20
21 //-----------------------------------------------------------------------------
22 // constants
23 //-----------------------------------------------------------------------------
24
25 #ifndef MM_TEXT
26 #define MM_TEXT 0
27 #define MM_ISOTROPIC 1
28 #define MM_ANISOTROPIC 2
29 #define MM_LOMETRIC 3
30 #define MM_HIMETRIC 4
31 #define MM_TWIPS 5
32 #define MM_POINTS 6
33 #define MM_METRIC 7
34 #endif
35
36 //-----------------------------------------------------------------------------
37 // wxDC
38 //-----------------------------------------------------------------------------
39
40 class WXDLLEXPORT wxDC : public wxDCBase
41 {
42 DECLARE_DYNAMIC_CLASS(wxDC)
43
44 public:
45 wxDC();
46 virtual ~wxDC() { }
47
48 virtual wxSize GetPPI() const;
49
50 protected:
51 virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y);
52 virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
53 bool useMask = false);
54
55 virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
56 wxCoord width, wxCoord height);
57 virtual void DoGetSize(int *width, int *height) const;
58 virtual void DoGetSizeMM(int* width, int* height) const;
59
60 public:
61 // implementation
62 wxCoord XDEV2LOG(wxCoord x) const { return DeviceToLogicalX(x); }
63 wxCoord XDEV2LOGREL(wxCoord x) const { return DeviceToLogicalXRel(x); }
64 wxCoord YDEV2LOG(wxCoord y) const { return DeviceToLogicalY(y); }
65 wxCoord YDEV2LOGREL(wxCoord y) const { return DeviceToLogicalYRel(y); }
66 wxCoord XLOG2DEV(wxCoord x) const { return LogicalToDeviceX(x); }
67 wxCoord XLOG2DEVREL(wxCoord x) const { return LogicalToDeviceXRel(x); }
68 wxCoord YLOG2DEV(wxCoord y) const { return LogicalToDeviceY(y); }
69 wxCoord YLOG2DEVREL(wxCoord y) const { return LogicalToDeviceYRel(y); }
70
71 // Without device translation, for backing pixmap purposes
72 wxCoord XLOG2DEV_2(wxCoord x) const
73 {
74 return wxRound((double)(x - m_logicalOriginX) * m_scaleX) * m_signX;
75 }
76 wxCoord YLOG2DEV_2(wxCoord y) const
77 {
78 return wxRound((double)(y - m_logicalOriginY) * m_scaleY) * m_signY;
79 }
80
81 };
82
83 #endif
84 // _WX_DC_H_