X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=ui%2Fncurses%2Fnc-scr.c;h=a02627bae946b761b78484c40fd306022aaed63d;hp=c6172e1e4c6d11e0e022d92cbc6fef9a2f7c90c8;hb=73ee21af6d0a379a104a21b7569331284b3659b7;hpb=31ae49c6bfaa3cd65969bff7448be0f6385a6255 diff --git a/ui/ncurses/nc-scr.c b/ui/ncurses/nc-scr.c index c6172e1..a02627b 100644 --- a/ui/ncurses/nc-scr.c +++ b/ui/ncurses/nc-scr.c @@ -16,9 +16,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#if defined(HAVE_CONFIG_H) #include "config.h" - -#define _GNU_SOURCE +#endif #include #include @@ -36,8 +36,22 @@ static void nc_scr_status_clear(struct nc_scr *scr) static void nc_scr_status_draw(struct nc_scr *scr) { - mvwaddstr(scr->main_ncw, LINES - nc_scr_pos_status, 1, - scr->frame.status); + mvwaddnstr(scr->main_ncw, LINES - nc_scr_pos_status, 1, + scr->frame.status, COLS); +} + +int nc_scr_post(struct nc_scr *scr) +{ + if (scr->post) + return scr->post(scr); + return 0; +} + +int nc_scr_unpost(struct nc_scr *scr) +{ + if (scr->unpost) + return scr->unpost(scr); + return 0; } void nc_scr_frame_draw(struct nc_scr *scr) @@ -114,7 +128,7 @@ int nc_scr_init(struct nc_scr *scr, enum pb_nc_sig sig, int begin_x, scr->sub_ncw = derwin(scr->main_ncw, LINES - nc_scr_frame_lines, - COLS - 1 - begin_x, + COLS - nc_scr_frame_cols - begin_x, nc_scr_pos_sub, begin_x);