--- rxvt-unicode/src/rxvttoolkit.h 2011/02/11 11:26:30 1.51 +++ rxvt-unicode/src/rxvttoolkit.h 2012/06/14 17:16:05 1.67 @@ -3,7 +3,7 @@ *----------------------------------------------------------------------* * * All portions of code are copyright by their respective author/s. - * Copyright (c) 2003-2006 Marc Lehmann + * Copyright (c) 2003-2011 Marc Lehmann * Copyright (c) 2011 Emanuele Giaquinta * * This program is free software; you can redistribute it and/or modify @@ -180,7 +180,7 @@ ///////////////////////////////////////////////////////////////////////////// -#ifdef USE_XIM +#if USE_XIM struct rxvt_xim : refcounted { void destroy (); @@ -214,10 +214,17 @@ #endif void set (rxvt_display *disp); - void select_visual (int bitdepth); + void select_visual (int id); + void select_depth (int bitdepth); // select visual by depth void clear (); }; +enum +{ + DISPLAY_HAS_RENDER = 1 << 0, + DISPLAY_HAS_RENDER_CONV = 1 << 1, +}; + struct rxvt_display : refcounted { event_vec xw; @@ -225,7 +232,7 @@ ev::prepare flush_ev; void flush_cb (ev::prepare &w, int revents); ev::io x_ev ; void x_cb (ev::io &w, int revents); -#ifdef USE_XIM +#if USE_XIM refcache xims; vector imw; @@ -244,6 +251,7 @@ #ifdef POINTER_BLANK Cursor blank_cursor; #endif + uint8_t flags; rxvt_display (const char *id); XrmDatabase get_resources (bool refresh); @@ -257,12 +265,13 @@ } Atom atom (const char *name); + Pixmap get_pixmap_property (Atom property); void set_selection_owner (rxvt_term *owner, bool clipboard); void reg (xevent_watcher *w); void unreg (xevent_watcher *w); -#ifdef USE_XIM +#if USE_XIM void reg (im_watcher *w); void unreg (im_watcher *w); @@ -271,7 +280,7 @@ #endif }; -#ifdef USE_XIM +#if USE_XIM struct im_watcher : rxvt_watcher, callback { void start (rxvt_display *display) @@ -310,14 +319,14 @@ struct rgba { - unsigned short r, g, b, a; + uint16_t r, g, b, a; enum { MIN_CC = 0x0000, MAX_CC = 0xffff }; rgba () { } - rgba (unsigned short r, unsigned short g, unsigned short b, unsigned short a = MAX_CC) + rgba (uint16_t r, uint16_t g, uint16_t b, uint16_t a = MAX_CC) : r(r), g(g), b(b), a(a) { } }; @@ -347,8 +356,14 @@ bool alloc (rxvt_screen *screen, const rgba &color); void free (rxvt_screen *screen); - void get (rgba &color); - void get (XColor &color); + operator rgba () const + { + rgba c; + get (c); + return c; + } + void get (rgba &color) const; + void get (XColor &color) const; bool set (rxvt_screen *screen, const char *name); bool set (rxvt_screen *screen, const rgba &color); @@ -365,21 +380,21 @@ #define Sel_CompoundText 0x10 /* last request was COMPOUND_TEXT */ #define Sel_UTF8String 0x20 /* last request was UTF8_STRING */ -typedef void (*sel_cb)(char *data, unsigned int len, struct rxvt_selection *rs, void *ptr); - struct rxvt_selection { - rxvt_selection (rxvt_display *disp, int selnum, Time tm, Window win, Atom prop, sel_cb cb, void *ptr); + rxvt_selection (rxvt_display *disp, int selnum, Time tm, Window win, Atom prop, rxvt_term *term); + void run (); ~rxvt_selection (); -private: + rxvt_term *term; // terminal to paste to, may be 0 + void *cb_sv; // managed by perl + rxvt_display *display; Time request_time; Window request_win; Atom request_prop; - sel_cb request_cb; - void *user_data; +private: unsigned char selection_wait; unsigned char selection_type; @@ -389,6 +404,7 @@ void timer_cb (ev::timer &w, int revents); ev::timer timer_ev; void x_cb (XEvent &xev); xevent_watcher x_ev; + void finish (char *data = 0, unsigned int len = 0); void stop (); bool request (Atom target, int selnum); void handle_selection (Window win, Atom prop, bool delete_prop);