Imported Upstream version 2.9.0
[debian/cc1111] / sim / ucsim / gui.src / serio.src / frontend.hh
1 /******************************************************************************
2  * to emulate the serial input and output of an 8051 controller               *
3  * frontend.hh - ncurses frontend                                             *
4  ******************************************************************************/
5 #include <sys/types.h>
6 #include <curses.h>
7 /*#include <term.h>*/
8 #include "config.h"
9
10 struct COORDS_S
11 {
12         int min_x;
13         int max_x;
14         int min_y;
15         int max_y;
16 };
17 typedef struct COORDS_S COORDS;
18
19 struct COORDINATES_S
20 {
21         int x;
22         int y;
23 };
24 typedef struct COORDINATES_S COORDINATES;
25
26
27 class Viewer
28 {
29         public:
30                 Viewer();
31                 ~Viewer();
32                 void DrawBox(void);
33                 void AddStrOutWin(char *string);
34                 void GetStrInWin(char *string);
35                 void AddChOutWin(char b);
36                 char GetChInWin(void);
37
38         private:
39                 WINDOW *inp, *outp;
40                 COORDS win_c, inp_c, outp_c;
41                 COORDINATES topleft, bottomright, current;
42                 int middle_y, middle_x;
43 };