]> git.saurik.com Git - wxWidgets.git/blob - include/wx/stubs/font.h
WXFARPROC prototyped as `typedef int (__stdcall *WXFARPROC)()' (does Borland
[wxWidgets.git] / include / wx / stubs / font.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: font.h
3 // Purpose: wxFont class
4 // Author: AUTHOR
5 // Modified by:
6 // Created: ??/??/98
7 // RCS-ID: $Id$
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_FONT_H_
13 #define _WX_FONT_H_
14
15 #ifdef __GNUG__
16 #pragma interface "font.h"
17 #endif
18
19 #include "wx/gdiobj.h"
20
21 class WXDLLEXPORT wxFont;
22
23 class WXDLLEXPORT wxFontRefData: public wxGDIRefData
24 {
25 friend class WXDLLEXPORT wxFont;
26 public:
27 wxFontRefData();
28 ~wxFontRefData();
29 protected:
30 int m_pointSize;
31 int m_family;
32 int m_fontId;
33 int m_style;
34 int m_weight;
35 bool m_underlined;
36 wxString m_faceName;
37 /* TODO: implementation
38 WXHFONT m_hFont;
39 */
40 };
41
42 #define M_FONTDATA ((wxFontRefData *)m_refData)
43
44 WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
45
46 // Font
47 class WXDLLEXPORT wxFont: public wxGDIObject
48 {
49 DECLARE_DYNAMIC_CLASS(wxFont)
50 public:
51 wxFont();
52 wxFont(int PointSize, int Family, int Style, int Weight, bool underlined = FALSE, const wxString& Face = wxEmptyString);
53 inline wxFont(const wxFont& font) { Ref(font); }
54 inline wxFont(const wxFont* font) { /* UnRef(); */ if (font) Ref(*font); }
55
56 ~wxFont();
57
58 bool Create(int PointSize, int Family, int Style, int Weight, bool underlined = FALSE, const wxString& Face = wxEmptyString);
59
60 virtual bool Ok() const { return (m_refData != NULL) ; }
61
62 inline int GetPointSize() const { return M_FONTDATA->m_pointSize; }
63 inline int GetFamily() const { return M_FONTDATA->m_family; }
64 inline int GetFontId() const { return M_FONTDATA->m_fontId; } /* New font system */
65 inline int GetStyle() const { return M_FONTDATA->m_style; }
66 inline int GetWeight() const { return M_FONTDATA->m_weight; }
67 wxString GetFamilyString() const ;
68 wxString GetFaceName() const ;
69 wxString GetStyleString() const ;
70 wxString GetWeightString() const ;
71 inline bool GetUnderlined() const { return M_FONTDATA->m_underlined; }
72
73 void SetPointSize(int pointSize);
74 void SetFamily(int family);
75 void SetStyle(int style);
76 void SetWeight(int weight);
77 void SetFaceName(const wxString& faceName);
78 void SetUnderlined(bool underlined);
79
80 inline wxFont& operator = (const wxFont& font) { if (*this == font) return (*this); Ref(font); return *this; }
81 inline bool operator == (const wxFont& font) { return m_refData == font.m_refData; }
82 inline bool operator != (const wxFont& font) { return m_refData != font.m_refData; }
83 };
84
85 #endif
86 // _WX_FONT_H_