- 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.
+ - further minor cleanups.
6.1 Tue Dec 27 13:23:40 CET 2005
- update iso8859-7 table (euro and drachma round-trip et al.).
=end table
+=item B<< C<Ps = 1021> >> (B<rxvt>)
+
+=begin table
+
+ B<< C<h> >> Bold/italic implies high intensity (see option B<-is>)
+ B<< C<l> >> Font styles have no effect on intensity.
+
+=end table
+
=item B<< C<Ps = 1047> >>
=begin table
if (len <= 0)
return; /* not mapped */
- if (options & Opt_scrollTtyKeypress)
+ if (OPTION (Opt_scrollTtyKeypress))
if (view_start)
{
view_start = 0;
{
pty_ev.stop ();
- if (!(options & Opt_hold))
+ if (!OPTION (Opt_hold))
destroy ();
}
#ifdef POINTER_BLANK
hidden_pointer = 0;
- if (options & Opt_pointerBlank)
+ if (OPTION (Opt_pointerBlank))
pointer_ev.start (NOW + pointerBlankDelay);
#endif
}
void
rxvt_term::pointer_blank ()
{
- if (! (options & Opt_pointerBlank))
+ if (! OPTION (Opt_pointerBlank))
return;
XDefineCursor (display->display, vt, display->blank_cursor);
SET_LOCALE (locale);
#if defined(CURSOR_BLINK)
- if ((options & Opt_cursorBlink) && ev.type == KeyPress)
+ if (OPTION (Opt_cursorBlink) && ev.type == KeyPress)
{
if (hidden_cursor)
{
#endif
#if defined(POINTER_BLANK)
- if ((options & Opt_pointerBlank) && pointerBlankDelay > 0)
+ if (OPTION (Opt_pointerBlank) && pointerBlankDelay > 0)
{
if (ev.type == MotionNotify
|| ev.type == ButtonPress
}
#ifdef TRANSPARENT /* XXX: maybe not needed - leave in for now */
- if (options & Opt_transparent)
+ if (OPTION (Opt_transparent))
check_our_parents ();
#endif
}
}
#endif
#if CURSOR_BLINK
- if (options & Opt_cursorBlink)
+ if (OPTION (Opt_cursorBlink))
cursor_blink_ev.start (NOW + BLINK_INTERVAL);
#endif
#if OFF_FOCUS_FADING
XUnsetICFocus (Input_Context);
#endif
#if CURSOR_BLINK
- if (options & Opt_cursorBlink)
+ if (OPTION (Opt_cursorBlink))
cursor_blink_ev.stop ();
hidden_cursor = 0;
#endif
/* FALLTHROUGH */
case ReparentNotify:
- if ((options & Opt_transparent) && check_our_parents () && am_transparent)
+ if (OPTION (Opt_transparent) && check_our_parents () && am_transparent)
want_refresh = want_full_refresh = 1;
break;
}
if (ev.state & ShiftMask)
i = 1;
- else if (options & Opt_mouseWheelScrollPage)
+ else if (OPTION (Opt_mouseWheelScrollPage))
i = nrow - 1;
else
i = 5;
pchanged = 0;
- if (!(options & Opt_transparent))
+ if (!OPTION (Opt_transparent))
return pchanged; /* Don't try any more */
XGetWindowAttributes (disp, display->root, &wrootattr);
refresh_count++;
- if (!(options & Opt_jumpScroll)
+ if (!OPTION (Opt_jumpScroll)
|| (refresh_count >= refresh_limit * (nrow - 1)))
{
refreshnow = true;
*/
if (refreshnow)
{
- if ((options & Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD)
+ if (OPTION (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD)
refresh_limit++;
else
{
scr_report_position ();
break;
case 7: /* unofficial extension */
- if (options & Opt_insecure)
+ if (OPTION (Opt_insecure))
tt_printf ("%-.250s\012", rs[Rs_display_name]);
break;
case 8: /* unofficial extension */
{
char *s;
XGetIconName (disp, parent[0], &s);
- tt_printf ("\033]L%-.250s\234", (options & Opt_insecure) && s ? s : ""); /* 8bit ST */
+ tt_printf ("\033]L%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */
XFree (s);
}
break;
{
char *s;
XFetchName (disp, parent[0], &s);
- tt_printf ("\033]l%-.250s\234", (options & Opt_insecure) && s ? s : ""); /* 8bit ST */
+ tt_printf ("\033]l%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */
XFree (s);
}
break;
#ifdef MENUBAR
case URxvt_Menu:
- if (options & Opt_insecure)
+ if (OPTION (Opt_insecure))
menubar_dispatch (const_cast<char *>(str)); // casting away constness is checked
break;
#endif
#endif
if (query)
tt_printf ("\33]%d;%-.250s%c", saveop,
- (options & Opt_insecure) && fontset[op - URxvt_font]->fontdesc
+ OPTION (Opt_insecure) && fontset[op - URxvt_font]->fontdesc
? fontset[op - URxvt_font]->fontdesc : "",
resp);
else
#if ENABLE_FRILLS
case URxvt_locale:
if (query)
- tt_printf ("\33]%d;%-.250s%c", URxvt_locale, (options & Opt_insecure) ? locale : "", resp);
+ tt_printf ("\33]%d;%-.250s%c", URxvt_locale, OPTION (Opt_insecure) ? locale : "", resp);
else
{
set_locale (str);
{
case 1048: /* alternative cursor save */
case 1049:
- if (options & Opt_secondaryScreen)
+ if (OPTION (Opt_secondaryScreen))
if (mode == 0)
scr_cursor (RESTORE);
else if (mode == 1)
set_widthheight (((state ? 132 : 80) * fwidth), height);
break;
case 4: /* smooth scrolling */
- if (state)
- options &= ~Opt_jumpScroll;
+ if (!state)
+ SET_OPTION (Opt_jumpScroll);
else
- options |= Opt_jumpScroll;
+ CLR_OPTION (Opt_jumpScroll);
break;
case 5: /* reverse video */
scr_rvideo_mode (state);
break; /* X11 mouse highlighting */
#endif
case 1010: /* scroll to bottom on TTY output inhibit */
- if (state)
- options &= ~Opt_scrollTtyOutput;
+ if (!state)
+ SET_OPTION (Opt_scrollTtyOutput);
else
- options |= Opt_scrollTtyOutput;
+ CLR_OPTION (Opt_scrollTtyOutput);
break;
case 1011: /* scroll to bottom on key press */
if (state)
- options |= Opt_scrollTtyKeypress;
+ SET_OPTION (Opt_scrollTtyKeypress);
else
- options &= ~Opt_scrollTtyKeypress;
+ CLR_OPTION (Opt_scrollTtyKeypress);
break;
+#if ENABLE_STYLES
+ case 1021:
+ if (state)
+ SET_OPTION (Opt_intensityStyles);
+ else
+ CLR_OPTION (Opt_intensityStyles);
+#endif
case 1047: /* secondary screen w/ clearing last */
- if (options & Opt_secondaryScreen)
+ if (OPTION (Opt_secondaryScreen))
if (current_screen != PRIMARY)
scr_erase_screen (2);
scr_change_screen (state);
break;
case 1049: /* secondary screen w/ clearing first */
scr_change_screen (state);
- if (options & Opt_secondaryScreen)
+ if (OPTION (Opt_secondaryScreen))
if (current_screen != PRIMARY)
scr_erase_screen (2);
break;
/* no point having a scrollbar without having any scrollback! */
if (!saveLines)
- options &= ~Opt_scrollBar;
+ CLR_OPTION (Opt_scrollBar);
#ifdef PRINTPIPE
if (!rs[Rs_print_pipe])
#ifdef XTERM_REVERSE_VIDEO
/* this is how xterm implements reverseVideo */
- if (options & Opt_reverseVideo)
+ if (OPTION (Opt_reverseVideo))
{
if (!rs[Rs_color + Color_fg])
rs[Rs_color + Color_fg] = def_colorName[Color_bg];
#ifndef XTERM_REVERSE_VIDEO
/* this is how we implement reverseVideo */
- if (options & Opt_reverseVideo)
+ if (OPTION (Opt_reverseVideo))
::swap (rs[Rs_color + Color_fg], rs[Rs_color + Color_bg]);
#endif
*/
#ifdef META8_OPTION
- meta_char = (options & Opt_meta8 ? 0x80 : C0_ESC);
+ meta_char = OPTION ((Opt_meta8) ? 0x80 : C0_ESC);
#endif
get_ourmods ();
- if (!(options & Opt_scrollTtyOutput))
+ if (!OPTION (Opt_scrollTtyOutput))
priv_modes |= PrivMode_TtyOutputInh;
- if (options & Opt_scrollTtyKeypress)
+ if (OPTION (Opt_scrollTtyKeypress))
priv_modes |= PrivMode_Keypress;
- if (!(options & Opt_jumpScroll))
+ if (!OPTION (Opt_jumpScroll))
priv_modes |= PrivMode_smoothScroll;
#ifndef NO_BACKSPACE_KEY
}
#ifdef CURSOR_BLINK
- if (options & Opt_cursorBlink)
+ if (OPTION (Opt_cursorBlink))
(void)gettimeofday (&lastcursorchange, NULL);
#endif
if (!rXParseAllocColor (&xcol, rs[Rs_color + i]))
{
#ifndef XTERM_REVERSE_VIDEO
- if (i < 2 && (options & Opt_reverseVideo))
+ if (i < 2 && OPTION (Opt_reverseVideo))
rs[Rs_color + i] = def_colorName[!i];
else
#endif
assert (sizeof (xa_names) / sizeof (char *) == NUM_XA);
XInternAtoms (disp, (char **)xa_names, NUM_XA, False, xa);
- if (options & Opt_transparent)
+ if (OPTION (Opt_transparent))
{
XGetWindowAttributes (disp, RootWindow (disp, display->screen), &gattr);
display->depth = gattr.depth; // doh //TODO, per-term not per-display?
}
#if ENABLE_FRILLS
- if (options & Opt_borderLess)
+ if (OPTION (Opt_borderLess))
{
prop = XInternAtom(disp, "_MOTIF_WM_INFO", True);
wmHint.flags = InputHint | StateHint | WindowGroupHint;
wmHint.input = True;
- wmHint.initial_state = options & Opt_iconic ? IconicState : NormalState;
+ wmHint.initial_state = OPTION (Opt_iconic) ? IconicState : NormalState;
wmHint.window_group = top;
XmbSetWMProperties (disp, top, NULL, NULL, (char **)argv, argc,
vt_emask = ExposureMask | ButtonPressMask | ButtonReleaseMask | PropertyChangeMask;
#ifdef POINTER_BLANK
- if (options & Opt_pointerBlank)
+ if (OPTION (Opt_pointerBlank))
vt_emask |= PointerMotionMask;
else
#endif
#ifdef XPM_BACKGROUND
if (rs[Rs_backgroundPixmap] != NULL
- && ! (options & Opt_transparent))
+ && ! OPTION (Opt_transparent))
{
const char *p = rs[Rs_backgroundPixmap];
SET_TTYMODE (STDIN_FILENO, &tio); /* init terminal attributes */
- if (options & Opt_console)
+ if (OPTION (Opt_console))
{ /* be virtual console, fail silently */
#ifdef TIOCCONS
unsigned int on = 1;
argv0 = (const char *)rxvt_r_basename (shell);
- if (options & Opt_loginShell)
+ if (OPTION (Opt_loginShell))
{
login = (char *)rxvt_malloc ((strlen (argv0) + 2) * sizeof (char));
arg_a[0] = my_basename (command);
- if (options & Opt_loginShell)
+ if (OPTION (Opt_loginShell))
{
login = rxvt_malloc ((strlen (arg_a[0]) + 2) * sizeof (char));
#ifdef WTMP_SUPPORT
# ifdef WTMP_ONLY_ON_LOGIN
- if (options & Opt_loginShell)
+ if (OPTION (Opt_loginShell))
# endif
{
# ifdef HAVE_STRUCT_UTMP
}
#endif
#if defined(LASTLOG_SUPPORT) && defined(RXVT_LASTLOG_FILE)
- if (options & Opt_loginShell)
+ if (OPTION (Opt_loginShell))
rxvt_update_lastlog (RXVT_LASTLOG_FILE, pty, hostname);
#endif
}
*/
#ifdef WTMP_SUPPORT
# ifdef WTMP_ONLY_ON_LOGIN
- if (options & Opt_loginShell)
+ if (OPTION (Opt_loginShell))
# endif
{
# ifdef HAVE_STRUCT_UTMP
{
cmd_pid = 0;
- if (!(options & Opt_hold))
+ if (!OPTION (Opt_hold))
destroy ();
}
menubar_read (rs[Rs_menu]);
#endif
#ifdef HAVE_SCROLLBARS
- if (options & Opt_scrollBar)
+ if (OPTION (Opt_scrollBar))
scrollBar.setIdle (); /* set existence for size calculations */
#endif
#endif
#ifdef HAVE_SCROLLBARS
- if (options & Opt_scrollBar)
+ if (OPTION (Opt_scrollBar))
resize_scrollbar (); /* create and map scrollbar */
#endif
#if (MENUBAR_MAX)
XMapWindow (disp, menuBar.win);
#endif
#ifdef TRANSPARENT
- if (options & Opt_transparent)
+ if (OPTION (Opt_transparent))
{
XSelectInput (disp, display->root, PropertyChangeMask);
check_our_parents ();
void
rxvt_term::privileged_utmp (rxvt_privaction action)
{
- if ((options & Opt_utmpInhibit)
+ if (OPTION (Opt_utmpInhibit)
|| !pty.name || !*pty.name)
return;
{
sb_w = scrollbar_TotalWidth ();
szHint.base_width += sb_w;
- if (!(options & Opt_scrollBar_right))
+ if (!OPTION (Opt_scrollBar_right))
window_vt_x += sb_w;
}
szHint.height = szHint.base_height + height;
}
- if (scrollbar_visible () && (options & Opt_scrollBar_right))
+ if (scrollbar_visible () && OPTION (Opt_scrollBar_right))
window_sb_x = szHint.width - sb_w;
if (recalc_x)
int base = GET_BASEFG (r);
#ifndef NO_BRIGHTCOLOR
if (r & RS_Bold
- && (!ENABLE_STYLES || options & Opt_intensityStyles)
+ && (!ENABLE_STYLES || OPTION (Opt_intensityStyles))
&& IN_RANGE_INC (base, minCOLOR, minBrightCOLOR))
base += minBrightCOLOR - minCOLOR;
#endif
int base = GET_BASEBG (r);
#ifndef NO_BRIGHTCOLOR
if (r & RS_Blink
- && (!ENABLE_STYLES || options & Opt_intensityStyles)
+ && (!ENABLE_STYLES || OPTION (Opt_intensityStyles))
&& IN_RANGE_INC (base, minCOLOR, minBrightCOLOR))
base += minBrightCOLOR - minCOLOR;
#endif
#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 OPTION(opt) (options && (opt))
+#define SET_OPTION(opt) (options |= (opt))
+#define CLR_OPTION(opt) (options &= ~(opt))
+#define OPTION(opt) (options & (opt))
#define DEFAULT_OPTIONS (Opt_scrollBar | Opt_scrollTtyOutput \
| Opt_jumpScroll | Opt_secondaryScreen \
| Opt_pastableTabs | Opt_intensityStyles)
* GENERAL SCREEN AND SELECTION UPDATE ROUTINES *
* ------------------------------------------------------------------------- */
#define ZERO_SCROLLBACK() \
- if (options & Opt_scrollTtyOutput) \
+ if (OPTION (Opt_scrollTtyOutput)) \
view_start = 0
#define CLEAR_SELECTION() \
selection.beg.row = selection.beg.col \
screen.cur.col = clamp (screen.cur.col, 0, prev_ncol - 1);
#if NSCREENS
- if (options & Opt_secondaryScreen)
+ if (OPTION (Opt_secondaryScreen))
{
num_scr = 0;
}
else
#endif
- if (options & Opt_secondaryScroll)
+ if (OPTION (Opt_secondaryScroll))
scr_scroll_text (0, prev_nrow - 1, prev_nrow);
return scrn;
if (count > 0
&& row1 == 0
&& row2 == nrow - 1
- && (current_screen == PRIMARY || options & Opt_secondaryScroll))
+ && (current_screen == PRIMARY || OPTION (Opt_secondaryScroll)))
{
nsaved = min (nsaved + count, saveLines);
term_start = (term_start + count) % total_rows;
scr_blank_screen_mem (ROW(row2 - i), rstyle);
}
- if ((options & Opt_scrollWithBuffer)
+ if (OPTION (Opt_scrollWithBuffer)
&& view_start != 0
&& view_start != saveLines)
scr_page (UP, count);
// store horizontal tab commands as characters inside the text
// buffer so they can be selected and pasted.
- if (ht && options & Opt_pastableTabs)
+ if (ht && OPTION (Opt_pastableTabs))
{
base_rend = SET_FONT (base_rend, 0);
if (bgPixmap.pixmap == None)
#endif
#if TRANSPARENT
- if (! (options & Opt_transparent) || am_transparent == 0)
+ if (! OPTION (Opt_transparent) || am_transparent == 0)
#endif
XSetWindowBackground (display->display, vt,
pix_colors[Color_bg]);
# ifndef NO_MAPALERT
# ifdef MAPALERT_OPTION
- if (options & Opt_mapAlert)
+ if (OPTION (Opt_mapAlert))
# endif
XMapWindow (display->display, parent[0]);
# endif
- if (options & Opt_visualBell)
+ if (OPTION (Opt_visualBell))
{
scr_rvideo_mode (!rvideo); /* refresh also done */
rxvt_usleep (VISUAL_BELL_DURATION);
must_clear |= bgPixmap.pixmap != None;
#endif
#if TRANSPARENT
- must_clear |= (options & Opt_transparent) && am_transparent;
+ must_clear |= OPTION (Opt_transparent) && am_transparent;
#endif
ocrow = oldcursor.row; /* is there an old outline cursor on screen? */
if (showcursor && focus)
{
- if (options & Opt_cursorUnderline)
+ if (OPTION (Opt_cursorUnderline))
*crp ^= RS_Uline;
else
{
{
if (focus)
{
- if (options & Opt_cursorUnderline)
+ if (OPTION (Opt_cursorUnderline))
*crp ^= RS_Uline;
else
{
else if (selection.clicks == 3)
{
#if ENABLE_FRILLS
- if (options & Opt_tripleclickwords)
+ if (OPTION (Opt_tripleclickwords))
{
selection_delimit_word (UP, &selection.beg, &selection.beg);
GCForeground, &gcvalue);
}
- xsb = (options & Opt_scrollBar_right) ? 1 : 0;
+ xsb = OPTION (Opt_scrollBar_right) ? 1 : 0;
if (update)
{
{
int xofs;
- if (options & Opt_scrollBar_right)
+ if (OPTION (Opt_scrollBar_right))
xofs = 0;
else
xofs = sbshadow ? sbwidth : sbwidth - 1;
if (update)
{
- xsb = (options & Opt_scrollBar_right) ? 1 : 0;
+ xsb = OPTION (Opt_scrollBar_right) ? 1 : 0;
if (last_top < scrollBar.top)
XClearArea (display->display, scrollBar.win,
sb_shadow + xsb, last_top,
width = min (i, SB_WIDTH_MAXIMUM);
# if defined(RXVT_SCROLLBAR)
- if (! (options & Opt_scrollBar_floating) && style == R_SB_RXVT)
+ if (! OPTION (Opt_scrollBar_floating) && style == R_SB_RXVT)
sb_shadow = SHADOW;
# endif
#include "keyboard.h"
#endif
+/* place holders used for parsing command-line options */
+#define Optflag_Reverse 0x40000000UL
+#define Optflag_Boolean 0x80000000UL
+#define Optflag_mask 0x3fffffffUL
+
/* #define DEBUG_RESOURCES */
/*{{{ monolithic option/resource structure: */
/* BOOL () - regular boolean `-/+' flag */
#define BOOL(rsp, kw, opt, flag, desc) \
- { (Opt_Boolean| (flag)), (rsp), (kw), (opt), NULL, (desc)}
+ { (Optflag_Boolean | (flag)), (rsp), (kw), (opt), NULL, (desc)}
/* SWCH () - `-' flag */
#define SWCH(opt, flag, desc) \
#define optList_strlen(i) \
(optList[i].flag ? 0 : (optList[i].arg ? strlen (optList[i].arg) : 1))
#define optList_isBool(i) \
- (optList[i].flag & Opt_Boolean)
+ (optList[i].flag & Optflag_Boolean)
#define optList_isReverse(i) \
- (optList[i].flag & Opt_Reverse)
+ (optList[i].flag & Optflag_Reverse)
#define optList_size \
(sizeof (optList) / sizeof (optList[0]))
STRG (Rs_scrollBar_thickness, "thickness", "sbt", "number", "scrollbar thickness/width in pixels"),
#endif
BOOL (Rs_scrollTtyOutput, "scrollTtyOutput", NULL, Opt_scrollTtyOutput, NULL),
- BOOL (Rs_scrollTtyOutput, NULL, "si", Opt_Reverse | Opt_scrollTtyOutput, "scroll-on-tty-output inhibit"),
+ BOOL (Rs_scrollTtyOutput, NULL, "si", Optflag_Reverse | Opt_scrollTtyOutput, "scroll-on-tty-output inhibit"),
BOOL (Rs_scrollTtyKeypress, "scrollTtyKeypress", "sk", Opt_scrollTtyKeypress, "scroll-on-keypress"),
BOOL (Rs_scrollWithBuffer, "scrollWithBuffer", "sw", Opt_scrollWithBuffer, "scroll-with-buffer"),
#if TRANSPARENT
optList[entry].opt, optList[entry].kw, flag);
#endif
if (flag == On)
- options |= optList[entry].flag;
+ SET_OPTION (optList[entry].flag & Optflag_mask);
else
- options &= ~optList[entry].flag;
+ CLR_OPTION (optList[entry].flag & Optflag_mask);
if (optList[entry].doff != -1)
rs[optList[entry].doff] = flag;
s = !s;
if (s)
- options |= optList[entry].flag;
+ SET_OPTION (optList[entry].flag & Optflag_mask);
else
- options &= ~optList[entry].flag;
+ CLR_OPTION (optList[entry].flag & Optflag_mask);
}
}
s = !s;
if (s)
- options |= optList[entry].flag;
+ SET_OPTION (optList[entry].flag & Optflag_mask);
else
- options &= ~optList[entry].flag;
+ CLR_OPTION (optList[entry].flag & Optflag_mask);
}
}
}
{ /* So be it: I'm not using pixmaps */
pixmap = None;
- if (!(options & Opt_transparent) || !am_transparent)
+ if (!OPTION (Opt_transparent) || !am_transparent)
XSetWindowBackground (disp, vt,
pix_colors[Color_bg]);