diff options
Diffstat (limited to 'app/xterm/menu.c')
-rw-r--r-- | app/xterm/menu.c | 389 |
1 files changed, 203 insertions, 186 deletions
diff --git a/app/xterm/menu.c b/app/xterm/menu.c index a40d2eadf..e4fb665d0 100644 --- a/app/xterm/menu.c +++ b/app/xterm/menu.c @@ -1,51 +1,58 @@ -/* $XTermId: menu.c,v 1.254 2009/10/11 22:46:44 tom Exp $ */ +/* $XTermId: menu.c,v 1.261 2010/01/04 22:16:06 tom Exp $ */ /* - -Copyright 1999-2008,2009 by Thomas E. Dickey - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of the above listed -copyright holder(s) not be used in advertising or publicity pertaining -to distribution of the software without specific, written prior -permission. - -THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD -TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE -LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -Copyright 1989 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ + * + * Copyright 1999-2009,2010 by Thomas E. Dickey + * + * All Rights Reserved + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above copyright + * holders shall not be used in advertising or otherwise to promote the + * sale, use or other dealings in this Software without prior written + * authorization. + * + * Copyright 1989 The Open Group + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation. + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of The Open Group shall not be + * used in advertising or otherwise to promote the sale, use or other dealings + * in this Software without prior written authorization from The Open Group. + * + */ #include <xterm.h> #include <data.h> @@ -136,7 +143,6 @@ static void do_kill PROTO_XT_CALLBACK_ARGS; static void do_old_fkeys PROTO_XT_CALLBACK_ARGS; static void do_poponbell PROTO_XT_CALLBACK_ARGS; static void do_print PROTO_XT_CALLBACK_ARGS; -static void do_print_everything PROTO_XT_CALLBACK_ARGS; static void do_print_redir PROTO_XT_CALLBACK_ARGS; static void do_quit PROTO_XT_CALLBACK_ARGS; static void do_redraw PROTO_XT_CALLBACK_ARGS; @@ -165,8 +171,9 @@ static void do_activeicon PROTO_XT_CALLBACK_ARGS; #if OPT_ALLOW_XXX_OPS static void enable_allow_xxx_ops (Bool); -static void do_allowTcapOps PROTO_XT_CALLBACK_ARGS; +static void do_allowColorOps PROTO_XT_CALLBACK_ARGS; static void do_allowFontOps PROTO_XT_CALLBACK_ARGS; +static void do_allowTcapOps PROTO_XT_CALLBACK_ARGS; static void do_allowTitleOps PROTO_XT_CALLBACK_ARGS; static void do_allowWindowOps PROTO_XT_CALLBACK_ARGS; #endif @@ -375,8 +382,9 @@ MenuEntry fontMenuEntries[] = { #if OPT_ALLOW_XXX_OPS { "line3", NULL, NULL }, - { "allow-tcap-ops", do_allowTcapOps,NULL }, + { "allow-color-ops",do_allowColorOps,NULL }, { "allow-font-ops", do_allowFontOps,NULL }, + { "allow-tcap-ops", do_allowTcapOps,NULL }, { "allow-title-ops",do_allowTitleOps,NULL }, { "allow-window-ops",do_allowWindowOps,NULL }, #endif @@ -496,7 +504,7 @@ create_menu(Widget w, XtermWidget xtw, MenuIndex num) static Arg arg = {XtNcallback, (XtArgVal) cb}; - TScreen *screen = &xtw->screen; + TScreen *screen = TScreenOf(xtw); MenuHeader *data = &menu_names[num]; MenuList *list = select_menu(w, num); struct _MenuEntry *entries = data->entry_list; @@ -728,26 +736,22 @@ domenu(Widget w, #endif #if OPT_DEC_CHRSET update_font_doublesize(); - if (term->screen.cache_doublesize == 0) + if (TScreenOf(term)->cache_doublesize == 0) SetItemSensitivity( fontMenuEntries[fontMenu_font_doublesize].widget, False); #endif #if OPT_RENDERFONT update_font_renderfont(); - if (term->misc.face_name == 0) { - SetItemSensitivity( - fontMenuEntries[fontMenu_render_font].widget, - False); - } #endif #if OPT_WIDE_CHARS update_font_utf8_mode(); update_font_utf8_title(); #endif #if OPT_ALLOW_XXX_OPS - update_menu_allowTcapOps(); + update_menu_allowColorOps(); update_menu_allowFontOps(); + update_menu_allowTcapOps(); update_menu_allowTitleOps(); update_menu_allowWindowOps(); enable_allow_xxx_ops(!(screen->allowSendEvents)); @@ -763,7 +767,7 @@ domenu(Widget w, #if OPT_TEK4014 case tekMenu: if (created && tekWidget) { - set_tekfont_menu_item(tekWidget->screen.cur.fontsize, True); + set_tekfont_menu_item(TekScreenOf(tekWidget)->cur.fontsize, True); update_vtshow(); } break; @@ -942,15 +946,7 @@ do_print(Widget gw GCC_UNUSED, XtPointer closure GCC_UNUSED, XtPointer data GCC_UNUSED) { - xtermPrintScreen(term, True); -} - -static void -do_print_everything(Widget gw GCC_UNUSED, - XtPointer closure GCC_UNUSED, - XtPointer data GCC_UNUSED) -{ - xtermPrintEverything(term); + xtermPrintScreen(term, True, getPrinterFlags(term, NULL, 0)); } static void @@ -958,7 +954,7 @@ do_print_redir(Widget gw GCC_UNUSED, XtPointer closure GCC_UNUSED, XtPointer data GCC_UNUSED) { - setPrinterControlMode(term, term->screen.printer_controlmode ? 0 : 2); + setPrinterControlMode(term, TScreenOf(term)->printer_controlmode ? 0 : 2); } static void @@ -972,8 +968,8 @@ do_redraw(Widget gw GCC_UNUSED, void show_8bit_control(Bool value) { - if (term->screen.control_eight_bits != value) { - term->screen.control_eight_bits = (Boolean) value; + if (TScreenOf(term)->control_eight_bits != value) { + TScreenOf(term)->control_eight_bits = (Boolean) value; update_8bit_control(); } } @@ -983,7 +979,7 @@ do_8bit_control(Widget gw GCC_UNUSED, XtPointer closure GCC_UNUSED, XtPointer data GCC_UNUSED) { - show_8bit_control(!term->screen.control_eight_bits); + show_8bit_control(!TScreenOf(term)->control_eight_bits); } static void @@ -1010,7 +1006,7 @@ do_alt_esc(Widget gw GCC_UNUSED, XtPointer closure GCC_UNUSED, XtPointer data GCC_UNUSED) { - ToggleFlag(term->screen.alt_sends_esc); + ToggleFlag(TScreenOf(term)->alt_sends_esc); update_alt_esc(); } @@ -1019,7 +1015,7 @@ do_meta_esc(Widget gw GCC_UNUSED, XtPointer closure GCC_UNUSED, XtPointer data GCC_UNUSED) { - ToggleFlag(term->screen.meta_sends_esc); + ToggleFlag(TScreenOf(term)->meta_sends_esc); update_meta_esc(); } #endif @@ -1030,9 +1026,9 @@ do_delete_del(Widget gw GCC_UNUSED, XtPointer data GCC_UNUSED) { if (xtermDeleteIsDEL(term)) - term->screen.delete_is_del = False; + TScreenOf(term)->delete_is_del = False; else - term->screen.delete_is_del = True; + TScreenOf(term)->delete_is_del = True; update_delete_del(); } @@ -1325,7 +1321,7 @@ do_marginbell(Widget gw GCC_UNUSED, TScreen *screen = TScreenOf(term); if (!(ToggleFlag(screen->marginbell))) - screen->bellarmed = -1; + screen->bellArmed = -1; update_marginbell(); } @@ -1485,8 +1481,8 @@ do_font_doublesize(Widget gw GCC_UNUSED, XtPointer closure GCC_UNUSED, XtPointer data GCC_UNUSED) { - if (term->screen.cache_doublesize != 0) - ToggleFlag(term->screen.font_doublesize); + if (TScreenOf(term)->cache_doublesize != 0) + ToggleFlag(TScreenOf(term)->font_doublesize); update_font_doublesize(); Redraw(); } @@ -1498,7 +1494,7 @@ do_font_boxchars(Widget gw GCC_UNUSED, XtPointer closure GCC_UNUSED, XtPointer data GCC_UNUSED) { - ToggleFlag(term->screen.force_box_chars); + ToggleFlag(TScreenOf(term)->force_box_chars); update_font_boxchars(); Redraw(); } @@ -1508,9 +1504,9 @@ do_font_packed(Widget gw GCC_UNUSED, XtPointer closure GCC_UNUSED, XtPointer data GCC_UNUSED) { - ToggleFlag(term->screen.force_packed); + ToggleFlag(TScreenOf(term)->force_packed); update_font_packed(); - SetVTFont(term, term->screen.menu_font_number, True, NULL); + SetVTFont(term, TScreenOf(term)->menu_font_number, True, NULL); } #endif @@ -1533,7 +1529,7 @@ do_font_renderfont(Widget gw GCC_UNUSED, { TScreen *screen = TScreenOf(term); int fontnum = screen->menu_font_number; - String name = term->screen.MenuFontName(fontnum); + String name = TScreenOf(term)->MenuFontName(fontnum); ToggleFlag(term->misc.render_font); update_font_renderfont(); @@ -1755,6 +1751,9 @@ handle_toggle(void (*proc) PROTO_XT_CALLBACK_ARGS, #define handle_vt_toggle(proc, var, params, nparams, w) \ handle_toggle(proc, (int) (var), params, nparams, w, (XtPointer)0, (XtPointer)0) +#define HANDLE_VT_TOGGLE(name) \ + handle_vt_toggle(do_##name, TScreenOf(term)->name, params, *param_count, w) + #define handle_tek_toggle(proc, var, params, nparams, w) \ handle_toggle(proc, (int) (var), params, nparams, w, (XtPointer)0, (XtPointer)0) @@ -1764,7 +1763,7 @@ HandleAllowSends(Widget w, String * params, Cardinal *param_count) { - handle_vt_toggle(do_allowsends, term->screen.allowSendEvents, + handle_vt_toggle(do_allowsends, TScreenOf(term)->allowSendEvents, params, *param_count, w); } @@ -1774,8 +1773,7 @@ HandleSetVisualBell(Widget w, String * params, Cardinal *param_count) { - handle_vt_toggle(do_visualbell, term->screen.visualbell, - params, *param_count, w); + HANDLE_VT_TOGGLE(visualbell); } void @@ -1784,8 +1782,7 @@ HandleSetPopOnBell(Widget w, String * params, Cardinal *param_count) { - handle_vt_toggle(do_poponbell, term->screen.poponbell, - params, *param_count, w); + HANDLE_VT_TOGGLE(poponbell); } #ifdef ALLOWLOGGING @@ -1795,29 +1792,28 @@ HandleLogging(Widget w, String * params, Cardinal *param_count) { - handle_vt_toggle(do_logging, term->screen.logging, - params, *param_count, w); + HANDLE_VT_TOGGLE(logging); } #endif /* ARGSUSED */ void -HandlePrintScreen(Widget w, +HandlePrintScreen(Widget w GCC_UNUSED, XEvent * event GCC_UNUSED, String * params GCC_UNUSED, Cardinal *param_count GCC_UNUSED) { - do_print(w, (XtPointer) 0, (XtPointer) 0); + xtermPrintScreen(term, True, getPrinterFlags(term, params, param_count)); } /* ARGSUSED */ void -HandlePrintEverything(Widget w, +HandlePrintEverything(Widget w GCC_UNUSED, XEvent * event GCC_UNUSED, - String * params GCC_UNUSED, - Cardinal *param_count GCC_UNUSED) + String * params, + Cardinal *param_count) { - do_print_everything(w, (XtPointer) 0, (XtPointer) 0); + xtermPrintEverything(term, getPrinterFlags(term, params, param_count)); } /* ARGSUSED */ @@ -1901,7 +1897,7 @@ Handle8BitControl(Widget w, String * params, Cardinal *param_count) { - handle_vt_toggle(do_8bit_control, term->screen.control_eight_bits, + handle_vt_toggle(do_8bit_control, TScreenOf(term)->control_eight_bits, params, *param_count, w); } @@ -1944,7 +1940,7 @@ HandleAltEsc(Widget w, String * params, Cardinal *param_count) { - handle_vt_toggle(do_alt_esc, !term->screen.input_eight_bits, + handle_vt_toggle(do_alt_esc, !TScreenOf(term)->input_eight_bits, params, *param_count, w); } @@ -1954,7 +1950,7 @@ HandleMetaEsc(Widget w, String * params, Cardinal *param_count) { - handle_vt_toggle(do_meta_esc, term->screen.meta_sends_esc, + handle_vt_toggle(do_meta_esc, TScreenOf(term)->meta_sends_esc, params, *param_count, w); } #endif @@ -1965,7 +1961,7 @@ HandleDeleteIsDEL(Widget w, String * params, Cardinal *param_count) { - handle_vt_toggle(do_delete_del, term->screen.delete_is_del, + handle_vt_toggle(do_delete_del, TScreenOf(term)->delete_is_del, params, *param_count, w); } @@ -2021,10 +2017,10 @@ HandleScrollbar(Widget w, String * params, Cardinal *param_count) { - if (IsIcon(&(term->screen))) { + if (IsIcon(TScreenOf(term))) { Bell(XkbBI_MinorError, 0); } else { - handle_vt_toggle(do_scrollbar, term->screen.fullVwin.sb_info.width, + handle_vt_toggle(do_scrollbar, TScreenOf(term)->fullVwin.sb_info.width, params, *param_count, w); } } @@ -2035,8 +2031,7 @@ HandleJumpscroll(Widget w, String * params, Cardinal *param_count) { - handle_vt_toggle(do_jumpscroll, term->screen.jumpscroll, - params, *param_count, w); + HANDLE_VT_TOGGLE(jumpscroll); } void @@ -2045,8 +2040,7 @@ HandleKeepSelection(Widget w, String * params, Cardinal *param_count) { - handle_vt_toggle(do_keepSelection, term->screen.keepSelection, - params, *param_count, w); + HANDLE_VT_TOGGLE(keepSelection); } void @@ -2055,7 +2049,7 @@ HandleSetSelect(Widget w, String * params, Cardinal *param_count) { - handle_vt_toggle(do_selectClipboard, term->screen.selectToClipboard, + handle_vt_toggle(do_selectClipboard, TScreenOf(term)->selectToClipboard, params, *param_count, w); } @@ -2125,8 +2119,7 @@ HandleScrollKey(Widget w, String * params, Cardinal *param_count) { - handle_vt_toggle(do_scrollkey, term->screen.scrollkey, - params, *param_count, w); + HANDLE_VT_TOGGLE(scrollkey); } void @@ -2135,8 +2128,7 @@ HandleScrollTtyOutput(Widget w, String * params, Cardinal *param_count) { - handle_vt_toggle(do_scrollttyoutput, term->screen.scrollttyoutput, - params, *param_count, w); + HANDLE_VT_TOGGLE(scrollttyoutput); } void @@ -2145,7 +2137,7 @@ HandleAllow132(Widget w, String * params, Cardinal *param_count) { - handle_vt_toggle(do_allow132, term->screen.c132, + handle_vt_toggle(do_allow132, TScreenOf(term)->c132, params, *param_count, w); } @@ -2155,7 +2147,7 @@ HandleCursesEmul(Widget w, String * params, Cardinal *param_count) { - handle_vt_toggle(do_cursesemul, term->screen.curses, + handle_vt_toggle(do_cursesemul, TScreenOf(term)->curses, params, *param_count, w); } @@ -2165,8 +2157,7 @@ HandleBellIsUrgent(Widget w, String * params, Cardinal *param_count) { - handle_vt_toggle(do_bellIsUrgent, term->screen.bellIsUrgent, - params, *param_count, w); + HANDLE_VT_TOGGLE(bellIsUrgent); } void @@ -2175,8 +2166,7 @@ HandleMarginBell(Widget w, String * params, Cardinal *param_count) { - handle_vt_toggle(do_marginbell, term->screen.marginbell, - params, *param_count, w); + HANDLE_VT_TOGGLE(marginbell); } #if OPT_BLINK_CURS @@ -2187,7 +2177,7 @@ HandleCursorBlink(Widget w, Cardinal *param_count) { /* eventually want to see if sensitive or not */ - handle_vt_toggle(do_cursorblink, term->screen.cursor_blink, + handle_vt_toggle(do_cursorblink, TScreenOf(term)->cursor_blink, params, *param_count, w); } #endif @@ -2199,7 +2189,7 @@ HandleAltScreen(Widget w, Cardinal *param_count) { /* eventually want to see if sensitive or not */ - handle_vt_toggle(do_altscreen, term->screen.whichBuf, + handle_vt_toggle(do_altscreen, TScreenOf(term)->whichBuf, params, *param_count, w); } @@ -2251,8 +2241,7 @@ HandleFontDoublesize(Widget w, String * params, Cardinal *param_count) { - handle_vt_toggle(do_font_doublesize, term->screen.font_doublesize, - params, *param_count, w); + HANDLE_VT_TOGGLE(font_doublesize); } #endif @@ -2263,7 +2252,7 @@ HandleFontBoxChars(Widget w, String * params, Cardinal *param_count) { - handle_vt_toggle(do_font_boxchars, term->screen.force_box_chars, + handle_vt_toggle(do_font_boxchars, TScreenOf(term)->force_box_chars, params, *param_count, w); } @@ -2273,7 +2262,7 @@ HandleFontPacked(Widget w, String * params, Cardinal *param_count) { - handle_vt_toggle(do_font_packed, term->screen.force_packed, + handle_vt_toggle(do_font_packed, TScreenOf(term)->force_packed, params, *param_count, w); } #endif @@ -2309,7 +2298,7 @@ HandleUTF8Mode(Widget w, String * params, Cardinal *param_count) { - handle_vt_toggle(do_font_utf8_mode, term->screen.utf8_mode, + handle_vt_toggle(do_font_utf8_mode, TScreenOf(term)->utf8_mode, params, *param_count, w); } @@ -2319,7 +2308,7 @@ HandleUTF8Title(Widget w, String * params, Cardinal *param_count) { - handle_vt_toggle(do_font_utf8_title, term->screen.utf8_title, + handle_vt_toggle(do_font_utf8_title, TScreenOf(term)->utf8_title, params, *param_count, w); } #endif @@ -2361,7 +2350,7 @@ HandleVisibility(Widget w, switch (params[0][0]) { case 'v': case 'V': - handle_tek_toggle(do_vtonoff, (int) term->screen.Vshow, + handle_tek_toggle(do_vtonoff, (int) TScreenOf(term)->Vshow, params + 1, (*param_count) - 1, w); break; case 't': @@ -2459,7 +2448,7 @@ UpdateMenuItem( if (mi) { menuArgs.value = (XtArgVal) ((val) - ? term->screen.menu_item_bitmap + ? TScreenOf(term)->menu_item_bitmap : None); XtSetValues(mi, &menuArgs, (Cardinal) 1); } @@ -2659,7 +2648,7 @@ InitWidgetMenu(Widget shell) { Bool result = False; - TRACE(("InitWidgetMenu(%p)\n", shell)); + TRACE(("InitWidgetMenu(%p)\n", (void *) shell)); if (term != 0) { if (shell == toplevel) { /* vt100 */ if (!term->init_menu) { @@ -2697,7 +2686,7 @@ toolbar_info(Widget w) #else (void) w; #endif - return &(WhichVWin(&(term->screen))->tb_info); + return &(WhichVWin(TScreenOf(term))->tb_info); } static void @@ -2757,7 +2746,7 @@ ShowToolbar(Bool enable) { TRACE(("ShowToolbar(%d)\n", enable)); - if (IsIcon(&(term->screen))) { + if (IsIcon(TScreenOf(term))) { Bell(XkbBI_MinorError, 0); } else { if (enable) { @@ -2784,7 +2773,7 @@ HandleToolbar(Widget w, String * params GCC_UNUSED, Cardinal *param_count GCC_UNUSED) { - if (IsIcon(&(term->screen))) { + if (IsIcon(TScreenOf(term))) { Bell(XkbBI_MinorError, 0); } else { handle_vt_toggle(do_toolbar, resource.toolBar, @@ -2803,7 +2792,7 @@ do_toolbar(Widget gw GCC_UNUSED, * menu which contains the checkbox indicating whether the toolbar is * active. */ - if (IsIcon(&(term->screen))) { + if (IsIcon(TScreenOf(term))) { Bell(XkbBI_MinorError, 0); } else { ShowToolbar(ToggleFlag(resource.toolBar)); @@ -2826,7 +2815,7 @@ update_securekbd(void) UpdateCheckbox("update_securekbd", mainMenuEntries, mainMenu_securekbd, - term->screen.grabbedKbd); + TScreenOf(term)->grabbedKbd); } void @@ -2835,7 +2824,7 @@ update_allowsends(void) UpdateCheckbox("update_allowsends", mainMenuEntries, mainMenu_allowsends, - term->screen.allowSendEvents); + TScreenOf(term)->allowSendEvents); } #ifdef ALLOWLOGGING @@ -2845,7 +2834,7 @@ update_logging(void) UpdateCheckbox("update_logging", mainMenuEntries, mainMenu_logging, - term->screen.logging); + TScreenOf(term)->logging); } #endif @@ -2855,7 +2844,7 @@ update_print_redir(void) UpdateCheckbox("update_print_redir", mainMenuEntries, mainMenu_print_redir, - term->screen.printer_controlmode); + TScreenOf(term)->printer_controlmode); } void @@ -2864,7 +2853,7 @@ update_8bit_control(void) UpdateCheckbox("update_8bit_control", mainMenuEntries, mainMenu_8bit_ctrl, - term->screen.control_eight_bits); + TScreenOf(term)->control_eight_bits); } void @@ -2892,7 +2881,7 @@ update_alt_esc(void) UpdateCheckbox("update_alt_esc", mainMenuEntries, mainMenu_alt_esc, - term->screen.alt_sends_esc); + TScreenOf(term)->alt_sends_esc); } void @@ -2901,7 +2890,7 @@ update_meta_esc(void) UpdateCheckbox("update_meta_esc", mainMenuEntries, mainMenu_meta_esc, - term->screen.meta_sends_esc); + TScreenOf(term)->meta_sends_esc); } #endif @@ -2993,7 +2982,7 @@ update_jumpscroll(void) UpdateCheckbox("update_jumpscroll", vtMenuEntries, vtMenu_jumpscroll, - term->screen.jumpscroll); + TScreenOf(term)->jumpscroll); } void @@ -3056,7 +3045,7 @@ update_scrollkey(void) UpdateCheckbox("update_scrollkey", vtMenuEntries, vtMenu_scrollkey, - term->screen.scrollkey); + TScreenOf(term)->scrollkey); } void @@ -3065,7 +3054,7 @@ update_scrollttyoutput(void) UpdateCheckbox("update_scrollttyoutput", vtMenuEntries, vtMenu_scrollttyoutput, - term->screen.scrollttyoutput); + TScreenOf(term)->scrollttyoutput); } void @@ -3074,7 +3063,7 @@ update_keepSelection(void) UpdateCheckbox("update_keepSelection", vtMenuEntries, vtMenu_keepSelection, - term->screen.keepSelection); + TScreenOf(term)->keepSelection); } void @@ -3083,7 +3072,7 @@ update_selectToClipboard(void) UpdateCheckbox("update_selectToClipboard", vtMenuEntries, vtMenu_selectToClipboard, - term->screen.selectToClipboard); + TScreenOf(term)->selectToClipboard); } void @@ -3092,7 +3081,7 @@ update_allow132(void) UpdateCheckbox("update_allow132", vtMenuEntries, vtMenu_allow132, - term->screen.c132); + TScreenOf(term)->c132); } void @@ -3100,7 +3089,7 @@ update_cursesemul(void) { #if 0 /* 2006-2-12: no longer menu entry */ UpdateMenuItem("update_cursesemul", vtMenuEntries, vtMenu_cursesemul, - term->screen.curses); + TScreenOf(term)->curses); #endif } @@ -3110,7 +3099,7 @@ update_visualbell(void) UpdateCheckbox("update_visualbell", vtMenuEntries, vtMenu_visualbell, - term->screen.visualbell); + TScreenOf(term)->visualbell); } void @@ -3119,7 +3108,7 @@ update_bellIsUrgent(void) UpdateCheckbox("update_bellIsUrgent", vtMenuEntries, vtMenu_bellIsUrgent, - term->screen.bellIsUrgent); + TScreenOf(term)->bellIsUrgent); } void @@ -3128,7 +3117,7 @@ update_poponbell(void) UpdateCheckbox("update_poponbell", vtMenuEntries, vtMenu_poponbell, - term->screen.poponbell); + TScreenOf(term)->poponbell); } #ifndef update_marginbell /* 2007-3-7: no longer menu entry */ @@ -3138,7 +3127,7 @@ update_marginbell(void) UpdateCheckbox("update_marginbell", vtMenuEntries, vtMenu_marginbell, - term->screen.marginbell); + TScreenOf(term)->marginbell); } #endif @@ -3149,7 +3138,7 @@ update_cursorblink(void) UpdateCheckbox("update_cursorblink", vtMenuEntries, vtMenu_cursorblink, - term->screen.cursor_blink); + TScreenOf(term)->cursor_blink); } #endif @@ -3159,7 +3148,7 @@ update_altscreen(void) UpdateCheckbox("update_altscreen", vtMenuEntries, vtMenu_altscreen, - term->screen.whichBuf); + TScreenOf(term)->whichBuf); } void @@ -3189,7 +3178,7 @@ update_font_doublesize(void) UpdateCheckbox("update_font_doublesize", fontMenuEntries, fontMenu_font_doublesize, - term->screen.font_doublesize); + TScreenOf(term)->font_doublesize); } #endif @@ -3200,7 +3189,7 @@ update_font_boxchars(void) UpdateCheckbox("update_font_boxchars", fontMenuEntries, fontMenu_font_boxchars, - term->screen.force_box_chars); + TScreenOf(term)->force_box_chars); } void @@ -3209,7 +3198,7 @@ update_font_packed(void) UpdateCheckbox("update_font_packed", fontMenuEntries, fontMenu_font_packedfont, - term->screen.force_packed); + TScreenOf(term)->force_packed); } #endif @@ -3232,6 +3221,8 @@ update_font_renderfont(void) fontMenuEntries, fontMenu_render_font, term->misc.render_font); + SetItemSensitivity(fontMenuEntries[fontMenu_render_font].widget, + !IsEmpty(term->misc.face_name)); } #endif @@ -3239,8 +3230,8 @@ update_font_renderfont(void) void update_font_utf8_mode(void) { - Bool active = (term->screen.utf8_mode != uAlways); - Bool enable = (term->screen.utf8_mode != uFalse); + Bool active = (TScreenOf(term)->utf8_mode != uAlways); + Bool enable = (TScreenOf(term)->utf8_mode != uFalse); TRACE(("update_font_utf8_mode active %d, enable %d\n", active, enable)); SetItemSensitivity(fontMenuEntries[fontMenu_wide_chars].widget, active); @@ -3253,8 +3244,8 @@ update_font_utf8_mode(void) void update_font_utf8_title(void) { - Bool active = (term->screen.utf8_mode != uFalse); - Bool enable = (term->screen.utf8_title); + Bool active = (TScreenOf(term)->utf8_mode != uFalse); + Bool enable = (TScreenOf(term)->utf8_title); TRACE(("update_font_utf8_title active %d, enable %d\n", active, enable)); SetItemSensitivity(fontMenuEntries[fontMenu_wide_title].widget, active); @@ -3276,13 +3267,25 @@ enable_allow_xxx_ops(Bool enable) } static void +do_allowColorOps(Widget w, + XtPointer closure GCC_UNUSED, + XtPointer data GCC_UNUSED) +{ + XtermWidget xw = getXtermWidget(w); + if (xw != 0) { + ToggleFlag(TScreenOf(xw)->allowColorOps); + update_menu_allowColorOps(); + } +} + +static void do_allowFontOps(Widget w, XtPointer closure GCC_UNUSED, XtPointer data GCC_UNUSED) { XtermWidget xw = getXtermWidget(w); if (xw != 0) { - ToggleFlag(xw->screen.allowFontOps); + ToggleFlag(TScreenOf(xw)->allowFontOps); update_menu_allowFontOps(); } } @@ -3294,7 +3297,7 @@ do_allowTcapOps(Widget w, { XtermWidget xw = getXtermWidget(w); if (xw != 0) { - ToggleFlag(xw->screen.allowTcapOps); + ToggleFlag(TScreenOf(xw)->allowTcapOps); update_menu_allowTcapOps(); } } @@ -3306,7 +3309,7 @@ do_allowTitleOps(Widget w, { XtermWidget xw = getXtermWidget(w); if (xw != 0) { - ToggleFlag(xw->screen.allowTitleOps); + ToggleFlag(TScreenOf(xw)->allowTitleOps); update_menu_allowTitleOps(); } } @@ -3318,19 +3321,27 @@ do_allowWindowOps(Widget w, { XtermWidget xw = getXtermWidget(w); if (xw != 0) { - ToggleFlag(xw->screen.allowWindowOps); + ToggleFlag(TScreenOf(xw)->allowWindowOps); update_menu_allowWindowOps(); } } void +HandleAllowColorOps(Widget w, + XEvent * event GCC_UNUSED, + String * params, + Cardinal *param_count) +{ + HANDLE_VT_TOGGLE(allowColorOps); +} + +void HandleAllowFontOps(Widget w, XEvent * event GCC_UNUSED, String * params, Cardinal *param_count) { - handle_vt_toggle(do_allowFontOps, term->screen.allowFontOps, - params, *param_count, w); + HANDLE_VT_TOGGLE(allowFontOps); } void @@ -3339,8 +3350,7 @@ HandleAllowTcapOps(Widget w, String * params, Cardinal *param_count) { - handle_vt_toggle(do_allowTcapOps, term->screen.allowTcapOps, - params, *param_count, w); + HANDLE_VT_TOGGLE(allowTcapOps); } void @@ -3349,8 +3359,7 @@ HandleAllowTitleOps(Widget w, String * params, Cardinal *param_count) { - handle_vt_toggle(do_allowTitleOps, term->screen.allowTitleOps, - params, *param_count, w); + HANDLE_VT_TOGGLE(allowTitleOps); } void @@ -3359,17 +3368,16 @@ HandleAllowWindowOps(Widget w, String * params, Cardinal *param_count) { - handle_vt_toggle(do_allowWindowOps, term->screen.allowWindowOps, - params, *param_count, w); + HANDLE_VT_TOGGLE(allowWindowOps); } void -update_menu_allowTcapOps(void) +update_menu_allowColorOps(void) { - UpdateCheckbox("update_menu_allowTcapOps", + UpdateCheckbox("update_menu_allowColorOps", fontMenuEntries, - fontMenu_allowTcapOps, - term->screen.allowTcapOps); + fontMenu_allowColorOps, + TScreenOf(term)->allowColorOps); } void @@ -3378,7 +3386,16 @@ update_menu_allowFontOps(void) UpdateCheckbox("update_menu_allowFontOps", fontMenuEntries, fontMenu_allowFontOps, - term->screen.allowFontOps); + TScreenOf(term)->allowFontOps); +} + +void +update_menu_allowTcapOps(void) +{ + UpdateCheckbox("update_menu_allowTcapOps", + fontMenuEntries, + fontMenu_allowTcapOps, + TScreenOf(term)->allowTcapOps); } void @@ -3387,7 +3404,7 @@ update_menu_allowTitleOps(void) UpdateCheckbox("update_menu_allowTitleOps", fontMenuEntries, fontMenu_allowTitleOps, - term->screen.allowTitleOps); + TScreenOf(term)->allowTitleOps); } void @@ -3396,7 +3413,7 @@ update_menu_allowWindowOps(void) UpdateCheckbox("update_menu_allowWindowOps", fontMenuEntries, fontMenu_allowWindowOps, - term->screen.allowWindowOps); + TScreenOf(term)->allowWindowOps); } #endif @@ -3404,7 +3421,7 @@ update_menu_allowWindowOps(void) void update_tekshow(void) { - if (!(term->screen.inhibit & I_TEK)) { + if (!(TScreenOf(term)->inhibit & I_TEK)) { UpdateCheckbox("update_tekshow", vtMenuEntries, vtMenu_tekshow, @@ -3415,7 +3432,7 @@ update_tekshow(void) void update_vttekmode(void) { - if (!(term->screen.inhibit & I_TEK)) { + if (!(TScreenOf(term)->inhibit & I_TEK)) { UpdateCheckbox("update_vtmode", vtMenuEntries, vtMenu_tekmode, @@ -3430,18 +3447,18 @@ update_vttekmode(void) void update_vtshow(void) { - if (!(term->screen.inhibit & I_TEK)) { + if (!(TScreenOf(term)->inhibit & I_TEK)) { UpdateCheckbox("update_vtshow", tekMenuEntries, tekMenu_vtshow, - term->screen.Vshow); + TScreenOf(term)->Vshow); } } void set_vthide_sensitivity(void) { - if (!(term->screen.inhibit & I_TEK)) { + if (!(TScreenOf(term)->inhibit & I_TEK)) { SetItemSensitivity( vtMenuEntries[vtMenu_vthide].widget, TEK4014_SHOWN(term)); @@ -3451,17 +3468,17 @@ set_vthide_sensitivity(void) void set_tekhide_sensitivity(void) { - if (!(term->screen.inhibit & I_TEK)) { + if (!(TScreenOf(term)->inhibit & I_TEK)) { SetItemSensitivity( tekMenuEntries[tekMenu_tekhide].widget, - term->screen.Vshow); + TScreenOf(term)->Vshow); } } void set_tekfont_menu_item(int n, int val) { - if (!(term->screen.inhibit & I_TEK)) { + if (!(TScreenOf(term)->inhibit & I_TEK)) { UpdateCheckbox("set_tekfont_menu_item", tekMenuEntries, FS2MI(n), (val)); } @@ -3473,6 +3490,6 @@ set_menu_font(int val) { UpdateCheckbox("set_menu_font", fontMenuEntries, - term->screen.menu_font_number, + TScreenOf(term)->menu_font_number, (val)); } |