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

Comparing rxvt-unicode/src/rxvttoolkit.h (file contents):
Revision 1.13 by root, Sun Jan 29 20:51:28 2006 UTC vs.
Revision 1.25 by root, Sat Feb 18 15:48:23 2006 UTC

28 XA_VT_SELECTION, 28 XA_VT_SELECTION,
29 XA_INCR, 29 XA_INCR,
30 XA_WM_PROTOCOLS, 30 XA_WM_PROTOCOLS,
31 XA_WM_DELETE_WINDOW, 31 XA_WM_DELETE_WINDOW,
32 XA_CLIPBOARD, 32 XA_CLIPBOARD,
33 XA_AVERAGE_WIDTH,
34 XA_WEIGHT_NAME,
35 XA_SLANT,
36 XA_CHARSET_REGISTRY,
37 XA_CHARSET_ENCODING,
33#if ENABLE_FRILLS 38#if ENABLE_FRILLS
34 XA_MOTIF_WM_HINTS, 39 XA_MOTIF_WM_HINTS,
35#endif 40#endif
36#if ENABLE_EWMH 41#if ENABLE_EWMH
37 XA_NET_WM_PID, 42 XA_NET_WM_PID,
49#endif 54#endif
50#if ENABLE_XEMBED 55#if ENABLE_XEMBED
51 XA_XEMBED, 56 XA_XEMBED,
52 XA_XEMBED_INFO, 57 XA_XEMBED_INFO,
53#endif 58#endif
59#if !ENABLE_MINIMAL
60 // these are usually allocated by other subsystens, but we do it
61 // here to avoid a server roundtrip.
62 XA_SCREEN_RESOURCES,
63 XA_XDCCC_LINEAR_RGB_CORRECTION,
64 XA_XDCCC_LINEAR_RGB_MATRICES,
65 XA_WM_COLORMAP_WINDOWS,
66 XA_WM_STATE,
67 XA_cursor,
68# if USE_XIM
69 // various selection targets used by XIM
70 XA_TRANSPORT,
71 XA_LOCALES,
72 XA__XIM_PROTOCOL,
73 XA__XIM_XCONNECT,
74 XA__XIM_MOREDATA,
75# endif
76#endif
54 NUM_XA 77 NUM_XA
55}; 78};
56 79
57struct rxvt_term; 80struct rxvt_term;
58struct rxvt_display; 81struct rxvt_display;
82 } 105 }
83}; 106};
84 107
85///////////////////////////////////////////////////////////////////////////// 108/////////////////////////////////////////////////////////////////////////////
86 109
110struct rxvt_screen;
111
112struct rxvt_drawable {
113 rxvt_screen *screen;
114 Drawable drawable;
115 operator Drawable() { return drawable; }
116
117#if XFT
118 XftDraw *xftdrawable;
119 operator XftDraw *();
120#endif
121
122 rxvt_drawable (rxvt_screen *screen, Drawable drawable)
123 : screen(screen),
124#if XFT
125 xftdrawable(0),
126#endif
127 drawable(drawable)
128 { }
129
130#if XFT
131 ~rxvt_drawable ();
132#endif
133};
134
135/////////////////////////////////////////////////////////////////////////////
136
87#ifdef USE_XIM 137#ifdef USE_XIM
88struct rxvt_xim : refcounted { 138struct rxvt_xim : refcounted {
89 void destroy (); 139 void destroy ();
90 rxvt_display *display; 140 rxvt_display *display;
91 141
98}; 148};
99#endif 149#endif
100 150
101struct rxvt_screen { 151struct rxvt_screen {
102 rxvt_display *display; 152 rxvt_display *display;
103 Display *xdisp; 153 Display *dpy;
104 int depth; 154 int depth;
105 Visual *visual; 155 Visual *visual;
106 Colormap cmap; 156 Colormap cmap;
107 157
158#if XFT
159 // scratch pixmap
160 rxvt_drawable *scratch_area;
161 int scratch_w, scratch_h;
162
163 rxvt_drawable &scratch_drawable (int w, int h);
164
165 rxvt_screen ();
166#endif
167
108 void set (rxvt_display *disp); 168 void set (rxvt_display *disp);
109 void set (rxvt_display *disp, int bitdepth); 169 void set (rxvt_display *disp, int bitdepth);
110 void clear (); 170 void clear ();
111}; 171};
112 172
122 void im_change_cb (); 182 void im_change_cb ();
123 void im_change_check (); 183 void im_change_check ();
124#endif 184#endif
125 185
126//public 186//public
127 Display *display; 187 Display *dpy;
128 int screen; 188 int screen;
129 Window root; 189 Window root;
130 rxvt_term *selection_owner; 190 rxvt_term *selection_owner;
131 Atom xa[NUM_XA]; 191 Atom xa[NUM_XA];
132#ifndef NO_SLOW_LINK_SUPPORT
133 bool is_local; 192 bool is_local;
134#endif
135#ifdef POINTER_BLANK 193#ifdef POINTER_BLANK
136 Cursor blank_cursor; 194 Cursor blank_cursor;
137#endif 195#endif
138 196
139 rxvt_display (const char *id); 197 rxvt_display (const char *id);
140 XrmDatabase get_resources (); 198 XrmDatabase get_resources (bool refresh);
141 bool ref_init (); 199 bool ref_init ();
142 void ref_next (); 200 void ref_next ();
143 ~rxvt_display (); 201 ~rxvt_display ();
144 202
145 void flush (); 203 void flush ();
199 257
200///////////////////////////////////////////////////////////////////////////// 258/////////////////////////////////////////////////////////////////////////////
201 259
202typedef unsigned long Pixel; 260typedef unsigned long Pixel;
203 261
204struct rxvt_rgba { 262struct rgba {
205 unsigned short r, g, b, a; 263 unsigned short r, g, b, a;
206 264
207 enum { MIN_CC = 0x0000, MAX_CC = 0xffff }; 265 enum { MIN_CC = 0x0000, MAX_CC = 0xffff };
208 266
209 rxvt_rgba () 267 rgba ()
210 { } 268 { }
211 269
212 rxvt_rgba (unsigned short r, unsigned short g, unsigned short b, unsigned short a = MAX_CC) 270 rgba (unsigned short r, unsigned short g, unsigned short b, unsigned short a = MAX_CC)
213 : r(r), g(g), b(b), a(a) 271 : r(r), g(g), b(b), a(a)
214 { } 272 { }
215}; 273};
216 274
217struct rxvt_color { 275struct rxvt_color {
218#if XFT 276#if XFT
219 XftColor c; 277 XftColor c;
278#else
279 XColor c;
280#endif
281
220 operator Pixel () const { return c.pixel; } 282 operator Pixel () const { return c.pixel; }
221#else
222 Pixel p;
223 operator Pixel () const { return p; }
224#endif
225 283
226 bool operator == (const rxvt_color &b) const { return Pixel (*this) == Pixel (b); } 284 bool operator == (const rxvt_color &b) const { return Pixel (*this) == Pixel (b); }
227 bool operator != (const rxvt_color &b) const { return Pixel (*this) != Pixel (b); } 285 bool operator != (const rxvt_color &b) const { return Pixel (*this) != Pixel (b); }
228 286
229 void get (rxvt_screen *screen, rxvt_rgba &rgba); 287 bool alloc (rxvt_screen *screen, const rgba &color);
288 void free (rxvt_screen *screen);
289
290 void get (rgba &color);
291 void get (XColor &color);
230 292
231 bool set (rxvt_screen *screen, const char *name); 293 bool set (rxvt_screen *screen, const char *name);
232 bool set (rxvt_screen *screen, rxvt_rgba rgba); 294 bool set (rxvt_screen *screen, const rgba &color);
233 295
234 rxvt_color fade (rxvt_screen *screen, int percent); // fades to black 296 void fade (rxvt_screen *screen, int percent, rxvt_color &result, const rgba &to = rgba (0, 0, 0));
235 rxvt_color fade (rxvt_screen *screen, int percent, rxvt_color &fadeto);
236
237 void free (rxvt_screen *screen);
238}; 297};
239 298
240#endif 299#endif
241 300

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines