From: David Elliott Date: Sat, 13 Oct 2007 06:58:26 +0000 (+0000) Subject: Rename src/cocoa/font.cpp to font.mm in both trunk and 2.8 branch. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/9d31c23993e7326a23e3aa76194e5c87f559bed7 Rename src/cocoa/font.cpp to font.mm in both trunk and 2.8 branch. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49143 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/Makefile.in b/Makefile.in index fbc32b0ffc..d405696c57 100644 --- a/Makefile.in +++ b/Makefile.in @@ -15592,8 +15592,8 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@monodll_font.o: $(srcdir)/src/mac/carbon/font.cpp $(MONODLL_ODEP) @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/mac/carbon/font.cpp -@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@monodll_font.o: $(srcdir)/src/cocoa/font.cpp $(MONODLL_ODEP) -@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/cocoa/font.cpp +@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@monodll_font.o: $(srcdir)/src/cocoa/font.mm $(MONODLL_ODEP) +@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/cocoa/font.mm @COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@monodll_font.o: $(srcdir)/src/os2/font.cpp $(MONODLL_ODEP) @COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/os2/font.cpp @@ -19951,8 +19951,8 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@monolib_font.o: $(srcdir)/src/mac/carbon/font.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/mac/carbon/font.cpp -@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@monolib_font.o: $(srcdir)/src/cocoa/font.cpp $(MONOLIB_ODEP) -@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/cocoa/font.cpp +@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@monolib_font.o: $(srcdir)/src/cocoa/font.mm $(MONOLIB_ODEP) +@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/cocoa/font.mm @COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@monolib_font.o: $(srcdir)/src/os2/font.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/os2/font.cpp @@ -24829,8 +24829,8 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP) @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@coredll_font.o: $(srcdir)/src/mac/carbon/font.cpp $(COREDLL_ODEP) @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/mac/carbon/font.cpp -@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@coredll_font.o: $(srcdir)/src/cocoa/font.cpp $(COREDLL_ODEP) -@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/cocoa/font.cpp +@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@coredll_font.o: $(srcdir)/src/cocoa/font.mm $(COREDLL_ODEP) +@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/cocoa/font.mm @COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@coredll_font.o: $(srcdir)/src/os2/font.cpp $(COREDLL_ODEP) @COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/os2/font.cpp @@ -27814,8 +27814,8 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP) @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@corelib_font.o: $(srcdir)/src/mac/carbon/font.cpp $(CORELIB_ODEP) @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/mac/carbon/font.cpp -@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@corelib_font.o: $(srcdir)/src/cocoa/font.cpp $(CORELIB_ODEP) -@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/cocoa/font.cpp +@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@corelib_font.o: $(srcdir)/src/cocoa/font.mm $(CORELIB_ODEP) +@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/cocoa/font.mm @COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@corelib_font.o: $(srcdir)/src/os2/font.cpp $(CORELIB_ODEP) @COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/os2/font.cpp diff --git a/build/bakefiles/files.bkl b/build/bakefiles/files.bkl index 3caf8ee689..cc08b05ff4 100644 --- a/build/bakefiles/files.bkl +++ b/build/bakefiles/files.bkl @@ -2461,7 +2461,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/cocoa/drawer.mm src/cocoa/evtloop.mm src/cocoa/filedlg.mm - src/cocoa/font.cpp + src/cocoa/font.mm src/cocoa/fontdlg.mm src/cocoa/fontenum.mm src/cocoa/fontutil.cpp diff --git a/src/cocoa/font.cpp b/src/cocoa/font.cpp deleted file mode 100644 index bfbed70f38..0000000000 --- a/src/cocoa/font.cpp +++ /dev/null @@ -1,198 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/cocoa/font.cpp -// Purpose: wxFont class -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "wx/wxprec.h" - -#include "wx/font.h" - -#ifndef WX_PRECOMP - #include "wx/string.h" - #include "wx/gdicmn.h" -#endif - -#include "wx/encinfo.h" - -IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject) - -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; -} - -wxFontRefData::~wxFontRefData() -{ - // TODO: delete font data -} - -#define M_FONTDATA ((wxFontRefData*)m_refData) - -bool wxFont::Create(const wxNativeFontInfo&) -{ - return false; -} - -void wxFont::SetEncoding(wxFontEncoding) -{ -} - -wxFontEncoding wxFont::GetEncoding() const -{ - return wxFontEncoding(); -} - -int wxFont::GetPointSize() const -{ - return 0; -} - -bool wxFont::GetUnderlined() const -{ - if(M_FONTDATA) - return M_FONTDATA->m_underlined; - else - return false; -} - -int wxFont::GetStyle() const -{ - return 0; -} - -int wxFont::GetFamily() const -{ - return 0; -} - -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) -{ - UnRef(); - m_refData = new wxFontRefData; - - M_FONTDATA->m_family = family; - M_FONTDATA->m_style = style; - M_FONTDATA->m_weight = weight; - M_FONTDATA->m_pointSize = pointSize; - M_FONTDATA->m_underlined = underlined; - M_FONTDATA->m_faceName = faceName; - - RealizeResource(); - - return true; -} - -wxFont::~wxFont() -{ -} - -bool wxFont::RealizeResource() -{ - // TODO: create the font (if there is a native font object) - return false; -} - -void wxFont::Unshare() -{ - // Don't change shared data - if (!m_refData) - { - m_refData = new wxFontRefData(); - } - else - { - wxFontRefData* ref = new wxFontRefData(*(wxFontRefData*)m_refData); - UnRef(); - m_refData = ref; - } -} - -void wxFont::SetPointSize(int pointSize) -{ - Unshare(); - - M_FONTDATA->m_pointSize = pointSize; - - RealizeResource(); -} - -void wxFont::SetFamily(int family) -{ - Unshare(); - - M_FONTDATA->m_family = family; - - RealizeResource(); -} - -void wxFont::SetStyle(int style) -{ - Unshare(); - - M_FONTDATA->m_style = style; - - RealizeResource(); -} - -void wxFont::SetWeight(int weight) -{ - Unshare(); - - M_FONTDATA->m_weight = weight; - - RealizeResource(); -} - -bool wxFont::SetFaceName(const wxString& faceName) -{ - Unshare(); - - M_FONTDATA->m_faceName = faceName; - - RealizeResource(); - - return wxFontBase::SetFaceName(faceName); -} - -void wxFont::SetUnderlined(bool underlined) -{ - Unshare(); - - M_FONTDATA->m_underlined = underlined; - - RealizeResource(); -} - -/* New font system */ -wxString wxFont::GetFaceName() const -{ - wxString str; - if (M_FONTDATA) - str = M_FONTDATA->m_faceName ; - return str; -} - -// vim:sts=4:sw=4:et diff --git a/src/cocoa/font.mm b/src/cocoa/font.mm new file mode 100644 index 0000000000..bfbed70f38 --- /dev/null +++ b/src/cocoa/font.mm @@ -0,0 +1,198 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: src/cocoa/font.cpp +// Purpose: wxFont class +// Author: AUTHOR +// Modified by: +// Created: ??/??/98 +// RCS-ID: $Id$ +// Copyright: (c) AUTHOR +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#include "wx/wxprec.h" + +#include "wx/font.h" + +#ifndef WX_PRECOMP + #include "wx/string.h" + #include "wx/gdicmn.h" +#endif + +#include "wx/encinfo.h" + +IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject) + +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; +} + +wxFontRefData::~wxFontRefData() +{ + // TODO: delete font data +} + +#define M_FONTDATA ((wxFontRefData*)m_refData) + +bool wxFont::Create(const wxNativeFontInfo&) +{ + return false; +} + +void wxFont::SetEncoding(wxFontEncoding) +{ +} + +wxFontEncoding wxFont::GetEncoding() const +{ + return wxFontEncoding(); +} + +int wxFont::GetPointSize() const +{ + return 0; +} + +bool wxFont::GetUnderlined() const +{ + if(M_FONTDATA) + return M_FONTDATA->m_underlined; + else + return false; +} + +int wxFont::GetStyle() const +{ + return 0; +} + +int wxFont::GetFamily() const +{ + return 0; +} + +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) +{ + UnRef(); + m_refData = new wxFontRefData; + + M_FONTDATA->m_family = family; + M_FONTDATA->m_style = style; + M_FONTDATA->m_weight = weight; + M_FONTDATA->m_pointSize = pointSize; + M_FONTDATA->m_underlined = underlined; + M_FONTDATA->m_faceName = faceName; + + RealizeResource(); + + return true; +} + +wxFont::~wxFont() +{ +} + +bool wxFont::RealizeResource() +{ + // TODO: create the font (if there is a native font object) + return false; +} + +void wxFont::Unshare() +{ + // Don't change shared data + if (!m_refData) + { + m_refData = new wxFontRefData(); + } + else + { + wxFontRefData* ref = new wxFontRefData(*(wxFontRefData*)m_refData); + UnRef(); + m_refData = ref; + } +} + +void wxFont::SetPointSize(int pointSize) +{ + Unshare(); + + M_FONTDATA->m_pointSize = pointSize; + + RealizeResource(); +} + +void wxFont::SetFamily(int family) +{ + Unshare(); + + M_FONTDATA->m_family = family; + + RealizeResource(); +} + +void wxFont::SetStyle(int style) +{ + Unshare(); + + M_FONTDATA->m_style = style; + + RealizeResource(); +} + +void wxFont::SetWeight(int weight) +{ + Unshare(); + + M_FONTDATA->m_weight = weight; + + RealizeResource(); +} + +bool wxFont::SetFaceName(const wxString& faceName) +{ + Unshare(); + + M_FONTDATA->m_faceName = faceName; + + RealizeResource(); + + return wxFontBase::SetFaceName(faceName); +} + +void wxFont::SetUnderlined(bool underlined) +{ + Unshare(); + + M_FONTDATA->m_underlined = underlined; + + RealizeResource(); +} + +/* New font system */ +wxString wxFont::GetFaceName() const +{ + wxString str; + if (M_FONTDATA) + str = M_FONTDATA->m_faceName ; + return str; +} + +// vim:sts=4:sw=4:et