示例#1
0
文件: term.c 项目: FabrizioFabbe/silc
static void read_settings(void)
{
        const char *str;
	int old_colors = term_use_colors;
        int old_type = term_type;

        term_auto_detach(settings_get_bool("term_auto_detach"));

        /* set terminal type */
	str = settings_get_str("term_charset");
	if (g_strcasecmp(str, "utf-8") == 0)
		term_type = TERM_TYPE_UTF8;
	else if (g_strcasecmp(str, "big5") == 0)
		term_type = TERM_TYPE_BIG5;
	else
		term_type = TERM_TYPE_8BIT;

	if (old_type != term_type)
                term_set_input_type(term_type);

        /* change color stuff */
	if (force_colors != settings_get_bool("term_force_colors")) {
		force_colors = settings_get_bool("term_force_colors");
		term_force_colors(force_colors);
	}

	term_use_colors = settings_get_bool("colors") &&
		(force_colors || term_has_colors());

	if (term_use_colors != old_colors)
		irssi_redraw();
}
示例#2
0
static gboolean do_redraw(gpointer unused)
{
	terminfo_cont(current_term);
	irssi_redraw();

        return 1;
}
示例#3
0
文件: FiSH.c 项目: kelek-/FiSH-irssi
void prompt_for_password(char *a_output)
{
	char *password = getpass(" --> Please enter your blow.ini password: ");

	strcpy(a_output, password);
	ZeroMemory(password, strlen(password));
	irssi_redraw();		// getpass() screws irssi GUI, lets redraw!
}
示例#4
0
static int redraw_timeout(void)
{
	if (redraw_needed) {
		irssi_redraw();
                redraw_needed = FALSE;
	}

        return 1;
}
示例#5
0
void mainwindows_resize(int ychange, int xchange)
{
	screen_refresh_freeze();
	if (ychange < 0)
		mainwindows_resize_smaller(ychange, xchange);
	else if (ychange > 0)
		mainwindows_resize_bigger(ychange, xchange);
	else if (xchange != 0)
		mainwindows_resize_horiz(xchange);

	irssi_redraw();
	screen_refresh_thaw();
}
示例#6
0
void mainwindows_resize(int width, int height)
{
	int xdiff, ydiff;

	xdiff = width-old_screen_width;
	ydiff = height-old_screen_height;
        old_screen_width = width;
        old_screen_height = height;

	if (ydiff < 0)
		mainwindows_resize_smaller(xdiff, ydiff);
	else if (ydiff > 0)
		mainwindows_resize_bigger(xdiff, ydiff);
        else if (xdiff != 0)
		mainwindows_resize_horiz(xdiff);

        signal_emit("terminal resized", 0);

	irssi_redraw();
}
示例#7
0
文件: term.c 项目: ailin-nemui/irssi
static void read_settings(void)
{
        const char *str;
	int old_colors = term_use_colors;
	int old_colors24 = term_use_colors24;
        int old_type = term_type;

        /* set terminal type */
	str = settings_get_str("term_charset");
	if (g_ascii_strcasecmp(str, "utf-8") == 0)
		term_type = TERM_TYPE_UTF8;
	else if (g_ascii_strcasecmp(str, "big5") == 0)
		term_type = TERM_TYPE_BIG5;
	else
		term_type = TERM_TYPE_8BIT;

	if (old_type != term_type)
                term_set_input_type(term_type);

        /* change color stuff */
	if (force_colors != settings_get_bool("term_force_colors")) {
		force_colors = settings_get_bool("term_force_colors");
		term_force_colors(force_colors);
	}

	term_use_colors = settings_get_bool("colors") &&
		(force_colors || term_has_colors());

#ifdef TERM_TRUECOLOR
	term_use_colors24 = settings_get_bool("colors_ansi_24bit") &&
		(force_colors || term_has_colors());
#else
	term_use_colors24 = FALSE;
#endif

	if (term_use_colors != old_colors || term_use_colors24 != old_colors24)
		irssi_redraw();
}
示例#8
0
文件: term.c 项目: ailin-nemui/irssi
static void cmd_redraw(void)
{
	irssi_redraw();
}
示例#9
0
void fish_init(void)
{
    char iniPasswordHash[50], SHA256digest[35], B64digest[50], *iniPass_ptr;
    int i;

    strcpy(iniPath, get_irssi_config());	// path to irssi config file
    strcpy(tempPath, iniPath);
    strcpy(strrchr(iniPath, '/'), blow_ini);
    strcpy(strrchr(tempPath, '/'), "/temp_FiSH.$$$");

    if (DH1080_Init()==FALSE) return;

    GetPrivateProfileString("FiSH", "ini_password_Hash", "0", iniPasswordHash, sizeof(iniPasswordHash), iniPath);
    if (strlen(iniPasswordHash) == 43) {
        iniPass_ptr = getpass(" --> Please enter your blow.ini password: "******"\002FiSH:\002 Wrong blow.ini password entered, try again...");
            printtext(NULL, NULL, MSGLEVEL_CRAP, "\002FiSH module NOT loaded.\002");
            return;
        }
        printtext(NULL, NULL, MSGLEVEL_CRAP, "\002FiSH:\002 Correct blow.ini password entered, lets go!");
    } else {
        strcpy(iniKey, default_iniKey);
        printtext(NULL, NULL, MSGLEVEL_CRAP, "\002FiSH:\002 Using default password to decrypt blow.ini... Try /setinipw to set a custom password.");
    }


    signal_add_first("server sendmsg", (SIGNAL_FUNC) encrypt_msg);
    signal_add_first("message private", (SIGNAL_FUNC) decrypt_msg);
    signal_add_first("message public", (SIGNAL_FUNC) decrypt_msg);
    signal_add_first("message irc notice", (SIGNAL_FUNC) decrypt_notice);
    signal_add_first("message irc action", (SIGNAL_FUNC) decrypt_action);

    signal_add_first("message own_private", (SIGNAL_FUNC) format_msg);
    signal_add_first("message own_public", (SIGNAL_FUNC) format_msg);

    signal_add_first("channel topic changed", (SIGNAL_FUNC) decrypt_changed_topic);
    signal_add_first("message topic", (SIGNAL_FUNC) decrypt_topic);
    signal_add_first("server incoming", (SIGNAL_FUNC) raw_handler);

    signal_add("query created", (SIGNAL_FUNC) do_auto_keyx);
    signal_add("query nick changed", (SIGNAL_FUNC) query_nick_changed);

    command_bind("topic+", NULL, (SIGNAL_FUNC) cmd_crypt_TOPIC);
    command_bind("notice+", NULL, (SIGNAL_FUNC) cmd_crypt_notice);
    command_bind("notfish", NULL, (SIGNAL_FUNC) cmd_crypt_notice);
    command_bind("me+", NULL, (SIGNAL_FUNC) cmd_crypt_action);
    command_bind("setkey", NULL, (SIGNAL_FUNC) cmd_setkey);
    command_bind("delkey", NULL, (SIGNAL_FUNC) cmd_delkey);
    command_bind("key", NULL, (SIGNAL_FUNC) cmd_key);
    command_bind("showkey", NULL, (SIGNAL_FUNC) cmd_key);
    command_bind("keyx", NULL, (SIGNAL_FUNC) cmd_keyx);
    command_bind("setinipw", NULL, (SIGNAL_FUNC) cmd_setinipw);
    command_bind("unsetinipw", NULL, (SIGNAL_FUNC) cmd_unsetinipw);

    command_bind("fishhelp", NULL, (SIGNAL_FUNC) cmd_helpfish);
    command_bind("helpfish", NULL, (SIGNAL_FUNC) cmd_helpfish);

    printtext(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
              "FiSH v1.00 - encryption module for irssi loaded! URL: https://github.com/falsovsky/FiSH-irssi\n"
              "Try /helpfish or /fishhelp for a short command overview");

    module_register("fish", "core");
}