diff options
author | Joursoir <chat@joursoir.net> | 2021-10-26 21:28:29 +0300 |
---|---|---|
committer | Joursoir <chat@joursoir.net> | 2021-10-26 21:28:29 +0300 |
commit | d4ce900ed5fc6a15b71421d1a65b374366983f9a (patch) | |
tree | eb76f7c4b56049cb3e7815e7d53d5fcbdfee80d6 /lib/tbi/win.c | |
parent | 642e48ad0625a65eec5ca216bb8d6ef5db7d457d (diff) | |
download | ufm-d4ce900ed5fc6a15b71421d1a65b374366983f9a.tar.gz ufm-d4ce900ed5fc6a15b71421d1a65b374366983f9a.tar.bz2 ufm-d4ce900ed5fc6a15b71421d1a65b374366983f9a.zip |
tbi/win: make mvwhline(), mvwvline()
Diffstat (limited to 'lib/tbi/win.c')
-rw-r--r-- | lib/tbi/win.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/lib/tbi/win.c b/lib/tbi/win.c index 4acc23f..3486c7a 100644 --- a/lib/tbi/win.c +++ b/lib/tbi/win.c @@ -150,3 +150,39 @@ BOOLEAN wborder(struct window *w, CHAR16 ls, CHAR16 rs, CHAR16 ts, return TRUE; } +BOOLEAN mvwhline(struct window *w, INT32 x, INT32 y, CHAR16 ch, INT32 n) +{ + UINTN i, length; + ASSERT(w != NULL); + CHECK_POSITION(w, x, y); + + length = w->width - x; + if(length > n) + length = n; + + length += x; + for(i = x; i < length; i++) { + w->text[y][i] = ch; + w->attr[y][i] = w->cur_attr; + } + return TRUE; +} + +BOOLEAN mvwvline(struct window *w, INT32 x, INT32 y, CHAR16 ch, INT32 n) +{ + UINTN i, length; + ASSERT(w != NULL); + CHECK_POSITION(w, x, y); + + length = w->height - y; + if(length > n) + length = n; + + length += y; + for(i = y; i < length; i++) { + w->text[i][x] = ch; + w->attr[i][x] = w->cur_attr; + } + return TRUE; +} + |