static void mcview_display_status (mcview_t * view) { const screen_dimen top = view->status_area.top; const screen_dimen left = view->status_area.left; const screen_dimen width = view->status_area.width; const screen_dimen height = view->status_area.height; const char *file_label; if (height < 1) return; tty_setcolor (STATUSBAR_COLOR); tty_draw_hline (WIDGET (view)->y + top, WIDGET (view)->x + left, ' ', width); file_label = view->filename_vpath != NULL ? vfs_path_get_last_path_str (view->filename_vpath) : view->command != NULL ? view->command : ""; if (width > 40) { widget_move (view, top, width - 32); if (view->hex_mode) tty_printf ("0x%08" PRIxMAX, (uintmax_t) view->hex_cursor); else { char buffer[BUF_TRUNC_LEN + 1]; size_trunc_len (buffer, BUF_TRUNC_LEN, mcview_get_filesize (view), 0, panels_options.kilobyte_si); tty_printf ("%9" PRIuMAX "/%s%s %s", (uintmax_t) view->dpy_end, buffer, mcview_may_still_grow (view) ? "+" : " ", #ifdef HAVE_CHARSET mc_global.source_codepage >= 0 ? get_codepage_id (mc_global.source_codepage) : #endif ""); } } widget_move (view, top, left); if (width > 40) tty_print_string (str_fit_to_term (file_label, width - 34, J_LEFT_FIT)); else tty_print_string (str_fit_to_term (file_label, width - 5, J_LEFT_FIT)); if (width > 26) mcview_percent (view, view->hex_mode ? view->hex_cursor : view->dpy_end); }
static void mcview_display_status (mcview_t * view) { const screen_dimen top = view->status_area.top; const screen_dimen left = view->status_area.left; const screen_dimen width = view->status_area.width; const screen_dimen height = view->status_area.height; const char *file_label; screen_dimen file_label_width; if (height < 1) return; tty_setcolor (STATUSBAR_COLOR); widget_move (view, top, left); tty_draw_hline (-1, -1, ' ', width); file_label = view->filename ? view->filename : view->command ? view->command : ""; file_label_width = str_term_width1 (file_label) - 2; if (width > 40) { char buffer[BUF_TINY]; widget_move (view, top, width - 32); if (view->hex_mode) tty_printf ("0x%08" PRIxMAX, (uintmax_t) view->hex_cursor); else { size_trunc_len (buffer, 5, mcview_get_filesize (view), 0, panels_options.kilobyte_si); tty_printf ("%9" PRIuMAX "/%s%s %s", (uintmax_t) view->dpy_end, buffer, mcview_may_still_grow (view) ? "+" : " ", #ifdef HAVE_CHARSET mc_global.source_codepage >= 0 ? get_codepage_id (mc_global.source_codepage) : "" #else "" #endif ); } } widget_move (view, top, left); if (width > 40) tty_print_string (str_fit_to_term (file_label, width - 34, J_LEFT_FIT)); else tty_print_string (str_fit_to_term (file_label, width - 5, J_LEFT_FIT)); if (width > 26) mcview_percent (view, view->hex_mode ? view->hex_cursor : view->dpy_end); }
int mcview_search_update_cmd_callback (const void *user_data, gsize char_offset) { mcview_t *view = (mcview_t *) user_data; if (char_offset >= (gsize) view->update_activate) { view->update_activate += view->update_steps; if (verbose) { mcview_percent (view, char_offset); tty_refresh (); } if (tty_got_interrupt ()) return MC_SEARCH_CB_ABORT; } /* may be in future return from this callback will change current position * in searching block. Now this just constant return value. */ return MC_SEARCH_CB_OK; }