]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/x11/dc.h
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
19 #include "wx/gdicmn.h"
21 //-----------------------------------------------------------------------------
23 //-----------------------------------------------------------------------------
27 #define MM_ISOTROPIC 1
28 #define MM_ANISOTROPIC 2
36 //-----------------------------------------------------------------------------
38 //-----------------------------------------------------------------------------
40 class WXDLLEXPORT wxDC
: public wxDCBase
46 // implement base class pure virtuals
47 // ----------------------------------
49 virtual wxSize
GetPPI() const;
51 virtual void SetMapMode(int mode
);
52 virtual void SetUserScale(double x
, double y
);
53 virtual void SetLogicalScale(double x
, double y
);
54 virtual void SetLogicalOrigin(wxCoord x
, wxCoord y
);
55 virtual void SetDeviceOrigin(wxCoord x
, wxCoord y
);
56 virtual void SetAxisOrientation(bool xLeftRight
, bool yBottomUp
);
59 virtual void DoSetClippingRegion(wxCoord x
, wxCoord y
,
60 wxCoord width
, wxCoord height
);
61 virtual void DoGetSizeMM(int* width
, int* height
) const;
64 virtual void ComputeScaleAndOrigin();
66 wxCoord
XDEV2LOG(wxCoord x
) const
68 wxCoord new_x
= x
- m_deviceOriginX
;
70 return (wxCoord
)((double)(new_x
) / m_scaleX
+ 0.5) * m_signX
+ m_logicalOriginX
;
72 return (wxCoord
)((double)(new_x
) / m_scaleX
- 0.5) * m_signX
+ m_logicalOriginX
;
74 wxCoord
XDEV2LOGREL(wxCoord x
) const
77 return (wxCoord
)((double)(x
) / m_scaleX
+ 0.5);
79 return (wxCoord
)((double)(x
) / m_scaleX
- 0.5);
81 wxCoord
YDEV2LOG(wxCoord y
) const
83 wxCoord new_y
= y
- m_deviceOriginY
;
85 return (wxCoord
)((double)(new_y
) / m_scaleY
+ 0.5) * m_signY
+ m_logicalOriginY
;
87 return (wxCoord
)((double)(new_y
) / m_scaleY
- 0.5) * m_signY
+ m_logicalOriginY
;
89 wxCoord
YDEV2LOGREL(wxCoord y
) const
92 return (wxCoord
)((double)(y
) / m_scaleY
+ 0.5);
94 return (wxCoord
)((double)(y
) / m_scaleY
- 0.5);
96 wxCoord
XLOG2DEV(wxCoord x
) const
98 wxCoord new_x
= x
- m_logicalOriginX
;
100 return (wxCoord
)((double)(new_x
) * m_scaleX
+ 0.5) * m_signX
+ m_deviceOriginX
;
102 return (wxCoord
)((double)(new_x
) * m_scaleX
- 0.5) * m_signX
+ m_deviceOriginX
;
104 wxCoord
XLOG2DEVREL(wxCoord x
) const
107 return (wxCoord
)((double)(x
) * m_scaleX
+ 0.5);
109 return (wxCoord
)((double)(x
) * m_scaleX
- 0.5);
111 wxCoord
YLOG2DEV(wxCoord y
) const
113 wxCoord new_y
= y
- m_logicalOriginY
;
115 return (wxCoord
)((double)(new_y
) * m_scaleY
+ 0.5) * m_signY
+ m_deviceOriginY
;
117 return (wxCoord
)((double)(new_y
) * m_scaleY
- 0.5) * m_signY
+ m_deviceOriginY
;
119 wxCoord
YLOG2DEVREL(wxCoord y
) const
122 return (wxCoord
)((double)(y
) * m_scaleY
+ 0.5);
124 return (wxCoord
)((double)(y
) * m_scaleY
- 0.5);
128 // not sure what for, but what is a mm on a screen you don't know the size of?
129 double m_mm_to_pix_x
,m_mm_to_pix_y
;
132 bool m_needComputeScaleX
, m_needComputeScaleY
;
136 DECLARE_ABSTRACT_CLASS(wxDC
)