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