]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/dc.h
support retina display
[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);
f30b9eed 22 wxGTKCairoDCImpl(wxDC* owner, int);
9dc44eff 23 wxGTKCairoDCImpl(wxDC* owner, wxWindow* window);
f30b9eed 24
9dc44eff
PC
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
380740af 114#include "wx/dc.h"
d296fd8f
RR
115
116//-----------------------------------------------------------------------------
2970ae54 117// wxDC
b86ad1d6
RR
118//-----------------------------------------------------------------------------
119
888dde65 120class WXDLLIMPEXP_CORE wxGTKDCImpl : public wxDCImpl
c801d85f 121{
463c1fa1 122public:
888dde65
RR
123 wxGTKDCImpl( wxDC *owner );
124 virtual ~wxGTKDCImpl();
c801d85f 125
0b04c4e0 126#if wxUSE_PALETTE
6dd0883d 127 void SetColourMap( const wxPalette& palette ) { SetPalette(palette); }
0b04c4e0 128#endif // wxUSE_PALETTE
8bbe427f 129
a23fd0e1
VZ
130 // Resolution in pixels per logical inch
131 virtual wxSize GetPPI() const;
c801d85f 132
b1263dcf 133 virtual bool StartDoc( const wxString& WXUNUSED(message) ) { return true; }
a23fd0e1
VZ
134 virtual void EndDoc() { }
135 virtual void StartPage() { }
136 virtual void EndPage() { }
8bbe427f 137
2e992e06 138 virtual GdkWindow* GetGDKWindow() const { return NULL; }
8e72f2cd
RD
139 virtual void* GetHandle() const { return GetGDKWindow(); }
140
a23fd0e1 141 // base class pure virtuals implemented here
72cdf4c9 142 virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
a23fd0e1 143 virtual void DoGetSizeMM(int* width, int* height) const;
8bbe427f 144
888dde65 145 DECLARE_ABSTRACT_CLASS(wxGTKDCImpl)
c801d85f
KB
146};
147
888dde65 148// this must be defined when wxDC::Blit() honours the DC origin and needed to
c3e44503
VZ
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
9dc44eff 155#endif
380740af 156#endif // _WX_GTKDC_H_