1 | /* |
1 | /* |
2 | * $Id: defaultfont.h,v 1.3 2003/11/25 09:29:11 pcg Exp $ |
2 | * $Id: defaultfont.h,v 1.6 2003/12/04 00:43:26 pcg Exp $ |
3 | */ |
3 | */ |
4 | |
4 | |
5 | #ifndef _DEFAULTFONT_H_ |
5 | #ifndef _DEFAULTFONT_H_ |
6 | #define _DEFAULTFONT_H_ |
6 | #define _DEFAULTFONT_H_ |
7 | |
7 | |
… | |
… | |
21 | #include "rxvtlib.h" |
21 | #include "rxvtlib.h" |
22 | #include "feature.h" |
22 | #include "feature.h" |
23 | #include "encoding.h" |
23 | #include "encoding.h" |
24 | #include "rxvtvec.h" |
24 | #include "rxvtvec.h" |
25 | |
25 | |
26 | typedef struct rxvt_vars rxvt_t; |
|
|
27 | |
|
|
28 | struct rxvt_font { |
26 | struct rxvt_font { |
29 | // managed by the fontset |
27 | // managed by the fontset |
30 | #if EXPLICIT_CONTEXT |
28 | rxvt_t r; |
31 | rxvt_t *rxvt_term; |
29 | void set_term (rxvt_t r) { this->r = r; } |
32 | void set_term (pR) { this->rxvt_term = R; } |
30 | |
33 | #else |
|
|
34 | void set_term (pR) { } |
|
|
35 | #endif |
|
|
36 | char *name; |
31 | char *name; |
37 | codeset cs; |
32 | codeset cs; |
38 | bool loaded; |
33 | bool loaded; // wether we tried loading it before (not wether it's loaded) |
39 | |
34 | |
40 | // managed by the font object |
35 | // managed by the font object |
41 | bool prop; // wether this is a proportional font or has other funny characteristics |
36 | bool prop; // wether this is a proportional font or has other funny characteristics |
42 | int ascent, descent, |
37 | int ascent, descent, |
43 | width, height; |
38 | width, height; |
… | |
… | |
68 | #define FONT_UNREF(f) delete f |
63 | #define FONT_UNREF(f) delete f |
69 | |
64 | |
70 | struct rxvt_fallback_font; |
65 | struct rxvt_fallback_font; |
71 | |
66 | |
72 | struct rxvt_fontset { |
67 | struct rxvt_fontset { |
73 | rxvt_fontset (pR); |
68 | rxvt_fontset (rxvt_t r); |
74 | ~rxvt_fontset (); |
69 | ~rxvt_fontset (); |
75 | |
70 | |
76 | rxvt_font *new_font (const char *name, codeset cs); |
71 | rxvt_font *new_font (const char *name, codeset cs); |
77 | |
72 | |
78 | void populate (const char *desc); |
73 | void populate (const char *desc); |
… | |
… | |
87 | { |
82 | { |
88 | return fonts[base_id]; |
83 | return fonts[base_id]; |
89 | } |
84 | } |
90 | |
85 | |
91 | private: |
86 | private: |
92 | #ifdef EXPLICIT_CONTEXT |
87 | rxvt_t r; |
93 | rxvt_t *rxvt_term; |
|
|
94 | #endif |
|
|
95 | simplevec<rxvt_font *> fonts; |
88 | simplevec<rxvt_font *> fonts; |
96 | const rxvt_fallback_font *fallback; |
89 | const rxvt_fallback_font *fallback; |
97 | |
90 | |
98 | int height; |
91 | int height; |
99 | int base_id; |
92 | int base_id; |