- nuke reconf script, serves no purpose anymore.
- do not process focus events caused by grabs
(patch by Mikachu).
- - better option handling (exg).
+ - better option handling, support more than 30 options (exg).
8.2 Sat Feb 17 21:35:28 CET 2007
- fix make depend in src/, reported by exg.
if (len <= 0)
return; /* not mapped */
- if (OPTION (Opt_scrollTtyKeypress))
+ if (option (Opt_scrollTtyKeypress))
if (view_start)
{
view_start = 0;
{
pty_ev.stop ();
- if (!OPTION (Opt_hold))
+ if (!option (Opt_hold))
destroy ();
}
#ifdef POINTER_BLANK
hidden_pointer = 0;
- if (OPTION (Opt_pointerBlank))
+ if (option (Opt_pointerBlank))
pointer_ev.start (NOW + pointerBlankDelay);
#endif
}
void
rxvt_term::pointer_blank ()
{
- if (!OPTION (Opt_pointerBlank))
+ if (!option (Opt_pointerBlank))
return;
XDefineCursor (dpy, vt, display->blank_cursor);
HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END));
#ifdef TRANSPARENT
- if (OPTION (Opt_transparent))
+ if (option (Opt_transparent))
check_our_parents ();
#endif
}
}
#if defined(CURSOR_BLINK)
- if (OPTION (Opt_cursorBlink) && ev.type == KeyPress)
+ if (option (Opt_cursorBlink) && ev.type == KeyPress)
{
if (hidden_cursor)
{
#endif
#if defined(POINTER_BLANK)
- if (OPTION (Opt_pointerBlank) && pointerBlankDelay > 0)
+ if (option (Opt_pointerBlank) && pointerBlankDelay > 0)
{
if (ev.type == MotionNotify
|| ev.type == ButtonPress
}
#endif
#if CURSOR_BLINK
- if (OPTION (Opt_cursorBlink))
+ if (option (Opt_cursorBlink))
cursor_blink_ev.start (NOW + CURSOR_BLINK_INTERVAL);
#endif
#if OFF_FOCUS_FADING
XUnsetICFocus (Input_Context);
#endif
#if CURSOR_BLINK
- if (OPTION (Opt_cursorBlink))
+ if (option (Opt_cursorBlink))
cursor_blink_ev.stop ();
hidden_cursor = 0;
#endif
/* FALLTHROUGH */
case ReparentNotify:
- if (OPTION (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 (OPTION (Opt_mouseWheelScrollPage))
+ else if (option (Opt_mouseWheelScrollPage))
i = nrow - 1;
else
i = 5;
pchanged = 0;
- if (!OPTION (Opt_transparent))
+ if (!option (Opt_transparent))
return pchanged; /* Don't try any more */
XGetWindowAttributes (dpy, display->root, &wrootattr);
refresh_count++;
- if (!OPTION (Opt_jumpScroll)
+ if (!option (Opt_jumpScroll)
|| (refresh_count >= refresh_limit * (nrow - 1)))
{
refreshnow = true;
*/
if (refreshnow)
{
- if (OPTION (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 (OPTION (Opt_insecure))
+ if (option (Opt_insecure))
tt_printf ("%-.250s\012", rs[Rs_display_name]);
break;
case 8: /* unofficial extension */
{
char *s;
XGetIconName (dpy, parent[0], &s);
- tt_printf ("\033]L%-.250s\234", OPTION (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 (dpy, parent[0], &s);
- tt_printf ("\033]l%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */
+ tt_printf ("\033]l%-.250s\234", option (Opt_insecure) && s ? s : ""); /* 8bit ST */
XFree (s);
}
break;
#endif
if (query)
tt_printf ("\33]%d;%-.250s%c", saveop,
- OPTION (Opt_insecure) && fontset[op - URxvt_font]->fontdesc
+ option (Opt_insecure) && fontset[op - URxvt_font]->fontdesc
? fontset[op - URxvt_font]->fontdesc : "",
resp);
else
#if !ENABLE_MINIMAL
case URxvt_locale:
if (query)
- tt_printf ("\33]%d;%-.250s%c", op, OPTION (Opt_insecure) ? locale : "", resp);
+ tt_printf ("\33]%d;%-.250s%c", op, option (Opt_insecure) ? locale : "", resp);
else
{
set_locale (str);
#endif
case 1048: /* alternative cursor save */
case 1049:
- if (OPTION (Opt_secondaryScreen))
+ if (option (Opt_secondaryScreen))
if (mode == 0)
scr_cursor (RESTORE);
else if (mode == 1)
set_option (Opt_scrollTtyKeypress, state);
break;
case 1047: /* secondary screen w/ clearing last */
- if (OPTION (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 (OPTION (Opt_secondaryScreen))
+ if (option (Opt_secondaryScreen))
if (current_screen != PRIMARY)
scr_erase_screen (2);
break;
last_bot = last_state = -1;
- set_option (Opt_scrollBar, 1);
- set_option (Opt_scrollTtyOutput, 1);
- set_option (Opt_jumpScroll, 1);
- set_option (Opt_secondaryScreen, 1);
- set_option (Opt_secondaryScroll, 1);
- set_option (Opt_pastableTabs, 1);
- set_option (Opt_intensityStyles, 1);
+ set_option (Opt_scrollBar);
+ set_option (Opt_scrollTtyOutput);
+ set_option (Opt_jumpScroll);
+ set_option (Opt_secondaryScreen);
+ set_option (Opt_secondaryScroll);
+ set_option (Opt_pastableTabs);
+ set_option (Opt_intensityStyles);
return true;
}
#ifdef XTERM_REVERSE_VIDEO
/* this is how xterm implements reverseVideo */
- if (OPTION (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 (OPTION (Opt_reverseVideo))
+ if (option (Opt_reverseVideo))
::swap (rs[Rs_color + Color_fg], rs[Rs_color + Color_bg]);
#endif
*/
#ifdef META8_OPTION
- meta_char = OPTION (Opt_meta8) ? 0x80 : C0_ESC;
+ meta_char = option (Opt_meta8) ? 0x80 : C0_ESC;
#endif
get_ourmods ();
- if (!OPTION (Opt_scrollTtyOutput))
+ if (!option (Opt_scrollTtyOutput))
priv_modes |= PrivMode_TtyOutputInh;
- if (OPTION (Opt_scrollTtyKeypress))
+ if (option (Opt_scrollTtyKeypress))
priv_modes |= PrivMode_Keypress;
- if (!OPTION (Opt_jumpScroll))
+ if (!option (Opt_jumpScroll))
priv_modes |= PrivMode_smoothScroll;
#ifndef NO_BACKSPACE_KEY
if (!set_color (xcol, name))
{
#ifndef XTERM_REVERSE_VIDEO
- if (i < 2 && OPTION (Opt_reverseVideo))
+ if (i < 2 && option (Opt_reverseVideo))
name = def_colorName [1 - i];
else
#endif
parent = display->root;
- attributes.override_redirect = !!OPTION (Opt_override_redirect);
+ attributes.override_redirect = !!option (Opt_override_redirect);
#if ENABLE_FRILLS
- if (OPTION (Opt_borderLess))
+ if (option (Opt_borderLess))
{
if (XInternAtom (dpy, "_MOTIF_WM_INFO", True) == None)
{
wmHint.flags = InputHint | StateHint | WindowGroupHint;
wmHint.input = True;
- wmHint.initial_state = OPTION (Opt_iconic) ? IconicState : NormalState;
+ wmHint.initial_state = option (Opt_iconic) ? IconicState : NormalState;
wmHint.window_group = top;
XmbSetWMProperties (dpy, top, NULL, NULL, (char **)argv, argc,
vt_emask = ExposureMask | ButtonPressMask | ButtonReleaseMask | PropertyChangeMask;
- if (OPTION (Opt_pointerBlank))
+ if (option (Opt_pointerBlank))
vt_emask |= PointerMotionMask;
else
vt_emask |= Button1MotionMask | Button3MotionMask;
#ifdef XPM_BACKGROUND
if (rs[Rs_backgroundPixmap] != NULL
- && !OPTION (Opt_transparent))
+ && !option (Opt_transparent))
{
const char *p = rs[Rs_backgroundPixmap];
_exit (EXIT_FAILURE);
default:
- if (!OPTION (Opt_utmpInhibit))
- pty->login (cmd_pid, OPTION (Opt_loginShell), rs[Rs_display_name]);
+ if (!option (Opt_utmpInhibit))
+ pty->login (cmd_pid, option (Opt_loginShell), rs[Rs_display_name]);
pty->close_tty ();
{
char *login;
- if (OPTION (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 (OPTION (Opt_loginShell))
+ if (option (Opt_loginShell))
{
login = (char *)rxvt_malloc ((strlen (argv0) + 2) * sizeof (char));
cmd_pid = 0;
- if (!OPTION (Opt_hold))
+ if (!option (Opt_hold))
destroy ();
}
#endif
#ifdef HAVE_SCROLLBARS
- if (OPTION (Opt_scrollBar))
+ if (option (Opt_scrollBar))
scrollBar.setIdle (); /* set existence for size calculations */
#endif
#endif
#ifdef HAVE_SCROLLBARS
- if (OPTION (Opt_scrollBar))
+ if (option (Opt_scrollBar))
resize_scrollbar (); /* create and map scrollbar */
#endif
#ifdef TRANSPARENT
- if (OPTION (Opt_transparent))
+ if (option (Opt_transparent))
{
XSelectInput (dpy, display->root, PropertyChangeMask);
check_our_parents ();
sb_w = scrollbar_TotalWidth ();
szHint.base_width += sb_w;
- if (!OPTION (Opt_scrollBar_right))
+ if (!option (Opt_scrollBar_right))
window_vt_x += sb_w;
}
szHint.height = szHint.base_height + height;
}
- if (scrollBar.state && OPTION (Opt_scrollBar_right))
+ if (scrollBar.state && option (Opt_scrollBar_right))
window_sb_x = szHint.width - sb_w;
if (recalc_x)
#define Width2Pixel(n) ((int32_t)(n) * (int32_t)fwidth)
#define Height2Pixel(n) ((int32_t)(n) * (int32_t)fheight)
-#define OPTION(opt) option(opt)
-
// for m >= -n, ensure remainder lies between 0..n-1
#define MOD(m,n) (((m) + (n)) % (n))
#ifndef NO_BRIGHTCOLOR
if (r & RS_Bold
# if ENABLE_STYLES
- && OPTION (Opt_intensityStyles)
+ && option (Opt_intensityStyles)
# endif
&& IN_RANGE_INC (base, minCOLOR, minBrightCOLOR))
base += minBrightCOLOR - minCOLOR;
#ifndef NO_BRIGHTCOLOR
if (r & RS_Blink
# if ENABLE_STYLES
- && OPTION (Opt_intensityStyles)
+ && option (Opt_intensityStyles)
# endif
&& IN_RANGE_INC (base, minCOLOR, minBrightCOLOR))
base += minBrightCOLOR - minCOLOR;
return options[opt >> 3] & (1 << (opt & 7));
}
- void set_option (uint8_t opt, bool set) NOTHROW
+ void set_option (uint8_t opt, bool set = true) NOTHROW
{
if (set)
options[opt >> 3] |= (1 << (opt & 7));
* GENERAL SCREEN AND SELECTION UPDATE ROUTINES *
* ------------------------------------------------------------------------- */
#define ZERO_SCROLLBACK() \
- if (OPTION (Opt_scrollTtyOutput)) \
+ if (option (Opt_scrollTtyOutput)) \
view_start = 0
#define CLEAR_SELECTION() \
selection.beg.row = selection.beg.col \
void
rxvt_term::scr_swap_screen ()
{
- if (!OPTION (Opt_secondaryScreen))
+ if (!option (Opt_secondaryScreen))
return;
for (int i = prev_nrow; i--; )
int i = current_screen; current_screen = scrn; scrn = i;
#if NSCREENS
- if (OPTION (Opt_secondaryScreen))
+ if (option (Opt_secondaryScreen))
{
num_scr = 0;
}
else
#endif
- if (OPTION (Opt_secondaryScroll))
+ if (option (Opt_secondaryScroll))
scr_scroll_text (0, prev_nrow - 1, prev_nrow);
}
if (count > 0
&& row1 == 0
- && (current_screen == PRIMARY || OPTION (Opt_secondaryScroll)))
+ && (current_screen == PRIMARY || option (Opt_secondaryScroll)))
{
top_row = max (top_row - count, -saveLines);
}
// finally move the view window, if desired
- if (OPTION (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 && OPTION (Opt_pastableTabs))
+ if (ht && option (Opt_pastableTabs))
{
base_rend = SET_FONT (base_rend, 0);
if (bgPixmap.pixmap == None)
#endif
#if TRANSPARENT
- if (!OPTION (Opt_transparent) || am_transparent == 0)
+ if (!option (Opt_transparent) || am_transparent == 0)
#endif
XSetWindowBackground (dpy, vt, pix_colors[Color_bg]);
# ifndef NO_MAPALERT
# ifdef MAPALERT_OPTION
- if (OPTION (Opt_mapAlert))
+ if (option (Opt_mapAlert))
# endif
XMapWindow (dpy, parent[0]);
# endif
- if (OPTION (Opt_visualBell))
+ if (option (Opt_visualBell))
{
rvideo_bell = true;
scr_rvideo_mode (rvideo_mode);
have_bg |= bgPixmap.pixmap != None;
#endif
#if TRANSPARENT
- have_bg |= OPTION (Opt_transparent) && am_transparent;
+ have_bg |= option (Opt_transparent) && am_transparent;
#endif
ocrow = oldcursor.row; /* is there an old outline cursor on screen? */
if (showcursor && focus)
{
- if (OPTION (Opt_cursorUnderline))
+ if (option (Opt_cursorUnderline))
*crp ^= RS_Uline;
else
{
{
if (focus)
{
- if (OPTION (Opt_cursorUnderline))
+ if (option (Opt_cursorUnderline))
*crp ^= RS_Uline;
else
{
else if (selection.clicks == 3)
{
#if ENABLE_FRILLS
- if (OPTION (Opt_tripleclickwords))
+ if (option (Opt_tripleclickwords))
{
selection_delimit_word (UP, &selection.beg, &selection.beg);
pscrollbarGC = XCreateGC (dpy, scrollBar.win, GCForeground, &gcvalue);
}
- xsb = OPTION (Opt_scrollBar_right) ? 1 : 0;
+ xsb = option (Opt_scrollBar_right) ? 1 : 0;
if (update)
{
-/*--------------------------------*-C-*---------------------------------*
+/*----------------------------------------------------------------------*
* File: scrollbar-rxvt.C
*----------------------------------------------------------------------*
*
{
int xofs;
- if (OPTION (Opt_scrollBar_right))
+ if (option (Opt_scrollBar_right))
xofs = 0;
else
xofs = sbshadow ? sbwidth : sbwidth - 1;
if (update)
{
- xsb = OPTION (Opt_scrollBar_right) ? 1 : 0;
+ xsb = option (Opt_scrollBar_right) ? 1 : 0;
if (last_top < scrollBar.top)
XClearArea (dpy, scrollBar.win,
sb_shadow + xsb, last_top,
-/*--------------------------------*-C-*---------------------------------*
+/*----------------------------------------------------------------------*
* File: scrollbar.C
*----------------------------------------------------------------------*
*
width = min (i, SB_WIDTH_MAXIMUM);
# ifdef RXVT_SCROLLBAR
- if (! OPTION (Opt_scrollBar_floating) && style == R_SB_RXVT)
+ if (! option (Opt_scrollBar_floating) && style == R_SB_RXVT)
sb_shadow = SHADOW_WIDTH;
# endif
pixmap = None;
#ifdef TRANSPARENT
- if (!OPTION (Opt_transparent) || !am_transparent)
+ if (!option (Opt_transparent) || !am_transparent)
#endif
XSetWindowBackground (dpy, vt, pix_colors[Color_bg]);