--- rxvt-unicode/src/rxvttoolkit.h 2011/02/12 00:30:01 1.52 +++ rxvt-unicode/src/rxvttoolkit.h 2012/06/10 15:01:14 1.65 @@ -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) @@ -347,8 +356,8 @@ bool alloc (rxvt_screen *screen, const rgba &color); void free (rxvt_screen *screen); - void get (rgba &color); - void get (XColor &color); + 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,22 +374,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; @@ -390,6 +398,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);