1 | /*----------------------------------------------------------------------* |
1 | /*----------------------------------------------------------------------* |
2 | * File: rxvttoolkit.h - provide toolkit-functionality for rxvt. |
2 | * File: rxvttoolkit.h - provide toolkit-functionality for rxvt. |
3 | *----------------------------------------------------------------------* |
3 | *----------------------------------------------------------------------* |
4 | * |
4 | * |
5 | * All portions of code are copyright by their respective author/s. |
5 | * All portions of code are copyright by their respective author/s. |
6 | * Copyright (c) 2003-2006 Marc Lehmann <pcg@goof.com> |
6 | * Copyright (c) 2003-2011 Marc Lehmann <schmorp@schmorp.de> |
|
|
7 | * Copyright (c) 2011 Emanuele Giaquinta <e.giaquinta@glauco.it> |
7 | * |
8 | * |
8 | * This program is free software; you can redistribute it and/or modify |
9 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by |
10 | * it under the terms of the GNU General Public License as published by |
10 | * the Free Software Foundation; either version 2 of the License, or |
11 | * the Free Software Foundation; either version 2 of the License, or |
11 | * (at your option) any later version. |
12 | * (at your option) any later version. |
… | |
… | |
353 | bool set (rxvt_screen *screen, const rgba &color); |
354 | bool set (rxvt_screen *screen, const rgba &color); |
354 | |
355 | |
355 | void fade (rxvt_screen *screen, int percent, rxvt_color &result, const rgba &to = rgba (0, 0, 0)); |
356 | void fade (rxvt_screen *screen, int percent, rxvt_color &result, const rgba &to = rgba (0, 0, 0)); |
356 | }; |
357 | }; |
357 | |
358 | |
358 | #if TRACE_PIXMAPS |
359 | #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); |
360 | #define Sel_incr 0x02 /* incremental selection */ |
360 | void trace_XFreePixmap (const char *file, int line, Display *dpy, Pixmap p); |
361 | #define Sel_Primary 0x01 |
|
|
362 | #define Sel_Secondary 0x02 |
|
|
363 | #define Sel_Clipboard 0x03 |
|
|
364 | #define Sel_whereMask 0x0f |
|
|
365 | #define Sel_CompoundText 0x10 /* last request was COMPOUND_TEXT */ |
|
|
366 | #define Sel_UTF8String 0x20 /* last request was UTF8_STRING */ |
361 | |
367 | |
362 | # define XCreatePixmap(dpy,r,w,h,d) trace_XCreatePixmap (__FILE__,__LINE__,dpy,r,w,h,d) |
368 | struct rxvt_selection |
363 | # define XFreePixmap(dpy,p) trace_XFreePixmap (__FILE__,__LINE__,dpy,p) |
369 | { |
364 | #endif |
370 | rxvt_selection (rxvt_display *disp, int selnum, Time tm, Window win, Atom prop, rxvt_term *term); |
|
|
371 | void run (); |
|
|
372 | ~rxvt_selection (); |
365 | |
373 | |
366 | #endif |
374 | rxvt_term *term; // terminal to paste to, may be 0 |
|
|
375 | void *cb_sv; // managed by perl |
367 | |
376 | |
|
|
377 | rxvt_display *display; |
|
|
378 | Time request_time; |
|
|
379 | Window request_win; |
|
|
380 | Atom request_prop; |
|
|
381 | |
|
|
382 | private: |
|
|
383 | unsigned char selection_wait; |
|
|
384 | unsigned char selection_type; |
|
|
385 | |
|
|
386 | char *incr_buf; |
|
|
387 | size_t incr_buf_size, incr_buf_fill; |
|
|
388 | |
|
|
389 | void timer_cb (ev::timer &w, int revents); ev::timer timer_ev; |
|
|
390 | void x_cb (XEvent &xev); xevent_watcher x_ev; |
|
|
391 | |
|
|
392 | void finish (char *data = 0, unsigned int len = 0); |
|
|
393 | void stop (); |
|
|
394 | bool request (Atom target, int selnum); |
|
|
395 | void handle_selection (Window win, Atom prop, bool delete_prop); |
|
|
396 | }; |
|
|
397 | |
|
|
398 | #endif |
|
|
399 | |