1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/private/textmeasure.h
3 // Purpose: wxGTK-specific declaration of wxTextMeasure class
4 // Author: Manuel Martin
6 // Copyright: (c) 1997-2012 wxWidgets team
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_GTK_PRIVATE_TEXTMEASURE_H_
11 #define _WX_GTK_PRIVATE_TEXTMEASURE_H_
13 // ----------------------------------------------------------------------------
15 // ----------------------------------------------------------------------------
17 class WXDLLIMPEXP_FWD_CORE wxWindowDCImpl
;
19 class wxTextMeasure
: public wxTextMeasureBase
22 wxTextMeasure(const wxDC
*dc
, const wxFont
*font
)
23 : wxTextMeasureBase(dc
, font
)
28 wxTextMeasure(const wxWindow
*win
, const wxFont
*font
)
29 : wxTextMeasureBase(win
, font
)
35 // Common part of both ctors.
38 virtual void BeginMeasuring();
39 virtual void EndMeasuring();
41 virtual void DoGetTextExtent(const wxString
& string
,
44 wxCoord
*descent
= NULL
,
45 wxCoord
*externalLeading
= NULL
);
47 virtual bool DoGetPartialTextExtents(const wxString
& text
,
52 // This class is only used for DC text measuring with GTK+ 2 as GTK+ 3 uses
53 // Cairo and not Pango for this. However it's still used even with GTK+ 3
54 // for window text measuring, so the context and the layout are still
57 wxWindowDCImpl
*m_wdc
;
59 PangoContext
*m_context
;
60 PangoLayout
*m_layout
;
62 wxDECLARE_NO_COPY_CLASS(wxTextMeasure
);
65 #endif // _WX_GTK_PRIVATE_TEXTMEASURE_H_