X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0c14b6c3241d48d9cc36a2fd0aeab0ba330d96de..64ea838d8f4d1853b7d850db93ee565e901d099a:/src/motif/font.cpp diff --git a/src/motif/font.cpp b/src/motif/font.cpp index 53cf1c2a3f..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(), (wxNativeFontInfo *)NULL, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid font") ); if(M_FONTDATA->m_nativeFontInfo.GetXFontName().empty()) GetInternalFont(); @@ -509,8 +505,8 @@ 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() ) - return (wxXFont *)NULL; + if ( !IsOk() ) + return NULL; long intScale = long(scale * 100.0 + 0.5); // key for wxXFont int pointSize = (M_FONTDATA->m_pointSize * 10 * intScale) / 100; @@ -541,7 +537,7 @@ wxXFont* wxFont::GetInternalFont(double scale, WXDisplay* display) const { wxFAIL_MSG( wxT("Could not allocate even a default font -- something is wrong.") ); - return (wxXFont*) NULL; + return NULL; } wxXFont* f = new 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 }