1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/x11/dcclient.h
3 // Purpose: wxClientDC, wxPaintDC and wxWindowDC classes
4 // Author: Julian Smart
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_DCCLIENT_H_
12 #define _WX_DCCLIENT_H_
15 #include "wx/dcclient.h"
16 #include "wx/x11/dc.h"
17 #include "wx/region.h"
19 // -----------------------------------------------------------------------------
21 // -----------------------------------------------------------------------------
23 class WXDLLIMPEXP_FWD_CORE wxWindow
;
25 //-----------------------------------------------------------------------------
27 //-----------------------------------------------------------------------------
29 class WXDLLIMPEXP_CORE wxWindowDCImpl
: public wxX11DCImpl
32 wxWindowDCImpl( wxDC
*owner
);
33 wxWindowDCImpl( wxDC
*owner
, wxWindow
*win
);
35 virtual ~wxWindowDCImpl();
37 virtual bool CanDrawBitmap() const { return true; }
38 virtual bool CanGetTextExtent() const { return true; }
41 virtual void DoGetSize(int *width
, int *height
) const;
42 virtual bool DoFloodFill( wxCoord x
, wxCoord y
, const wxColour
& col
,
43 wxFloodFillStyle style
= wxFLOOD_SURFACE
);
44 virtual bool DoGetPixel( wxCoord x
, wxCoord y
, wxColour
*col
) const;
46 virtual void DoDrawPoint(wxCoord x
, wxCoord y
);
47 virtual void DoDrawLine(wxCoord x1
, wxCoord y1
, wxCoord x2
, wxCoord y2
);
49 virtual void DoDrawIcon( const wxIcon
&icon
, wxCoord x
, wxCoord y
);
50 virtual void DoDrawBitmap( const wxBitmap
&bitmap
, wxCoord x
, wxCoord y
,
51 bool useMask
= false );
53 virtual void DoDrawArc(wxCoord x1
, wxCoord y1
,
54 wxCoord x2
, wxCoord y2
,
55 wxCoord xc
, wxCoord yc
);
56 virtual void DoDrawEllipticArc(wxCoord x
, wxCoord y
, wxCoord w
, wxCoord h
,
57 double sa
, double ea
);
59 virtual void DoDrawRectangle(wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
);
60 virtual void DoDrawRoundedRectangle(wxCoord x
, wxCoord y
,
61 wxCoord width
, wxCoord height
,
63 virtual void DoDrawEllipse(wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
);
65 virtual void DoCrossHair(wxCoord x
, wxCoord y
);
67 virtual void DoDrawText(const wxString
& text
, wxCoord x
, wxCoord y
);
68 virtual void DoDrawRotatedText(const wxString
&text
, wxCoord x
, wxCoord y
, double angle
);
70 virtual bool DoBlit(wxCoord xdest
, wxCoord ydest
, wxCoord width
, wxCoord height
,
71 wxDC
*source
, wxCoord xsrc
, wxCoord ysrc
,
72 wxRasterOperationMode rop
= wxCOPY
, bool useMask
= false,
73 wxCoord xsrcMask
= -1, wxCoord ysrcMask
= -1);
75 virtual void DoSetClippingRegion(wxCoord x
, wxCoord y
,
76 wxCoord width
, wxCoord height
);
77 virtual void DoSetDeviceClippingRegion(const wxRegion
& region
);
79 virtual void DoDrawLines(int n
, const wxPoint points
[],
80 wxCoord xoffset
, wxCoord yoffset
);
81 virtual void DoDrawPolygon(int n
, const wxPoint points
[],
82 wxCoord xoffset
, wxCoord yoffset
,
83 wxPolygonFillMode fillStyle
= wxODDEVEN_RULE
);
89 virtual void SetFont(const wxFont
& font
);
90 virtual void SetPen(const wxPen
& pen
);
91 virtual void SetBrush(const wxBrush
& brush
);
92 virtual void SetBackground(const wxBrush
& brush
);
93 virtual void SetBackgroundMode(int mode
);
94 virtual void SetPalette(const wxPalette
& palette
);
95 virtual void SetLogicalFunction( wxRasterOperationMode function
);
97 virtual void SetTextForeground(const wxColour
& colour
);
98 virtual void SetTextBackground(const wxColour
& colour
);
100 virtual wxCoord
GetCharHeight() const;
101 virtual wxCoord
GetCharWidth() const;
103 virtual int GetDepth() const;
104 virtual wxSize
GetPPI() const;
106 virtual void DestroyClippingRegion();
107 WXWindow
GetX11Window() const { return m_x11window
; }
109 virtual void ComputeScaleAndOrigin();
114 virtual void DoGetTextExtent(const wxString
& string
,
115 wxCoord
*x
, wxCoord
*y
,
116 wxCoord
*descent
= NULL
,
117 wxCoord
*externalLeading
= NULL
,
118 const wxFont
*theFont
= NULL
) const;
122 WXDisplay
*m_display
;
123 WXWindow m_x11window
;
131 wxRegion m_currentClippingRegion
;
132 wxRegion m_paintClippingRegion
;
135 PangoContext
*m_context
;
136 PangoFontDescription
*m_fontdesc
;
143 DECLARE_CLASS(wxWindowDCImpl
)
146 //-----------------------------------------------------------------------------
148 //-----------------------------------------------------------------------------
150 class WXDLLIMPEXP_CORE wxClientDCImpl
: public wxWindowDCImpl
153 wxClientDCImpl( wxDC
*owner
) : wxWindowDCImpl( owner
) { }
154 wxClientDCImpl( wxDC
*owner
, wxWindow
*win
);
157 virtual void DoGetSize(int *width
, int *height
) const;
160 DECLARE_CLASS(wxClientDCImpl
)
163 //-----------------------------------------------------------------------------
165 //-----------------------------------------------------------------------------
167 class WXDLLIMPEXP_CORE wxPaintDCImpl
: public wxClientDCImpl
170 wxPaintDCImpl( wxDC
*owner
) : wxClientDCImpl( owner
) { }
171 wxPaintDCImpl( wxDC
*owner
, wxWindow
*win
);
174 DECLARE_CLASS(wxPaintDCImpl
)