--- rxvt-unicode/src/rxvt.h 2012/11/30 07:02:12 1.510 +++ rxvt-unicode/src/rxvt.h 2012/12/31 12:05:46 1.517 @@ -77,10 +77,19 @@ # include #endif -#if defined(BG_IMAGE_FROM_FILE) || defined(ENABLE_TRANSPARENCY) +#if XRENDER && (HAVE_PIXBUF || ENABLE_TRANSPARENCY) # define HAVE_BG_PIXMAP 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 #include "encoding.h" #include "rxvtutil.h" @@ -582,7 +591,7 @@ #ifdef RXVT_SCROLLBAR Color_trough, #endif -#if ENABLE_TRANSPARENCY +#if BG_IMAGE_FROM_ROOT Color_tint, #endif #if OFF_FOCUS_FADING @@ -1174,52 +1183,43 @@ 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 +# 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 void tint_image (rxvt_img *img, rxvt_color &tint, bool tint_set, int shade); ev_tstamp bg_valid_since; - rxvt_img *bg_img; - bool bg_window_size_sensitive (); bool bg_window_position_sensitive (); void bg_render (); - void bg_invalidate () - { - bg_flags &= ~BG_IS_VALID; - } +#endif + +#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 @@ -1283,7 +1283,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