]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/font.h
flipped accessor conforming to plain c++ impl
[wxWidgets.git] / include / wx / gtk / font.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: font.h
3 // Purpose:
4 // Author: Robert Roebling
5 // Id: $Id$
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 #ifndef _WX_GTK_FONT_H_
11 #define _WX_GTK_FONT_H_
12
13 // ----------------------------------------------------------------------------
14 // wxFont
15 // ----------------------------------------------------------------------------
16
17 class WXDLLIMPEXP_CORE wxFont : public wxFontBase
18 {
19 public:
20 wxFont() { }
21
22 // wxGTK-specific
23 wxFont(const wxString& fontname)
24 {
25 Create(fontname);
26 }
27
28 wxFont(const wxNativeFontInfo& info);
29
30 #if FUTURE_WXWIN_COMPATIBILITY_3_0
31 wxFont(int size,
32 int family,
33 int style,
34 int weight,
35 bool underlined = false,
36 const wxString& face = wxEmptyString,
37 wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
38 {
39 (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding);
40 }
41 #endif
42
43 wxFont(int size,
44 wxFontFamily family,
45 wxFontStyle style,
46 wxFontWeight weight,
47 bool underlined = false,
48 const wxString& face = wxEmptyString,
49 wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
50 {
51 Create(size, family, style, weight, underlined, face, encoding);
52 }
53
54 bool Create(int size,
55 wxFontFamily family,
56 wxFontStyle style,
57 wxFontWeight weight,
58 bool underlined = false,
59 const wxString& face = wxEmptyString,
60 wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
61
62 // wxGTK-specific
63 bool Create(const wxString& fontname);
64
65 virtual ~wxFont();
66
67 // implement base class pure virtuals
68 virtual int GetPointSize() const;
69 virtual wxFontFamily GetFamily() const;
70 virtual wxFontStyle GetStyle() const;
71 virtual wxFontWeight GetWeight() const;
72 virtual wxString GetFaceName() const;
73 virtual bool GetUnderlined() const;
74 virtual wxFontEncoding GetEncoding() const;
75 virtual const wxNativeFontInfo *GetNativeFontInfo() const;
76 virtual bool IsFixedWidth() const;
77
78 virtual void SetPointSize( int pointSize );
79 virtual void SetFamily(wxFontFamily family);
80 virtual void SetStyle(wxFontStyle style);
81 virtual void SetWeight(wxFontWeight weight);
82 virtual bool SetFaceName( const wxString& faceName );
83 virtual void SetUnderlined( bool underlined );
84 virtual void SetEncoding(wxFontEncoding encoding);
85
86 WXDECLARE_COMPAT_SETTERS
87
88 virtual void SetNoAntiAliasing( bool no = true );
89 virtual bool GetNoAntiAliasing() const ;
90
91 // implementation from now on
92 void Unshare();
93
94 // no data :-)
95
96 protected:
97 virtual void DoSetNativeFontInfo( const wxNativeFontInfo& info );
98
99 // common part of all ctors
100 void Init();
101
102 virtual wxGDIRefData* CreateGDIRefData() const;
103 virtual wxGDIRefData* CloneGDIRefData(const wxGDIRefData* data) const;
104
105 private:
106 DECLARE_DYNAMIC_CLASS(wxFont)
107 };
108
109 #endif // _WX_GTK_FONT_H_