l10n: Updated Ukrainian (uk) translation to 100%
[midnight-commander.git] / lib / tty / tty.h
blobc5abd502b6dbf9ce6c22a66d46a3974b68f8be31
2 /** \file tty.h
3 * \brief Header: %interface to the terminal controlling library
5 * This file is the %interface to the terminal controlling library:
6 * slang or ncurses. It provides an additional layer of abstraction
7 * above the "real" libraries to keep the number of ifdefs in the other
8 * files small.
9 */
11 #ifndef MC_TTY_H
12 #define MC_TTY_H
14 #include "lib/global.h" /* include <glib.h> */
16 #ifdef HAVE_SLANG
17 # include "tty-slang.h"
18 #else
19 # include "tty-ncurses.h"
20 #endif
22 /* {{{ Input }}} */
24 extern int reset_hp_softkeys;
26 extern void tty_init (gboolean slow, gboolean ugly_lines);
27 extern void tty_shutdown (void);
29 extern gboolean tty_is_slow (void);
31 extern void tty_start_interrupt_key (void);
32 extern void tty_enable_interrupt_key (void);
33 extern void tty_disable_interrupt_key (void);
34 extern gboolean tty_got_interrupt (void);
36 extern void tty_reset_prog_mode (void);
37 extern void tty_reset_shell_mode (void);
39 extern void tty_raw_mode (void);
40 extern void tty_noraw_mode (void);
42 extern void tty_noecho (void);
43 extern int tty_flush_input (void);
45 extern void tty_keypad (gboolean set);
46 extern void tty_nodelay (gboolean set);
47 extern int tty_baudrate (void);
49 extern int tty_lowlevel_getch (void);
51 /* {{{ Output }}} */
54 The output functions do not check themselves for screen overflows,
55 so make sure that you never write more than what fits on the screen.
56 While SLang provides such a feature, ncurses does not.
59 extern int tty_reset_screen (void);
60 extern void tty_touch_screen (void);
62 extern void tty_gotoyx (int y, int x);
63 extern void tty_getyx (int *py, int *px);
65 extern void tty_set_alt_charset (gboolean alt_charset);
67 extern void tty_display_8bit (gboolean what);
68 extern void tty_print_char (int c);
69 extern void tty_print_alt_char (int c, gboolean single);
70 extern void tty_print_anychar (int c);
71 extern void tty_print_string (const char *s);
72 extern void tty_printf (const char *s, ...);
74 extern void tty_print_one_vline (gboolean single);
75 extern void tty_print_one_hline (gboolean single);
76 extern void tty_draw_hline (int y, int x, int ch, int len);
77 extern void tty_draw_vline (int y, int x, int ch, int len);
78 extern void tty_draw_box (int y, int x, int rows, int cols, gboolean single);
79 extern void tty_fill_region (int y, int x, int rows, int cols, unsigned char ch);
81 extern int mc_tty_frm[];
83 typedef enum
85 /* single lines */
86 MC_TTY_FRM_VERT,
87 MC_TTY_FRM_HORIZ,
88 MC_TTY_FRM_LEFTTOP,
89 MC_TTY_FRM_RIGHTTOP,
90 MC_TTY_FRM_LEFTBOTTOM,
91 MC_TTY_FRM_RIGHTBOTTOM,
92 MC_TTY_FRM_TOPMIDDLE,
93 MC_TTY_FRM_BOTTOMMIDDLE,
94 MC_TTY_FRM_LEFTMIDDLE,
95 MC_TTY_FRM_RIGHTMIDDLE,
96 MC_TTY_FRM_CROSS,
98 /* double lines */
99 MC_TTY_FRM_DVERT,
100 MC_TTY_FRM_DHORIZ,
101 MC_TTY_FRM_DLEFTTOP,
102 MC_TTY_FRM_DRIGHTTOP,
103 MC_TTY_FRM_DLEFTBOTTOM,
104 MC_TTY_FRM_DRIGHTBOTTOM,
105 MC_TTY_FRM_DTOPMIDDLE,
106 MC_TTY_FRM_DBOTTOMMIDDLE,
107 MC_TTY_FRM_DLEFTMIDDLE,
108 MC_TTY_FRM_DRIGHTMIDDLE,
110 MC_TTY_FRM_MAX
111 } mc_tty_frm_t;
113 extern char *tty_tgetstr (const char *name);
115 extern void tty_beep (void);
117 #define KEY_KP_ADD 4001
118 #define KEY_KP_SUBTRACT 4002
119 #define KEY_KP_MULTIPLY 4003
121 extern void tty_refresh (void);
122 extern void tty_setup_sigwinch (void (*handler) (int));
124 extern int mc_tty_normalize_lines_char (const char *);
126 #endif /* MC_TTY_H */