ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/defaultfont.h
(Generate patch)

Comparing rxvt-unicode/src/defaultfont.h (file contents):
Revision 1.13 by pcg, Sun Feb 22 08:28:36 2004 UTC vs.
Revision 1.14 by pcg, Tue Feb 24 00:44:23 2004 UTC

1#ifndef DEFAULTFONT_H_ 1#ifndef DEFAULTFONT_H_
2#define DEFAULTFONT_H_ 2#define DEFAULTFONT_H_
3
4#include <X11/Xlib.h>
5#if XFT
6# include <X11/Xft/Xft.h>
7#endif
3 8
4#ifdef HAVE_XSETLOCALE 9#ifdef HAVE_XSETLOCALE
5# define X_LOCALE 10# define X_LOCALE
6# include <X11/Xlocale.h> 11# include <X11/Xlocale.h>
7#else 12#else
26 }; 31 };
27 int width, height; 32 int width, height;
28 int weight, slant; 33 int weight, slant;
29}; 34};
30 35
36struct rxvt_drawable {
37 rxvt_display *display;
38 Drawable drawable;
39# if XFT
40 XftDraw *xftdrawable;
41#endif
42 rxvt_drawable (rxvt_display *display, Drawable drawable)
43 : display(display), drawable(drawable), xftdrawable(0) { }
44 ~rxvt_drawable ();
45
46 operator Drawable() { return drawable; }
47 operator XftDraw *();
48};
49
31struct rxvt_font { 50struct rxvt_font {
32 // managed by the fontset 51 // managed by the fontset
33 rxvt_t r; 52 rxvt_t r;
34 void set_term (rxvt_t r) { this->r = r; } 53 void set_term (rxvt_t r) { this->r = r; }
35 54
49 } 68 }
50 69
51 rxvt_font () { name = 0; } 70 rxvt_font () { name = 0; }
52 ~rxvt_font () { free (name); }; 71 ~rxvt_font () { free (name); };
53 72
54 void clear_rect (int x, int y, int w, int h, int color); 73 void clear_rect (rxvt_drawable &d, int x, int y, int w, int h, int color);
55 74
56 virtual void clear () { }; 75 virtual void clear () { };
57 76
58 virtual rxvt_fontprop properties () = 0; 77 virtual rxvt_fontprop properties () = 0;
59 78
60 virtual bool load (const rxvt_fontprop &prop) = 0; 79 virtual bool load (const rxvt_fontprop &prop) = 0;
61 virtual bool has_codepoint (uint32_t unicode) = 0; 80 virtual bool has_codepoint (uint32_t unicode) = 0;
62 81
63 virtual void draw (int x, int y, 82 virtual void draw (rxvt_drawable &d,
83 int x, int y,
64 const text_t *text, int len, 84 const text_t *text, int len,
65 int fg, int bg) = 0; 85 int fg, int bg) = 0;
66}; 86};
67 87
68#define FONT_UNREF(f) do { (f)->clear (); delete (f); } while (0) 88#define FONT_UNREF(f) do { (f)->clear (); delete (f); } while (0)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines