]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/dc.h
Fixed wxRichTextCtrl caret test case
[wxWidgets.git] / include / wx / gtk / dc.h
CommitLineData
c801d85f 1/////////////////////////////////////////////////////////////////////////////
0b04c4e0 2// Name: wx/gtk/dc.h
c801d85f
KB
3// Purpose:
4// Author: Robert Roebling
dbf858b5
RR
5// Id: $Id$
6// Copyright: (c) 1998 Robert Roebling
65571936 7// Licence: wxWindows licence
c801d85f
KB
8/////////////////////////////////////////////////////////////////////////////
9
380740af
PC
10#ifndef _WX_GTKDC_H_
11#define _WX_GTKDC_H_
c801d85f 12
9dc44eff
PC
13#ifdef __WXGTK3__
14
15#include "wx/dcgraph.h"
16
17class wxGTKCairoDCImpl: public wxGCDCImpl
18{
19 typedef wxGCDCImpl base_type;
20public:
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);
25#if wxUSE_IMAGE
26 virtual bool DoFloodFill(int x, int y, const wxColour& col, wxFloodFillStyle style);
27#endif
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;
33
34protected:
35 int m_width, m_height;
36
37 wxDECLARE_NO_COPY_CLASS(wxGTKCairoDCImpl);
38};
39//-----------------------------------------------------------------------------
40
41class wxWindowDCImpl: public wxGTKCairoDCImpl
42{
43 typedef wxGTKCairoDCImpl base_type;
44public:
45 wxWindowDCImpl(wxWindowDC* owner, wxWindow* window);
46
47 wxDECLARE_NO_COPY_CLASS(wxWindowDCImpl);
48};
49//-----------------------------------------------------------------------------
50
51class wxClientDCImpl: public wxGTKCairoDCImpl
52{
53 typedef wxGTKCairoDCImpl base_type;
54public:
55 wxClientDCImpl(wxClientDC* owner, wxWindow* window);
56
57 wxDECLARE_NO_COPY_CLASS(wxClientDCImpl);
58};
59//-----------------------------------------------------------------------------
60
61class wxPaintDCImpl: public wxGTKCairoDCImpl
62{
63 typedef wxGTKCairoDCImpl base_type;
64public:
65 wxPaintDCImpl(wxPaintDC* owner, wxWindow* window);
66
67 wxDECLARE_NO_COPY_CLASS(wxPaintDCImpl);
68};
69//-----------------------------------------------------------------------------
70
71class wxScreenDCImpl: public wxGTKCairoDCImpl
72{
73 typedef wxGTKCairoDCImpl base_type;
74public:
75 wxScreenDCImpl(wxScreenDC* owner);
76
77 wxDECLARE_NO_COPY_CLASS(wxScreenDCImpl);
78};
79//-----------------------------------------------------------------------------
80
81class wxMemoryDCImpl: public wxGTKCairoDCImpl
82{
83 typedef wxGTKCairoDCImpl base_type;
84public:
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();
92
93private:
94 void Setup();
95 wxBitmap m_bitmap;
96
97 wxDECLARE_NO_COPY_CLASS(wxMemoryDCImpl);
98};
99//-----------------------------------------------------------------------------
100
101class WXDLLIMPEXP_CORE wxGTKCairoDC: public wxDC
102{
103 typedef wxDC base_type;
104public:
105 wxGTKCairoDC(cairo_t* cr);
106
107 wxDECLARE_NO_COPY_CLASS(wxGTKCairoDC);
108};
109
110#else
111
380740af 112#include "wx/dc.h"
d296fd8f
RR
113
114//-----------------------------------------------------------------------------
2970ae54 115// wxDC
b86ad1d6
RR
116//-----------------------------------------------------------------------------
117
888dde65 118class WXDLLIMPEXP_CORE wxGTKDCImpl : public wxDCImpl
c801d85f 119{
463c1fa1 120public:
888dde65
RR
121 wxGTKDCImpl( wxDC *owner );
122 virtual ~wxGTKDCImpl();
c801d85f 123
0b04c4e0 124#if wxUSE_PALETTE
6dd0883d 125 void SetColourMap( const wxPalette& palette ) { SetPalette(palette); }
0b04c4e0 126#endif // wxUSE_PALETTE
8bbe427f 127
a23fd0e1
VZ
128 // Resolution in pixels per logical inch
129 virtual wxSize GetPPI() const;
c801d85f 130
b1263dcf 131 virtual bool StartDoc( const wxString& WXUNUSED(message) ) { return true; }
a23fd0e1
VZ
132 virtual void EndDoc() { }
133 virtual void StartPage() { }
134 virtual void EndPage() { }
8bbe427f 135
2e992e06
VZ
136 virtual GdkWindow* GetGDKWindow() const { return NULL; }
137
a23fd0e1 138 // base class pure virtuals implemented here
72cdf4c9 139 virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
a23fd0e1 140 virtual void DoGetSizeMM(int* width, int* height) const;
8bbe427f 141
888dde65 142 DECLARE_ABSTRACT_CLASS(wxGTKDCImpl)
c801d85f
KB
143};
144
888dde65 145// this must be defined when wxDC::Blit() honours the DC origin and needed to
c3e44503
VZ
146// allow wxUniv code in univ/winuniv.cpp to work with versions of wxGTK
147// 2.3.[23]
148#ifndef wxHAS_WORKING_GTK_DC_BLIT
149 #define wxHAS_WORKING_GTK_DC_BLIT
150#endif
151
9dc44eff 152#endif
380740af 153#endif // _WX_GTKDC_H_