]> git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/dc.h
More work on getting wxLisBox events right
[wxWidgets.git] / include / wx / motif / dc.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/motif/dc.h
3 // Purpose: wxMotifDCImpl 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/dc.h"
16
17 // ----------------------------------------------------------------------------
18 // wxMotifDCImpl
19 // ----------------------------------------------------------------------------
20
21 class WXDLLIMPEXP_CORE wxMotifDCImpl : public wxDCImpl
22 {
23 public:
24 wxMotifDCImpl(wxDC *owner);
25
26 virtual wxSize GetPPI() const;
27
28 protected:
29 virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y);
30 virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
31 bool useMask = false);
32
33 virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
34 wxCoord width, wxCoord height);
35 virtual void DoGetSize(int *width, int *height) const;
36 virtual void DoGetSizeMM(int* width, int* height) const;
37
38 public:
39 // implementation
40 wxCoord XDEV2LOG(wxCoord x) const { return DeviceToLogicalX(x); }
41 wxCoord XDEV2LOGREL(wxCoord x) const { return DeviceToLogicalXRel(x); }
42 wxCoord YDEV2LOG(wxCoord y) const { return DeviceToLogicalY(y); }
43 wxCoord YDEV2LOGREL(wxCoord y) const { return DeviceToLogicalYRel(y); }
44 wxCoord XLOG2DEV(wxCoord x) const { return LogicalToDeviceX(x); }
45 wxCoord XLOG2DEVREL(wxCoord x) const { return LogicalToDeviceXRel(x); }
46 wxCoord YLOG2DEV(wxCoord y) const { return LogicalToDeviceY(y); }
47 wxCoord YLOG2DEVREL(wxCoord y) const { return LogicalToDeviceYRel(y); }
48
49 // Without device translation, for backing pixmap purposes
50 wxCoord XLOG2DEV_2(wxCoord x) const
51 {
52 return wxRound((double)(x - m_logicalOriginX) * m_scaleX) * m_signX;
53 }
54 wxCoord YLOG2DEV_2(wxCoord y) const
55 {
56 return wxRound((double)(y - m_logicalOriginY) * m_scaleY) * m_signY;
57 }
58
59 DECLARE_DYNAMIC_CLASS(wxMotifDCImpl)
60 };
61
62 #endif // _WX_DC_H_