]>
Commit | Line | Data |
---|---|---|
b3c86150 VS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/dfb/font.h | |
3 | // Author: Vaclav Slavik | |
4 | // Purpose: wxFont declaration | |
5 | // Created: 2006-08-08 | |
b3c86150 VS |
6 | // Copyright: (c) 2006 REA Elektronik GmbH |
7 | // Licence: wxWindows licence | |
8 | ///////////////////////////////////////////////////////////////////////////// | |
9 | ||
10 | #ifndef _WX_DFB_FONT_H_ | |
11 | #define _WX_DFB_FONT_H_ | |
12 | ||
52c8d32a | 13 | #include "wx/dfb/dfbptr.h" |
b3c86150 VS |
14 | |
15 | wxDFB_DECLARE_INTERFACE(IDirectFBFont); | |
16 | ||
17 | // ---------------------------------------------------------------------------- | |
18 | // wxFont | |
19 | // ---------------------------------------------------------------------------- | |
20 | ||
21 | class WXDLLIMPEXP_CORE wxFont : public wxFontBase | |
22 | { | |
23 | public: | |
24 | wxFont() {} | |
b960795e VZ |
25 | |
26 | wxFont(const wxFontInfo& info) | |
27 | { | |
28 | Create(info.GetPointSize(), | |
29 | info.GetFamily(), | |
30 | info.GetStyle(), | |
31 | info.GetWeight(), | |
32 | info.IsUnderlined(), | |
33 | info.GetFaceName(), | |
34 | info.GetEncoding()); | |
35 | ||
36 | if ( info.IsUsingSizeInPixels() ) | |
37 | SetPixelSize(info.GetPixelSize()); | |
38 | } | |
39 | ||
b3c86150 | 40 | wxFont(const wxNativeFontInfo& info) { Create(info); } |
0c14b6c3 | 41 | #if FUTURE_WXWIN_COMPATIBILITY_3_0 |
b3c86150 VS |
42 | wxFont(int size, |
43 | int family, | |
44 | int style, | |
45 | int weight, | |
46 | bool underlined = false, | |
47 | const wxString& face = wxEmptyString, | |
48 | wxFontEncoding encoding = wxFONTENCODING_DEFAULT) | |
0c14b6c3 FM |
49 | { |
50 | (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding); | |
51 | } | |
52 | #endif | |
53 | ||
54 | wxFont(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) | |
b3c86150 VS |
61 | { |
62 | Create(size, family, style, weight, underlined, face, encoding); | |
63 | } | |
03647350 | 64 | |
b5791cc7 FM |
65 | wxFont(const wxSize& pixelSize, |
66 | wxFontFamily family, | |
67 | wxFontStyle style, | |
68 | wxFontWeight weight, | |
69 | bool underlined = false, | |
70 | const wxString& face = wxEmptyString, | |
71 | wxFontEncoding encoding = wxFONTENCODING_DEFAULT) | |
72 | { | |
73 | Create(10, family, style, weight, underlined, face, encoding); | |
74 | SetPixelSize(pixelSize); | |
75 | } | |
03647350 | 76 | |
b3c86150 | 77 | bool Create(int size, |
0c14b6c3 FM |
78 | wxFontFamily family, |
79 | wxFontStyle style, | |
80 | wxFontWeight weight, | |
b3c86150 VS |
81 | bool underlined = false, |
82 | const wxString& face = wxEmptyString, | |
83 | wxFontEncoding encoding = wxFONTENCODING_DEFAULT); | |
84 | bool Create(const wxNativeFontInfo& fontinfo); | |
85 | ||
86 | // implement base class pure virtuals | |
87 | virtual int GetPointSize() const; | |
0c14b6c3 FM |
88 | virtual wxFontStyle GetStyle() const; |
89 | virtual wxFontWeight GetWeight() const; | |
b3c86150 VS |
90 | virtual wxString GetFaceName() const; |
91 | virtual bool GetUnderlined() const; | |
92 | virtual wxFontEncoding GetEncoding() const; | |
93 | virtual bool IsFixedWidth() const; | |
94 | virtual const wxNativeFontInfo *GetNativeFontInfo() const; | |
95 | ||
96 | virtual void SetPointSize(int pointSize); | |
0c14b6c3 FM |
97 | virtual void SetFamily(wxFontFamily family); |
98 | virtual void SetStyle(wxFontStyle style); | |
99 | virtual void SetWeight(wxFontWeight weight); | |
b3c86150 VS |
100 | virtual bool SetFaceName(const wxString& faceName); |
101 | virtual void SetUnderlined(bool underlined); | |
102 | virtual void SetEncoding(wxFontEncoding encoding); | |
103 | ||
f76c0758 | 104 | wxDECLARE_COMMON_FONT_METHODS(); |
0c14b6c3 | 105 | |
b3c86150 | 106 | // implementation from now on: |
d7ae4a62 | 107 | wxIDirectFBFontPtr GetDirectFBFont(bool antialiased) const; |
b3c86150 VS |
108 | |
109 | protected: | |
8f884a0d VZ |
110 | virtual wxGDIRefData *CreateGDIRefData() const; |
111 | virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; | |
b3c86150 | 112 | |
59b7da02 VZ |
113 | virtual wxFontFamily DoGetFamily() const; |
114 | ||
b3c86150 VS |
115 | private: |
116 | DECLARE_DYNAMIC_CLASS(wxFont) | |
117 | }; | |
118 | ||
119 | #endif // _WX_DFB_FONT_H_ |