void tty_print_string (const char *s) { int len; int start = 0; s = str_term_form (s); len = str_term_width1 (s); /* line is upper or below the screen or entire line is before or after scrren */ if (mc_curs_row < 0 || mc_curs_row >= LINES || mc_curs_col + len <= 0 || mc_curs_col >= COLS) { mc_curs_col += len; return; } /* skip invisible left part */ if (mc_curs_col < 0) { start = -mc_curs_col; len += mc_curs_col; mc_curs_col = 0; } mc_curs_col += len; if (mc_curs_col >= COLS) len = COLS - (mc_curs_col - len); addstr (str_term_substring (s, start, len)); }
void tty_print_anychar (int c) { char str[6 + 1]; if (c > 255) { int res = g_unichar_to_utf8 (c, str); if (res == 0) { str[0] = '.'; str[1] = '\0'; } else { str[res] = '\0'; } SLsmg_write_string ((char *) str_term_form (str)); } else { if (!is_printable (c)) c = '.'; SLsmg_write_char ((SLwchar_Type) ((unsigned int) c)); } }
/** Show current directory in the xterm title */ void update_xterm_title_path (void) { char *p; char *path; char *login; if (!(mc_global.tty.xterm_flag && xterm_title)) return; title_path_prepare (&path, &login); p = g_strdup_printf ("mc [%s]:%s", login, path); fprintf (stdout, "\33]0;%s\7", str_term_form (p)); g_free (login); g_free (p); if (!mc_global.tty.alternate_plus_minus) numeric_keypad_mode (); (void) fflush (stdout); g_free (path); }
void tty_print_anychar (int c) { unsigned char str[6 + 1]; if (mc_global.utf8_display || c > 255) { int res; res = g_unichar_to_utf8 (c, (char *) str); if (res == 0) { if (yx_in_screen (mc_curs_row, mc_curs_col)) addch ('.'); mc_curs_col++; } else { const char *s; str[res] = '\0'; s = str_term_form ((char *) str); if (yx_in_screen (mc_curs_row, mc_curs_col)) addstr (s); if (g_unichar_iswide (c)) mc_curs_col += 2; else if (!g_unichar_iszerowidth (c)) mc_curs_col++; } } else { if (yx_in_screen (mc_curs_row, mc_curs_col)) addch (c); mc_curs_col++; } }
void tty_print_string (const char *s) { SLsmg_write_string ((char *) str_term_form (s)); }