DD2-monitor/viz/curses/ecran.c

50 lines
958 B
C
Raw Normal View History

2019-01-10 01:44:47 +01:00
#include <stdio.h>
#include <stdlib.h>
2019-01-10 14:07:56 +01:00
#include <string.h>
2019-01-10 01:44:47 +01:00
#include <getopt.h>
#include <ncurses.h>
#include "ecran.h"
int verbosity;
/* ---------------------------------------------------------------- */
/* ---------------------------------------------------------------- */
void barre_inverse(char c, int ligne)
{
int foo;
standout();
for (foo=0; foo<COLS; foo++)
mvaddch(ligne, foo, c);
standend();
/* refresh(); */
}
/* ---------------------------------------------------------------- */
2019-01-10 14:07:56 +01:00
int fond_ecran(char *title)
2019-01-10 01:44:47 +01:00
{
2019-01-10 14:07:56 +01:00
char *tp;
2019-01-10 01:44:47 +01:00
#if TRACE
int foo;
char buffer[200];
#endif
2019-01-10 14:07:56 +01:00
tp = " DD2 MONITORING by tTh 2019 ";
if (NULL != title) tp = title;
barre_inverse(' ', 0);
2019-01-10 01:44:47 +01:00
standout();
2019-01-10 14:07:56 +01:00
mvaddstr(0, 2, tp);
2019-01-10 01:44:47 +01:00
#if TRACE
sprintf(buffer, " ecran %dx%d ", COLS, LINES);
foo = strlen(buffer);
mvaddstr(0, COLS-2-foo, buffer);
#endif
standend();
refresh();
return 0;
}
/* ---------------------------------------------------------------- */