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_FWD_CORE wxWindow
;
18 //-----------------------------------------------------------------------------
20 //-----------------------------------------------------------------------------
23 class WXDLLIMPEXP_CORE wxGTKWindowImplDC
: public wxGTKImplDC
25 #define wxGTKWindowImplDC wxWindowDC
26 class WXDLLIMPEXP_CORE wxWindowDC
: public wxDC
33 wxGTKWindowImplDC( wxDC
*owner
);
34 wxGTKWindowImplDC( wxDC
*owner
, wxWindow
*win
);
37 wxWindowDC( wxWindow
*win
);
40 virtual ~wxGTKWindowImplDC();
42 virtual bool CanDrawBitmap() const { return true; }
43 virtual bool CanGetTextExtent() const { return true; }
46 virtual void DoGetSize(int *width
, int *height
) const;
47 virtual bool DoFloodFill( wxCoord x
, wxCoord y
, const wxColour
& col
, int style
=wxFLOOD_SURFACE
);
48 virtual bool DoGetPixel( wxCoord x1
, wxCoord y1
, wxColour
*col
) const;
50 virtual void DoDrawLine( wxCoord x1
, wxCoord y1
, wxCoord x2
, wxCoord y2
);
51 virtual void DoCrossHair( wxCoord x
, wxCoord y
);
52 virtual void DoDrawArc( wxCoord x1
, wxCoord y1
, wxCoord x2
, wxCoord y2
,
53 wxCoord xc
, wxCoord yc
);
54 virtual void DoDrawEllipticArc( wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
,
55 double sa
, double ea
);
56 virtual void DoDrawPoint( wxCoord x
, wxCoord y
);
58 virtual void DoDrawLines(int n
, wxPoint points
[],
59 wxCoord xoffset
, wxCoord yoffset
);
60 virtual void DoDrawPolygon(int n
, wxPoint points
[],
61 wxCoord xoffset
, wxCoord yoffset
,
62 int fillStyle
= wxODDEVEN_RULE
);
64 virtual void DoDrawRectangle( wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
);
65 virtual void DoDrawRoundedRectangle( wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
, double radius
= 20.0 );
66 virtual void DoDrawEllipse( wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
);
68 virtual void DoDrawIcon( const wxIcon
&icon
, wxCoord x
, wxCoord y
);
69 virtual void DoDrawBitmap( const wxBitmap
&bitmap
, wxCoord x
, wxCoord y
,
70 bool useMask
= false );
72 virtual bool DoBlit( wxCoord xdest
, wxCoord ydest
, wxCoord width
, wxCoord height
,
73 wxDC
*source
, wxCoord xsrc
, wxCoord ysrc
,
74 int logical_func
= wxCOPY
, bool useMask
= false, wxCoord xsrcMask
= -1, wxCoord ysrcMask
= -1 );
76 virtual void DoDrawText( const wxString
&text
, wxCoord x
, wxCoord y
);
77 virtual void DoDrawRotatedText(const wxString
& text
, wxCoord x
, wxCoord y
,
79 virtual void DoGetTextExtent( const wxString
&string
,
80 wxCoord
*width
, wxCoord
*height
,
81 wxCoord
*descent
= (wxCoord
*) NULL
,
82 wxCoord
*externalLeading
= (wxCoord
*) NULL
,
83 const wxFont
*theFont
= (wxFont
*) NULL
) const;
84 virtual bool DoGetPartialTextExtents(const wxString
& text
, wxArrayInt
& widths
) const;
85 virtual void DoSetClippingRegion( wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
);
86 virtual void DoSetClippingRegionAsRegion( const wxRegion
®ion
);
90 virtual wxCoord
GetCharWidth() const;
91 virtual wxCoord
GetCharHeight() const;
95 virtual void SetFont( const wxFont
&font
);
96 virtual void SetPen( const wxPen
&pen
);
97 virtual void SetBrush( const wxBrush
&brush
);
98 virtual void SetBackground( const wxBrush
&brush
);
99 virtual void SetLogicalFunction( int function
);
100 virtual void SetTextForeground( const wxColour
&col
);
101 virtual void SetTextBackground( const wxColour
&col
);
102 virtual void SetBackgroundMode( int mode
);
103 virtual void SetPalette( const wxPalette
& palette
);
105 virtual void DestroyClippingRegion();
107 // Resolution in pixels per logical inch
108 virtual wxSize
GetPPI() const;
109 virtual int GetDepth() const;
111 // overrriden here for RTL
112 virtual void SetDeviceOrigin( wxCoord x
, wxCoord y
);
113 virtual void SetAxisOrientation( bool xLeftRight
, bool yBottomUp
);
126 wxWindow
*m_owningWindow
;
127 wxRegion m_currentClippingRegion
;
128 wxRegion m_paintClippingRegion
;
130 // PangoContext stuff for GTK 2.0
131 PangoContext
*m_context
;
132 PangoLayout
*m_layout
;
133 PangoFontDescription
*m_fontdesc
;
135 void SetUpDC( bool ismem
= false );
138 virtual void ComputeScaleAndOrigin();
140 virtual GdkWindow
*GetGDKWindow() const { return m_window
; }
143 DECLARE_ABSTRACT_CLASS(wxGTKWindowImplDC
)
146 //-----------------------------------------------------------------------------
148 //-----------------------------------------------------------------------------
151 class WXDLLIMPEXP_CORE wxGTKClientImplDC
: public wxGTKWindowImplDC
153 #define wxGTKClientImplDC wxClientDC
154 class WXDLLIMPEXP_CORE wxClientDC
: public wxWindowDC
160 wxGTKClientImplDC( wxDC
*owner
);
161 wxGTKClientImplDC( wxDC
*owner
, wxWindow
*win
);
164 wxClientDC( wxWindow
*win
);
168 virtual void DoGetSize(int *width
, int *height
) const;
171 DECLARE_ABSTRACT_CLASS(wxGTKClientImplDC
)
174 //-----------------------------------------------------------------------------
176 //-----------------------------------------------------------------------------
179 class WXDLLIMPEXP_CORE wxGTKPaintImplDC
: public wxGTKClientImplDC
181 #define wxGTKPaintImplDC wxPaintDC
182 class WXDLLIMPEXP_CORE wxPaintDC
: public wxClientDC
188 wxGTKPaintImplDC( wxDC
*owner
);
189 wxGTKPaintImplDC( wxDC
*owner
, wxWindow
*win
);
192 wxPaintDC( wxWindow
*win
);
196 DECLARE_ABSTRACT_CLASS(wxGTKPaintImplDC
)
199 #endif // __GTKDCCLIENTH__