Extending wxFont API & OSX Core Text Implementation (#877)
* Switch to pure Core Text Implementation, Start extended Font API * mac fixes * First msw implementation * Fixing paste error * fixing typo * Rearranging lines to former fallthrough order * Blind fixes for covering new abstract methods * Blind gtk implementations * Fixing according to travis .. * Removing method defined in base * formatting adaptions * Extending the schema definition for new weights * fixing typo, using wxRound, other fixes according to comments * changes according to suggestions * fixing init order, before the init of m_info was overridden by Init() * redo * redo * redo * Cleanup Removing obsolete code snippets, proper traces for font names * Moving common code Only the Get/SetNumericWeight calls should now be implemented in the native part, the ‚old‘ Get/SetWeight are common code and use the numeric counterparts. * Updating docs * commit wa missing changes.txt * Doc fixes * Full stops added
This commit is contained in:
@@ -79,12 +79,17 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
explicit wxCFDictionaryRef(CFDictionaryRef r)
|
||||
wxCFDictionaryRef(CFDictionaryRef r)
|
||||
: wxCFDictionaryRefCommon(r)
|
||||
{
|
||||
}
|
||||
|
||||
wxCFDictionaryRef& operator=(const wxCFMutableDictionaryRef& other);
|
||||
|
||||
CFDictionaryRef CreateCopy() const
|
||||
{
|
||||
return CFDictionaryCreateCopy(kCFAllocatorDefault, this->m_ptr);
|
||||
}
|
||||
};
|
||||
|
||||
class wxCFMutableDictionaryRef : public wxCFDictionaryRefCommon<CFMutableDictionaryRef>
|
||||
@@ -95,7 +100,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
explicit wxCFMutableDictionaryRef(CFMutableDictionaryRef r)
|
||||
wxCFMutableDictionaryRef(CFMutableDictionaryRef r)
|
||||
: wxCFDictionaryRefCommon(r)
|
||||
{
|
||||
}
|
||||
@@ -109,6 +114,11 @@ public:
|
||||
{
|
||||
SetValue(key, wxCFNumberRef(v));
|
||||
}
|
||||
|
||||
CFMutableDictionaryRef CreateCopy() const
|
||||
{
|
||||
return CFDictionaryCreateMutableCopy(kCFAllocatorDefault, 0, this->m_ptr);
|
||||
}
|
||||
|
||||
friend class wxCFDictionaryRef;
|
||||
};
|
||||
|
@@ -51,6 +51,7 @@ public:
|
||||
}
|
||||
|
||||
wxFont( wxOSXSystemFont systemFont );
|
||||
wxFont(CTFontRef font);
|
||||
|
||||
#if wxOSX_USE_COCOA
|
||||
wxFont(WX_NSFont nsfont);
|
||||
@@ -67,6 +68,17 @@ public:
|
||||
Create(size, family, style, weight, underlined, face, encoding);
|
||||
}
|
||||
|
||||
wxFont(float size,
|
||||
wxFontFamily family,
|
||||
wxFontStyle style,
|
||||
wxFontWeight weight,
|
||||
bool underlined = false,
|
||||
const wxString& face = wxEmptyString,
|
||||
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
|
||||
{
|
||||
Create(size, family, style, weight, underlined, face, encoding);
|
||||
}
|
||||
|
||||
wxFont(const wxSize& pixelSize,
|
||||
wxFontFamily family,
|
||||
wxFontStyle style,
|
||||
@@ -87,6 +99,14 @@ public:
|
||||
const wxString& face = wxEmptyString,
|
||||
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
|
||||
|
||||
bool Create(float size,
|
||||
wxFontFamily family,
|
||||
wxFontStyle style,
|
||||
wxFontWeight weight,
|
||||
bool underlined = false,
|
||||
const wxString& face = wxEmptyString,
|
||||
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
|
||||
|
||||
wxFont(const wxNativeFontInfo& info)
|
||||
{
|
||||
(void)Create(info);
|
||||
@@ -99,26 +119,28 @@ public:
|
||||
virtual ~wxFont();
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual int GetPointSize() const;
|
||||
virtual wxSize GetPixelSize() const;
|
||||
virtual wxFontStyle GetStyle() const;
|
||||
virtual wxFontWeight GetWeight() const;
|
||||
virtual bool GetUnderlined() const;
|
||||
virtual bool GetStrikethrough() const;
|
||||
virtual wxString GetFaceName() const;
|
||||
virtual wxFontEncoding GetEncoding() const;
|
||||
virtual const wxNativeFontInfo *GetNativeFontInfo() const;
|
||||
virtual float GetFractionalPointSize() const wxOVERRIDE;
|
||||
virtual wxSize GetPixelSize() const wxOVERRIDE;
|
||||
virtual wxFontStyle GetStyle() const wxOVERRIDE;
|
||||
virtual wxFontWeight GetWeight() const wxOVERRIDE;
|
||||
virtual int GetNumericWeight() const wxOVERRIDE;
|
||||
virtual bool GetUnderlined() const wxOVERRIDE;
|
||||
virtual bool GetStrikethrough() const wxOVERRIDE;
|
||||
virtual wxString GetFaceName() const wxOVERRIDE;
|
||||
virtual wxFontEncoding GetEncoding() const wxOVERRIDE;
|
||||
virtual const wxNativeFontInfo *GetNativeFontInfo() const wxOVERRIDE;
|
||||
|
||||
virtual bool IsFixedWidth() const;
|
||||
virtual bool IsFixedWidth() const wxOVERRIDE;
|
||||
|
||||
virtual void SetPointSize(int pointSize);
|
||||
virtual void SetFamily(wxFontFamily family);
|
||||
virtual void SetStyle(wxFontStyle style);
|
||||
virtual void SetWeight(wxFontWeight weight);
|
||||
virtual bool SetFaceName(const wxString& faceName);
|
||||
virtual void SetUnderlined(bool underlined);
|
||||
virtual void SetStrikethrough(bool strikethrough);
|
||||
virtual void SetEncoding(wxFontEncoding encoding);
|
||||
virtual void SetPointSize(float pointSize) wxOVERRIDE;
|
||||
virtual void SetFamily(wxFontFamily family) wxOVERRIDE;
|
||||
virtual void SetStyle(wxFontStyle style) wxOVERRIDE;
|
||||
virtual void SetWeight(wxFontWeight weight) wxOVERRIDE;
|
||||
virtual void SetNumericWeight(int weight) wxOVERRIDE;
|
||||
virtual bool SetFaceName(const wxString& faceName) wxOVERRIDE;
|
||||
virtual void SetUnderlined(bool underlined) wxOVERRIDE;
|
||||
virtual void SetStrikethrough(bool strikethrough) wxOVERRIDE;
|
||||
virtual void SetEncoding(wxFontEncoding encoding) wxOVERRIDE;
|
||||
|
||||
wxDECLARE_COMMON_FONT_METHODS();
|
||||
|
||||
@@ -148,7 +170,6 @@ public:
|
||||
|
||||
#if wxOSX_USE_COCOA
|
||||
WX_NSFont OSXGetNSFont() const;
|
||||
static void SetNativeInfoFromNSFont(WX_NSFont nsfont, wxNativeFontInfo* info);
|
||||
#endif
|
||||
|
||||
#if wxOSX_USE_IPHONE
|
||||
@@ -156,11 +177,11 @@ public:
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void DoSetNativeFontInfo(const wxNativeFontInfo& info);
|
||||
virtual wxFontFamily DoGetFamily() const;
|
||||
virtual void DoSetNativeFontInfo(const wxNativeFontInfo& info) wxOVERRIDE;
|
||||
virtual wxFontFamily DoGetFamily() const wxOVERRIDE;
|
||||
|
||||
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||
virtual wxGDIRefData *CreateGDIRefData() const wxOVERRIDE;
|
||||
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const wxOVERRIDE;
|
||||
|
||||
private:
|
||||
|
||||
|
Reference in New Issue
Block a user