From 51635072ddd0fe714a7d9983288abbb32315824f Mon Sep 17 00:00:00 2001 From: Joursoir Date: Sun, 24 Oct 2021 21:08:31 +0000 Subject: tbi/win: make wattrset(), wattroff() --- lib/tbi/win.c | 14 ++++++++++++++ lib/tbi/win.h | 20 ++++++++++++++++++++ 2 files changed, 34 insertions(+) (limited to 'lib/tbi') diff --git a/lib/tbi/win.c b/lib/tbi/win.c index 69ba895..e3ba31e 100644 --- a/lib/tbi/win.c +++ b/lib/tbi/win.c @@ -88,3 +88,17 @@ VOID delwin(struct window *w) FreePool(w); } + +VOID wattrset(struct window *w, INT32 attr) +{ + ASSERT(w != NULL); + + w->cur_attr = attr; +} + +VOID wattroff(struct window *w) +{ + ASSERT(w != NULL); + + w->cur_attr = w->scr->attr; +} diff --git a/lib/tbi/win.h b/lib/tbi/win.h index 2de5310..1539877 100644 --- a/lib/tbi/win.h +++ b/lib/tbi/win.h @@ -54,4 +54,24 @@ struct window *newwin(struct screen *s, */ VOID delwin(struct window *w); +/* + * Sets the current attributes of the given window + * + * w: the window on which to operate + * attr: the attributes + * + * return: VOID +*/ +VOID wattrset(struct window *w, INT32 attr); + +/* + * Resets the current attributes of the given window to standard screen + * attributes + * + * w: the window on which to operate + * + * return: VOID +*/ +VOID wattroff(struct window *w); + #endif /* UFM_TBI_WINDOW_H */ -- cgit v1.2.3-18-g5258