diff options
author | wm4 <wm4@nowhere> | 2013-12-18 15:03:08 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-12-20 21:07:57 +0100 |
commit | 4d4b82217126de3160299b3aefba1f6941623d30 (patch) | |
tree | e72cfa8070e7abfd6b5ef62176b19dd2e84e9673 /osdep/terminal.h | |
parent | a4fe95b0d8d339ba5afbdb5346ad8fd367a4a1c1 (diff) | |
download | mpv-4d4b82217126de3160299b3aefba1f6941623d30.tar.bz2 mpv-4d4b82217126de3160299b3aefba1f6941623d30.tar.xz |
terminal: abstract terminal color handling
Instead of making msg.c an ifdef hell for unix vs. windows code, move
the code to separate functions defined in terminal-unix.c/terminal-
win.c.
Drop the code that selects random colors for --msgmodule prefixes.
Diffstat (limited to 'osdep/terminal.h')
-rw-r--r-- | osdep/terminal.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/osdep/terminal.h b/osdep/terminal.h index 76cedd9928..fe4d5e32d5 100644 --- a/osdep/terminal.h +++ b/osdep/terminal.h @@ -25,6 +25,7 @@ #define MPLAYER_GETCH2_H #include <stdbool.h> +#include <stdio.h> /* Screen size. Initialized by load_termcap() and get_screen_size() */ extern int screen_width; @@ -33,12 +34,19 @@ 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); + +/* 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); |