]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk1/font.h
adding clipboard events, fixes #11906
[wxWidgets.git] / include / wx / gtk1 / font.h
CommitLineData
c801d85f 1/////////////////////////////////////////////////////////////////////////////
8ef94bfc 2// Name: wx/gtk1/font.h
c801d85f
KB
3// Purpose:
4// Author: Robert Roebling
58614078 5// Id: $Id$
371a5b4e 6// Copyright: (c) 1998 Robert Roebling
65571936 7// Licence: wxWindows licence
c801d85f
KB
8/////////////////////////////////////////////////////////////////////////////
9
c801d85f
KB
10#ifndef __GTKFONTH__
11#define __GTKFONTH__
12
c801d85f 13#include "wx/hash.h"
c801d85f 14
0c5d3e1c 15// ----------------------------------------------------------------------------
c801d85f 16// classes
0c5d3e1c 17// ----------------------------------------------------------------------------
c801d85f 18
b5dbe15d
VS
19class WXDLLIMPEXP_FWD_CORE wxDC;
20class WXDLLIMPEXP_FWD_CORE wxPaintDC;
21class WXDLLIMPEXP_FWD_CORE wxWindow;
c801d85f 22
b5dbe15d 23class WXDLLIMPEXP_FWD_CORE wxFont;
c801d85f 24
0c5d3e1c 25// ----------------------------------------------------------------------------
c801d85f 26// wxFont
0c5d3e1c 27// ----------------------------------------------------------------------------
c801d85f 28
20123d49 29class WXDLLIMPEXP_CORE wxFont : public wxFontBase
c801d85f 30{
358fc25c 31public:
0c5d3e1c 32 // ctors and such
8628b7d4 33 wxFont() { }
409d5a58
VZ
34
35 // wxGTK-specific
36 wxFont(const wxString& fontname)
7826e2dd 37 {
409d5a58 38 Create(fontname);
7826e2dd
VZ
39 }
40
41 wxFont(const wxNativeFontInfo& info);
0c5d3e1c 42
0c14b6c3 43#if FUTURE_WXWIN_COMPATIBILITY_3_0
0c5d3e1c
VZ
44 wxFont(int size,
45 int family,
46 int style,
47 int weight,
dabbc6a5 48 bool underlined = false,
0c5d3e1c
VZ
49 const wxString& face = wxEmptyString,
50 wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
51 {
0c14b6c3
FM
52 (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding);
53 }
54#endif
55
56 wxFont(int size,
57 wxFontFamily family,
58 wxFontStyle style,
59 wxFontWeight weight,
60 bool underlined = false,
61 const wxString& face = wxEmptyString,
62 wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
63 {
64 Create(size, family, style, weight, underlined, face, encoding);
0c5d3e1c 65 }
03647350 66
b5791cc7
FM
67 wxFont(const wxSize& pixelSize,
68 wxFontFamily family,
69 wxFontStyle style,
70 wxFontWeight weight,
71 bool underlined = false,
72 const wxString& face = wxEmptyString,
73 wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
74 {
75 Create(10, family, style, weight, underlined, face, encoding);
76 SetPixelSize(pixelSize);
77 }
03647350 78
0c5d3e1c 79 bool Create(int size,
0c14b6c3
FM
80 wxFontFamily family,
81 wxFontStyle style,
82 wxFontWeight weight,
dabbc6a5 83 bool underlined = false,
0c5d3e1c 84 const wxString& face = wxEmptyString,
7826e2dd 85 wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
30764ab5 86
0c14b6c3 87
7826e2dd 88 // wxGTK-specific
409d5a58 89 bool Create(const wxString& fontname);
0c5d3e1c 90
d3c7fc99 91 virtual ~wxFont();
0c5d3e1c
VZ
92
93 // implement base class pure virtuals
94 virtual int GetPointSize() const;
0c14b6c3
FM
95 virtual wxFontFamily GetFamily() const;
96 virtual wxFontStyle GetStyle() const;
97 virtual wxFontWeight GetWeight() const;
0c5d3e1c
VZ
98 virtual wxString GetFaceName() const;
99 virtual bool GetUnderlined() const;
100 virtual wxFontEncoding GetEncoding() const;
3bf5a59b 101 virtual const wxNativeFontInfo *GetNativeFontInfo() const;
53f6aab7 102 virtual bool IsFixedWidth() const;
0c5d3e1c
VZ
103
104 virtual void SetPointSize( int pointSize );
0c14b6c3
FM
105 virtual void SetFamily(wxFontFamily family);
106 virtual void SetStyle(wxFontStyle style);
107 virtual void SetWeight(wxFontWeight weight);
85ab460e 108 virtual bool SetFaceName( const wxString& faceName );
0c5d3e1c
VZ
109 virtual void SetUnderlined( bool underlined );
110 virtual void SetEncoding(wxFontEncoding encoding);
111
f76c0758 112 wxDECLARE_COMMON_FONT_METHODS();
0c14b6c3 113
0c5d3e1c 114 // implementation from now on
0c5d3e1c
VZ
115 void Unshare();
116
117 GdkFont* GetInternalFont(float scale = 1.0) const;
118
0c5d3e1c 119protected:
8f884a0d
VZ
120 virtual wxGDIRefData *CreateGDIRefData() const;
121 virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
122
9045ad9d
VZ
123 virtual void DoSetNativeFontInfo( const wxNativeFontInfo& info );
124
0c5d3e1c
VZ
125private:
126 DECLARE_DYNAMIC_CLASS(wxFont)
c801d85f
KB
127};
128
c801d85f 129#endif // __GTKFONTH__