]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/palmos/font.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/palmos/font.h
3 // Purpose: wxFont class
4 // Author: William Osborne - minimal working wxPalmOS port
5 // Modified by: Yunhui Fu
8 // Copyright: (c) William Osborne
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #include "wx/gdicmn.h"
17 // ----------------------------------------------------------------------------
19 // ----------------------------------------------------------------------------
21 class WXDLLIMPEXP_CORE wxFont
: public wxFontBase
27 #if FUTURE_WXWIN_COMPATIBILITY_3_0
32 bool underlined
= false,
33 const wxString
& face
= wxEmptyString
,
34 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
36 (void)Create(size
, (wxFontFamily
)family
, (wxFontStyle
)style
, (wxFontWeight
)weight
, underlined
, face
, encoding
);
44 bool underlined
= false,
45 const wxString
& face
= wxEmptyString
,
46 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
48 Create(size
, family
, style
, weight
, underlined
, face
, encoding
);
51 wxFont(const wxSize
& pixelSize
,
55 bool underlined
= false,
56 const wxString
& face
= wxEmptyString
,
57 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
59 Create(10, family
, style
, weight
, underlined
, face
, encoding
);
60 SetPixelSize(pixelSize
);
67 bool underlined
= false,
68 const wxString
& face
= wxEmptyString
,
69 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
71 wxFont(const wxSize
& pixelSize
,
75 bool underlined
= false,
76 const wxString
& face
= wxEmptyString
,
77 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
79 (void)Create(pixelSize
, family
, style
, weight
,
80 underlined
, face
, encoding
);
83 wxFont(const wxNativeFontInfo
& info
, WXHFONT hFont
= 0)
88 wxFont(const wxString
& fontDesc
);
90 bool Create(const wxSize
& pixelSize
,
94 bool underlined
= false,
95 const wxString
& face
= wxEmptyString
,
96 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
98 return DoCreate(-1, pixelSize
, true, family
, style
,
99 weight
, underlined
, face
, encoding
);
102 bool Create(const wxNativeFontInfo
& info
, WXHFONT hFont
= 0);
106 // wxFontBase overridden functions
107 virtual wxString
GetNativeFontInfoDesc() const;
108 virtual wxString
GetNativeFontInfoUserDesc() const;
110 // implement base class pure virtuals
111 virtual int GetPointSize() const;
112 virtual wxSize
GetPixelSize() const;
113 virtual bool IsUsingSizeInPixels() const;
114 virtual wxFontFamily
GetFamily() const;
115 virtual wxFontStyle
GetStyle() const;
116 virtual wxFontWeight
GetWeight() const;
117 virtual bool GetUnderlined() const;
118 virtual wxString
GetFaceName() const;
119 virtual wxFontEncoding
GetEncoding() const;
120 virtual const wxNativeFontInfo
*GetNativeFontInfo() const;
122 virtual void SetPointSize(int pointSize
);
123 virtual void SetPixelSize(const wxSize
& pixelSize
);
124 virtual void SetFamily(wxFontFamily family
);
125 virtual void SetStyle(wxFontStyle style
);
126 virtual void SetWeight(wxFontWeight weight
);
127 virtual bool SetFaceName(const wxString
& faceName
);
128 virtual void SetUnderlined(bool underlined
);
129 virtual void SetEncoding(wxFontEncoding encoding
);
131 WXDECLARE_COMPAT_SETTERS
133 virtual bool IsFixedWidth() const;
135 // implementation only from now on
136 // -------------------------------
138 virtual bool IsFree() const;
139 virtual bool RealizeResource();
140 virtual WXHANDLE
GetResourceHandle() const;
141 virtual bool FreeResource(bool force
= false);
144 // real font creation function, used in all cases
145 bool DoCreate(int size
,
146 const wxSize
& pixelSize
,
147 bool sizeUsingPixels
,
151 bool underlined
= false,
152 const wxString
& face
= wxEmptyString
,
153 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
155 virtual void DoSetNativeFontInfo(const wxNativeFontInfo
& info
);
157 // implement wxObject virtuals which are used by AllocExclusive()
158 virtual wxGDIRefData
*CreateGDIRefData() const;
159 virtual wxGDIRefData
*CloneGDIRefData(const wxGDIRefData
*data
) const;
162 DECLARE_DYNAMIC_CLASS(wxFont
)
165 #endif // _WX_FONT_H_