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 //-----------------------------------------------------------------------------
23 class WXDLLIMPEXP_CORE wxGTKWindowImplDC
: public wxGTKImplDC
25 #define wxGTKWindowImplDC wxWindowDC
26 class WXDLLIMPEXP_CORE wxWindowDC
: public wxDC
31 wxGTKWindowImplDC( wxWindow
*win
);
33 virtual ~wxGTKWindowImplDC();
35 virtual bool CanDrawBitmap() const { return true; }
36 virtual bool CanGetTextExtent() const { return true; }
39 virtual void DoGetSize(int *width
, int *height
) const;
40 virtual bool DoFloodFill( wxCoord x
, wxCoord y
, const wxColour
& col
, int style
=wxFLOOD_SURFACE
);
41 virtual bool DoGetPixel( wxCoord x1
, wxCoord y1
, wxColour
*col
) const;
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
,
48 double sa
, double ea
);
49 virtual void DoDrawPoint( wxCoord x
, wxCoord y
);
51 virtual void DoDrawLines(int n
, wxPoint points
[],
52 wxCoord xoffset
, wxCoord yoffset
);
53 virtual void DoDrawPolygon(int n
, wxPoint points
[],
54 wxCoord xoffset
, wxCoord yoffset
,
55 int fillStyle
= wxODDEVEN_RULE
);
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
);
61 virtual void DoDrawIcon( const wxIcon
&icon
, wxCoord x
, wxCoord y
);
62 virtual void DoDrawBitmap( const wxBitmap
&bitmap
, wxCoord x
, wxCoord y
,
63 bool useMask
= false );
65 virtual bool DoBlit( wxCoord xdest
, wxCoord ydest
, wxCoord width
, wxCoord height
,
66 wxDC
*source
, wxCoord xsrc
, wxCoord ysrc
,
67 int logical_func
= wxCOPY
, bool useMask
= false, wxCoord xsrcMask
= -1, wxCoord ysrcMask
= -1 );
69 virtual void DoDrawText( const wxString
&text
, wxCoord x
, wxCoord y
);
70 virtual void DoDrawRotatedText(const wxString
& text
, wxCoord x
, wxCoord y
,
72 virtual void DoGetTextExtent( const wxString
&string
,
73 wxCoord
*width
, wxCoord
*height
,
74 wxCoord
*descent
= (wxCoord
*) NULL
,
75 wxCoord
*externalLeading
= (wxCoord
*) NULL
,
76 const wxFont
*theFont
= (wxFont
*) NULL
) const;
77 virtual bool DoGetPartialTextExtents(const wxString
& text
, wxArrayInt
& widths
) const;
78 virtual void DoSetClippingRegion( wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
);
79 virtual void DoSetClippingRegionAsRegion( const wxRegion
®ion
);
83 virtual wxCoord
GetCharWidth() const;
84 virtual wxCoord
GetCharHeight() const;
88 virtual void SetFont( const wxFont
&font
);
89 virtual void SetPen( const wxPen
&pen
);
90 virtual void SetBrush( const wxBrush
&brush
);
91 virtual void SetBackground( const wxBrush
&brush
);
92 virtual void SetLogicalFunction( int function
);
93 virtual void SetTextForeground( const wxColour
&col
);
94 virtual void SetTextBackground( const wxColour
&col
);
95 virtual void SetBackgroundMode( int mode
);
96 virtual void SetPalette( const wxPalette
& palette
);
98 virtual void DestroyClippingRegion();
100 // Resolution in pixels per logical inch
101 virtual wxSize
GetPPI() const;
102 virtual int GetDepth() const;
104 // overrriden here for RTL
105 virtual void SetDeviceOrigin( wxCoord x
, wxCoord y
);
106 virtual void SetAxisOrientation( bool xLeftRight
, bool yBottomUp
);
121 wxRegion m_currentClippingRegion
;
122 wxRegion m_paintClippingRegion
;
124 // PangoContext stuff for GTK 2.0
125 PangoContext
*m_context
;
126 PangoLayout
*m_layout
;
127 PangoFontDescription
*m_fontdesc
;
132 virtual void ComputeScaleAndOrigin();
134 virtual GdkWindow
*GetGDKWindow() const { return m_window
; }
137 DECLARE_DYNAMIC_CLASS(wxGTKWindowImplDC
)
140 //-----------------------------------------------------------------------------
142 //-----------------------------------------------------------------------------
145 class WXDLLIMPEXP_CORE wxGTKClientImplDC
: public wxGTKWindowImplDC
147 #define wxGTKClientImplDC wxClientDC
148 class WXDLLIMPEXP_CORE wxClientDC
: public wxWindowDC
152 wxGTKClientImplDC() { }
153 wxGTKClientImplDC( wxWindow
*win
);
156 virtual void DoGetSize(int *width
, int *height
) const;
159 DECLARE_DYNAMIC_CLASS(wxGTKClientImplDC
)
162 //-----------------------------------------------------------------------------
164 //-----------------------------------------------------------------------------
167 class WXDLLIMPEXP_CORE wxGTKPaintImplDC
: public wxGTKClientImplDC
169 #define wxGTKPaintImplDC wxPaintDC
170 class WXDLLIMPEXP_CORE wxPaintDC
: public wxClientDC
174 wxGTKPaintImplDC() { }
175 wxGTKPaintImplDC( wxWindow
*win
);
178 DECLARE_DYNAMIC_CLASS(wxGTKPaintImplDC
)
181 #endif // __GTKDCCLIENTH__