Moved all the coordinate system calculation to wxDCBase
[wxWidgets.git] / include / wx / gtk / dc.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/dc.h
3 // Purpose:
4 // Author: Robert Roebling
5 // Id: $Id$
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 #ifndef __GTKDCH__
11 #define __GTKDCH__
12
13 //-----------------------------------------------------------------------------
14 // wxDC
15 //-----------------------------------------------------------------------------
16
17 class WXDLLIMPEXP_CORE wxDC : public wxDCBase
18 {
19 public:
20 wxDC();
21 virtual ~wxDC() { }
22
23 #if wxUSE_PALETTE
24 void SetColourMap( const wxPalette& palette ) { SetPalette(palette); };
25 #endif // wxUSE_PALETTE
26
27 // Resolution in pixels per logical inch
28 virtual wxSize GetPPI() const;
29
30 virtual bool StartDoc( const wxString& WXUNUSED(message) ) { return true; }
31 virtual void EndDoc() { }
32 virtual void StartPage() { }
33 virtual void EndPage() { }
34
35 virtual GdkWindow* GetGDKWindow() const { return NULL; }
36
37 protected:
38 // implementation
39 wxCoord XDEV2LOG(wxCoord x) const { return DeviceToLogicalX(x); }
40 wxCoord XDEV2LOGREL(wxCoord x) const { return DeviceToLogicalXRel(x); }
41 wxCoord YDEV2LOG(wxCoord y) const { return DeviceToLogicalY(y); }
42 wxCoord YDEV2LOGREL(wxCoord y) const { return DeviceToLogicalYRel(y); }
43 wxCoord XLOG2DEV(wxCoord x) const { return LogicalToDeviceX(x); }
44 wxCoord XLOG2DEVREL(wxCoord x) const { return LogicalToDeviceXRel(x); }
45 wxCoord YLOG2DEV(wxCoord y) const { return LogicalToDeviceY(y); }
46 wxCoord YLOG2DEVREL(wxCoord y) const { return LogicalToDeviceYRel(y); }
47
48 // base class pure virtuals implemented here
49 virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
50 virtual void DoGetSizeMM(int* width, int* height) const;
51
52 private:
53 DECLARE_ABSTRACT_CLASS(wxDC)
54 };
55
56 // this must be defined when wxDC::Blit() honours the DC origian and needed to
57 // allow wxUniv code in univ/winuniv.cpp to work with versions of wxGTK
58 // 2.3.[23]
59 #ifndef wxHAS_WORKING_GTK_DC_BLIT
60 #define wxHAS_WORKING_GTK_DC_BLIT
61 #endif
62
63 #endif // __GTKDCH__