]>
Commit | Line | Data |
---|---|---|
83df96d6 | 1 | ///////////////////////////////////////////////////////////////////////////// |
80fdcdb9 | 2 | // Name: wx/x11/dcclient.h |
83df96d6 JS |
3 | // Purpose: wxClientDC, wxPaintDC and wxWindowDC classes |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 17/09/98 | |
83df96d6 | 7 | // Copyright: (c) Julian Smart |
65571936 | 8 | // Licence: wxWindows licence |
83df96d6 JS |
9 | ///////////////////////////////////////////////////////////////////////////// |
10 | ||
11 | #ifndef _WX_DCCLIENT_H_ | |
12 | #define _WX_DCCLIENT_H_ | |
13 | ||
83df96d6 | 14 | #include "wx/dc.h" |
2b77c3fc RR |
15 | #include "wx/dcclient.h" |
16 | #include "wx/x11/dc.h" | |
3cd0b8c5 | 17 | #include "wx/region.h" |
83df96d6 JS |
18 | |
19 | // ----------------------------------------------------------------------------- | |
20 | // fwd declarations | |
21 | // ----------------------------------------------------------------------------- | |
22 | ||
b5dbe15d | 23 | class WXDLLIMPEXP_FWD_CORE wxWindow; |
83df96d6 | 24 | |
83df96d6 | 25 | //----------------------------------------------------------------------------- |
2b77c3fc | 26 | // wxWindowDCImpl |
83df96d6 JS |
27 | //----------------------------------------------------------------------------- |
28 | ||
2b77c3fc | 29 | class WXDLLIMPEXP_CORE wxWindowDCImpl : public wxX11DCImpl |
83df96d6 | 30 | { |
83df96d6 | 31 | public: |
2b77c3fc RR |
32 | wxWindowDCImpl( wxDC *owner ); |
33 | wxWindowDCImpl( wxDC *owner, wxWindow *win ); | |
03647350 | 34 | |
2b77c3fc | 35 | virtual ~wxWindowDCImpl(); |
b1263dcf WS |
36 | |
37 | virtual bool CanDrawBitmap() const { return true; } | |
38 | virtual bool CanGetTextExtent() const { return true; } | |
3cd0b8c5 | 39 | |
83df96d6 | 40 | protected: |
3cd0b8c5 | 41 | virtual void DoGetSize(int *width, int *height) const; |
03647350 | 42 | virtual bool DoFloodFill( wxCoord x, wxCoord y, const wxColour& col, |
89efaf2b | 43 | wxFloodFillStyle style = wxFLOOD_SURFACE ); |
3cd0b8c5 | 44 | virtual bool DoGetPixel( wxCoord x, wxCoord y, wxColour *col ) const; |
b1263dcf | 45 | |
83df96d6 JS |
46 | virtual void DoDrawPoint(wxCoord x, wxCoord y); |
47 | virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2); | |
b1263dcf | 48 | |
3cd0b8c5 RR |
49 | virtual void DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y ); |
50 | virtual void DoDrawBitmap( const wxBitmap &bitmap, wxCoord x, wxCoord y, | |
b1263dcf | 51 | bool useMask = false ); |
3cd0b8c5 | 52 | |
83df96d6 JS |
53 | virtual void DoDrawArc(wxCoord x1, wxCoord y1, |
54 | wxCoord x2, wxCoord y2, | |
55 | wxCoord xc, wxCoord yc); | |
56 | virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h, | |
57 | double sa, double ea); | |
b1263dcf | 58 | |
83df96d6 JS |
59 | virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height); |
60 | virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y, | |
61 | wxCoord width, wxCoord height, | |
62 | double radius); | |
63 | virtual void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height); | |
b1263dcf | 64 | |
83df96d6 | 65 | virtual void DoCrossHair(wxCoord x, wxCoord y); |
b1263dcf | 66 | |
83df96d6 JS |
67 | virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y); |
68 | virtual void DoDrawRotatedText(const wxString &text, wxCoord x, wxCoord y, double angle); | |
b1263dcf | 69 | |
83df96d6 JS |
70 | virtual bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, |
71 | wxDC *source, wxCoord xsrc, wxCoord ysrc, | |
03647350 | 72 | wxRasterOperationMode rop = wxCOPY, bool useMask = false, |
89efaf2b | 73 | wxCoord xsrcMask = -1, wxCoord ysrcMask = -1); |
b1263dcf | 74 | |
83df96d6 JS |
75 | virtual void DoSetClippingRegion(wxCoord x, wxCoord y, |
76 | wxCoord width, wxCoord height); | |
fdaad94e | 77 | virtual void DoSetDeviceClippingRegion(const wxRegion& region); |
b1263dcf | 78 | |
4787c92d | 79 | virtual void DoDrawLines(int n, const wxPoint points[], |
83df96d6 | 80 | wxCoord xoffset, wxCoord yoffset); |
4787c92d | 81 | virtual void DoDrawPolygon(int n, const wxPoint points[], |
83df96d6 | 82 | wxCoord xoffset, wxCoord yoffset, |
89efaf2b | 83 | wxPolygonFillMode fillStyle = wxODDEVEN_RULE); |
3cd0b8c5 RR |
84 | |
85 | ||
86 | public: | |
87 | virtual void Clear(); | |
b1263dcf | 88 | |
3cd0b8c5 RR |
89 | virtual void SetFont(const wxFont& font); |
90 | virtual void SetPen(const wxPen& pen); | |
91 | virtual void SetBrush(const wxBrush& brush); | |
92 | virtual void SetBackground(const wxBrush& brush); | |
93 | virtual void SetBackgroundMode(int mode); | |
94 | virtual void SetPalette(const wxPalette& palette); | |
89efaf2b | 95 | virtual void SetLogicalFunction( wxRasterOperationMode function ); |
b1263dcf | 96 | |
3cd0b8c5 RR |
97 | virtual void SetTextForeground(const wxColour& colour); |
98 | virtual void SetTextBackground(const wxColour& colour); | |
b1263dcf | 99 | |
3cd0b8c5 RR |
100 | virtual wxCoord GetCharHeight() const; |
101 | virtual wxCoord GetCharWidth() const; | |
b1263dcf | 102 | |
3cd0b8c5 RR |
103 | virtual int GetDepth() const; |
104 | virtual wxSize GetPPI() const; | |
b1263dcf | 105 | |
3cd0b8c5 | 106 | virtual void DestroyClippingRegion(); |
73f46291 | 107 | WXWindow GetX11Window() const { return m_x11window; } |
3cd0b8c5 | 108 | |
6f02a879 VZ |
109 | virtual void ComputeScaleAndOrigin(); |
110 | ||
b1263dcf | 111 | protected: |
3cd0b8c5 RR |
112 | // implementation |
113 | // -------------- | |
6f02a879 VZ |
114 | virtual void DoGetTextExtent(const wxString& string, |
115 | wxCoord *x, wxCoord *y, | |
116 | wxCoord *descent = NULL, | |
117 | wxCoord *externalLeading = NULL, | |
c94f845b | 118 | const wxFont *theFont = NULL) const; |
3cd0b8c5 | 119 | |
5c9d9745 VZ |
120 | void Init(); |
121 | ||
3cd0b8c5 | 122 | WXDisplay *m_display; |
2b77c3fc | 123 | WXWindow m_x11window; |
3cd0b8c5 RR |
124 | WXGC m_penGC; |
125 | WXGC m_brushGC; | |
126 | WXGC m_textGC; | |
127 | WXGC m_bgGC; | |
128 | WXColormap m_cmap; | |
129 | bool m_isMemDC; | |
130 | bool m_isScreenDC; | |
3cd0b8c5 RR |
131 | wxRegion m_currentClippingRegion; |
132 | wxRegion m_paintClippingRegion; | |
133 | ||
2b5f62a0 VZ |
134 | #if wxUSE_UNICODE |
135 | PangoContext *m_context; | |
136 | PangoFontDescription *m_fontdesc; | |
137 | #endif | |
138 | ||
3cd0b8c5 RR |
139 | void SetUpDC(); |
140 | void Destroy(); | |
3cd0b8c5 RR |
141 | |
142 | private: | |
2b77c3fc | 143 | DECLARE_CLASS(wxWindowDCImpl) |
83df96d6 JS |
144 | }; |
145 | ||
3cd0b8c5 RR |
146 | //----------------------------------------------------------------------------- |
147 | // wxClientDC | |
148 | //----------------------------------------------------------------------------- | |
149 | ||
2b77c3fc | 150 | class WXDLLIMPEXP_CORE wxClientDCImpl : public wxWindowDCImpl |
83df96d6 | 151 | { |
83df96d6 | 152 | public: |
2b77c3fc RR |
153 | wxClientDCImpl( wxDC *owner ) : wxWindowDCImpl( owner ) { } |
154 | wxClientDCImpl( wxDC *owner, wxWindow *win ); | |
3cd0b8c5 RR |
155 | |
156 | protected: | |
157 | virtual void DoGetSize(int *width, int *height) const; | |
158 | ||
159 | private: | |
2b77c3fc | 160 | DECLARE_CLASS(wxClientDCImpl) |
83df96d6 JS |
161 | }; |
162 | ||
3cd0b8c5 RR |
163 | //----------------------------------------------------------------------------- |
164 | // wxPaintDC | |
165 | //----------------------------------------------------------------------------- | |
166 | ||
2b77c3fc | 167 | class WXDLLIMPEXP_CORE wxPaintDCImpl : public wxClientDCImpl |
83df96d6 | 168 | { |
83df96d6 | 169 | public: |
2b77c3fc RR |
170 | wxPaintDCImpl( wxDC *owner ) : wxClientDCImpl( owner ) { } |
171 | wxPaintDCImpl( wxDC *owner, wxWindow *win ); | |
3cd0b8c5 RR |
172 | |
173 | private: | |
2b77c3fc | 174 | DECLARE_CLASS(wxPaintDCImpl) |
83df96d6 JS |
175 | }; |
176 | ||
177 | #endif | |
178 | // _WX_DCCLIENT_H_ |