]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: dcclient.h | |
3 | // Purpose: | |
4 | // Author: Robert Roebling | |
dbf858b5 RR |
5 | // Id: $Id$ |
6 | // Copyright: (c) 1998 Robert Roebling | |
8bbe427f | 7 | // Licence: wxWindows licence |
c801d85f KB |
8 | ///////////////////////////////////////////////////////////////////////////// |
9 | ||
c801d85f KB |
10 | #ifndef __GTKDCCLIENTH__ |
11 | #define __GTKDCCLIENTH__ | |
12 | ||
13 | #ifdef __GNUG__ | |
14 | #pragma interface | |
15 | #endif | |
16 | ||
17 | #include "wx/dc.h" | |
18 | #include "wx/window.h" | |
19 | ||
20 | //----------------------------------------------------------------------------- | |
21 | // classes | |
22 | //----------------------------------------------------------------------------- | |
23 | ||
ec758a20 | 24 | class wxWindowDC; |
c801d85f | 25 | class wxPaintDC; |
ec758a20 | 26 | class wxClientDC; |
c801d85f KB |
27 | |
28 | //----------------------------------------------------------------------------- | |
ec758a20 | 29 | // wxWindowDC |
c801d85f KB |
30 | //----------------------------------------------------------------------------- |
31 | ||
b0e0d661 | 32 | class wxWindowDC : public wxDC |
c801d85f | 33 | { |
ec758a20 | 34 | public: |
b0e0d661 VZ |
35 | wxWindowDC(); |
36 | wxWindowDC( wxWindow *win ); | |
37 | ||
38 | ~wxWindowDC(); | |
39 | ||
40 | virtual bool CanDrawBitmap() const { return TRUE; } | |
41 | virtual bool CanGetTextExtent() const { return TRUE; } | |
42 | ||
72cdf4c9 VZ |
43 | virtual void DoFloodFill( wxCoord x, wxCoord y, const wxColour& col, int style=wxFLOOD_SURFACE ); |
44 | virtual bool DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const; | |
45 | ||
46 | virtual void DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 ); | |
47 | virtual void DoCrossHair( wxCoord x, wxCoord y ); | |
48 | virtual void DoDrawArc( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2, | |
49 | wxCoord xc, wxCoord yc ); | |
50 | virtual void DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord width, wxCoord height, | |
b0e0d661 | 51 | double sa, double ea ); |
72cdf4c9 | 52 | virtual void DoDrawPoint( wxCoord x, wxCoord y ); |
b0e0d661 VZ |
53 | |
54 | virtual void DoDrawLines(int n, wxPoint points[], | |
72cdf4c9 | 55 | wxCoord xoffset, wxCoord yoffset); |
b0e0d661 | 56 | virtual void DoDrawPolygon(int n, wxPoint points[], |
72cdf4c9 | 57 | wxCoord xoffset, wxCoord yoffset, |
b0e0d661 VZ |
58 | int fillStyle = wxODDEVEN_RULE); |
59 | ||
72cdf4c9 VZ |
60 | virtual void DoDrawRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height ); |
61 | virtual void DoDrawRoundedRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius = 20.0 ); | |
62 | virtual void DoDrawEllipse( wxCoord x, wxCoord y, wxCoord width, wxCoord height ); | |
b0e0d661 | 63 | |
72cdf4c9 VZ |
64 | virtual void DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y ); |
65 | virtual void DoDrawBitmap( const wxBitmap &bitmap, wxCoord x, wxCoord y, | |
b0e0d661 VZ |
66 | bool useMask = FALSE ); |
67 | ||
72cdf4c9 VZ |
68 | virtual bool DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, |
69 | wxDC *source, wxCoord xsrc, wxCoord ysrc, | |
b0e0d661 VZ |
70 | int logical_func = wxCOPY, bool useMask = FALSE ); |
71 | ||
72cdf4c9 VZ |
72 | virtual void DoDrawText( const wxString &text, wxCoord x, wxCoord y ); |
73 | virtual void DoGetTextExtent( const wxString &string, | |
74 | wxCoord *width, wxCoord *height, | |
75 | wxCoord *descent = (wxCoord *) NULL, | |
76 | wxCoord *externalLeading = (wxCoord *) NULL, | |
b0e0d661 | 77 | wxFont *theFont = (wxFont *) NULL) const; |
72cdf4c9 VZ |
78 | virtual wxCoord GetCharWidth() const; |
79 | virtual wxCoord GetCharHeight() const; | |
b0e0d661 VZ |
80 | |
81 | virtual void Clear(); | |
82 | ||
83 | virtual void SetFont( const wxFont &font ); | |
84 | virtual void SetPen( const wxPen &pen ); | |
85 | virtual void SetBrush( const wxBrush &brush ); | |
86 | virtual void SetBackground( const wxBrush &brush ); | |
87 | virtual void SetLogicalFunction( int function ); | |
88 | virtual void SetTextForeground( const wxColour &col ); | |
89 | virtual void SetTextBackground( const wxColour &col ); | |
90 | virtual void SetBackgroundMode( int mode ); | |
91 | virtual void SetPalette( const wxPalette& palette ); | |
92 | ||
72cdf4c9 | 93 | virtual void DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height ); |
b0e0d661 VZ |
94 | virtual void DestroyClippingRegion(); |
95 | virtual void DoSetClippingRegionAsRegion( const wxRegion ®ion ); | |
96 | ||
d54e4256 | 97 | #if wxUSE_SPLINES |
b0e0d661 | 98 | virtual void DoDrawSpline( wxList *points ); |
d54e4256 | 99 | #endif |
b0e0d661 VZ |
100 | |
101 | // Resolution in pixels per logical inch | |
102 | virtual wxSize GetPPI() const; | |
103 | virtual int GetDepth() const; | |
104 | ||
105 | // implementation | |
106 | // -------------- | |
107 | ||
108 | GdkWindow *m_window; | |
109 | GdkGC *m_penGC; | |
110 | GdkGC *m_brushGC; | |
111 | GdkGC *m_textGC; | |
112 | GdkGC *m_bgGC; | |
113 | GdkColormap *m_cmap; | |
114 | bool m_isMemDC; | |
115 | wxWindow *m_owner; | |
116 | ||
117 | void SetUpDC(); | |
118 | void Destroy(); | |
238d735d RR |
119 | void ComputeScaleAndOrigin(); |
120 | ||
b0e0d661 | 121 | GdkWindow *GetWindow() { return m_window; } |
20e05ffb RR |
122 | |
123 | private: | |
124 | DECLARE_DYNAMIC_CLASS(wxWindowDC) | |
ec758a20 RR |
125 | }; |
126 | ||
127 | //----------------------------------------------------------------------------- | |
128 | // wxPaintDC | |
129 | //----------------------------------------------------------------------------- | |
130 | ||
131 | class wxPaintDC : public wxWindowDC | |
132 | { | |
ec758a20 | 133 | public: |
b0e0d661 VZ |
134 | wxPaintDC(); |
135 | wxPaintDC( wxWindow *win ); | |
20e05ffb RR |
136 | |
137 | private: | |
138 | DECLARE_DYNAMIC_CLASS(wxPaintDC) | |
c801d85f KB |
139 | }; |
140 | ||
ec758a20 RR |
141 | //----------------------------------------------------------------------------- |
142 | // wxClientDC | |
143 | //----------------------------------------------------------------------------- | |
144 | ||
145 | class wxClientDC : public wxWindowDC | |
146 | { | |
ec758a20 | 147 | public: |
b0e0d661 VZ |
148 | wxClientDC(); |
149 | wxClientDC( wxWindow *win ); | |
20e05ffb RR |
150 | |
151 | private: | |
152 | DECLARE_DYNAMIC_CLASS(wxClientDC) | |
ec758a20 RR |
153 | }; |
154 | ||
c801d85f | 155 | #endif // __GTKDCCLIENTH__ |