]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk1/font.h
routing native events first to the wx class and only if skipped call native handler
[wxWidgets.git] / include / wx / gtk1 / font.h
CommitLineData
c801d85f 1/////////////////////////////////////////////////////////////////////////////
8ef94bfc 2// Name: wx/gtk1/font.h
c801d85f
KB
3// Purpose:
4// Author: Robert Roebling
58614078 5// Id: $Id$
371a5b4e 6// Copyright: (c) 1998 Robert Roebling
65571936 7// Licence: wxWindows licence
c801d85f
KB
8/////////////////////////////////////////////////////////////////////////////
9
c801d85f
KB
10#ifndef __GTKFONTH__
11#define __GTKFONTH__
12
c801d85f 13#include "wx/hash.h"
c801d85f 14
0c5d3e1c 15// ----------------------------------------------------------------------------
c801d85f 16// classes
0c5d3e1c 17// ----------------------------------------------------------------------------
c801d85f 18
b5dbe15d
VS
19class WXDLLIMPEXP_FWD_CORE wxDC;
20class WXDLLIMPEXP_FWD_CORE wxPaintDC;
21class WXDLLIMPEXP_FWD_CORE wxWindow;
c801d85f 22
b5dbe15d 23class WXDLLIMPEXP_FWD_CORE wxFont;
c801d85f 24
0c5d3e1c 25// ----------------------------------------------------------------------------
c801d85f 26// wxFont
0c5d3e1c 27// ----------------------------------------------------------------------------
c801d85f 28
20123d49 29class WXDLLIMPEXP_CORE wxFont : public wxFontBase
c801d85f 30{
358fc25c 31public:
0c5d3e1c 32 // ctors and such
8628b7d4 33 wxFont() { }
409d5a58
VZ
34
35 // wxGTK-specific
36 wxFont(const wxString& fontname)
7826e2dd 37 {
409d5a58 38 Create(fontname);
7826e2dd
VZ
39 }
40
41 wxFont(const wxNativeFontInfo& info);
0c5d3e1c 42
0c14b6c3 43#if FUTURE_WXWIN_COMPATIBILITY_3_0
0c5d3e1c
VZ
44 wxFont(int size,
45 int family,
46 int style,
47 int weight,
dabbc6a5 48 bool underlined = false,
0c5d3e1c
VZ
49 const wxString& face = wxEmptyString,
50 wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
51 {
0c14b6c3
FM
52 (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding);
53 }
54#endif
55
56 wxFont(int size,
57 wxFontFamily family,
58 wxFontStyle style,
59 wxFontWeight weight,
60 bool underlined = false,
61 const wxString& face = wxEmptyString,
62 wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
63 {
64 Create(size, family, style, weight, underlined, face, encoding);
0c5d3e1c
VZ
65 }
66
67 bool Create(int size,
0c14b6c3
FM
68 wxFontFamily family,
69 wxFontStyle style,
70 wxFontWeight weight,
dabbc6a5 71 bool underlined = false,
0c5d3e1c 72 const wxString& face = wxEmptyString,
7826e2dd 73 wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
30764ab5 74
0c14b6c3 75
7826e2dd 76 // wxGTK-specific
409d5a58 77 bool Create(const wxString& fontname);
0c5d3e1c 78
d3c7fc99 79 virtual ~wxFont();
0c5d3e1c
VZ
80
81 // implement base class pure virtuals
82 virtual int GetPointSize() const;
0c14b6c3
FM
83 virtual wxFontFamily GetFamily() const;
84 virtual wxFontStyle GetStyle() const;
85 virtual wxFontWeight GetWeight() const;
0c5d3e1c
VZ
86 virtual wxString GetFaceName() const;
87 virtual bool GetUnderlined() const;
88 virtual wxFontEncoding GetEncoding() const;
3bf5a59b 89 virtual const wxNativeFontInfo *GetNativeFontInfo() const;
53f6aab7 90 virtual bool IsFixedWidth() const;
0c5d3e1c
VZ
91
92 virtual void SetPointSize( int pointSize );
0c14b6c3
FM
93 virtual void SetFamily(wxFontFamily family);
94 virtual void SetStyle(wxFontStyle style);
95 virtual void SetWeight(wxFontWeight weight);
85ab460e 96 virtual bool SetFaceName( const wxString& faceName );
0c5d3e1c
VZ
97 virtual void SetUnderlined( bool underlined );
98 virtual void SetEncoding(wxFontEncoding encoding);
99
0c14b6c3
FM
100 WXDECLARE_COMPAT_SETTERS
101
dabbc6a5 102 virtual void SetNoAntiAliasing( bool no = true );
5ac2e80c 103 virtual bool GetNoAntiAliasing() const ;
9045ad9d 104
0c5d3e1c 105 // implementation from now on
0c5d3e1c
VZ
106 void Unshare();
107
108 GdkFont* GetInternalFont(float scale = 1.0) const;
109
0c5d3e1c 110protected:
8f884a0d
VZ
111 virtual wxGDIRefData *CreateGDIRefData() const;
112 virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
113
9045ad9d
VZ
114 virtual void DoSetNativeFontInfo( const wxNativeFontInfo& info );
115
0c5d3e1c
VZ
116private:
117 DECLARE_DYNAMIC_CLASS(wxFont)
c801d85f
KB
118};
119
c801d85f 120#endif // __GTKFONTH__