* DevNotes: Add entry cgf-000024.

* fhandler.h (dev_console::state): Remove trailing underscore.
(dev_console::args): Ditto.
(dev_console::nargs): Ditto.
(dev_console::info): Eliminate subclass.
(dev_console::dwEnd): New field.
(dev_console::scroll_window): New function.
(dev_console::is_fullscreen): Ditto.
(dev_console::fillin): Rename from fillin_info.
(fhandler_console::scroll_buffer): Rename from scroll_screen.
* fhandler_console.cc: Throughout s/dev_state\.info/dev_state/g.  Accommodate
other name changes.
(dev_console::fillin): Accommodate rename.  Notice max x/y written to.  Forgo
memset if GetConsoleScreenBufferInfo fails.
(fhandler_console::scroll_buffer): Accommodate rename.  Don't treat y
coordinate of zero as top of screen.
(dev_console::is_fullscreen): New function.
(dev_console::scroll_window): Ditto.
(fhandler_console::clear_screen): Just scroll the screen when clearing the
screen in a state where the screen buffer is bigger than the screen.
(fhandler_console::char_command): Try harder to get 'S' and 'T' working in the
presence of a screen buffer.  Use temporary 'n' variable rather than
dev_state.args[0].  Use GNU ?: shortcut method.
This commit is contained in:
Christopher Faylor
2014-02-16 01:48:25 +00:00
parent f235534904
commit df2764ef93
5 changed files with 228 additions and 168 deletions

View File

@ -1263,9 +1263,9 @@ class dev_console
int meta_mask;
/* Output state */
int state_;
int args_[MAXARGS];
int nargs_;
int state;
int args[MAXARGS];
int nargs;
unsigned rarg;
bool saw_question_mark;
bool saw_greater_than_sign;
@ -1295,17 +1295,14 @@ class dev_console
{
short Top, Bottom;
} scroll_region;
struct console_attrs
{
SHORT winTop;
SHORT winBottom;
COORD dwWinSize;
COORD dwBufferSize;
COORD dwCursorPosition;
WORD wAttributes;
int set_cl_x (cltype);
int set_cl_y (cltype);
} info;
SHORT winTop;
SHORT winBottom;
COORD dwWinSize;
COORD dwBufferSize;
COORD dwCursorPosition;
WORD wAttributes;
COORD dwEnd;
COORD dwLastCursorPosition;
COORD dwMousePosition; /* scroll-adjusted coord of mouse event */
@ -1326,8 +1323,12 @@ class dev_console
DWORD con_to_str (char *d, int dlen, WCHAR w);
DWORD str_to_con (mbtowc_p, const char *, PWCHAR d, const char *s, DWORD sz);
void set_color (HANDLE);
bool fillin_info (HANDLE);
void set_default_attr ();
int set_cl_x (cltype);
int set_cl_y (cltype);
bool fillin (HANDLE);
bool is_fullscreen (int, int, int, int);
void scroll_window (HANDLE);
friend class fhandler_console;
};
@ -1358,7 +1359,7 @@ private:
void set_default_attr ();
void clear_screen (cltype, cltype, cltype, cltype);
void scroll_screen (int, int, int, int, int, int);
void scroll_buffer (int, int, int, int, int, int);
void cursor_set (bool, int, int);
void cursor_get (int *, int *);
void cursor_rel (int, int);