summaryrefslogtreecommitdiff
path: root/payloads/libpayload
diff options
context:
space:
mode:
authorJordan Crouse <jordan.crouse@amd.com>2008-05-14 20:10:02 +0000
committerJordan Crouse <jordan.crouse@amd.com>2008-05-14 20:10:02 +0000
commit621c09563b5300b2ea9821d0e4aec9224bb1c97f (patch)
tree9297354147f605fb1240550d5c4a24cd73afbc3e /payloads/libpayload
parent3148935557fb9f11922e989c1fb40d86d2628d34 (diff)
downloadcoreboot-621c09563b5300b2ea9821d0e4aec9224bb1c97f.tar.xz
libpayload: implement wborder function
Implement the wborder function for curses to draw a box around a window. Signed-off-by: Jordan Crouse <jordan.crouse@amd.com> Acked-by: Myles Watson <mylesgw@gmail.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3317 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'payloads/libpayload')
-rw-r--r--payloads/libpayload/curses/tinycurses.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/payloads/libpayload/curses/tinycurses.c b/payloads/libpayload/curses/tinycurses.c
index 8fc9bde268..08b858e3c0 100644
--- a/payloads/libpayload/curses/tinycurses.c
+++ b/payloads/libpayload/curses/tinycurses.c
@@ -464,7 +464,39 @@ int wattr_off(WINDOW *win, attr_t at, void *opts GCC_UNUSED)
}
// int wbkgd (WINDOW *, chtype) {}
void wbkgdset(WINDOW *win, chtype ch) { /* TODO */ }
-// int wborder (WINDOW *,chtype,chtype,chtype,chtype,chtype,chtype,chtype,chtype) {}
+
+int wborder(WINDOW *win, chtype ls, chtype rs, chtype ts, chtype bs,
+ chtype tl, chtype tr, chtype bl, chtype br)
+{
+ int x, y;
+
+ for(y = 0; y <= win->_maxy; y++) {
+
+ if (y == 0) {
+ mvwaddch(win, y, 0, tl);
+
+ for(x = 1; x < win->_maxx; x++)
+ mvwaddch(win, y, x, ts);
+
+ mvwaddch(win, y, win->_maxx, tr);
+ }
+ else if (y == win->_maxy) {
+ mvwaddch(win, y, 0, bl);
+
+ for(x = 1; x < win->_maxx; x++)
+ mvwaddch(win, y, x, bs);
+
+ mvwaddch(win, y, win->_maxx, br);
+ }
+ else {
+ mvwaddch(win, y, 0, ls);
+ mvwaddch(win, y, win->_maxx, rs);
+ }
+ }
+
+ return OK;
+}
+
// int wchgat (WINDOW *, int, attr_t, short, const void *) {}
/* D */ int wclear(WINDOW *win)
{