#include "wx/tokenzr.h"
#include "wx/motif/private.h"
-IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
-
// ----------------------------------------------------------------------------
// private classes
// ----------------------------------------------------------------------------
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 )
(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 )
(wxFontEncoding)(wxFONTENCODING_CP1250 + cp);
}
}
- else if ( registry == _T("KOI8") )
+ else if ( registry == wxT("KOI8") )
{
M_FONTDATA->m_encoding = wxFONTENCODING_KOI8;
}
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();
// 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;
{
wxFAIL_MSG( wxT("Could not allocate even a default font -- something is wrong.") );
- return (wxXFont*) NULL;
+ return NULL;
}
wxXFont* f = new wxXFont;
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
}