1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
5 // Copyright: (c) 1998 Robert Roebling
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
14 #include "wx/dcgraph.h"
16 class wxGTKCairoDCImpl
: public wxGCDCImpl
18 typedef wxGCDCImpl base_type
;
20 wxGTKCairoDCImpl(wxDC
* owner
);
21 wxGTKCairoDCImpl(wxDC
* owner
, int);
22 wxGTKCairoDCImpl(wxDC
* owner
, wxWindow
* window
);
24 virtual void DoDrawBitmap(const wxBitmap
& bitmap
, int x
, int y
, bool useMask
);
25 virtual void DoDrawIcon(const wxIcon
& icon
, int x
, int y
);
27 virtual bool DoFloodFill(int x
, int y
, const wxColour
& col
, wxFloodFillStyle style
);
29 virtual wxBitmap
DoGetAsBitmap(const wxRect
* subrect
) const;
30 virtual bool DoGetPixel(int x
, int y
, wxColour
* col
) const;
31 virtual void DoGetSize(int* width
, int* height
) const;
32 virtual bool DoStretchBlit(int xdest
, int ydest
, int dstWidth
, int dstHeight
, wxDC
* source
, int xsrc
, int ysrc
, int srcWidth
, int srcHeight
, wxRasterOperationMode rop
, bool useMask
, int xsrcMask
, int ysrcMask
);
33 virtual void* GetCairoContext() const;
36 int m_width
, m_height
;
38 wxDECLARE_NO_COPY_CLASS(wxGTKCairoDCImpl
);
40 //-----------------------------------------------------------------------------
42 class wxWindowDCImpl
: public wxGTKCairoDCImpl
44 typedef wxGTKCairoDCImpl base_type
;
46 wxWindowDCImpl(wxWindowDC
* owner
, wxWindow
* window
);
48 wxDECLARE_NO_COPY_CLASS(wxWindowDCImpl
);
50 //-----------------------------------------------------------------------------
52 class wxClientDCImpl
: public wxGTKCairoDCImpl
54 typedef wxGTKCairoDCImpl base_type
;
56 wxClientDCImpl(wxClientDC
* owner
, wxWindow
* window
);
58 wxDECLARE_NO_COPY_CLASS(wxClientDCImpl
);
60 //-----------------------------------------------------------------------------
62 class wxPaintDCImpl
: public wxGTKCairoDCImpl
64 typedef wxGTKCairoDCImpl base_type
;
66 wxPaintDCImpl(wxPaintDC
* owner
, wxWindow
* window
);
68 wxDECLARE_NO_COPY_CLASS(wxPaintDCImpl
);
70 //-----------------------------------------------------------------------------
72 class wxScreenDCImpl
: public wxGTKCairoDCImpl
74 typedef wxGTKCairoDCImpl base_type
;
76 wxScreenDCImpl(wxScreenDC
* owner
);
78 wxDECLARE_NO_COPY_CLASS(wxScreenDCImpl
);
80 //-----------------------------------------------------------------------------
82 class wxMemoryDCImpl
: public wxGTKCairoDCImpl
84 typedef wxGTKCairoDCImpl base_type
;
86 wxMemoryDCImpl(wxMemoryDC
* owner
);
87 wxMemoryDCImpl(wxMemoryDC
* owner
, wxBitmap
& bitmap
);
88 wxMemoryDCImpl(wxMemoryDC
* owner
, wxDC
* dc
);
89 virtual wxBitmap
DoGetAsBitmap(const wxRect
* subrect
) const;
90 virtual void DoSelect(const wxBitmap
& bitmap
);
91 virtual const wxBitmap
& GetSelectedBitmap() const;
92 virtual wxBitmap
& GetSelectedBitmap();
98 wxDECLARE_NO_COPY_CLASS(wxMemoryDCImpl
);
100 //-----------------------------------------------------------------------------
102 class WXDLLIMPEXP_CORE wxGTKCairoDC
: public wxDC
104 typedef wxDC base_type
;
106 wxGTKCairoDC(cairo_t
* cr
);
108 wxDECLARE_NO_COPY_CLASS(wxGTKCairoDC
);
115 //-----------------------------------------------------------------------------
117 //-----------------------------------------------------------------------------
119 class WXDLLIMPEXP_CORE wxGTKDCImpl
: public wxDCImpl
122 wxGTKDCImpl( wxDC
*owner
);
123 virtual ~wxGTKDCImpl();
126 void SetColourMap( const wxPalette
& palette
) { SetPalette(palette
); }
127 #endif // wxUSE_PALETTE
129 // Resolution in pixels per logical inch
130 virtual wxSize
GetPPI() const;
132 virtual bool StartDoc( const wxString
& WXUNUSED(message
) ) { return true; }
133 virtual void EndDoc() { }
134 virtual void StartPage() { }
135 virtual void EndPage() { }
137 virtual GdkWindow
* GetGDKWindow() const { return NULL
; }
138 virtual void* GetHandle() const { return GetGDKWindow(); }
140 // base class pure virtuals implemented here
141 virtual void DoSetClippingRegion(wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
);
142 virtual void DoGetSizeMM(int* width
, int* height
) const;
144 DECLARE_ABSTRACT_CLASS(wxGTKDCImpl
)
147 // this must be defined when wxDC::Blit() honours the DC origin and needed to
148 // allow wxUniv code in univ/winuniv.cpp to work with versions of wxGTK
150 #ifndef wxHAS_WORKING_GTK_DC_BLIT
151 #define wxHAS_WORKING_GTK_DC_BLIT
155 #endif // _WX_GTKDC_H_