]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/gtk/dc.h
m_menubar does not need to be public for hildon, it's the same as m_widget in that...
[wxWidgets.git] / include / wx / gtk / dc.h
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/gtk/dc.h
3// Purpose:
4// Author: Robert Roebling
5// Id: $Id$
6// Copyright: (c) 1998 Robert Roebling
7// Licence: wxWindows licence
8/////////////////////////////////////////////////////////////////////////////
9
10#ifndef _WX_GTKDC_H_
11#define _WX_GTKDC_H_
12
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, int);
23 wxGTKCairoDCImpl(wxDC* owner, wxWindow* window);
24
25 virtual void DoDrawBitmap(const wxBitmap& bitmap, int x, int y, bool useMask);
26 virtual void DoDrawIcon(const wxIcon& icon, int x, int y);
27#if wxUSE_IMAGE
28 virtual bool DoFloodFill(int x, int y, const wxColour& col, wxFloodFillStyle style);
29#endif
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;
35
36protected:
37 int m_width, m_height;
38
39 wxDECLARE_NO_COPY_CLASS(wxGTKCairoDCImpl);
40};
41//-----------------------------------------------------------------------------
42
43class wxWindowDCImpl: public wxGTKCairoDCImpl
44{
45 typedef wxGTKCairoDCImpl base_type;
46public:
47 wxWindowDCImpl(wxWindowDC* owner, wxWindow* window);
48
49 wxDECLARE_NO_COPY_CLASS(wxWindowDCImpl);
50};
51//-----------------------------------------------------------------------------
52
53class wxClientDCImpl: public wxGTKCairoDCImpl
54{
55 typedef wxGTKCairoDCImpl base_type;
56public:
57 wxClientDCImpl(wxClientDC* owner, wxWindow* window);
58
59 wxDECLARE_NO_COPY_CLASS(wxClientDCImpl);
60};
61//-----------------------------------------------------------------------------
62
63class wxPaintDCImpl: public wxGTKCairoDCImpl
64{
65 typedef wxGTKCairoDCImpl base_type;
66public:
67 wxPaintDCImpl(wxPaintDC* owner, wxWindow* window);
68
69 wxDECLARE_NO_COPY_CLASS(wxPaintDCImpl);
70};
71//-----------------------------------------------------------------------------
72
73class wxScreenDCImpl: public wxGTKCairoDCImpl
74{
75 typedef wxGTKCairoDCImpl base_type;
76public:
77 wxScreenDCImpl(wxScreenDC* owner);
78
79 wxDECLARE_NO_COPY_CLASS(wxScreenDCImpl);
80};
81//-----------------------------------------------------------------------------
82
83class wxMemoryDCImpl: public wxGTKCairoDCImpl
84{
85 typedef wxGTKCairoDCImpl base_type;
86public:
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();
94
95private:
96 void Setup();
97 wxBitmap m_bitmap;
98
99 wxDECLARE_NO_COPY_CLASS(wxMemoryDCImpl);
100};
101//-----------------------------------------------------------------------------
102
103class WXDLLIMPEXP_CORE wxGTKCairoDC: public wxDC
104{
105 typedef wxDC base_type;
106public:
107 wxGTKCairoDC(cairo_t* cr);
108
109 wxDECLARE_NO_COPY_CLASS(wxGTKCairoDC);
110};
111
112#else
113
114#include "wx/dc.h"
115
116//-----------------------------------------------------------------------------
117// wxDC
118//-----------------------------------------------------------------------------
119
120class WXDLLIMPEXP_CORE wxGTKDCImpl : public wxDCImpl
121{
122public:
123 wxGTKDCImpl( wxDC *owner );
124 virtual ~wxGTKDCImpl();
125
126#if wxUSE_PALETTE
127 void SetColourMap( const wxPalette& palette ) { SetPalette(palette); }
128#endif // wxUSE_PALETTE
129
130 // Resolution in pixels per logical inch
131 virtual wxSize GetPPI() const;
132
133 virtual bool StartDoc( const wxString& WXUNUSED(message) ) { return true; }
134 virtual void EndDoc() { }
135 virtual void StartPage() { }
136 virtual void EndPage() { }
137
138 virtual GdkWindow* GetGDKWindow() const { return NULL; }
139 virtual void* GetHandle() const { return GetGDKWindow(); }
140
141 // base class pure virtuals implemented here
142 virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
143 virtual void DoGetSizeMM(int* width, int* height) const;
144
145 DECLARE_ABSTRACT_CLASS(wxGTKDCImpl)
146};
147
148// this must be defined when wxDC::Blit() honours the DC origin and needed to
149// allow wxUniv code in univ/winuniv.cpp to work with versions of wxGTK
150// 2.3.[23]
151#ifndef wxHAS_WORKING_GTK_DC_BLIT
152 #define wxHAS_WORKING_GTK_DC_BLIT
153#endif
154
155#endif
156#endif // _WX_GTKDC_H_