Ejemplo n.º 1
0
void setup_ov_mode(int on, int hide, int log)
{
#ifdef WANT_OPERVIEW 

char *default_oper = "wsckf";
Window *win = NULL;

	if (on)
	{
		if ((win = get_window_by_name("oper_view")))
		{
			if (win->log)
			do_log(0, NULL, &win->log_fp);
			delete_window(win);
			update_all_windows();
			set_input_prompt(current_window, get_string_var(INPUT_PROMPT_VAR), 0);
			cursor_to_input();
		}
		send_to_server("MODE %s -%s%s", get_server_nickname(from_server), get_string_var(OPER_MODES_VAR)?get_string_var(OPER_MODES_VAR):default_oper, send_umode);
	} 
	else 
	{
		Window *tmp = NULL;
		win = current_window;
		if ((tmp = new_window(current_window->screen)))
		{
			malloc_strcpy(&tmp->name, "oper_view");
			tmp->double_status = 0;
			if (hide)
				hide_window(tmp);
			else
				resize_window(1, tmp, -5);
			tmp->window_level = LOG_WALLOP|LOG_OPNOTE|LOG_SNOTE;
			tmp->absolute_size = 1;
			tmp->skip = 1;
			set_wset_string_var(tmp->wset, STATUS_FORMAT1_WSET, fget_string_var(FORMAT_OV_FSET));
			build_status(tmp, NULL, 0);
			update_all_windows();
			set_input_prompt(current_window, get_string_var(INPUT_PROMPT_VAR), 0);
			cursor_to_input();
			send_to_server("MODE %s +%s", get_server_nickname(from_server), get_string_var(OPER_MODES_VAR)?get_string_var(OPER_MODES_VAR):default_oper);
			set_screens_current_window(win->screen, win);
			tmp->mangler = operlog_line_mangler;
			if (log != -1)
			{
				tmp->log = log;
				if (tmp->log)
					do_log(log, "~/.BitchX/operview.log", &tmp->log_fp);
			}
		}
	}
#endif
}
Ejemplo n.º 2
0
void
enter_change_mode(FileView *active_view)
{
	if(curr_stats.load_stage < 2)
		return;

	view = active_view;
	vle_mode_set(CHANGE_MODE, VMT_SECONDARY);

	wattroff(view->win, COLOR_PAIR(cfg.cs.pair[CURR_LINE_COLOR]) | A_BOLD);
	curs_set(FALSE);
	update_all_windows();

	top = 2;
#ifndef _WIN32
	bottom = 8;
#else
	bottom = 4;
#endif
	curr = 2;
	col = 6;
	step = 2;

	redraw_change_dialog();
}
Ejemplo n.º 3
0
void	redraw_all_screens (void)
{
	Screen *s, *old_os;

	old_os = output_screen;
	for (s = screen_list; s; s = s->next)
	{
		if (!s->alive)
			continue;

		output_screen = s;
		unflash();
		term_clear_screen();
		if (s == main_screen && term_resize())
			recalculate_windows(current_window->screen);
	}

	/* Logically mark all windows as needing a redraw */
	redraw_all_windows();

	/* Physically redraw all windows and status bars */
	update_all_windows();

	/* Physically redraw all input lines */
	update_input(NULL, UPDATE_ALL);

	output_screen = old_os;
	need_redraw = 0;
}
Ejemplo n.º 4
0
/*
 * refresh_screen: Whenever the REFRESH_SCREEN function is activated, this
 * swoops into effect 
 */
