# In that case most of those commands do nothing, except cleaning *~
# and cleaning source links.
distclean:
- (cd $(srcdir); rm -f *~ config.cache config.h config.log config.status libtool)
- @for I in $(allsubdirs); do (cd $$I; $(MAKE) $@) || exit 1; done
- (cd $(srcdir); rm -f Makefile)
-
+ (cd $(srcdir); rm -f *~ config.cache config.h config.log config.status libtool rxvtlib.h)
+ @for I in $(allsubdirs); do (cd $$I; $(MAKE) $@; rm -f Makefile) || exit 1; done
+ rm -f Makefile
+
distdir:
cd doc && $(MAKE) distdepend
cd src && $(MAKE) depend
/* config.h.in. Generated from configure.ac by autoheader. */
+/* Define if you want to integrate with AfterStep window manager */
+#undef AFTERSTEP_INTEGRATION
+
/* clone device filename */
#undef CLONE_DEVICE
/* Define if you want extended chinese codesets */
#undef ENCODING_ZH_EXT
+/* Define if you want to use libAfterImage for image processing */
+#undef HAVE_AFTERIMAGE
+
/* Define to 1 if you have the <assert.h> header file. */
#undef HAVE_ASSERT_H
/* Define ONLY iff Xlib.h supports it */
#undef XLIB_ILLEGAL_ACCESS
-/* Define if you want to have sexy-looking background pixmaps. Needs libXpm */
+/* Define if you want to have sexy-looking background pixmaps. Needs libXpm or
+ libAfterImage */
#undef XPM_BACKGROUND
/* Define if you include <X11/xpm.h> on a normal include path (be careful) */
support_scroll_plain=yes
support_xim=yes
support_xpm=yes
+support_afterimage=yes
+support_afterstep=yes
support_xft=yes
support_unicode3=no
support_combining=yes
support_wtmp=no
support_xim=no
support_xpm=no
+ support_afterimage=no
+ support_afterstep=no
support_xft=no
support_unicode3=no
support_combining=no
support_wtmp=yes
support_xim=yes
support_xpm=yes
+ support_afterimage=yes
+ support_afterstep=yes
support_xft=yes
support_unicode3=yes
support_combining=yes
fi])
AC_ARG_ENABLE(xpm-background,
- [ --enable-xpm-background enable XPM background pixmaps],
+ [ --enable-xpm-background enable background pixmaps],
[if test x$enableval = xyes -o x$enableval = xno; then
support_xpm=$enableval
fi])
+AC_ARG_ENABLE(afterimage,
+ [ --enable-afterimage enable integration with libAfterImage for background images],
+ [if test x$enableval = xyes -o x$enableval = xno; then
+ support_afterimage=$enableval
+ fi])
+
+AC_ARG_WITH(afterimage_config, [ --with-afterimage-config=DIR use libAfterImage config script in DIR], afterimage_config="$withval",afterimage_config=NO)
+
+AC_ARG_ENABLE(afterstep,
+ [ --enable-afterstep enable integration with AfterStep window manager],
+ [if test x$enableval = xyes -o x$enableval = xno; then
+ support_afterstep=$enableval
+ fi])
+
AC_ARG_ENABLE(transparency,
[ --enable-transparency enable transparent backgrounds],
[if test x$enableval = xyes -o x$enableval = xno; then
dnl# the only reasonable way to find libXpm is do-it-yourself
dnl# only check if we want xpm-background
-if test x$support_xpm = xyes; then
+LIBAFTERIMAGE_CFLAGS=
+AFTERIMAGE_LIBS=
+have_afterimage=
+
+if test x$support_afterimage == xyes; then
+ AC_MSG_CHECKING(installed libAfterImage)
+ support_afterimage=no
+ if test "$afterimage_config" = "NO" ; then
+ if afterimage-config --version > /dev/null 2>&1 ; then
+ afterimage_config=afterimage-config
+ else
+ if test -x /usr/local/bin/afterimage-config; then
+ afterimage_config=/usr/local/bin/afterimage-config
+ fi
+ fi
+ else
+ afterimage_config=$afterimage_config/afterimage-config
+ fi
+ if $afterimage_config --version > /dev/null 2>&1 ; then
+ LIBAFTERIMAGE_CFLAGS=`$afterimage_config --cflags`
+ AFTERIMAGE_LIBS=`$afterimage_config --libs`
+ if test "x$AFTERIMAGE_LIBS" != "x"; then
+ support_afterimage=yes
+ fi
+ fi
+
+ if test "x$support_afterimage" = "xyes"; then
+ AC_MSG_RESULT($AFTERIMAGE_LIBS)
+ else
+ AC_MSG_RESULT(afterimage-config not found in $afterimage_config - can't use libAfterImage for images.)
+ fi
+fi
+
+if test x$support_afterimage != xyes -a x$support_xpm = xyes ; then
VT_FIND_LIBXPM
if test x$no_xpm = xyes; then
support_xpm=needsmanualspecification
AC_DEFINE(USE_XIM, 1, Define if you want to have XIM (X Input Method) protocol support - required for multibyte characters input)
fi
fi
-if test x$support_xpm = xyes; then
- AC_DEFINE(XPM_BACKGROUND, 1, Define if you want to have sexy-looking background pixmaps. Needs libXpm)
+if test x$support_xpm = xyes -o x$support_afterimage = xyes ; then
+ AC_DEFINE(XPM_BACKGROUND, 1, Define if you want to have sexy-looking background pixmaps. Needs libXpm or libAfterImage)
fi
+
+if test x$support_afterimage = xyes; then
+ AC_DEFINE(HAVE_AFTERIMAGE, 1, Define if you want to use libAfterImage for image processing)
+fi
+
+if test x$support_afterstep = xyes; then
+ AC_DEFINE(AFTERSTEP_INTEGRATION, 1, Define if you want to integrate with AfterStep window manager)
+fi
+
if test x$support_scroll_rxvt = xyes; then
AC_DEFINE(RXVT_SCROLLBAR, 1, Support Rxvt original style scrollbars)
scrolltypes="rxvt"
AC_SUBST(X_LIBS)
AC_SUBST(X_EXTRA_LIBS)
+AC_SUBST(LIBAFTERIMAGE_CFLAGS)
+AC_SUBST(AFTERIMAGE_LIBS)
+
AC_ARG_PROGRAM
dnl# test for "sun" or "__sun__" before include sys_ioctl
echo " Xpm library: $XPM_LIBS"
fi
+if test x$support_afterimage = xyes; then
+ echo " AfterImage library: $AFTERIMAGE_LIBS"
+fi
+
+if test x$support_afterstep = xyes; then
+ echo " With AfterStep integration"
+fi
+
if test x$term != x; then
echo " set TERM to: $term"
fi
@@RXVT_NAME@@ -tr -tint blue -sh 40
-=item B<-sh>
+=item B<-sh> I<number>
-I<number> Darken (0 .. 100) or lighten (-1 .. -100) the transparent
-background image in addition to tinting it (i.e. B<-tint> must be
-specified, too, e.g. C<-tint white>); resource I<shading>.
+Darken (0 .. 100) or lighten (-1 .. -100) the transparent
+background image in addition to (or instead of) tinting it;
+resource I<shading>.
+
+=item B<-blt> I<string>
+
+Specify background blending type. If background pixmap is specified
+at the same time as transparency - such pixmap will be blended over
+transparency image, using method specified. Supported values are :
+B<add>, B<alphablend>, B<allanon> - color values averaging, B<colorize>,
+B<darken>, B<diff>, B<dissipate>, B<hue>, B<lighten>, B<overlay>,
+B<saturate>, B<screen>, B<sub>, B<tint>, B<value>. The default is
+alpha-blending; resource I<blendType>.
+
+=item B<-blr> I<number>
+
+Apply Gaussian Blur with the specified radius to the transparent
+background image; resource I<blurRadius>.
=item B<-bg> I<colour>
=item B<-pixmap> I<file[;geom]>
-Compile I<XPM>: Specify XPM file for the background and also optionally
-specify its scaling with a geometry string. Note you may need to
+Compile I<afterimage>: Specify image file for the background and also
+optionally specify its scaling with a geometry string. Note you may need to
add quotes to avoid special shell interpretation of the C<;> in the
-command-line; resource B<backgroundPixmap>.
+command-line; for more details see resource B<backgroundPixmap>.
=item B<-cr> I<colour>
Darken (0 .. 100) or lighten (-1 .. -100) the transparent background image
in addition to tinting it; option B<-sh>.
+=item B<blendType:> I<string>
+
+Specify background blending type; option B<-blt>.
+
+=item B<blurRadius:> I<number>
+
+Apply Gaussian Blurr with the specified radius to the transparent
+background image; option B<-blr>.
+
=item B<scrollColor:> I<colour>
Use the specified colour for the scrollbar [default #B2B2B2].
=item B<backgroundPixmap:> I<file[;geom]>
-Use the specified XPM file (note the `.xpm' extension is optional) for
-the background and also optionally specify its scaling with a geometry
-string B<WxH+X+Y>, in which B<"W" / "H"> specify the
-horizontal/vertical scale (percent) and B<"X" / "Y"> locate the image
-centre (percent). A scale of 0 displays the image with tiling. A scale
-of 1 displays the image without any scaling. A scale of 2 to 9
-specifies an integer number of images in that direction. No image will
-be magnified beyond 10 times its original size. The maximum permitted
-scale is 1000. [default 0x0+50+50]
+Use the specified image file for the background and also optionally
+specify its scaling with a geometry string B<WxH+X+Y>,
+in which B<"W" / "H"> specify the horizontal/vertical scale (percent),
+and B<"X" / "Y"> locate the image centre (percent).
+A scale of 0 displays the image with tiling. A scale of 1 displays the
+image without any scaling. A scale of 2 to 9 specifies an integer
+number of images in that direction. No image will be magnified beyond
+10 times its original size. The maximum permitted scale is 1000.
+Special string of B<"auto"> used as a geometry will cause image to be
+automatically scaled to match window size.
+If used in conjunction with B<-tr> option - specified pixmap will be
+blended over transparency image using either alpha-blending, or any
+other blending type, specified with B<-blt "type"> option.
+[default 0x0+50+50]
=item B<path:> I<path>
LIBS = @LIBS@
DINCLUDE = @DINCLUDE@
DLIB = @DLIB@
-XINC = @X_CFLAGS@ @XPM_CFLAGS@
-XLIB = @X_LIBS@ @XPM_LIBS@ -lX11 @X_EXTRA_LIBS@
+XINC = @X_CFLAGS@ @XPM_CFLAGS@ @LIBAFTERIMAGE_CFLAGS@
+XLIB = @X_LIBS@ @XPM_LIBS@ @AFTERIMAGE_LIBS@ -lX11 @X_EXTRA_LIBS@
COMPILE = $(CXX) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CXXFLAGS) $(DEBUG) $(DINCLUDE) $(XINC) -I$(basedir) -I$(srcdir) -I.
LINK = @LINKER@ $(LDFLAGS)
{
seen_resize = 1;
resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1);
+#ifdef XPM_BACKGROUND
+ if (!option(Opt_transparent) && bgPixmap.auto_resize)
+ {
+ resize_pixmap ();
+ scr_touch (true);
+ }
+#endif
}
HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END));
/* FALLTHROUGH */
case ReparentNotify:
- if (option (Opt_transparent) && check_our_parents () && am_transparent)
- want_refresh = want_full_refresh = 1;
+ if (option (Opt_transparent))
+ check_our_parents ();
break;
}
# endif
}
#ifdef TRANSPARENT
-#if TINTING
+#if TINTING && !defined(HAVE_AFTERIMAGE)
/* taken from aterm-0.4.2 */
typedef uint32_t RUINT32T;
*/
int
rxvt_term::check_our_parents ()
+{
+#if TRANSPARENT || ENABLE_PERL
+ check_our_aprents_ev.stop();
+ check_our_aprents_ev.start(NOW + 1./3.);
+#endif
+ return 0;
+}
+
+void
+rxvt_term::check_our_parents_cb (time_watcher &w)
{
int i, pchanged, aformat, have_pixmap, rootdepth;
unsigned long nitems, bytes_after;
Window root, oldp, *list;
Pixmap rootpixmap = None;
XWindowAttributes wattr, wrootattr;
+ int sx, sy;
+ Window cr;
pchanged = 0;
if (!option (Opt_transparent))
- return pchanged; /* Don't try any more */
+ return /*pchanged*/; /* Don't try any more */
XGetWindowAttributes (dpy, display->root, &wrootattr);
rootdepth = wrootattr.depth;
am_transparent = am_pixmap_trans = 0;
}
- return pchanged; /* Don't try any more */
+ return /*pchanged*/; /* Don't try any more */
}
/* Get all X ops out of the queue so that our information is up-to-date. */
XSync (dpy, False);
+ XTranslateCoordinates (dpy, parent[0], display->root,
+ 0, 0, &sx, &sy, &cr);
+
+ /* check if we are outside of the visible part of the virtual screen : */
+ if( sx + (int)szHint.width <= 0 || sy + (int)szHint.height <= 0
+ || sx >= wrootattr.width || sy >= wrootattr.height )
+ return /* 0 */ ;
/*
* Make the frame window set by the window manager have
* the root background. Some window managers put multiple nested frame
if (!i || prop == NULL
#if TINTING
- || !ISSET_PIXCOLOR (Color_tint)
+ || (!ISSET_PIXCOLOR (Color_tint) && rs[Rs_shade] == NULL
+#ifdef HAVE_AFTERIMAGE
+ && original_asim == NULL && rs[Rs_blurradius] == NULL
+#endif
+ )
#endif
)
have_pixmap = 0;
if (have_pixmap)
{
+ Bool success = False ;
+ GC gc;
+ XGCValues gcvalue;
+#ifdef HAVE_AFTERIMAGE
+ {
+ Pixmap tmp_pmap = None ;
+ ShadingInfo shade;
+ ARGB32 tint ;
+ unsigned int pmap_w = 0, pmap_h = 0;
+
+ if (get_drawable_size( rootpixmap, &pmap_w, &pmap_h ))
+ {
+ int root_x = 0, root_y = 0;
+
+ shade.shading = rs[Rs_shade] ? atoi (rs[Rs_shade]) : 100;
+ if (ISSET_PIXCOLOR (Color_tint))
+ {
+ rgba c;
+ pix_colors_focused [Color_tint].get (c);
+ shade.tintColor.red = c.r;
+ shade.tintColor.green = c.g;
+ shade.tintColor.blue = c.b;
+ }
+ else
+ shade.tintColor.red = shade.tintColor.green = shade.tintColor.blue = 0xFFFF;
+ tint = shading2tint32( &shade );
+ gc = XCreateGC (dpy, vt, 0UL, &gcvalue);
+ if (GetWinPosition (parent[0], &root_x, &root_y) )
+ {
+ ASImageLayer *layers = create_image_layers( 2 );
+ ASImage *merged_im = NULL;
+ int back_x, back_y, back_w, back_h;
+ /* merge_layers does good job at tiling background appropriately,
+ so all we need is to cut out smallest possible piece : */
+#define MAKE_ROOTPMAP_GEOM(xy,wh,widthheight) \
+ do{ while( root_##xy < 0 ) root_##xy += (int)wrootattr.widthheight; \
+ back_##xy = root_##xy % pmap_##wh; /* that gives us left side of the closest tile : */ \
+ if( pmap_##wh >= back_##xy + szHint.widthheight ) \
+ back_##wh = szHint.widthheight;/* background is large - limit it by our size */ \
+ else \
+ { /* small background - need the whole of it for successfull tiling :*/ \
+ back_##xy = 0; \
+ back_##wh = pmap_##wh; \
+ }}while(0)
+
+ MAKE_ROOTPMAP_GEOM(x,w,width);
+ MAKE_ROOTPMAP_GEOM(y,h,height);
+
+ layers[0].im = pixmap2asimage (display->asv, rootpixmap, back_x, back_y, back_w, back_h, AllPlanes, ASA_ASImage, 100);
+ layers[0].clip_x = (back_w == pmap_w)?root_x:0;
+ layers[0].clip_y = (back_h == pmap_h)?root_y:0;
+ layers[0].clip_width = szHint.width;
+ layers[0].clip_height = szHint.height;
+ layers[0].tint = tint;
+ if (rs[Rs_blurradius] && layers[0].im)
+ {
+ double r = atof(rs[Rs_blurradius]);
+ ASImage* tmp = blur_asimage_gauss(display->asv, layers[0].im, r, r, 0xFFFFFFFF, ASA_ASImage, 100, ASIMAGE_QUALITY_DEFAULT );
+ if( tmp )
+ {
+ destroy_asimage( &layers[0].im );
+ layers[0].im = tmp;
+ }
+ }
+ if (original_asim != NULL)
+ {
+ int fore_w, fore_h;
+ layers[1].im = original_asim;
+ if( bgPixmap.auto_resize )
+ {
+ fore_w = szHint.width;
+ fore_h = szHint.height;
+ }
+ else
+ {
+ fore_w = bgPixmap.w;
+ fore_h = bgPixmap.h;
+ }
+ if (fore_w != original_asim->width
+ || fore_h != original_asim->height)
+ {
+ layers[1].im = scale_asimage( display->asv,
+ original_asim,
+ fore_w, fore_h,
+ ASA_ASImage, 100,
+ ASIMAGE_QUALITY_DEFAULT );
+ }
+
+ layers[1].clip_width = szHint.width;
+ layers[1].clip_height = szHint.height;
+
+ if (rs[Rs_blendtype])
+ {
+ layers[1].merge_scanlines = blend_scanlines_name2func(rs[Rs_blendtype]);
+ if( layers[1].merge_scanlines == NULL )
+ layers[1].merge_scanlines = alphablend_scanlines;
+ }
+ }
+ merged_im = merge_layers( display->asv, layers, layers[1].im?2:1,
+ szHint.width, szHint.height,
+ ASA_XImage, 0, ASIMAGE_QUALITY_DEFAULT );
+ if (layers[1].im != original_asim)
+ destroy_asimage( &(layers[1].im) );
+ destroy_asimage( &(layers[0].im) );
+ if (merged_im != NULL)
+ {
+ tmp_pmap = asimage2pixmap( display->asv, DefaultRootWindow(dpy), merged_im, gc, True );
+ destroy_asimage( &merged_im );
+ }
+ free( layers );
+ }
+ }
+ if (tmp_pmap != None)
+ {
+ success = True;
+ if (pixmap != None)
+ XFreePixmap (dpy, pixmap);
+ pixmap = tmp_pmap;
+ }
+ }
+#else /* HAVE_AFTERIMAGE */
+ {
/*
* Copy display->root pixmap transparency
*/
- int sx, sy, nx, ny;
- unsigned int nw, nh;
- Window cr;
- XImage *image;
- GC gc;
- XGCValues gcvalue;
+ int nx, ny;
+ unsigned int nw, nh;
+ XImage *image;
- XTranslateCoordinates (dpy, parent[0], display->root,
- 0, 0, &sx, &sy, &cr);
- nw = (unsigned int)szHint.width;
- nh = (unsigned int)szHint.height;
- nx = ny = 0;
+ nw = (unsigned int)szHint.width;
+ nh = (unsigned int)szHint.height;
+ nx = ny = 0;
- if (sx < 0)
- {
- nw += sx;
- nx = -sx;
- sx = 0;
- }
+ if (sx < 0)
+ {
+ nw += sx;
+ nx = -sx;
+ sx = 0;
+ }
- if (sy < 0)
- {
- nh += sy;
- ny = -sy;
- sy = 0;
- }
+ if (sy < 0)
+ {
+ nh += sy;
+ ny = -sy;
+ sy = 0;
+ }
- min_it (nw, (unsigned int) (wrootattr.width - sx));
- min_it (nh, (unsigned int) (wrootattr.height - sy));
+ min_it (nw, (unsigned int) (wrootattr.width - sx));
+ min_it (nh, (unsigned int) (wrootattr.height - sy));
- XSync (dpy, False);
- allowedxerror = -1;
- image = XGetImage (dpy, rootpixmap, sx, sy, nw, nh, AllPlanes, ZPixmap);
+ XSync (dpy, False);
+ allowedxerror = -1;
+ image = XGetImage (dpy, rootpixmap, sx, sy, nw, nh, AllPlanes, ZPixmap);
- /* XXX: handle BadMatch - usually because we're outside the pixmap */
- /* XXX: may need a delay here? */
- allowedxerror = 0;
+ /* XXX: handle BadMatch - usually because we're outside the pixmap */
+ /* XXX: may need a delay here? */
+ allowedxerror = 0;
+ if (image != NULL)
+ {
+ if (pixmap != None)
+ XFreePixmap (dpy, pixmap);
+
+#if TINTING
+ if (ISSET_PIXCOLOR (Color_tint))
+ {
+ int shade = rs[Rs_shade] ? atoi (rs[Rs_shade]) : 100;
+
+ rgba c;
+ pix_colors_focused [Color_tint].get (c);
+ ShadeXImage (this, image, shade, c.r, c.g, c.b);
+ }
+#endif
+
+ pixmap = XCreatePixmap (dpy, vt, szHint.width, szHint.height, image->depth);
+ gc = XCreateGC (dpy, vt, 0UL, &gcvalue);
+ XPutImage (dpy, pixmap, gc, image, 0, 0,
+ nx, ny, image->width, image->height);
+ XDestroyImage (image);
+ success = True ;
+ }
+ }
+#endif /* HAVE_AFTERIMAGE */
+ if (gc != NULL)
+ XFreeGC (dpy, gc);
- if (image == NULL)
+ if (!success)
{
if (am_transparent && am_pixmap_trans)
{
}
else
{
- if (pixmap != None)
- XFreePixmap (dpy, pixmap);
-
-#if TINTING
- if (ISSET_PIXCOLOR (Color_tint))
- {
- int shade = rs[Rs_shade] ? atoi (rs[Rs_shade]) : 100;
-
- rgba c;
- pix_colors_focused [Color_tint].get (c);
-
- ShadeXImage (this, image, shade, c.r, c.g, c.b);
- }
-#endif
-
- pixmap = XCreatePixmap (dpy, vt, szHint.width, szHint.height, image->depth);
- gc = XCreateGC (dpy, vt, 0UL, &gcvalue);
- XPutImage (dpy, pixmap, gc, image, 0, 0,
- nx, ny, image->width, image->height);
- XFreeGC (dpy, gc);
- XDestroyImage (image);
XSetWindowBackgroundPixmap (dpy, parent[0], pixmap);
XClearWindow (dpy, parent[0]);
flush ();
}
- return pchanged;
+// return pchanged;
}
#endif
scr_touch (true);
#endif
}
+#if TRANSPARENT && defined(HAVE_AFTERIMAGE)
+ if (option(Opt_transparent))
+ check_our_parents ();
+#endif
+
}
break;
#ifdef XPM_BACKGROUND
if (rs[Rs_backgroundPixmap] != NULL
- && !option (Opt_transparent))
+#ifndef HAVE_AFTERIMAGE
+ && !OPTION (Opt_transparent)
+#endif
+ )
{
const char *p = rs[Rs_backgroundPixmap];
:
#if TRANSPARENT || ENABLE_PERL
rootwin_ev (this, &rxvt_term::rootwin_cb),
+ check_our_aprents_ev(this, &rxvt_term::check_our_parents_cb),
#endif
#ifdef HAVE_SCROLLBARS
scrollbar_ev (this, &rxvt_term::x_cb),
def (perl_ext_2)
def (perl_lib)
#endif
+#ifdef HAVE_AFTERIMAGE
+ def (blendtype)
+ def (blurradius)
+#endif
#include <termios.h>
typedef struct termios ttymode_t;
-#ifdef XPM_BACKGROUND
+#ifdef HAVE_AFTERIMAGE
+# include <afterimage.h>
+#undef min
+#undef max
+#elif defined(XPM_BACKGROUND)
# ifdef XPM_INC_X11
# include <X11/xpm.h>
# else
#ifdef XPM_BACKGROUND
typedef struct {
short w, h, x, y;
+ bool auto_resize ;
Pixmap pixmap;
} bgPixmap_t;
#endif
row_col_t oldcursor;
#ifdef XPM_BACKGROUND
bgPixmap_t bgPixmap;
+#ifdef HAVE_AFTERIMAGE
+ ASImageManager *asimman;
+ ASImage *original_asim;
+ struct { unsigned int width, height; } xpmAttr; /* all we need is width/height */
+#else
XpmAttributes xpmAttr; /* originally loaded pixmap and its scaling */
+#endif
#endif
#if ENABLE_OVERLAY
#if TRANSPARENT || ENABLE_PERL
void rootwin_cb (XEvent &xev);
xevent_watcher rootwin_ev;
+ void check_our_parents_cb (time_watcher &w);
+ time_watcher check_our_aprents_ev;
#endif
void x_cb (XEvent &xev);
screen = DefaultScreen (dpy);
root = DefaultRootWindow (dpy);
+#ifdef HAVE_AFTERIMAGE
+ ::dpy = dpy; /* init global var from libAfter... */
+ asv = create_asvisual_for_id( dpy, screen, DefaultDepth(dpy,screen), XVisualIDFromVisual(DefaultVisual(dpy,screen)), None, NULL );
+#endif
+
assert (sizeof (xa_names) / sizeof (char *) == NUM_XA);
XInternAtoms (dpy, (char **)xa_names, NUM_XA, False, xa);
void clear ();
};
+#ifdef HAVE_AFTERIMAGE
+struct ASVisual;
+#endif
+
struct rxvt_display : refcounted {
io_manager_vec<xevent_watcher> xw;
Display *dpy;
int screen;
Window root;
+#ifdef HAVE_AFTERIMAGE
+ struct ASVisual *asv;
+#endif
rxvt_term *selection_owner;
Atom xa[NUM_XA];
bool is_local;
RSTRG (Rs_perl_ext_1, "perl-ext-common", "string"), //, "colon-separated list of perl extensions to enable"),TODO
STRG (Rs_perl_ext_2, "perl-ext", "pe", "string", "colon-separated list of perl extensions to enable for this instance"),
#endif
+
+#ifdef HAVE_AFTERIMAGE
+ STRG (Rs_blendtype, "blendType", "blt", "string", "background image blending type - alpha, tint, etc..."),
+ STRG (Rs_blurradius, "blurRadius", "blr", "number", "Gaussian Blur radius to apply to the root background"),
+#endif
#ifndef NO_RESOURCES
INFO ("xrm", "string", "X resource"),
#endif
strncpy (str, geom, n);
str[n] = '\0';
- flags = XParseGeometry (str, &x, &y, &w, &h);
+ if (strcmp(str, "auto") == 0)
+ {
+ if (!bgpixmap->auto_resize)
+ changed++;
+ bgpixmap->auto_resize = True ;
+ w = szHint.width ;
+ h = szHint.height ;
+ flags = WidthValue|HeightValue ;
+ }
+ else
+ {
+ bgpixmap->auto_resize = False ;
+ flags = XParseGeometry (str, &x, &y, &w, &h);
+ }
if (!flags)
{
GC gc;
if (pixmap != None)
- XFreePixmap (dpy, pixmap);
+ {
+ XFreePixmap (dpy, pixmap);
+ pixmap = None ;
+ }
if (bgPixmap.pixmap == None)
{ /* So be it: I'm not using pixmaps */
unsigned int xpmh = xpmAttr.height,
xpmw = xpmAttr.width;
+ if (bgPixmap.auto_resize)
+ {
+ w = szHint.width ;
+ h = szHint.height ;
+ }
/*
* don't zoom pixmap too much nor expand really small pixmaps
*/
XCopyArea (dpy, bgPixmap.pixmap, pixmap, gc, 0, 0, x, y, xpmw - x, xpmh - y);
}
else
+#ifdef HAVE_AFTERIMAGE
+#ifdef TRANSPARENT
+ if (!option(Opt_transparent) || !am_transparent)
+ /* will do that in check_our_parents otherwise */
+#endif
+ {
+ ASImage *scaled_im = scale_asimage( display->asv, original_asim, w, h, ASA_XImage, 0, ASIMAGE_QUALITY_DEFAULT );
+ if (scaled_im)
+ {
+ pixmap = asimage2pixmap( display->asv, display->root, scaled_im, gc, True );
+ destroy_asimage( &scaled_im );
+ }
+ }
+#else /* HAVE_AFTERIMAGE */
{
float incr, p;
Pixmap tmp;
XFreePixmap (dpy, tmp);
}
+#endif /* HAVE_AFTERIMAGE */
}
XSetWindowBackgroundPixmap (dpy, vt, pixmap);
*/
/* XGetWindowAttributes (dpy, vt, &attr); */
+#ifdef HAVE_AFTERIMAGE
+ if (asimman == NULL)
+ asimman = create_generic_imageman(rs[Rs_path]);
+ if ((f = strchr (file, ';')) == NULL)
+ original_asim = get_asimage( asimman, file, 0xFFFFFFFF, 100 );
+ else
+ {
+ f = strndup( file, f - file );
+ original_asim = get_asimage( asimman, f, 0xFFFFFFFF, 100 );
+ free( f );
+ }
+ if (original_asim)
+ {
+ bgPixmap.pixmap = asimage2pixmap( display->asv, display->root, original_asim, NULL, True );
+ xpmAttr.width = original_asim->width ;
+ xpmAttr.height = original_asim->height ;
+ }
+#else /* HAVE_AFTERIMAGE */
xpmAttr.closeness = 30000;
xpmAttr.colormap = cmap;
xpmAttr.visual = visual;
rxvt_warn ("couldn't load XPM file \"%.*s\", ignoring.\n", (p - file), file);
}
-
free (f);
+#endif /* HAVE_AFTERIMAGE */
}
resize_pixmap ();