--- rxvt-unicode/src/rxvt.h 2012/06/07 09:34:51 1.504 +++ rxvt-unicode/src/rxvt.h 2014/08/16 10:51:23 1.534 @@ -77,8 +77,18 @@ # include #endif -#if defined(BG_IMAGE_FROM_FILE) || defined(ENABLE_TRANSPARENCY) +#if XRENDER && (HAVE_PIXBUF || ENABLE_TRANSPARENCY) # define HAVE_BG_PIXMAP 1 +# define HAVE_IMG 1 +#endif + +#if HAVE_BG_PIXMAP +# if HAVE_PIXBUF +# define BG_IMAGE_FROM_FILE 1 +# endif +# if ENABLE_TRANSPARENCY +# define BG_IMAGE_FROM_ROOT 1 +# endif #endif #include @@ -245,7 +255,6 @@ # if BG_IMAGE_FROM_FILE enum { - IM_IS_SET = 1 << 0, IM_IS_SIZE_SENSITIVE = 1 << 1, IM_KEEP_ASPECT = 1 << 2, IM_ROOT_ALIGN = 1 << 3, @@ -276,28 +285,17 @@ || (!(flags & IM_ROOT_ALIGN) && (h_align || v_align))); } -# if HAVE_PIXBUF - GdkPixbuf *pixbuf; + rxvt_img *img; void destroy () { - if (pixbuf) - g_object_unref (pixbuf); - } - - int width () - { - return gdk_pixbuf_get_width (pixbuf); - } - int height () - { - return gdk_pixbuf_get_height (pixbuf); + delete img; + img = 0; } -# endif rxvt_image (); - bool set_file_geometry (const char *file); - bool set_file (const char *file); + void set_file_geometry (rxvt_screen *s, const char *file); + void set_file (rxvt_screen *s, const char *file); bool set_geometry (const char *geom, bool update = false); }; # endif @@ -405,9 +403,9 @@ /* modes for rxvt_term::scr_page () - scroll page. used by scrollbar window */ enum page_dirn { - UP, - DN, - NO_DIR, + DN = -1, + NO_DIR = 0, + UP = 1, }; /* arguments for rxvt_term::scr_change_screen () */ @@ -594,7 +592,7 @@ #ifdef RXVT_SCROLLBAR Color_trough, #endif -#if ENABLE_TRANSPARENCY +#if BG_IMAGE_FROM_ROOT Color_tint, #endif #if OFF_FOCUS_FADING @@ -666,7 +664,7 @@ // do not change these constants lightly, there are many interdependencies #define IMBUFSIZ 128 // input modifier buffer sizes #define KBUFSZ 512 // size of keyboard mapping buffer -#define CBUFSIZ 2048 // size of command buffer +#define CBUFSIZ 32768 // size of command buffer (longest command sequence possible) #define CBUFCNT 8 // never call pty_fill/cmd_parse more than this often in a row #define UBUFSIZ 2048 // character buffer @@ -1148,7 +1146,6 @@ /* ---------- */ #ifdef SELECTION_SCROLLING int scroll_selection_lines; - enum page_dirn scroll_selection_dir; int selection_save_x, selection_save_y, selection_save_state; @@ -1167,6 +1164,7 @@ # ifdef POINTER_BLANK pointerBlankDelay, # endif + multiClickTime, allowedxerror; /* ---------- */ unsigned int ModLevel3Mask, @@ -1186,63 +1184,41 @@ XComposeStatus compose; static struct termios def_tio; row_col_t oldcursor; + #ifdef HAVE_BG_PIXMAP void bg_init (); void bg_destroy (); - enum { - BG_IS_VALID = 1 << 0, - - BG_IS_TRANSPARENT = 1 << 1, - BG_NEEDS_REFRESH = 1 << 2, - BG_INHIBIT_RENDER = 1 << 3, - }; - - uint8_t bg_flags; - # if BG_IMAGE_FROM_FILE rxvt_image fimage; - void get_image_geometry (rxvt_image &image, int &w, int &h, int &x, int &y); - bool render_image (rxvt_image &image); + void render_image (rxvt_image &image); # endif -# if ENABLE_TRANSPARENCY - Pixmap root_pixmap; /* current root pixmap set */ +# if BG_IMAGE_FROM_ROOT + rxvt_img *root_img; image_effects root_effects; - void bg_set_transparent () - { - bg_flags |= BG_IS_TRANSPARENT; - } - void bg_set_root_pixmap (); - bool render_root_image (); + void render_root_image (); # endif - bool blur_pixmap (Pixmap pixmap, int width, int height, bool argb, int h_blurRadius, int v_blurRadius); - bool tint_pixmap (Pixmap pixmap, int width, int height, bool argb, rxvt_color &tint, bool tint_set, int shade); - void tint_ximage (XImage *ximage, rxvt_color &tint, bool tint_set, int shade); - ev_tstamp bg_valid_since; - Pixmap bg_pixmap; - unsigned int bg_pmap_width, bg_pmap_height; - - int target_x; - int target_y; - bool bg_set_position (int x, int y); bool bg_window_size_sensitive (); bool bg_window_position_sensitive (); void bg_render (); - void bg_invalidate () - { - bg_flags &= ~BG_IS_VALID; - } #endif -#if HAVE_PIXBUF - bool pixbuf_to_pixmap (GdkPixbuf *pixbuf, Pixmap pixmap, GC gc, - int src_x, int src_y, int dst_x, int dst_y, - unsigned int width, unsigned int height, bool argb); + +#ifdef HAVE_IMG + enum { + BG_IS_TRANSPARENT = 1 << 1, + BG_NEEDS_REFRESH = 1 << 2, + BG_INHIBIT_RENDER = 1 << 3, + }; + + uint8_t bg_flags; + + rxvt_img *bg_img; #endif #if ENABLE_OVERLAY @@ -1306,7 +1282,7 @@ XSelectInput (dpy, vt, vt_emask | vt_emask_perl | vt_emask_xim | vt_emask_mouse); } -#if ENABLE_TRANSPARENCY || ENABLE_PERL +#if BG_IMAGE_FROM_ROOT || ENABLE_PERL void rootwin_cb (XEvent &xev); xevent_watcher rootwin_ev; #endif @@ -1359,7 +1335,9 @@ void pointer_unblank (); void tt_printf (const char *fmt,...); + void tt_write_ (const char *data, unsigned int len); void tt_write (const char *data, unsigned int len); + void tt_write_user_input (const char *data, unsigned int len); void pty_write (); void make_current () const // make this the "currently active" urxvt instance @@ -1427,6 +1405,7 @@ int privcases (int mode, unsigned long bit); void process_terminal_mode (int mode, int priv, unsigned int nargs, const int *arg); void process_sgr_mode (unsigned int nargs, const int *arg); + void set_cursor_style (int style); // init.C void init (stringvec *argv, stringvec *envv); void init (int argc, const char *const *argv, const char *const *envv); @@ -1468,6 +1447,13 @@ // screen.C + bool option (uint8_t opt) const NOTHROW + { + return options[opt >> 3] & (1 << (opt & 7)); + } + + void set_option (uint8_t opt, bool set = true) NOTHROW; + int fgcolor_of (rend_t r) const NOTHROW { int base = GET_BASEFG (r); @@ -1496,13 +1482,6 @@ return base; } - bool option (uint8_t opt) const NOTHROW - { - return options[opt >> 3] & (1 << (opt & 7)); - } - - void set_option (uint8_t opt, bool set = true) NOTHROW; - // modifies first argument(!) void tt_paste (char *data, unsigned int len) NOTHROW; void paste (char *data, unsigned int len) NOTHROW; @@ -1510,7 +1489,9 @@ void scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs) const NOTHROW; void scr_blank_screen_mem (line_t &l, rend_t efs) const NOTHROW; void scr_kill_char (line_t &l, int col) const NOTHROW; + void scr_set_char_rend (line_t &l, int col, rend_t rend); int scr_scroll_text (int row1, int row2, int count) NOTHROW; + void copy_line (line_t &dst, line_t &src); void scr_reset (); void scr_release () NOTHROW; void scr_clear (bool really = false) NOTHROW; @@ -1559,7 +1540,11 @@ void scr_charset_choose (int set) NOTHROW; void scr_charset_set (int set, unsigned int ch) NOTHROW; void scr_move_to (int y, int len) NOTHROW; - bool scr_page (enum page_dirn direction, int nlines) NOTHROW; + bool scr_page (int nlines) NOTHROW; + bool scr_page (enum page_dirn direction, int nlines) NOTHROW + { + return scr_page (direction * nlines); + } bool scr_changeview (int new_view_start) NOTHROW; void scr_bell () NOTHROW; void scr_printscreen (int fullhist) NOTHROW; @@ -1569,6 +1554,7 @@ void scr_dump (int fd) NOTHROW; void selection_check (int check_more) NOTHROW; + void selection_changed () NOTHROW; /* sets want_refresh, corrects coordinates */ void selection_request (Time tm, int selnum = Sel_Primary) NOTHROW; void selection_clear (bool clipboard = false) NOTHROW; void selection_make (Time tm); @@ -1585,19 +1571,11 @@ // xdefaults.C void rxvt_usage (int type); const char **get_options (int argc, const char *const *argv); - int parse_keysym (const char *str, const char *arg); + int bind_action (const char *str, const char *arg); const char *x_resource (const char *name); void extract_resources (); + void enumerate_keysym_resources (void (*cb)(rxvt_term *, const char *, const char *)); void extract_keysym_resources (); - void find_resources (const char *n_prefix, const char *c_prefix, int mode, - Bool (*proc)(XrmDatabase *, XrmBindingList, XrmQuarkList, XrmRepresentation *, XrmValue *, XPointer)); - bool parse_bool_resource (const char *str) - { - return (!strcasecmp (str, "TRUE") - || !strcasecmp (str, "YES") - || !strcasecmp (str, "ON") - || !strcasecmp (str, "1")); - } }; #endif /* _RXVT_H_ */