void refresh_screen (unsigned char dumb, char *dumber)
{
extern int need_redraw;

#if !defined(WINNT) && !defined(__EMX__)
	term_clear_screen();
	unflash();
#else
	xterm_settitle();
	term_clear_screen();
#endif

#if 0
	for (tmp = screen_list; tmp; tmp = tmp->next)
		tmp->co = TI_cols, tmp->li = TI_lines;
#endif
	if (term_resize())
		recalculate_windows(current_window->screen);
	else
		redraw_all_windows();
	if (need_redraw)
		need_redraw = 0;
	update_all_windows();
	update_input(UPDATE_ALL);
}
Ejemplo n.º 5
0
static void
cmd_ctrl_m(key_info_t key_info, keys_info_t *keys_info)
{
	static menu_info *saved_menu;

	*mode = NORMAL_MODE;
	saved_menu = menu;
	if(execute_menu_cb(curr_view, menu) != 0)
	{
		*mode = MENU_MODE;
		menu_redraw();
		return;
	}

	if(*mode != MENU_MODE)
	{
		reset_popup_menu(saved_menu);
	}
	else if(menu != saved_menu)
	{
		reset_popup_menu(saved_menu);
		update_menu();
	}

	if(was_redraw)
		update_screen(UT_FULL);
	else
		update_all_windows();
}
Ejemplo n.º 6
0
void refresh_window_screen(Window *window)
{
   xterm_settitle();
   recalculate_windows(current_window->screen);
   update_all_windows();
   update_input(UPDATE_ALL);
}
Ejemplo n.º 7
0
void
enter_change_mode(FileView *active_view)
{
	if(curr_stats.load_stage < 2)
		return;

	view = active_view;
	*mode = CHANGE_MODE;

	wattroff(view->win, COLOR_PAIR(DCOLOR_BASE + CURR_LINE_COLOR) | A_BOLD);
	curs_set(FALSE);
	update_all_windows();

	top = 2;
#ifndef _WIN32
	bottom = 8;
#else
	bottom = 4;
#endif
	curr = 2;
	col = 6;
	step = 2;

	redraw_change_dialog();
}
Ejemplo n.º 8
0
Archivo: menus.c Proyecto: lyuts/vifm
int
query_user_menu(char *title, char *message)
{
	int key;
	char *dup = strdup(message);

	curr_stats.errmsg_shown = 2;

	redraw_error_msg(title, message, 0);

	do
	{
		key = wgetch(error_win);
	}
	while(key != 'y' && key != 'n' && key != ERR);

	free(dup);

	curr_stats.errmsg_shown = 0;

	werase(error_win);
	wrefresh(error_win);

	touchwin(stdscr);

	update_all_windows();

	if(curr_stats.need_update != UT_NONE)
		update_screen(UT_FULL);

	return key == 'y';
}
Ejemplo n.º 9
0
static	void create_help_window (void)
{
    if (help_window)
        return;

    if (!dumb_mode && get_int_var(HELP_WINDOW_VAR))
    {
        if (!(help_window = new_window(current_window->screen)))
        {
            say("Could not create a new window, maybe you have "
                "all your windows fixed?");
            return;
        }

        use_help_window = 1;
        help_window->holding_top_of_display = NULL;
        recalculate_window_cursor_and_display_ip(help_window);
        help_window->window_level = LOG_HELP;
        window_body_needs_redraw(help_window);
        window_statusbar_needs_redraw(help_window);
        update_all_windows();
    }
    else
        help_window = current_window;
}
Ejemplo n.º 10
0
void
modes_update(void)
{
	if(vle_mode_is(CMDLINE_MODE))
	{
		redraw_cmdline();
		return;
	}
	else if(vle_mode_is(MENU_MODE))
	{
		menu_redraw();
		return;
	}
	else if(vle_mode_is(FILE_INFO_MODE))
	{
		redraw_file_info_dialog();
		return;
	}

	touchwin(stdscr);
	update_all_windows();

	if(vle_mode_is(SORT_MODE))
	{
		redraw_sort_dialog();
	}
	else if(vle_mode_is(CHANGE_MODE))
	{
		redraw_change_dialog();
	}
	else if(vle_mode_is(ATTR_MODE))
	{
		redraw_attr_dialog();
	}
}
Ejemplo n.º 11
0
Archivo: vars.c Proyecto: jnbek/TekNap
static void reinit_screen(Window *win, char *unused, int value)
{
	set_input_prompt(current_window, NULL, 0);
	set_input_prompt(current_window, get_string_var(INPUT_PROMPT_VAR), 0);
	update_all_windows();
	update_all_status(current_window, NULL, 0);
	update_input(UPDATE_ALL);
}
Ejemplo n.º 12
0
static void
leave_sort_mode(void)
{
	vle_mode_set(NORMAL_MODE, VMT_PRIMARY);

	ui_view_reset_selection_and_reload(view);

	update_all_windows();
}
Ejemplo n.º 13
0
void window_shrink_one(char dumb, char *dumber)
{
    in_window_command = 1;
    message_from(NULL, LOG_CURRENT);
    resize_window(1, curr_scr_win, -1);
    update_all_windows();
    in_window_command = 0;
    message_from(NULL, LOG_CRAP);
}
Ejemplo n.º 14
0
void window_key_move(char dumb, char *dumber)
{
    in_window_command = 1;
    message_from(NULL, LOG_CURRENT);
    move_window(curr_scr_win, 1);
    update_all_windows();
    in_window_command = 0;
    message_from(NULL, LOG_CRAP);
}
Ejemplo n.º 15
0
void window_key_balance(char dumb, char *dumber)
{
    in_window_command = 1;
    message_from(NULL, LOG_CURRENT);
    recalculate_windows();
    update_all_windows();
    in_window_command = 0;
    message_from(NULL, LOG_CRAP);
}
Ejemplo n.º 16
0
static void
leave_file_info_mode(void)
{
	*mode = NORMAL_MODE;

	if(was_redraw)
		update_screen(UT_FULL);
	else
		update_all_windows();
}
Ejemplo n.º 17
0
void debug_window(Window *win, char *value, int unused)
{
	Window	*old_win = win;
	char	*nv = NULL;

	internal_debug = parse_debug(value, internal_debug, &nv);
	set_string_var(DEBUG_VAR, nv);

	if (internal_debug)
	{
		Window *tmp = NULL;
		if (!get_window_by_name("debug") && (tmp = new_window(win->screen)))
		{
			malloc_strcpy(&tmp->name, "debug");
			tmp->double_status = 0;
			hide_window(tmp);
			tmp->window_level = LOG_DEBUG;
			tmp->absolute_size = 1;
			tmp->skip = 1;
			debugging_window = tmp;
			set_wset_string_var(tmp->wset, STATUS_FORMAT1_WSET, DEFAULT_FORMAT_DEBUG_FSET);
			build_status(tmp, NULL, 0);
			update_all_windows();
			set_input_prompt(win, get_string_var(INPUT_PROMPT_VAR), 0);
			cursor_to_input();
			set_screens_current_window(old_win->screen, old_win);
		}
	}
	else
	{
		if ((old_win = get_window_by_name("debug")))
		{
			delete_window(old_win);
			debugging_window = NULL;
			update_all_windows();
			set_input_prompt(current_window, get_string_var(INPUT_PROMPT_VAR), 0);
			cursor_to_input();
		}
	}
	new_free(&nv);
}
Ejemplo n.º 18
0
Archivo: menu.c Proyecto: cfillion/vifm
/* Updates UI on leaving the mode trying to minimize efforts to do this. */
static void
update_ui_on_leaving(void)
{
	if(was_redraw)
	{
		update_screen(UT_FULL);
	}
	else
	{
		update_all_windows();
	}
}
Ejemplo n.º 19
0
static void
leave_change_mode(int clean_selection)
{
	vle_mode_set(NORMAL_MODE, VMT_PRIMARY);

	if(clean_selection)
	{
		ui_view_reset_selection_and_reload(view);
	}

	update_all_windows();
}
Ejemplo n.º 20
0
static void handle_swap(int windownum)
{
    char *p = NULL;

    malloc_sprintf(&p, "SWAP %d", windownum);
    t_parse_command("WINDOW", p);
    set_channel_window(curr_scr_win, get_current_channel_by_refnum(curr_scr_win->refnum), curr_scr_win->server);
    new_free(&p);
    set_input_prompt(curr_scr_win, get_string_var(INPUT_PROMPT_VAR), 0);
    update_input(UPDATE_ALL);
    update_all_windows();
}
Ejemplo n.º 21
0
/* leaves properties change dialog */
static void
leave_attr_mode(void)
{
	vle_mode_set(NORMAL_MODE, VMT_PRIMARY);
	curr_stats.use_input_bar = 1;

	clean_selected_files(view);
	load_dir_list(view, 1);
	move_to_list_pos(view, view->list_pos);

	update_all_windows();
}
Ejemplo n.º 22
0
/* init_windows:  */
int init_screen (void)
{
extern int term_initialized;
	term_initialized = 1;
	term_clear_screen();
	term_resize();
	create_new_screen();
	new_window(main_screen);
	update_all_windows();
	term_move_cursor(0, 0);
	return 0;
}
Ejemplo n.º 23
0
static void
leave_attr_mode(void)
{
	*mode = NORMAL_MODE;
	curs_set(FALSE);
	curr_stats.use_input_bar = 1;

	clean_selected_files(view);
	load_dir_list(view, 1);
	move_to_list_pos(view, view->list_pos);

	update_all_windows();
}
Ejemplo n.º 24
0
static void
leave_attr_mode(void)
{
	vle_mode_set(NORMAL_MODE, VMT_PRIMARY);
	curs_set(0);
	curr_stats.use_input_bar = 1;

	clean_selected_files(view);
	load_dir_list(view, 1);
	fview_cursor_redraw(view);

	update_all_windows();
}
Ejemplo n.º 25
0
static void
leave_menu_mode(void)
{
	reset_popup_menu(menu);

	clean_selected_files(view);
	redraw_view(view);

	*mode = NORMAL_MODE;
	if(was_redraw)
		update_screen(UT_FULL);
	else
		update_all_windows();
}
Ejemplo n.º 26
0
static void
leave_file_info_mode(void)
{
	vle_mode_set(NORMAL_MODE, VMT_PRIMARY);

	if(was_redraw)
	{
		update_screen(UT_FULL);
	}
	else
	{
		update_all_windows();
	}
}
Ejemplo n.º 27
0
static void
leave_change_mode(int clean_selection)
{
	*mode = NORMAL_MODE;

	if(clean_selection)
	{
		clean_selected_files(view);
		load_saving_pos(view, 1);
		move_to_list_pos(view, view->list_pos);
	}

	update_all_windows();
}
Ejemplo n.º 28
0
void	refresh_a_screen (Screen *screen)
{
	unflash();
	term_clear_screen();

	if (screen != main_screen || term_resize())
		recalculate_windows(screen);
	else
		redraw_all_windows();

	if (need_redraw)
		need_redraw = 0;

	update_all_windows();
	update_input(UPDATE_ALL);
}
Ejemplo n.º 29
0
static void
set_msg_screen(Screen * screen)
{
	msg_screen = screen;
	if (!msg_screen && msg_window) {
		if (use_msg_window) {
			int display = window_display;

			window_display = 0;
			delete_window(msg_window);
			window_display = display;
		}
		msg_window = NULL;
		update_all_windows();
	}
}
Ejemplo n.º 30
0
static	void	set_help_screen (Screen *screen)
{
    help_screen = screen;
    if (!help_screen && help_window)
    {
        if (use_help_window)
        {
            int display = window_display;

            window_display = 0;
            delete_window(help_window);
            window_display = display;
        }
        help_window = (Window *) 0;
        update_all_windows();
    }
}