Thu Aug 21 23:18:23 2003 Michael Jennings (mej)
A few cosmetic changes to the source code, and a fix for Debian Bug #176274 reported by Gerhard Tonn <GerhardTonn@gammatau.de>. SVN revision: 7361
This commit is contained in:
parent
e5b7bd4890
commit
6b43700de1
|
@ -5080,3 +5080,8 @@ Wed Aug 20 10:19:50 2003 Michael Jennings (mej)
|
|||
When saving settings, make sure to save the font effects too. Spotted
|
||||
by ptiJo <ptiJo@noos.fr>.
|
||||
----------------------------------------------------------------------
|
||||
Thu Aug 21 23:18:23 2003 Michael Jennings (mej)
|
||||
|
||||
A few cosmetic changes to the source code, and a fix for Debian Bug
|
||||
#176274 reported by Gerhard Tonn <GerhardTonn@gammatau.de>.
|
||||
----------------------------------------------------------------------
|
||||
|
|
|
@ -1012,7 +1012,7 @@ bbar_show(buttonbar_t *bbar, unsigned char visible)
|
|||
}
|
||||
|
||||
void
|
||||
bbar_show_all(char visible)
|
||||
bbar_show_all(signed char visible)
|
||||
{
|
||||
buttonbar_t *bbar;
|
||||
|
||||
|
|
|
@ -136,7 +136,7 @@ extern void bbar_deselect_button(buttonbar_t *bbar, button_t *button);
|
|||
extern void bbar_click_button(buttonbar_t *bbar, button_t *button);
|
||||
extern void button_check_action(buttonbar_t *bbar, button_t *button, unsigned char press, Time t);
|
||||
extern unsigned char bbar_show(buttonbar_t *bbar, unsigned char visible);
|
||||
extern void bbar_show_all(char visible);
|
||||
extern void bbar_show_all(signed char visible);
|
||||
extern void bbar_resize(buttonbar_t *bbar, int w);
|
||||
extern void bbar_resize_all(int width);
|
||||
extern void bbar_dock(buttonbar_t *bbar, unsigned char dock);
|
||||
|
|
|
@ -1050,7 +1050,7 @@ handle_child_signal(int sig)
|
|||
|| ((pid == -1) && (errno == ECHILD))
|
||||
|| ((pid == 0) && ((kill(cmd_pid, 0)) < 0)))) {
|
||||
cmd_pid = -1;
|
||||
if (Options & Opt_pause) {
|
||||
if (OPTIONS & OPT_PAUSE) {
|
||||
paused = 1;
|
||||
return;
|
||||
}
|
||||
|
@ -1850,13 +1850,13 @@ xim_send_spot(void)
|
|||
static void
|
||||
xim_get_area(XRectangle * preedit_rect, XRectangle * status_rect, XRectangle * needed_rect)
|
||||
{
|
||||
preedit_rect->x = needed_rect->width + (scrollbar_is_visible() && !(Options & Opt_scrollbar_right) ? (scrollbar_trough_width()) : 0);
|
||||
preedit_rect->x = needed_rect->width + (scrollbar_is_visible() && !(OPTIONS & OPT_SCROLLBAR_RIGHT) ? (scrollbar_trough_width()) : 0);
|
||||
preedit_rect->y = Height2Pixel(TERM_WINDOW_GET_ROWS() - 1);
|
||||
|
||||
preedit_rect->width = Width2Pixel(TERM_WINDOW_GET_COLS() + 1) - needed_rect->width + (!(Options & Opt_scrollbar_right) ? (scrollbar_trough_width()) : 0);
|
||||
preedit_rect->width = Width2Pixel(TERM_WINDOW_GET_COLS() + 1) - needed_rect->width + (!(OPTIONS & OPT_SCROLLBAR_RIGHT) ? (scrollbar_trough_width()) : 0);
|
||||
preedit_rect->height = Height2Pixel(1);
|
||||
|
||||
status_rect->x = (scrollbar_is_visible() && !(Options & Opt_scrollbar_right)) ? (scrollbar_trough_width()) : 0;
|
||||
status_rect->x = (scrollbar_is_visible() && !(OPTIONS & OPT_SCROLLBAR_RIGHT)) ? (scrollbar_trough_width()) : 0;
|
||||
status_rect->y = Height2Pixel(TERM_WINDOW_GET_ROWS() - 1);
|
||||
|
||||
status_rect->width = needed_rect->width ? needed_rect->width : Width2Pixel(TERM_WINDOW_GET_COLS() + 1);
|
||||
|
@ -2190,7 +2190,7 @@ run_command(char **argv)
|
|||
tt_winsize(0);
|
||||
|
||||
/* become virtual console, fail silently */
|
||||
if (Options & Opt_console) {
|
||||
if (OPTIONS & OPT_CONSOLE) {
|
||||
int fd = 1;
|
||||
|
||||
privileges(INVOKE);
|
||||
|
@ -2255,7 +2255,7 @@ run_command(char **argv)
|
|||
shell = "/bin/sh";
|
||||
|
||||
argv0 = my_basename(shell);
|
||||
if (Options & Opt_login_shell) {
|
||||
if (OPTIONS & OPT_LOGIN_SHELL) {
|
||||
char *p = MALLOC(strlen(argv0) + 2);
|
||||
|
||||
p[0] = '-';
|
||||
|
@ -2270,7 +2270,7 @@ run_command(char **argv)
|
|||
}
|
||||
#ifdef UTMP_SUPPORT
|
||||
privileges(RESTORE);
|
||||
if (Options & Opt_write_utmp) {
|
||||
if (OPTIONS & OPT_WRITE_UTMP) {
|
||||
add_utmp_entry(ttydev, display_name, ptyfd);
|
||||
}
|
||||
privileges(IGNORE);
|
||||
|
@ -2985,7 +2985,7 @@ init_command(char **argv)
|
|||
init_locale();
|
||||
|
||||
#ifdef META8_OPTION
|
||||
meta_char = (Options & Opt_meta8 ? 0x80 : 033);
|
||||
meta_char = (OPTIONS & OPT_META8 ? 0x80 : 033);
|
||||
#endif
|
||||
|
||||
#ifdef GREEK_SUPPORT
|
||||
|
@ -3330,7 +3330,7 @@ cmd_getc(void)
|
|||
} else {
|
||||
/* Our file descriptor went bye-bye. */
|
||||
cmd_fd = -1;
|
||||
if (!paused && (Options & Opt_pause)) {
|
||||
if (!paused && (OPTIONS & OPT_PAUSE)) {
|
||||
paused = 1;
|
||||
}
|
||||
break;
|
||||
|
@ -3338,7 +3338,7 @@ cmd_getc(void)
|
|||
} else if (n == 0) {
|
||||
/* EOF */
|
||||
cmd_fd = -1;
|
||||
if (!paused && (Options & Opt_pause)) {
|
||||
if (!paused && (OPTIONS & OPT_PAUSE)) {
|
||||
paused = 1;
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -208,7 +208,7 @@ handle_key_press(event_t *ev)
|
|||
REQUIRE_RVAL(XEVENT_IS_MYWIN(ev, &primary_data), 0);
|
||||
|
||||
COUNT_EVENT(keypress_cnt);
|
||||
if (!(Options & Opt_no_input)) {
|
||||
if (!(OPTIONS & OPT_NO_INPUT)) {
|
||||
lookup_key(ev);
|
||||
}
|
||||
PROF_DONE(handle_key_press);
|
||||
|
@ -470,8 +470,8 @@ handle_focus_in(event_t *ev)
|
|||
redraw_image(image_bg);
|
||||
}
|
||||
}
|
||||
if (Options & Opt_scrollbar_popup) {
|
||||
map_scrollbar(Options & Opt_scrollbar);
|
||||
if (OPTIONS & OPT_SCROLLBAR_POPUP) {
|
||||
map_scrollbar(OPTIONS & OPT_SCROLLBAR);
|
||||
} else {
|
||||
scrollbar_set_focus(TermWin.focus);
|
||||
scrollbar_draw(IMAGE_STATE_NORMAL, MODE_SOLID);
|
||||
|
@ -498,7 +498,7 @@ handle_focus_out(event_t *ev)
|
|||
images[image_bg].current = images[image_bg].disabled;
|
||||
redraw_image(image_bg);
|
||||
}
|
||||
if (Options & Opt_scrollbar_popup) {
|
||||
if (OPTIONS & OPT_SCROLLBAR_POPUP) {
|
||||
map_scrollbar(0);
|
||||
} else {
|
||||
scrollbar_set_focus(TermWin.focus);
|
||||
|
|
|
@ -588,7 +588,7 @@ change_font(int init, const char *fontname)
|
|||
TermWin.fprop = 1; /* Proportional font */
|
||||
|
||||
/* For proportional fonts with large size variations, do some math-fu to try and help the appearance */
|
||||
if (TermWin.fprop && (Options & Opt_proportional) && TermWin.font->per_char && (TermWin.font->max_bounds.width - TermWin.font->min_bounds.width >= 3)) {
|
||||
if (TermWin.fprop && (OPTIONS & OPT_PROPORTIONAL) && TermWin.font->per_char && (TermWin.font->max_bounds.width - TermWin.font->min_bounds.width >= 3)) {
|
||||
int cw, n = 0, sum = 0, sumsq = 0, min_w, max_w;
|
||||
unsigned int i;
|
||||
double dev;
|
||||
|
|
212
src/options.c
212
src/options.c
|
@ -96,7 +96,7 @@ static char *rs_multichar_encoding = NULL;
|
|||
static char *rs_greek_keyboard = NULL;
|
||||
#endif
|
||||
|
||||
unsigned long Options = (Opt_scrollbar | Opt_select_trailing_spaces | Opt_secondary_screen), image_toggles = 0;
|
||||
unsigned long OPTIONS = (OPT_SCROLLBAR | OPT_SELECT_TRAILING_SPACES | OPT_SECONDARY_SCREEN), image_toggles = 0;
|
||||
char *theme_dir = NULL, *user_dir = NULL;
|
||||
char **rs_exec_args = NULL; /* Args to exec (-e or --exec) */
|
||||
char *rs_title = NULL; /* Window title */
|
||||
|
@ -158,7 +158,7 @@ KeySym ks_bigfont = XK_greater;
|
|||
KeySym ks_smallfont = XK_less;
|
||||
#endif
|
||||
|
||||
/* Options structure */
|
||||
/* OPTIONS structure */
|
||||
spifopt_t option_list[] = {
|
||||
SPIFOPT_STR_PP('t', "theme", "select a theme", rs_theme),
|
||||
SPIFOPT_STR_PP('X', "config-file", "choose an alternate config file", rs_config_file),
|
||||
|
@ -176,13 +176,13 @@ spifopt_t option_list[] = {
|
|||
#else
|
||||
SPIFOPT_INT_LONG_PP("debug", "level of debugging information to show (0-5)", DEBUG_LEVEL),
|
||||
#endif
|
||||
SPIFOPT_BOOL_LONG_PP("install", "install a private colormap", Options, Opt_install),
|
||||
SPIFOPT_BOOL_LONG_PP("install", "install a private colormap", OPTIONS, OPT_INSTALL),
|
||||
|
||||
SPIFOPT_ABST_PP('h', "help", "display usage information", usage),
|
||||
SPIFOPT_ABST_LONG_PP("version", "display version and configuration information", version),
|
||||
|
||||
/* =======[ Color options ]======= */
|
||||
SPIFOPT_BOOL('r', "reverse-video", "reverse video", Options, Opt_reverse_video),
|
||||
SPIFOPT_BOOL('r', "reverse-video", "reverse video", OPTIONS, OPT_REVERSE_VIDEO),
|
||||
SPIFOPT_STR('b', "background-color", "background color", rs_color[bgColor]),
|
||||
SPIFOPT_STR('f', "foreground-color", "foreground color", rs_color[fgColor]),
|
||||
SPIFOPT_STR_LONG("color0", "color 0", rs_color[minColor]),
|
||||
|
@ -215,7 +215,7 @@ spifopt_t option_list[] = {
|
|||
|
||||
/* =======[ X11 options ]======= */
|
||||
SPIFOPT_STR('g', "geometry", "WxH+X+Y = size and position", rs_geometry),
|
||||
SPIFOPT_BOOL('i', "iconic", "start iconified", Options, Opt_iconic),
|
||||
SPIFOPT_BOOL('i', "iconic", "start iconified", OPTIONS, OPT_ICONIC),
|
||||
SPIFOPT_STR('n', "name", "client instance, icon, and title strings", rs_name),
|
||||
SPIFOPT_STR('T', "title", "title string", rs_title),
|
||||
SPIFOPT_STR_LONG("icon-name", "icon name", rs_iconName),
|
||||
|
@ -232,7 +232,7 @@ spifopt_t option_list[] = {
|
|||
SPIFOPT_STR_LONG("font2", "font 2", rs_font[2]),
|
||||
SPIFOPT_STR_LONG("font3", "font 3", rs_font[3]),
|
||||
SPIFOPT_STR_LONG("font4", "font 4", rs_font[4]),
|
||||
SPIFOPT_BOOL_LONG("proportional", "toggle proportional font optimizations", Options, Opt_proportional),
|
||||
SPIFOPT_BOOL_LONG("proportional", "toggle proportional font optimizations", OPTIONS, OPT_PROPORTIONAL),
|
||||
SPIFOPT_STR_LONG("font-fx", "specify font effects for the terminal fonts", rs_font_effects),
|
||||
|
||||
/* =======[ Pixmap options ]======= */
|
||||
|
@ -275,35 +275,35 @@ spifopt_t option_list[] = {
|
|||
#endif
|
||||
|
||||
/* =======[ Toggles ]======= */
|
||||
SPIFOPT_BOOL('l', "login-shell", "login shell, prepend - to shell name", Options, Opt_login_shell),
|
||||
SPIFOPT_BOOL('s', "scrollbar", "display scrollbar", Options, Opt_scrollbar),
|
||||
SPIFOPT_BOOL('u', "utmp-logging", "make a utmp entry", Options, Opt_write_utmp),
|
||||
SPIFOPT_BOOL('v', "visual-bell", "visual bell", Options, Opt_visual_bell),
|
||||
SPIFOPT_BOOL('H', "home-on-output", "jump to bottom on output", Options, Opt_home_on_output),
|
||||
SPIFOPT_BOOL_LONG("home-on-input", "jump to bottom on input", Options, Opt_home_on_input),
|
||||
SPIFOPT_BOOL('q', "no-input", "configure for output only", Options, Opt_no_input),
|
||||
SPIFOPT_BOOL_LONG("scrollbar-right", "display the scrollbar on the right", Options, Opt_scrollbar_right),
|
||||
SPIFOPT_BOOL_LONG("scrollbar-floating", "display the scrollbar with no trough", Options, Opt_scrollbar_floating),
|
||||
SPIFOPT_BOOL_LONG("scrollbar-popup", "popup the scrollbar only when focused", Options, Opt_scrollbar_popup),
|
||||
SPIFOPT_BOOL('x', "borderless", "force Eterm to have no borders", Options, Opt_borderless),
|
||||
SPIFOPT_BOOL('l', "login-shell", "login shell, prepend - to shell name", OPTIONS, OPT_LOGIN_SHELL),
|
||||
SPIFOPT_BOOL('s', "scrollbar", "display scrollbar", OPTIONS, OPT_SCROLLBAR),
|
||||
SPIFOPT_BOOL('u', "utmp-logging", "make a utmp entry", OPTIONS, OPT_WRITE_UTMP),
|
||||
SPIFOPT_BOOL('v', "visual-bell", "visual bell", OPTIONS, OPT_VISUAL_BELL),
|
||||
SPIFOPT_BOOL('H', "home-on-output", "jump to bottom on output", OPTIONS, OPT_HOME_ON_OUTPUT),
|
||||
SPIFOPT_BOOL_LONG("home-on-input", "jump to bottom on input", OPTIONS, OPT_HOME_ON_INPUT),
|
||||
SPIFOPT_BOOL('q', "no-input", "configure for output only", OPTIONS, OPT_NO_INPUT),
|
||||
SPIFOPT_BOOL_LONG("scrollbar-right", "display the scrollbar on the right", OPTIONS, OPT_SCROLLBAR_RIGHT),
|
||||
SPIFOPT_BOOL_LONG("scrollbar-floating", "display the scrollbar with no trough", OPTIONS, OPT_SCROLLBAR_FLOATING),
|
||||
SPIFOPT_BOOL_LONG("scrollbar-popup", "popup the scrollbar only when focused", OPTIONS, OPT_SCROLLBAR_POPUP),
|
||||
SPIFOPT_BOOL('x', "borderless", "force Eterm to have no borders", OPTIONS, OPT_BORDERLESS),
|
||||
#ifndef NO_MAPALERT
|
||||
# ifdef MAPALERT_OPTION
|
||||
SPIFOPT_BOOL('m', "map-alert", "uniconify on beep", Options, Opt_map_alert),
|
||||
SPIFOPT_BOOL('m', "map-alert", "uniconify on beep", OPTIONS, OPT_MAP_ALERT),
|
||||
# endif
|
||||
#endif
|
||||
#ifdef META8_OPTION
|
||||
SPIFOPT_BOOL('8', "meta-8", "Meta key toggles 8-bit", Options, Opt_meta8),
|
||||
SPIFOPT_BOOL('8', "meta-8", "Meta key toggles 8-bit", OPTIONS, OPT_META8),
|
||||
#endif
|
||||
SPIFOPT_BOOL_LONG("double-buffer", "reduce exposes using double-buffering (and more memory)", Options, Opt_double_buffer),
|
||||
SPIFOPT_BOOL_LONG("no-cursor", "disable the text cursor", Options, Opt_no_cursor),
|
||||
SPIFOPT_BOOL_LONG("pause", "pause after the child process exits", Options, Opt_pause),
|
||||
SPIFOPT_BOOL_LONG("xterm-select", "duplicate xterm's selection behavior", Options, Opt_xterm_select),
|
||||
SPIFOPT_BOOL_LONG("select-line", "triple-click selects whole line", Options, Opt_select_whole_line),
|
||||
SPIFOPT_BOOL_LONG("select-trailing-spaces", "do not skip trailing spaces when selecting", Options, Opt_select_trailing_spaces),
|
||||
SPIFOPT_BOOL_LONG("report-as-keysyms", "report special keys as keysyms", Options, Opt_report_as_keysyms),
|
||||
SPIFOPT_BOOL_LONG("double-buffer", "reduce exposes using double-buffering (and more memory)", OPTIONS, OPT_DOUBLE_BUFFER),
|
||||
SPIFOPT_BOOL_LONG("no-cursor", "disable the text cursor", OPTIONS, OPT_NO_CURSOR),
|
||||
SPIFOPT_BOOL_LONG("pause", "pause after the child process exits", OPTIONS, OPT_PAUSE),
|
||||
SPIFOPT_BOOL_LONG("xterm-select", "duplicate xterm's selection behavior", OPTIONS, OPT_XTERM_SELECT),
|
||||
SPIFOPT_BOOL_LONG("select-line", "triple-click selects whole line", OPTIONS, OPT_SELECT_WHOLE_LINE),
|
||||
SPIFOPT_BOOL_LONG("select-trailing-spaces", "do not skip trailing spaces when selecting", OPTIONS, OPT_SELECT_TRAILING_SPACES),
|
||||
SPIFOPT_BOOL_LONG("report-as-keysyms", "report special keys as keysyms", OPTIONS, OPT_REPORT_AS_KEYSYMS),
|
||||
SPIFOPT_BOOL_LONG("buttonbar", "toggle the display of all buttonbars", rs_buttonbars, BBAR_FORCE_TOGGLE),
|
||||
SPIFOPT_BOOL_LONG("resize-gravity", "toggle gravitation to nearest corner on resize", Options, Opt_resize_gravity),
|
||||
SPIFOPT_BOOL_LONG("secondary-screen", "toggle use of secondary screen", Options, Opt_secondary_screen),
|
||||
SPIFOPT_BOOL_LONG("resize-gravity", "toggle gravitation to nearest corner on resize", OPTIONS, OPT_RESIZE_GRAVITY),
|
||||
SPIFOPT_BOOL_LONG("secondary-screen", "toggle use of secondary screen", OPTIONS, OPT_SECONDARY_SCREEN),
|
||||
|
||||
/* =======[ Keyboard options ]======= */
|
||||
#if defined (HOTKEY_CTRL) || defined (HOTKEY_META)
|
||||
|
@ -341,7 +341,7 @@ spifopt_t option_list[] = {
|
|||
SPIFOPT_INT('z', "delay", "initial delay in seconds", rs_delay),
|
||||
#endif
|
||||
SPIFOPT_ABST('a', "attribute", "parse an attribute in the specified context", handle_attribute),
|
||||
SPIFOPT_BOOL('C', "console", "grab console messages", Options, Opt_console),
|
||||
SPIFOPT_BOOL('C', "console", "grab console messages", OPTIONS, OPT_CONSOLE),
|
||||
SPIFOPT_ARGS('e', "exec", "execute a command rather than a shell", rs_exec_args)
|
||||
};
|
||||
|
||||
|
@ -353,7 +353,7 @@ usage(void)
|
|||
printf("Eterm Enlightened Terminal Emulator for the X Window System\n");
|
||||
printf("Copyright (c) 1997-2003, " AUTHORS "\n\n");
|
||||
|
||||
printf("Option types:\n");
|
||||
printf("OPTION types:\n");
|
||||
printf(" (bool) -- Boolean option ('1', 'on', 'yes', or 'true' to activate, '0', 'off', 'no', or 'false' to deactivate)\n");
|
||||
printf(" (int) -- Integer option (any signed number of reasonable value, usually in decimal/octal/hex)\n");
|
||||
printf(" (str) -- String option (be sure to quote strings if needed to avoid shell expansion)\n");
|
||||
|
@ -845,7 +845,7 @@ parse_color(char *buff, void *state)
|
|||
char *tmp = get_pword(2, buff);
|
||||
|
||||
if (!BEG_STRCASECMP(tmp, "reverse")) {
|
||||
Options |= Opt_reverse_video;
|
||||
OPTIONS |= OPT_REVERSE_VIDEO;
|
||||
} else if (BEG_STRCASECMP(tmp, "normal")) {
|
||||
print_error("Parse error in file %s, line %lu: Invalid value \"%s\" for attribute video\n",
|
||||
file_peek_path(), file_peek_line(), tmp);
|
||||
|
@ -994,9 +994,9 @@ parse_attributes(char *buff, void *state)
|
|||
} else if (!BEG_STRCASECMP(tmp, "prop")) {
|
||||
tmp = get_pword(2, tmp);
|
||||
if (BOOL_OPT_ISTRUE(tmp)) {
|
||||
Options |= Opt_proportional;
|
||||
OPTIONS |= OPT_PROPORTIONAL;
|
||||
} else if (BOOL_OPT_ISFALSE(tmp)) {
|
||||
Options &= ~(Opt_proportional);
|
||||
OPTIONS &= ~(OPT_PROPORTIONAL);
|
||||
} else {
|
||||
print_error("Parse error in file %s, line %lu: Invalid/missing boolean value for attribute proportional\n",
|
||||
file_peek_path(), file_peek_line());
|
||||
|
@ -1057,9 +1057,9 @@ parse_toggles(char *buff, void *state)
|
|||
if (!BEG_STRCASECMP(buff, "map_alert ")) {
|
||||
#if !defined(NO_MAPALERT) && defined(MAPALERT_OPTION)
|
||||
if (bool_val) {
|
||||
Options |= Opt_map_alert;
|
||||
OPTIONS |= OPT_MAP_ALERT;
|
||||
} else {
|
||||
Options &= ~(Opt_map_alert);
|
||||
OPTIONS &= ~(OPT_MAP_ALERT);
|
||||
}
|
||||
#else
|
||||
print_warning("Support for the map_alert attribute was not compiled in, ignoring\n");
|
||||
|
@ -1067,29 +1067,29 @@ parse_toggles(char *buff, void *state)
|
|||
|
||||
} else if (!BEG_STRCASECMP(buff, "visual_bell ")) {
|
||||
if (bool_val) {
|
||||
Options |= Opt_visual_bell;
|
||||
OPTIONS |= OPT_VISUAL_BELL;
|
||||
} else {
|
||||
Options &= ~(Opt_visual_bell);
|
||||
OPTIONS &= ~(OPT_VISUAL_BELL);
|
||||
}
|
||||
} else if (!BEG_STRCASECMP(buff, "login_shell ")) {
|
||||
if (bool_val) {
|
||||
Options |= Opt_login_shell;
|
||||
OPTIONS |= OPT_LOGIN_SHELL;
|
||||
} else {
|
||||
Options &= ~(Opt_login_shell);
|
||||
OPTIONS &= ~(OPT_LOGIN_SHELL);
|
||||
}
|
||||
} else if (!BEG_STRCASECMP(buff, "scrollbar ")) {
|
||||
if (bool_val) {
|
||||
Options |= Opt_scrollbar;
|
||||
OPTIONS |= OPT_SCROLLBAR;
|
||||
} else {
|
||||
Options &= ~(Opt_scrollbar);
|
||||
OPTIONS &= ~(OPT_SCROLLBAR);
|
||||
}
|
||||
|
||||
} else if (!BEG_STRCASECMP(buff, "utmp_logging ")) {
|
||||
#ifdef UTMP_SUPPORT
|
||||
if (bool_val) {
|
||||
Options |= Opt_write_utmp;
|
||||
OPTIONS |= OPT_WRITE_UTMP;
|
||||
} else {
|
||||
Options &= ~(Opt_write_utmp);
|
||||
OPTIONS &= ~(OPT_WRITE_UTMP);
|
||||
}
|
||||
#else
|
||||
print_warning("Support for the utmp_logging attribute was not compiled in, ignoring\n");
|
||||
|
@ -1098,9 +1098,9 @@ parse_toggles(char *buff, void *state)
|
|||
} else if (!BEG_STRCASECMP(buff, "meta8 ")) {
|
||||
#ifdef META8_OPTION
|
||||
if (bool_val) {
|
||||
Options |= Opt_meta8;
|
||||
OPTIONS |= OPT_META8;
|
||||
} else {
|
||||
Options &= ~(Opt_meta8);
|
||||
OPTIONS &= ~(OPT_META8);
|
||||
}
|
||||
#else
|
||||
print_warning("Support for the meta8 attribute was not compiled in, ignoring\n");
|
||||
|
@ -1108,111 +1108,111 @@ parse_toggles(char *buff, void *state)
|
|||
|
||||
} else if (!BEG_STRCASECMP(buff, "iconic ")) {
|
||||
if (bool_val) {
|
||||
Options |= Opt_iconic;
|
||||
OPTIONS |= OPT_ICONIC;
|
||||
} else {
|
||||
Options &= ~(Opt_iconic);
|
||||
OPTIONS &= ~(OPT_ICONIC);
|
||||
}
|
||||
|
||||
} else if (!BEG_STRCASECMP(buff, "home_on_output ")) {
|
||||
if (bool_val) {
|
||||
Options |= Opt_home_on_output;
|
||||
OPTIONS |= OPT_HOME_ON_OUTPUT;
|
||||
} else {
|
||||
Options &= ~(Opt_home_on_output);
|
||||
OPTIONS &= ~(OPT_HOME_ON_OUTPUT);
|
||||
}
|
||||
|
||||
} else if (!BEG_STRCASECMP(buff, "home_on_input ")) {
|
||||
if (bool_val) {
|
||||
Options |= Opt_home_on_input;
|
||||
OPTIONS |= OPT_HOME_ON_INPUT;
|
||||
} else {
|
||||
Options &= ~(Opt_home_on_input);
|
||||
OPTIONS &= ~(OPT_HOME_ON_INPUT);
|
||||
}
|
||||
|
||||
} else if (!BEG_STRCASECMP(buff, "no_input ")) {
|
||||
if (bool_val) {
|
||||
Options |= Opt_no_input;
|
||||
OPTIONS |= OPT_NO_INPUT;
|
||||
} else {
|
||||
Options &= ~(Opt_no_input);
|
||||
OPTIONS &= ~(OPT_NO_INPUT);
|
||||
}
|
||||
|
||||
} else if (!BEG_STRCASECMP(buff, "scrollbar_floating ")) {
|
||||
if (bool_val) {
|
||||
Options |= Opt_scrollbar_floating;
|
||||
OPTIONS |= OPT_SCROLLBAR_FLOATING;
|
||||
} else {
|
||||
Options &= ~(Opt_scrollbar_floating);
|
||||
OPTIONS &= ~(OPT_SCROLLBAR_FLOATING);
|
||||
}
|
||||
|
||||
} else if (!BEG_STRCASECMP(buff, "scrollbar_right ")) {
|
||||
if (bool_val) {
|
||||
Options |= Opt_scrollbar_right;
|
||||
OPTIONS |= OPT_SCROLLBAR_RIGHT;
|
||||
} else {
|
||||
Options &= ~(Opt_scrollbar_right);
|
||||
OPTIONS &= ~(OPT_SCROLLBAR_RIGHT);
|
||||
}
|
||||
} else if (!BEG_STRCASECMP(buff, "scrollbar_popup ")) {
|
||||
if (bool_val) {
|
||||
Options |= Opt_scrollbar_popup;
|
||||
OPTIONS |= OPT_SCROLLBAR_POPUP;
|
||||
} else {
|
||||
Options &= ~(Opt_scrollbar_popup);
|
||||
OPTIONS &= ~(OPT_SCROLLBAR_POPUP);
|
||||
}
|
||||
} else if (!BEG_STRCASECMP(buff, "borderless ")) {
|
||||
if (bool_val) {
|
||||
Options |= Opt_borderless;
|
||||
OPTIONS |= OPT_BORDERLESS;
|
||||
} else {
|
||||
Options &= ~(Opt_borderless);
|
||||
OPTIONS &= ~(OPT_BORDERLESS);
|
||||
}
|
||||
} else if (!BEG_STRCASECMP(buff, "double_buffer ")) {
|
||||
if (bool_val) {
|
||||
Options |= Opt_double_buffer;
|
||||
OPTIONS |= OPT_DOUBLE_BUFFER;
|
||||
} else {
|
||||
Options &= ~(Opt_double_buffer);
|
||||
OPTIONS &= ~(OPT_DOUBLE_BUFFER);
|
||||
}
|
||||
|
||||
} else if (!BEG_STRCASECMP(buff, "no_cursor ")) {
|
||||
if (bool_val) {
|
||||
Options |= Opt_no_cursor;
|
||||
OPTIONS |= OPT_NO_CURSOR;
|
||||
} else {
|
||||
Options &= ~(Opt_no_cursor);
|
||||
OPTIONS &= ~(OPT_NO_CURSOR);
|
||||
}
|
||||
|
||||
} else if (!BEG_STRCASECMP(buff, "pause ")) {
|
||||
if (bool_val) {
|
||||
Options |= Opt_pause;
|
||||
OPTIONS |= OPT_PAUSE;
|
||||
} else {
|
||||
Options &= ~(Opt_pause);
|
||||
OPTIONS &= ~(OPT_PAUSE);
|
||||
}
|
||||
|
||||
} else if (!BEG_STRCASECMP(buff, "xterm_select ")) {
|
||||
if (bool_val) {
|
||||
Options |= Opt_xterm_select;
|
||||
OPTIONS |= OPT_XTERM_SELECT;
|
||||
} else {
|
||||
Options &= ~(Opt_xterm_select);
|
||||
OPTIONS &= ~(OPT_XTERM_SELECT);
|
||||
}
|
||||
|
||||
} else if (!BEG_STRCASECMP(buff, "select_line ")) {
|
||||
if (bool_val) {
|
||||
Options |= Opt_select_whole_line;
|
||||
OPTIONS |= OPT_SELECT_WHOLE_LINE;
|
||||
} else {
|
||||
Options &= ~(Opt_select_whole_line);
|
||||
OPTIONS &= ~(OPT_SELECT_WHOLE_LINE);
|
||||
}
|
||||
|
||||
} else if (!BEG_STRCASECMP(buff, "select_trailing_spaces ")) {
|
||||
if (bool_val) {
|
||||
Options |= Opt_select_trailing_spaces;
|
||||
OPTIONS |= OPT_SELECT_TRAILING_SPACES;
|
||||
} else {
|
||||
Options &= ~(Opt_select_trailing_spaces);
|
||||
OPTIONS &= ~(OPT_SELECT_TRAILING_SPACES);
|
||||
}
|
||||
|
||||
} else if (!BEG_STRCASECMP(buff, "report_as_keysyms ")) {
|
||||
if (bool_val) {
|
||||
Options |= Opt_report_as_keysyms;
|
||||
OPTIONS |= OPT_REPORT_AS_KEYSYMS;
|
||||
} else {
|
||||
Options &= ~(Opt_report_as_keysyms);
|
||||
OPTIONS &= ~(OPT_REPORT_AS_KEYSYMS);
|
||||
}
|
||||
|
||||
} else if (!BEG_STRCASECMP(buff, "mbyte_cursor ")) {
|
||||
if (bool_val) {
|
||||
Options |= Opt_mbyte_cursor;
|
||||
OPTIONS |= OPT_MBYTE_CURSOR;
|
||||
} else {
|
||||
Options &= ~(Opt_mbyte_cursor);
|
||||
OPTIONS &= ~(OPT_MBYTE_CURSOR);
|
||||
}
|
||||
|
||||
} else if (!BEG_STRCASECMP(buff, "itrans ") || !BEG_STRCASECMP(buff, "immotile_trans ")) {
|
||||
|
@ -1233,9 +1233,9 @@ parse_toggles(char *buff, void *state)
|
|||
|
||||
} else if (!BEG_STRCASECMP(buff, "resize_gravity")) {
|
||||
if (bool_val) {
|
||||
Options |= Opt_resize_gravity;
|
||||
OPTIONS |= OPT_RESIZE_GRAVITY;
|
||||
} else {
|
||||
Options &= ~(Opt_resize_gravity);
|
||||
OPTIONS &= ~(OPT_RESIZE_GRAVITY);
|
||||
}
|
||||
} else {
|
||||
print_error("Parse error in file %s, line %lu: Attribute \"%s\" is not valid within context toggles\n", file_peek_path(),
|
||||
|
@ -1253,7 +1253,7 @@ parse_keyboard(char *buff, void *state)
|
|||
if (!BEG_STRCASECMP(buff, "smallfont_key ")) {
|
||||
#if defined (HOTKEY_CTRL) || defined (HOTKEY_META)
|
||||
RESET_AND_ASSIGN(rs_smallfont_key, get_word(2, buff));
|
||||
to_keysym(&ks_smallfont, rs_smallfont_key);
|
||||
TO_KEYSYM(&ks_smallfont, rs_smallfont_key);
|
||||
#else
|
||||
print_warning("Support for the smallfont_key attribute was not compiled in, ignoring\n");
|
||||
#endif
|
||||
|
@ -1261,7 +1261,7 @@ parse_keyboard(char *buff, void *state)
|
|||
} else if (!BEG_STRCASECMP(buff, "bigfont_key ")) {
|
||||
#if defined (HOTKEY_CTRL) || defined (HOTKEY_META)
|
||||
RESET_AND_ASSIGN(rs_bigfont_key, get_word(2, buff));
|
||||
to_keysym(&ks_bigfont, rs_bigfont_key);
|
||||
TO_KEYSYM(&ks_bigfont, rs_bigfont_key);
|
||||
#else
|
||||
print_warning("Support for the bigfont_key attribute was not compiled in, ignoring\n");
|
||||
#endif
|
||||
|
@ -2581,7 +2581,7 @@ post_parse(void)
|
|||
}
|
||||
/* no point having a scrollbar without having any scrollback! */
|
||||
if (!TermWin.saveLines) {
|
||||
Options &= ~Opt_scrollbar;
|
||||
OPTIONS &= ~OPT_SCROLLBAR;
|
||||
}
|
||||
#ifdef PRINTPIPE
|
||||
if (!rs_print_pipe) {
|
||||
|
@ -2941,7 +2941,7 @@ post_parse(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
if (Options & Opt_reverse_video) {
|
||||
if (OPTIONS & OPT_REVERSE_VIDEO) {
|
||||
char *tmp;
|
||||
|
||||
/* swap foreground/background colors */
|
||||
|
@ -3164,7 +3164,7 @@ save_config(char *path, unsigned char save_theme)
|
|||
(scrollbar_get_type() == SCROLLBAR_XTERM ? "xterm" : (scrollbar_get_type() == SCROLLBAR_MOTIF ? "motif" : "next")));
|
||||
fprintf(fp, " scrollbar_width %d\n", scrollbar_anchor_width());
|
||||
fprintf(fp, " font default %u\n", (unsigned int) font_idx);
|
||||
fprintf(fp, " font proportional %d\n", ((Options & Opt_proportional) ? 1 : 0));
|
||||
fprintf(fp, " font proportional %d\n", ((OPTIONS & OPT_PROPORTIONAL) ? 1 : 0));
|
||||
for (i = 0; i < font_cnt; i++) {
|
||||
if (etfonts[i]) {
|
||||
fprintf(fp, " font %d %s\n", i, etfonts[i]);
|
||||
|
@ -3732,30 +3732,30 @@ save_config(char *path, unsigned char save_theme)
|
|||
}
|
||||
|
||||
fprintf(fp, "begin toggles\n");
|
||||
fprintf(fp, " map_alert %d\n", (Options & Opt_map_alert ? 1 : 0));
|
||||
fprintf(fp, " visual_bell %d\n", (Options & Opt_visual_bell ? 1 : 0));
|
||||
fprintf(fp, " login_shell %d\n", (Options & Opt_login_shell ? 1 : 0));
|
||||
fprintf(fp, " scrollbar %d\n", (Options & Opt_scrollbar ? 1 : 0));
|
||||
fprintf(fp, " utmp_logging %d\n", (Options & Opt_write_utmp ? 1 : 0));
|
||||
fprintf(fp, " meta8 %d\n", (Options & Opt_meta8 ? 1 : 0));
|
||||
fprintf(fp, " iconic %d\n", (Options & Opt_iconic ? 1 : 0));
|
||||
fprintf(fp, " home_on_output %d\n", (Options & Opt_home_on_output ? 1 : 0));
|
||||
fprintf(fp, " home_on_input %d\n", (Options & Opt_home_on_input ? 1 : 0));
|
||||
fprintf(fp, " no_input %d\n", (Options & Opt_no_input ? 1 : 0));
|
||||
fprintf(fp, " scrollbar_floating %d\n", (Options & Opt_scrollbar_floating ? 1 : 0));
|
||||
fprintf(fp, " scrollbar_right %d\n", (Options & Opt_scrollbar_right ? 1 : 0));
|
||||
fprintf(fp, " scrollbar_popup %d\n", (Options & Opt_scrollbar_popup ? 1 : 0));
|
||||
fprintf(fp, " borderless %d\n", (Options & Opt_borderless ? 1 : 0));
|
||||
fprintf(fp, " double_buffer %d\n", (Options & Opt_double_buffer ? 1 : 0));
|
||||
fprintf(fp, " no_cursor %d\n", (Options & Opt_no_cursor ? 1 : 0));
|
||||
fprintf(fp, " pause %d\n", (Options & Opt_pause ? 1 : 0));
|
||||
fprintf(fp, " xterm_select %d\n", (Options & Opt_xterm_select ? 1 : 0));
|
||||
fprintf(fp, " select_line %d\n", (Options & Opt_select_whole_line ? 1 : 0));
|
||||
fprintf(fp, " select_trailing_spaces %d\n", (Options & Opt_select_trailing_spaces ? 1 : 0));
|
||||
fprintf(fp, " report_as_keysyms %d\n", (Options & Opt_report_as_keysyms ? 1 : 0));
|
||||
fprintf(fp, " map_alert %d\n", (OPTIONS & OPT_MAP_ALERT ? 1 : 0));
|
||||
fprintf(fp, " visual_bell %d\n", (OPTIONS & OPT_VISUAL_BELL ? 1 : 0));
|
||||
fprintf(fp, " login_shell %d\n", (OPTIONS & OPT_LOGIN_SHELL ? 1 : 0));
|
||||
fprintf(fp, " scrollbar %d\n", (OPTIONS & OPT_SCROLLBAR ? 1 : 0));
|
||||
fprintf(fp, " utmp_logging %d\n", (OPTIONS & OPT_WRITE_UTMP ? 1 : 0));
|
||||
fprintf(fp, " meta8 %d\n", (OPTIONS & OPT_META8 ? 1 : 0));
|
||||
fprintf(fp, " iconic %d\n", (OPTIONS & OPT_ICONIC ? 1 : 0));
|
||||
fprintf(fp, " home_on_output %d\n", (OPTIONS & OPT_HOME_ON_OUTPUT ? 1 : 0));
|
||||
fprintf(fp, " home_on_input %d\n", (OPTIONS & OPT_HOME_ON_INPUT ? 1 : 0));
|
||||
fprintf(fp, " no_input %d\n", (OPTIONS & OPT_NO_INPUT ? 1 : 0));
|
||||
fprintf(fp, " scrollbar_floating %d\n", (OPTIONS & OPT_SCROLLBAR_FLOATING ? 1 : 0));
|
||||
fprintf(fp, " scrollbar_right %d\n", (OPTIONS & OPT_SCROLLBAR_RIGHT ? 1 : 0));
|
||||
fprintf(fp, " scrollbar_popup %d\n", (OPTIONS & OPT_SCROLLBAR_POPUP ? 1 : 0));
|
||||
fprintf(fp, " borderless %d\n", (OPTIONS & OPT_BORDERLESS ? 1 : 0));
|
||||
fprintf(fp, " double_buffer %d\n", (OPTIONS & OPT_DOUBLE_BUFFER ? 1 : 0));
|
||||
fprintf(fp, " no_cursor %d\n", (OPTIONS & OPT_NO_CURSOR ? 1 : 0));
|
||||
fprintf(fp, " pause %d\n", (OPTIONS & OPT_PAUSE ? 1 : 0));
|
||||
fprintf(fp, " xterm_select %d\n", (OPTIONS & OPT_XTERM_SELECT ? 1 : 0));
|
||||
fprintf(fp, " select_line %d\n", (OPTIONS & OPT_SELECT_WHOLE_LINE ? 1 : 0));
|
||||
fprintf(fp, " select_trailing_spaces %d\n", (OPTIONS & OPT_SELECT_TRAILING_SPACES ? 1 : 0));
|
||||
fprintf(fp, " report_as_keysyms %d\n", (OPTIONS & OPT_REPORT_AS_KEYSYMS ? 1 : 0));
|
||||
fprintf(fp, " itrans %d\n", (image_toggles & IMOPT_ITRANS ? 1 : 0));
|
||||
fprintf(fp, " buttonbar %d\n", ((buttonbar && bbar_is_visible(buttonbar)) ? 1 : 0));
|
||||
fprintf(fp, " resize_gravity %d\n", (Options & Opt_resize_gravity ? 1 : 0));
|
||||
fprintf(fp, " resize_gravity %d\n", (OPTIONS & OPT_RESIZE_GRAVITY ? 1 : 0));
|
||||
fprintf(fp, "end toggles\n\n");
|
||||
|
||||
fprintf(fp, "begin keyboard\n");
|
||||
|
|
|
@ -28,34 +28,34 @@
|
|||
#include <X11/Intrinsic.h> /* Xlib, Xutil, Xresource, Xfuncproto */
|
||||
|
||||
/************ Macros and Definitions ************/
|
||||
# define Opt_console (1LU << 0)
|
||||
# define Opt_login_shell (1LU << 1)
|
||||
# define Opt_iconic (1LU << 2)
|
||||
# define Opt_visual_bell (1LU << 3)
|
||||
# define Opt_map_alert (1LU << 4)
|
||||
# define Opt_reverse_video (1LU << 5)
|
||||
# define Opt_write_utmp (1LU << 6)
|
||||
# define Opt_scrollbar (1LU << 7)
|
||||
# define Opt_meta8 (1LU << 8)
|
||||
# define Opt_home_on_output (1LU << 9)
|
||||
# define Opt_scrollbar_right (1LU << 10)
|
||||
# define Opt_borderless (1LU << 11)
|
||||
# define Opt_no_input (1LU << 12)
|
||||
# define Opt_no_cursor (1LU << 13)
|
||||
# define Opt_pause (1LU << 14)
|
||||
# define Opt_home_on_input (1LU << 15)
|
||||
# define Opt_report_as_keysyms (1LU << 16)
|
||||
# define Opt_xterm_select (1LU << 17)
|
||||
# define Opt_select_whole_line (1LU << 18)
|
||||
# define Opt_scrollbar_popup (1LU << 19)
|
||||
# define Opt_select_trailing_spaces (1LU << 20)
|
||||
# define Opt_install (1LU << 21)
|
||||
# define Opt_scrollbar_floating (1LU << 22)
|
||||
# define Opt_double_buffer (1LU << 23)
|
||||
# define Opt_mbyte_cursor (1LU << 24)
|
||||
# define Opt_proportional (1LU << 25)
|
||||
# define Opt_resize_gravity (1LU << 26)
|
||||
# define Opt_secondary_screen (1LU << 27)
|
||||
# define OPT_CONSOLE (1LU << 0)
|
||||
# define OPT_LOGIN_SHELL (1LU << 1)
|
||||
# define OPT_ICONIC (1LU << 2)
|
||||
# define OPT_VISUAL_BELL (1LU << 3)
|
||||
# define OPT_MAP_ALERT (1LU << 4)
|
||||
# define OPT_REVERSE_VIDEO (1LU << 5)
|
||||
# define OPT_WRITE_UTMP (1LU << 6)
|
||||
# define OPT_SCROLLBAR (1LU << 7)
|
||||
# define OPT_META8 (1LU << 8)
|
||||
# define OPT_HOME_ON_OUTPUT (1LU << 9)
|
||||
# define OPT_SCROLLBAR_RIGHT (1LU << 10)
|
||||
# define OPT_BORDERLESS (1LU << 11)
|
||||
# define OPT_NO_INPUT (1LU << 12)
|
||||
# define OPT_NO_CURSOR (1LU << 13)
|
||||
# define OPT_PAUSE (1LU << 14)
|
||||
# define OPT_HOME_ON_INPUT (1LU << 15)
|
||||
# define OPT_REPORT_AS_KEYSYMS (1LU << 16)
|
||||
# define OPT_XTERM_SELECT (1LU << 17)
|
||||
# define OPT_SELECT_WHOLE_LINE (1LU << 18)
|
||||
# define OPT_SCROLLBAR_POPUP (1LU << 19)
|
||||
# define OPT_SELECT_TRAILING_SPACES (1LU << 20)
|
||||
# define OPT_INSTALL (1LU << 21)
|
||||
# define OPT_SCROLLBAR_FLOATING (1LU << 22)
|
||||
# define OPT_DOUBLE_BUFFER (1LU << 23)
|
||||
# define OPT_MBYTE_CURSOR (1LU << 24)
|
||||
# define OPT_PROPORTIONAL (1LU << 25)
|
||||
# define OPT_RESIZE_GRAVITY (1LU << 26)
|
||||
# define OPT_SECONDARY_SCREEN (1LU << 27)
|
||||
|
||||
# define IMOPT_TRANS (1U << 0)
|
||||
# define IMOPT_ITRANS (1U << 1)
|
||||
|
@ -71,7 +71,7 @@
|
|||
#define PARSE_TRY_NO_THEME ((unsigned char) 0x04)
|
||||
#define PARSE_TRY_ALL ((unsigned char) 0x07)
|
||||
|
||||
#define to_keysym(p,s) do { KeySym sym; \
|
||||
#define TO_KEYSYM(p,s) do { KeySym sym; \
|
||||
if (s && ((sym = XStringToKeysym(s)) != 0)) *p = sym; \
|
||||
} while (0)
|
||||
#define CHECK_VALID_INDEX(i) (((i) >= image_bg) && ((i) < image_max))
|
||||
|
@ -81,7 +81,7 @@
|
|||
/************ Structures ************/
|
||||
|
||||
/************ Variables ************/
|
||||
extern unsigned long Options, image_toggles;
|
||||
extern unsigned long OPTIONS, image_toggles;
|
||||
extern char *theme_dir, *user_dir;
|
||||
extern char **rs_exec_args; /* Args to exec (-e or --exec) */
|
||||
extern char *rs_title; /* Window title */
|
||||
|
|
|
@ -1091,7 +1091,7 @@ render_simage(simage_t *simg, Window win, unsigned short width, unsigned short h
|
|||
}
|
||||
simg->pmap->pixmap = create_trans_pixmap(simg, which, win, 0, 0, width, height);
|
||||
if (simg->pmap->pixmap != None) {
|
||||
if ((which == image_bg) && (Options & Opt_double_buffer)) {
|
||||
if ((which == image_bg) && (OPTIONS & OPT_DOUBLE_BUFFER)) {
|
||||
copy_buffer_pixmap(MODE_TRANS, (unsigned long) simg->pmap->pixmap, width, height);
|
||||
XSetWindowBackgroundPixmap(Xdisplay, win, buffer_pixmap);
|
||||
} else {
|
||||
|
@ -1117,7 +1117,7 @@ render_simage(simage_t *simg, Window win, unsigned short width, unsigned short h
|
|||
}
|
||||
if (simg->pmap->pixmap != None) {
|
||||
D_PIXMAP(("Setting background of window 0x%08x to 0x%08x\n", win, simg->pmap->pixmap));
|
||||
if ((which == image_bg) && (Options & Opt_double_buffer)) {
|
||||
if ((which == image_bg) && (OPTIONS & OPT_DOUBLE_BUFFER)) {
|
||||
copy_buffer_pixmap(MODE_VIEWPORT, (unsigned long) simg->pmap->pixmap, width, height);
|
||||
XSetWindowBackgroundPixmap(Xdisplay, win, buffer_pixmap);
|
||||
} else {
|
||||
|
@ -1228,7 +1228,7 @@ render_simage(simage_t *simg, Window win, unsigned short width, unsigned short h
|
|||
bevel_pixmap(simg->pmap->pixmap, width, height, simg->iml->bevel->edges, simg->iml->bevel->up);
|
||||
}
|
||||
D_PIXMAP(("Setting background of window 0x%08x to 0x%08x\n", win, simg->pmap->pixmap));
|
||||
if ((which == image_bg) && (Options & Opt_double_buffer)) {
|
||||
if ((which == image_bg) && (OPTIONS & OPT_DOUBLE_BUFFER)) {
|
||||
copy_buffer_pixmap(MODE_VIEWPORT, (unsigned long) simg->pmap->pixmap, width, height);
|
||||
XSetWindowBackgroundPixmap(Xdisplay, win, buffer_pixmap);
|
||||
} else {
|
||||
|
@ -1254,7 +1254,7 @@ render_simage(simage_t *simg, Window win, unsigned short width, unsigned short h
|
|||
|
||||
/* Fall back to solid mode if all else fails. */
|
||||
if (!image_mode_is(which, MODE_MASK)) {
|
||||
if ((which == image_bg) && (Options & Opt_double_buffer)) {
|
||||
if ((which == image_bg) && (OPTIONS & OPT_DOUBLE_BUFFER)) {
|
||||
copy_buffer_pixmap(MODE_SOLID, (unsigned long) PixColors[bgColor], width, height);
|
||||
XSetWindowBackgroundPixmap(Xdisplay, win, buffer_pixmap);
|
||||
} else {
|
||||
|
|
34
src/screen.c
34
src/screen.c
|
@ -357,7 +357,7 @@ scr_poweron(void)
|
|||
/* Reset the rendering style to the default colors/style */
|
||||
scr_rendition(0, ~RS_None);
|
||||
#if NSCREENS
|
||||
if (Options & Opt_secondary_screen) {
|
||||
if (OPTIONS & OPT_SECONDARY_SCREEN) {
|
||||
/* Reset the secondary screen */
|
||||
scr_change_screen(SECONDARY);
|
||||
scr_erase_screen(2);
|
||||
|
@ -432,7 +432,7 @@ scr_change_screen(int scrn)
|
|||
|
||||
SWAP_IT(current_screen, scrn, tmp);
|
||||
#if NSCREENS
|
||||
if (Options & Opt_secondary_screen) {
|
||||
if (OPTIONS & OPT_SECONDARY_SCREEN) {
|
||||
offset = TermWin.saveLines;
|
||||
if (!screen.text || !screen.rend)
|
||||
return (current_screen);
|
||||
|
@ -1179,7 +1179,7 @@ scr_insdel_chars(int count, int insdel)
|
|||
}
|
||||
blank_line(&(screen.text[row][TERM_WINDOW_GET_REPORTED_COLS() - count]), &(screen.rend[row][TERM_WINDOW_GET_REPORTED_COLS() - count]), count, rstyle);
|
||||
screen.text[row][TERM_WINDOW_GET_REPORTED_COLS()] -= count;
|
||||
if (((int) (char) screen.text[row][TERM_WINDOW_GET_REPORTED_COLS()]) < 0)
|
||||
if (((signed char) screen.text[row][TERM_WINDOW_GET_REPORTED_COLS()]) < 0)
|
||||
screen.text[row][TERM_WINDOW_GET_REPORTED_COLS()] = 0;
|
||||
break;
|
||||
}
|
||||
|
@ -1525,11 +1525,11 @@ scr_bell(void)
|
|||
{
|
||||
#ifndef NO_MAPALERT
|
||||
#ifdef MAPALERT_OPTION
|
||||
if (Options & Opt_map_alert)
|
||||
if (OPTIONS & OPT_MAP_ALERT)
|
||||
#endif
|
||||
XMapWindow(Xdisplay, TermWin.parent);
|
||||
#endif
|
||||
if (Options & Opt_visual_bell) {
|
||||
if (OPTIONS & OPT_VISUAL_BELL) {
|
||||
scr_rvideo_mode(!rvideo);
|
||||
scr_rvideo_mode(!rvideo);
|
||||
} else
|
||||
|
@ -2690,7 +2690,7 @@ selection_make(Time tm)
|
|||
*str++ = *t++;
|
||||
col = 0;
|
||||
if (screen.text[row][TERM_WINDOW_GET_REPORTED_COLS()] != WRAP_CHAR) {
|
||||
if (!(Options & Opt_select_trailing_spaces)) {
|
||||
if (!(OPTIONS & OPT_SELECT_TRAILING_SPACES)) {
|
||||
for (str--; *str == ' ' || *str == '\t'; str--);
|
||||
str++;
|
||||
}
|
||||
|
@ -2710,7 +2710,7 @@ selection_make(Time tm)
|
|||
UPPER_BOUND(end_col, TERM_WINDOW_GET_REPORTED_COLS());
|
||||
for (; col < end_col; col++)
|
||||
*str++ = *t++;
|
||||
if (!(Options & Opt_select_trailing_spaces)) {
|
||||
if (!(OPTIONS & OPT_SELECT_TRAILING_SPACES)) {
|
||||
for (str--; *str == ' ' || *str == '\t'; str--);
|
||||
str++;
|
||||
}
|
||||
|
@ -2830,7 +2830,7 @@ selection_delimit_word(int col, int row, row_col_t *beg, row_col_t *end)
|
|||
for (;;) {
|
||||
for (; beg_col > 0; beg_col--) {
|
||||
t = *--stp;
|
||||
if (DELIMIT_TEXT(t) != w1 || (w1 && *stp1 != t && Options & Opt_xterm_select))
|
||||
if (DELIMIT_TEXT(t) != w1 || (w1 && *stp1 != t && OPTIONS & OPT_XTERM_SELECT))
|
||||
break;
|
||||
#ifdef MULTI_CHARSET
|
||||
r = *--srp;
|
||||
|
@ -2838,7 +2838,7 @@ selection_delimit_word(int col, int row, row_col_t *beg, row_col_t *end)
|
|||
break;
|
||||
#endif
|
||||
}
|
||||
if (!(Options & Opt_xterm_select)) {
|
||||
if (!(OPTIONS & OPT_XTERM_SELECT)) {
|
||||
if (beg_col == col && beg_col > 0) {
|
||||
if (DELIMIT_TEXT(*stp)) /* space or tab or cutchar */
|
||||
break;
|
||||
|
@ -2864,10 +2864,10 @@ selection_delimit_word(int col, int row, row_col_t *beg, row_col_t *end)
|
|||
#ifdef MULTI_CHARSET
|
||||
srp = &(screen.rend[beg_row + row_offset - 1][last_col + 1]);
|
||||
r = *(srp - 1);
|
||||
if (DELIMIT_TEXT(t) == w1 && (!w1 || *stp == t || !(Options & Opt_xterm_select)) && DELIMIT_REND(r) == w2) {
|
||||
if (DELIMIT_TEXT(t) == w1 && (!w1 || *stp == t || !(OPTIONS & OPT_XTERM_SELECT)) && DELIMIT_REND(r) == w2) {
|
||||
srp--;
|
||||
#else
|
||||
if (DELIMIT_TEXT(t) == w1 && (!w1 || *stp == t || !(Options & Opt_xterm_select))) {
|
||||
if (DELIMIT_TEXT(t) == w1 && (!w1 || *stp == t || !(OPTIONS & OPT_XTERM_SELECT))) {
|
||||
#endif
|
||||
stp--;
|
||||
beg_row--;
|
||||
|
@ -2893,7 +2893,7 @@ selection_delimit_word(int col, int row, row_col_t *beg, row_col_t *end)
|
|||
for (;;) {
|
||||
for (; end_col < last_col; end_col++) {
|
||||
t = *++stp;
|
||||
if (DELIMIT_TEXT(t) != w1 || (w1 && *stp1 != t && Options & Opt_xterm_select))
|
||||
if (DELIMIT_TEXT(t) != w1 || (w1 && *stp1 != t && OPTIONS & OPT_XTERM_SELECT))
|
||||
break;
|
||||
#ifdef MULTI_CHARSET
|
||||
r = *++srp;
|
||||
|
@ -2901,7 +2901,7 @@ selection_delimit_word(int col, int row, row_col_t *beg, row_col_t *end)
|
|||
break;
|
||||
#endif
|
||||
}
|
||||
if (!(Options & Opt_xterm_select)) {
|
||||
if (!(OPTIONS & OPT_XTERM_SELECT)) {
|
||||
if (end_col == col && end_col < last_col) {
|
||||
if (DELIMIT_TEXT(*stp)) /* space or tab or cutchar */
|
||||
break;
|
||||
|
@ -2925,9 +2925,9 @@ selection_delimit_word(int col, int row, row_col_t *beg, row_col_t *end)
|
|||
stp = screen.text[end_row + row_offset + 1];
|
||||
#ifdef MULTI_CHARSET
|
||||
srp = screen.rend[end_row + row_offset + 1];
|
||||
if (DELIMIT_TEXT(*stp) == w1 && (!w1 || *stp1 == *stp || !(Options & Opt_xterm_select)) && DELIMIT_REND(*srp) == w2) {
|
||||
if (DELIMIT_TEXT(*stp) == w1 && (!w1 || *stp1 == *stp || !(OPTIONS & OPT_XTERM_SELECT)) && DELIMIT_REND(*srp) == w2) {
|
||||
#else
|
||||
if (DELIMIT_TEXT(*stp) == w1 && (!w1 || *stp1 == *stp || !(Options & Opt_xterm_select))) {
|
||||
if (DELIMIT_TEXT(*stp) == w1 && (!w1 || *stp1 == *stp || !(OPTIONS & OPT_XTERM_SELECT))) {
|
||||
#endif
|
||||
end_row++;
|
||||
end_col = 0;
|
||||
|
@ -3157,7 +3157,7 @@ selection_extend_colrow(int col, int row, int flag, int cont)
|
|||
selection.beg.row = selection.mark.row;
|
||||
selection.end.row = row;
|
||||
}
|
||||
if (Options & Opt_select_whole_line) {
|
||||
if (OPTIONS & OPT_SELECT_WHOLE_LINE) {
|
||||
selection.beg.col = 0;
|
||||
} else {
|
||||
selection.clicks = 2;
|
||||
|
@ -3363,7 +3363,7 @@ void
|
|||
xim_get_position(XPoint * pos)
|
||||
{
|
||||
pos->x = Col2Pixel(screen.col);
|
||||
if (scrollbar_is_visible() && !(Options & Opt_scrollbar_right)) {
|
||||
if (scrollbar_is_visible() && !(OPTIONS & OPT_SCROLLBAR_RIGHT)) {
|
||||
pos->x += scrollbar_trough_width();
|
||||
}
|
||||
pos->y = (Height2Pixel(screen.row)
|
||||
|
|
|
@ -29,10 +29,10 @@
|
|||
#define IS_CUT_BUFFER(a) (((a) >= XA_CUT_BUFFER0) && ((a) <= XA_CUT_BUFFER7))
|
||||
|
||||
#define ZERO_SCROLLBACK do { \
|
||||
if (Options & Opt_home_on_output) TermWin.view_start = 0; \
|
||||
if (OPTIONS & OPT_HOME_ON_OUTPUT) TermWin.view_start = 0; \
|
||||
} while (0)
|
||||
#define REFRESH_ZERO_SCROLLBACK do { \
|
||||
if (Options & Opt_home_on_output) TermWin.view_start = 0; \
|
||||
if (OPTIONS & OPT_HOME_ON_OUTPUT) TermWin.view_start = 0; \
|
||||
} while (0)
|
||||
#define CHECK_SELECTION do { \
|
||||
if (selection.op) selection_check(); \
|
||||
|
|
|
@ -383,7 +383,7 @@ scrollbar_draw_uparrow(unsigned char image_state, unsigned char force_modes)
|
|||
}
|
||||
if (!image_mode_is(image_up, MODE_MASK)) {
|
||||
/* Solid mode. Redraw every time since it's cheap. */
|
||||
if (Options & Opt_scrollbar_floating) {
|
||||
if (OPTIONS & OPT_SCROLLBAR_FLOATING) {
|
||||
XSetWindowBackground(Xdisplay, scrollbar.up_win, PixColors[bgColor]);
|
||||
XClearWindow(Xdisplay, scrollbar.up_win);
|
||||
} else {
|
||||
|
@ -453,7 +453,7 @@ scrollbar_draw_downarrow(unsigned char image_state, unsigned char force_modes)
|
|||
}
|
||||
if (!image_mode_is(image_down, MODE_MASK)) {
|
||||
/* Solid mode. Redraw every time since it's cheap. */
|
||||
if (Options & Opt_scrollbar_floating) {
|
||||
if (OPTIONS & OPT_SCROLLBAR_FLOATING) {
|
||||
XSetWindowBackground(Xdisplay, scrollbar.dn_win, PixColors[bgColor]);
|
||||
XClearWindow(Xdisplay, scrollbar.dn_win);
|
||||
} else {
|
||||
|
@ -538,7 +538,7 @@ scrollbar_draw_anchor(unsigned char image_state, unsigned char force_modes)
|
|||
/* Solid mode. Redraw every time since it's cheap. */
|
||||
#ifdef XTERM_SCROLLBAR
|
||||
if (scrollbar.type == SCROLLBAR_XTERM) {
|
||||
int x = ((Options & Opt_scrollbar_right) ? 1 : 0);
|
||||
int x = ((OPTIONS & OPT_SCROLLBAR_RIGHT) ? 1 : 0);
|
||||
|
||||
XSetForeground(Xdisplay, gc_stipple, images[image_sa].current->bg);
|
||||
XFillRectangle(Xdisplay, scrollbar.sa_win, gc_stipple, x + 1, 0, scrollbar_anchor_width() - x - 1, scrollbar_anchor_height());
|
||||
|
@ -547,7 +547,7 @@ scrollbar_draw_anchor(unsigned char image_state, unsigned char force_modes)
|
|||
#endif /* XTERM_SCROLLBAR */
|
||||
#if defined(MOTIF_SCROLLBAR) || defined(NEXT_SCROLLBAR)
|
||||
if (scrollbar.type == SCROLLBAR_MOTIF || scrollbar.type == SCROLLBAR_NEXT) {
|
||||
if (Options & Opt_scrollbar_floating) {
|
||||
if (OPTIONS & OPT_SCROLLBAR_FLOATING) {
|
||||
XSetWindowBackground(Xdisplay, scrollbar.sa_win, PixColors[bgColor]);
|
||||
XClearWindow(Xdisplay, scrollbar.sa_win);
|
||||
} else {
|
||||
|
@ -656,7 +656,7 @@ scrollbar_draw_trough(unsigned char image_state, unsigned char force_modes)
|
|||
}
|
||||
if (!image_mode_is(image_sb, MODE_MASK)) {
|
||||
/* Solid mode. Redraw every time since it's cheap. */
|
||||
if ((Options & Opt_scrollbar_floating) || (scrollbar.type == SCROLLBAR_XTERM)) {
|
||||
if ((OPTIONS & OPT_SCROLLBAR_FLOATING) || (scrollbar.type == SCROLLBAR_XTERM)) {
|
||||
XSetWindowBackground(Xdisplay, scrollbar.win, PixColors[bgColor]);
|
||||
XClearWindow(Xdisplay, scrollbar.win);
|
||||
} else {
|
||||
|
@ -695,7 +695,7 @@ scrollbar_init(int width, int height)
|
|||
|
||||
/* Create the scrollbar trough window. It will be the parent to the other windows. */
|
||||
scrollbar.win =
|
||||
XCreateWindow(Xdisplay, TermWin.parent, ((Options & Opt_scrollbar_right) ? (width - scrollbar_trough_width()) : (0)),
|
||||
XCreateWindow(Xdisplay, TermWin.parent, ((OPTIONS & OPT_SCROLLBAR_RIGHT) ? (width - scrollbar_trough_width()) : (0)),
|
||||
bbar_calc_docked_height(BBAR_DOCKED_TOP), scrollbar_trough_width(), height, 0, Xdepth, InputOutput, CopyFromParent,
|
||||
CWOverrideRedirect | CWBackPixel | CWBorderPixel | CWColormap, &Attributes);
|
||||
XDefineCursor(Xdisplay, scrollbar.win, cursor);
|
||||
|
@ -817,9 +817,9 @@ scrollbar_resize(int width, int height)
|
|||
D_SCROLLBAR(("scrollbar_resize(%d, %d)\n", width, height));
|
||||
scrollbar_calc_size(width, height);
|
||||
D_SCROLLBAR((" -> XMoveResizeWindow(Xdisplay, 0x%08x, %d, y, %d, %d)\n", scrollbar.win,
|
||||
((Options & Opt_scrollbar_right) ? (width - scrollbar_trough_width()) : (0)),
|
||||
((OPTIONS & OPT_SCROLLBAR_RIGHT) ? (width - scrollbar_trough_width()) : (0)),
|
||||
scrollbar_trough_width(), scrollbar_trough_height()));
|
||||
XMoveResizeWindow(Xdisplay, scrollbar.win, ((Options & Opt_scrollbar_right) ? (width - scrollbar_trough_width()) : (0)),
|
||||
XMoveResizeWindow(Xdisplay, scrollbar.win, ((OPTIONS & OPT_SCROLLBAR_RIGHT) ? (width - scrollbar_trough_width()) : (0)),
|
||||
bbar_calc_docked_height(BBAR_DOCKED_TOP), scrollbar_trough_width(), scrollbar_trough_height());
|
||||
scrollbar_draw_trough(IMAGE_STATE_CURRENT, MODE_MASK);
|
||||
scrollbar_reposition_and_draw(MODE_MASK);
|
||||
|
|
|
@ -118,7 +118,7 @@ eterm_bootstrap(int argc, char *argv[])
|
|||
}
|
||||
XSetErrorHandler((XErrorHandler) xerror_handler);
|
||||
|
||||
if (Options & Opt_install) {
|
||||
if (OPTIONS & OPT_INSTALL) {
|
||||
cmap = XCreateColormap(Xdisplay, Xroot, Xvisual, AllocNone);
|
||||
XInstallColormap(Xdisplay, cmap);
|
||||
} else {
|
||||
|
@ -235,7 +235,7 @@ eterm_bootstrap(int argc, char *argv[])
|
|||
|
||||
/* Initialize the scrollbar */
|
||||
scrollbar_init(szHint.width, szHint.height - bbar_calc_docked_height(BBAR_DOCKED));
|
||||
scrollbar_mapping((Options & Opt_scrollbar) && !((Options & Opt_scrollbar_popup) && !TermWin.focus));
|
||||
scrollbar_mapping((OPTIONS & OPT_SCROLLBAR) && !((OPTIONS & OPT_SCROLLBAR_POPUP) && !TermWin.focus));
|
||||
|
||||
/* Initialize the menu subsystem. */
|
||||
menu_init();
|
||||
|
|
44
src/term.c
44
src/term.c
|
@ -290,14 +290,14 @@ lookup_key(XEvent * ev)
|
|||
}
|
||||
if (len) {
|
||||
/* Only home for keypresses with length. */
|
||||
if (Options & Opt_home_on_input) {
|
||||
if (OPTIONS & OPT_HOME_ON_INPUT) {
|
||||
TermWin.view_start = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* This is a special mode that reports all extended keysyms (above 0xff00) to the application
|
||||
as escape sequences. Very few applications use it, but it can be a handy thing to have. */
|
||||
if ((Options & Opt_report_as_keysyms) && (keysym >= 0xff00)) {
|
||||
if ((OPTIONS & OPT_REPORT_AS_KEYSYMS) && (keysym >= 0xff00)) {
|
||||
len = sprintf((char *) kbuf, "\033[k%X;%X~", (unsigned int) (ev->xkey.state & 0xff), (unsigned int) (keysym & 0xff));
|
||||
tt_write(kbuf, len);
|
||||
LK_RET();
|
||||
|
@ -468,7 +468,7 @@ lookup_key(XEvent * ev)
|
|||
kbuf[0] = (((PrivateModes & PrivMode_BackSpace) ? !(shft | ctrl) : (shft | ctrl)) ? '\b' : '\177');
|
||||
#endif
|
||||
#ifdef MULTI_CHARSET
|
||||
if ((Options & Opt_mbyte_cursor) && scr_multi2()) {
|
||||
if ((OPTIONS & OPT_MBYTE_CURSOR) && scr_multi2()) {
|
||||
memmove(kbuf + len, kbuf, len);
|
||||
len *= 2;
|
||||
}
|
||||
|
@ -530,7 +530,7 @@ lookup_key(XEvent * ev)
|
|||
kbuf[2] = ("dacb"[keysym - XK_Left]);
|
||||
}
|
||||
#ifdef MULTI_CHARSET
|
||||
if ((Options & Opt_mbyte_cursor)
|
||||
if ((OPTIONS & OPT_MBYTE_CURSOR)
|
||||
&& ((keysym == XK_Left && scr_multi2())
|
||||
|| (keysym == XK_Right && scr_multi1()))) {
|
||||
memmove(kbuf + len, kbuf, len);
|
||||
|
@ -624,7 +624,7 @@ lookup_key(XEvent * ev)
|
|||
#ifdef KS_DELETE
|
||||
len = strlen(strcpy(kbuf, KS_DELETE));
|
||||
#ifdef MULTI_CHARSET
|
||||
if ((Options & Opt_mbyte_cursor) && scr_multi1()) {
|
||||
if ((OPTIONS & OPT_MBYTE_CURSOR) && scr_multi1()) {
|
||||
memmove(kbuf + len, kbuf, len);
|
||||
len *= 2;
|
||||
}
|
||||
|
@ -1541,16 +1541,16 @@ process_terminal_mode(int mode, int priv, unsigned int nargs, int arg[])
|
|||
#endif
|
||||
|
||||
case 1010: /* Scroll to bottom on TTY output */
|
||||
if (Options & Opt_home_on_output)
|
||||
Options &= ~Opt_home_on_output;
|
||||
if (OPTIONS & OPT_HOME_ON_OUTPUT)
|
||||
OPTIONS &= ~OPT_HOME_ON_OUTPUT;
|
||||
else
|
||||
Options |= Opt_home_on_output;
|
||||
OPTIONS |= OPT_HOME_ON_OUTPUT;
|
||||
break;
|
||||
case 1012: /* Scroll to bottom on TTY input */
|
||||
if (Options & Opt_home_on_input)
|
||||
Options &= ~Opt_home_on_input;
|
||||
if (OPTIONS & OPT_HOME_ON_INPUT)
|
||||
OPTIONS &= ~OPT_HOME_ON_INPUT;
|
||||
else
|
||||
Options |= Opt_home_on_input;
|
||||
OPTIONS |= OPT_HOME_ON_INPUT;
|
||||
break;
|
||||
|
||||
case 1047: /* Alternate screen & clear */
|
||||
|
@ -2249,18 +2249,18 @@ xterm_seq(int op, const char *str)
|
|||
break;
|
||||
case 11:
|
||||
nstr = (char *) strsep(&tnstr, ";");
|
||||
OPT_SET_OR_TOGGLE(nstr, Options, Opt_scrollbar_right);
|
||||
OPT_SET_OR_TOGGLE(nstr, OPTIONS, OPT_SCROLLBAR_RIGHT);
|
||||
scr_touch();
|
||||
parent_resize();
|
||||
break;
|
||||
case 12:
|
||||
nstr = (char *) strsep(&tnstr, ";");
|
||||
OPT_SET_OR_TOGGLE(nstr, Options, Opt_scrollbar_floating);
|
||||
OPT_SET_OR_TOGGLE(nstr, OPTIONS, OPT_SCROLLBAR_FLOATING);
|
||||
scrollbar_reposition_and_always_draw();
|
||||
break;
|
||||
case 13:
|
||||
nstr = (char *) strsep(&tnstr, ";");
|
||||
OPT_SET_OR_TOGGLE(nstr, Options, Opt_scrollbar_popup);
|
||||
OPT_SET_OR_TOGGLE(nstr, OPTIONS, OPT_SCROLLBAR_POPUP);
|
||||
break;
|
||||
case 14:
|
||||
nstr = (char *) strsep(&tnstr, ";");
|
||||
|
@ -2277,21 +2277,21 @@ xterm_seq(int op, const char *str)
|
|||
break;
|
||||
case 20:
|
||||
nstr = (char *) strsep(&tnstr, ";");
|
||||
OPT_SET_OR_TOGGLE(nstr, Options, Opt_visual_bell);
|
||||
OPT_SET_OR_TOGGLE(nstr, OPTIONS, OPT_VISUAL_BELL);
|
||||
break;
|
||||
#ifdef MAPALERT_OPTION
|
||||
case 21:
|
||||
nstr = (char *) strsep(&tnstr, ";");
|
||||
OPT_SET_OR_TOGGLE(nstr, Options, Opt_map_alert);
|
||||
OPT_SET_OR_TOGGLE(nstr, OPTIONS, OPT_MAP_ALERT);
|
||||
break;
|
||||
#endif
|
||||
case 22:
|
||||
nstr = (char *) strsep(&tnstr, ";");
|
||||
OPT_SET_OR_TOGGLE(nstr, Options, Opt_xterm_select);
|
||||
OPT_SET_OR_TOGGLE(nstr, OPTIONS, OPT_XTERM_SELECT);
|
||||
break;
|
||||
case 23:
|
||||
nstr = (char *) strsep(&tnstr, ";");
|
||||
OPT_SET_OR_TOGGLE(nstr, Options, Opt_select_whole_line);
|
||||
OPT_SET_OR_TOGGLE(nstr, OPTIONS, OPT_SELECT_WHOLE_LINE);
|
||||
break;
|
||||
case 24:
|
||||
nstr = (char *) strsep(&tnstr, ";");
|
||||
|
@ -2302,18 +2302,18 @@ xterm_seq(int op, const char *str)
|
|||
break;
|
||||
case 25:
|
||||
nstr = (char *) strsep(&tnstr, ";");
|
||||
OPT_SET_OR_TOGGLE(nstr, Options, Opt_select_trailing_spaces);
|
||||
OPT_SET_OR_TOGGLE(nstr, OPTIONS, OPT_SELECT_TRAILING_SPACES);
|
||||
break;
|
||||
case 26:
|
||||
nstr = (char *) strsep(&tnstr, ";");
|
||||
OPT_SET_OR_TOGGLE(nstr, Options, Opt_report_as_keysyms);
|
||||
OPT_SET_OR_TOGGLE(nstr, OPTIONS, OPT_REPORT_AS_KEYSYMS);
|
||||
break;
|
||||
case 27:
|
||||
nstr = (char *) strsep(&tnstr, ";");
|
||||
OPT_SET_OR_TOGGLE(nstr, Options, Opt_no_input);
|
||||
OPT_SET_OR_TOGGLE(nstr, OPTIONS, OPT_NO_INPUT);
|
||||
wm_hints = XGetWMHints(Xdisplay, TermWin.parent);
|
||||
wm_hints->flags |= InputHint;
|
||||
wm_hints->input = ((Options & Opt_no_input) ? False : True);
|
||||
wm_hints->input = ((OPTIONS & OPT_NO_INPUT) ? False : True);
|
||||
XSetWMHints(Xdisplay, TermWin.parent, wm_hints);
|
||||
XFree(wm_hints);
|
||||
break;
|
||||
|
|
|
@ -365,7 +365,7 @@ Create_Windows(int argc, char *argv[])
|
|||
unsigned int width = 0, height = 0;
|
||||
MWMHints mwmhints;
|
||||
|
||||
if (Options & Opt_borderless) {
|
||||
if (OPTIONS & OPT_BORDERLESS) {
|
||||
prop = XInternAtom(Xdisplay, "_MOTIF_WM_INFO", True);
|
||||
if (prop == None) {
|
||||
print_warning("Window Manager does not support MWM hints. Bypassing window manager control for borderless window.\n");
|
||||
|
@ -380,7 +380,7 @@ Create_Windows(int argc, char *argv[])
|
|||
}
|
||||
Attributes.colormap = cmap;
|
||||
|
||||
szHint.base_width = (2 * TermWin.internalBorder + ((Options & Opt_scrollbar) ? (scrollbar_get_width() + (2 * scrollbar_get_shadow())) : 0));
|
||||
szHint.base_width = (2 * TermWin.internalBorder + ((OPTIONS & OPT_SCROLLBAR) ? (scrollbar_get_width() + (2 * scrollbar_get_shadow())) : 0));
|
||||
szHint.base_height = (2 * TermWin.internalBorder) + bbar_calc_docked_height(BBAR_DOCKED);
|
||||
|
||||
flags = (rs_geometry ? XParseGeometry(rs_geometry, &x, &y, &width, &height) : 0);
|
||||
|
@ -434,8 +434,8 @@ Create_Windows(int argc, char *argv[])
|
|||
classHint.res_name = (char *) rs_name;
|
||||
classHint.res_class = APL_NAME;
|
||||
wmHint.window_group = TermWin.parent;
|
||||
wmHint.input = ((Options & Opt_no_input) ? False : True);
|
||||
wmHint.initial_state = (Options & Opt_iconic ? IconicState : NormalState);
|
||||
wmHint.input = ((OPTIONS & OPT_NO_INPUT) ? False : True);
|
||||
wmHint.initial_state = (OPTIONS & OPT_ICONIC ? IconicState : NormalState);
|
||||
wmHint.window_group = TermWin.parent;
|
||||
wmHint.flags = (InputHint | StateHint | WindowGroupHint);
|
||||
#ifdef PIXMAP_SUPPORT
|
||||
|
@ -457,12 +457,12 @@ Create_Windows(int argc, char *argv[])
|
|||
cursor = XCreateFontCursor(Xdisplay, XC_left_ptr);
|
||||
|
||||
/* the vt window */
|
||||
TermWin.x = (((Options & Opt_scrollbar) && !(Options & Opt_scrollbar_right)) ? (scrollbar_get_width() + (2 * scrollbar_get_shadow())) : 0);
|
||||
TermWin.x = (((OPTIONS & OPT_SCROLLBAR) && !(OPTIONS & OPT_SCROLLBAR_RIGHT)) ? (scrollbar_get_width() + (2 * scrollbar_get_shadow())) : 0);
|
||||
TermWin.y = bbar_calc_docked_height(BBAR_DOCKED_TOP);
|
||||
TermWin.vt = XCreateWindow(Xdisplay, TermWin.parent, TermWin.x, TermWin.y, szHint.width, szHint.height, 0, Xdepth, InputOutput, CopyFromParent,
|
||||
CWBackPixel | CWBorderPixel | CWOverrideRedirect | CWColormap, &Attributes);
|
||||
D_X11(("Created terminal window 0x%08x at %dx%d\n", TermWin.vt, TermWin.x, TermWin.y));
|
||||
if (!(background_is_pixmap()) && !(Options & Opt_borderless)) {
|
||||
if (!(background_is_pixmap()) && !(OPTIONS & OPT_BORDERLESS)) {
|
||||
XSetWindowBackground(Xdisplay, TermWin.vt, PixColors[bgColor]);
|
||||
XClearWindow(Xdisplay, TermWin.vt);
|
||||
}
|
||||
|
@ -499,7 +499,7 @@ Create_Windows(int argc, char *argv[])
|
|||
TermWin.gc = LIBAST_X_CREATE_GC(GCForeground | GCBackground | GCFont | GCGraphicsExposures, &gcvalue);
|
||||
}
|
||||
|
||||
if (Options & Opt_no_cursor) {
|
||||
if (OPTIONS & OPT_NO_CURSOR) {
|
||||
scr_cursor_visible(0);
|
||||
}
|
||||
}
|
||||
|
@ -510,7 +510,7 @@ resize_parent(unsigned int width, unsigned int height)
|
|||
{
|
||||
XWindowAttributes attr;
|
||||
|
||||
if (!(Options & Opt_resize_gravity) || !XGetWindowAttributes(Xdisplay, TermWin.parent, &attr)) {
|
||||
if (!(OPTIONS & OPT_RESIZE_GRAVITY) || !XGetWindowAttributes(Xdisplay, TermWin.parent, &attr)) {
|
||||
XResizeWindow(Xdisplay, TermWin.parent, width, height);
|
||||
} else {
|
||||
Window junkwin;
|
||||
|
@ -592,7 +592,7 @@ term_resize(int width, int height)
|
|||
width = TERM_WINDOW_FULL_WIDTH();
|
||||
height = TERM_WINDOW_FULL_HEIGHT();
|
||||
XMoveResizeWindow(Xdisplay, TermWin.vt,
|
||||
((Options & Opt_scrollbar_right) ? (0) : ((scrollbar_is_visible())? (scrollbar_trough_width()) : (0))),
|
||||
((OPTIONS & OPT_SCROLLBAR_RIGHT) ? (0) : ((scrollbar_is_visible())? (scrollbar_trough_width()) : (0))),
|
||||
bbar_calc_docked_height(BBAR_DOCKED_TOP), width, height);
|
||||
if (width != last_width || height != last_height) {
|
||||
render_simage(images[image_bg].current, TermWin.vt, width, height, image_bg, 0);
|
||||
|
|
Loading…
Reference in New Issue