1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk1/dcclient.h
4 // Author: Robert Roebling
5 // Copyright: (c) 1998 Robert Roebling
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
9 #ifndef __GTKDCCLIENTH__
10 #define __GTKDCCLIENTH__
12 #include "wx/gtk1/dc.h"
13 #include "wx/window.h"
15 //-----------------------------------------------------------------------------
17 //-----------------------------------------------------------------------------
19 class WXDLLIMPEXP_FWD_CORE wxWindowDCImpl
;
20 class WXDLLIMPEXP_FWD_CORE wxPaintDCImpl
;
21 class WXDLLIMPEXP_FWD_CORE wxClientDCImpl
;
23 //-----------------------------------------------------------------------------
25 //-----------------------------------------------------------------------------
27 class WXDLLIMPEXP_CORE wxWindowDCImpl
: public wxGTKDCImpl
30 wxWindowDCImpl(wxDC
*owner
);
31 wxWindowDCImpl(wxDC
*owner
, wxWindow
*win
);
33 virtual ~wxWindowDCImpl();
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
, wxFloodFillStyle 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
, const wxPoint points
[],
52 wxCoord xoffset
, wxCoord yoffset
);
53 virtual void DoDrawPolygon(int n
, const wxPoint points
[],
54 wxCoord xoffset
, wxCoord yoffset
,
55 wxPolygonFillMode 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 wxRasterOperationMode logical_func
= wxCOPY
, bool useMask
= false,
68 wxCoord xsrcMask
= -1, wxCoord ysrcMask
= -1 );
70 virtual void DoDrawText( const wxString
&text
, wxCoord x
, wxCoord y
);
71 virtual void DoDrawRotatedText(const wxString
& text
, wxCoord x
, wxCoord y
,
73 virtual void DoGetTextExtent( const wxString
&string
,
74 wxCoord
*width
, wxCoord
*height
,
75 wxCoord
*descent
= NULL
,
76 wxCoord
*externalLeading
= NULL
,
77 const wxFont
*theFont
= NULL
) const;
80 virtual wxCoord
GetCharWidth() const;
81 virtual wxCoord
GetCharHeight() const;
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
);
89 virtual void SetLogicalFunction( wxRasterOperationMode function
);
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
);
95 virtual void DoSetClippingRegion( wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
);
96 virtual void DestroyClippingRegion();
97 virtual void DoSetDeviceClippingRegion( const wxRegion
®ion
);
99 // Resolution in pixels per logical inch
100 virtual wxSize
GetPPI() const;
101 virtual int GetDepth() const;
103 virtual GdkWindow
* GetGDKWindow() const { return m_window
; }
117 wxRegion m_currentClippingRegion
;
118 wxRegion m_paintClippingRegion
;
122 virtual void ComputeScaleAndOrigin();
124 GdkWindow
*GetWindow() { return m_window
; }
127 DECLARE_DYNAMIC_CLASS(wxWindowDCImpl
)
130 //-----------------------------------------------------------------------------
132 //-----------------------------------------------------------------------------
134 class WXDLLIMPEXP_CORE wxClientDCImpl
: public wxWindowDCImpl
137 wxClientDCImpl(wxDC
*owner
) : wxWindowDCImpl(owner
) { }
138 wxClientDCImpl(wxDC
*owner
, wxWindow
*win
);
141 virtual void DoGetSize(int *width
, int *height
) const;
144 DECLARE_DYNAMIC_CLASS(wxClientDCImpl
)
147 //-----------------------------------------------------------------------------
149 //-----------------------------------------------------------------------------
151 class WXDLLIMPEXP_CORE wxPaintDCImpl
: public wxClientDCImpl
154 wxPaintDCImpl(wxDC
*owner
) : wxClientDCImpl(owner
) { }
155 wxPaintDCImpl(wxDC
*owner
, wxWindow
*win
);
158 DECLARE_DYNAMIC_CLASS(wxPaintDCImpl
)
161 #endif // __GTKDCCLIENTH__