]> git.saurik.com Git - wxWidgets.git/blob - include/wx/mgl/font.h
Applied patch [ 1381895 ] remove circular include dependendcy in wxchar.h
[wxWidgets.git] / include / wx / mgl / font.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: font.h
3 // Author: Vaclav Slavik
4 // Id: $Id$
5 // Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com)
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
8
9 #ifndef __WX_FONT_H__
10 #define __WX_FONT_H__
11
12 #include "wx/hash.h"
13
14 // ----------------------------------------------------------------------------
15 // classes
16 // ----------------------------------------------------------------------------
17
18 class WXDLLEXPORT wxDC;
19 class WXDLLEXPORT wxPaintDC;
20 class WXDLLEXPORT wxWindow;
21 class WXDLLEXPORT wxFont;
22
23 struct font_t;
24
25 // ----------------------------------------------------------------------------
26 // wxFont
27 // ----------------------------------------------------------------------------
28
29 class WXDLLEXPORT wxFont : public wxFontBase
30 {
31 public:
32 // ctors and such
33 wxFont() { Init(); }
34 wxFont(const wxFont& font) { Init(); Ref(font); }
35
36 wxFont(const wxNativeFontInfo& info)
37 {
38 Init();
39
40 (void)Create(info);
41 }
42
43 wxFont(int size,
44 int family,
45 int style,
46 int weight,
47 bool underlined = FALSE,
48 const wxString& face = wxEmptyString,
49 wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
50 {
51 Init();
52
53 (void)Create(size, family, style, weight, underlined, face, encoding);
54 }
55
56 bool Create(int size,
57 int family,
58 int style,
59 int weight,
60 bool underlined = FALSE,
61 const wxString& face = wxEmptyString,
62 wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
63
64 bool Create(const wxNativeFontInfo& fontinfo);
65
66 ~wxFont() {}
67
68 // assignment
69 wxFont& operator=(const wxFont& font);
70
71 // implement base class pure virtuals
72 virtual int GetPointSize() const;
73 virtual int GetFamily() const;
74 virtual int GetStyle() const;
75 virtual int GetWeight() const;
76 virtual wxString GetFaceName() const;
77 virtual bool GetUnderlined() const;
78 virtual wxFontEncoding GetEncoding() const;
79 virtual bool IsFixedWidth() const;
80 virtual const wxNativeFontInfo *GetNativeFontInfo() const;
81
82 virtual void SetPointSize(int pointSize);
83 virtual void SetFamily(int family);
84 virtual void SetStyle(int style);
85 virtual void SetWeight(int weight);
86 virtual void SetFaceName(const wxString& faceName);
87 virtual void SetUnderlined(bool underlined);
88 virtual void SetEncoding(wxFontEncoding encoding);
89
90 struct font_t *GetMGLfont_t(float scale, bool antialiased);
91
92 protected:
93 // common part of all ctors
94 void Init() {}
95
96 // ref counting code
97 virtual wxObjectRefData *CreateRefData() const;
98 virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
99
100 private:
101 DECLARE_DYNAMIC_CLASS(wxFont)
102 };
103
104 #endif // __WX_FONT_H__