]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: font.h | |
3 | // Purpose: | |
4 | // Author: Robert Roebling | |
5 | // Id: $Id$ | |
6 | // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem | |
7 | // Licence: wxWindows licence | |
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 | ||
28 | class wxDC; | |
29 | class wxPaintDC; | |
30 | class wxWindow; | |
31 | ||
32 | class wxFont; | |
33 | /* | |
34 | class wxFontNameDirectory; | |
35 | */ | |
36 | ||
37 | //----------------------------------------------------------------------------- | |
38 | // global variables | |
39 | //----------------------------------------------------------------------------- | |
40 | ||
41 | /* | |
42 | extern wxFontNameDirectory *wxTheFontNameDirectory; | |
43 | */ | |
44 | extern const wxChar* wxEmptyString; | |
45 | ||
46 | //----------------------------------------------------------------------------- | |
47 | // wxFont | |
48 | //----------------------------------------------------------------------------- | |
49 | ||
50 | class wxFont: public wxGDIObject | |
51 | { | |
52 | DECLARE_DYNAMIC_CLASS(wxFont) | |
53 | ||
54 | public: | |
55 | wxFont(); | |
56 | wxFont( int pointSize, int family, int style, int weight, bool underlined = FALSE, | |
57 | const wxString& face = wxEmptyString ); | |
58 | wxFont( const wxFont& font ); | |
59 | ~wxFont(); | |
60 | wxFont& operator = ( const wxFont& font ); | |
61 | bool operator == ( const wxFont& font ) const; | |
62 | bool operator != ( const wxFont& font ) const; | |
63 | bool Ok() const; | |
64 | ||
65 | int GetPointSize() const; | |
66 | int GetFamily() const; | |
67 | int GetStyle() const; | |
68 | int GetWeight() const; | |
69 | bool GetUnderlined() const; | |
70 | ||
71 | void SetPointSize( int pointSize ); | |
72 | void SetFamily( int family ); | |
73 | void SetStyle( int style ); | |
74 | void SetWeight( int weight ); | |
75 | void SetFaceName( const wxString& faceName ); | |
76 | void SetUnderlined( bool underlined ); | |
77 | ||
78 | wxString GetFaceName() const; | |
79 | wxString GetFamilyString() const; | |
80 | wxString GetStyleString() const; | |
81 | wxString GetWeightString() const; | |
82 | ||
83 | // implementation | |
84 | ||
85 | wxFont( char *xFontName ); | |
86 | void Unshare(); | |
87 | ||
88 | GdkFont* GetInternalFont(float scale = 1.0) const; | |
89 | ||
90 | // no data :-) | |
91 | }; | |
92 | ||
93 | /* | |
94 | //----------------------------------------------------------------------------- | |
95 | // wxFontDirectory | |
96 | //----------------------------------------------------------------------------- | |
97 | ||
98 | class wxFontNameDirectory: public wxObject | |
99 | { | |
100 | DECLARE_DYNAMIC_CLASS(wxFontNameDirectory) | |
101 | ||
102 | public: | |
103 | wxFontNameDirectory(); | |
104 | ~wxFontNameDirectory(); | |
105 | ||
106 | void Initialize(); | |
107 | void Initialize(int fontid, int family, const char *name); | |
108 | ||
109 | int FindOrCreateFontId(const char *name, int family); | |
110 | char* GetAFMName(int fontid, int weight, int style); | |
111 | int GetFamily(int fontid); | |
112 | int GetFontId(const char *name); | |
113 | char* GetFontName(int fontid); | |
114 | int GetNewFontId(); | |
115 | char* GetPostScriptName(int fontid, int weight, int style); | |
116 | char* GetScreenName(int fontid, int weight, int style); | |
117 | ||
118 | class wxHashTable *table; | |
119 | int nextFontId; | |
120 | }; | |
121 | */ | |
122 | ||
123 | #endif // __GTKFONTH__ |