⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lyoptions.c

📁 基于rtos开发的浏览器!
💻 C
📖 第 1 页 / 共 5 页
字号:
	    case 'V':		/*		 *  Copy strings into choice array.		 */		choices[0] = NULL;		StrAllocCopy(choices[0], "OFF");		choices[1] = NULL;		StrAllocCopy(choices[1], "ON ");		choices[2] = NULL;		vi_keys = boolean_choice(vi_keys,					 L_Bool_A, C_VIKEYS,					 choices);		if (vi_keys) {		    set_vi_keys();		} else {		    reset_vi_keys();		}		FREE(choices[0]);		FREE(choices[1]);		response = ' ';		break;	    case 'M':	/* Change emacs keys setting. */	    case 'm':		/*		 *  Copy strings into choice array.		 */		choices[0] = NULL;		StrAllocCopy(choices[0], "OFF");		choices[1] = NULL;		StrAllocCopy(choices[1], "ON ");		choices[2] = NULL;		emacs_keys = boolean_choice(emacs_keys,					    L_Bool_A, C_EMACSKEYS,					    choices);		if (emacs_keys) {		    set_emacs_keys();		} else {		    reset_emacs_keys();		}		FREE(choices[0]);		FREE(choices[1]);		response = ' ';		break;	    case 'W':	/* Change show dotfiles setting. */	    case 'w':		if (no_dotfiles) {		    option_statusline(DOTFILE_ACCESS_DISABLED);		} else {		    /*		     *	Copy strings into choice array.		     */		    choices[0] = NULL;		    StrAllocCopy(choices[0], "OFF");		    choices[1] = NULL;		    StrAllocCopy(choices[1], "ON ");		    choices[2] = NULL;		    show_dotfiles = boolean_choice(show_dotfiles,						   L_Bool_A,						   C_SHOW_DOTFILES,						   choices);		    FREE(choices[0]);		    FREE(choices[1]);		}		response = ' ';		break;	    case 't':	/* Change select popups setting. */	    case 'T':		/*		 *  Copy strings into choice array.		 */		choices[0] = NULL;		StrAllocCopy(choices[0], "OFF");		choices[1] = NULL;		StrAllocCopy(choices[1], "ON ");		choices[2] = NULL;		LYSelectPopups = boolean_choice(LYSelectPopups,						L_Bool_B,						C_SELECT_POPUPS,						choices);		FREE(choices[0]);		FREE(choices[1]);		response = ' ';		break;#if defined(USE_SLANG) || defined(COLOR_CURSES)	    case '&':	/* Change show color setting. */		if (no_option_save) {#if defined(COLOR_CURSES)		    if (!has_colors()) {			char * terminal = getenv("TERM");			if (terminal)			    option_user_message(				COLOR_TOGGLE_DISABLED_FOR_TERM,				terminal);			else			    option_statusline(COLOR_TOGGLE_DISABLED);			sleep(AlertSecs);		    }#endif		/*		 *  Copy strings into choice array.		 */		    choices[0] = NULL;		    StrAllocCopy(choices[0], "OFF");		    choices[1] = NULL;		    StrAllocCopy(choices[1], "ON ");		    choices[2] = NULL;		    LYShowColor = boolean_choice((LYShowColor - 1),						 L_Color,						 C_COLOR,						 choices);		    if (LYShowColor == 0) {			LYShowColor = SHOW_COLOR_OFF;		    } else {			LYShowColor = SHOW_COLOR_ON;		    }		} else {		/* !no_option_save */		    BOOLEAN again = FALSE;		    int chosen;		/*		 *  Copy strings into choice array.		 */		    choices[0] = NULL;		    StrAllocCopy(choices[0], "NEVER     ");		    choices[1] = NULL;		    StrAllocCopy(choices[1], "OFF       ");		    choices[2] = NULL;		    StrAllocCopy(choices[2], "ON        ");		    choices[3] = NULL;#if defined(COLOR_CURSES)		    if (!has_colors())			StrAllocCopy(choices[3], "Always try");		    else#endif			StrAllocCopy(choices[3], "ALWAYS    ");		    choices[4] = NULL;		    do {			if (!LYSelectPopups) {			    chosen = boolean_choice(LYChosenShowColor,						    L_Color,						    C_COLOR,						    choices);			} else {			    chosen = popup_choice(LYChosenShowColor,						  L_Color,						  C_COLOR,						  choices, 4, FALSE);			}#if defined(COLOR_CURSES)			again = (chosen == 2 && !has_colors());			if (again) {			    char * terminal = getenv("TERM");			    if (terminal)				option_user_message(				    COLOR_TOGGLE_DISABLED_FOR_TERM,				    terminal);			    else				option_statusline(COLOR_TOGGLE_DISABLED);			    sleep(AlertSecs);			}#endif		    } while (again);		    LYChosenShowColor = chosen;#if defined(VMS)		    if (LYSelectPopups) {			move(L_Color, C_COLOR);			clrtoeol();			addstr(choices[LYChosenShowColor]);		    }#endif /* VMS */#if defined(COLOR_CURSES)		    if (has_colors())#endif			LYShowColor = chosen;		    FREE(choices[2]);		    FREE(choices[3]);		}		FREE(choices[0]);		FREE(choices[1]);		if (CurrentShowColor != LYShowColor) {		    lynx_force_repaint();		}		CurrentShowColor = LYShowColor;#ifdef USE_SLANG		SLtt_Use_Ansi_Colors = (LYShowColor > 1 ? 1 : 0);#endif		response = ' ';		if (LYSelectPopups && !no_option_save) {#if !defined(VMS) || defined(USE_SLANG)		    if (term_options) {			term_options = FALSE;		    } else {			AddValueAccepted = TRUE;		    }		    goto draw_options;#else		    term_options = FALSE;#endif /* !VMS || USE_SLANG */		}		break;#endif /* USE_SLANG or COLOR_CURSES */	    case '@':	/* Change show cursor setting. */		/*		 *  Copy strings into choice array.		 */		choices[0] = NULL;		StrAllocCopy(choices[0], "OFF");		choices[1] = NULL;		StrAllocCopy(choices[1], "ON ");		choices[2] = NULL;		LYShowCursor = boolean_choice(LYShowCursor,					      L_Bool_B,					      C_SHOW_CURSOR,					      choices);		FREE(choices[0]);		FREE(choices[1]);		response = ' ';		break;	    case 'k':	/* Change keypad mode. */	    case 'K':		/*		 *  Copy strings into choice array.		 */		choices[0] = NULL;		StrAllocCopy(choices[0],			     "Numbers act as arrows             ");		choices[1] = NULL;		StrAllocCopy(choices[1],			     "Links are numbered                ");		choices[2] = NULL;		StrAllocCopy(choices[2],			     "Links and form fields are numbered");		choices[3] = NULL;		if (!LYSelectPopups) {		    keypad_mode = boolean_choice(keypad_mode,						 L_Keypad, -1,						 choices);		} else {		    keypad_mode = popup_choice(keypad_mode,					       L_Keypad, -1,					       choices,					       3, FALSE);#if defined(VMS) || defined(USE_SLANG)		    move(L_Keypad, COL_OPTION_VALUES);		    clrtoeol();		    addstr(choices[keypad_mode]);#endif /* VMS || USE_SLANG */		}		if (keypad_mode == NUMBERS_AS_ARROWS) {		    set_numbers_as_arrows();		} else {		    reset_numbers_as_arrows();		}		FREE(choices[0]);		FREE(choices[1]);		FREE(choices[2]);		response = ' ';		if (LYSelectPopups) {#if !defined(VMS) || defined(USE_SLANG)		    if (term_options) {			term_options = FALSE;		    } else {			AddValueAccepted = TRUE;		    }		    goto draw_options;#else		    term_options = FALSE;#endif /* !VMS || USE_SLANG */		}		break;	    case 'n':	/* Change line editor key bindings. */	    case 'N':		if (!LYSelectPopups) {		    current_lineedit = boolean_choice(current_lineedit,						      L_Lineed, -1,						      LYLineeditNames);		} else {		    current_lineedit = popup_choice(current_lineedit,						    L_Lineed, -1,						    LYLineeditNames,						    0, FALSE);#if defined(VMS) || defined(USE_SLANG)		    move(L_Lineed, COL_OPTION_VALUES);		    clrtoeol();		    addstr(LYLineeditNames[current_lineedit]);#endif /* VMS || USE_SLANG */		}		response = ' ';		if (LYSelectPopups) {#if !defined(VMS) || defined(USE_SLANG)		    if (term_options) {			term_options = FALSE;		    } else {			AddValueAccepted = TRUE;		    }		    goto draw_options;#else		    term_options = FALSE;#endif /* !VMS || USE_SLANG */		}		break;#ifdef DIRED_SUPPORT	    case 'i':	/* Change local directory sorting. */	    case 'I':		/*		 *  Copy strings into choice array.		 */		choices[0] = NULL;		StrAllocCopy(choices[0], "Directories first");		choices[1] = NULL;		StrAllocCopy(choices[1], "Files first      ");		choices[2] = NULL;		StrAllocCopy(choices[2], "Mixed style      ");		choices[3] = NULL;		if (!LYSelectPopups) {		    dir_list_style = boolean_choice(dir_list_style,						    L_Dired, -1,						    choices);		} else {		    dir_list_style = popup_choice(dir_list_style,						  L_Dired, -1,						  choices,						  3, FALSE);#if defined(VMS) || defined(USE_SLANG)		    move(L_Dired, COL_OPTION_VALUES);		    clrtoeol();		    addstr(choices[dir_list_style]);#endif /* VMS || USE_SLANG */		}		FREE(choices[0]);		FREE(choices[1]);		FREE(choices[2]);		response = ' ';		if (LYSelectPopups) {#if !defined(VMS) || defined(USE_SLANG)		    if (term_options) {			term_options = FALSE;		    } else {			AddValueAccepted = TRUE;		    }		    goto draw_options;#else		    term_options = FALSE;#endif /* !VMS || USE_SLANG */		}		break;#endif /* DIRED_SUPPORT */	    case 'u':	/* Change user mode. */	    case 'U':		/*		 *  Copy strings into choice array.		 */		choices[0] = NULL;		StrAllocCopy(choices[0], "Novice      ");		choices[1] = NULL;		StrAllocCopy(choices[1], "Intermediate");		choices[2] = NULL;		StrAllocCopy(choices[2], "Advanced    ");		choices[3] = NULL;		if (!LYSelectPopups) {		    user_mode = boolean_choice(user_mode,					       L_User_Mode, -1,					       choices);		    use_assume_charset = (user_mode >= 2);		} else {		    user_mode = popup_choice(user_mode,					     L_User_Mode, -1,					     choices,					     3, FALSE);		    use_assume_charset = (user_mode >= 2);#if defined(VMS) || defined(USE_SLANG)		    if (use_assume_charset == old_use_assume_charset) {			move(L_User_Mode, COL_OPTION_VALUES);			clrtoeol();			addstr(choices[user_mode]);		    }#endif /* VMS || USE_SLANG */		}		FREE(choices[0]);		FREE(choices[1]);		FREE(choices[2]);		if (user_mode == NOVICE_MODE) {		    display_lines = (LYlines - 4);		} else {		    display_lines = LYlines-2;		}		response = ' ';		if (LYSelectPopups) {#if !defined(VMS) || defined(USE_SLANG)		    if (term_options) {			term_options = FALSE;		    } else {			AddValueAccepted = TRUE;		    }		    goto draw_options;#else		    term_options = FALSE;		    if (use_assume_charset != old_use_assume_charset)			goto draw_options;#endif /* !VMS || USE_SLANG */		}		break;	    case 'a':	/* Change user agent string. */	    case 'A':		if (!no_useragent) {		    if (LYUserAgent && *LYUserAgent) {			strcpy(display_option, LYUserAgent);		    } else {  /* clear the NONE */			move(L_HOME, COL_OPTION_VALUES);			addstr("    ");			*display_option = '\0';		    }		    option_statusline(ACCEPT_DATA_OR_DEFAULT);		    move(L_User_Agent, COL_OPTION_VALUES);		    start_bold();		    ch = LYgetstr(display_option, VISIBLE,				  sizeof(display_option), NORECALL);		    stop_bold();		    move(L_User_Agent, COL_OPTION_VALUES);		    if (term_options || ch == -1) {			addstr((LYUserAgent &&				*LYUserAgent) ?				  LYUserAgent : "NONE");		    } else if (*display_option == '\0') {			StrAllocCopy(LYUserAgent, LYUserAgentDefault);			addstr((LYUserAgent &&				*LYUserAgent) ?				  LYUserAgent : "NONE");		    } else {			StrAllocCopy(LYUserAgent, display_option);			addstr(display_option);		    }		    clrtoeol();		    if (ch == -1) {			option_statusline(CANCELLED);			sleep(InfoSecs);			option_statusline("");		    } else if (LYUserAgent && *LYUserAgent &&			!strstr(LYUserAgent, "Lynx") &&			!strstr(LYUserAgent, "lynx")) {			option_statusline(UA_COPYRIGHT_WARNING);		    } else {			option_statusline(VALUE_ACCEPTED);		    }		} else { /* disallowed */		    option_statusline(UA_COPYRIGHT_WARNING);		}		response = ' ';		break;#ifdef ALLOW_USERS_TO_CHANGE_EXEC_WITHIN_OPTIONS	    case 'x':	/* Change local exec restriction. */	    case 'X':		if (exec_frozen && !LYSelectPopups) {		    option_statusline(CHANGE_OF_SETTING_DISALLOWED);		    response = ' ';		    break;		}#ifndef NEVER_ALLOW_REMOTE_EXEC		if (local_exec) {		    itmp = 2;		} else#endif /* !NEVER_ALLOW_REMOTE_EXEC */		{		    if (local_exec_on_local_files) {			itmp= 1;		    } else {			itmp = 0;		    }		}		/*		 *  Copy strings into choice array.		 */		choices[0] = NULL;		StrAllocCopy(choices[0], "ALWAYS OFF          ");		choices[1] = NULL;		StrAllocCopy(choices[1], "FOR LOCAL FILES ONLY");		choices[2] = NULL;#ifndef NEVER_ALLOW_REMOTE_EXEC		StrAllocCopy(choices[2], "ALWAYS ON           ");		choices[3] = NULL;#endif /* !NEVER_ALLOW_REMOTE_EXEC */		if (!LYSelectPopups) {		    itmp = boolean_choice(itmp,					  L_Exec, -1,					  choices);		} else {		    itmp = popup_choice(itmp,					L_Exec, -1,					choices,					0, (exec_frozen ? TRUE : FALSE));#if defined(VMS) || defined(USE_SLANG)		    move(L_Exec, COL_OPTION_VALUES);		    clrtoeol();		    addstr(choices[itmp]);#endif /* VMS || USE_SLANG */		}		FREE(choices[0]);		FREE(choices[1]);#ifndef NEVER_ALLOW_REMOTE_EXEC		FREE(choices[2]);#endif /* !NEVER_ALLOW_REMOTE_EXEC */		if (!exec_frozen) {		    switch (itmp) {			case 0:

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -