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.59 by sf-exg, Sun Jun 3 15:50:22 2012 UTC vs.
Revision 1.69 by sf-exg, Sat Dec 29 14:23:35 2012 UTC

66#endif 66#endif
67#if USE_XIM 67#if USE_XIM
68 XA_WM_LOCALE_NAME, 68 XA_WM_LOCALE_NAME,
69 XA_XIM_SERVERS, 69 XA_XIM_SERVERS,
70#endif 70#endif
71#if ENABLE_TRANSPARENCY 71#if BG_IMAGE_FROM_ROOT || ENABLE_PERL
72 XA_XROOTPMAP_ID, 72 XA_XROOTPMAP_ID,
73 XA_ESETROOT_PMAP_ID, 73 XA_ESETROOT_PMAP_ID,
74#endif 74#endif
75#if ENABLE_XEMBED 75#if ENABLE_XEMBED
76 XA_XEMBED, 76 XA_XEMBED,
178#endif 178#endif
179}; 179};
180 180
181///////////////////////////////////////////////////////////////////////////// 181/////////////////////////////////////////////////////////////////////////////
182 182
183#ifdef USE_XIM 183#if USE_XIM
184struct rxvt_xim : refcounted 184struct rxvt_xim : refcounted
185{ 185{
186 void destroy (); 186 void destroy ();
187 rxvt_display *display; 187 rxvt_display *display;
188 188
212 212
213 rxvt_screen (); 213 rxvt_screen ();
214#endif 214#endif
215 215
216 void set (rxvt_display *disp); 216 void set (rxvt_display *disp);
217 void select_visual (int bitdepth); 217 void select_visual (int id);
218 void select_depth (int bitdepth); // select visual by depth
218 void clear (); 219 void clear ();
219}; 220};
220 221
221enum { 222enum
223{
222 DISPLAY_HAS_RENDER = 1 << 0, 224 DISPLAY_HAS_RENDER = 1 << 0,
223 DISPLAY_HAS_RENDER_MUL = 1 << 1,
224 DISPLAY_HAS_RENDER_CONV = 1 << 2, 225 DISPLAY_HAS_RENDER_CONV = 1 << 1,
225}; 226};
226 227
227struct rxvt_display : refcounted 228struct rxvt_display : refcounted
228{ 229{
229 event_vec<xevent_watcher> xw; 230 event_vec<xevent_watcher> xw;
230 231
231 ev::prepare flush_ev; void flush_cb (ev::prepare &w, int revents); 232 ev::prepare flush_ev; void flush_cb (ev::prepare &w, int revents);
232 ev::io x_ev ; void x_cb (ev::io &w, int revents); 233 ev::io x_ev ; void x_cb (ev::io &w, int revents);
233 234
234#ifdef USE_XIM 235#if USE_XIM
235 refcache<rxvt_xim> xims; 236 refcache<rxvt_xim> xims;
236 vector<im_watcher *> imw; 237 vector<im_watcher *> imw;
237 238
238 void im_change_cb (); 239 void im_change_cb ();
239 void im_change_check (); 240 void im_change_check ();
262 { 263 {
263 flush_ev.start (); 264 flush_ev.start ();
264 } 265 }
265 266
266 Atom atom (const char *name); 267 Atom atom (const char *name);
268 Pixmap get_pixmap_property (Atom property);
267 void set_selection_owner (rxvt_term *owner, bool clipboard); 269 void set_selection_owner (rxvt_term *owner, bool clipboard);
268 270
269 void reg (xevent_watcher *w); 271 void reg (xevent_watcher *w);
270 void unreg (xevent_watcher *w); 272 void unreg (xevent_watcher *w);
271 273
272#ifdef USE_XIM 274#if USE_XIM
273 void reg (im_watcher *w); 275 void reg (im_watcher *w);
274 void unreg (im_watcher *w); 276 void unreg (im_watcher *w);
275 277
276 rxvt_xim *get_xim (const char *locale, const char *modifiers); 278 rxvt_xim *get_xim (const char *locale, const char *modifiers);
277 void put_xim (rxvt_xim *xim); 279 void put_xim (rxvt_xim *xim);
278#endif 280#endif
279}; 281};
280 282
281#ifdef USE_XIM 283#if USE_XIM
282struct im_watcher : rxvt_watcher, callback<void (void)> 284struct im_watcher : rxvt_watcher, callback<void (void)>
283{ 285{
284 void start (rxvt_display *display) 286 void start (rxvt_display *display)
285 { 287 {
286 display->reg (this); 288 display->reg (this);
315 317
316typedef unsigned long Pixel; 318typedef unsigned long Pixel;
317 319
318struct rgba 320struct rgba
319{ 321{
320 unsigned short r, g, b, a; 322 uint16_t r, g, b, a;
321 323
322 enum { MIN_CC = 0x0000, MAX_CC = 0xffff }; 324 enum { MIN_CC = 0x0000, MAX_CC = 0xffff };
323 325
324 rgba () 326 rgba ()
325 { } 327 { }
326 328
327 rgba (unsigned short r, unsigned short g, unsigned short b, unsigned short a = MAX_CC) 329 rgba (uint16_t r, uint16_t g, uint16_t b, uint16_t a = MAX_CC)
328 : r(r), g(g), b(b), a(a) 330 : r(r), g(g), b(b), a(a)
329 { } 331 { }
330}; 332};
331 333
332struct rxvt_color 334struct rxvt_color
352 } 354 }
353 355
354 bool alloc (rxvt_screen *screen, const rgba &color); 356 bool alloc (rxvt_screen *screen, const rgba &color);
355 void free (rxvt_screen *screen); 357 void free (rxvt_screen *screen);
356 358
359 operator rgba () const
360 {
361 rgba c;
362 get (c);
363 return c;
364 }
357 void get (rgba &color); 365 void get (rgba &color) const;
358 void get (XColor &color); 366 void get (XColor &color) const;
359 367
360 bool set (rxvt_screen *screen, const char *name); 368 bool set (rxvt_screen *screen, const char *name);
361 bool set (rxvt_screen *screen, const rgba &color); 369 bool set (rxvt_screen *screen, const rgba &color);
362 370
363 void fade (rxvt_screen *screen, int percent, rxvt_color &result, const rgba &to = rgba (0, 0, 0)); 371 void fade (rxvt_screen *screen, int percent, rxvt_color &result, const rgba &to = rgba (0, 0, 0));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines