1
1

Replaced addstr() call to tty_print_string() one.

Этот коммит содержится в:
Andrew Borodin 2009-05-13 14:04:09 +04:00
родитель 069aab9ebc
Коммит 7a75f8723d
11 изменённых файлов: 69 добавлений и 72 удалений

Просмотреть файл

@ -340,7 +340,7 @@ print_to_widget (WEdit *edit, long row, int start_col, int start_col_real,
} else {
str[res] = '\0';
}
addstr ((char *)str);
tty_print_string ((char *) str);
} else {
addch(textchar);
}

Просмотреть файл

@ -347,23 +347,23 @@ static void chown_refresh (void)
tty_setcolor (COLOR_NORMAL);
dlg_move (ch_dlg, BY - 1, 8);
addstr (_("owner"));
tty_print_string (_("owner"));
dlg_move (ch_dlg, BY - 1, 16);
addstr (_("group"));
tty_print_string (_("group"));
dlg_move (ch_dlg, BY - 1, 24);
addstr (_("other"));
tty_print_string (_("other"));
dlg_move (ch_dlg, BY - 1, 35);
addstr (_("owner"));
tty_print_string (_("owner"));
dlg_move (ch_dlg, BY - 1, 53);
addstr (_("group"));
tty_print_string (_("group"));
dlg_move (ch_dlg, 3, 4);
addstr (_("On"));
tty_print_string (_("On"));
dlg_move (ch_dlg, BY + 1, 4);
addstr (_("Flag"));
tty_print_string (_("Flag"));
dlg_move (ch_dlg, BY + 2, 4);
addstr (_("Mode"));
tty_print_string (_("Mode"));
if (!single_set){
dlg_move (ch_dlg, 3, 54);
@ -382,7 +382,7 @@ static void chown_info_update (void)
/* name && mode */
dlg_move (ch_dlg, 3, 8);
addstr (str_fit_to_term (fname, 45, J_LEFT_FIT));
tty_print_string (str_fit_to_term (fname, 45, J_LEFT_FIT));
dlg_move (ch_dlg, BY + 2, 9);
tty_printf ("%12o", get_mode ());

Просмотреть файл

@ -131,29 +131,29 @@ static void chmod_refresh (Dlg_head *h)
draw_box (h, FY, FX, 10, 25);
dlg_move (h, FY + 1, FX + 2);
addstr (_("Name"));
tty_print_string (_("Name"));
dlg_move (h, FY + 3, FX + 2);
addstr (_("Permissions (Octal)"));
tty_print_string (_("Permissions (Octal)"));
dlg_move (h, FY + 5, FX + 2);
addstr (_("Owner name"));
tty_print_string (_("Owner name"));
dlg_move (h, FY + 7, FX + 2);
addstr (_("Group name"));
tty_print_string (_("Group name"));
dlg_move (h, TY, TX);
addstr (_("Use SPACE to change"));
tty_print_string (_("Use SPACE to change"));
dlg_move (h, TY + 1, TX);
addstr (_("an option, ARROW KEYS"));
tty_print_string (_("an option, ARROW KEYS"));
dlg_move (h, TY + 2, TX);
addstr (_("to move between options"));
tty_print_string (_("to move between options"));
dlg_move (h, TY + 3, TX);
addstr (_("and T or INS to mark"));
tty_print_string (_("and T or INS to mark"));
tty_setcolor (COLOR_HOT_NORMAL);
dlg_move (h, PY, PX + 1);
addstr (_(" Permission "));
tty_print_string (_(" Permission "));
dlg_move (h, FY, FX + 1);
addstr (_(" File "));
tty_print_string (_(" File "));
}
static cb_ret_t

Просмотреть файл

@ -108,23 +108,23 @@ chown_refresh (Dlg_head *h)
draw_box (h, TY, TX, 12, 19);
dlg_move (h, TY + 1, TX + 1);
addstr (_(" Name "));
tty_print_string (_(" Name "));
dlg_move (h, TY + 3, TX + 1);
addstr (_(" Owner name "));
tty_print_string (_(" Owner name "));
dlg_move (h, TY + 5, TX + 1);
addstr (_(" Group name "));
tty_print_string (_(" Group name "));
dlg_move (h, TY + 7, TX + 1);
addstr (_(" Size "));
tty_print_string (_(" Size "));
dlg_move (h, TY + 9, TX + 1);
addstr (_(" Permission "));
tty_print_string (_(" Permission "));
tty_setcolor (COLOR_HOT_NORMAL);
dlg_move (h, UY, UX + 1);
addstr (_(" User name "));
tty_print_string (_(" User name "));
dlg_move (h, GY, GX + 1);
addstr (_(" Group name "));
tty_print_string (_(" Group name "));
dlg_move (h, TY, TX + 1);
addstr (_(" File "));
tty_print_string (_(" File "));
}
static char *

