--- rxvt-unicode/src/background.h 2010/08/31 15:12:49 1.18 +++ rxvt-unicode/src/background.h 2010/11/01 14:58:44 1.34 @@ -11,6 +11,10 @@ # undef max #endif +#ifdef HAVE_PIXBUF +#include +#endif + #if defined(BG_IMAGE_FROM_FILE) || defined(ENABLE_TRANSPARENCY) # define HAVE_BG_PIXMAP 1 /* to simplify further usage */ struct bgPixmap_t @@ -21,22 +25,23 @@ enum { geometrySet = 1 << 0, propScale = 1 << 1, - geometryFlags = geometrySet | propScale, + rootAlign = 1 << 2, + geometryFlags = geometrySet | propScale | rootAlign, tintSet = 1 << 8, tintNeeded = 1 << 9, tintWholesome = 1 << 10, - tintServerSide = 1 << 11, - tintFlags = tintSet | tintServerSide | tintNeeded | tintWholesome, + tintFlags = tintSet | tintNeeded | tintWholesome, + + blurNeeded = 1 << 11, - blurNeeded = 1 << 12, - blurServerSide = 1 << 13, /* this doesn't work yet */ + HAS_RENDER = 1 << 12, + HAS_RENDER_CONV = 1 << 13, isTransparent = 1 << 16, isInvalid = 1 << 17, - isVtOrigin = 1 << 18, /* if set pixmap has origin at corner of - vt window instead of parent[0]! */ hasChanged = 1 << 19, + sizeSensitive = 1 << 20, }; unsigned int flags; @@ -44,23 +49,21 @@ enum { transpPmapTiled = 1 << 0, transpPmapTinted = tintNeeded, - transpPmapBlured = blurNeeded, + transpPmapBlurred = blurNeeded, transpTransformations = tintNeeded | blurNeeded, }; /* these flags are returned by make_transparency_pixmap if called */ - bool check_clearChanged () - { - bool r = flags & hasChanged; - flags &= ~hasChanged; - return r; - }; - # ifdef BG_IMAGE_FROM_FILE # ifdef HAVE_AFTERIMAGE ASImage *original_asim; - bool render_asim (unsigned long background_flags); # endif +# ifdef HAVE_PIXBUF + GdkPixbuf *pixbuf; +# endif + + void get_image_geometry (int image_width, int image_height, int &w, int &h, int &x, int &y); + bool render_image (unsigned long background_flags); bool have_image; enum { @@ -69,7 +72,6 @@ defaultScale = windowScale, centerAlign = 50, defaultAlign = centerAlign, - rootAlign = -10000 }; unsigned int h_scale, v_scale;/* percents of the window size */ @@ -91,10 +93,9 @@ # endif /* BG_IMAGE_FROM_FILE */ rxvt_term *target; - bool set_target (rxvt_term *new_target); + void set_target (rxvt_term *new_target); # ifdef ENABLE_TRANSPARENCY - int root_depth; /* obtained when target is set */ Pixmap root_pixmap; /* current root pixmap set */ rxvt_color tint; int shade; @@ -105,7 +106,9 @@ bool set_tint (rxvt_color &new_tint); bool unset_tint (); bool set_shade (const char *shade_str); - bool set_root_pixmap (); + bool blur_pixmap (Pixmap pixmap, Visual *visual, int width, int height); + bool tint_pixmap (Pixmap pixmap, Visual *visual, int width, int height); + void set_root_pixmap (); unsigned long make_transparency_pixmap ();/* returns combination of the transpTransformations flags */ # endif @@ -118,11 +121,6 @@ bool window_size_sensitive (); bool window_position_sensitive (); - bool is_parentOrigin () - { - return !(flags & isVtOrigin); - }; - bool need_client_side_rendering (); void apply (); bool render ();