// headers
// ----------------------------------------------------------------------------
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "font.h"
#endif
// copy cstr
wxFontRefData(const wxFontRefData& data);
-
+
// from XFLD
wxFontRefData(const wxString& fontname);
-
+
// dstr
virtual ~wxFontRefData();
void SetNoAntiAliasing( bool no = TRUE ) { m_noAA = no; }
bool GetNoAntiAliasing() { return m_noAA; }
-
+
// and this one also modifies all the other font data fields
void SetNativeFontInfo(const wxNativeFontInfo& info);
-
+
protected:
// common part of all ctors
void Init(int size,
// set all fields from (already initialized and valid) m_nativeFontInfo
void InitFromNative();
-
+
// font attributes
int m_pointSize;
int m_family;
bool m_noAA; // No anti-aliasing
wxNativeFontInfo m_nativeFontInfo;
-
+
void ClearX11Fonts();
#if wxUSE_UNICODE
m_underlined = underlined;
m_encoding = encoding;
-
+
#if wxUSE_UNICODE
// Create native font info
m_nativeFontInfo.description = pango_font_description_new();
m_encoding = data.m_encoding;
m_noAA = data.m_noAA;
-
+
m_nativeFontInfo = data.m_nativeFontInfo;
}
{
#if wxUSE_UNICODE
#else
- wxNode* node = m_fonts.First();
+ wxList::compatibility_iterator node = m_fonts.GetFirst();
while (node)
{
- wxXFont* f = (wxXFont*) node->Data();
+ wxXFont* f = (wxXFont*) node->GetData();
delete f;
- node = node->Next();
+ node = node->GetNext();
}
m_fonts.Clear();
#endif
wxFontEncoding encoding)
{
UnRef();
-
+
m_refData = new wxFontRefData(pointSize, family, style, weight,
underlined, faceName, encoding);
return TRUE;
}
-#if wxUSE_UNICODE
-#else
+#if !wxUSE_UNICODE
+
bool wxFont::Create(const wxString& fontname, wxFontEncoding enc)
{
if( !fontname )
else
return FALSE;
}
- return TRUE;
+ return TRUE;
}
-#endif
+#endif // !wxUSE_UNICODE
wxFont::~wxFont()
{
return M_FONTDATA->m_noAA;
}
-wxNativeFontInfo *wxFont::GetNativeFontInfo() const
+const wxNativeFontInfo *wxFont::GetNativeFontInfo() const
{
wxCHECK_MSG( Ok(), (wxNativeFontInfo *)NULL, wxT("invalid font") );
GetInternalFont();
#endif
- return new wxNativeFontInfo(M_FONTDATA->m_nativeFontInfo);
+ return &(M_FONTDATA->m_nativeFontInfo);
}
bool wxFont::IsFixedWidth() const
M_FONTDATA->SetEncoding(encoding);
}
-void wxFont::SetNativeFontInfo( const wxNativeFontInfo& info )
+void wxFont::DoSetNativeFontInfo( const wxNativeFontInfo& info )
{
Unshare();
int pointSize = (M_FONTDATA->m_pointSize * 10 * intScale) / 100;
// search existing fonts first
- wxNode* node = M_FONTDATA->m_fonts.First();
+ wxList::compatibility_iterator node = M_FONTDATA->m_fonts.GetFirst();
while (node)
{
- wxXFont* f = (wxXFont*) node->Data();
+ wxXFont* f = (wxXFont*) node->GetData();
if ((!display || (f->m_display == display)) && (f->m_scale == intScale))
return f;
- node = node->Next();
+ node = node->GetNext();
}
// not found, create a new one