void init_ncurses_ui(double graph_limit_in, double hz_in, char use_colors_in) { graph_limit = graph_limit_in; hz = hz_in; use_colors = use_colors_in; initscr(); start_color(); keypad(stdscr, TRUE); intrflush(stdscr, FALSE); noecho(); refresh(); nodelay(stdscr, FALSE); meta(stdscr, TRUE); /* enable 8-bit input */ idlok(stdscr, TRUE); /* may give a little clunky screenredraw */ idcok(stdscr, TRUE); /* may give a little clunky screenredraw */ leaveok(stdscr, FALSE); init_pair(C_WHITE, COLOR_WHITE, COLOR_BLACK); init_pair(C_CYAN, COLOR_CYAN, COLOR_BLACK); init_pair(C_MAGENTA, COLOR_MAGENTA, COLOR_BLACK); init_pair(C_BLUE, COLOR_BLUE, COLOR_BLACK); init_pair(C_YELLOW, COLOR_YELLOW, COLOR_BLACK); init_pair(C_GREEN, COLOR_GREEN, COLOR_BLACK); init_pair(C_RED, COLOR_RED, COLOR_BLACK); kalman_init(0.0); recreate_terminal(); }
int main(int argc, char *argv[]) { /* Initialise the screen */ mywin = initscr(); noecho(); raw(); keypad(stdscr, TRUE); scrollok(mywin,1); idcok(mywin, 1); idlok(mywin, 1); /* Get the size of the window */ getmaxyx(mywin, nrows, ncols); clear(); refresh(); /* Set row and col */ r=0; c=0; /* The main loop */ while(1) { keyhandler(); } echo(); keypad(mywin, 0); endwin(); return 0; }
int con_init() { initscr(); start_color(); qiflush(); cbreak(); if ( !getenv("UNICON_NO_RAW") ) { /* To allow curses app to handle properly ctrl+z, ctrl+c, etc. I should not call raw() here, anyway it is known that this will cause misinterpretation of some keys (arrows) after resuming (SUSP -- ctrl+z)... So, unless UNICON_NO_RAW exported and set to any value raw() is called as usual. */ raw(); } noecho(); nonl(); // `return' translation off if (!has_colors()) fprintf(stderr,"Attention: A color terminal may be required to run this application !\n"); conio_scr=newwin(0,0,0,0); keypad(conio_scr,TRUE); // allow function keys (keypad) meta(conio_scr,TRUE); // switch to 8 bit terminal return values // intrflush(conio_scr,FALSE); // idlok(conio_scr,TRUE); // hardware line ins/del (required?) idcok(conio_scr,TRUE); // hardware char ins/del (required?) scrollok(conio_scr,TRUE); // scroll screen if required (cursor at bottom) /* Color initialization */ for ( __bg=0; __bg<8; __bg++ ) for ( __fg=0; __fg<8; __fg++ ) init_pair( CON_PAIR(__fg,__bg), colortab(__fg), colortab(__bg)); con_ta(7); return 0; }
void debug_console::init() { initscr(); start_color(); keypad(stdscr, TRUE); intrflush(stdscr, FALSE); noecho(); nonl(); refresh(); nodelay(stdscr, FALSE); meta(stdscr, TRUE); /* enable 8-bit input */ idlok(stdscr, TRUE); /* may give a little clunky screenredraw */ idcok(stdscr, TRUE); /* may give a little clunky screenredraw */ leaveok(stdscr, FALSE); init_pair(C_WHITE, COLOR_WHITE, COLOR_BLACK); init_pair(C_CYAN, COLOR_CYAN, COLOR_BLACK); init_pair(C_MAGENTA, COLOR_MAGENTA, COLOR_BLACK); init_pair(C_BLUE, COLOR_BLUE, COLOR_BLACK); init_pair(C_YELLOW, COLOR_YELLOW, COLOR_BLACK); init_pair(C_GREEN, COLOR_GREEN, COLOR_BLACK); init_pair(C_RED, COLOR_RED, COLOR_BLACK); recreate_terminal(); dc_log("Calibrating..."); wnoutrefresh(win_logs); doupdate(); nc = true; }
static bool test_opaque_idcok(WINDOW *win, int mode) { if (mode >= 0) { idcok(win, mode); } return is_idcok(win); }
void setup_screen() /* print the message at the center of the screen */ { char mesg[]="?: "; /* message to be appeared onn the screen */ mywin=initscr(); clear(); idcok(mywin, 1); idlok(mywin, 1); mvprintw(LINES - 2, 0, "!: %s", items); getmaxyx(stdscr,row,col);/* get the number of rows and columns */ cursor_row = row/5; cursor_col = (col-strlen(mesg))/4; mvprintw(cursor_row,cursor_col,"%s",mesg); }
int sc_enterStructuredMode () { if (initscr() == NULL) return FALSE; start_color(); scrollok(stdscr, TRUE); immedok(stdscr, FALSE); leaveok(stdscr, FALSE); idlok(stdscr, TRUE); idcok(stdscr, TRUE); intrflush(stdscr, FALSE); keypad(stdscr, FALSE); notimeout(stdscr, FALSE); raw(); noecho(); nl(); return TRUE; }
c_ecurses_idcok (EIF_POINTER p, EIF_BOOLEAN b) { idcok( (WINDOW *) p , (bool)b) ; };