Converted wxGTK's basic DC classes to new DC code
[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 //-----------------------------------------------------------------------------
15 // wxDC
16 //-----------------------------------------------------------------------------
17
18 #if wxUSE_NEW_DC
19 class WXDLLIMPEXP_CORE wxGTKImplDC : public wxImplDC
20 #else
21 #define wxGTKImplDC wxDC
22 class WXDLLIMPEXP_CORE wxDC : public wxDCBase
23 #endif
24
25 {
26 public:
27 #if wxUSE_NEW_DC
28 wxGTKImplDC( wxDC *owner );
29 #else
30 wxDC();
31 #endif
32
33 virtual ~wxGTKImplDC();
34
35 #if wxUSE_PALETTE
36 void SetColourMap( const wxPalette& palette ) { SetPalette(palette); };
37 #endif // wxUSE_PALETTE
38
39 // Resolution in pixels per logical inch
40 virtual wxSize GetPPI() const;
41
42 virtual bool StartDoc( const wxString& WXUNUSED(message) ) { return true; }
43 virtual void EndDoc() { }
44 virtual void StartPage() { }
45 virtual void EndPage() { }
46
47 virtual GdkWindow* GetGDKWindow() const { return NULL; }
48
49 protected:
50 // implementation
51 wxCoord XDEV2LOG(wxCoord x) const { return DeviceToLogicalX(x); }
52 wxCoord XDEV2LOGREL(wxCoord x) const { return DeviceToLogicalXRel(x); }
53 wxCoord YDEV2LOG(wxCoord y) const { return DeviceToLogicalY(y); }
54 wxCoord YDEV2LOGREL(wxCoord y) const { return DeviceToLogicalYRel(y); }
55 wxCoord XLOG2DEV(wxCoord x) const { return LogicalToDeviceX(x); }
56 wxCoord XLOG2DEVREL(wxCoord x) const { return LogicalToDeviceXRel(x); }
57 wxCoord YLOG2DEV(wxCoord y) const { return LogicalToDeviceY(y); }
58 wxCoord YLOG2DEVREL(wxCoord y) const { return LogicalToDeviceYRel(y); }
59
60 // base class pure virtuals implemented here
61 virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
62 virtual void DoGetSizeMM(int* width, int* height) const;
63
64 private:
65 DECLARE_ABSTRACT_CLASS(wxGTKImplDC)
66 };
67
68 // this must be defined when wxDC::Blit() honours the DC origian and needed to
69 // allow wxUniv code in univ/winuniv.cpp to work with versions of wxGTK
70 // 2.3.[23]
71 #ifndef wxHAS_WORKING_GTK_DC_BLIT
72 #define wxHAS_WORKING_GTK_DC_BLIT
73 #endif
74
75 #endif // __GTKDCH__