… | |
… | |
9 | #ifdef HAVE_XSETLOCALE |
9 | #ifdef HAVE_XSETLOCALE |
10 | # define X_LOCALE |
10 | # define X_LOCALE |
11 | # include <X11/Xlocale.h> |
11 | # include <X11/Xlocale.h> |
12 | #else |
12 | #else |
13 | # ifdef HAVE_SETLOCALE |
13 | # ifdef HAVE_SETLOCALE |
14 | # include <locale.h> |
14 | # include <clocale> |
15 | # endif |
15 | # endif |
16 | #endif /* HAVE_XLOCALE */ |
16 | #endif /* HAVE_XLOCALE */ |
17 | |
17 | |
18 | #ifdef HAVE_NL_LANGINFO |
18 | #ifdef HAVE_NL_LANGINFO |
19 | # include <langinfo.h> |
19 | # include <langinfo.h> |
20 | #endif |
20 | #endif |
|
|
21 | |
|
|
22 | #include <inttypes.h> |
21 | |
23 | |
22 | #include "rxvtlib.h" |
24 | #include "rxvtlib.h" |
23 | #include "feature.h" |
25 | #include "feature.h" |
24 | #include "encoding.h" |
26 | #include "encoding.h" |
25 | #include "rxvtstl.h" |
27 | #include "rxvtstl.h" |
… | |
… | |
34 | }; |
36 | }; |
35 | |
37 | |
36 | struct rxvt_drawable { |
38 | struct rxvt_drawable { |
37 | rxvt_display *display; |
39 | rxvt_display *display; |
38 | Drawable drawable; |
40 | Drawable drawable; |
39 | # if XFT |
41 | #if XFT |
40 | XftDraw *xftdrawable; |
42 | XftDraw *xftdrawable; |
|
|
43 | operator XftDraw *(); |
41 | #endif |
44 | #endif |
|
|
45 | |
42 | rxvt_drawable (rxvt_display *display, Drawable drawable) |
46 | rxvt_drawable (rxvt_display *display, Drawable drawable) |
43 | : display(display), drawable(drawable), xftdrawable(0) { } |
47 | : display(display), |
|
|
48 | #if XFT |
|
|
49 | xftdrawable(0), |
|
|
50 | #endif |
|
|
51 | drawable(drawable) |
|
|
52 | { } |
|
|
53 | |
|
|
54 | #if XFT |
44 | ~rxvt_drawable (); |
55 | ~rxvt_drawable (); |
|
|
56 | #endif |
45 | |
57 | |
46 | operator Drawable() { return drawable; } |
58 | operator Drawable() { return drawable; } |
47 | operator XftDraw *(); |
|
|
48 | }; |
59 | }; |
49 | |
60 | |
50 | struct rxvt_font { |
61 | struct rxvt_font { |
|
|
62 | struct rxvt_fontset *fs; |
51 | // managed by the fontset |
63 | // managed by the fontset |
52 | rxvt_t r; |
64 | rxvt_t r; |
53 | void set_term (rxvt_t r) { this->r = r; } |
65 | void set_term (rxvt_t r) { this->r = r; } |
54 | |
66 | |
55 | char *name; |
67 | char *name; |
… | |
… | |
88 | #define FONT_UNREF(f) do { (f)->clear (); delete (f); } while (0) |
100 | #define FONT_UNREF(f) do { (f)->clear (); delete (f); } while (0) |
89 | |
101 | |
90 | struct rxvt_fallback_font; |
102 | struct rxvt_fallback_font; |
91 | |
103 | |
92 | struct rxvt_fontset { |
104 | struct rxvt_fontset { |
|
|
105 | char *fontdesc; |
|
|
106 | |
93 | rxvt_fontset (rxvt_t r); |
107 | rxvt_fontset (rxvt_t r); |
94 | ~rxvt_fontset (); |
108 | ~rxvt_fontset (); |
95 | |
109 | |
96 | rxvt_font *new_font (const char *name, codeset cs); |
110 | rxvt_font *new_font (const char *name, codeset cs); |
97 | |
111 | |
98 | bool populate (const char *desc); |
112 | bool populate (const char *desc); |
99 | int find_font (uint32_t unicode); |
113 | int find_font (uint32_t unicode, bool bold = false); |
100 | |
114 | |
|
|
115 | // font-id's MUST fit into a signed 16 bit integer. |
101 | rxvt_font *operator [] (int id) const |
116 | rxvt_font *operator [] (int id) const |
102 | { |
117 | { |
103 | return fonts[id]; |
118 | return fonts[id]; |
104 | } |
119 | } |
105 | |
120 | |