]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/dcclient.h
refactoring/simplification of code dealing with scrollbars and their events
[wxWidgets.git] / include / wx / gtk / dcclient.h
CommitLineData
c801d85f
KB
1/////////////////////////////////////////////////////////////////////////////
2// Name: dcclient.h
3// Purpose:
4// Author: Robert Roebling
dbf858b5
RR
5// Id: $Id$
6// Copyright: (c) 1998 Robert Roebling
65571936 7// Licence: wxWindows licence
c801d85f
KB
8/////////////////////////////////////////////////////////////////////////////
9
c801d85f
KB
10#ifndef __GTKDCCLIENTH__
11#define __GTKDCCLIENTH__
12
c801d85f
KB
13#include "wx/dc.h"
14#include "wx/window.h"
15
16//-----------------------------------------------------------------------------
17// classes
18//-----------------------------------------------------------------------------
19
20123d49
MW
20class WXDLLIMPEXP_CORE wxWindowDC;
21class WXDLLIMPEXP_CORE wxPaintDC;
22class WXDLLIMPEXP_CORE wxClientDC;
c801d85f
KB
23
24//-----------------------------------------------------------------------------
ec758a20 25// wxWindowDC
c801d85f
KB
26//-----------------------------------------------------------------------------
27
20123d49 28class WXDLLIMPEXP_CORE wxWindowDC : public wxDC
c801d85f 29{
ec758a20 30public:
b0e0d661
VZ
31 wxWindowDC();
32 wxWindowDC( wxWindow *win );
33
4f55a07f 34 virtual ~wxWindowDC();
b0e0d661 35
b1263dcf
WS
36 virtual bool CanDrawBitmap() const { return true; }
37 virtual bool CanGetTextExtent() const { return true; }
b0e0d661 38
376aa62a
VZ
39protected:
40 virtual void DoGetSize(int *width, int *height) const;
387ebd3e 41 virtual bool DoFloodFill( wxCoord x, wxCoord y, const wxColour& col, int style=wxFLOOD_SURFACE );
72cdf4c9
VZ
42 virtual bool DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const;
43
44 virtual void DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 );
45 virtual void DoCrossHair( wxCoord x, wxCoord y );
46 virtual void DoDrawArc( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2,
47 wxCoord xc, wxCoord yc );
48 virtual void DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord width, wxCoord height,
b0e0d661 49 double sa, double ea );
72cdf4c9 50 virtual void DoDrawPoint( wxCoord x, wxCoord y );
b0e0d661
VZ
51
52 virtual void DoDrawLines(int n, wxPoint points[],
72cdf4c9 53 wxCoord xoffset, wxCoord yoffset);
b0e0d661 54 virtual void DoDrawPolygon(int n, wxPoint points[],
72cdf4c9 55 wxCoord xoffset, wxCoord yoffset,
b0e0d661
VZ
56 int fillStyle = wxODDEVEN_RULE);
57
72cdf4c9
VZ
58 virtual void DoDrawRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height );
59 virtual void DoDrawRoundedRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius = 20.0 );
60 virtual void DoDrawEllipse( wxCoord x, wxCoord y, wxCoord width, wxCoord height );
b0e0d661 61
72cdf4c9
VZ
62 virtual void DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y );
63 virtual void DoDrawBitmap( const wxBitmap &bitmap, wxCoord x, wxCoord y,
b1263dcf 64 bool useMask = false );
b0e0d661 65
72cdf4c9
VZ
66 virtual bool DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
67 wxDC *source, wxCoord xsrc, wxCoord ysrc,
b1263dcf 68 int logical_func = wxCOPY, bool useMask = false, 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,
75 wxCoord *descent = (wxCoord *) NULL,
76 wxCoord *externalLeading = (wxCoord *) NULL,
b0e0d661 77 wxFont *theFont = (wxFont *) NULL) const;
6f02a879
VZ
78 virtual void DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height );
79 virtual void DoSetClippingRegionAsRegion( const wxRegion &region );
376aa62a
VZ
80
81public:
72cdf4c9
VZ
82 virtual wxCoord GetCharWidth() const;
83 virtual wxCoord GetCharHeight() const;
b0e0d661
VZ
84
85 virtual void Clear();
86
87 virtual void SetFont( const wxFont &font );
88 virtual void SetPen( const wxPen &pen );
89 virtual void SetBrush( const wxBrush &brush );
90 virtual void SetBackground( const wxBrush &brush );
91 virtual void SetLogicalFunction( int function );
92 virtual void SetTextForeground( const wxColour &col );
93 virtual void SetTextBackground( const wxColour &col );
94 virtual void SetBackgroundMode( int mode );
95 virtual void SetPalette( const wxPalette& palette );
96
b0e0d661 97 virtual void DestroyClippingRegion();
b0e0d661 98
b0e0d661
VZ
99 // Resolution in pixels per logical inch
100 virtual wxSize GetPPI() const;
101 virtual int GetDepth() const;
102
103 // implementation
104 // --------------
105
106 GdkWindow *m_window;
107 GdkGC *m_penGC;
108 GdkGC *m_brushGC;
109 GdkGC *m_textGC;
110 GdkGC *m_bgGC;
111 GdkColormap *m_cmap;
112 bool m_isMemDC;
e1208c31 113 bool m_isScreenDC;
b0e0d661 114 wxWindow *m_owner;
3d2d8da1
RR
115 wxRegion m_currentClippingRegion;
116 wxRegion m_paintClippingRegion;
b1263dcf 117
2b5f62a0 118 // PangoContext stuff for GTK 2.0
8943b403 119 PangoContext *m_context;
138618ac 120 PangoLayout *m_layout;
8943b403 121 PangoFontDescription *m_fontdesc;
b0e0d661
VZ
122
123 void SetUpDC();
124 void Destroy();
b1263dcf 125 virtual void ComputeScaleAndOrigin();
238d735d 126
b0e0d661 127 GdkWindow *GetWindow() { return m_window; }
cd9da200 128
20e05ffb
RR
129private:
130 DECLARE_DYNAMIC_CLASS(wxWindowDC)
ec758a20
RR
131};
132
133//-----------------------------------------------------------------------------
376aa62a 134// wxClientDC
ec758a20
RR
135//-----------------------------------------------------------------------------
136
20123d49 137class WXDLLIMPEXP_CORE wxClientDC : public wxWindowDC
ec758a20 138{
ec758a20 139public:
4f55a07f 140 wxClientDC() { }
376aa62a 141 wxClientDC( wxWindow *win );
cd9da200 142
7b30ac82
VZ
143protected:
144 virtual void DoGetSize(int *width, int *height) const;
145
20e05ffb 146private:
376aa62a 147 DECLARE_DYNAMIC_CLASS(wxClientDC)
c801d85f
KB
148};
149
ec758a20 150//-----------------------------------------------------------------------------
376aa62a 151// wxPaintDC
ec758a20
RR
152//-----------------------------------------------------------------------------
153
20123d49 154class WXDLLIMPEXP_CORE wxPaintDC : public wxClientDC
ec758a20 155{
ec758a20 156public:
376aa62a
VZ
157 wxPaintDC() { }
158 wxPaintDC( wxWindow *win );
cd9da200 159
20e05ffb 160private:
376aa62a 161 DECLARE_DYNAMIC_CLASS(wxPaintDC)
ec758a20
RR
162};
163
c801d85f 164#endif // __GTKDCCLIENTH__