]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/dfb/font.h
wxMessageBox off the main thread lost result code.
[wxWidgets.git] / include / wx / dfb / font.h
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/dfb/font.h
3// Author: Vaclav Slavik
4// Purpose: wxFont declaration
5// Created: 2006-08-08
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
13#include "wx/dfb/dfbptr.h"
14
15wxDFB_DECLARE_INTERFACE(IDirectFBFont);
16
17// ----------------------------------------------------------------------------
18// wxFont
19// ----------------------------------------------------------------------------
20
21class WXDLLIMPEXP_CORE wxFont : public wxFontBase
22{
23public:
24 wxFont() {}
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
40 wxFont(const wxNativeFontInfo& info) { Create(info); }
41#if FUTURE_WXWIN_COMPATIBILITY_3_0
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)
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)
61 {
62 Create(size, family, style, weight, underlined, face, encoding);
63 }
64
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 }
76
77 bool Create(int size,
78 wxFontFamily family,
79 wxFontStyle style,
80 wxFontWeight weight,
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;
88 virtual wxFontStyle GetStyle() const;
89 virtual wxFontWeight GetWeight() const;
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);
97 virtual void SetFamily(wxFontFamily family);
98 virtual void SetStyle(wxFontStyle style);
99 virtual void SetWeight(wxFontWeight weight);
100 virtual bool SetFaceName(const wxString& faceName);
101 virtual void SetUnderlined(bool underlined);
102 virtual void SetEncoding(wxFontEncoding encoding);
103
104 wxDECLARE_COMMON_FONT_METHODS();
105
106 // implementation from now on:
107 wxIDirectFBFontPtr GetDirectFBFont(bool antialiased) const;
108
109protected:
110 virtual wxGDIRefData *CreateGDIRefData() const;
111 virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
112
113 virtual wxFontFamily DoGetFamily() const;
114
115private:
116 DECLARE_DYNAMIC_CLASS(wxFont)
117};
118
119#endif // _WX_DFB_FONT_H_