diff options
Diffstat (limited to 'osdep/terminal.h')
-rw-r--r-- | osdep/terminal.h | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/osdep/terminal.h b/osdep/terminal.h index 76cedd9928..c524adbc2b 100644 --- a/osdep/terminal.h +++ b/osdep/terminal.h @@ -25,6 +25,9 @@ #define MPLAYER_GETCH2_H #include <stdbool.h> +#include <stdio.h> + +struct input_ctx; /* Screen size. Initialized by load_termcap() and get_screen_size() */ extern int screen_width; @@ -33,12 +36,25 @@ extern int screen_height; /* Termcap code to erase to end of line */ extern char * erase_to_end_of_line; +/* Global initialization for terminal output. */ +int terminal_init(void); + +/* Setup ictx to read input commands from stdin (slave mode) */ +void terminal_setup_stdin_cmd_input(struct input_ctx *ictx); + +/* Setup ictx to read keys from the terminal */ +void terminal_setup_getch(struct input_ctx *ictx); + +/* Return whether the process has been backgrounded. */ +bool terminal_in_background(void); + +/* Set ANSI text foreground color. c is [-1, 7], where 0-7 are colors, and + * -1 means reset to default. stream is either stdout or stderr. */ +void terminal_set_foreground_color(FILE *stream, int c); + /* Get screen-size using IOCTL call. */ void get_screen_size(void); -/* Load key definitions from the TERMCAP database. 'termtype' can be NULL */ -int load_termcap(char *termtype); - /* Initialize getch2 */ void getch2_enable(void); void getch2_disable(void); @@ -46,18 +62,4 @@ void getch2_disable(void); /* Enable and disable STDIN line-buffering */ void getch2_poll(void); -/* Read a character or a special key code (see keycodes.h) */ -struct input_ctx; -bool getch2(struct input_ctx *ictx); - -#if defined(__MINGW32__) -// slave cmd function for Windows -int mp_input_slave_cmd_func(int fd,char* dest,int size); -#define USE_FD0_CMD_SELECT 0 -#define MP_INPUT_SLAVE_CMD_FUNC mp_input_slave_cmd_func -#else -#define USE_FD0_CMD_SELECT 1 -#define MP_INPUT_SLAVE_CMD_FUNC NULL -#endif - #endif /* MPLAYER_GETCH2_H */ |