--- rxvt-unicode/src/background.h 2007/12/14 06:29:28 1.12 +++ rxvt-unicode/src/background.h 2010/09/08 22:17:06 1.21 @@ -11,50 +11,67 @@ # 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 */ +# define HAVE_BG_PIXMAP 1 /* to simplify further usage */ struct bgPixmap_t { bgPixmap_t (); void destroy (); enum { - geometrySet = (1UL<<0), - propScale = (1UL<<1), - geometryFlags = (geometrySet|propScale), - - tintSet = (1UL<<8), - tintNeeded = (1UL<<9), - tintWholesome = (1UL<<10), - tintServerSide = (1UL<<11), - tintFlags = (tintSet|tintServerSide|tintNeeded|tintWholesome), - blurNeeded = (1UL<<12), - blurServerSide = (1UL<<13), /* this don't work yet */ - - isTransparent = (1UL<<16), - isInvalid = (1UL<<17), - isVtOrigin = (1UL<<18), /* if set pixmap has origin at corner of - vt window instead of parent[0]! */ - hasChanged = (1UL<<19) + geometrySet = 1 << 0, + propScale = 1 << 1, + geometryFlags = geometrySet | propScale, + + tintSet = 1 << 8, + tintNeeded = 1 << 9, + tintWholesome = 1 << 10, + tintServerSide = 1 << 11, + tintFlags = tintSet | tintServerSide | tintNeeded | tintWholesome, + + blurNeeded = 1 << 12, + blurServerSide = 1 << 13, /* this doesn't work yet */ + + 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, }; - unsigned long flags; + unsigned int flags; enum { - transpPmapTiled = (1UL<<0), - transpPmapTinted = tintNeeded, - transpPmapBlured = blurNeeded, - transpTransformations = (tintNeeded|blurNeeded) - }; /* this flags are returned by make_transparency_pixmap if called */ + transpPmapTiled = 1 << 0, + transpPmapTinted = tintNeeded, + transpPmapBlured = 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; }; + 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 (ASImage *background, ARGB32 background_tint); # 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 { noScale = 0, windowScale = 100, @@ -67,7 +84,10 @@ unsigned int h_scale, v_scale;/* percents of the window size */ int h_align, v_align; /* percents of the window size: 0 - left align, 50 - center, 100 - right */ - void unset_geometry () { flags = flags & ~geometryFlags; }; + void unset_geometry () + { + flags = flags & ~geometryFlags; + }; bool set_geometry (const char *geom); void set_defaultGeometry () { @@ -98,7 +118,7 @@ unsigned long make_transparency_pixmap ();/* returns combination of the transpTransformations flags */ # endif - double invalid_since; + double invalid_since, valid_since; Pixmap pixmap; unsigned int pmap_width, pmap_height; @@ -107,7 +127,8 @@ bool window_size_sensitive (); bool window_position_sensitive (); - bool is_parentOrigin () { + bool is_parentOrigin () + { return !(flags & isVtOrigin); };