]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/dfb/private/fontmgr.h
wxMessageBox off the main thread lost result code.
[wxWidgets.git] / include / wx / dfb / private / fontmgr.h
... / ...
CommitLineData
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
16class wxFileConfig;
17
18class wxFontInstance : public wxFontInstanceBase
19{
20public:
21 wxFontInstance(float ptSize, bool aa, const wxString& filename);
22
23 wxIDirectFBFontPtr GetDirectFBFont() const { return m_font; }
24
25private:
26 wxIDirectFBFontPtr m_font;
27};
28
29class wxFontFace : public wxFontFaceBase
30{
31public:
32 wxFontFace(const wxString& filename) : m_fileName(filename) {}
33
34protected:
35 wxFontInstance *CreateFontInstance(float ptSize, bool aa);
36
37private:
38 wxString m_fileName;
39};
40
41class wxFontBundle : public wxFontBundleBase
42{
43public:
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
56private:
57 wxString m_name;
58 bool m_isFixed;
59};
60
61class wxFontsManager : public wxFontsManagerBase
62{
63public:
64 wxFontsManager() { AddAllFonts(); }
65
66 virtual wxString GetDefaultFacename(wxFontFamily family) const
67 {
68 return m_defaultFacenames[family];
69 }
70
71private:
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
78private:
79 // default facenames
80 wxString m_defaultFacenames[wxFONTFAMILY_MAX];
81};
82
83#endif // _WX_DFB_PRIVATE_FONTMGR_H_