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