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.42 by root, Wed Jan 23 05:59:30 2008 UTC vs.
Revision 1.50 by sf-exg, Fri Feb 11 01:24:46 2011 UTC

59#if ENABLE_EWMH 59#if ENABLE_EWMH
60 XA_NET_WM_PID, 60 XA_NET_WM_PID,
61 XA_NET_WM_NAME, 61 XA_NET_WM_NAME,
62 XA_NET_WM_ICON_NAME, 62 XA_NET_WM_ICON_NAME,
63 XA_NET_WM_PING, 63 XA_NET_WM_PING,
64 XA_NET_WM_ICON,
64#endif 65#endif
65#if USE_XIM 66#if USE_XIM
66 XA_WM_LOCALE_NAME, 67 XA_WM_LOCALE_NAME,
67 XA_XIM_SERVERS, 68 XA_XIM_SERVERS,
68#endif 69#endif
234//public 235//public
235 Display *dpy; 236 Display *dpy;
236 int screen; 237 int screen;
237 Window root; 238 Window root;
238 rxvt_term *selection_owner; 239 rxvt_term *selection_owner;
240 rxvt_term *clipboard_owner;
239 Atom xa[NUM_XA]; 241 Atom xa[NUM_XA];
240 bool is_local; 242 bool is_local;
241#ifdef POINTER_BLANK 243#ifdef POINTER_BLANK
242 Cursor blank_cursor; 244 Cursor blank_cursor;
243#endif 245#endif
252 { 254 {
253 flush_ev.start (); 255 flush_ev.start ();
254 } 256 }
255 257
256 Atom atom (const char *name); 258 Atom atom (const char *name);
257 void set_selection_owner (rxvt_term *owner); 259 void set_selection_owner (rxvt_term *owner, bool clipboard);
258 260
259 void reg (xevent_watcher *w); 261 void reg (xevent_watcher *w);
260 void unreg (xevent_watcher *w); 262 void unreg (xevent_watcher *w);
261 263
262#ifdef USE_XIM 264#ifdef USE_XIM
267 void put_xim (rxvt_xim *xim); 269 void put_xim (rxvt_xim *xim);
268#endif 270#endif
269}; 271};
270 272
271#ifdef USE_XIM 273#ifdef USE_XIM
272struct im_watcher : rxvt_watcher, callback<void (void)> { 274struct im_watcher : rxvt_watcher, callback<void (void)>
275{
273 void start (rxvt_display *display) 276 void start (rxvt_display *display)
274 { 277 {
275 display->reg (this); 278 display->reg (this);
276 } 279 }
277 280
332 bool operator != (const rxvt_color &b) const { return Pixel (*this) != Pixel (b); } 335 bool operator != (const rxvt_color &b) const { return Pixel (*this) != Pixel (b); }
333 336
334 bool is_opaque () const 337 bool is_opaque () const
335 { 338 {
336#if XFT 339#if XFT
337 //TODO: only supports 24 bit truecolour 340 return c.color.alpha == rgba::MAX_CC;
338 return c.color.alpha < 0xff00;
339#else 341#else
340 return 1; 342 return 1;
341#endif 343#endif
342 } 344 }
343 345
351 bool set (rxvt_screen *screen, const rgba &color); 353 bool set (rxvt_screen *screen, const rgba &color);
352 354
353 void fade (rxvt_screen *screen, int percent, rxvt_color &result, const rgba &to = rgba (0, 0, 0)); 355 void fade (rxvt_screen *screen, int percent, rxvt_color &result, const rgba &to = rgba (0, 0, 0));
354}; 356};
355 357
356#if TRACE_PIXMAPS 358#define Sel_normal 0x01 /* normal selection */
357Pixmap trace_XCreatePixmap (const char *file, int line, Display *dpy, Window r, unsigned int w, unsigned int h, unsigned int d); 359#define Sel_incr 0x02 /* incremental selection */
358void trace_XFreePixmap (const char *file, int line, Display *dpy, Pixmap p); 360#define Sel_Primary 0x01
361#define Sel_Secondary 0x02
362#define Sel_Clipboard 0x03
363#define Sel_whereMask 0x0f
364#define Sel_CompoundText 0x10 /* last request was COMPOUND_TEXT */
365#define Sel_UTF8String 0x20 /* last request was UTF8_STRING */
359 366
360# define XCreatePixmap(dpy,r,w,h,d) trace_XCreatePixmap (__FILE__,__LINE__,dpy,r,w,h,d) 367typedef void (*sel_cb)(char *data, unsigned int len, struct rxvt_selection *rs, void *ptr);
361# define XFreePixmap(dpy,p) trace_XFreePixmap (__FILE__,__LINE__,dpy,p)
362#endif
363 368
364#endif 369struct rxvt_selection
370{
371 rxvt_selection (rxvt_display *disp, int selnum, Time tm, Window win, Atom prop, sel_cb cb, void *ptr);
372 ~rxvt_selection ();
365 373
374private:
375 rxvt_display *display;
376 Time request_time;
377 Window request_win;
378 Atom request_prop;
379 sel_cb request_cb;
380 void *user_data;
381
382 unsigned char selection_wait;
383 unsigned char selection_type;
384
385 char *incr_buf;
386 size_t incr_buf_size, incr_buf_fill;
387
388 void timer_cb (ev::timer &w, int revents); ev::timer timer_ev;
389 void x_cb (XEvent &xev); xevent_watcher x_ev;
390
391 void stop ();
392 bool request (Atom target, int selnum);
393 void handle_selection (Window win, Atom prop, bool delete_prop);
394};
395
396#endif
397

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines