// Name: font.cpp
// Author: Vaclav Slavik
// Id: $Id$
-// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
+// Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
return instance->GetMGLfont_t();
}
-void wxFont::Unshare()
+wxObjectRefData *wxFont::CreateRefData() const
{
- if ( !m_refData )
- {
- m_refData = new wxFontRefData();
- }
- else
- {
- wxFontRefData* ref = new wxFontRefData(*(wxFontRefData*)m_refData);
- UnRef();
- m_refData = ref;
- }
+ return new wxFontRefData;
}
+wxObjectRefData *wxFont::CloneRefData(const wxObjectRefData *data) const
+{
+ return new wxFontRefData(*(wxFontRefData *)data);
+}
+
+
// ----------------------------------------------------------------------------
// accessors
// ----------------------------------------------------------------------------
void wxFont::SetPointSize(int pointSize)
{
- Unshare();
+ AllocExclusive();
M_FONTDATA->m_pointSize = pointSize;
M_FONTDATA->m_valid = FALSE;
void wxFont::SetFamily(int family)
{
- Unshare();
+ AllocExclusive();
M_FONTDATA->m_family = family;
M_FONTDATA->m_valid = FALSE;
void wxFont::SetStyle(int style)
{
- Unshare();
+ AllocExclusive();
M_FONTDATA->m_style = style;
M_FONTDATA->m_valid = FALSE;
void wxFont::SetWeight(int weight)
{
- Unshare();
+ AllocExclusive();
M_FONTDATA->m_weight = weight;
M_FONTDATA->m_valid = FALSE;
void wxFont::SetFaceName(const wxString& faceName)
{
- Unshare();
+ AllocExclusive();
M_FONTDATA->m_faceName = faceName;
M_FONTDATA->m_valid = FALSE;
void wxFont::SetUnderlined(bool underlined)
{
- Unshare();
+ AllocExclusive();
M_FONTDATA->m_underlined = underlined;
}
void wxFont::SetEncoding(wxFontEncoding encoding)
{
- Unshare();
+ AllocExclusive();
M_FONTDATA->m_encoding = encoding;
M_FONTDATA->m_valid = FALSE;