… | |
… | |
353 | bool set (rxvt_screen *screen, const rgba &color); |
353 | bool set (rxvt_screen *screen, const rgba &color); |
354 | |
354 | |
355 | 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)); |
356 | }; |
356 | }; |
357 | |
357 | |
358 | #if TRACE_PIXMAPS |
358 | #define Sel_normal 0x01 /* normal selection */ |
359 | Pixmap 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 */ |
360 | void 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 */ |
361 | |
366 | |
362 | # define XCreatePixmap(dpy,r,w,h,d) trace_XCreatePixmap (__FILE__,__LINE__,dpy,r,w,h,d) |
367 | typedef void (*sel_cb)(char *data, unsigned int len, struct rxvt_selection *rs, void *ptr); |
363 | # define XFreePixmap(dpy,p) trace_XFreePixmap (__FILE__,__LINE__,dpy,p) |
|
|
364 | #endif |
|
|
365 | |
368 | |
366 | #endif |
369 | struct 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 (); |
367 | |
373 | |
|
|
374 | private: |
|
|
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 | |