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
, wxWindow
* window
);
23 virtual void DoDrawBitmap(const wxBitmap
& bitmap
, int x
, int y
, bool useMask
);
24 virtual void DoDrawIcon(const wxIcon
& icon
, int x
, int y
);
26 virtual bool DoFloodFill(int x
, int y
, const wxColour
& col
, wxFloodFillStyle style
);
28 virtual wxBitmap
DoGetAsBitmap(const wxRect
* subrect
) const;
29 virtual bool DoGetPixel(int x
, int y
, wxColour
* col
) const;
30 virtual void DoGetSize(int* width
, int* height
) const;
31 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
);
32 virtual void* GetCairoContext() const;
35 int m_width
, m_height
;
37 wxDECLARE_NO_COPY_CLASS(wxGTKCairoDCImpl
);
39 //-----------------------------------------------------------------------------
41 class wxWindowDCImpl
: public wxGTKCairoDCImpl
43 typedef wxGTKCairoDCImpl base_type
;
45 wxWindowDCImpl(wxWindowDC
* owner
, wxWindow
* window
);
47 wxDECLARE_NO_COPY_CLASS(wxWindowDCImpl
);
49 //-----------------------------------------------------------------------------
51 class wxClientDCImpl
: public wxGTKCairoDCImpl
53 typedef wxGTKCairoDCImpl base_type
;
55 wxClientDCImpl(wxClientDC
* owner
, wxWindow
* window
);
57 wxDECLARE_NO_COPY_CLASS(wxClientDCImpl
);
59 //-----------------------------------------------------------------------------
61 class wxPaintDCImpl
: public wxGTKCairoDCImpl
63 typedef wxGTKCairoDCImpl base_type
;
65 wxPaintDCImpl(wxPaintDC
* owner
, wxWindow
* window
);
67 wxDECLARE_NO_COPY_CLASS(wxPaintDCImpl
);
69 //-----------------------------------------------------------------------------
71 class wxScreenDCImpl
: public wxGTKCairoDCImpl
73 typedef wxGTKCairoDCImpl base_type
;
75 wxScreenDCImpl(wxScreenDC
* owner
);
77 wxDECLARE_NO_COPY_CLASS(wxScreenDCImpl
);
79 //-----------------------------------------------------------------------------
81 class wxMemoryDCImpl
: public wxGTKCairoDCImpl
83 typedef wxGTKCairoDCImpl base_type
;
85 wxMemoryDCImpl(wxMemoryDC
* owner
);
86 wxMemoryDCImpl(wxMemoryDC
* owner
, wxBitmap
& bitmap
);
87 wxMemoryDCImpl(wxMemoryDC
* owner
, wxDC
* dc
);
88 virtual wxBitmap
DoGetAsBitmap(const wxRect
* subrect
) const;
89 virtual void DoSelect(const wxBitmap
& bitmap
);
90 virtual const wxBitmap
& GetSelectedBitmap() const;
91 virtual wxBitmap
& GetSelectedBitmap();
97 wxDECLARE_NO_COPY_CLASS(wxMemoryDCImpl
);
99 //-----------------------------------------------------------------------------
101 class WXDLLIMPEXP_CORE wxGTKCairoDC
: public wxDC
103 typedef wxDC base_type
;
105 wxGTKCairoDC(cairo_t
* cr
);
107 wxDECLARE_NO_COPY_CLASS(wxGTKCairoDC
);
114 //-----------------------------------------------------------------------------
116 //-----------------------------------------------------------------------------
118 class WXDLLIMPEXP_CORE wxGTKDCImpl
: public wxDCImpl
121 wxGTKDCImpl( wxDC
*owner
);
122 virtual ~wxGTKDCImpl();
125 void SetColourMap( const wxPalette
& palette
) { SetPalette(palette
); }
126 #endif // wxUSE_PALETTE
128 // Resolution in pixels per logical inch
129 virtual wxSize
GetPPI() const;
131 virtual bool StartDoc( const wxString
& WXUNUSED(message
) ) { return true; }
132 virtual void EndDoc() { }
133 virtual void StartPage() { }
134 virtual void EndPage() { }
136 virtual GdkWindow
* GetGDKWindow() const { return NULL
; }
138 // base class pure virtuals implemented here
139 virtual void DoSetClippingRegion(wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
);
140 virtual void DoGetSizeMM(int* width
, int* height
) const;
142 DECLARE_ABSTRACT_CLASS(wxGTKDCImpl
)
145 // this must be defined when wxDC::Blit() honours the DC origin and needed to
146 // allow wxUniv code in univ/winuniv.cpp to work with versions of wxGTK
148 #ifndef wxHAS_WORKING_GTK_DC_BLIT
149 #define wxHAS_WORKING_GTK_DC_BLIT
153 #endif // _WX_GTKDC_H_