- 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.
=item B<-depth> I<bitdepth>
-Compile I<frills>: Attempt to find a visual with the given bit depth;
+Compile I<xft>: Attempt to find a visual with the given bit depth;
resource B<depth>.
=item B<-geometry> I<geom>
=item B<depth:> I<bitdepth>
-Compile I<frills>: Attempt to find a visual with the given bit depth;
+Compile I<xft>: Attempt to find a visual with the given bit depth;
option B<-depth>.
=item B<geometry:> I<geom>
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;
}
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)
{
// 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
#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),