X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d3b9f782ef3949f583e8ac53795d36787f044fc3..ee6a122fa3446c7aa020e7fdfeb85584d92309d1:/src/motif/font.cpp diff --git a/src/motif/font.cpp b/src/motif/font.cpp index df62b908ba..a07b6fa920 100644 --- a/src/motif/font.cpp +++ b/src/motif/font.cpp @@ -42,8 +42,6 @@ #include "wx/tokenzr.h" #include "wx/motif/private.h" -IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject) - // ---------------------------------------------------------------------------- // private classes // ---------------------------------------------------------------------------- @@ -311,7 +309,7 @@ bool wxFont::Create(const wxString& fontname, wxFontEncoding enc) wxString registry = tn.GetNextToken().MakeUpper(), encoding = tn.GetNextToken().MakeUpper(); - if ( registry == _T("ISO8859") ) + if ( registry == wxT("ISO8859") ) { int cp; if ( wxSscanf(encoding, wxT("%d"), &cp) == 1 ) @@ -320,7 +318,7 @@ bool wxFont::Create(const wxString& fontname, wxFontEncoding enc) (wxFontEncoding)(wxFONTENCODING_ISO8859_1 + cp - 1); } } - else if ( registry == _T("MICROSOFT") ) + else if ( registry == wxT("MICROSOFT") ) { int cp; if ( wxSscanf(encoding, wxT("cp125%d"), &cp) == 1 ) @@ -329,7 +327,7 @@ bool wxFont::Create(const wxString& fontname, wxFontEncoding enc) (wxFontEncoding)(wxFONTENCODING_CP1250 + cp); } } - else if ( registry == _T("KOI8") ) + else if ( registry == wxT("KOI8") ) { M_FONTDATA->m_encoding = wxFONTENCODING_KOI8; } @@ -443,56 +441,54 @@ void wxFont::DoSetNativeFontInfo(const wxNativeFontInfo& info) 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") ); return M_FONTDATA->m_encoding; } const wxNativeFontInfo *wxFont::GetNativeFontInfo() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid font") ); if(M_FONTDATA->m_nativeFontInfo.GetXFontName().empty()) GetInternalFont(); @@ -509,7 +505,7 @@ const wxNativeFontInfo *wxFont::GetNativeFontInfo() const // font to list in the private data for future reference. wxXFont* wxFont::GetInternalFont(double scale, WXDisplay* display) const { - if ( !Ok() ) + if ( !IsOk() ) return NULL; long intScale = long(scale * 100.0 + 0.5); // key for wxXFont @@ -621,18 +617,18 @@ WXRenderTable wxFont::GetRenderTable(WXDisplay* display) const WXFontType wxFont::GetFontType(WXDisplay* display) const { #if wxMOTIF_USE_RENDER_TABLE - return Ok() ? GetRenderTable(display) : NULL; + return IsOk() ? GetRenderTable(display) : NULL; #else - return Ok() ? GetFontList(1.0, display) : NULL; + return IsOk() ? GetFontList(1.0, display) : NULL; #endif } WXFontType wxFont::GetFontTypeC(WXDisplay* display) const { #if wxMOTIF_USE_RENDER_TABLE - return Ok() ? GetRenderTable(display) : NULL; + return IsOk() ? GetRenderTable(display) : NULL; #else - return Ok() ? XmFontListCopy( (XmFontList)GetFontList(1.0, display) ) : NULL; + return IsOk() ? XmFontListCopy( (XmFontList)GetFontList(1.0, display) ) : NULL; #endif }