1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
15 #include "wx/dcgraph.h"
17 class wxGTKCairoDCImpl
: public wxGCDCImpl
19 typedef wxGCDCImpl base_type
;
21 wxGTKCairoDCImpl(wxDC
* owner
);
22 wxGTKCairoDCImpl(wxDC
* owner
, int);
23 wxGTKCairoDCImpl(wxDC
* owner
, wxWindow
* window
);
25 virtual void DoDrawBitmap(const wxBitmap
& bitmap
, int x
, int y
, bool useMask
);
26 virtual void DoDrawIcon(const wxIcon
& icon
, int x
, int y
);
28 virtual bool DoFloodFill(int x
, int y
, const wxColour
& col
, wxFloodFillStyle style
);
30 virtual wxBitmap
DoGetAsBitmap(const wxRect
* subrect
) const;
31 virtual bool DoGetPixel(int x
, int y
, wxColour
* col
) const;
32 virtual void DoGetSize(int* width
, int* height
) const;
33 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
);
34 virtual void* GetCairoContext() const;
37 int m_width
, m_height
;
39 wxDECLARE_NO_COPY_CLASS(wxGTKCairoDCImpl
);
41 //-----------------------------------------------------------------------------
43 class wxWindowDCImpl
: public wxGTKCairoDCImpl
45 typedef wxGTKCairoDCImpl base_type
;
47 wxWindowDCImpl(wxWindowDC
* owner
, wxWindow
* window
);
49 wxDECLARE_NO_COPY_CLASS(wxWindowDCImpl
);
51 //-----------------------------------------------------------------------------
53 class wxClientDCImpl
: public wxGTKCairoDCImpl
55 typedef wxGTKCairoDCImpl base_type
;
57 wxClientDCImpl(wxClientDC
* owner
, wxWindow
* window
);
59 wxDECLARE_NO_COPY_CLASS(wxClientDCImpl
);
61 //-----------------------------------------------------------------------------
63 class wxPaintDCImpl
: public wxGTKCairoDCImpl
65 typedef wxGTKCairoDCImpl base_type
;
67 wxPaintDCImpl(wxPaintDC
* owner
, wxWindow
* window
);
69 wxDECLARE_NO_COPY_CLASS(wxPaintDCImpl
);
71 //-----------------------------------------------------------------------------
73 class wxScreenDCImpl
: public wxGTKCairoDCImpl
75 typedef wxGTKCairoDCImpl base_type
;
77 wxScreenDCImpl(wxScreenDC
* owner
);
79 wxDECLARE_NO_COPY_CLASS(wxScreenDCImpl
);
81 //-----------------------------------------------------------------------------
83 class wxMemoryDCImpl
: public wxGTKCairoDCImpl
85 typedef wxGTKCairoDCImpl base_type
;
87 wxMemoryDCImpl(wxMemoryDC
* owner
);
88 wxMemoryDCImpl(wxMemoryDC
* owner
, wxBitmap
& bitmap
);
89 wxMemoryDCImpl(wxMemoryDC
* owner
, wxDC
* dc
);
90 virtual wxBitmap
DoGetAsBitmap(const wxRect
* subrect
) const;
91 virtual void DoSelect(const wxBitmap
& bitmap
);
92 virtual const wxBitmap
& GetSelectedBitmap() const;
93 virtual wxBitmap
& GetSelectedBitmap();
99 wxDECLARE_NO_COPY_CLASS(wxMemoryDCImpl
);
101 //-----------------------------------------------------------------------------
103 class WXDLLIMPEXP_CORE wxGTKCairoDC
: public wxDC
105 typedef wxDC base_type
;
107 wxGTKCairoDC(cairo_t
* cr
);
109 wxDECLARE_NO_COPY_CLASS(wxGTKCairoDC
);
116 //-----------------------------------------------------------------------------
118 //-----------------------------------------------------------------------------
120 class WXDLLIMPEXP_CORE wxGTKDCImpl
: public wxDCImpl
123 wxGTKDCImpl( wxDC
*owner
);
124 virtual ~wxGTKDCImpl();
127 void SetColourMap( const wxPalette
& palette
) { SetPalette(palette
); }
128 #endif // wxUSE_PALETTE
130 // Resolution in pixels per logical inch
131 virtual wxSize
GetPPI() const;
133 virtual bool StartDoc( const wxString
& WXUNUSED(message
) ) { return true; }
134 virtual void EndDoc() { }
135 virtual void StartPage() { }
136 virtual void EndPage() { }
138 virtual GdkWindow
* GetGDKWindow() const { return NULL
; }
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_