X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a24aff654fb10971e82abccc1b56217d556d447b..d00077abbe42b2fe08d5054519499dee4e93cf98:/src/cocoa/font.cpp diff --git a/src/cocoa/font.cpp b/src/cocoa/font.cpp index c907342aa5..606e2e3d72 100644 --- a/src/cocoa/font.cpp +++ b/src/cocoa/font.cpp @@ -1,35 +1,34 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: font.cpp +// Name: src/cocoa/font.cpp // Purpose: wxFont class // Author: AUTHOR // Modified by: // Created: ??/??/98 // RCS-ID: $Id$ // Copyright: (c) AUTHOR -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "font.h" +#include "wx/wxprec.h" + +#ifndef WX_PRECOMP + #include "wx/string.h" #endif -#include "wx/defs.h" -#include "wx/string.h" #include "wx/font.h" #include "wx/gdicmn.h" +#include "wx/encinfo.h" -#if !USE_SHARED_LIBRARIES IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject) -#endif void wxFontRefData::Init(int size, int family, int style, int weight, bool underlined, const wxString& faceName, wxFontEncoding encoding) { - m_family = family; - m_style = style; - m_weight = weight; - m_underlined = underlined; - m_faceName = faceName; - m_encoding = encoding; + m_family = family; + m_style = style; + m_weight = weight; + m_underlined = underlined; + m_faceName = faceName; + m_encoding = encoding; } wxFontRefData::~wxFontRefData() @@ -37,13 +36,9 @@ wxFontRefData::~wxFontRefData() // TODO: delete font data } -void wxFont::Init() -{ -} - bool wxFont::Create(const wxNativeFontInfo&) { - return FALSE; + return false; } void wxFont::SetEncoding(wxFontEncoding) @@ -62,7 +57,7 @@ int wxFont::GetPointSize() const bool wxFont::GetUnderlined() const { - return FALSE; + return false; } int wxFont::GetStyle() const @@ -80,6 +75,11 @@ int wxFont::GetWeight() const return 0; } +const wxNativeFontInfo *wxFont::GetNativeFontInfo() const +{ + return NULL; +} + void wxGetNativeFontEncoding(wxFontEncoding, wxNativeEncodingInfo*); bool wxFont::Create(int pointSize, int family, int style, int weight, bool underlined, const wxString& faceName, wxFontEncoding encoding) @@ -96,34 +96,32 @@ bool wxFont::Create(int pointSize, int family, int style, int weight, bool under RealizeResource(); - return TRUE; + return true; } wxFont::~wxFont() { - if (wxTheFontList) - wxTheFontList->DeleteObject(this); } bool wxFont::RealizeResource() { // TODO: create the font (if there is a native font object) - return FALSE; + return false; } void wxFont::Unshare() { - // Don't change shared data - if (!m_refData) + // Don't change shared data + if (!m_refData) { - m_refData = new wxFontRefData(); - } + m_refData = new wxFontRefData(); + } else { - wxFontRefData* ref = new wxFontRefData(*(wxFontRefData*)m_refData); - UnRef(); - m_refData = ref; - } + wxFontRefData* ref = new wxFontRefData(*(wxFontRefData*)m_refData); + UnRef(); + m_refData = ref; + } } void wxFont::SetPointSize(int pointSize) @@ -162,13 +160,15 @@ void wxFont::SetWeight(int weight) RealizeResource(); } -void wxFont::SetFaceName(const wxString& faceName) +bool wxFont::SetFaceName(const wxString& faceName) { Unshare(); M_FONTDATA->m_faceName = faceName; RealizeResource(); + + return wxFontBase::SetFaceName(faceName); } void wxFont::SetUnderlined(bool underlined) @@ -183,9 +183,9 @@ void wxFont::SetUnderlined(bool underlined) /* New font system */ wxString wxFont::GetFaceName() const { - wxString str(""); + wxString str; if (M_FONTDATA) - str = M_FONTDATA->m_faceName ; + str = M_FONTDATA->m_faceName ; return str; }