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