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