From c106872dd21b8b229941a942f6a5e2d4a5b7b575 Mon Sep 17 00:00:00 2001 From: Joursoir Date: Wed, 1 Dec 2021 19:31:29 +0300 Subject: tbi/win: support echoing input chars --- Library/UefiShellUfmCommandLib/tbi/win.c | 8 ++++++++ Library/UefiShellUfmCommandLib/tbi/win.h | 12 ++++++++++++ 2 files changed, 20 insertions(+) (limited to 'Library/UefiShellUfmCommandLib') diff --git a/Library/UefiShellUfmCommandLib/tbi/win.c b/Library/UefiShellUfmCommandLib/tbi/win.c index 1496808..55171da 100644 --- a/Library/UefiShellUfmCommandLib/tbi/win.c +++ b/Library/UefiShellUfmCommandLib/tbi/win.c @@ -58,6 +58,7 @@ struct window *newwin(struct screen *s, win->width = ncols; win->height = nlines; win->cur_attr = s->attr; + win->echo = FALSE; for(y = 0; y < nlines; y++) { win->text[y] = AllocatePool((ncols + 1) * sizeof(CHAR16)); @@ -114,6 +115,13 @@ VOID wattroff(struct window *w) w->cur_attr = w->scr->attr; } +VOID echo(struct window *w, BOOLEAN state) +{ + ASSERT(w != NULL); + + w->echo = state; +} + BOOLEAN wmove(struct window *w, INT32 x, INT32 y) { ASSERT(w != NULL); diff --git a/Library/UefiShellUfmCommandLib/tbi/win.h b/Library/UefiShellUfmCommandLib/tbi/win.h index 76be2d8..02822d4 100644 --- a/Library/UefiShellUfmCommandLib/tbi/win.h +++ b/Library/UefiShellUfmCommandLib/tbi/win.h @@ -29,6 +29,7 @@ struct window { INT32 **attr; INT32 cur_attr; + BOOLEAN echo; }; /* @@ -74,6 +75,17 @@ VOID wattrset(struct window *w, INT32 attr); */ VOID wattroff(struct window *w); +/* + * Changes the echo state. Echoing is disabled by default. + * + * w: the window on which to operate + * state: TRUE if the echo should be activated. FALSE if the + * echo should be disabled + * + * return: VOID +*/ +VOID echo(struct window *w, BOOLEAN state); + /* * Moves cursor position to specified coordinates * -- cgit v1.2.3-18-g5258