]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/dc.h
82f2ae49e788599b5eb045e3980f542187e03460
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
13 //-----------------------------------------------------------------------------
15 //-----------------------------------------------------------------------------
17 class WXDLLIMPEXP_CORE wxDC
;
19 //-----------------------------------------------------------------------------
21 //-----------------------------------------------------------------------------
25 #define MM_ISOTROPIC 1
26 #define MM_ANISOTROPIC 2
34 //-----------------------------------------------------------------------------
36 //-----------------------------------------------------------------------------
38 class WXDLLIMPEXP_CORE wxDC
: public wxDCBase
45 void SetColourMap( const wxPalette
& palette
) { SetPalette(palette
); };
46 #endif // wxUSE_PALETTE
48 // Resolution in pixels per logical inch
49 virtual wxSize
GetPPI() const;
51 virtual bool StartDoc( const wxString
& WXUNUSED(message
) ) { return true; }
52 virtual void EndDoc() { }
53 virtual void StartPage() { }
54 virtual void EndPage() { }
56 virtual void SetMapMode( int mode
);
57 virtual void SetUserScale( double x
, double y
);
58 virtual void SetLogicalScale( double x
, double y
);
59 virtual void SetLogicalOrigin( wxCoord x
, wxCoord y
);
60 virtual void SetDeviceOrigin( wxCoord x
, wxCoord y
);
62 virtual void SetAxisOrientation( bool xLeftRight
, bool yBottomUp
);
67 virtual void ComputeScaleAndOrigin();
69 virtual GdkWindow
* GetGDKWindow() const { return NULL
; }
71 wxCoord
XDEV2LOG(wxCoord x
) const
73 wxCoord new_x
= x
- m_deviceOriginX
;
75 return (wxCoord
)((double)(new_x
) / m_scaleX
+ 0.5) * m_signX
+ m_logicalOriginX
;
77 return (wxCoord
)((double)(new_x
) / m_scaleX
- 0.5) * m_signX
+ m_logicalOriginX
;
79 wxCoord
XDEV2LOGREL(wxCoord x
) const
82 return (wxCoord
)((double)(x
) / m_scaleX
+ 0.5);
84 return (wxCoord
)((double)(x
) / m_scaleX
- 0.5);
86 wxCoord
YDEV2LOG(wxCoord y
) const
88 wxCoord new_y
= y
- m_deviceOriginY
;
90 return (wxCoord
)((double)(new_y
) / m_scaleY
+ 0.5) * m_signY
+ m_logicalOriginY
;
92 return (wxCoord
)((double)(new_y
) / m_scaleY
- 0.5) * m_signY
+ m_logicalOriginY
;
94 wxCoord
YDEV2LOGREL(wxCoord y
) const
97 return (wxCoord
)((double)(y
) / m_scaleY
+ 0.5);
99 return (wxCoord
)((double)(y
) / m_scaleY
- 0.5);
101 wxCoord
XLOG2DEV(wxCoord x
) const
103 wxCoord new_x
= x
- m_logicalOriginX
;
105 return (wxCoord
)((double)(new_x
) * m_scaleX
+ 0.5) * m_signX
+ m_deviceOriginX
;
107 return (wxCoord
)((double)(new_x
) * m_scaleX
- 0.5) * m_signX
+ m_deviceOriginX
;
109 wxCoord
XLOG2DEVREL(wxCoord x
) const
112 return (wxCoord
)((double)(x
) * m_scaleX
+ 0.5);
114 return (wxCoord
)((double)(x
) * m_scaleX
- 0.5);
116 wxCoord
YLOG2DEV(wxCoord y
) const
118 wxCoord new_y
= y
- m_logicalOriginY
;
120 return (wxCoord
)((double)(new_y
) * m_scaleY
+ 0.5) * m_signY
+ m_deviceOriginY
;
122 return (wxCoord
)((double)(new_y
) * m_scaleY
- 0.5) * m_signY
+ m_deviceOriginY
;
124 wxCoord
YLOG2DEVREL(wxCoord y
) const
127 return (wxCoord
)((double)(y
) * m_scaleY
+ 0.5);
129 return (wxCoord
)((double)(y
) * m_scaleY
- 0.5);
133 // base class pure virtuals implemented here
134 virtual void DoSetClippingRegion(wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
);
135 virtual void DoGetSizeMM(int* width
, int* height
) const;
138 // GTK-specific member variables
140 // not sure what for, but what is a mm on a screen you don't know the size
142 double m_mm_to_pix_x
,
145 bool m_needComputeScaleX
,
146 m_needComputeScaleY
; // not yet used
150 DECLARE_ABSTRACT_CLASS(wxDC
)
153 // this must be defined when wxDC::Blit() honours the DC origian and needed to
154 // allow wxUniv code in univ/winuniv.cpp to work with versions of wxGTK
156 #ifndef wxHAS_WORKING_GTK_DC_BLIT
157 #define wxHAS_WORKING_GTK_DC_BLIT