X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5844fc07752fa6368b594f213666fce4abb03456..670f9935630beb2123a5ca62894ae92a3f0efa4f:/src/x11/font.cpp diff --git a/src/x11/font.cpp b/src/x11/font.cpp index 125cb3545e..c1e7646796 100644 --- a/src/x11/font.cpp +++ b/src/x11/font.cpp @@ -9,6 +9,9 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +// for compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + // ============================================================================ // declarations // ============================================================================ @@ -17,10 +20,6 @@ // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "font.h" -#endif - #ifdef __VMS #pragma message disable nosimpint #include "wx/vms_x_fix.h" @@ -30,9 +29,12 @@ #pragma message enable nosimpint #endif -#include "wx/defs.h" -#include "wx/string.h" #include "wx/font.h" + +#ifndef WX_PRECOMP + #include "wx/string.h" +#endif + #include "wx/gdicmn.h" #include "wx/utils.h" // for wxGetDisplay() #include "wx/fontutil.h" // for wxNativeFontInfo @@ -99,7 +101,7 @@ public: int family = wxDEFAULT, int style = wxDEFAULT, int weight = wxDEFAULT, - bool underlined = FALSE, + bool underlined = false, const wxString& faceName = wxEmptyString, wxFontEncoding encoding = wxFONTENCODING_DEFAULT); @@ -122,7 +124,7 @@ public: void SetFaceName(const wxString& facename); void SetEncoding(wxFontEncoding encoding); - void SetNoAntiAliasing( bool no = TRUE ) { m_noAA = no; } + void SetNoAntiAliasing( bool no = true ) { m_noAA = no; } bool GetNoAntiAliasing() const { return m_noAA; } // and this one also modifies all the other font data fields @@ -217,7 +219,7 @@ void wxFontRefData::Init(int pointSize, void wxFontRefData::InitFromNative() { - m_noAA = FALSE; + m_noAA = false; #if wxUSE_UNICODE // Get native info @@ -277,7 +279,7 @@ void wxFontRefData::InitFromNative() } // Pango description are never underlined (?) - m_underlined = FALSE; + m_underlined = false; // Cannot we choose that m_encoding = wxFONTENCODING_SYSTEM; @@ -347,7 +349,7 @@ void wxFontRefData::InitFromNative() } // X fonts are never underlined... - m_underlined = FALSE; + m_underlined = false; // deal with font encoding wxString @@ -526,14 +528,8 @@ void wxFontRefData::SetNativeFontInfo(const wxNativeFontInfo& info) // wxFont // ---------------------------------------------------------------------------- -void wxFont::Init() -{ -} - wxFont::wxFont(const wxNativeFontInfo& info) { - Init(); - #if wxUSE_UNICODE Create( info.GetPointSize(), info.GetFamily(), @@ -560,7 +556,7 @@ bool wxFont::Create(int pointSize, m_refData = new wxFontRefData(pointSize, family, style, weight, underlined, faceName, encoding); - return TRUE; + return true; } #if !wxUSE_UNICODE @@ -570,7 +566,7 @@ bool wxFont::Create(const wxString& fontname, wxFontEncoding enc) if( !fontname ) { *this = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT); - return TRUE; + return true; } m_refData = new wxFontRefData(); @@ -663,9 +659,9 @@ bool wxFont::Create(const wxString& fontname, wxFontEncoding enc) } //else: unknown encoding - may be give a warning here? else - return FALSE; + return false; } - return TRUE; + return true; } #endif // !wxUSE_UNICODE @@ -705,7 +701,7 @@ int wxFont::GetPointSize() const wxString wxFont::GetFaceName() const { - wxCHECK_MSG( Ok(), wxT(""), wxT("invalid font") ); + wxCHECK_MSG( Ok(), wxEmptyString, wxT("invalid font") ); return M_FONTDATA->m_faceName; } @@ -733,7 +729,7 @@ int wxFont::GetWeight() const bool wxFont::GetUnderlined() const { - wxCHECK_MSG( Ok(), FALSE, wxT("invalid font") ); + wxCHECK_MSG( Ok(), false, wxT("invalid font") ); return M_FONTDATA->m_underlined; } @@ -767,13 +763,13 @@ const wxNativeFontInfo *wxFont::GetNativeFontInfo() const bool wxFont::IsFixedWidth() const { - wxCHECK_MSG( Ok(), FALSE, wxT("invalid font") ); + wxCHECK_MSG( Ok(), false, wxT("invalid font") ); #if wxUSE_UNICODE return wxFontBase::IsFixedWidth(); #else // Robert, is this right? HasNativeFont doesn't exist. - if ( TRUE ) + if ( true ) // if ( M_FONTDATA->HasNativeFont() ) { // the monospace fonts are supposed to have "M" in the spacing field @@ -887,7 +883,7 @@ wxXFont* wxFont::GetInternalFont(double scale, WXDisplay* display) const if (xFontName == "-*-*-*-*-*--*-*-*-*-*-*-*-*") // wxFont constructor not called with native font info parameter => take M_FONTDATA values xFontName.Clear(); - + // not found, create a new one XFontStruct *font = (XFontStruct *) wxLoadQueryNearestFont(pointSize,