TODO: align default value of cutchars with rxvt.1.pod and add it as a fallback in perl 'selection'
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=377194
-TODO: automove-background
- expect major compatibility issues and please test and report.
- converted from the veritable io manager event loop to
the high performance libev (http://software.schmorp.de/pkg/libev).
+ - automove-background functionality re-implemented internaly using :root op in pixmap
+ geometry string. For example: rxvt -pixmap "image.jpg;:root"
- fix a serious bug while setting the XIM destroy callback
on (typical) 64 bit systems.
- fix memory leak in pixmap code.
Window foreground colour; resource B<foreground>.
-=item B<-pixmap> I<file[;geom]>
+=item B<-pixmap> I<file[;geom[:op1][:op2][...]]>
Compile I<afterimage>: Specify image file for the background and also
optionally specify its scaling with a geometry string. Note you may need to
The colour of the border around the text area and between the scrollbar
and the text.
-=item B<backgroundPixmap:> I<file[;geom]>
+=item B<backgroundPixmap:> I<file[;geom[:op1][:op2][...]]>
Use the specified image file for the background and also optionally
specify its scaling with a geometry string B<WxH+X+Y>,
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.
+Additional operations can be specified after colon B<:op1:op2...>.
+Supported operations are:
+ B<"tile"> - force background image to be tiled and not scaled. Equivalent to 0x0,
+ B<"propscale"> - will scale image keeping proportions,
+ B<"auto"> - will scale image to match window size. Equivalent to 100x100;
+ B<"hscale"> - will scale image horizontally to the window size;
+ B<"vscale"> - will scale image vertically to the window size;
+ B<"scale"> - will scale image to match window size;
+ B<"root"> - will tile image as if it was a root window background, auto-adjusting
+ whenever terminal window moves.
+
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.
your picture with gimp or any other tool:
convert wallpaper.jpg -blur 20x20 -modulate 30 background.jpg
- @@URXVT_NAME@@ -pixmap background.jpg -pe automove-background
+ @@URXVT_NAME@@ -pixmap "background.jpg;:root"
-That works. If you think it doesn't, you lack AfterImage and Perl support, or you
+That works. If you think it doesn't, you lack AfterImage support, or you
are unable to read.
3. Use an ARGB visual:
bool
bgPixmap_t::window_size_sensitive ()
{
+# ifdef ENABLE_TRANSPARENCY
+ if (flags & isTransparent)
+ return true;
+# endif
+
# ifdef BG_IMAGE_FROM_FILE
# ifdef HAVE_AFTERIMAGE
if (original_asim != NULL)
return true;
}
# endif
+
+ return false;
+}
+
+bool
+bgPixmap_t::window_position_sensitive ()
+{
# ifdef ENABLE_TRANSPARENCY
if (flags & isTransparent)
return true;
# endif
+
+# ifdef BG_IMAGE_FROM_FILE
+# ifdef HAVE_AFTERIMAGE
+ if (original_asim != NULL)
+# endif
+ {
+ if (h_align == rootAlign || v_align == rootAlign)
+ return true;
+ }
+# endif
+
return false;
-}
+};
bool bgPixmap_t::need_client_side_rendering ()
{
{
if (geom_flags & flag)
{
- if (new_value < -100)
- new_value = -100;
- else if (new_value > 200)
- new_value = 200;
+ if (new_value != bgPixmap_t::rootAlign)
+ {
+ if (new_value < -100)
+ new_value = -100;
+ else if (new_value > 200)
+ new_value = 200;
+ }
if (new_value != align)
{
align = new_value;
# define CHECK_GEOM_OPS(op_str) (strncasecmp (ops, (op_str), sizeof(op_str)-1) == 0)
if (CHECK_GEOM_OPS("tile"))
{
- w = h = 0;
+ w = h = noScale;
geom_flags |= WidthValue|HeightValue;
}
else if (CHECK_GEOM_OPS("propscale"))
{
if (w == 0 && h == 0)
{
- w = 100;
+ w = windowScale;
geom_flags |= WidthValue;
}
new_flags |= propScale;
else if (CHECK_GEOM_OPS("hscale"))
{
if (w == 0)
- w = 100;
- h = 0;
+ w = windowScale;
+ h = noScale;
geom_flags |= WidthValue|HeightValue;
}
else if (CHECK_GEOM_OPS("vscale"))
{
if (h == 0)
- h = 100;
- w = 0;
+ h = windowScale;
+ w = noScale;
geom_flags |= WidthValue|HeightValue;
}
else if (CHECK_GEOM_OPS("scale"))
{
if (h == 0)
- h = 100;
+ h = windowScale;
if (w == 0)
- w = 100;
+ w = windowScale;
geom_flags |= WidthValue|HeightValue;
}
else if (CHECK_GEOM_OPS("auto"))
{
- w = h = 100;
- x = y = 50;
+ w = h = windowScale;
+ x = y = centerAlign;
+ geom_flags |= WidthValue|HeightValue|XValue|YValue;
+ }
+ else if (CHECK_GEOM_OPS("root"))
+ {
+ w = h = noScale;
+ x = y = rootAlign;
geom_flags |= WidthValue|HeightValue|XValue|YValue;
}
# undef CHECK_GEOM_OPS
if (original_asim)
{
- x = make_align_position (h_align, target_width, w > 0 ? w : (int)original_asim->width);
- y = make_align_position (v_align, target_height, h > 0 ? h : (int)original_asim->height);
+ if (h_align == rootAlign || v_align == rootAlign)
+ {
+ target->get_window_origin(x, y);
+ x = -x;
+ y = -y;
+ }
+ if (h_align != rootAlign)
+ x = make_align_position (h_align, target_width, w > 0 ? w : (int)original_asim->width);
+ if (v_align != rootAlign)
+ y = make_align_position (v_align, target_height, h > 0 ? h : (int)original_asim->height);
}
if (original_asim == NULL
100, ASIMAGE_QUALITY_DEFAULT);
}
if (background == NULL)
- {/* if tiling - pixmap has to be sized exactly as the image */
+ {/* if tiling - pixmap has to be sized exactly as the image,
+ but there is no need to make it bigger then the window! */
if (h_scale == 0)
- new_pmap_width = result->width;
+ new_pmap_width = min (result->width, target_width);
if (v_scale == 0)
- new_pmap_height = result->height;
+ new_pmap_height = min (result->height, target_height);
/* we also need to tile our image in one or both directions */
if (h_scale == 0 || v_scale == 0)
{
ASImage *tmp = tile_asimage (target->asv, result,
(h_scale > 0) ? 0 : (int)result->width - x,
(v_scale > 0) ? 0 : (int)result->height - y,
- result->width, result->height,
+ new_pmap_width,
+ new_pmap_height,
TINT_LEAVE_SAME, ASA_XImage,
100, ASIMAGE_QUALITY_DEFAULT);
if (tmp)
bool render_asim (ASImage *background, ARGB32 background_tint);
# endif
- enum { defaultScale = 100, defaultAlign = 50 };
+ enum {
+ noScale = 0, windowScale = 100, defaultScale = windowScale,
+ centerAlign = 50, defaultAlign = centerAlign,
+ rootAlign = -10000 };
unsigned int h_scale, v_scale;/* percents of the window size */
int h_align, v_align; /* percents of the window size:
unsigned int pmap_depth;
bool window_size_sensitive ();
- bool window_position_sensitive () {
- return (flags & isTransparent);
- };
+ bool window_position_sensitive ();
bool is_parentOrigin () {
return !(flags & isVtOrigin);
}
#ifdef HAVE_BG_PIXMAP
+# if TRACE_PIXMAPS
+# undef update_background
+int rxvt_term::trace_update_background (const char* file, int line)
+{
+ fprintf (stderr, "%s:%d:update_background()\n", file, line);
+ update_background ();
+}
+# endif
int
rxvt_term::update_background ()
{
#endif
#ifdef HAVE_BG_PIXMAP
int update_background ();
+#if TRACE_PIXMAPS
+ int trace_update_background (const char* file, int line);
+# define update_background() trace_update_background (__FILE__, __LINE__)
+#endif
void update_background_cb (ev::timer &w, int revents);
ev::timer update_background_ev;
#endif