]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: dcclient.h | |
3 | // Purpose: | |
4 | // Author: Robert Roebling | |
5 | // Id: $Id$ | |
6 | // Copyright: (c) 1998 Robert Roebling | |
7 | // Licence: wxWindows licence | |
8 | ///////////////////////////////////////////////////////////////////////////// | |
9 | ||
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 | ||
24 | class wxWindowDC; | |
25 | class wxPaintDC; | |
26 | class wxClientDC; | |
27 | ||
28 | //----------------------------------------------------------------------------- | |
29 | // wxWindowDC | |
30 | //----------------------------------------------------------------------------- | |
31 | ||
32 | class wxWindowDC : public wxDC | |
33 | { | |
34 | public: | |
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 | ||
43 | //protected: | |
44 | virtual void DoFloodFill( wxCoord x, wxCoord y, const wxColour& col, int style=wxFLOOD_SURFACE ); | |
45 | virtual bool DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const; | |
46 | ||
47 | virtual void DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 ); | |
48 | virtual void DoCrossHair( wxCoord x, wxCoord y ); | |
49 | virtual void DoDrawArc( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2, | |
50 | wxCoord xc, wxCoord yc ); | |
51 | virtual void DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord width, wxCoord height, | |
52 | double sa, double ea ); | |
53 | virtual void DoDrawPoint( wxCoord x, wxCoord y ); | |
54 | ||
55 | virtual void DoDrawLines(int n, wxPoint points[], | |
56 | wxCoord xoffset, wxCoord yoffset); | |
57 | virtual void DoDrawPolygon(int n, wxPoint points[], | |
58 | wxCoord xoffset, wxCoord yoffset, | |
59 | int fillStyle = wxODDEVEN_RULE); | |
60 | ||
61 | virtual void DoDrawRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height ); | |
62 | virtual void DoDrawRoundedRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius = 20.0 ); | |
63 | virtual void DoDrawEllipse( wxCoord x, wxCoord y, wxCoord width, wxCoord height ); | |
64 | ||
65 | virtual void DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y ); | |
66 | virtual void DoDrawBitmap( const wxBitmap &bitmap, wxCoord x, wxCoord y, | |
67 | bool useMask = FALSE ); | |
68 | ||
69 | virtual bool DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, | |
70 | wxDC *source, wxCoord xsrc, wxCoord ysrc, | |
71 | int logical_func = wxCOPY, bool useMask = FALSE ); | |
72 | ||
73 | virtual void DoDrawText( const wxString &text, wxCoord x, wxCoord y ); | |
74 | virtual void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, | |
75 | double angle); | |
76 | virtual void DoGetTextExtent( const wxString &string, | |
77 | wxCoord *width, wxCoord *height, | |
78 | wxCoord *descent = (wxCoord *) NULL, | |
79 | wxCoord *externalLeading = (wxCoord *) NULL, | |
80 | wxFont *theFont = (wxFont *) NULL) const; | |
81 | virtual wxCoord GetCharWidth() const; | |
82 | virtual wxCoord GetCharHeight() const; | |
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 ); | |
90 | virtual void SetLogicalFunction( int function ); | |
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 | ||
96 | virtual void DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height ); | |
97 | virtual void DestroyClippingRegion(); | |
98 | virtual void DoSetClippingRegionAsRegion( const wxRegion ®ion ); | |
99 | ||
100 | #if wxUSE_SPLINES | |
101 | virtual void DoDrawSpline( wxList *points ); | |
102 | #endif | |
103 | ||
104 | // Resolution in pixels per logical inch | |
105 | virtual wxSize GetPPI() const; | |
106 | virtual int GetDepth() const; | |
107 | ||
108 | // implementation | |
109 | // -------------- | |
110 | ||
111 | GdkWindow *m_window; | |
112 | GdkGC *m_penGC; | |
113 | GdkGC *m_brushGC; | |
114 | GdkGC *m_textGC; | |
115 | GdkGC *m_bgGC; | |
116 | GdkColormap *m_cmap; | |
117 | bool m_isMemDC; | |
118 | bool m_isScreenDC; | |
119 | wxWindow *m_owner; | |
120 | wxRegion m_currentClippingRegion; | |
121 | wxRegion m_paintClippingRegion; | |
122 | ||
123 | void SetUpDC(); | |
124 | void Destroy(); | |
125 | void ComputeScaleAndOrigin(); | |
126 | ||
127 | GdkWindow *GetWindow() { return m_window; } | |
128 | ||
129 | private: | |
130 | DECLARE_DYNAMIC_CLASS(wxWindowDC) | |
131 | }; | |
132 | ||
133 | //----------------------------------------------------------------------------- | |
134 | // wxPaintDC | |
135 | //----------------------------------------------------------------------------- | |
136 | ||
137 | class wxPaintDC : public wxWindowDC | |
138 | { | |
139 | public: | |
140 | wxPaintDC(); | |
141 | wxPaintDC( wxWindow *win ); | |
142 | ||
143 | private: | |
144 | DECLARE_DYNAMIC_CLASS(wxPaintDC) | |
145 | }; | |
146 | ||
147 | //----------------------------------------------------------------------------- | |
148 | // wxClientDC | |
149 | //----------------------------------------------------------------------------- | |
150 | ||
151 | class wxClientDC : public wxWindowDC | |
152 | { | |
153 | public: | |
154 | wxClientDC(); | |
155 | wxClientDC( wxWindow *win ); | |
156 | ||
157 | private: | |
158 | DECLARE_DYNAMIC_CLASS(wxClientDC) | |
159 | }; | |
160 | ||
161 | #endif // __GTKDCCLIENTH__ |