]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk1/font.h
New wxDataObject, DnD and Clipboard code
[wxWidgets.git] / include / wx / gtk1 / 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
10
11#ifndef __GTKFONTH__
12#define __GTKFONTH__
13
14#ifdef __GNUG__
15#pragma interface
16#endif
17
18#include "wx/defs.h"
19#include "wx/object.h"
20#include "wx/string.h"
21#include "wx/hash.h"
22#include "wx/gdiobj.h"
23
24//-----------------------------------------------------------------------------
25// classes
26//-----------------------------------------------------------------------------
27
28class wxDC;
29class wxPaintDC;
30class wxWindow;
31
32class wxFont;
33class wxFontNameDirectory;
34
35//-----------------------------------------------------------------------------
36// global variables
37//-----------------------------------------------------------------------------
38
a3622daa 39//extern wxFontNameDirectory *wxTheFontNameDirectory; // defined below
c801d85f
KB
40
41//-----------------------------------------------------------------------------
42// wxFont
43//-----------------------------------------------------------------------------
44
8bbe427f 45class wxFont: public wxGDIObject
c801d85f
KB
46{
47 DECLARE_DYNAMIC_CLASS(wxFont)
8bbe427f 48
c801d85f 49 public:
8bbe427f 50 wxFont();
c801d85f 51 wxFont( int PointSize, int FontIdOrFamily, int Style, int Weight,
8bbe427f
VZ
52 bool underlined = FALSE, const char *Face = ( const char *) NULL );
53 wxFont( int PointSize, const char *Face, int Family,
54 int Style, int Weight, bool underlined = FALSE );
c801d85f 55 wxFont( const wxFont& font );
8bbe427f 56 ~wxFont();
c801d85f
KB
57 wxFont& operator = ( const wxFont& font );
58 bool operator == ( const wxFont& font );
59 bool operator != ( const wxFont& font );
d84eb083 60 bool Ok() const;
c801d85f 61
8bbe427f
VZ
62 int GetPointSize() const;
63 wxString GetFaceName() const;
64 int GetFamily() const;
65 wxString GetFamilyString() const;
66 int GetFontId() const;
67 wxString GetFaceString() const;
68 int GetStyle() const;
69 wxString GetStyleString() const;
70 int GetWeight() const;
71 wxString GetWeightString() const;
72 bool GetUnderlined() const;
c801d85f
KB
73
74 wxFont( char *xFontName );
868a2826 75
8bbe427f
VZ
76 // implementation
77
c33c4050 78 GdkFont* GetInternalFont(float scale = 1.0) const;
c801d85f
KB
79
80 // no data :-)
81};
82
83//-----------------------------------------------------------------------------
84// wxFontDirectory
85//-----------------------------------------------------------------------------
86
8bbe427f 87class wxFontNameDirectory: public wxObject
c801d85f
KB
88{
89 DECLARE_DYNAMIC_CLASS(wxFontNameDirectory)
8bbe427f 90
c801d85f 91 public:
8bbe427f 92 wxFontNameDirectory();
c801d85f
KB
93 ~wxFontNameDirectory();
94
8bbe427f 95 void Initialize();
c801d85f
KB
96 void Initialize(int fontid, int family, const char *name);
97
98 int FindOrCreateFontId(const char *name, int family);
99 char* GetAFMName(int fontid, int weight, int style);
100 int GetFamily(int fontid);
101 int GetFontId(const char *name);
102 char* GetFontName(int fontid);
8bbe427f 103 int GetNewFontId();
c801d85f
KB
104 char* GetPostScriptName(int fontid, int weight, int style);
105 char* GetScreenName(int fontid, int weight, int style);
8bbe427f 106
c801d85f
KB
107 class wxHashTable *table;
108 int nextFontId;
109};
110
a3622daa 111extern wxFontNameDirectory *wxTheFontNameDirectory;
c801d85f
KB
112
113#endif // __GTKFONTH__