1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk1/dcclient.h
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 #ifndef __GTKDCCLIENTH__
11 #define __GTKDCCLIENTH__
13 #include "wx/gtk1/dc.h"
14 #include "wx/window.h"
16 //-----------------------------------------------------------------------------
18 //-----------------------------------------------------------------------------
20 class WXDLLIMPEXP_FWD_CORE wxWindowDCImpl
;
21 class WXDLLIMPEXP_FWD_CORE wxPaintDCImpl
;
22 class WXDLLIMPEXP_FWD_CORE wxClientDCImpl
;
24 //-----------------------------------------------------------------------------
26 //-----------------------------------------------------------------------------
28 class WXDLLIMPEXP_CORE wxWindowDCImpl
: public wxGTKDCImpl
31 wxWindowDCImpl(wxDC
*owner
);
32 wxWindowDCImpl(wxDC
*owner
, wxWindow
*win
);
34 virtual ~wxWindowDCImpl();
36 virtual bool CanDrawBitmap() const { return true; }
37 virtual bool CanGetTextExtent() const { return true; }
40 virtual void DoGetSize(int *width
, int *height
) const;
41 virtual bool DoFloodFill( wxCoord x
, wxCoord y
, const wxColour
& col
, wxFloodFillStyle style
=wxFLOOD_SURFACE
);
42 virtual bool DoGetPixel( wxCoord x1
, wxCoord y1
, wxColour
*col
) const;
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
,
49 double sa
, double ea
);
50 virtual void DoDrawPoint( wxCoord x
, wxCoord y
);
52 virtual void DoDrawLines(int n
, wxPoint points
[],
53 wxCoord xoffset
, wxCoord yoffset
);
54 virtual void DoDrawPolygon(int n
, wxPoint points
[],
55 wxCoord xoffset
, wxCoord yoffset
,
56 wxPolygonFillMode fillStyle
= wxODDEVEN_RULE
);
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
);
62 virtual void DoDrawIcon( const wxIcon
&icon
, wxCoord x
, wxCoord y
);
63 virtual void DoDrawBitmap( const wxBitmap
&bitmap
, wxCoord x
, wxCoord y
,
64 bool useMask
= false );
66 virtual bool DoBlit( wxCoord xdest
, wxCoord ydest
, wxCoord width
, wxCoord height
,
67 wxDC
*source
, wxCoord xsrc
, wxCoord ysrc
,
68 wxRasterOperationMode logical_func
= wxCOPY
, bool useMask
= false,
69 wxCoord xsrcMask
= -1, wxCoord ysrcMask
= -1 );
71 virtual void DoDrawText( const wxString
&text
, wxCoord x
, wxCoord y
);
72 virtual void DoDrawRotatedText(const wxString
& text
, wxCoord x
, wxCoord y
,
74 virtual void DoGetTextExtent( const wxString
&string
,
75 wxCoord
*width
, wxCoord
*height
,
76 wxCoord
*descent
= NULL
,
77 wxCoord
*externalLeading
= NULL
,
78 const wxFont
*theFont
= NULL
) const;
81 virtual wxCoord
GetCharWidth() const;
82 virtual wxCoord
GetCharHeight() const;
86 virtual void SetFont( const wxFont
&font
);
87 virtual void SetPen( const wxPen
&pen
);
88 virtual void SetBrush( const wxBrush
&brush
);
89 virtual void SetBackground( const wxBrush
&brush
);
90 virtual void SetLogicalFunction( wxRasterOperationMode function
);
91 virtual void SetTextForeground( const wxColour
&col
);
92 virtual void SetTextBackground( const wxColour
&col
);
93 virtual void SetBackgroundMode( int mode
);
94 virtual void SetPalette( const wxPalette
& palette
);
96 virtual void DoSetClippingRegion( wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
);
97 virtual void DestroyClippingRegion();
98 virtual void DoSetDeviceClippingRegion( const wxRegion
®ion
);
100 // Resolution in pixels per logical inch
101 virtual wxSize
GetPPI() const;
102 virtual int GetDepth() const;
104 virtual GdkWindow
* GetGDKWindow() const { return m_window
; }
118 wxRegion m_currentClippingRegion
;
119 wxRegion m_paintClippingRegion
;
123 virtual void ComputeScaleAndOrigin();
125 GdkWindow
*GetWindow() { return m_window
; }
128 DECLARE_DYNAMIC_CLASS(wxWindowDCImpl
)
131 //-----------------------------------------------------------------------------
133 //-----------------------------------------------------------------------------
135 class WXDLLIMPEXP_CORE wxClientDCImpl
: public wxWindowDCImpl
138 wxClientDCImpl(wxDC
*owner
) : wxWindowDCImpl(owner
) { }
139 wxClientDCImpl(wxDC
*owner
, wxWindow
*win
);
142 virtual void DoGetSize(int *width
, int *height
) const;
145 DECLARE_DYNAMIC_CLASS(wxClientDCImpl
)
148 //-----------------------------------------------------------------------------
150 //-----------------------------------------------------------------------------
152 class WXDLLIMPEXP_CORE wxPaintDCImpl
: public wxClientDCImpl
155 wxPaintDCImpl(wxDC
*owner
) : wxClientDCImpl(owner
) { }
156 wxPaintDCImpl(wxDC
*owner
, wxWindow
*win
);
159 DECLARE_DYNAMIC_CLASS(wxPaintDCImpl
)
162 #endif // __GTKDCCLIENTH__