From a8da0e79d5959ccbce1ad8fbf87816dc84f968b8 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 29 Jan 2006 22:27:04 +0000 Subject: [PATCH] *** empty log message *** --- Changes | 3 ++- doc/rxvt.1.pod | 4 ++-- src/rxvttoolkit.C | 8 ++++---- src/rxvtutil.C | 27 +++++++++++++++++++++++++++ src/rxvtutil.h | 1 - src/xdefaults.C | 4 +++- 6 files changed, 38 insertions(+), 9 deletions(-) diff --git a/Changes b/Changes index 5ce56589..c5731770 100644 --- a/Changes +++ b/Changes @@ -19,7 +19,8 @@ DUMB: support tex fonts - small configure updates. - overhauled color management: smaller codesize, alpha support. - support rgba:r/g/b/a, #argb, #aarrggbb and #aaaarrrrggggbbbb - colour "names". + colour "names", and try to work around xft forcing everything + to be 100% transparent. Long Live Xft! - do not include X11/Intrinsic.h anymore, directly use Xlib/Xutil/Xresource directly. diff --git a/doc/rxvt.1.pod b/doc/rxvt.1.pod index 86fb9074..8e9c772c 100644 --- a/doc/rxvt.1.pod +++ b/doc/rxvt.1.pod @@ -97,7 +97,7 @@ B environment variable is used. =item B<-depth> I -Compile I: Attempt to find a visual with the given bit depth; +Compile I: Attempt to find a visual with the given bit depth; resource B. =item B<-geometry> I @@ -514,7 +514,7 @@ extensions not documented here): =item B I -Compile I: Attempt to find a visual with the given bit depth; +Compile I: Attempt to find a visual with the given bit depth; option B<-depth>. =item B I diff --git a/src/rxvttoolkit.C b/src/rxvttoolkit.C index aa4356c1..fcd2fbc5 100644 --- a/src/rxvttoolkit.C +++ b/src/rxvttoolkit.C @@ -591,10 +591,10 @@ rxvt_color::set (rxvt_screen *screen, rxvt_rgba rgba) c.color.blue = rgba.b; c.color.alpha = rgba.a; - c.pixel = (rgba.r >> (16 - popcount (format->direct.redMask )) << format->direct.red) - | (rgba.g >> (16 - popcount (format->direct.greenMask)) << format->direct.green) - | (rgba.b >> (16 - popcount (format->direct.blueMask )) << format->direct.blue) - | (rgba.a >> (16 - popcount (format->direct.alphaMask)) << format->direct.alpha); + c.pixel = ((rgba.r * format->direct.redMask / rxvt_rgba::MAX_CC) << format->direct.red) + | ((rgba.g * format->direct.greenMask / rxvt_rgba::MAX_CC) << format->direct.green) + | ((rgba.b * format->direct.blueMask / rxvt_rgba::MAX_CC) << format->direct.blue) + | ((rgba.a * format->direct.alphaMask / rxvt_rgba::MAX_CC) << format->direct.alpha); return true; } diff --git a/src/rxvtutil.C b/src/rxvtutil.C index bf1baa41..d2cd7c08 100644 --- a/src/rxvtutil.C +++ b/src/rxvtutil.C @@ -23,6 +23,33 @@ byteorder::byteorder () e = w.u; } +#if !HAVE_GCC_BUILTINS +int ctz (unsigned int x) +{ + int r = 0; + + x &= -x; // this isolates the lowest bit + + if (x & 0xaaaaaaaa) r += 1; + if (x & 0xcccccccc) r += 2; + if (x & 0xf0f0f0f0) r += 4; + if (x & 0xff00ff00) r += 8; + if (x & 0xffff0000) r += 16; + + return r; +} + +int popcount (unsigned int x) +{ + x -= (x >> 1) & 0x55555555; + x = ((x >> 2) & 0x33333333) + (x & 0x33333333); + x = ((x >> 4) + x) & 0x0f0f0f0f; + x *= 0x01010101; + + return x >> 24; +} +#endif + void * zero_initialized::operator new (size_t s) { diff --git a/src/rxvtutil.h b/src/rxvtutil.h index bdbdb9f7..71725ebb 100644 --- a/src/rxvtutil.h +++ b/src/rxvtutil.h @@ -11,7 +11,6 @@ // actually, some gcc-3.x versions work, too #define HAVE_GCC_BUILTINS (__GNUC__ >= 4) -#define HAVE_GCC_BUILTINS 0 extern class byteorder { static unsigned int e; // at least 32 bits diff --git a/src/xdefaults.C b/src/xdefaults.C index 6b64bb2b..36fe7c10 100644 --- a/src/xdefaults.C +++ b/src/xdefaults.C @@ -213,12 +213,14 @@ optList[] = { #if ENABLE_XEMBED STRG (Rs_embed, NULL, "embed", "windowid", "window id to embed terminal in"), #endif +#if XFT + STRG (Rs_depth, "depth", "depth", "number", "depth of visual to request"), +#endif #if ENABLE_FRILLS RSTRG (Rs_transient_for, "transient-for", "windowid"), BOOL (Rs_override_redirect, "override-redirect", "override-redirect", Opt_override_redirect, "set override-redirect on the terminal window"), STRG (Rs_pty_fd, NULL, "pty-fd", "fileno", "file descriptor of pty to use"), BOOL (Rs_hold, "hold", "hold", Opt_hold, "retain window after shell exit"), - STRG (Rs_depth, "depth", "depth", "number", "depth of visual to request"), STRG (Rs_ext_bwidth, "externalBorder", "w", "number", "external border in pixels"), STRG (Rs_ext_bwidth, NULL, "bw", NULL, NULL), STRG (Rs_ext_bwidth, NULL, "borderwidth", NULL, NULL), -- 2.34.1