diff --git a/lib/widget/button.c b/lib/widget/button.c index 66206b606..e211b5dc2 100644 --- a/lib/widget/button.c +++ b/lib/widget/button.c @@ -120,7 +120,7 @@ button_default_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm off = 0; break; } - widget_move (w, 0, b->hotpos + off); + widget_gotoyx (w, 0, b->hotpos + off); return MSG_HANDLED; case MSG_DRAW: @@ -130,7 +130,7 @@ button_default_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm focused = widget_get_state (w, WST_FOCUSED); widget_selectcolor (w, focused, FALSE); - widget_move (w, 0, 0); + widget_gotoyx (w, 0, 0); switch (b->flags) { diff --git a/lib/widget/buttonbar.c b/lib/widget/buttonbar.c index ded1cabf4..394e2858f 100644 --- a/lib/widget/buttonbar.c +++ b/lib/widget/buttonbar.c @@ -177,10 +177,10 @@ buttonbar_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, voi if (bb->visible) { buttonbar_init_button_positions (bb); - widget_move (w, 0, 0); + widget_gotoyx (w, 0, 0); tty_setcolor (DEFAULT_COLOR); tty_printf ("%-*s", w->cols, ""); - widget_move (w, 0, 0); + widget_gotoyx (w, 0, 0); for (i = 0; i < BUTTONBAR_LABELS_NUM; i++) { diff --git a/lib/widget/check.c b/lib/widget/check.c index 874177caf..20404ebd8 100644 --- a/lib/widget/check.c +++ b/lib/widget/check.c @@ -79,7 +79,7 @@ check_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d return MSG_HANDLED; case MSG_CURSOR: - widget_move (w, 0, 1); + widget_gotoyx (w, 0, 1); return MSG_HANDLED; case MSG_DRAW: @@ -88,7 +88,7 @@ check_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d focused = widget_get_state (w, WST_FOCUSED); widget_selectcolor (w, focused, FALSE); - widget_move (w, 0, 0); + widget_gotoyx (w, 0, 0); tty_print_string (c->state ? "[x] " : "[ ] "); hotkey_draw (w, c->text, focused); return MSG_HANDLED; diff --git a/lib/widget/dialog.c b/lib/widget/dialog.c index 1b054449e..d8bbdafb5 100644 --- a/lib/widget/dialog.c +++ b/lib/widget/dialog.c @@ -629,7 +629,7 @@ dlg_default_repaint (WDialog * h) { /* TODO: truncate long title */ tty_setcolor (h->color[DLG_COLOR_TITLE]); - widget_move (h, space, (wh->cols - str_term_width1 (h->title)) / 2); + widget_gotoyx (h, space, (wh->cols - str_term_width1 (h->title)) / 2); tty_print_string (h->title); } } diff --git a/lib/widget/gauge.c b/lib/widget/gauge.c index e3c30509b..50e47f28b 100644 --- a/lib/widget/gauge.c +++ b/lib/widget/gauge.c @@ -63,7 +63,7 @@ gauge_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d switch (msg) { case MSG_DRAW: - widget_move (w, 0, 0); + widget_gotoyx (w, 0, 0); if (!g->shown) { tty_setcolor (h->color[DLG_COLOR_NORMAL]); diff --git a/lib/widget/groupbox.c b/lib/widget/groupbox.c index f3a377d5c..3af2d1b41 100644 --- a/lib/widget/groupbox.c +++ b/lib/widget/groupbox.c @@ -72,7 +72,7 @@ groupbox_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void if (g->title != NULL) { tty_setcolor (disabled ? DISABLED_COLOR : h->color[DLG_COLOR_TITLE]); - widget_move (w, 0, 1); + widget_gotoyx (w, 0, 1); tty_print_string (g->title); } return MSG_HANDLED; diff --git a/lib/widget/hline.c b/lib/widget/hline.c index 937ccbeca..2f018b2d9 100644 --- a/lib/widget/hline.c +++ b/lib/widget/hline.c @@ -90,9 +90,9 @@ hline_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d if (l->auto_adjust_cols) { - widget_move (w, 0, 0); + widget_gotoyx (w, 0, 0); tty_print_alt_char (ACS_LTEE, FALSE); - widget_move (w, 0, w->cols - 1); + widget_gotoyx (w, 0, w->cols - 1); tty_print_alt_char (ACS_RTEE, FALSE); } @@ -101,7 +101,7 @@ hline_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d int text_width; text_width = str_term_width1 (l->text); - widget_move (w, 0, (w->cols - text_width) / 2); + widget_gotoyx (w, 0, (w->cols - text_width) / 2); tty_print_string (l->text); } return MSG_HANDLED; diff --git a/lib/widget/input.c b/lib/widget/input.c index 143e09b95..59c3f3391 100644 --- a/lib/widget/input.c +++ b/lib/widget/input.c @@ -113,13 +113,13 @@ draw_history_button (WInput * in) else c = '|'; - widget_move (in, 0, WIDGET (in)->cols - HISTORY_BUTTON_WIDTH); + widget_gotoyx (in, 0, WIDGET (in)->cols - HISTORY_BUTTON_WIDTH); disabled = widget_get_state (WIDGET (in), WST_DISABLED); tty_setcolor (disabled ? DISABLED_COLOR : in->color[WINPUTC_HISTORY]); #ifdef LARGE_HISTORY_BUTTON tty_print_string ("[ ]"); - widget_move (in, 0, WIDGET (in)->cols - HISTORY_BUTTON_WIDTH + 1); + widget_gotoyx (in, 0, WIDGET (in)->cols - HISTORY_BUTTON_WIDTH + 1); #endif tty_print_char (c); @@ -1091,7 +1091,7 @@ input_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d return MSG_HANDLED; case MSG_CURSOR: - widget_move (in, 0, str_term_width2 (in->buffer, in->point) - in->term_first_shown); + widget_gotoyx (in, 0, str_term_width2 (in->buffer, in->point) - in->term_first_shown); return MSG_HANDLED; case MSG_DESTROY: @@ -1290,7 +1290,7 @@ input_update (WInput * in, gboolean clear_first) else tty_setcolor (in->color[WINPUTC_MAIN]); - widget_move (in, 0, 0); + widget_gotoyx (in, 0, 0); if (!in->is_password) { @@ -1309,7 +1309,7 @@ input_update (WInput * in, gboolean clear_first) tty_setcolor (in->color[WINPUTC_MARK]); if (m1 < in->term_first_shown) { - widget_move (in, 0, 0); + widget_gotoyx (in, 0, 0); tty_print_string (str_term_substring (in->buffer, in->term_first_shown, m2 - in->term_first_shown)); @@ -1318,7 +1318,7 @@ input_update (WInput * in, gboolean clear_first) { int sel_width, buf_width; - widget_move (in, 0, m1 - in->term_first_shown); + widget_gotoyx (in, 0, m1 - in->term_first_shown); buf_width = str_term_width2 (in->buffer, m1); sel_width = MIN (m2 - m1, (w->cols - has_history) - (buf_width - in->term_first_shown)); diff --git a/lib/widget/label.c b/lib/widget/label.c index 5369214ca..fac52f3ad 100644 --- a/lib/widget/label.c +++ b/lib/widget/label.c @@ -96,7 +96,7 @@ label_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d q[0] = '\0'; } - widget_move (w, y, 0); + widget_gotoyx (w, y, 0); tty_print_string (str_fit_to_term (p, w->cols, align)); if (q == NULL) diff --git a/lib/widget/listbox.c b/lib/widget/listbox.c index cda3fbf19..d736a1301 100644 --- a/lib/widget/listbox.c +++ b/lib/widget/listbox.c @@ -96,7 +96,7 @@ listbox_drawscroll (WListbox * l) int length; /* Are we at the top? */ - widget_move (w, 0, w->cols); + widget_gotoyx (w, 0, w->cols); if (l->top == 0) tty_print_one_vline (TRUE); else @@ -105,7 +105,7 @@ listbox_drawscroll (WListbox * l) length = g_queue_get_length (l->list); /* Are we at the bottom? */ - widget_move (w, max_line, w->cols); + widget_gotoyx (w, max_line, w->cols); if (l->top + w->lines == length || w->lines >= length) tty_print_one_vline (TRUE); else @@ -117,7 +117,7 @@ listbox_drawscroll (WListbox * l) for (i = 1; i < max_line; i++) { - widget_move (w, i, w->cols); + widget_gotoyx (w, i, w->cols); if (i != line) tty_print_one_vline (TRUE); else @@ -172,7 +172,7 @@ listbox_draw (WListbox * l, gboolean focused) else tty_setcolor (normalc); - widget_move (l, i, 1); + widget_gotoyx (l, i, 1); if (l->list != NULL && le != NULL && (i == 0 || pos < length)) { @@ -481,7 +481,7 @@ listbox_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void return listbox_execute_cmd (l, parm); case MSG_CURSOR: - widget_move (l, l->cursor_y, 0); + widget_gotoyx (l, l->cursor_y, 0); return MSG_HANDLED; case MSG_DRAW: diff --git a/lib/widget/menu.c b/lib/widget/menu.c index 68ae6f6ce..4c2e30cdf 100644 --- a/lib/widget/menu.c +++ b/lib/widget/menu.c @@ -135,10 +135,10 @@ menubar_paint_idx (WMenuBar * menubar, unsigned int idx, int color) /* menu separator */ tty_setcolor (MENU_ENTRY_COLOR); - widget_move (w, y, x - 1); + widget_gotoyx (w, y, x - 1); tty_print_alt_char (ACS_LTEE, FALSE); tty_draw_hline (w->y + y, w->x + x, ACS_HLINE, menu->max_entry_len + 3); - widget_move (w, y, x + menu->max_entry_len + 3); + widget_gotoyx (w, y, x + menu->max_entry_len + 3); tty_print_alt_char (ACS_RTEE, FALSE); } else @@ -147,7 +147,7 @@ menubar_paint_idx (WMenuBar * menubar, unsigned int idx, int color) /* menu text */ tty_setcolor (color); - widget_move (w, y, x); + widget_gotoyx (w, y, x); tty_print_char ((unsigned char) entry->first_letter); tty_getyx (&yt, &xt); tty_draw_hline (yt, xt, ' ', menu->max_entry_len + 2); /* clear line */ @@ -165,12 +165,12 @@ menubar_paint_idx (WMenuBar * menubar, unsigned int idx, int color) if (entry->shortcut != NULL) { - widget_move (w, y, x + menu->max_hotkey_len + 3); + widget_gotoyx (w, y, x + menu->max_hotkey_len + 3); tty_print_string (entry->shortcut); } /* move cursor to the start of entry text */ - widget_move (w, y, x + 1); + widget_gotoyx (w, y, x + 1); } } @@ -228,7 +228,7 @@ menubar_draw (WMenuBar * menubar) gboolean is_selected = (menubar->selected == (gsize) g_list_position (menubar->menu, i)); menubar_set_color (menubar, is_selected, FALSE); - widget_move (w, 0, menu->start_x); + widget_gotoyx (w, 0, menu->start_x); tty_print_char (' '); tty_print_string (menu->text.start); @@ -249,7 +249,7 @@ menubar_draw (WMenuBar * menubar) if (menubar->is_dropped) menubar_draw_drop (menubar); else - widget_move (w, 0, MENU (g_list_nth_data (menubar->menu, menubar->selected))->start_x); + widget_gotoyx (w, 0, MENU (g_list_nth_data (menubar->menu, menubar->selected))->start_x); } /* --------------------------------------------------------------------------------------------- */ diff --git a/lib/widget/radio.c b/lib/widget/radio.c index 023023116..deddd4387 100644 --- a/lib/widget/radio.c +++ b/lib/widget/radio.c @@ -112,7 +112,7 @@ radio_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d } case MSG_CURSOR: - widget_move (r, r->pos, 1); + widget_gotoyx (r, r->pos, 1); return MSG_HANDLED; case MSG_DRAW: @@ -124,7 +124,7 @@ radio_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d for (i = 0; i < r->count; i++) { widget_selectcolor (w, i == r->pos && focused, FALSE); - widget_move (w, i, 0); + widget_gotoyx (w, i, 0); tty_draw_hline (w->y + i, w->x, ' ', w->cols); tty_print_string ((r->sel == i) ? "(*) " : "( ) "); hotkey_draw (w, r->texts[i], i == r->pos && focused); diff --git a/lib/widget/widget-common.h b/lib/widget/widget-common.h index c6573a51c..ec79acc22 100644 --- a/lib/widget/widget-common.h +++ b/lib/widget/widget-common.h @@ -14,7 +14,7 @@ #define WIDGET(x) ((Widget *)(x)) #define CONST_WIDGET(x) ((const Widget *)(x)) -#define widget_move(w, _y, _x) tty_gotoyx (CONST_WIDGET(w)->y + (_y), CONST_WIDGET(w)->x + (_x)) +#define widget_gotoyx(w, _y, _x) tty_gotoyx (CONST_WIDGET(w)->y + (_y), CONST_WIDGET(w)->x + (_x)) /* Sets/clear the specified flag in the options field */ #define widget_want_cursor(w,i) widget_set_options(w, WOP_WANT_CURSOR, i) #define widget_want_hotkey(w,i) widget_set_options(w, WOP_WANT_HOTKEY, i) diff --git a/src/editor/editdraw.c b/src/editor/editdraw.c index 56889463f..94851ed95 100644 --- a/src/editor/editdraw.c +++ b/src/editor/editdraw.c @@ -77,7 +77,7 @@ gboolean visible_tabs = TRUE; #define MOD_CURSOR (1 << 11) #define MOD_WHITESPACE (1 << 12) -#define edit_move(x,y) widget_move(edit, y, x); +#define edit_move(x,y) widget_gotoyx(edit, y, x); #define key_pending(x) (!is_idle()) @@ -231,7 +231,7 @@ edit_status_fullscreen (WEdit * edit, int color) fname = str_trunc (fname, fname_len); } - widget_move (h, 0, 0); + widget_gotoyx (h, 0, 0); tty_setcolor (color); printwstr (fname, fname_len + gap); printwstr (status, w - (fname_len + gap)); @@ -241,7 +241,7 @@ edit_status_fullscreen (WEdit * edit, int color) int percent; percent = edit_buffer_calc_percent (&edit->buffer, edit->buffer.curs1); - widget_move (h, 0, w - 6 - 6); + widget_gotoyx (h, 0, w - 6 - 6); tty_printf (" %3d%%", percent); } @@ -359,7 +359,7 @@ edit_draw_frame (const WEdit * edit, int color, gboolean active) if (edit->drag_state == MCEDIT_DRAG_NONE) { tty_setcolor (EDITOR_FRAME_DRAG); - widget_move (w, w->lines - 1, w->cols - 1); + widget_gotoyx (w, w->lines - 1, w->cols - 1); tty_print_alt_char (ACS_LRCORNER, TRUE); } } @@ -380,9 +380,9 @@ edit_draw_window_icons (const WEdit * edit, int color) tty_setcolor (color); if (edit->fullscreen) - widget_move (w->owner, 0, WIDGET (w->owner)->cols - 6); + widget_gotoyx (w->owner, 0, WIDGET (w->owner)->cols - 6); else - widget_move (w, 0, w->cols - 8); + widget_gotoyx (w, 0, w->cols - 8); g_snprintf (tmp, sizeof (tmp), "[%s][%s]", edit_window_state_char, edit_window_close_char); tty_print_string (tmp); } diff --git a/src/editor/editwidget.c b/src/editor/editwidget.c index 6e7768277..189d2c42e 100644 --- a/src/editor/editwidget.c +++ b/src/editor/editwidget.c @@ -960,7 +960,7 @@ edit_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *da x = (e->fullscreen ? 0 : 1) + EDIT_TEXT_HORIZONTAL_OFFSET + option_line_state_width + e->curs_col + e->start_col + e->over_col; - widget_move (w, y, x); + widget_gotoyx (w, y, x); return MSG_HANDLED; } diff --git a/src/filemanager/achown.c b/src/filemanager/achown.c index e933d6fd8..11711f3ae 100644 --- a/src/filemanager/achown.c +++ b/src/filemanager/achown.c @@ -246,19 +246,19 @@ print_flags (const WDialog * h) for (i = 0; i < 3; i++) { - widget_move (h, BY + 1, advanced_chown_but[0].x + 6 + i); + widget_gotoyx (h, BY + 1, advanced_chown_but[0].x + 6 + i); tty_print_char (ch_flags[i]); } for (i = 0; i < 3; i++) { - widget_move (h, BY + 1, advanced_chown_but[1].x + 6 + i); + widget_gotoyx (h, BY + 1, advanced_chown_but[1].x + 6 + i); tty_print_char (ch_flags[i + 3]); } for (i = 0; i < 3; i++) { - widget_move (h, BY + 1, advanced_chown_but[2].x + 6 + i); + widget_gotoyx (h, BY + 1, advanced_chown_but[2].x + 6 + i); tty_print_char (ch_flags[i + 6]); } @@ -266,12 +266,12 @@ print_flags (const WDialog * h) for (i = 0; i < 15; i++) { - widget_move (h, BY + 1, advanced_chown_but[3].x + 6 + i); + widget_gotoyx (h, BY + 1, advanced_chown_but[3].x + 6 + i); tty_print_char (ch_flags[9]); } for (i = 0; i < 15; i++) { - widget_move (h, BY + 1, advanced_chown_but[4].x + 6 + i); + widget_gotoyx (h, BY + 1, advanced_chown_but[4].x + 6 + i); tty_print_char (ch_flags[10]); } } @@ -285,19 +285,19 @@ advanced_chown_refresh (WDialog * h) tty_setcolor (COLOR_NORMAL); - widget_move (h, BY - 1, advanced_chown_but[0].x + 5); + widget_gotoyx (h, BY - 1, advanced_chown_but[0].x + 5); tty_print_string (_("owner")); - widget_move (h, BY - 1, advanced_chown_but[1].x + 5); + widget_gotoyx (h, BY - 1, advanced_chown_but[1].x + 5); tty_print_string (_("group")); - widget_move (h, BY - 1, advanced_chown_but[2].x + 5); + widget_gotoyx (h, BY - 1, advanced_chown_but[2].x + 5); tty_print_string (_("other")); - widget_move (h, BY - 1, advanced_chown_but[3].x + 5); + widget_gotoyx (h, BY - 1, advanced_chown_but[3].x + 5); tty_print_string (_("owner")); - widget_move (h, BY - 1, advanced_chown_but[4].x + 5); + widget_gotoyx (h, BY - 1, advanced_chown_but[4].x + 5); tty_print_string (_("group")); - widget_move (h, BY + 1, 3); + widget_gotoyx (h, BY + 1, 3); tty_print_string (_("Flag")); print_flags (h); } diff --git a/src/filemanager/chmod.c b/src/filemanager/chmod.c index b2a6c2113..93559b7a8 100644 --- a/src/filemanager/chmod.c +++ b/src/filemanager/chmod.c @@ -183,9 +183,9 @@ chmod_toggle_select (WDialog * h, int Id) tty_setcolor (COLOR_NORMAL); check_perm[Id].selected = !check_perm[Id].selected; - widget_move (h, PY + Id + 1, PX + 1); + widget_gotoyx (h, PY + Id + 1, PX + 1); tty_print_char (check_perm[Id].selected ? '*' : ' '); - widget_move (h, PY + Id + 1, PX + 3); + widget_gotoyx (h, PY + Id + 1, PX + 3); } /* --------------------------------------------------------------------------------------------- */ diff --git a/src/filemanager/chown.c b/src/filemanager/chown.c index 72478eff5..be7b04280 100644 --- a/src/filemanager/chown.c +++ b/src/filemanager/chown.c @@ -157,15 +157,15 @@ chown_refresh (WDialog * h) tty_setcolor (COLOR_NORMAL); - widget_move (h, y + 0, x); + widget_gotoyx (h, y + 0, x); tty_print_string (_("Name")); - widget_move (h, y + 2, x); + widget_gotoyx (h, y + 2, x); tty_print_string (_("Owner name")); - widget_move (h, y + 4, x); + widget_gotoyx (h, y + 4, x); tty_print_string (_("Group name")); - widget_move (h, y + 6, x); + widget_gotoyx (h, y + 6, x); tty_print_string (_("Size")); - widget_move (h, y + 8, x); + widget_gotoyx (h, y + 8, x); tty_print_string (_("Permission")); } diff --git a/src/filemanager/find.c b/src/filemanager/find.c index 6cdfb5766..a5813e1f8 100644 --- a/src/filemanager/find.c +++ b/src/filemanager/find.c @@ -1250,7 +1250,7 @@ find_rotate_dash (const WDialog * h, gboolean show) const Widget *w = CONST_WIDGET (h); tty_setcolor (h->color[DLG_COLOR_NORMAL]); - widget_move (h, w->lines - 7, w->cols - 4); + widget_gotoyx (h, w->lines - 7, w->cols - 4); tty_print_char (show ? rotating_dash[pos] : ' '); pos = (pos + 1) % sizeof (rotating_dash); mc_refresh (); diff --git a/src/filemanager/info.c b/src/filemanager/info.c index 1703881f9..8c71c2512 100644 --- a/src/filemanager/info.c +++ b/src/filemanager/info.c @@ -88,12 +88,12 @@ info_box (WInfo * info) widget_erase (w); tty_draw_box (w->y, w->x, w->lines, w->cols, FALSE); - widget_move (w, 0, (w->cols - len - 2) / 2); + widget_gotoyx (w, 0, (w->cols - len - 2) / 2); tty_printf (" %s ", title); - widget_move (w, 2, 0); + widget_gotoyx (w, 2, 0); tty_print_alt_char (ACS_LTEE, FALSE); - widget_move (w, 2, w->cols - 1); + widget_gotoyx (w, 2, w->cols - 1); tty_print_alt_char (ACS_RTEE, FALSE); tty_draw_hline (w->y + 2, w->x + 1, ACS_HLINE, w->cols - 2); } @@ -117,7 +117,7 @@ info_show_info (WInfo * info) info_box (info); tty_setcolor (MARKED_COLOR); - widget_move (w, 1, 3); + widget_gotoyx (w, 1, 3); tty_printf (_("Midnight Commander %s"), VERSION); if (!info->ready) @@ -155,7 +155,7 @@ info_show_info (WInfo * info) default: MC_FALLTHROUGH; case 16: - widget_move (w, 16, 3); + widget_gotoyx (w, 16, 3); if ((myfs_stats.nfree == 0 && myfs_stats.nodes == 0) || (myfs_stats.nfree == (uintmax_t) (-1) && myfs_stats.nodes == (uintmax_t) (-1))) tty_print_string (_("No node information")); @@ -171,7 +171,7 @@ info_show_info (WInfo * info) (int) (100 * (long double) myfs_stats.nfree / myfs_stats.nodes)); MC_FALLTHROUGH; case 15: - widget_move (w, 15, 3); + widget_gotoyx (w, 15, 3); if (myfs_stats.avail == 0 && myfs_stats.total == 0) tty_print_string (_("No space information")); else @@ -186,40 +186,40 @@ info_show_info (WInfo * info) } MC_FALLTHROUGH; case 14: - widget_move (w, 14, 3); + widget_gotoyx (w, 14, 3); tty_printf (_("Type: %s"), myfs_stats.typename ? myfs_stats.typename : _("non-local vfs")); if (myfs_stats.type != 0xffff && myfs_stats.type != -1) tty_printf (" (%Xh)", (unsigned int) myfs_stats.type); MC_FALLTHROUGH; case 13: - widget_move (w, 13, 3); + widget_gotoyx (w, 13, 3); str_printf (buff, _("Device: %s"), str_trunc (myfs_stats.device, w->cols - i18n_adjust)); tty_print_string (buff->str); g_string_set_size (buff, 0); MC_FALLTHROUGH; case 12: - widget_move (w, 12, 3); + widget_gotoyx (w, 12, 3); str_printf (buff, _("Filesystem: %s"), str_trunc (myfs_stats.mpoint, w->cols - i18n_adjust)); tty_print_string (buff->str); g_string_set_size (buff, 0); MC_FALLTHROUGH; case 11: - widget_move (w, 11, 3); + widget_gotoyx (w, 11, 3); str_printf (buff, _("Accessed: %s"), file_date (st.st_atime)); tty_print_string (buff->str); g_string_set_size (buff, 0); MC_FALLTHROUGH; case 10: - widget_move (w, 10, 3); + widget_gotoyx (w, 10, 3); str_printf (buff, _("Modified: %s"), file_date (st.st_mtime)); tty_print_string (buff->str); g_string_set_size (buff, 0); MC_FALLTHROUGH; case 9: - widget_move (w, 9, 3); + widget_gotoyx (w, 9, 3); /* The field st_ctime is changed by writing or by setting inode information (i.e., owner, group, link count, mode, etc.). */ /* TRANSLATORS: Time of last status change as in stat(2) man. */ @@ -228,7 +228,7 @@ info_show_info (WInfo * info) g_string_set_size (buff, 0); MC_FALLTHROUGH; case 8: - widget_move (w, 8, 3); + widget_gotoyx (w, 8, 3); #ifdef HAVE_STRUCT_STAT_ST_RDEV if (S_ISCHR (st.st_mode) || S_ISBLK (st.st_mode)) tty_printf (_("Dev. type: major %lu, minor %lu"), @@ -246,27 +246,27 @@ info_show_info (WInfo * info) } MC_FALLTHROUGH; case 7: - widget_move (w, 7, 3); + widget_gotoyx (w, 7, 3); tty_printf (_("Owner: %s/%s"), get_owner (st.st_uid), get_group (st.st_gid)); MC_FALLTHROUGH; case 6: - widget_move (w, 6, 3); + widget_gotoyx (w, 6, 3); tty_printf (_("Links: %d"), (int) st.st_nlink); MC_FALLTHROUGH; case 5: - widget_move (w, 5, 3); + widget_gotoyx (w, 5, 3); tty_printf (_("Mode: %s (%04o)"), string_perm (st.st_mode), (unsigned) st.st_mode & 07777); MC_FALLTHROUGH; case 4: - widget_move (w, 4, 3); + widget_gotoyx (w, 4, 3); tty_printf (_("Location: %Xh:%Xh"), (unsigned int) st.st_dev, (unsigned int) st.st_ino); MC_FALLTHROUGH; case 3: { const char *fname; - widget_move (w, 3, 2); + widget_gotoyx (w, 3, 2); fname = current_panel->dir.list[current_panel->selected].fname; str_printf (buff, file_label, str_trunc (fname, w->cols - i18n_adjust)); tty_print_string (buff->str); diff --git a/src/filemanager/layout.c b/src/filemanager/layout.c index 733962cbb..12943d0ce 100644 --- a/src/filemanager/layout.c +++ b/src/filemanager/layout.c @@ -233,19 +233,19 @@ update_split (const WDialog * h) tty_setcolor (check_options[0].widget->state ? DISABLED_COLOR : COLOR_NORMAL); - widget_move (h, 6, 5); + widget_gotoyx (h, 6, 5); if (panels_layout.horizontal_split) tty_printf ("%03d", panels_layout.top_panel_size); else tty_printf ("%03d", panels_layout.left_panel_size); - widget_move (h, 6, 17); + widget_gotoyx (h, 6, 17); if (panels_layout.horizontal_split) tty_printf ("%03d", height - panels_layout.top_panel_size); else tty_printf ("%03d", CONST_WIDGET (midnight_dlg)->cols - panels_layout.left_panel_size); - widget_move (h, 6, 12); + widget_gotoyx (h, 6, 12); tty_print_char ('='); } @@ -325,9 +325,9 @@ layout_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void * { old_output_lines = _output_lines; tty_setcolor (mc_global.tty.console_flag != '\0' ? COLOR_NORMAL : DISABLED_COLOR); - widget_move (h, 9, 5); + widget_gotoyx (h, 9, 5); tty_print_string (output_lines_label); - widget_move (h, 9, 5 + 3 + output_lines_label_len); + widget_gotoyx (h, 9, 5 + 3 + output_lines_label_len); tty_printf ("%02d", _output_lines); } return MSG_HANDLED; @@ -367,7 +367,7 @@ layout_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void * { old_output_lines = _output_lines; tty_setcolor (mc_global.tty.console_flag != '\0' ? COLOR_NORMAL : DISABLED_COLOR); - widget_move (h, 9, 5 + 3 + output_lines_label_len); + widget_gotoyx (h, 9, 5 + 3 + output_lines_label_len); tty_printf ("%02d", _output_lines); } } @@ -964,7 +964,7 @@ rotate_dash (gboolean show) if (show && !mc_time_elapsed (×tamp, delay)) return; - widget_move (w, (menubar_visible != 0) ? 1 : 0, w->cols - 1); + widget_gotoyx (w, (menubar_visible != 0) ? 1 : 0, w->cols - 1); tty_setcolor (NORMAL_COLOR); if (!show) diff --git a/src/filemanager/panel.c b/src/filemanager/panel.c index 4f01e9a50..8d46d9f8b 100644 --- a/src/filemanager/panel.c +++ b/src/filemanager/panel.c @@ -937,7 +937,7 @@ repaint_file (WPanel * panel, int file_index, gboolean mv, int attr, gboolean is ypos %= panel_lines (panel); ypos += 2; /* top frame and header */ - widget_move (w, ypos, offset + 1); + widget_gotoyx (w, ypos, offset + 1); } ret_frm = format_file (panel, file_index, width, attr, isstatus, &fln); @@ -961,7 +961,7 @@ repaint_file (WPanel * panel, int file_index, gboolean mv, int attr, gboolean is } } - widget_move (w, ypos, offset); + widget_gotoyx (w, ypos, offset); tty_setcolor (NORMAL_COLOR); tty_print_string (panel_filename_scroll_left_char); @@ -971,7 +971,7 @@ repaint_file (WPanel * panel, int file_index, gboolean mv, int attr, gboolean is if (nth_column + 1 >= panel->list_cols) offset++; - widget_move (w, ypos, offset); + widget_gotoyx (w, ypos, offset); tty_setcolor (NORMAL_COLOR); tty_print_string (panel_filename_scroll_right_char); } @@ -988,7 +988,7 @@ display_mini_info (WPanel * panel) if (!panels_options.show_mini_info) return; - widget_move (w, panel_lines (panel) + 3, 1); + widget_gotoyx (w, panel_lines (panel) + 3, 1); if (panel->searching) { @@ -1098,7 +1098,7 @@ display_total_marked_size (const WPanel * panel, int y, int x, gboolean size_onl * y == panel_lines (panel) + 2 for mini_info_separator * y == w->lines - 1 for panel bottom frame */ - widget_move (w, y, x); + widget_gotoyx (w, y, x); tty_setcolor (MARKED_COLOR); tty_printf (" %s ", buf); } @@ -1163,7 +1163,7 @@ show_free_space (const WPanel * panel) g_snprintf (tmp, sizeof (tmp), " %s/%s (%d%%) ", buffer1, buffer2, myfs_stats.total == 0 ? 0 : (int) (100 * (long double) myfs_stats.avail / myfs_stats.total)); - widget_move (w, w->lines - 1, w->cols - 2 - (int) strlen (tmp)); + widget_gotoyx (w, w->lines - 1, w->cols - 2 - (int) strlen (tmp)); tty_setcolor (NORMAL_COLOR); tty_print_string (tmp); } @@ -1267,25 +1267,25 @@ show_dir (const WPanel * panel) y = panel_lines (panel) + 2; - widget_move (w, y, 0); + widget_gotoyx (w, y, 0); tty_print_alt_char (ACS_LTEE, FALSE); - widget_move (w, y, w->cols - 1); + widget_gotoyx (w, y, w->cols - 1); tty_print_alt_char (ACS_RTEE, FALSE); } - widget_move (w, 0, 1); + widget_gotoyx (w, 0, 1); tty_print_string (panel_history_prev_item_sign); tmp = panels_options.show_dot_files ? panel_hiddenfiles_sign_show : panel_hiddenfiles_sign_hide; tmp = g_strdup_printf ("%s[%s]%s", tmp, panel_history_show_list_sign, panel_history_next_item_sign); - widget_move (w, 0, w->cols - 6); + widget_gotoyx (w, 0, w->cols - 6); tty_print_string (tmp); g_free (tmp); - widget_move (w, 0, 3); + widget_gotoyx (w, 0, 3); if (panel->is_panelized) tty_printf (" %s ", _("Panelize")); @@ -1296,7 +1296,7 @@ show_dir (const WPanel * panel) if (tmp != NULL) { tty_printf ("%s", tmp); - widget_move (w, 0, 3 + strlen (tmp)); + widget_gotoyx (w, 0, 3 + strlen (tmp)); g_free (tmp); } } @@ -1322,7 +1322,7 @@ show_dir (const WPanel * panel) size_trunc_sep (panel->dir.list[panel->selected].st.st_size, panels_options.kilobyte_si)); tty_setcolor (NORMAL_COLOR); - widget_move (w, w->lines - 1, 4); + widget_gotoyx (w, w->lines - 1, 4); tty_print_string (buffer); } } @@ -1518,7 +1518,7 @@ panel_paint_sort_info (const WPanel * panel) char *str; str = g_strdup_printf ("%s%s", sort_sign, Q_ (panel->sort_field->hotkey)); - widget_move (panel, 1, 1); + widget_gotoyx (panel, 1, 1); tty_print_string (str); g_free (str); } @@ -1558,7 +1558,7 @@ panel_print_header (const WPanel * panel) int i; GString *format_txt; - widget_move (w, 1, 1); + widget_gotoyx (w, 1, 1); tty_getyx (&y, &x); tty_setcolor (NORMAL_COLOR); tty_draw_hline (y, x, ' ', w->cols - 2); diff --git a/src/filemanager/tree.c b/src/filemanager/tree.c index d5d0464c6..8630da696 100644 --- a/src/filemanager/tree.c +++ b/src/filemanager/tree.c @@ -241,7 +241,7 @@ tree_show_mini_info (WTree * tree, int tree_lines, int tree_cols) /* Show search string */ tty_setcolor (INPUT_COLOR); tty_draw_hline (w->y + line, w->x + 1, ' ', tree_cols); - widget_move (w, line, 1); + widget_gotoyx (w, line, 1); tty_print_char (PATH_SEP); tty_print_string (str_fit_to_term (tree->search_buffer, tree_cols - 2, J_LEFT_FIT)); tty_print_char (' '); @@ -253,7 +253,7 @@ tree_show_mini_info (WTree * tree, int tree_lines, int tree_cols) tty_setcolor (tree->is_panel ? NORMAL_COLOR : TREE_NORMALC (h)); tty_draw_hline (w->y + line, w->x + 1, ' ', tree_cols); - widget_move (w, line, 1); + widget_gotoyx (w, line, 1); tty_print_string (str_fit_to_term (vfs_path_as_str (tree->selected_ptr->name), tree_cols, J_LEFT_FIT)); } @@ -276,7 +276,7 @@ show_tree (WTree * tree) tree_lines = tlines (tree); tree_cols = w->cols; - widget_move (w, y, x); + widget_gotoyx (w, y, x); if (tree->is_panel) { tree_cols -= 2; @@ -1124,7 +1124,7 @@ tree_frame (WDialog * h, WTree * tree) tty_draw_box (w->y, w->x, w->lines, w->cols, FALSE); - widget_move (w, 0, (w->cols - len - 2) / 2); + widget_gotoyx (w, 0, (w->cols - len - 2) / 2); tty_printf (" %s ", title); if (panels_options.show_mini_info) @@ -1132,9 +1132,9 @@ tree_frame (WDialog * h, WTree * tree) int y; y = w->lines - 3; - widget_move (w, y, 0); + widget_gotoyx (w, y, 0); tty_print_alt_char (ACS_LTEE, FALSE); - widget_move (w, y, w->cols - 1); + widget_gotoyx (w, y, w->cols - 1); tty_print_alt_char (ACS_RTEE, FALSE); tty_draw_hline (w->y + y, w->x + 1, ACS_HLINE, w->cols - 2); } diff --git a/src/help.c b/src/help.c index bdba440f5..94615ab30 100644 --- a/src/help.c +++ b/src/help.c @@ -420,7 +420,7 @@ help_print_word (WDialog * h, GString * word, int *col, int *line, gboolean add_ g_string_set_size (word, 0); else { - widget_move (h, *line + 2, *col + 2); + widget_gotoyx (h, *line + 2, *col + 2); tty_print_string (word->str); g_string_set_size (word, 0); *col += w; @@ -512,7 +512,7 @@ help_show (WDialog * h, const char *paint_start) acs = FALSE; break; case CHAR_VERSION: - widget_move (h, line + 2, col + 2); + widget_gotoyx (h, line + 2, col + 2); tty_print_string (VERSION); col += str_term_width1 (VERSION); break; @@ -557,7 +557,7 @@ help_show (WDialog * h, const char *paint_start) g_string_append (word, buff); else if (col < HELP_WINDOW_WIDTH) { - widget_move (h, line + 2, col + 2); + widget_gotoyx (h, line + 2, col + 2); if ((c == ' ') || (c == '.')) tty_print_char (c); @@ -598,7 +598,7 @@ help_show (WDialog * h, const char *paint_start) /* Position the cursor over a nice link */ if (active_col) - widget_move (h, active_line, active_col); + widget_gotoyx (h, active_line, active_col); } /* --------------------------------------------------------------------------------------------- */ diff --git a/src/viewer/ascii.c b/src/viewer/ascii.c index 8cd74879b..2c117701d 100644 --- a/src/viewer/ascii.c +++ b/src/viewer/ascii.c @@ -680,7 +680,7 @@ mcview_display_line (WView * view, mcview_state_machine_t * state, int row, { /* The combining character sequence fits entirely in the viewport. Print it. */ tty_setcolor (color); - widget_move (view, top + row, left + ((off_t) col - dpy_text_column)); + widget_gotoyx (view, top + row, left + ((off_t) col - dpy_text_column)); if (cs[0] == '\t') { for (i = 0; i < charwidth; i++) @@ -708,7 +708,7 @@ mcview_display_line (WView * view, mcview_state_machine_t * state, int row, for (i = dpy_text_column; i < (off_t) col + charwidth && i < dpy_text_column + (off_t) width; i++) { - widget_move (view, top + row, left + (i - dpy_text_column)); + widget_gotoyx (view, top + row, left + (i - dpy_text_column)); tty_print_anychar ((cs[0] == '\t') ? ' ' : PARTIAL_CJK_AT_LEFT_MARGIN); } } @@ -721,7 +721,7 @@ mcview_display_line (WView * view, mcview_state_machine_t * state, int row, tty_setcolor (color); for (i = col; i < dpy_text_column + (off_t) width; i++) { - widget_move (view, top + row, left + (i - dpy_text_column)); + widget_gotoyx (view, top + row, left + (i - dpy_text_column)); tty_print_anychar ((cs[0] == '\t') ? ' ' : PARTIAL_CJK_AT_RIGHT_MARGIN); } } @@ -906,7 +906,7 @@ mcview_display_text (WView * view) if (mcview_show_eof != NULL && mcview_show_eof[0] != '\0') while (row < (int) height) { - widget_move (view, top + row, left); + widget_gotoyx (view, top + row, left); /* TODO: should make it no wider than the viewport */ tty_print_string (mcview_show_eof); row++; diff --git a/src/viewer/display.c b/src/viewer/display.c index 665e20fe4..3acd38d9f 100644 --- a/src/viewer/display.c +++ b/src/viewer/display.c @@ -133,10 +133,10 @@ mcview_display_percent (WView * view, off_t p) const screen_dimen top = view->status_area.top; const screen_dimen right = view->status_area.left + view->status_area.width; - widget_move (view, top, right - 4); + widget_gotoyx (view, top, right - 4); tty_printf ("%3d%%", percent); /* avoid cursor wrapping in NCurses-base MC */ - widget_move (view, top, right - 1); + widget_gotoyx (view, top, right - 1); } } @@ -164,7 +164,7 @@ mcview_display_status (WView * view) if (width > 40) { - widget_move (view, top, width - 32); + widget_gotoyx (view, top, width - 32); if (view->mode_flags.hex) tty_printf ("0x%08" PRIxMAX, (uintmax_t) view->hex_cursor); else @@ -182,7 +182,7 @@ mcview_display_status (WView * view) ""); } } - widget_move (view, top, left); + widget_gotoyx (view, top, left); if (width > 40) tty_print_string (str_fit_to_term (file_label, width - 34, J_LEFT_FIT)); else @@ -384,7 +384,7 @@ mcview_display_ruler (WView * view) cl = view->dpy_text_column + c; if (line_row < height) { - widget_move (view, top + line_row, left + c); + widget_gotoyx (view, top + line_row, left + c); tty_print_char (ruler_chars[cl % 10]); } @@ -393,7 +393,7 @@ mcview_display_ruler (WView * view) g_snprintf (r_buff, sizeof (r_buff), "%" PRIuMAX, (uintmax_t) cl); if (nums_row < height) { - widget_move (view, top + nums_row, left + c - 1); + widget_gotoyx (view, top + nums_row, left + c - 1); tty_print_string (r_buff); } } diff --git a/src/viewer/hex.c b/src/viewer/hex.c index a952cd5cb..b980b5996 100644 --- a/src/viewer/hex.c +++ b/src/viewer/hex.c @@ -160,7 +160,7 @@ mcview_display_hex (WView * view) size_t i; g_snprintf (hex_buff, sizeof (hex_buff), "%08" PRIXMAX " ", (uintmax_t) from); - widget_move (view, top + row, left); + widget_gotoyx (view, top + row, left); tty_setcolor (VIEW_BOLD_COLOR); for (i = 0; col < width && hex_buff[i] != '\0'; col++, i++) tty_print_char (hex_buff[i]); @@ -276,7 +276,7 @@ mcview_display_hex (WView * view) view->hexview_in_text ? VIEW_SELECTED_COLOR : VIEW_UNDERLINED_COLOR); /* Print the hex number */ - widget_move (view, top + row, left + col); + widget_gotoyx (view, top + row, left + col); if (col < width) { tty_print_char (hex_char[c / 16]); @@ -349,7 +349,7 @@ mcview_display_hex (WView * view) /* Print corresponding character on the text side */ if (text_start + bytes < width) { - widget_move (view, top + row, left + text_start + bytes); + widget_gotoyx (view, top + row, left + text_start + bytes); #ifdef HAVE_CHARSET if (view->utf8) tty_print_anychar (ch); diff --git a/src/viewer/move.c b/src/viewer/move.c index 00268a735..2240e5a83 100644 --- a/src/viewer/move.c +++ b/src/viewer/move.c @@ -382,7 +382,7 @@ mcview_place_cursor (WView * view) screen_dimen col = view->cursor_col; if (!view->hexview_in_text && view->hexedit_lownibble) col++; - widget_move (view, top + view->cursor_row, left + col); + widget_gotoyx (view, top + view->cursor_row, left + col); } /* --------------------------------------------------------------------------------------------- */