Просмотреть файл

@ -400,7 +400,7 @@ static void help_show (Dlg_head *h, const char *paint_start)
break;
case CHAR_VERSION:
dlg_move (h, line+2, col+2);
addstr (VERSION);
tty_print_string (VERSION);
col += str_term_width1 (VERSION);
break;
case CHAR_FONT_BOLD:
@ -437,7 +437,7 @@ static void help_show (Dlg_head *h, const char *paint_start)
SLsmg_draw_object (h->y + line + 2, h->x + col + 2, c);
#endif
} else {
addstr (buff);
tty_print_string (buff);
}
col+= w;
break;

Просмотреть файл

@ -113,7 +113,7 @@ info_show_info (struct WInfo *info)
? 100 * myfs_stats.nfree / myfs_stats.nodes : 0,
myfs_stats.nodes);
else
addstr (_("No node information"));
tty_print_string (_("No node information"));
case 15:
widget_move (&info->widget, 15, 3);
@ -125,7 +125,7 @@ info_show_info (struct WInfo *info)
(int)(100 * (double)myfs_stats.avail / myfs_stats.total) : 0,
buffer2);
} else
addstr (_("No space information"));
tty_print_string (_("No space information"));
case 14:
widget_move (&info->widget, 14, 3);
@ -211,7 +211,7 @@ info_show_info (struct WInfo *info)
info->widget.cols - i18n_adjust));
tty_print_string (buff->str);
} else
addstr (_("File: None"));
tty_print_string (_("File: None"));
case 2:
case 1:

Просмотреть файл

@ -853,7 +853,7 @@ void print_vfs_message (const char *msg, ...)
tty_gotoyx (0, 0);
tty_setcolor (NORMAL_COLOR);
addstr (str_fit_to_term (str, COLS - 1, J_LEFT));
tty_print_string (str_fit_to_term (str, COLS - 1, J_LEFT));
/* Restore cursor position */
tty_gotoyx (row, col);

Просмотреть файл

