From 8b209b20d55e4b5b7aff0423a34acb974dbb25c1 Mon Sep 17 00:00:00 2001
From: root
Date: Sun, 29 Jan 2006 21:45:47 +0000
Subject: [PATCH] *** empty log message ***
---
Changes | 2 ++
doc/rxvt.1.html | 13 +++++++++++--
doc/rxvt.1.man.in | 16 +++++++++++++---
doc/rxvt.1.pod | 10 ++++++----
doc/rxvt.1.txt | 16 +++++++++++++---
doc/rxvtperl.3.html | 19 ++++++++++++++++---
doc/rxvtperl.3.man.in | 27 ++++++++++++++++++++-------
doc/rxvtperl.3.txt | 17 ++++++++++++++---
src/command.C | 2 +-
src/rxvttoolkit.C | 25 +++++++++++++++++++++----
10 files changed, 117 insertions(+), 30 deletions(-)
diff --git a/Changes b/Changes
index a7921a2f..5ce56589 100644
--- a/Changes
+++ b/Changes
@@ -18,6 +18,8 @@ DUMB: support tex fonts
- added the OSC sequence 702 to detect the urxvt version number.
- small configure updates.
- overhauled color management: smaller codesize, alpha support.
+ - support rgba:r/g/b/a, #argb, #aarrggbb and #aaaarrrrggggbbbb
+ colour "names".
- do not include X11/Intrinsic.h anymore, directly use
Xlib/Xutil/Xresource directly.
diff --git a/doc/rxvt.1.html b/doc/rxvt.1.html
index a59c573c..b22295ed 100644
--- a/doc/rxvt.1.html
+++ b/doc/rxvt.1.html
@@ -48,7 +48,7 @@
color0 | (black) | = Black |
color1 | (red) | = Red3 |
@@ -1728,6 +1728,15 @@ colours with their rgb.txt names.
background, cursorColor, cursorColor2, colorBD, colorUL as
a number 0-15, as a convenient shorthand to reference the colour name of
color0-color15.
+If Xft support has been compiled in and as long as Xft/Xrender/X don't get
+their act together, rxvt-unicode will support rgba:rrrr/gggg/bbbb/aaaa
+(recommended, but MUST have 4 digits/component), #ARGB
, #AARRGGBB
+and #AAAARRRRGGGGBBBB
colour specifications, in addition to the ones
+provided by X, where the additional A component specifies alpha (opacity)
+values (0 is completely transparent and the maximum is opaque). You
+probably need to specify ``-depth 32'', too, and have the luck that your
+X-server uses ARGB pixel layout, as X is far from just supporting ARGB
+visuals out of the box, and rxvt-unicode just fudges around.
Note that -rv (``reverseVideo: True'') simulates reverse video by
always swapping the foreground/background colours. This is in contrast to
xterm(1) where the colours are only swapped if they have not otherwise
diff --git a/doc/rxvt.1.man.in b/doc/rxvt.1.man.in
index b435a051..800e5eef 100644
--- a/doc/rxvt.1.man.in
+++ b/doc/rxvt.1.man.in
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.3
+.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -129,7 +129,7 @@
.\" ========================================================================
.\"
.IX Title "rxvt 1"
-.TH rxvt 1 "2006-01-26" "7.3a" "RXVT-UNICODE"
+.TH rxvt 1 "2006-01-29" "7.4" "RXVT-UNICODE"
.SH "NAME"
rxvt\-unicode (ouR XVT, unicode) \- (a VT102 emulator for the X window system)
.SH "SYNOPSIS"
@@ -1309,7 +1309,7 @@ on some systems or setgid to root or to some other group on others.
In addition to the default foreground and background colours,
\&\fB@@RXVT_NAME@@\fR can display up to 16 colours (8 \s-1ANSI\s0 colours plus
high-intensity bold/blink versions of the same). Here is a list of the
-colours with their \fBrgb.txt\fR names.
+colours with their names.
.TS
l l l .
color0 (black) = Black
@@ -1338,6 +1338,16 @@ It is also possible to specify the colour values of \fBforeground\fR,
a number 0\-15, as a convenient shorthand to reference the colour name of
color0\-color15.
.PP
+If Xft support has been compiled in and as long as Xft/Xrender/X don't get
+their act together, rxvt-unicode will support \f(CW\*(C`rgba:rrrr/gggg/bbbb/aaaa\*(C'\fR
+(recommended, but \fB\s-1MUST\s0\fR have 4 digits/component), \f(CW\*(C`#ARGB\*(C'\fR, \f(CW\*(C`#AARRGGBB\*(C'\fR
+and \f(CW\*(C`#AAAARRRRGGGGBBBB\*(C'\fR colour specifications, in addition to the ones
+provided by X, where the additional A component specifies alpha (opacity)
+values (0 is completely transparent and the maximum is opaque). You
+probably need to specify \fB\*(L"\-depth 32\*(R"\fR, too, and have the luck that your
+X\-server uses \s-1ARGB\s0 pixel layout, as X is far from just supporting \s-1ARGB\s0
+visuals out of the box, and rxvt-unicode just fudges around.
+.PP
Note that \fB\-rv\fR (\fB\*(L"reverseVideo: True\*(R"\fR) simulates reverse video by
always swapping the foreground/background colours. This is in contrast to
\&\fIxterm\fR(1) where the colours are only swapped if they have not otherwise
diff --git a/doc/rxvt.1.pod b/doc/rxvt.1.pod
index 5ed8b650..86fb9074 100644
--- a/doc/rxvt.1.pod
+++ b/doc/rxvt.1.pod
@@ -1342,13 +1342,15 @@ B, B, B, B, B as
a number 0-15, as a convenient shorthand to reference the colour name of
color0-color15.
-If Xft support has been compiled in and as long as Xft/Xrender don't get
-their act together, rxvt-unicode will support C<#ARGB>, C<#AARRGGBB>
+If Xft support has been compiled in and as long as Xft/Xrender/X don't get
+their act together, rxvt-unicode will support C
+(recommended, but B have 4 digits/component), C<#ARGB>, C<#AARRGGBB>
and C<#AAAARRRRGGGGBBBB> colour specifications, in addition to the ones
provided by X, where the additional A component specifies alpha (opacity)
values (0 is completely transparent and the maximum is opaque). You
-probably need to specify B<"-depth 32">, too, as X is far from just
-supporting ARGB visuals out of the box.
+probably need to specify B<"-depth 32">, too, and have the luck that your
+X-server uses ARGB pixel layout, as X is far from just supporting ARGB
+visuals out of the box, and rxvt-unicode just fudges around.
Note that B<-rv> (B<"reverseVideo: True">) simulates reverse video by
always swapping the foreground/background colours. This is in contrast to
diff --git a/doc/rxvt.1.txt b/doc/rxvt.1.txt
index 031d7847..e23c5aaf 100644
--- a/doc/rxvt.1.txt
+++ b/doc/rxvt.1.txt
@@ -6,7 +6,7 @@ SYNOPSIS
rxvt [options] [-e command [ args ]]
DESCRIPTION
- rxvt-unicode, version 7.3a, is a colour vt102 terminal emulator intended
+ rxvt-unicode, version 7.4, is a colour vt102 terminal emulator intended
as an *xterm*(1) replacement for users who do not require features such
as Tektronix 4014 emulation and toolkit-style configurability. As a
result, rxvt-unicode uses much less swap space -- a significant
@@ -1145,8 +1145,7 @@ LOGIN STAMP
COLORS AND GRAPHICS
In addition to the default foreground and background colours, rxvt can
display up to 16 colours (8 ANSI colours plus high-intensity bold/blink
- versions of the same). Here is a list of the colours with their rgb.txt
- names.
+ versions of the same). Here is a list of the colours with their names.
color0 (black) = Black
color1 (red) = Red3
@@ -1172,6 +1171,17 @@ COLORS AND GRAPHICS
0-15, as a convenient shorthand to reference the colour name of
color0-color15.
+ If Xft support has been compiled in and as long as Xft/Xrender/X don't
+ get their act together, rxvt-unicode will support
+ "rgba:rrrr/gggg/bbbb/aaaa" (recommended, but MUST have 4
+ digits/component), "#ARGB", "#AARRGGBB" and "#AAAARRRRGGGGBBBB" colour
+ specifications, in addition to the ones provided by X, where the
+ additional A component specifies alpha (opacity) values (0 is completely
+ transparent and the maximum is opaque). You probably need to specify
+ "-depth 32", too, and have the luck that your X-server uses ARGB pixel
+ layout, as X is far from just supporting ARGB visuals out of the box,
+ and rxvt-unicode just fudges around.
+
Note that -rv ("reverseVideo: True") simulates reverse video by always
swapping the foreground/background colours. This is in contrast to
*xterm*(1) where the colours are only swapped if they have not otherwise
diff --git a/doc/rxvtperl.3.html b/doc/rxvtperl.3.html
index 295cbd31..efca8e1d 100644
--- a/doc/rxvtperl.3.html
+++ b/doc/rxvtperl.3.html
@@ -840,6 +840,15 @@ correct place, e.g. on stderr of the connecting urxvtc client.
Messages have a size limit of 1023 bytes currently.
+@terms = urxvt::termlist
+
+
+Returns all urxvt::term objects that exist in this process, regardless of
+wether they are started, being destroyed etc., so be careful. Only term
+objects that have perl extensions attached will be returned (because there
+is no urxvt::term objet associated with others).
+
+
$time = urxvt::NOW
@@ -958,7 +967,8 @@ hash which defines the environment of the new terminal.
Croaks (and probably outputs an error message) if the new instance
couldn't be created. Returns undef
if the new instance didn't
initialise perl, and the terminal object otherwise. The init
and
-start
hooks will be called during this call.
+start
hooks will be called before this call returns, and are free to
+refer to global data (which is race free).
$term->destroy
@@ -1503,10 +1513,13 @@ Converts rxvt-unicodes text reprsentation into a perl string. See
$term->ROW_t
for details.
-$success = $term->grab_button ($button, $modifiermask)
+$success = $term->grab_button ($button, $modifiermask[, $window = $term->vt])
+
+$term->ungrab_button ($button, $modifiermask[, $window = $term->vt])
-Registers a synchronous button grab. See the XGrabButton manpage.
+Register/unregister a synchronous button grab. See the XGrabButton
+manpage.
$success = $term->grab ($eventtime[, $sync])
diff --git a/doc/rxvtperl.3.man.in b/doc/rxvtperl.3.man.in
index 4ba9d92a..d6364718 100644
--- a/doc/rxvtperl.3.man.in
+++ b/doc/rxvtperl.3.man.in
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.3
+.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -129,7 +129,7 @@
.\" ========================================================================
.\"
.IX Title "rxvt 3"
-.TH rxvt 3 "2006-01-26" "7.3a" "RXVT-UNICODE"
+.TH rxvt 3 "2006-01-29" "7.4" "RXVT-UNICODE"
.SH "NAME"
@@RXVT_NAME@@perl \- rxvt\-unicode's embedded perl interpreter
.SH "SYNOPSIS"
@@ -780,6 +780,12 @@ Using this function has the advantage that its output ends up in the
correct place, e.g. on stderr of the connecting urxvtc client.
.Sp
Messages have a size limit of 1023 bytes currently.
+.IP "@terms = urxvt::termlist" 4
+.IX Item "@terms = urxvt::termlist"
+Returns all urxvt::term objects that exist in this process, regardless of
+wether they are started, being destroyed etc., so be careful. Only term
+objects that have perl extensions attached will be returned (because there
+is no urxvt::term objet associated with others).
.IP "$time = urxvt::NOW" 4
.IX Item "$time = urxvt::NOW"
Returns the \*(L"current time\*(R" (as per the event loop).
@@ -866,7 +872,8 @@ hash which defines the environment of the new terminal.
Croaks (and probably outputs an error message) if the new instance
couldn't be created. Returns \f(CW\*(C`undef\*(C'\fR if the new instance didn't
initialise perl, and the terminal object otherwise. The \f(CW\*(C`init\*(C'\fR and
-\&\f(CW\*(C`start\*(C'\fR hooks will be called during this call.
+\&\f(CW\*(C`start\*(C'\fR hooks will be called before this call returns, and are free to
+refer to global data (which is race free).
.IP "$term\->destroy" 4
.IX Item "$term->destroy"
Destroy the terminal object (close the window, free resources
@@ -1302,10 +1309,16 @@ where one character corresponds to one screen cell. See
.IX Item "$string = $term->special_decode $text"
Converts rxvt-unicodes text reprsentation into a perl string. See
\&\f(CW\*(C`$term\->ROW_t\*(C'\fR for details.
-.ie n .IP "$success = $term\fR\->grab_button ($button, \f(CW$modifiermask)" 4
-.el .IP "$success = \f(CW$term\fR\->grab_button ($button, \f(CW$modifiermask\fR)" 4
-.IX Item "$success = $term->grab_button ($button, $modifiermask)"
-Registers a synchronous button grab. See the XGrabButton manpage.
+.ie n .IP "$success = $term\fR\->grab_button ($button, \f(CW$modifiermask\fR[, \f(CW$window\fR = \f(CW$term\->vt])" 4
+.el .IP "$success = \f(CW$term\fR\->grab_button ($button, \f(CW$modifiermask\fR[, \f(CW$window\fR = \f(CW$term\fR\->vt])" 4
+.IX Item "$success = $term->grab_button ($button, $modifiermask[, $window = $term->vt])"
+.PD 0
+.ie n .IP "$term\->ungrab_button ($button, $modifiermask\fR[, \f(CW$window\fR = \f(CW$term\->vt])" 4
+.el .IP "$term\->ungrab_button ($button, \f(CW$modifiermask\fR[, \f(CW$window\fR = \f(CW$term\fR\->vt])" 4
+.IX Item "$term->ungrab_button ($button, $modifiermask[, $window = $term->vt])"
+.PD
+Register/unregister a synchronous button grab. See the XGrabButton
+manpage.
.ie n .IP "$success = $term\fR\->grab ($eventtime[, \f(CW$sync])" 4
.el .IP "$success = \f(CW$term\fR\->grab ($eventtime[, \f(CW$sync\fR])" 4
.IX Item "$success = $term->grab ($eventtime[, $sync])"
diff --git a/doc/rxvtperl.3.txt b/doc/rxvtperl.3.txt
index 9e11351e..e2f034f3 100644
--- a/doc/rxvtperl.3.txt
+++ b/doc/rxvtperl.3.txt
@@ -553,6 +553,13 @@ API DOCUMENTATION
Messages have a size limit of 1023 bytes currently.
+ @terms = urxvt::termlist
+ Returns all urxvt::term objects that exist in this process,
+ regardless of wether they are started, being destroyed etc., so be
+ careful. Only term objects that have perl extensions attached will
+ be returned (because there is no urxvt::term objet associated with
+ others).
+
$time = urxvt::NOW
Returns the "current time" (as per the event loop).
@@ -633,7 +640,8 @@ API DOCUMENTATION
Croaks (and probably outputs an error message) if the new instance
couldn't be created. Returns "undef" if the new instance didn't
initialise perl, and the terminal object otherwise. The "init" and
- "start" hooks will be called during this call.
+ "start" hooks will be called before this call returns, and are free
+ to refer to global data (which is race free).
$term->destroy
Destroy the terminal object (close the window, free resources etc.).
@@ -987,8 +995,11 @@ API DOCUMENTATION
Converts rxvt-unicodes text reprsentation into a perl string. See
"$term->ROW_t" for details.
- $success = $term->grab_button ($button, $modifiermask)
- Registers a synchronous button grab. See the XGrabButton manpage.
+ $success = $term->grab_button ($button, $modifiermask[, $window =
+ $term->vt])
+ $term->ungrab_button ($button, $modifiermask[, $window = $term->vt])
+ Register/unregister a synchronous button grab. See the XGrabButton
+ manpage.
$success = $term->grab ($eventtime[, $sync])
Calls XGrabPointer and XGrabKeyboard in asynchronous (default) or
diff --git a/src/command.C b/src/command.C
index f5db1c21..d4838d54 100644
--- a/src/command.C
+++ b/src/command.C
@@ -3721,7 +3721,7 @@ rxvt_term::process_color_seq (int report, int color, const char *str, char resp)
#if XFT
if (c.a != rxvt_rgba::MAX_CC)
- tt_printf ("\033]%d;#%04x%04x%04x%04x%c", report, c.a, c.r, c.g, c.b, resp);
+ tt_printf ("\033]%d;rgba:%04x/%04x/%04x/%04x%c", report, c.a, c.r, c.g, c.b, resp);
else
#endif
tt_printf ("\033]%d;rgb:%04x/%04x/%04x%c", report, c.r, c.g, c.b, resp);
diff --git a/src/rxvttoolkit.C b/src/rxvttoolkit.C
index 972f6fa8..f6dac542 100644
--- a/src/rxvttoolkit.C
+++ b/src/rxvttoolkit.C
@@ -545,11 +545,13 @@ rxvt_color::set (rxvt_screen *screen, const char *name)
int mult;
if ( l == 1+4*1 && 4 == sscanf (name, "#%1hx%1hx%1hx%1hx%c", &r.a, &r.r, &r.g, &r.b, &eos))
- mult = 0x1111;
+ mult = rxvt_rgba::MAX_CC / 0x000f;
else if (l == 1+4*2 && 4 == sscanf (name, "#%2hx%2hx%2hx%2hx%c", &r.a, &r.r, &r.g, &r.b, &eos))
- mult = 0x0101;
+ mult = rxvt_rgba::MAX_CC / 0x00ff;
else if (l == 1+4*4 && 4 == sscanf (name, "#%4hx%4hx%4hx%4hx%c", &r.a, &r.r, &r.g, &r.b, &eos))
- mult = 0x0001;
+ mult = rxvt_rgba::MAX_CC / 0xffff;
+ else if (l == 4+5*4 && 4 == sscanf (name, "rgba:%hx/%hx/%hx/%hx%c", &r.r, &r.g, &r.b, &r.a, &eos))
+ mult = rxvt_rgba::MAX_CC / 0xffff;
else
return XftColorAllocName (screen->xdisp, screen->visual, screen->cmap, name, &c);
@@ -576,7 +578,22 @@ rxvt_color::set (rxvt_screen *screen, rxvt_rgba rgba)
d.blue = rgba.b;
d.alpha = rgba.a;
- return XftColorAllocValue (screen->xdisp, screen->visual, screen->cmap, &d, &c);
+ if (XftColorAllocValue (screen->xdisp, screen->visual, screen->cmap, &d, &c))
+ {
+ // FUCKING Xft gets it wrong, of course, fix it for the common case
+ // transparency users should eat shit and die, and then
+ // XRenderQueryPictIndexValues themselves plenty.
+ if (screen->depth == 32
+ && screen->visual->c_class == TrueColor
+ && screen->visual->red_mask == 0x00ff0000
+ && screen->visual->green_mask == 0x0000ff00
+ && screen->visual->blue_mask == 0x000000ff)
+ c.pixel = c.pixel & 0x00ffffffUL | ((rgba.a >> 8) << 24);
+
+ return true;
+ }
+
+ return false;
#else
XColor xc;
--
2.34.1