diff options
author | Egor Duda <deo@logos-m.ru> | 2001-02-27 09:14:35 +0000 |
---|---|---|
committer | Egor Duda <deo@logos-m.ru> | 2001-02-27 09:14:35 +0000 |
commit | a53136cc468fb88a7481eb7f6a86951222a688da (patch) | |
tree | 1fa0a5b44cca0e2e1c2da7754789cb8627c8c628 /winsup/cygwin/fhandler.h | |
parent | 5b331f1ef18682349a65af219c987fe827246531 (diff) | |
download | newlib-a53136cc468fb88a7481eb7f6a86951222a688da.zip newlib-a53136cc468fb88a7481eb7f6a86951222a688da.tar.gz newlib-a53136cc468fb88a7481eb7f6a86951222a688da.tar.bz2 |
* fhandler.h (class fhandler_console): Make all variables that
describe "state" of console to be members of fhandler_console.
default_color is now the color which is set when console recieves
reset command.
* fhandler_console.cc (fhandler_console::fhandler_console): Turn
mouse handling and raw keyboard mode off by default. Initialize
state information.
* fhandler.cc (fhandler_console::set_raw_win32_keyboard_mode): New
function.
* fhandler_console.cc (fhandler_console::set_default_attr): New
function. Reset console attributes to default values.
* fhandler_console.cc (fhandler_console::open): Reset attributes.
* fhandler_console.cc (fhandler_console::get_win32_attr): New function.
Calculate win32-style console attribute based on terminal attributes.
* fhandler_console.cc (fhandler_console::set_cursor_maybe): Use
member variable.
* fhandler_console.cc (fhandler_console::read): If in raw-win32
keyboard mode, encode win32 keyboard events in \033{x;y;z;t;u;wK
sequences.
* fhandler_console.cc (fhandler_console::dup): Copy all state
information to the dup()ed handle.
* fhandler_console.cc (fhandler_console::scroll_screen): Use current
fill-in attribute.
* fhandler_console.cc (fhandler_console::clear_screen): Ditto.
* fhandler_console.cc (fhandler_console::char_command): Check if we
saw '?' symbol by member variable. Set terminal attributes on \033[Xm
commands. \033[24m - turn off underline mode, \033[27m - turn off
reverse mode, \033[39m - restore default foreground color.
\033[49m - restore default background color. \033[2000h - turn on raw
keyboard mode, \033[2000l - turn off raw keyboard mode.
* fhandler_console.cc (fhandler_console::write): Set attribues to
default values on reset command.
Diffstat (limited to 'winsup/cygwin/fhandler.h')
-rw-r--r-- | winsup/cygwin/fhandler.h | 61 |
1 files changed, 52 insertions, 9 deletions
diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index 92cf8c3..99321a1 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -575,14 +575,14 @@ public: virtual void __release_output_mutex (const char *fn, int ln) {} }; -/* This is a input and output console handle */ -class fhandler_console: public fhandler_termios +enum ansi_intensity { -private: - -/* Output state */ + INTENSITY_INVISIBLE, + INTENSITY_DIM, + INTENSITY_NORMAL, + INTENSITY_BOLD +}; - // enum {normal, gotesc, gotsquare, gotarg1, gotcommand} state; #define normal 1 #define gotesc 2 #define gotsquare 3 @@ -592,13 +592,55 @@ private: #define gettitle 7 #define eattitle 8 #define MAXARGS 10 + +/* This is a input and output console handle */ +class fhandler_console: public fhandler_termios +{ +private: + + WORD default_color, underline_color, dim_color; + +/* Output state */ int state_; int args_[MAXARGS]; int nargs_; - - DWORD default_color; + unsigned rarg; + BOOL saw_question_mark; + + char my_title_buf [TITLESIZE + 1]; + + WORD current_win32_attr; + ansi_intensity intensity; + BOOL underline, blink, reverse; + WORD fg, bg; + + /* saved cursor coordinates */ + int savex, savey; + + struct + { + short Top, Bottom; + } scroll_region; + struct + { + SHORT winTop; + SHORT winBottom; + COORD dwWinSize; + COORD dwBufferSize; + COORD dwCursorPosition; + WORD wAttributes; + } info; + + COORD dwLastCursorPosition; + DWORD dwLastButtonState; + int nModifiers; + + BOOL use_mouse; + BOOL raw_win32_keyboard_mode; /* Output calls */ + void set_default_attr (); + WORD get_win32_attr (); BOOL fillin_info (); void clear_screen (int, int, int, int); @@ -607,7 +649,8 @@ private: void cursor_get (int *, int *); void cursor_rel (int, int); const unsigned char * write_normal (unsigned const char*, unsigned const char *); - void char_command (char, bool); + void char_command (char); + BOOL set_raw_win32_keyboard_mode (BOOL); int output_tcsetattr (int a, const struct termios *t); /* Input calls */ |