From 37164acd78931f89269729a31ee1b3fd0eb583fb Mon Sep 17 00:00:00 2001 From: root Date: Wed, 15 Dec 2004 00:53:23 +0000 Subject: [PATCH] *** empty log message *** --- Changes | 3 +-- doc/rxvt.1.pod | 5 +++++ src/command.C | 14 ++++++-------- src/init.C | 5 ++++- src/main.C | 4 ---- src/rxvt.h | 7 +++++-- src/rxvttoolkit.C | 5 +++++ src/rxvttoolkit.h | 4 +--- src/screen.C | 8 +++++++- src/xdefaults.C | 3 +++ 10 files changed, 37 insertions(+), 21 deletions(-) diff --git a/Changes b/Changes index 76529966..d3d1b247 100644 --- a/Changes +++ b/Changes @@ -2,7 +2,6 @@ Lines marked with "xterm:" indicate either xterm features ported to rxvt or changed rxvt behaviour to make it more compatible to xterm (usually xfree86's xterm). -TODO: configurable underline line colour. TODO: read property sequence is broken with respect to utf-8 etc. FEAT: hotkey font resizing FEAT: searchable backlog @@ -18,7 +17,7 @@ FEAT: tabbed windows (hey, just use screen...) - fix atom name enumeration. - streamline atom and xft color allocation to reduce startup time (12.8s -> 7.8s on my dsl). Still, doing it with only 2-3 - turnarounds would be much faster, but impossible to implement. + turnarounds would be much faster, but impossible to implement(?). - do not use XSETROOTPMAP_ID anymore, support ESETROOT_PMAP_ID instead. - implement underlineColor resource when ENABLE_FRILLS. diff --git a/doc/rxvt.1.pod b/doc/rxvt.1.pod index bc081f5b..b8bd65f1 100644 --- a/doc/rxvt.1.pod +++ b/doc/rxvt.1.pod @@ -441,6 +441,11 @@ foreground colour is the default. Use the specified colour as the background for reverse video characters. +=item B I + +If set, use the specified colour as the colour for the underline +itself. If unset, use the foreground colour. + =item B I Use the specified colour for the cursor. The default is to use the diff --git a/src/command.C b/src/command.C index 8fa267d1..9654179f 100644 --- a/src/command.C +++ b/src/command.C @@ -1670,10 +1670,8 @@ rxvt_term::rootwin_cb (XEvent &ev) * if user used some Esetroot compatible prog to set the root bg, * use the property to determine the pixmap. We use it later on. */ - if (xa[XA_XROOTPMAPID] == 0) - xa[XA_XROOTPMAPID] = XInternAtom (display->display, "_XROOTPMAP_ID", False); - - if (ev.xproperty.atom != xa[XA_XROOTPMAPID]) + if (ev.xproperty.atom == xa[XA_XROOTPMAP_ID] + || ev.xproperty.atom == xa[XA_ESETROOT_PMAP_ID]) return; /* FALLTHROUGH */ @@ -2353,14 +2351,14 @@ rxvt_term::check_our_parents () * the root background. Some window managers put multiple nested frame * windows for each client, so we have to take care about that. */ - i = (xa[XA_XROOTPMAPID] - && XGetWindowProperty (display->display, display->root, xa[XA_XROOTPMAPID], + i = (xa[XA_XROOTPMAP_ID] + && XGetWindowProperty (display->display, display->root, xa[XA_XROOTPMAP_ID], 0L, 1L, False, XA_PIXMAP, &atype, &aformat, &nitems, &bytes_after, &prop) == Success); if (!i || prop == NULL) - i = (xa[XA_XSETROOTID] - && XGetWindowProperty (display->display, display->root, xa[XA_XSETROOTID], + i = (xa[XA_ESETROOT_PMAP_ID] + && XGetWindowProperty (display->display, display->root, xa[XA_ESETROOT_PMAP_ID], 0L, 1L, False, XA_PIXMAP, &atype, &aformat, &nitems, &bytes_after, &prop) == Success); diff --git a/src/init.C b/src/init.C index 99c5fa7d..17c9eb99 100644 --- a/src/init.C +++ b/src/init.C @@ -157,6 +157,9 @@ const char *const def_colorName[] = NULL, /* Color_UL */ NULL, /* Color_RV */ #endif /* ! NO_BOLD_UNDERLINE_REVERSE */ +#if ENABLE_FRILLS + NULL, // Color_underline +#endif #ifdef OPTION_HC NULL, #endif @@ -192,7 +195,7 @@ const char *const xa_names[] = #endif #ifdef TRANSPARENT "_XROOTPMAP_ID", - "_XSETROOT_ID", + "ESETROOT_PMAP_ID", #endif #ifdef OFFIX_DND "DndProtocol", diff --git a/src/main.C b/src/main.C index db560df7..4fd79334 100644 --- a/src/main.C +++ b/src/main.C @@ -1000,10 +1000,6 @@ rxvt_term::set_colorfgbg () } /*----------------------------------------------------------------------*/ -/* - * Colour determination for low colour displays, routine from - * Hans de Goede - */ int rxvt_term::rXParseAllocColor (rxvt_color *screen_in_out, const char *colour) diff --git a/src/rxvt.h b/src/rxvt.h index 20584e92..dd835026 100644 --- a/src/rxvt.h +++ b/src/rxvt.h @@ -502,6 +502,9 @@ enum colour_list { Color_UL, Color_RV, #endif +#if ENABLE_FRILLS + Color_underline, +#endif #ifdef OPTION_HC Color_HC, #endif @@ -651,8 +654,8 @@ enum { XA_WM_LOCALE_NAME, #endif #if TRANSPARENT - XA_XROOTPMAPID, - XA_XSETROOTID, + XA_XROOTPMAP_ID, + XA_ESETROOT_PMAP_ID, #endif #if OFFIX_DND /* OffiX Dnd (drag 'n' drop) support */ XA_DNDPROTOCOL, diff --git a/src/rxvttoolkit.C b/src/rxvttoolkit.C index 3f4cf0e4..1cb697ab 100644 --- a/src/rxvttoolkit.C +++ b/src/rxvttoolkit.C @@ -388,12 +388,17 @@ rxvt_color::set (rxvt_display *display, Pixel p) bool rxvt_color::set (rxvt_display *display, const char *name) { +#if XFT + return XftColorAllocName (display->display, display->visual, display->cmap, + name, &c); +#else XColor xc; if (XParseColor (display->display, display->cmap, name, &xc)) return set (display, xc.red, xc.green, xc.blue); return false; +#endif } bool diff --git a/src/rxvttoolkit.h b/src/rxvttoolkit.h index 5a113049..290beb41 100644 --- a/src/rxvttoolkit.h +++ b/src/rxvttoolkit.h @@ -89,7 +89,7 @@ struct rxvt_display : refcounted { operator Display *() const { return display; } void flush (); - + Atom atom (const char *name); void set_selection_owner (rxvt_term *owner); void reg (xevent_watcher *w); @@ -102,8 +102,6 @@ struct rxvt_display : refcounted { rxvt_xim *get_xim (const char *locale, const char *modifiers); void put_xim (rxvt_xim *xim); #endif - - Atom atom (const char *name); }; #ifdef USE_XIM diff --git a/src/screen.C b/src/screen.C index 116c264c..c9fcfe71 100644 --- a/src/screen.C +++ b/src/screen.C @@ -2402,7 +2402,13 @@ rxvt_term::scr_refresh (unsigned char refresh_type) if (rend & RS_Uline && font->descent > 1 && fore != back) { - XSetForeground (display->display, TermWin.gc, pix_colors[fore]); +#if ENABLE_FRILLS + if (ISSET_PIXCOLOR (Color_underline)) + XSetForeground (display->display, TermWin.gc, pix_colors[Color_underline]); + else +#endif + XSetForeground (display->display, TermWin.gc, pix_colors[fore]); + XDrawLine (display->display, drawBuffer, TermWin.gc, xpixel, ypixel + font->ascent + 1, xpixel + Width2Pixel (count) - 1, ypixel + font->ascent + 1); diff --git a/src/xdefaults.C b/src/xdefaults.C index 8bc36338..52737e62 100644 --- a/src/xdefaults.C +++ b/src/xdefaults.C @@ -166,6 +166,9 @@ optList[] = { RSTRG (Rs_color + Color_UL, "colorUL", "color"), RSTRG (Rs_color + Color_RV, "colorRV", "color"), #endif /* ! NO_BOLD_UNDERLINE_REVERSE */ +#if ENABLE_FRILLS + RSTRG (Rs_color + Color_underline, "underlineColor", "color"), +#endif #ifdef KEEP_SCROLLCOLOR RSTRG (Rs_color + Color_scroll, "scrollColor", "color"), RSTRG (Rs_color + Color_trough, "troughColor", "color"), -- 2.34.1