]>
Commit | Line | Data |
---|---|---|
c801d85f | 1 | ///////////////////////////////////////////////////////////////////////////// |
8ef94bfc | 2 | // Name: wx/gtk1/dcclient.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 | ||
c801d85f KB |
10 | #ifndef __GTKDCCLIENTH__ |
11 | #define __GTKDCCLIENTH__ | |
12 | ||
10d30222 | 13 | #include "wx/gtk1/dc.h" |
c801d85f KB |
14 | #include "wx/window.h" |
15 | ||
16 | //----------------------------------------------------------------------------- | |
17 | // classes | |
18 | //----------------------------------------------------------------------------- | |
19 | ||
10d30222 VZ |
20 | class WXDLLIMPEXP_FWD_CORE wxWindowDCImpl; |
21 | class WXDLLIMPEXP_FWD_CORE wxPaintDCImpl; | |
22 | class WXDLLIMPEXP_FWD_CORE wxClientDCImpl; | |
c801d85f KB |
23 | |
24 | //----------------------------------------------------------------------------- | |
10d30222 | 25 | // wxWindowDCImpl |
c801d85f KB |
26 | //----------------------------------------------------------------------------- |
27 | ||
10d30222 | 28 | class WXDLLIMPEXP_CORE wxWindowDCImpl : public wxGTKDCImpl |
c801d85f | 29 | { |
ec758a20 | 30 | public: |
10d30222 VZ |
31 | wxWindowDCImpl(wxDC *owner); |
32 | wxWindowDCImpl(wxDC *owner, wxWindow *win); | |
b0e0d661 | 33 | |
10d30222 | 34 | virtual ~wxWindowDCImpl(); |
b0e0d661 | 35 | |
b1263dcf WS |
36 | virtual bool CanDrawBitmap() const { return true; } |
37 | virtual bool CanGetTextExtent() const { return true; } | |
b0e0d661 | 38 | |
376aa62a VZ |
39 | protected: |
40 | virtual void DoGetSize(int *width, int *height) const; | |
89efaf2b | 41 | virtual bool DoFloodFill( wxCoord x, wxCoord y, const wxColour& col, wxFloodFillStyle style=wxFLOOD_SURFACE ); |
72cdf4c9 VZ |
42 | virtual bool DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const; |
43 | ||
44 | virtual void DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 ); | |
45 | virtual void DoCrossHair( wxCoord x, wxCoord y ); | |
46 | virtual void DoDrawArc( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2, | |
47 | wxCoord xc, wxCoord yc ); | |
48 | virtual void DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord width, wxCoord height, | |
b0e0d661 | 49 | double sa, double ea ); |
72cdf4c9 | 50 | virtual void DoDrawPoint( wxCoord x, wxCoord y ); |
b0e0d661 VZ |
51 | |
52 | virtual void DoDrawLines(int n, wxPoint points[], | |
72cdf4c9 | 53 | wxCoord xoffset, wxCoord yoffset); |
b0e0d661 | 54 | virtual void DoDrawPolygon(int n, wxPoint points[], |
72cdf4c9 | 55 | wxCoord xoffset, wxCoord yoffset, |
89efaf2b | 56 | wxPolygonFillMode fillStyle = wxODDEVEN_RULE); |
b0e0d661 | 57 | |
72cdf4c9 VZ |
58 | virtual void DoDrawRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height ); |
59 | virtual void DoDrawRoundedRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius = 20.0 ); | |
60 | virtual void DoDrawEllipse( wxCoord x, wxCoord y, wxCoord width, wxCoord height ); | |
b0e0d661 | 61 | |
72cdf4c9 VZ |
62 | virtual void DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y ); |
63 | virtual void DoDrawBitmap( const wxBitmap &bitmap, wxCoord x, wxCoord y, | |
b1263dcf | 64 | bool useMask = false ); |
b0e0d661 | 65 | |
72cdf4c9 VZ |
66 | virtual bool DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, |
67 | wxDC *source, wxCoord xsrc, wxCoord ysrc, | |
89efaf2b FM |
68 | wxRasterOperationMode logical_func = wxCOPY, bool useMask = false, |
69 | wxCoord xsrcMask = -1, wxCoord ysrcMask = -1 ); | |
b0e0d661 | 70 | |
72cdf4c9 | 71 | virtual void DoDrawText( const wxString &text, wxCoord x, wxCoord y ); |
95724b1a VZ |
72 | virtual void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, |
73 | double angle); | |
72cdf4c9 VZ |
74 | virtual void DoGetTextExtent( const wxString &string, |
75 | wxCoord *width, wxCoord *height, | |
76 | wxCoord *descent = (wxCoord *) NULL, | |
77 | wxCoord *externalLeading = (wxCoord *) NULL, | |
c94f845b | 78 | const wxFont *theFont = (wxFont *) NULL) const; |
376aa62a VZ |
79 | |
80 | public: | |
72cdf4c9 VZ |
81 | virtual wxCoord GetCharWidth() const; |
82 | virtual wxCoord GetCharHeight() const; | |
b0e0d661 VZ |
83 | |
84 | virtual void Clear(); | |
85 | ||
86 | virtual void SetFont( const wxFont &font ); | |
87 | virtual void SetPen( const wxPen &pen ); | |
88 | virtual void SetBrush( const wxBrush &brush ); | |
89 | virtual void SetBackground( const wxBrush &brush ); | |
89efaf2b | 90 | virtual void SetLogicalFunction( wxRasterOperationMode function ); |
b0e0d661 VZ |
91 | virtual void SetTextForeground( const wxColour &col ); |
92 | virtual void SetTextBackground( const wxColour &col ); | |
93 | virtual void SetBackgroundMode( int mode ); | |
94 | virtual void SetPalette( const wxPalette& palette ); | |
95 | ||
72cdf4c9 | 96 | virtual void DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height ); |
b0e0d661 | 97 | virtual void DestroyClippingRegion(); |
fdaad94e | 98 | virtual void DoSetDeviceClippingRegion( const wxRegion ®ion ); |
b0e0d661 | 99 | |
b0e0d661 VZ |
100 | // Resolution in pixels per logical inch |
101 | virtual wxSize GetPPI() const; | |
102 | virtual int GetDepth() const; | |
103 | ||
2e992e06 VZ |
104 | virtual GdkWindow* GetGDKWindow() const { return m_window; } |
105 | ||
b0e0d661 VZ |
106 | // implementation |
107 | // -------------- | |
108 | ||
109 | GdkWindow *m_window; | |
110 | GdkGC *m_penGC; | |
111 | GdkGC *m_brushGC; | |
112 | GdkGC *m_textGC; | |
113 | GdkGC *m_bgGC; | |
114 | GdkColormap *m_cmap; | |
115 | bool m_isMemDC; | |
e1208c31 | 116 | bool m_isScreenDC; |
b0e0d661 | 117 | wxWindow *m_owner; |
3d2d8da1 RR |
118 | wxRegion m_currentClippingRegion; |
119 | wxRegion m_paintClippingRegion; | |
b1263dcf | 120 | |
b0e0d661 VZ |
121 | void SetUpDC(); |
122 | void Destroy(); | |
b1263dcf | 123 | virtual void ComputeScaleAndOrigin(); |
238d735d | 124 | |
b0e0d661 | 125 | GdkWindow *GetWindow() { return m_window; } |
cd9da200 | 126 | |
20e05ffb | 127 | private: |
10d30222 | 128 | DECLARE_DYNAMIC_CLASS(wxWindowDCImpl) |
ec758a20 RR |
129 | }; |
130 | ||
131 | //----------------------------------------------------------------------------- | |
10d30222 | 132 | // wxClientDCImpl |
ec758a20 RR |
133 | //----------------------------------------------------------------------------- |
134 | ||
10d30222 | 135 | class WXDLLIMPEXP_CORE wxClientDCImpl : public wxWindowDCImpl |
ec758a20 | 136 | { |
ec758a20 | 137 | public: |
10d30222 VZ |
138 | wxClientDCImpl(wxDC *owner) : wxWindowDCImpl(owner) { } |
139 | wxClientDCImpl(wxDC *owner, wxWindow *win); | |
cd9da200 | 140 | |
7b30ac82 VZ |
141 | protected: |
142 | virtual void DoGetSize(int *width, int *height) const; | |
143 | ||
20e05ffb | 144 | private: |
10d30222 | 145 | DECLARE_DYNAMIC_CLASS(wxClientDCImpl) |
c801d85f KB |
146 | }; |
147 | ||
ec758a20 | 148 | //----------------------------------------------------------------------------- |
10d30222 | 149 | // wxPaintDCImpl |
ec758a20 RR |
150 | //----------------------------------------------------------------------------- |
151 | ||
10d30222 | 152 | class WXDLLIMPEXP_CORE wxPaintDCImpl : public wxClientDCImpl |
ec758a20 | 153 | { |
ec758a20 | 154 | public: |
10d30222 VZ |
155 | wxPaintDCImpl(wxDC *owner) : wxClientDCImpl(owner) { } |
156 | wxPaintDCImpl(wxDC *owner, wxWindow *win); | |
cd9da200 | 157 | |
20e05ffb | 158 | private: |
10d30222 | 159 | DECLARE_DYNAMIC_CLASS(wxPaintDCImpl) |
ec758a20 RR |
160 | }; |
161 | ||
c801d85f | 162 | #endif // __GTKDCCLIENTH__ |