From 5497fbb1c5c0ff33daf0ae4cc220e1e095e2e97b Mon Sep 17 00:00:00 2001 From: root Date: Sat, 31 Dec 2005 16:06:48 +0000 Subject: [PATCH] *** empty log message *** --- Changes | 3 +++ doc/rxvt.1.pod | 14 ++++++++++++++ src/ptytty.C | 8 ++++++-- src/rxvt.h | 25 +++++++++++++------------ src/rxvtlib.h.in | 7 ++++++- src/xdefaults.C | 1 + 6 files changed, 43 insertions(+), 15 deletions(-) diff --git a/Changes b/Changes index 088da1af..0875f393 100644 --- a/Changes +++ b/Changes @@ -18,6 +18,9 @@ WISH: just for fun, do shade and tint with XRender. most BSDs), privileges weren't dropped before opening the pty, resulting in wrong permissions on the pseudo terminal. Reported and fixed by Ryan Beasley. + - implemented intensityStyles option which enables/disables bold/blink + selecting high intensity foreground/background colours, suggested by + Chuck Blake. - replaced callback.h by a fixed version from gvpe that correctly returns the callback result (affects new -pty-fd semantics in urxvtc on a few architectures). Reported by darix. diff --git a/doc/rxvt.1.pod b/doc/rxvt.1.pod index ba8df696..15eeeb87 100644 --- a/doc/rxvt.1.pod +++ b/doc/rxvt.1.pod @@ -204,6 +204,12 @@ be printed. See resource B for details. Compile font-styles: The bold italic font list to use when bold characters are to be printed. See resource B for details. +=item B<-is>|B<+is> + +Compile font-styles: Bold/Italic font styles imply high intensity +foreground/background (default). See resource B for +details. + =item B<-name> I Specify the application name under which resources are to be obtained, @@ -689,6 +695,14 @@ not possible, replacement fonts of the desired shape will be tried. If set, but empty, then this specific style is disabled and the normal text font will being used for the given style. +=item B I + +When font styles are not enabled, or this option is enabled (B, +option B<-is>, the default), bold and italic font styles imply high +intensity foreground/backround colours. Disabling this option (B, +option B<+is>) disables this behaviour, the high intensity colours are not +reachable. + =item B I Set mouse selection style to B which is 2.20, B which is diff --git a/src/ptytty.C b/src/ptytty.C index 3cf50424..6bd703a9 100644 --- a/src/ptytty.C +++ b/src/ptytty.C @@ -76,9 +76,13 @@ get_pty (int *fd_tty, char **ttydev) int pfd; #ifdef PTYS_ARE_OPENPTY - char tty_name[sizeof "/dev/pts/????\0"]; + char tty_name[sizeof "/dev/pts/?????\0"]; - if (openpty (&pfd, fd_tty, tty_name, NULL, NULL) != -1) + rxvt_privileges (RESTORE); + int res = openpty (&pfd, fd_tty, tty_name, NULL, NULL); + rxvt_privileges (IGNORE); + + if (res != -1) { *ttydev = strdup (tty_name); return pfd; diff --git a/src/rxvt.h b/src/rxvt.h index 89c2a1b4..b2a7b44b 100644 --- a/src/rxvt.h +++ b/src/rxvt.h @@ -638,6 +638,7 @@ enum { Rs_borderLess, Rs_lineSpace, Rs_cursorUnderline, + Rs_intensityStyles, #endif #if CURSOR_BLINK Rs_cursorBlink, @@ -829,18 +830,18 @@ enum { #define GET_BASEFG(x) (((x) & RS_fgMask)) #define GET_BASEBG(x) (((x) & RS_bgMask)>>Color_Bits) #ifndef NO_BRIGHTCOLOR -# define GET_FGCOLOR(x) \ - ((((x) & RS_Bold) == 0 \ - || GET_BASEFG (x) < minCOLOR \ - || GET_BASEFG (x) >= minBrightCOLOR) \ - ? GET_BASEFG (x) \ - : (GET_BASEFG (x) + (minBrightCOLOR - minCOLOR))) -# define GET_BGCOLOR(x) \ - ((((x) & RS_Blink) == 0 \ - || GET_BASEBG (x) < minCOLOR \ - || GET_BASEBG (x) >= minBrightCOLOR) \ - ? GET_BASEBG (x) \ - : (GET_BASEBG (x) + (minBrightCOLOR - minCOLOR))) +# define GET_FGCOLOR(x) ( \ + !((x) & RS_Bold) \ + || (ENABLE_STYLES && !(options & Opt_intensityStyles)) \ + || !IN_RANGE_INC (GET_BASEFG (x), minCOLOR, minBrightCOLOR) \ + ? GET_BASEFG (x) \ + : (GET_BASEFG (x) + (minBrightCOLOR - minCOLOR))) +# define GET_BGCOLOR(x) ( \ + !((x) & RS_Blink) \ + || (ENABLE_STYLES && !(options & Opt_intensityStyles)) \ + || !IN_RANGE_INC (GET_BASEBG (x), minCOLOR, minBrightCOLOR) \ + ? GET_BASEBG (x) \ + : (GET_BASEBG (x) + (minBrightCOLOR - minCOLOR))) #else # define GET_FGCOLOR(x) GET_BASEFG(x) # define GET_BGCOLOR(x) GET_BASEBG(x) diff --git a/src/rxvtlib.h.in b/src/rxvtlib.h.in index dbc2f2f1..d395b59d 100644 --- a/src/rxvtlib.h.in +++ b/src/rxvtlib.h.in @@ -261,13 +261,18 @@ typedef struct { # define Opt_borderLess 0 # define Opt_hold 0 #endif +#if ENABLE_STYLES +# define Opt_intensityStyles (1UL<<27) // font styles imply intensity +#else +# define Opt_intensityStyles 0 +#endif /* place holder used for parsing command-line options */ #define Opt_Reverse (1UL<<30) #define Opt_Boolean (1UL<<31) #define DEFAULT_OPTIONS (Opt_scrollBar | Opt_scrollTtyOutput \ | Opt_jumpScroll | Opt_secondaryScreen \ - | Opt_pastableTabs) + | Opt_pastableTabs | Opt_intensityStyles) /* ------------------------------------------------------------------------- */ diff --git a/src/xdefaults.C b/src/xdefaults.C index 25a56a34..be0dc439 100644 --- a/src/xdefaults.C +++ b/src/xdefaults.C @@ -207,6 +207,7 @@ optList[] = { STRG (Rs_boldFont, "boldFont", "fb", "fontname", "bold font"), STRG (Rs_italicFont, "italicFont", "fi", "fontname", "italic font"), STRG (Rs_boldItalicFont, "boldItalicFont", "fbi", "fontname", "bold italic font"), + BOOL (Rs_intensityStyles, "intensityStyles", "is", Opt_intensityStyles, "font styles imply intensity changes"), #endif #ifdef USE_XIM STRG (Rs_inputMethod, "inputMethod", "im", "name", "name of input method"), -- 2.34.1