X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2b5f62a0b2db198609b45dec622a018dae37008e..1978421a6d8b81c1f8a961da4b8ddf544fec7b1b:/src/x11/font.cpp?ds=sidebyside diff --git a/src/x11/font.cpp b/src/x11/font.cpp index 8cd3bba65c..773246bbe6 100644 --- a/src/x11/font.cpp +++ b/src/x11/font.cpp @@ -17,7 +17,7 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "font.h" #endif @@ -105,10 +105,10 @@ public: // copy cstr wxFontRefData(const wxFontRefData& data); - + // from XFLD wxFontRefData(const wxString& fontname); - + // dstr virtual ~wxFontRefData(); @@ -124,10 +124,10 @@ public: 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, @@ -140,7 +140,7 @@ protected: // set all fields from (already initialized and valid) m_nativeFontInfo void InitFromNative(); - + // font attributes int m_pointSize; int m_family; @@ -152,7 +152,7 @@ protected: bool m_noAA; // No anti-aliasing wxNativeFontInfo m_nativeFontInfo; - + void ClearX11Fonts(); #if wxUSE_UNICODE @@ -190,7 +190,7 @@ void wxFontRefData::Init(int pointSize, m_underlined = underlined; m_encoding = encoding; - + #if wxUSE_UNICODE // Create native font info m_nativeFontInfo.description = pango_font_description_new(); @@ -396,7 +396,7 @@ wxFontRefData::wxFontRefData( const wxFontRefData& data ) m_encoding = data.m_encoding; m_noAA = data.m_noAA; - + m_nativeFontInfo = data.m_nativeFontInfo; } @@ -424,12 +424,12 @@ void wxFontRefData::ClearX11Fonts() { #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 @@ -556,15 +556,15 @@ bool wxFont::Create(int pointSize, 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 ) @@ -665,9 +665,9 @@ bool wxFont::Create(const wxString& fontname, wxFontEncoding enc) else return FALSE; } - return TRUE; + return TRUE; } -#endif +#endif // !wxUSE_UNICODE wxFont::~wxFont() { @@ -839,7 +839,7 @@ void wxFont::SetEncoding(wxFontEncoding encoding) M_FONTDATA->SetEncoding(encoding); } -void wxFont::SetNativeFontInfo( const wxNativeFontInfo& info ) +void wxFont::DoSetNativeFontInfo( const wxNativeFontInfo& info ) { Unshare(); @@ -872,13 +872,13 @@ wxXFont* wxFont::GetInternalFont(double scale, WXDisplay* display) const 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