@ -559,7 +559,7 @@ format_file (char *dest, int limit, WPanel *panel, int file_index, int width, in
add_permission_string (preperad_text, format->field_len, fe,
attr, color, perm - 1);
else
addstr (preperad_text);
tty_print_string (preperad_text);
length+= len;
} else {
@ -632,8 +632,8 @@ display_mini_info (WPanel *panel)
if (panel->searching){
tty_setcolor (INPUT_COLOR);
addstr ("/");
addstr (str_fit_to_term (panel->search_buffer,
tty_print_string ("/");
tty_print_string (str_fit_to_term (panel->search_buffer,
panel->widget.cols - 3, J_LEFT));
tty_setcolor (NORMAL_COLOR);
return;
@ -651,18 +651,18 @@ display_mini_info (WPanel *panel)
g_free (link);
if (len > 0){
link_target[len] = 0;
addstr ("-> ");
addstr (str_fit_to_term (link_target, panel->widget.cols - 5,
tty_print_string ("-> ");
tty_print_string (str_fit_to_term (link_target, panel->widget.cols - 5,
J_LEFT_FIT));
} else
addstr (str_fit_to_term (_("<readlink failed>"),
tty_print_string (str_fit_to_term (_("<readlink failed>"),
panel->widget.cols - 2, J_LEFT));
} else if (strcmp (panel->dir.list [panel->selected].fname, "..") == 0) {
/* FIXME:
* while loading directory (do_load_dir() and do_reload_dir(),
* the actual stat info about ".." directory isn't got;
* so just don't display incorrect info about ".." directory */
addstr (str_fit_to_term (_("UP--DIR"), panel->widget.cols - 2, J_LEFT));
tty_print_string (str_fit_to_term (_("UP--DIR"), panel->widget.cols - 2, J_LEFT));
} else
/* Default behavior */
repaint_file (panel, panel->selected, 0, STATUS, 1);
@ -790,7 +790,7 @@ show_free_space (WPanel *panel)
widget_move (&panel->widget, panel->widget.lines - 1,
panel->widget.cols - 2 - (int) strlen (tmp));
tty_setcolor (NORMAL_COLOR);
addstr (tmp);
tty_print_string (tmp);
}
}
@ -819,15 +819,15 @@ show_dir (WPanel *panel)
addch (' ');
len = min (max (panel->widget.cols - 9, 0), panel->widget.cols);
addstr (str_term_trim (strip_home_and_password (panel->cwd), len));
tty_print_string (str_term_trim (strip_home_and_password (panel->cwd), len));
addch (' ');
widget_move (&panel->widget, 0, 1);
addstr ("<");
tty_print_string ("<");
widget_move (&panel->widget, 0, panel->widget.cols - 2);
addstr (">");
tty_print_string (">");
widget_move (&panel->widget, 0, panel->widget.cols - 3);
addstr ("v");
tty_print_string ("v");
if (!show_mini_info) {
if (panel->marked == 0) {
@ -839,7 +839,7 @@ show_dir (WPanel *panel)
size_trunc_sep (panel->dir.list [panel->selected].st.st_size));
tty_setcolor (NORMAL_COLOR);
widget_move (&panel->widget, panel->widget.lines - 1, 2);
addstr (buffer);
tty_print_string (buffer);
}
} else {
/* Show total size of marked files
@ -1244,7 +1244,7 @@ paint_frame (WPanel *panel)
header_len = format->field_len;
tty_setcolor (MARKED_COLOR);
addstr (str_fit_to_term (txt, format->field_len, J_CENTER_LEFT));
tty_print_string (str_fit_to_term (txt, format->field_len, J_CENTER_LEFT));
g_free(txt);
width -= format->field_len;
} else {

Просмотреть файл

@ -183,13 +183,13 @@ static void tree_show_mini_info (WTree *tree, int tree_lines, int tree_cols)
tty_setcolor (DLG_FOCUSC (h));
addch (PATH_SEP);
addstr (str_fit_to_term (tree->search_buffer,
tty_print_string (str_fit_to_term (tree->search_buffer,
tree_cols - 2, J_LEFT_FIT));
addch (' ');
tty_setcolor (DLG_FOCUSC (h));
} else {
/* Show full name of selected directory */
addstr (str_fit_to_term (tree->selected_ptr->name,
tty_print_string (str_fit_to_term (tree->selected_ptr->name,
tree_cols, J_LEFT_FIT));
}
}
@ -276,7 +276,7 @@ static void show_tree (WTree *tree)
}
/* Show full name */
addstr (str_fit_to_term (current->name, tree_cols - 6, J_LEFT_FIT));
tty_print_string (str_fit_to_term (current->name, tree_cols - 6, J_LEFT_FIT));
} else{
/* Sub level directory */
@ -310,7 +310,7 @@ static void show_tree (WTree *tree)
/* Show sub-name */
addch (' ');
addstr (str_fit_to_term (current->subname,
tty_print_string (str_fit_to_term (current->subname,
tree_cols - 2 - 4 - 3 * j, J_LEFT_FIT));
}
addch (' ');

Просмотреть файл

@ -2130,7 +2130,6 @@ view_display_status (WView *view)
const char *file_label, *file_name;
screen_dimen file_label_width;
int i;
char *tmp;
if (height < 1)
return;
@ -2146,13 +2145,11 @@ view_display_status (WView *view)
: "";
if (width < file_label_width + 6)
addstr (str_fit_to_term (file_name, width, J_LEFT_FIT));
tty_print_string (str_fit_to_term (file_name, width, J_LEFT_FIT));
else {
i = (width > 22 ? 22 : width) - file_label_width;
tmp = g_strdup_printf (file_label, str_fit_to_term (file_name, i, J_LEFT_FIT));
addstr (tmp);
g_free (tmp);
tty_printf (file_label, str_fit_to_term (file_name, i, J_LEFT_FIT));
if (width > 46) {
widget_move (view, top, left + 24);
/* FIXME: the format strings need to be changed when offset_type changes */
@ -2282,7 +2279,7 @@ view_display_hex (WView *view)
struct hexedit_change_node *curr = view->change_list;
size_t i;
char hex_buff[10]; /* A temporary buffer for sprintf and mvwaddstr */
char hex_buff[10]; /* A temporary buffer for sprintf */
int bytes; /* Number of bytes already printed on the line */
view_display_clean (view);

Просмотреть файл

@ -230,13 +230,13 @@ button_callback (Widget *w, widget_msg_t msg, int parm)
switch (b->flags) {
case DEFPUSH_BUTTON:
addstr ("[< ");
tty_print_string ("[< ");
break;
case NORMAL_BUTTON:
addstr ("[ ");
tty_print_string ("[ ");
break;
case NARROW_BUTTON:
addstr ("[");
tty_print_string ("[");
break;
case HIDDEN_BUTTON:
default:
@ -247,13 +247,13 @@ button_callback (Widget *w, widget_msg_t msg, int parm)
switch (b->flags) {
case DEFPUSH_BUTTON:
addstr (" >]");
tty_print_string (" >]");
break;
case NORMAL_BUTTON:
addstr (" ]");
tty_print_string (" ]");
break;
case NARROW_BUTTON:
addstr ("]");
tty_print_string ("]");
break;
}
return MSG_HANDLED;
@ -421,7 +421,7 @@ radio_callback (Widget *w, widget_msg_t msg, int parm)
const gboolean focused = (i == r->pos && msg == WIDGET_FOCUS);
widget_selectcolor (w, focused, FALSE);
widget_move (&r->widget, i, 0);
addstr ((r->sel == i) ? "(*) " : "( ) ");
tty_print_string ((r->sel == i) ? "(*) " : "( ) ");
draw_hotkey (w, r->texts[i], focused);
}
return MSG_HANDLED;
@ -527,7 +527,7 @@ check_callback (Widget *w, widget_msg_t msg, int parm)
case WIDGET_DRAW:
widget_selectcolor (w, msg == WIDGET_FOCUS, FALSE);
widget_move (&c->widget, 0, 0);
addstr ((c->state & C_BOOL) ? "[x] " : "[ ] ");
tty_print_string ((c->state & C_BOOL) ? "[x] " : "[ ] ");
draw_hotkey (w, c->text, msg == WIDGET_FOCUS);
return MSG_HANDLED;
@ -613,7 +613,7 @@ label_callback (Widget *w, widget_msg_t msg, int parm)
}
widget_move (&l->widget, y, 0);
addstr (str_fit_to_term (p, l->widget.cols, J_LEFT));
tty_print_string (str_fit_to_term (p, l->widget.cols, J_LEFT));
if (q == NULL)
break;
@ -795,7 +795,7 @@ static void draw_history_button (WInput * in)
Dlg_head *h;
h = in->widget.parent;
tty_setcolor (NORMAL_COLOR);
addstr ("[ ]");
tty_print_string ("[ ]");
/* Too distracting: tty_setcolor (MARKED_COLOR); */
widget_move (&in->widget, 0, in->field_width - HISTORY_BUTTON_WIDTH + 1);
addch (c);
@ -851,7 +851,7 @@ update_input (WInput *in, int clear_first)
widget_move (&in->widget, 0, 0);
if (!in->is_password) {
addstr (str_term_substring (in->buffer, in->term_first_shown,
tty_print_string (str_term_substring (in->buffer, in->term_first_shown,
in->field_width - has_history));
} else {
cp = in->buffer;
@ -1910,7 +1910,7 @@ listbox_draw (WListbox *l, int focused)
text = e->text;
e = e->next;
}
addstr (str_fit_to_term (text, l->width - 2, J_LEFT_FIT));
tty_print_string (str_fit_to_term (text, l->width - 2, J_LEFT_FIT));
}
l->cursor_y = sel_line;
if (!l->scrollbar)
@ -2478,7 +2478,7 @@ buttonbar_callback (Widget *w, widget_msg_t msg, int parm)
tty_printf ("%2d", i + 1);
tty_setcolor (SELECTED_COLOR);
text = (bb->labels[i].text != NULL) ? bb->labels[i].text : "";
addstr (str_fit_to_term (text, bb->btn_width - 2, J_CENTER_LEFT));
tty_print_string (str_fit_to_term (text, bb->btn_width - 2, J_CENTER_LEFT));
tty_setcolor (DEFAULT_COLOR);
}
tty_setcolor (SELECTED_COLOR);