]> git.saurik.com Git - wxWidgets.git/blob - include/wx/dfb/private/fontmgr.h
Fix wxPropertyGrid::GetPropertyRect when the last item is collapsed.
[wxWidgets.git] / include / wx / dfb / private / fontmgr.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/dfb/private/fontmgr.h
3 // Purpose: font management for wxDFB
4 // Author: Vaclav Slavik
5 // Created: 2006-11-18
6 // Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com)
7 // (c) 2006 REA Elektronik GmbH
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_DFB_PRIVATE_FONTMGR_H_
12 #define _WX_DFB_PRIVATE_FONTMGR_H_
13
14 #include "wx/dfb/wrapdfb.h"
15
16 class wxFileConfig;
17
18 class wxFontInstance : public wxFontInstanceBase
19 {
20 public:
21 wxFontInstance(float ptSize, bool aa, const wxString& filename);
22
23 wxIDirectFBFontPtr GetDirectFBFont() const { return m_font; }
24
25 private:
26 wxIDirectFBFontPtr m_font;
27 };
28
29 class wxFontFace : public wxFontFaceBase
30 {
31 public:
32 wxFontFace(const wxString& filename) : m_fileName(filename) {}
33
34 protected:
35 wxFontInstance *CreateFontInstance(float ptSize, bool aa);
36
37 private:
38 wxString m_fileName;
39 };
40
41 class wxFontBundle : public wxFontBundleBase
42 {
43 public:
44 wxFontBundle(const wxString& name,
45 const wxString& fileRegular,
46 const wxString& fileBold,
47 const wxString& fileItalic,
48 const wxString& fileBoldItalic,
49 bool isFixed);
50
51 /// Returns name of the family
52 virtual wxString GetName() const { return m_name; }
53
54 virtual bool IsFixed() const { return m_isFixed; }
55
56 private:
57 wxString m_name;
58 bool m_isFixed;
59 };
60
61 class wxFontsManager : public wxFontsManagerBase
62 {
63 public:
64 wxFontsManager() { AddAllFonts(); }
65
66 virtual wxString GetDefaultFacename(wxFontFamily family) const
67 {
68 return m_defaultFacenames[family];
69 }
70
71 private:
72 // adds all fonts using AddBundle()
73 void AddAllFonts();
74 void AddFontsFromDir(const wxString& indexFile);
75 void AddFont(const wxString& dir, const wxString& name, wxFileConfig& cfg);
76 void SetDefaultFonts(wxFileConfig& cfg);
77
78 private:
79 // default facenames
80 wxString m_defaultFacenames[wxFONTFAMILY_MAX];
81 };
82
83 #endif // _WX_DFB_PRIVATE_FONTMGR_H_