From c862a3b4d59fd7f0c54240d13c034ac64a5185b7 Mon Sep 17 00:00:00 2001 From: Joursoir Date: Mon, 25 Oct 2021 17:24:55 +0000 Subject: tbi/win: make wmove() --- lib/tbi/win.c | 11 +++++++++++ lib/tbi/win.h | 11 +++++++++++ 2 files changed, 22 insertions(+) (limited to 'lib/tbi') diff --git a/lib/tbi/win.c b/lib/tbi/win.c index bf674a2..9129403 100644 --- a/lib/tbi/win.c +++ b/lib/tbi/win.c @@ -106,3 +106,14 @@ VOID wattroff(struct window *w) w->cur_attr = w->scr->attr; } + +BOOLEAN wmove(struct window *w, INT32 x, INT32 y) +{ + ASSERT(w != NULL); + CHECK_POSITION(w, x, y); + + w->curx = x; + w->cury = y; + return TRUE; +} + diff --git a/lib/tbi/win.h b/lib/tbi/win.h index 1539877..9057369 100644 --- a/lib/tbi/win.h +++ b/lib/tbi/win.h @@ -74,4 +74,15 @@ VOID wattrset(struct window *w, INT32 attr); */ VOID wattroff(struct window *w); +/* + * Moves cursor position to specified coordinates + * + * w: the window on which to operate + * x: the X(column) coordinate + * y: the Y(row) coordinate + * + * return: FALSE upon failure and TRUE upon successful completion +*/ +BOOLEAN wmove(struct window *w, INT32 x, INT32 y); + #endif /* UFM_TBI_WINDOW_H */ -- cgit v1.2.3-18-g5258