--- rxvt-unicode/src/rxvt.h 2007/08/09 22:08:21 1.290 +++ rxvt-unicode/src/rxvt.h 2007/08/17 22:01:33 1.294 @@ -175,50 +175,90 @@ #if defined(XPM_BACKGROUND) || defined(ENABLE_TRANSPARENCY) # define HAVE_BG_PIXMAP 1/* to simplify further usage */ struct bgPixmap_t { -# define bgPmap_geometrySet (1UL<<0) -# define bgPmap_propScale (1UL<<1) -# define bgPmap_geometryFlags (bgPmap_geometrySet|bgPmap_propScale) -# define bgPmap_Transparent (1UL<<16) + enum { + geometrySet = (1UL<<0), + propScale = (1UL<<1), + geometryFlags = (geometrySet|propScale), + + tintSet = (1UL<<8), + tintNeeded = (1UL<<9), + tintServerSide = (1UL<<10), + tintFlags = (tintSet|tintServerSide|tintNeeded), + blurNeeded = (1UL<<11), + + isTransparent = (1UL<<16), + isInvalid = (1UL<<17) + }; + unsigned long flags; + enum { + transpPmapTiled = (1UL<<0), + transpPmapTinted = tintNeeded, + transpPmapBlured = blurNeeded, + transpTransformations = (tintNeeded|blurNeeded) + }; /* this flags are returned by make_transparency_pixmap if called */ + # ifdef XPM_BACKGROUND # ifdef HAVE_AFTERIMAGE ASImage *original_asim; bool render_asim (ASImage *background, ARGB32 background_tint); # endif -#define bgPmap_defaultScale 100 -#define bgPmap_defaultAlign 50 + enum { defaultScale = 100, defaultAlign = 50 }; + 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 */ - bool handle_geometry (const char *geom); + void unset_geometry () { flags = flags & ~geometryFlags; }; + bool set_geometry (const char *geom); void set_defaultGeometry () { - h_scale = v_scale = bgPmap_defaultScale; - h_align = v_align = bgPmap_defaultAlign; - flags |= bgPmap_geometrySet; + h_scale = v_scale = defaultScale; + h_align = v_align = defaultAlign; + flags |= geometrySet; }; + bool set_file (const char *file); # endif /* XPM_BACKGROUND */ rxvt_term *target; bool set_target (rxvt_term *new_target); # ifdef ENABLE_TRANSPARENCY - int root_depth; /* obtained when target is set */ - Pixmap root_pixmap; /* current root pixmap set */ - bool make_transparency_pixmap (); + int root_depth; /* obtained when target is set */ + Pixmap root_pixmap; /* current root pixmap set */ + rxvt_color tint; + int shade; + int h_blurRadius, v_blurRadius; + + bool set_transparent (); + bool set_blur_radius (const char *geom); + bool set_tint (rxvt_color &new_tint); + bool unset_tint (); + bool set_shade (const char *shade_str); + bool set_root_pixmap (); + + unsigned long make_transparency_pixmap ();/* returns combination of the transpTransformations flags */ # endif + double invalid_since; Pixmap pixmap; unsigned int pmap_width, pmap_height; unsigned int pmap_depth; bool window_size_sensitive (); - void apply_background (); - + bool need_client_side_rendering (); + void apply (); + bool render (); + void invalidate () { + if (!(flags & isInvalid)) + { + flags |= isInvalid; + invalid_since = NOW; + } + }; }; #else # undef HAVE_BG_PIXMAP @@ -933,8 +973,6 @@ unsigned char want_refresh:1, #ifdef ENABLE_TRANSPARENCY want_full_refresh:1, /* awaiting full screen refresh */ - am_transparent:1, /* is a transparent term */ - am_pixmap_trans:1, /* transparency w/known root pixmap */ #endif current_screen:1, /* primary or secondary */ num_scr_allow:1, @@ -1127,10 +1165,10 @@ void rootwin_cb (XEvent &xev); xevent_watcher rootwin_ev; #endif -#if ENABLE_TRANSPARENCY - int check_our_parents (); - void check_our_parents_cb (time_watcher &w); - time_watcher check_our_parents_ev; +#ifdef HAVE_BG_PIXMAP + int update_background (); + void update_background_cb (time_watcher &w); + time_watcher update_background_ev; #endif void x_cb (XEvent &xev); @@ -1476,9 +1514,6 @@ void get_xdefaults (FILE *stream, const char *name); void extract_resources (); // xpm.C -//int scale_pixmap (const char *geom); - void resize_pixmap (); - void set_bgPixmap (const char *file); void get_window_origin (int &x, int &y); Pixmap get_pixmap_property (int prop_id); };