aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2021-10-25 17:24:55 +0000
committerJoursoir <chat@joursoir.net>2021-10-25 17:25:27 +0000
commitc862a3b4d59fd7f0c54240d13c034ac64a5185b7 (patch)
treeea344ee96a19edcce39a56e53c0e90430e2a193f
parentd807043b4b2fd18a7ea6af362787d2e6130472a4 (diff)
downloadufm-c862a3b4d59fd7f0c54240d13c034ac64a5185b7.tar.gz
ufm-c862a3b4d59fd7f0c54240d13c034ac64a5185b7.tar.bz2
ufm-c862a3b4d59fd7f0c54240d13c034ac64a5185b7.zip
tbi/win: make wmove()
-rw-r--r--lib/tbi/win.c11
-rw-r--r--lib/tbi/win.h11
2 files changed, 22 insertions, 0 deletions
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 */