]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/font.h
added carbonaccessors.o
[wxWidgets.git] / include / wx / gtk / font.h
CommitLineData
c801d85f
KB
1/////////////////////////////////////////////////////////////////////////////
2// Name: font.h
3// Purpose:
4// Author: Robert Roebling
58614078 5// Id: $Id$
c801d85f 6// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
8bbe427f 7// Licence: wxWindows licence
c801d85f
KB
8/////////////////////////////////////////////////////////////////////////////
9
c801d85f
KB
10#ifndef __GTKFONTH__
11#define __GTKFONTH__
12
13#ifdef __GNUG__
0c5d3e1c 14 #pragma interface
c801d85f
KB
15#endif
16
c801d85f 17#include "wx/hash.h"
c801d85f 18
0c5d3e1c 19// ----------------------------------------------------------------------------
c801d85f 20// classes
0c5d3e1c 21// ----------------------------------------------------------------------------
c801d85f
KB
22
23class wxDC;
24class wxPaintDC;
25class wxWindow;
26
27class wxFont;
c801d85f 28
0c5d3e1c 29// ----------------------------------------------------------------------------
c801d85f 30// wxFont
0c5d3e1c 31// ----------------------------------------------------------------------------
c801d85f 32
0c5d3e1c 33class wxFont : public wxFontBase
c801d85f 34{
358fc25c 35public:
0c5d3e1c
VZ
36 // ctors and such
37 wxFont() { Init(); }
6788ecb8 38 wxFont(const wxFont& font) : wxFontBase() { Init(); Ref(font); }
7826e2dd
VZ
39 wxFont(const wxString& fontname,
40 wxFontEncoding fontenc = wxFONTENCODING_DEFAULT)
41 {
42 Init();
0c5d3e1c 43
7826e2dd
VZ
44 Create(fontname, fontenc);
45 }
46
47 wxFont(const wxNativeFontInfo& info);
0c5d3e1c
VZ
48
49 wxFont(int size,
50 int family,
51 int style,
52 int weight,
53 bool underlined = FALSE,
54 const wxString& face = wxEmptyString,
55 wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
56 {
57 Init();
58
59 (void)Create(size, family, style, weight, underlined, face, encoding);
60 }
61
62 bool Create(int size,
63 int family,
64 int style,
65 int weight,
66 bool underlined = FALSE,
67 const wxString& face = wxEmptyString,
7826e2dd 68 wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
30764ab5 69
7826e2dd
VZ
70 // wxGTK-specific
71 bool Create(const wxString& fontname,
72 wxFontEncoding fontenc = wxFONTENCODING_DEFAULT);
73 bool Create(const wxNativeFontInfo& fontinfo);
0c5d3e1c
VZ
74
75 ~wxFont();
76
7826e2dd
VZ
77 // assignment
78 wxFont& operator=(const wxFont& font);
79
0c5d3e1c
VZ
80 // implement base class pure virtuals
81 virtual int GetPointSize() const;
82 virtual int GetFamily() const;
83 virtual int GetStyle() const;
84 virtual int GetWeight() const;
85 virtual wxString GetFaceName() const;
86 virtual bool GetUnderlined() const;
87 virtual wxFontEncoding GetEncoding() const;
7826e2dd 88 virtual wxNativeFontInfo *GetNativeFontInfo() const;
0c5d3e1c
VZ
89
90 virtual void SetPointSize( int pointSize );
91 virtual void SetFamily( int family );
92 virtual void SetStyle( int style );
93 virtual void SetWeight( int weight );
94 virtual void SetFaceName( const wxString& faceName );
95 virtual void SetUnderlined( bool underlined );
96 virtual void SetEncoding(wxFontEncoding encoding);
30764ab5 97 virtual void SetNativeFontInfo( const wxNativeFontInfo& info );
0c5d3e1c
VZ
98
99 // implementation from now on
0c5d3e1c
VZ
100 void Unshare();
101
102 GdkFont* GetInternalFont(float scale = 1.0) const;
103
104 // no data :-)
105
106protected:
107 // common part of all ctors
108 void Init();
109
110private:
111 DECLARE_DYNAMIC_CLASS(wxFont)
c801d85f
KB
112};
113
c801d85f 114#endif // __GTKFONTH__