[coreboot] libpayload: implement wborder function

Jordan Crouse jordan.crouse at amd.com
Wed May 14 22:11:00 CEST 2008


On 14/05/08 10:48 -0600, Myles Watson wrote:
> 
> 
> > -----Original Message-----
> > From: coreboot-bounces at coreboot.org [mailto:coreboot-bounces at coreboot.org]
> > On Behalf Of jordan.crouse at amd.com
> > Sent: Tuesday, May 13, 2008 5:34 PM
> > To: coreboot at coreboot.org
> > Cc: Jordan Crouse
> > Subject: [coreboot] [patch 5/5] libpayload: implement wborder function
> > 
> > Implement the wborder function for curses to draw a box around a window.
> > 
> > Signed-off-by: Jordan Crouse <jordan.crouse at amd.com>
> 
> Acked-by: Myles Watson <mylesgw at gmail.com>

r3317.  Thanks.

> Thanks,
> Myles
> 
> > Index: libpayload/curses/tinycurses.c
> > ===================================================================
> > --- libpayload.orig/curses/tinycurses.c	2008-05-13
> 13:51:05.000000000 -
> > 0600
> > +++ libpayload/curses/tinycurses.c	2008-05-13 14:08:27.000000000 -0600
> > @@ -464,7 +464,39 @@
> >  }
> >  // 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)
> >  {
> > 
> > --
> > Jordan Crouse
> > Systems Software Development Engineer
> > Advanced Micro Devices, Inc.
> > 
> > 
> > --
> > coreboot mailing list
> > coreboot at coreboot.org
> > http://www.coreboot.org/mailman/listinfo/coreboot
> 
> 

-- 
Jordan Crouse
Systems Software Development Engineer 
Advanced Micro Devices, Inc.





More information about the coreboot mailing list