]>
git.saurik.com Git - wxWidgets.git/blob - src/qt/font.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxFont class
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "font.h"
18 #if !USE_SHARED_LIBRARIES
19 IMPLEMENT_DYNAMIC_CLASS(wxFont
, wxGDIObject
)
22 wxFontRefData::wxFontRefData()
36 wxFontRefData::wxFontRefData(const wxFontRefData
& data
)
38 m_style
= data
.m_style
;
39 m_pointSize
= data
.m_pointSize
;
40 m_family
= data
.m_family
;
41 m_style
= data
.m_style
;
42 m_weight
= data
.m_weight
;
43 m_underlined
= data
.m_underlined
;
44 m_faceName
= data
.m_faceName
;
50 wxFontRefData::~wxFontRefData()
52 // TODO: delete font data
58 wxTheFontList
->Append(this);
61 wxFont::wxFont(int pointSize
, int family
, int style
, int weight
, bool underlined
, const wxString
& faceName
)
63 Create(pointSize
, family
, style
, weight
, underlined
, faceName
);
66 wxTheFontList
->Append(this);
69 bool wxFont::Create(int pointSize
, int family
, int style
, int weight
, bool underlined
, const wxString
& faceName
)
72 m_refData
= new wxFontRefData
;
74 M_FONTDATA
->m_family
= family
;
75 M_FONTDATA
->m_style
= style
;
76 M_FONTDATA
->m_weight
= weight
;
77 M_FONTDATA
->m_pointSize
= pointSize
;
78 M_FONTDATA
->m_underlined
= underlined
;
79 M_FONTDATA
->m_faceName
= faceName
;
89 wxTheFontList
->DeleteObject(this);
92 bool wxFont::RealizeResource()
94 // TODO: create the font (if there is a native font object)
98 void wxFont::Unshare()
100 // Don't change shared data
103 m_refData
= new wxFontRefData();
107 wxFontRefData
* ref
= new wxFontRefData(*(wxFontRefData
*)m_refData
);
113 void wxFont::SetPointSize(int pointSize
)
117 M_FONTDATA
->m_pointSize
= pointSize
;
122 void wxFont::SetFamily(int family
)
126 M_FONTDATA
->m_family
= family
;
131 void wxFont::SetStyle(int style
)
135 M_FONTDATA
->m_style
= style
;
140 void wxFont::SetWeight(int weight
)
144 M_FONTDATA
->m_weight
= weight
;
149 void wxFont::SetFaceName(const wxString
& faceName
)
153 M_FONTDATA
->m_faceName
= faceName
;
158 void wxFont::SetUnderlined(bool underlined
)
162 M_FONTDATA
->m_underlined
= underlined
;
167 wxString
wxFont::GetFamilyString() const
173 fam
= "wxDECORATIVE";
197 /* New font system */
198 wxString
wxFont::GetFaceName() const
202 str
= M_FONTDATA
->m_faceName
;
206 wxString
wxFont::GetStyleString() const
224 wxString
wxFont::GetWeightString() const