1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 #ifndef __GTKDCCLIENTH__
11 #define __GTKDCCLIENTH__
14 #include "wx/region.h"
16 class WXDLLIMPEXP_CORE wxWindow
;
18 //-----------------------------------------------------------------------------
20 //-----------------------------------------------------------------------------
22 class WXDLLIMPEXP_CORE wxWindowDC
: public wxDC
26 wxWindowDC( wxWindow
*win
);
28 virtual ~wxWindowDC();
30 virtual bool CanDrawBitmap() const { return true; }
31 virtual bool CanGetTextExtent() const { return true; }
34 virtual void DoGetSize(int *width
, int *height
) const;
35 virtual bool DoFloodFill( wxCoord x
, wxCoord y
, const wxColour
& col
, int style
=wxFLOOD_SURFACE
);
36 virtual bool DoGetPixel( wxCoord x1
, wxCoord y1
, wxColour
*col
) const;
38 virtual void DoDrawLine( wxCoord x1
, wxCoord y1
, wxCoord x2
, wxCoord y2
);
39 virtual void DoCrossHair( wxCoord x
, wxCoord y
);
40 virtual void DoDrawArc( wxCoord x1
, wxCoord y1
, wxCoord x2
, wxCoord y2
,
41 wxCoord xc
, wxCoord yc
);
42 virtual void DoDrawEllipticArc( wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
,
43 double sa
, double ea
);
44 virtual void DoDrawPoint( wxCoord x
, wxCoord y
);
46 virtual void DoDrawLines(int n
, wxPoint points
[],
47 wxCoord xoffset
, wxCoord yoffset
);
48 virtual void DoDrawPolygon(int n
, wxPoint points
[],
49 wxCoord xoffset
, wxCoord yoffset
,
50 int fillStyle
= wxODDEVEN_RULE
);
52 virtual void DoDrawRectangle( wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
);
53 virtual void DoDrawRoundedRectangle( wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
, double radius
= 20.0 );
54 virtual void DoDrawEllipse( wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
);
56 virtual void DoDrawIcon( const wxIcon
&icon
, wxCoord x
, wxCoord y
);
57 virtual void DoDrawBitmap( const wxBitmap
&bitmap
, wxCoord x
, wxCoord y
,
58 bool useMask
= false );
60 virtual bool DoBlit( wxCoord xdest
, wxCoord ydest
, wxCoord width
, wxCoord height
,
61 wxDC
*source
, wxCoord xsrc
, wxCoord ysrc
,
62 int logical_func
= wxCOPY
, bool useMask
= false, wxCoord xsrcMask
= -1, wxCoord ysrcMask
= -1 );
64 virtual void DoDrawText( const wxString
&text
, wxCoord x
, wxCoord y
);
65 virtual void DoDrawRotatedText(const wxString
& text
, wxCoord x
, wxCoord y
,
67 virtual void DoGetTextExtent( const wxString
&string
,
68 wxCoord
*width
, wxCoord
*height
,
69 wxCoord
*descent
= (wxCoord
*) NULL
,
70 wxCoord
*externalLeading
= (wxCoord
*) NULL
,
71 wxFont
*theFont
= (wxFont
*) NULL
) const;
72 virtual void DoSetClippingRegion( wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
);
73 virtual void DoSetClippingRegionAsRegion( const wxRegion
®ion
);
76 virtual wxCoord
GetCharWidth() const;
77 virtual wxCoord
GetCharHeight() const;
81 virtual void SetFont( const wxFont
&font
);
82 virtual void SetPen( const wxPen
&pen
);
83 virtual void SetBrush( const wxBrush
&brush
);
84 virtual void SetBackground( const wxBrush
&brush
);
85 virtual void SetLogicalFunction( int function
);
86 virtual void SetTextForeground( const wxColour
&col
);
87 virtual void SetTextBackground( const wxColour
&col
);
88 virtual void SetBackgroundMode( int mode
);
89 virtual void SetPalette( const wxPalette
& palette
);
91 virtual void DestroyClippingRegion();
93 // Resolution in pixels per logical inch
94 virtual wxSize
GetPPI() const;
95 virtual int GetDepth() const;
109 wxRegion m_currentClippingRegion
;
110 wxRegion m_paintClippingRegion
;
112 // PangoContext stuff for GTK 2.0
113 PangoContext
*m_context
;
114 PangoLayout
*m_layout
;
115 PangoFontDescription
*m_fontdesc
;
120 virtual void ComputeScaleAndOrigin();
122 GdkWindow
*GetWindow() { return m_window
; }
125 DECLARE_DYNAMIC_CLASS(wxWindowDC
)
128 //-----------------------------------------------------------------------------
130 //-----------------------------------------------------------------------------
132 class WXDLLIMPEXP_CORE wxClientDC
: public wxWindowDC
136 wxClientDC( wxWindow
*win
);
139 virtual void DoGetSize(int *width
, int *height
) const;
142 DECLARE_DYNAMIC_CLASS(wxClientDC
)
145 //-----------------------------------------------------------------------------
147 //-----------------------------------------------------------------------------
149 class WXDLLIMPEXP_CORE wxPaintDC
: public wxClientDC
153 wxPaintDC( wxWindow
*win
);
156 DECLARE_DYNAMIC_CLASS(wxPaintDC
)
159 #endif // __GTKDCCLIENTH__