]> git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/dcclient.h
Removed unnecessary code from utilsunx.cpp
[wxWidgets.git] / include / wx / motif / dcclient.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: dcclient.h
3 // Purpose: wxClientDC, wxPaintDC and wxWindowDC classes
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 17/09/98
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_DCCLIENT_H_
13 #define _WX_DCCLIENT_H_
14
15 #ifdef __GNUG__
16 #pragma interface "dcclient.h"
17 #endif
18
19 #include "wx/dc.h"
20
21 // -----------------------------------------------------------------------------
22 // fwd declarations
23 // -----------------------------------------------------------------------------
24
25 class WXDLLEXPORT wxWindowDC;
26 class WXDLLEXPORT wxWindow;
27
28 // Under Windows, wxClientDC, wxPaintDC and wxWindowDC are implemented
29 // differently. On many platforms, however, they will be the same.
30
31 //-----------------------------------------------------------------------------
32 // wxWindowDC
33 //-----------------------------------------------------------------------------
34
35 class WXDLLEXPORT wxWindowDC : public wxDC
36 {
37 DECLARE_DYNAMIC_CLASS(wxWindowDC)
38
39 public:
40 wxWindowDC();
41 wxWindowDC( wxWindow *win );
42
43 ~wxWindowDC();
44
45 // TODO this function is Motif-only for now - should it go into base class?
46 void Clear(const wxRect& rect);
47
48 // implement base class pure virtuals
49 // ----------------------------------
50
51 virtual void Clear();
52
53 virtual void SetFont(const wxFont& font);
54 virtual void SetPen(const wxPen& pen);
55 virtual void SetBrush(const wxBrush& brush);
56 virtual void SetBackground(const wxBrush& brush);
57 virtual void SetBackgroundMode(int mode);
58 virtual void SetPalette(const wxPalette& palette);
59 virtual void SetLogicalFunction( int function );
60
61 virtual void SetTextForeground(const wxColour& colour);
62 virtual void SetTextBackground(const wxColour& colour);
63
64 virtual wxCoord GetCharHeight() const;
65 virtual wxCoord GetCharWidth() const;
66 virtual void DoGetTextExtent(const wxString& string,
67 wxCoord *x, wxCoord *y,
68 wxCoord *descent = NULL,
69 wxCoord *externalLeading = NULL,
70 wxFont *theFont = NULL) const;
71
72 virtual bool CanDrawBitmap() const;
73 virtual bool CanGetTextExtent() const;
74
75 virtual int GetDepth() const;
76 virtual wxSize GetPPI() const;
77
78 virtual void DestroyClippingRegion();
79
80 // Helper function for setting clipping
81 void SetDCClipping();
82
83 // implementation from now on
84 // --------------------------
85
86 WXGC GetGC() const { return m_gc; }
87 WXGC GetBackingGC() const { return m_gcBacking; }
88 WXDisplay* GetDisplay() const { return m_display; }
89 bool GetAutoSetting() const { return m_autoSetting; }
90 void SetAutoSetting(bool flag) { m_autoSetting = flag; }
91
92 protected:
93 virtual void DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
94 int style = wxFLOOD_SURFACE);
95
96 virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const;
97
98 virtual void DoDrawPoint(wxCoord x, wxCoord y);
99 virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2);
100
101 virtual void DoDrawArc(wxCoord x1, wxCoord y1,
102 wxCoord x2, wxCoord y2,
103 wxCoord xc, wxCoord yc);
104 virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h,
105 double sa, double ea);
106
107 virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
108 virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y,
109 wxCoord width, wxCoord height,
110 double radius);
111 virtual void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
112
113 virtual void DoCrossHair(wxCoord x, wxCoord y);
114
115 virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y);
116 virtual void DoDrawRotatedText(const wxString &text, wxCoord x, wxCoord y, double angle);
117
118 virtual bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
119 wxDC *source, wxCoord xsrc, wxCoord ysrc,
120 int rop = wxCOPY, bool useMask = FALSE);
121
122 virtual void DoSetClippingRegionAsRegion(const wxRegion& region);
123 virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
124 wxCoord width, wxCoord height);
125
126 virtual void DoDrawLines(int n, wxPoint points[],
127 wxCoord xoffset, wxCoord yoffset);
128 virtual void DoDrawPolygon(int n, wxPoint points[],
129 wxCoord xoffset, wxCoord yoffset,
130 int fillStyle = wxODDEVEN_RULE);
131
132 #if wxUSE_SPLINES
133 virtual void DoDrawSpline(wxList *points);
134 #endif // wxUSE_SPLINES
135
136 WXGC m_gc;
137 WXGC m_gcBacking;
138 WXDisplay* m_display;
139 wxWindow* m_window;
140 WXRegion m_currentRegion; // Current clipping region (incl. paint clip region)
141 WXRegion m_userRegion; // User-defined clipping region
142 WXPixmap m_pixmap; // Pixmap for drawing on
143
144 // Not sure if we'll need all of these
145 int m_backgroundPixel;
146 wxColour m_currentColour;
147 // int m_currentBkMode;
148 int m_currentPenWidth ;
149 int m_currentPenJoin ;
150 int m_currentPenCap ;
151 int m_currentPenDashCount ;
152 char* m_currentPenDash ;
153 wxBitmap m_currentStipple ;
154 int m_currentStyle ;
155 int m_currentFill ;
156 int m_autoSetting ; // See comment in dcclient.cpp
157 WXFont m_oldFont;
158 };
159
160 class WXDLLEXPORT wxPaintDC: public wxWindowDC
161 {
162 DECLARE_DYNAMIC_CLASS(wxPaintDC)
163
164 public:
165 wxPaintDC() { }
166 wxPaintDC(wxWindow* win);
167
168 ~wxPaintDC();
169 };
170
171 class WXDLLEXPORT wxClientDC: public wxWindowDC
172 {
173 DECLARE_DYNAMIC_CLASS(wxClientDC)
174
175 public:
176 wxClientDC() { }
177 wxClientDC(wxWindow* win) : wxWindowDC(win) { }
178 };
179
180 #endif
181 // _WX_DCCLIENT_H_