Thu Aug 21 23:51:12 2003 Michael Jennings (mej)
Oops, that wasn't *quite* what I had in mind.... SVN revision: 7362
This commit is contained in:
parent
6b43700de1
commit
0784d8336b
|
@ -5085,3 +5085,7 @@ 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>.
|
||||
----------------------------------------------------------------------
|
||||
Thu Aug 21 23:51:12 2003 Michael Jennings (mej)
|
||||
|
||||
Oops, that wasn't *quite* what I had in mind....
|
||||
----------------------------------------------------------------------
|
||||
|
|
|
@ -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 (eterm_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() && !(eterm_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 + (!(eterm_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() && !(eterm_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 (eterm_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 (eterm_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 (eterm_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 = (eterm_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 && (eterm_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 && (eterm_options & OPT_PAUSE)) {
|
||||
paused = 1;
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -38,8 +38,8 @@
|
|||
# define D_SELECT(x) DPRINTF1(x)
|
||||
# define DEBUG_UTMP 1
|
||||
# define D_UTMP(x) DPRINTF1(x)
|
||||
# define DEBUG_OPTIONS 1
|
||||
# define D_OPTIONS(x) DPRINTF1(x)
|
||||
# define DEBUG_eterm_options 1
|
||||
# define D_eterm_options(x) DPRINTF1(x)
|
||||
# define DEBUG_IMLIB 1
|
||||
# define D_IMLIB(x) DPRINTF1(x)
|
||||
# define DEBUG_PIXMAP 1
|
||||
|
|
|
@ -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 (!(eterm_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 (eterm_options & OPT_SCROLLBAR_POPUP) {
|
||||
map_scrollbar(eterm_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 (eterm_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 && (eterm_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;
|
||||
|
|
228
src/options.c
228
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 eterm_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 */
|
||||
/* eterm_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", eterm_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", eterm_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", eterm_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", eterm_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", eterm_options, OPT_LOGIN_SHELL),
|
||||
SPIFOPT_BOOL('s', "scrollbar", "display scrollbar", eterm_options, OPT_SCROLLBAR),
|
||||
SPIFOPT_BOOL('u', "utmp-logging", "make a utmp entry", eterm_options, OPT_WRITE_UTMP),
|
||||
SPIFOPT_BOOL('v', "visual-bell", "visual bell", eterm_options, OPT_VISUAL_BELL),
|
||||
SPIFOPT_BOOL('H', "home-on-output", "jump to bottom on output", eterm_options, OPT_HOME_ON_OUTPUT),
|
||||
SPIFOPT_BOOL_LONG("home-on-input", "jump to bottom on input", eterm_options, OPT_HOME_ON_INPUT),
|
||||
SPIFOPT_BOOL('q', "no-input", "configure for output only", eterm_options, OPT_NO_INPUT),
|
||||
SPIFOPT_BOOL_LONG("scrollbar-right", "display the scrollbar on the right", eterm_options, OPT_SCROLLBAR_RIGHT),
|
||||
SPIFOPT_BOOL_LONG("scrollbar-floating", "display the scrollbar with no trough", eterm_options, OPT_SCROLLBAR_FLOATING),
|
||||
SPIFOPT_BOOL_LONG("scrollbar-popup", "popup the scrollbar only when focused", eterm_options, OPT_SCROLLBAR_POPUP),
|
||||
SPIFOPT_BOOL('x', "borderless", "force Eterm to have no borders", eterm_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", eterm_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", eterm_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)", eterm_options, OPT_DOUBLE_BUFFER),
|
||||
SPIFOPT_BOOL_LONG("no-cursor", "disable the text cursor", eterm_options, OPT_NO_CURSOR),
|
||||
SPIFOPT_BOOL_LONG("pause", "pause after the child process exits", eterm_options, OPT_PAUSE),
|
||||
SPIFOPT_BOOL_LONG("xterm-select", "duplicate xterm's selection behavior", eterm_options, OPT_XTERM_SELECT),
|
||||
SPIFOPT_BOOL_LONG("select-line", "triple-click selects whole line", eterm_options, OPT_SELECT_WHOLE_LINE),
|
||||
SPIFOPT_BOOL_LONG("select-trailing-spaces", "do not skip trailing spaces when selecting", eterm_options, OPT_SELECT_TRAILING_SPACES),
|
||||
SPIFOPT_BOOL_LONG("report-as-keysyms", "report special keys as keysyms", eterm_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", eterm_options, OPT_RESIZE_GRAVITY),
|
||||
SPIFOPT_BOOL_LONG("secondary-screen", "toggle use of secondary screen", eterm_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", eterm_options, OPT_CONSOLE),
|
||||
SPIFOPT_ARGS('e', "exec", "execute a command rather than a shell", rs_exec_args)
|
||||
};
|
||||
|
||||
|
@ -422,8 +422,8 @@ version(void)
|
|||
#if DEBUG >= DEBUG_UTMP
|
||||
printf(" +DEBUG_UTMP");
|
||||
#endif
|
||||
#if DEBUG >= DEBUG_OPTIONS
|
||||
printf(" +DEBUG_OPTIONS");
|
||||
#if DEBUG >= DEBUG_eterm_options
|
||||
printf(" +DEBUG_eterm_options");
|
||||
#endif
|
||||
#if DEBUG >= DEBUG_IMLIB
|
||||
printf(" +DEBUG_IMLIB");
|
||||
|
@ -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;
|
||||
eterm_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;
|
||||
eterm_options |= OPT_PROPORTIONAL;
|
||||
} else if (BOOL_OPT_ISFALSE(tmp)) {
|
||||
OPTIONS &= ~(OPT_PROPORTIONAL);
|
||||
eterm_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;
|
||||
eterm_options |= OPT_MAP_ALERT;
|
||||
} else {
|
||||
OPTIONS &= ~(OPT_MAP_ALERT);
|
||||
eterm_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;
|
||||
eterm_options |= OPT_VISUAL_BELL;
|
||||
} else {
|
||||
OPTIONS &= ~(OPT_VISUAL_BELL);
|
||||
eterm_options &= ~(OPT_VISUAL_BELL);
|
||||
}
|
||||
} else if (!BEG_STRCASECMP(buff, "login_shell ")) {
|
||||
if (bool_val) {
|
||||
OPTIONS |= OPT_LOGIN_SHELL;
|
||||
eterm_options |= OPT_LOGIN_SHELL;
|
||||
} else {
|
||||
OPTIONS &= ~(OPT_LOGIN_SHELL);
|
||||
eterm_options &= ~(OPT_LOGIN_SHELL);
|
||||
}
|
||||
} else if (!BEG_STRCASECMP(buff, "scrollbar ")) {
|
||||
if (bool_val) {
|
||||
OPTIONS |= OPT_SCROLLBAR;
|
||||
eterm_options |= OPT_SCROLLBAR;
|
||||
} else {
|
||||
OPTIONS &= ~(OPT_SCROLLBAR);
|
||||
eterm_options &= ~(OPT_SCROLLBAR);
|
||||
}
|
||||
|
||||
} else if (!BEG_STRCASECMP(buff, "utmp_logging ")) {
|
||||
#ifdef UTMP_SUPPORT
|
||||
if (bool_val) {
|
||||
OPTIONS |= OPT_WRITE_UTMP;
|
||||
eterm_options |= OPT_WRITE_UTMP;
|
||||
} else {
|
||||
OPTIONS &= ~(OPT_WRITE_UTMP);
|
||||
eterm_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;
|
||||
eterm_options |= OPT_META8;
|
||||
} else {
|
||||
OPTIONS &= ~(OPT_META8);
|
||||
eterm_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;
|
||||
eterm_options |= OPT_ICONIC;
|
||||
} else {
|
||||
OPTIONS &= ~(OPT_ICONIC);
|
||||
eterm_options &= ~(OPT_ICONIC);
|
||||
}
|
||||
|
||||
} else if (!BEG_STRCASECMP(buff, "home_on_output ")) {
|
||||
if (bool_val) {
|
||||
OPTIONS |= OPT_HOME_ON_OUTPUT;
|
||||
eterm_options |= OPT_HOME_ON_OUTPUT;
|
||||
} else {
|
||||
OPTIONS &= ~(OPT_HOME_ON_OUTPUT);
|
||||
eterm_options &= ~(OPT_HOME_ON_OUTPUT);
|
||||
}
|
||||
|
||||
} else if (!BEG_STRCASECMP(buff, "home_on_input ")) {
|
||||
if (bool_val) {
|
||||
OPTIONS |= OPT_HOME_ON_INPUT;
|
||||
eterm_options |= OPT_HOME_ON_INPUT;
|
||||
} else {
|
||||
OPTIONS &= ~(OPT_HOME_ON_INPUT);
|
||||
eterm_options &= ~(OPT_HOME_ON_INPUT);
|
||||
}
|
||||
|
||||
} else if (!BEG_STRCASECMP(buff, "no_input ")) {
|
||||
if (bool_val) {
|
||||
OPTIONS |= OPT_NO_INPUT;
|
||||
eterm_options |= OPT_NO_INPUT;
|
||||
} else {
|
||||
OPTIONS &= ~(OPT_NO_INPUT);
|
||||
eterm_options &= ~(OPT_NO_INPUT);
|
||||
}
|
||||
|
||||
} else if (!BEG_STRCASECMP(buff, "scrollbar_floating ")) {
|
||||
if (bool_val) {
|
||||
OPTIONS |= OPT_SCROLLBAR_FLOATING;
|
||||
eterm_options |= OPT_SCROLLBAR_FLOATING;
|
||||
} else {
|
||||
OPTIONS &= ~(OPT_SCROLLBAR_FLOATING);
|
||||
eterm_options &= ~(OPT_SCROLLBAR_FLOATING);
|
||||
}
|
||||
|
||||
} else if (!BEG_STRCASECMP(buff, "scrollbar_right ")) {
|
||||
if (bool_val) {
|
||||
OPTIONS |= OPT_SCROLLBAR_RIGHT;
|
||||
eterm_options |= OPT_SCROLLBAR_RIGHT;
|
||||
} else {
|
||||
OPTIONS &= ~(OPT_SCROLLBAR_RIGHT);
|
||||
eterm_options &= ~(OPT_SCROLLBAR_RIGHT);
|
||||
}
|
||||
} else if (!BEG_STRCASECMP(buff, "scrollbar_popup ")) {
|
||||
if (bool_val) {
|
||||
OPTIONS |= OPT_SCROLLBAR_POPUP;
|
||||
eterm_options |= OPT_SCROLLBAR_POPUP;
|
||||
} else {
|
||||
OPTIONS &= ~(OPT_SCROLLBAR_POPUP);
|
||||
eterm_options &= ~(OPT_SCROLLBAR_POPUP);
|
||||
}
|
||||
} else if (!BEG_STRCASECMP(buff, "borderless ")) {
|
||||
if (bool_val) {
|
||||
OPTIONS |= OPT_BORDERLESS;
|
||||
eterm_options |= OPT_BORDERLESS;
|
||||
} else {
|
||||
OPTIONS &= ~(OPT_BORDERLESS);
|
||||
eterm_options &= ~(OPT_BORDERLESS);
|
||||
}
|
||||
} else if (!BEG_STRCASECMP(buff, "double_buffer ")) {
|
||||
if (bool_val) {
|
||||
OPTIONS |= OPT_DOUBLE_BUFFER;
|
||||
eterm_options |= OPT_DOUBLE_BUFFER;
|
||||
} else {
|
||||
OPTIONS &= ~(OPT_DOUBLE_BUFFER);
|
||||
eterm_options &= ~(OPT_DOUBLE_BUFFER);
|
||||
}
|
||||
|
||||
} else if (!BEG_STRCASECMP(buff, "no_cursor ")) {
|
||||
if (bool_val) {
|
||||
OPTIONS |= OPT_NO_CURSOR;
|
||||
eterm_options |= OPT_NO_CURSOR;
|
||||
} else {
|
||||
OPTIONS &= ~(OPT_NO_CURSOR);
|
||||
eterm_options &= ~(OPT_NO_CURSOR);
|
||||
}
|
||||
|
||||
} else if (!BEG_STRCASECMP(buff, "pause ")) {
|
||||
if (bool_val) {
|
||||
OPTIONS |= OPT_PAUSE;
|
||||
eterm_options |= OPT_PAUSE;
|
||||
} else {
|
||||
OPTIONS &= ~(OPT_PAUSE);
|
||||
eterm_options &= ~(OPT_PAUSE);
|
||||
}
|
||||
|
||||
} else if (!BEG_STRCASECMP(buff, "xterm_select ")) {
|
||||
if (bool_val) {
|
||||
OPTIONS |= OPT_XTERM_SELECT;
|
||||
eterm_options |= OPT_XTERM_SELECT;
|
||||
} else {
|
||||
OPTIONS &= ~(OPT_XTERM_SELECT);
|
||||
eterm_options &= ~(OPT_XTERM_SELECT);
|
||||
}
|
||||
|
||||
} else if (!BEG_STRCASECMP(buff, "select_line ")) {
|
||||
if (bool_val) {
|
||||
OPTIONS |= OPT_SELECT_WHOLE_LINE;
|
||||
eterm_options |= OPT_SELECT_WHOLE_LINE;
|
||||
} else {
|
||||
OPTIONS &= ~(OPT_SELECT_WHOLE_LINE);
|
||||
eterm_options &= ~(OPT_SELECT_WHOLE_LINE);
|
||||
}
|
||||
|
||||
} else if (!BEG_STRCASECMP(buff, "select_trailing_spaces ")) {
|
||||
if (bool_val) {
|
||||
OPTIONS |= OPT_SELECT_TRAILING_SPACES;
|
||||
eterm_options |= OPT_SELECT_TRAILING_SPACES;
|
||||
} else {
|
||||
OPTIONS &= ~(OPT_SELECT_TRAILING_SPACES);
|
||||
eterm_options &= ~(OPT_SELECT_TRAILING_SPACES);
|
||||
}
|
||||
|
||||
} else if (!BEG_STRCASECMP(buff, "report_as_keysyms ")) {
|
||||
if (bool_val) {
|
||||
OPTIONS |= OPT_REPORT_AS_KEYSYMS;
|
||||
eterm_options |= OPT_REPORT_AS_KEYSYMS;
|
||||
} else {
|
||||
OPTIONS &= ~(OPT_REPORT_AS_KEYSYMS);
|
||||
eterm_options &= ~(OPT_REPORT_AS_KEYSYMS);
|
||||
}
|
||||
|
||||
} else if (!BEG_STRCASECMP(buff, "mbyte_cursor ")) {
|
||||
if (bool_val) {
|
||||
OPTIONS |= OPT_MBYTE_CURSOR;
|
||||
eterm_options |= OPT_MBYTE_CURSOR;
|
||||
} else {
|
||||
OPTIONS &= ~(OPT_MBYTE_CURSOR);
|
||||
eterm_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;
|
||||
eterm_options |= OPT_RESIZE_GRAVITY;
|
||||
} else {
|
||||
OPTIONS &= ~(OPT_RESIZE_GRAVITY);
|
||||
eterm_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(),
|
||||
|
@ -1459,7 +1459,7 @@ parse_misc(char *buff, void *state)
|
|||
|
||||
for (k = 0; k < n; k++) {
|
||||
rs_exec_args[k] = get_word(k + 2, buff);
|
||||
D_OPTIONS(("rs_exec_args[%d] == %s\n", k, rs_exec_args[k]));
|
||||
D_eterm_options(("rs_exec_args[%d] == %s\n", k, rs_exec_args[k]));
|
||||
}
|
||||
rs_exec_args[n] = (char *) NULL;
|
||||
|
||||
|
@ -2581,7 +2581,7 @@ post_parse(void)
|
|||
}
|
||||
/* no point having a scrollbar without having any scrollback! */
|
||||
if (!TermWin.saveLines) {
|
||||
OPTIONS &= ~OPT_SCROLLBAR;
|
||||
eterm_options &= ~OPT_SCROLLBAR;
|
||||
}
|
||||
#ifdef PRINTPIPE
|
||||
if (!rs_print_pipe) {
|
||||
|
@ -2941,7 +2941,7 @@ post_parse(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
if (OPTIONS & OPT_REVERSE_VIDEO) {
|
||||
if (eterm_options & OPT_REVERSE_VIDEO) {
|
||||
char *tmp;
|
||||
|
||||
/* swap foreground/background colors */
|
||||
|
@ -3043,7 +3043,7 @@ save_config(char *path, unsigned char save_theme)
|
|||
action_t *action;
|
||||
buttonbar_t *bbar;
|
||||
|
||||
D_OPTIONS(("Saving %s config to \"%s\"\n", (save_theme ? "theme" : "user"), NONULL(path)));
|
||||
D_eterm_options(("Saving %s config to \"%s\"\n", (save_theme ? "theme" : "user"), NONULL(path)));
|
||||
|
||||
cur_tm = localtime(&cur_time);
|
||||
|
||||
|
@ -3055,7 +3055,7 @@ save_config(char *path, unsigned char save_theme)
|
|||
if (stat(path, &fst) || !S_ISDIR(fst.st_mode) || !CAN_WRITE(fst)) {
|
||||
char *tmp = NULL;
|
||||
|
||||
D_OPTIONS(("Problem with \"%s\". S_ISDIR == %d, CAN_WRITE == %d\n", path, S_ISDIR(fst.st_mode), CAN_WRITE(fst)));
|
||||
D_eterm_options(("Problem with \"%s\". S_ISDIR == %d, CAN_WRITE == %d\n", path, S_ISDIR(fst.st_mode), CAN_WRITE(fst)));
|
||||
if (theme_dir) {
|
||||
tmp = strrchr(theme_dir, '/');
|
||||
if (tmp) {
|
||||
|
@ -3063,7 +3063,7 @@ save_config(char *path, unsigned char save_theme)
|
|||
}
|
||||
}
|
||||
snprintf(path, PATH_MAX, "%s/.Eterm/themes/%s", getenv("HOME"), (tmp ? tmp : "Eterm"));
|
||||
D_OPTIONS(("Trying \"%s\" instead, tmp == \"%s\"\n", path, tmp));
|
||||
D_eterm_options(("Trying \"%s\" instead, tmp == \"%s\"\n", path, tmp));
|
||||
if (tmp) {
|
||||
*(--tmp) = '/';
|
||||
}
|
||||
|
@ -3074,7 +3074,7 @@ save_config(char *path, unsigned char save_theme)
|
|||
}
|
||||
}
|
||||
strcat(path, "/" THEME_CFG);
|
||||
D_OPTIONS(("Final path is \"%s\"\n", path));
|
||||
D_eterm_options(("Final path is \"%s\"\n", path));
|
||||
path[PATH_MAX] = 0;
|
||||
}
|
||||
} else {
|
||||
|
@ -3085,7 +3085,7 @@ save_config(char *path, unsigned char save_theme)
|
|||
if (stat(path, &fst) || !S_ISDIR(fst.st_mode) || !CAN_WRITE(fst)) {
|
||||
char *tmp = NULL;
|
||||
|
||||
D_OPTIONS(("Problem with \"%s\". S_ISDIR == %d, CAN_WRITE == %d\n", path, S_ISDIR(fst.st_mode), CAN_WRITE(fst)));
|
||||
D_eterm_options(("Problem with \"%s\". S_ISDIR == %d, CAN_WRITE == %d\n", path, S_ISDIR(fst.st_mode), CAN_WRITE(fst)));
|
||||
if (user_dir) {
|
||||
tmp = strrchr(user_dir, '/');
|
||||
if (tmp) {
|
||||
|
@ -3093,7 +3093,7 @@ save_config(char *path, unsigned char save_theme)
|
|||
}
|
||||
}
|
||||
snprintf(path, PATH_MAX, "%s/.Eterm/themes/%s", getenv("HOME"), (tmp ? tmp : "Eterm"));
|
||||
D_OPTIONS(("Trying \"%s\" instead, tmp == \"%s\"\n", path, tmp));
|
||||
D_eterm_options(("Trying \"%s\" instead, tmp == \"%s\"\n", path, tmp));
|
||||
if (tmp) {
|
||||
*(--tmp) = '/';
|
||||
}
|
||||
|
@ -3104,7 +3104,7 @@ save_config(char *path, unsigned char save_theme)
|
|||
}
|
||||
}
|
||||
strcat(path, "/" USER_CFG);
|
||||
D_OPTIONS(("Final path is \"%s\"\n", path));
|
||||
D_eterm_options(("Final path is \"%s\"\n", path));
|
||||
path[PATH_MAX] = 0;
|
||||
}
|
||||
}
|
||||
|
@ -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", ((eterm_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", (eterm_options & OPT_MAP_ALERT ? 1 : 0));
|
||||
fprintf(fp, " visual_bell %d\n", (eterm_options & OPT_VISUAL_BELL ? 1 : 0));
|
||||
fprintf(fp, " login_shell %d\n", (eterm_options & OPT_LOGIN_SHELL ? 1 : 0));
|
||||
fprintf(fp, " scrollbar %d\n", (eterm_options & OPT_SCROLLBAR ? 1 : 0));
|
||||
fprintf(fp, " utmp_logging %d\n", (eterm_options & OPT_WRITE_UTMP ? 1 : 0));
|
||||
fprintf(fp, " meta8 %d\n", (eterm_options & OPT_META8 ? 1 : 0));
|
||||
fprintf(fp, " iconic %d\n", (eterm_options & OPT_ICONIC ? 1 : 0));
|
||||
fprintf(fp, " home_on_output %d\n", (eterm_options & OPT_HOME_ON_OUTPUT ? 1 : 0));
|
||||
fprintf(fp, " home_on_input %d\n", (eterm_options & OPT_HOME_ON_INPUT ? 1 : 0));
|
||||
fprintf(fp, " no_input %d\n", (eterm_options & OPT_NO_INPUT ? 1 : 0));
|
||||
fprintf(fp, " scrollbar_floating %d\n", (eterm_options & OPT_SCROLLBAR_FLOATING ? 1 : 0));
|
||||
fprintf(fp, " scrollbar_right %d\n", (eterm_options & OPT_SCROLLBAR_RIGHT ? 1 : 0));
|
||||
fprintf(fp, " scrollbar_popup %d\n", (eterm_options & OPT_SCROLLBAR_POPUP ? 1 : 0));
|
||||
fprintf(fp, " borderless %d\n", (eterm_options & OPT_BORDERLESS ? 1 : 0));
|
||||
fprintf(fp, " double_buffer %d\n", (eterm_options & OPT_DOUBLE_BUFFER ? 1 : 0));
|
||||
fprintf(fp, " no_cursor %d\n", (eterm_options & OPT_NO_CURSOR ? 1 : 0));
|
||||
fprintf(fp, " pause %d\n", (eterm_options & OPT_PAUSE ? 1 : 0));
|
||||
fprintf(fp, " xterm_select %d\n", (eterm_options & OPT_XTERM_SELECT ? 1 : 0));
|
||||
fprintf(fp, " select_line %d\n", (eterm_options & OPT_SELECT_WHOLE_LINE ? 1 : 0));
|
||||
fprintf(fp, " select_trailing_spaces %d\n", (eterm_options & OPT_SELECT_TRAILING_SPACES ? 1 : 0));
|
||||
fprintf(fp, " report_as_keysyms %d\n", (eterm_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", (eterm_options & OPT_RESIZE_GRAVITY ? 1 : 0));
|
||||
fprintf(fp, "end toggles\n\n");
|
||||
|
||||
fprintf(fp, "begin keyboard\n");
|
||||
|
@ -3809,7 +3809,7 @@ save_config(char *path, unsigned char save_theme)
|
|||
}
|
||||
fprintf(fp, "\n");
|
||||
}
|
||||
#ifdef CUTCHAR_OPTIONS
|
||||
#ifdef CUTCHAR_eterm_options
|
||||
if (rs_cutchars) {
|
||||
fprintf(fp, " cut_chars '%s'\n", rs_cutchars);
|
||||
}
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef _OPTIONS_H_
|
||||
#define _OPTIONS_H_
|
||||
#ifndef _eterm_options_H_
|
||||
#define _eterm_options_H_
|
||||
|
||||
#include <X11/Xfuncproto.h>
|
||||
#include <X11/Intrinsic.h> /* Xlib, Xutil, Xresource, Xfuncproto */
|
||||
|
@ -81,7 +81,7 @@
|
|||
/************ Structures ************/
|
||||
|
||||
/************ Variables ************/
|
||||
extern unsigned long OPTIONS, image_toggles;
|
||||
extern unsigned long eterm_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 */
|
||||
|
@ -150,4 +150,4 @@ unsigned char save_config(char *, unsigned char);
|
|||
|
||||
_XFUNCPROTOEND
|
||||
|
||||
#endif /* _OPTIONS_H_ */
|
||||
#endif /* _eterm_options_H_ */
|
||||
|
|
42
src/pixmap.c
42
src/pixmap.c
|
@ -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) && (eterm_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) && (eterm_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) && (eterm_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) && (eterm_options & OPT_DOUBLE_BUFFER)) {
|
||||
copy_buffer_pixmap(MODE_SOLID, (unsigned long) PixColors[bgColor], width, height);
|
||||
XSetWindowBackgroundPixmap(Xdisplay, win, buffer_pixmap);
|
||||
} else {
|
||||
|
@ -1296,25 +1296,25 @@ search_path(const char *pathlist, const char *file)
|
|||
}
|
||||
getcwd(name, PATH_MAX);
|
||||
len = strlen(name);
|
||||
D_OPTIONS(("search_path(\"%s\", \"%s\") called from \"%s\".\n", pathlist, file, name));
|
||||
D_eterm_options(("search_path(\"%s\", \"%s\") called from \"%s\".\n", pathlist, file, name));
|
||||
if (len < PATH_MAX - 1) {
|
||||
strcat(name, "/");
|
||||
strncat(name, file, PATH_MAX - len - 1);
|
||||
}
|
||||
D_OPTIONS(("Checking for file \"%s\"\n", name));
|
||||
D_eterm_options(("Checking for file \"%s\"\n", name));
|
||||
if (!access(name, R_OK)) {
|
||||
if (stat(name, &fst)) {
|
||||
D_OPTIONS(("Unable to stat %s -- %s\n", name, strerror(errno)));
|
||||
D_eterm_options(("Unable to stat %s -- %s\n", name, strerror(errno)));
|
||||
} else {
|
||||
D_OPTIONS(("Stat returned mode 0x%08o, S_ISDIR() == %d\n", fst.st_mode, S_ISDIR(fst.st_mode)));
|
||||
D_eterm_options(("Stat returned mode 0x%08o, S_ISDIR() == %d\n", fst.st_mode, S_ISDIR(fst.st_mode)));
|
||||
}
|
||||
if (!S_ISDIR(fst.st_mode)) {
|
||||
return name;
|
||||
} else {
|
||||
D_OPTIONS(("%s is a directory.\n", name));
|
||||
D_eterm_options(("%s is a directory.\n", name));
|
||||
}
|
||||
} else {
|
||||
D_OPTIONS(("Unable to access %s -- %s\n", name, strerror(errno)));
|
||||
D_eterm_options(("Unable to access %s -- %s\n", name, strerror(errno)));
|
||||
}
|
||||
|
||||
if ((p = strchr(file, '@')) == NULL)
|
||||
|
@ -1327,20 +1327,20 @@ search_path(const char *pathlist, const char *file)
|
|||
/* check if we can find it now */
|
||||
strncpy(name, file, len);
|
||||
name[len] = '\0';
|
||||
D_OPTIONS(("Checking for file \"%s\"\n", name));
|
||||
D_eterm_options(("Checking for file \"%s\"\n", name));
|
||||
if (!access(name, R_OK)) {
|
||||
if (stat(name, &fst)) {
|
||||
D_OPTIONS(("Unable to stat %s -- %s\n", name, strerror(errno)));
|
||||
D_eterm_options(("Unable to stat %s -- %s\n", name, strerror(errno)));
|
||||
} else {
|
||||
D_OPTIONS(("Stat returned mode 0x%08o, S_ISDIR() == %d\n", fst.st_mode, S_ISDIR(fst.st_mode)));
|
||||
D_eterm_options(("Stat returned mode 0x%08o, S_ISDIR() == %d\n", fst.st_mode, S_ISDIR(fst.st_mode)));
|
||||
}
|
||||
if (!S_ISDIR(fst.st_mode)) {
|
||||
return name;
|
||||
} else {
|
||||
D_OPTIONS(("%s is a directory.\n", name));
|
||||
D_eterm_options(("%s is a directory.\n", name));
|
||||
}
|
||||
} else {
|
||||
D_OPTIONS(("Unable to access %s -- %s\n", name, strerror(errno)));
|
||||
D_eterm_options(("Unable to access %s -- %s\n", name, strerror(errno)));
|
||||
}
|
||||
for (path = pathlist; path != NULL && *path != '\0'; path = p) {
|
||||
int n;
|
||||
|
@ -1372,24 +1372,24 @@ search_path(const char *pathlist, const char *file)
|
|||
name[n++] = '/';
|
||||
name[n] = '\0';
|
||||
strncat(name, file, len);
|
||||
D_OPTIONS(("Checking for file \"%s\"\n", name));
|
||||
D_eterm_options(("Checking for file \"%s\"\n", name));
|
||||
if (!access(name, R_OK)) {
|
||||
if (stat(name, &fst)) {
|
||||
D_OPTIONS(("Unable to stat %s -- %s\n", name, strerror(errno)));
|
||||
D_eterm_options(("Unable to stat %s -- %s\n", name, strerror(errno)));
|
||||
} else {
|
||||
D_OPTIONS(("Stat returned mode 0x%08o, S_ISDIR() == %d\n", fst.st_mode, S_ISDIR(fst.st_mode)));
|
||||
D_eterm_options(("Stat returned mode 0x%08o, S_ISDIR() == %d\n", fst.st_mode, S_ISDIR(fst.st_mode)));
|
||||
}
|
||||
if (!S_ISDIR(fst.st_mode)) {
|
||||
return name;
|
||||
} else {
|
||||
D_OPTIONS(("%s is a directory.\n", name));
|
||||
D_eterm_options(("%s is a directory.\n", name));
|
||||
}
|
||||
} else {
|
||||
D_OPTIONS(("Unable to access %s -- %s\n", name, strerror(errno)));
|
||||
D_eterm_options(("Unable to access %s -- %s\n", name, strerror(errno)));
|
||||
}
|
||||
}
|
||||
}
|
||||
D_OPTIONS(("File \"%s\" not found in path.\n", file));
|
||||
D_eterm_options(("File \"%s\" not found in path.\n", file));
|
||||
return ((const char *) NULL);
|
||||
}
|
||||
|
||||
|
|
32
src/screen.c
32
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 (eterm_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 (eterm_options & OPT_SECONDARY_SCREEN) {
|
||||
offset = TermWin.saveLines;
|
||||
if (!screen.text || !screen.rend)
|
||||
return (current_screen);
|
||||
|
@ -1525,11 +1525,11 @@ scr_bell(void)
|
|||
{
|
||||
#ifndef NO_MAPALERT
|
||||
#ifdef MAPALERT_OPTION
|
||||
if (OPTIONS & OPT_MAP_ALERT)
|
||||
if (eterm_options & OPT_MAP_ALERT)
|
||||
#endif
|
||||
XMapWindow(Xdisplay, TermWin.parent);
|
||||
#endif
|
||||
if (OPTIONS & OPT_VISUAL_BELL) {
|
||||
if (eterm_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 (!(eterm_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 (!(eterm_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 && eterm_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 (!(eterm_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 || !(eterm_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 || !(eterm_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 && eterm_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 (!(eterm_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 || !(eterm_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 || !(eterm_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 (eterm_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() && !(eterm_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 (eterm_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 (eterm_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 (eterm_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 (eterm_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 = ((eterm_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 (eterm_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 ((eterm_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, ((eterm_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)),
|
||||
((eterm_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, ((eterm_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 (eterm_options & OPT_INSTALL) {
|
||||
cmap = XCreateColormap(Xdisplay, Xroot, Xvisual, AllocNone);
|
||||
XInstallColormap(Xdisplay, cmap);
|
||||
} else {
|
||||
|
@ -150,7 +150,7 @@ eterm_bootstrap(int argc, char *argv[])
|
|||
if ((theme_dir = conf_parse_theme(&rs_theme, THEME_CFG, PARSE_TRY_ALL)) != NULL) {
|
||||
char *tmp;
|
||||
|
||||
D_OPTIONS(("conf_parse_theme() returned \"%s\"\n", theme_dir));
|
||||
D_eterm_options(("conf_parse_theme() returned \"%s\"\n", theme_dir));
|
||||
tmp = (char *) MALLOC(strlen(theme_dir) + sizeof("ETERM_THEME_ROOT=\0"));
|
||||
sprintf(tmp, "ETERM_THEME_ROOT=%s", theme_dir);
|
||||
putenv(tmp);
|
||||
|
@ -158,7 +158,7 @@ eterm_bootstrap(int argc, char *argv[])
|
|||
if ((user_dir = conf_parse_theme(&rs_theme, (rs_config_file ? rs_config_file : USER_CFG), (PARSE_TRY_USER_THEME | PARSE_TRY_NO_THEME))) != NULL) {
|
||||
char *tmp;
|
||||
|
||||
D_OPTIONS(("conf_parse_theme() returned \"%s\"\n", user_dir));
|
||||
D_eterm_options(("conf_parse_theme() returned \"%s\"\n", user_dir));
|
||||
tmp = (char *) MALLOC(strlen(user_dir) + sizeof("ETERM_USER_ROOT=\0"));
|
||||
sprintf(tmp, "ETERM_USER_ROOT=%s", user_dir);
|
||||
putenv(tmp);
|
||||
|
@ -184,7 +184,7 @@ eterm_bootstrap(int argc, char *argv[])
|
|||
tmp[len] = '\0';
|
||||
FREE(rs_path);
|
||||
rs_path = tmp;
|
||||
D_OPTIONS(("New rs_path set to \"%s\"\n", rs_path));
|
||||
D_eterm_options(("New rs_path set to \"%s\"\n", rs_path));
|
||||
}
|
||||
#endif
|
||||
spifopt_parse(argc, argv);
|
||||
|
@ -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((eterm_options & OPT_SCROLLBAR) && !((eterm_options & OPT_SCROLLBAR_POPUP) && !TermWin.focus));
|
||||
|
||||
/* Initialize the menu subsystem. */
|
||||
menu_init();
|
||||
|
|
14
src/system.c
14
src/system.c
|
@ -47,7 +47,7 @@ wait_for_chld(int system_pid)
|
|||
{
|
||||
int pid, status = 0, save_errno = errno, code;
|
||||
|
||||
D_OPTIONS(("wait_for_chld(%ld) called.\n", system_pid));
|
||||
D_eterm_options(("wait_for_chld(%ld) called.\n", system_pid));
|
||||
|
||||
while (1) {
|
||||
do {
|
||||
|
@ -60,14 +60,14 @@ wait_for_chld(int system_pid)
|
|||
errno = save_errno;
|
||||
break;
|
||||
}
|
||||
D_OPTIONS(("%ld exited.\n", pid));
|
||||
D_eterm_options(("%ld exited.\n", pid));
|
||||
if (pid == system_pid || system_pid == -1) {
|
||||
if (WIFEXITED(status)) {
|
||||
code = WEXITSTATUS(status);
|
||||
D_OPTIONS(("Child process exited with return code %lu\n", code));
|
||||
D_eterm_options(("Child process exited with return code %lu\n", code));
|
||||
} else if (WIFSIGNALED(status)) {
|
||||
code = WTERMSIG(status);
|
||||
D_OPTIONS(("Child process was terminated by unhandled signal %lu\n", code));
|
||||
D_eterm_options(("Child process was terminated by unhandled signal %lu\n", code));
|
||||
} else {
|
||||
code = 0;
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ system_wait(char *command)
|
|||
|
||||
pid_t pid;
|
||||
|
||||
D_OPTIONS(("system_wait(%s) called.\n", command));
|
||||
D_eterm_options(("system_wait(%s) called.\n", command));
|
||||
|
||||
if (!(pid = fork())) {
|
||||
setreuid(my_ruid, my_ruid);
|
||||
|
@ -95,7 +95,7 @@ system_wait(char *command)
|
|||
print_error("execl(%s) failed -- %s\n", command, strerror(errno));
|
||||
exit(EXIT_FAILURE);
|
||||
} else {
|
||||
D_OPTIONS(("%d: fork() returned %d\n", getpid(), pid));
|
||||
D_eterm_options(("%d: fork() returned %d\n", getpid(), pid));
|
||||
return (wait_for_chld(pid));
|
||||
}
|
||||
ASSERT_NOTREACHED_RVAL(0);
|
||||
|
@ -107,7 +107,7 @@ system_no_wait(char *command)
|
|||
|
||||
pid_t pid;
|
||||
|
||||
D_OPTIONS(("system_no_wait(%s) called.\n", command));
|
||||
D_eterm_options(("system_no_wait(%s) called.\n", command));
|
||||
|
||||
if (!(pid = fork())) {
|
||||
setreuid(my_ruid, my_ruid);
|
||||
|
|
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 (eterm_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 ((eterm_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 ((eterm_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 ((eterm_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 ((eterm_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 (eterm_options & OPT_HOME_ON_OUTPUT)
|
||||
eterm_options &= ~OPT_HOME_ON_OUTPUT;
|
||||
else
|
||||
OPTIONS |= OPT_HOME_ON_OUTPUT;
|
||||
eterm_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 (eterm_options & OPT_HOME_ON_INPUT)
|
||||
eterm_options &= ~OPT_HOME_ON_INPUT;
|
||||
else
|
||||
OPTIONS |= OPT_HOME_ON_INPUT;
|
||||
eterm_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, eterm_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, eterm_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, eterm_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, eterm_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, eterm_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, eterm_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, eterm_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, eterm_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, eterm_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, eterm_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 = ((eterm_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 (eterm_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 + ((eterm_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 = ((eterm_options & OPT_NO_INPUT) ? False : True);
|
||||
wmHint.initial_state = (eterm_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 = (((eterm_options & OPT_SCROLLBAR) && !(eterm_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()) && !(eterm_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 (eterm_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 (!(eterm_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))),
|
||||
((eterm_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