X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d04f9b8e31da4fc851fe6659234064b5bd2d21e9..e28cc3ca0aa9bb1c7e9613c447ca94b13a8bc858:/src/dfb/font.cpp?ds=sidebyside diff --git a/src/dfb/font.cpp b/src/dfb/font.cpp index 4bf8087c5b..4311923e67 100644 --- a/src/dfb/font.cpp +++ b/src/dfb/font.cpp @@ -39,8 +39,6 @@ typedef wxFontMgrFontRefData wxFontRefData; // wxFont // ---------------------------------------------------------------------------- -IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject) - bool wxFont::Create(const wxNativeFontInfo& info) { return Create(info.pointSize, info.family, info.style, info.weight, @@ -48,9 +46,9 @@ bool wxFont::Create(const wxNativeFontInfo& info) } bool wxFont::Create(int pointSize, - int family, - int style, - int weight, + wxFontFamily family, + wxFontStyle style, + wxFontWeight weight, bool underlined, const wxString& face, wxFontEncoding encoding) @@ -60,12 +58,12 @@ bool wxFont::Create(int pointSize, return true; } -wxObjectRefData *wxFont::CreateRefData() const +wxGDIRefData *wxFont::CreateGDIRefData() const { return new wxFontRefData; } -wxObjectRefData *wxFont::CloneRefData(const wxObjectRefData *data) const +wxGDIRefData *wxFont::CloneGDIRefData(const wxGDIRefData *data) const { return new wxFontRefData(*(wxFontRefData *)data); } @@ -77,7 +75,7 @@ wxObjectRefData *wxFont::CloneRefData(const wxObjectRefData *data) const wxIDirectFBFontPtr wxFont::GetDirectFBFont(bool antialiased) const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid font") ); // we don't support DC scaling yet, so use scale=1 wxFontInstance *i = M_FONTDATA->GetFontInstance(1.0, antialiased); @@ -86,42 +84,40 @@ wxIDirectFBFontPtr wxFont::GetDirectFBFont(bool antialiased) const int wxFont::GetPointSize() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid font") ); return M_FONTDATA->GetPointSize(); } wxString wxFont::GetFaceName() const { - wxCHECK_MSG( Ok(), wxEmptyString, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxEmptyString, wxT("invalid font") ); return M_FONTDATA->GetFaceName(); } -int wxFont::GetFamily() const +wxFontFamily wxFont::DoGetFamily() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid font") ); - return M_FONTDATA->GetFamily(); } -int wxFont::GetStyle() const +wxFontStyle wxFont::GetStyle() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxFONTSTYLE_MAX, wxT("invalid font") ); return M_FONTDATA->GetStyle(); } -int wxFont::GetWeight() const +wxFontWeight wxFont::GetWeight() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxFONTWEIGHT_MAX, wxT("invalid font") ); return M_FONTDATA->GetWeight(); } bool wxFont::GetUnderlined() const { - wxCHECK_MSG( Ok(), false, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), false, wxT("invalid font") ); return M_FONTDATA->GetUnderlined(); } @@ -129,32 +125,25 @@ bool wxFont::GetUnderlined() const wxFontEncoding wxFont::GetEncoding() const { - wxCHECK_MSG( Ok(), wxFONTENCODING_DEFAULT, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxFONTENCODING_DEFAULT, wxT("invalid font") ); return M_FONTDATA->GetEncoding(); } bool wxFont::IsFixedWidth() const { - wxCHECK_MSG( Ok(), false, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), false, wxT("invalid font") ); return M_FONTDATA->IsFixedWidth(); } const wxNativeFontInfo *wxFont::GetNativeFontInfo() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid font") ); return M_FONTDATA->GetNativeFontInfo(); } -bool wxFont::GetNoAntiAliasing() const -{ - wxCHECK_MSG( Ok(), false, wxT("invalid font") ); - - return M_FONTDATA->GetNoAntiAliasing(); -} - // ---------------------------------------------------------------------------- // change font attributes // ---------------------------------------------------------------------------- @@ -165,19 +154,19 @@ void wxFont::SetPointSize(int pointSize) M_FONTDATA->SetPointSize(pointSize); } -void wxFont::SetFamily(int family) +void wxFont::SetFamily(wxFontFamily family) { AllocExclusive(); M_FONTDATA->SetFamily(family); } -void wxFont::SetStyle(int style) +void wxFont::SetStyle(wxFontStyle style) { AllocExclusive(); M_FONTDATA->SetStyle(style); } -void wxFont::SetWeight(int weight) +void wxFont::SetWeight(wxFontWeight weight) { AllocExclusive(); M_FONTDATA->SetWeight(weight); @@ -202,8 +191,3 @@ void wxFont::SetEncoding(wxFontEncoding encoding) M_FONTDATA->SetEncoding(encoding); } -void wxFont::SetNoAntiAliasing(bool no) -{ - AllocExclusive(); - M_FONTDATA->SetNoAntiAliasing(no); -}