X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0b83552acf359689c43d641175f7292391f6a9e6..12bb29f5432174ecbd65549bda832d70d34a98ae:/src/gtk1/font.cpp?ds=sidebyside diff --git a/src/gtk1/font.cpp b/src/gtk1/font.cpp index 9970976eff..16c8e3ae6a 100644 --- a/src/gtk1/font.cpp +++ b/src/gtk1/font.cpp @@ -23,11 +23,12 @@ #ifndef WX_PRECOMP #include "wx/log.h" #include "wx/settings.h" - #include "wx/cmndata.h" #include "wx/gdicmn.h" + #include "wx/crt.h" #endif #include "wx/fontutil.h" +#include "wx/encinfo.h" #include "wx/utils.h" #include "wx/tokenzr.h" @@ -450,8 +451,6 @@ void wxFontRefData::SetNativeFontInfo(const wxNativeFontInfo& info) // wxFont creation // ---------------------------------------------------------------------------- -IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject) - wxFont::wxFont(const wxNativeFontInfo& info) { (void) Create(info.GetXFontName()); @@ -522,49 +521,47 @@ wxGDIRefData *wxFont::CloneGDIRefData(const wxGDIRefData *data) const int wxFont::GetPointSize() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid font") ); return M_FONTDATA->m_pointSize; } wxString wxFont::GetFaceName() const { - wxCHECK_MSG( Ok(), wxEmptyString, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxEmptyString, wxT("invalid font") ); return M_FONTDATA->m_faceName; } -wxFontFamily wxFont::GetFamily() const +wxFontFamily wxFont::DoGetFamily() const { - wxCHECK_MSG( Ok(), wxFONTFAMILY_MAX, wxT("invalid font") ); - return M_FONTDATA->m_family; } wxFontStyle wxFont::GetStyle() const { - wxCHECK_MSG( Ok(), wxFONTSTYLE_MAX, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxFONTSTYLE_MAX, wxT("invalid font") ); return M_FONTDATA->m_style; } wxFontWeight wxFont::GetWeight() const { - wxCHECK_MSG( Ok(), wxFONTWEIGHT_MAX, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxFONTWEIGHT_MAX, wxT("invalid font") ); return M_FONTDATA->m_weight; } bool wxFont::GetUnderlined() const { - wxCHECK_MSG( Ok(), false, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), false, wxT("invalid font") ); return M_FONTDATA->m_underlined; } wxFontEncoding wxFont::GetEncoding() const { - wxCHECK_MSG( Ok(), wxFONTENCODING_DEFAULT, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxFONTENCODING_DEFAULT, wxT("invalid font") ); // m_encoding is unused in wxGTK2, return encoding that the user set. return M_FONTDATA->m_encoding; @@ -572,7 +569,7 @@ wxFontEncoding wxFont::GetEncoding() const const wxNativeFontInfo *wxFont::GetNativeFontInfo() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid font") ); if ( !M_FONTDATA->HasNativeFont() ) { @@ -587,7 +584,7 @@ const wxNativeFontInfo *wxFont::GetNativeFontInfo() const bool wxFont::IsFixedWidth() const { - wxCHECK_MSG( Ok(), false, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), false, wxT("invalid font") ); if ( M_FONTDATA->HasNativeFont() ) { @@ -700,7 +697,7 @@ GdkFont *wxFont::GetInternalFont( float scale ) const { GdkFont *font = NULL; - wxCHECK_MSG( Ok(), font, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), font, wxT("invalid font") ); long int_scale = long(scale * 100.0 + 0.5); // key for fontlist int point_scale = (int)((M_FONTDATA->m_pointSize * 10 * int_scale) / 100);