summaryrefslogtreecommitdiffstats
path: root/osdep/terminal.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-08-21 22:11:38 +0200
committerwm4 <wm4@nowhere>2014-08-21 22:45:58 +0200
commit47b29094c34bdf0aab9f213c8eb2347993e4d505 (patch)
tree3c68821d10cd713c6d515705b79d1513160bd494 /osdep/terminal.h
parent218ace2b02e2f2a867c4b792d4a1ec03015d7294 (diff)
downloadmpv-47b29094c34bdf0aab9f213c8eb2347993e4d505.tar.bz2
mpv-47b29094c34bdf0aab9f213c8eb2347993e4d505.tar.xz
win32: emulate some ANSI terminal escape codes
We already redirect all terminal output through our own wrappers (for the sake of UTF-8), so we might as well use it to handle ANSI escape codes. This also changes behavior on UNIX: we don't retrieve some escape codes per terminfo anymore, and just hardcode them. Every terminal should understand them. The advantage is that we can pretend to have a real terminal in the normal player code, and Windows atrocities are locked away in glue code.
Diffstat (limited to 'osdep/terminal.h')
-rw-r--r--osdep/terminal.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/osdep/terminal.h b/osdep/terminal.h
index 4495bfb471..491d76975b 100644
--- a/osdep/terminal.h
+++ b/osdep/terminal.h
@@ -33,9 +33,6 @@ struct input_ctx;
extern int screen_width;
extern int screen_height;
-extern char *terminal_erase_to_end_of_line;
-extern char *terminal_cursor_up;
-
/* Global initialization for terminal output. */
int terminal_init(void);
@@ -45,10 +42,6 @@ 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);
@@ -59,4 +52,7 @@ void getch2_disable(void);
/* Enable and disable STDIN line-buffering */
void getch2_poll(void);
+// Windows only.
+void mp_write_console_ansi(void **wstream, char *buf);
+
#endif /* MPLAYER_GETCH2_H */