2006-12-20 07:12:04 +01:00
|
|
|
#include <stddef.h>
|
2006-06-08 19:23:37 +02:00
|
|
|
#include <curses.h>
|
|
|
|
|
2006-06-21 12:35:46 +02:00
|
|
|
/** @file
|
|
|
|
*
|
|
|
|
* MuCurses initialisation functions
|
|
|
|
*
|
|
|
|
*/
|
2006-06-08 19:23:37 +02:00
|
|
|
|
2015-03-02 13:04:57 +01:00
|
|
|
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
2009-05-01 16:41:06 +02:00
|
|
|
|
2006-06-08 19:23:37 +02:00
|
|
|
/**
|
|
|
|
* Initialise console environment
|
|
|
|
*
|
|
|
|
* @ret *win return pointer to stdscr
|
|
|
|
*/
|
|
|
|
WINDOW *initscr ( void ) {
|
|
|
|
/* determine console size */
|
|
|
|
/* initialise screen */
|
2006-12-19 01:27:25 +01:00
|
|
|
stdscr->scr->init( stdscr->scr );
|
2006-06-21 12:35:46 +02:00
|
|
|
stdscr->height = LINES;
|
|
|
|
stdscr->width = COLS;
|
2009-01-31 08:36:05 +01:00
|
|
|
move ( 0, 0 );
|
2006-06-08 19:23:37 +02:00
|
|
|
return stdscr;
|
|
|
|
}
|
2006-12-19 01:27:25 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Finalise console environment
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
int endwin ( void ) {
|
2006-12-20 07:12:04 +01:00
|
|
|
attrset ( 0 );
|
|
|
|
color_set ( 0, NULL );
|
2013-12-02 18:23:09 +01:00
|
|
|
curs_set ( 1 );
|
2009-01-31 08:36:05 +01:00
|
|
|
mvprintw ( ( LINES - 1 ), 0, "\n" );
|
2006-12-19 01:27:25 +01:00
|
|
|
stdscr->scr->exit( stdscr->scr );
|
|
|
|
return OK;
|
|
|
|
}
|