Imported Upstream version 2.9.0
[debian/cc1111] / sim / ucsim / gui.src / obsolete / viewcl.h
1 /*
2  * Simulator of microcontrollers (viewcl.h)
3  *
4  * Copyright (C) 1999,99 Drotos Daniel, Talker Bt.
5  * 
6  * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu
7  *
8  */
9
10 /* This file is part of microcontroller simulator: ucsim.
11
12 UCSIM is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
16
17 UCSIM is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 GNU General Public License for more details.
21
22 You should have received a copy of the GNU General Public License
23 along with UCSIM; see the file COPYING.  If not, write to the Free
24 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
25 02111-1307, USA. */
26 /*@1@*/
27
28 #ifndef VIEWCL_HEADER
29 #define VIEWCL_HEADER
30
31 #include <curses.h>
32 #include <panel.h>
33
34 #include "pobjcl.h"
35
36 #include "palette.h"
37 #include "eventcl.h"
38
39
40 // Status flags
41 #define SF_NOTHING      0x0000
42 #define SF_SELECTED     0x0001
43 #define SF_FOCUSED      0x0002
44 #define SF_ACTIVE       0x0004
45
46 // Option flags
47 #define OF_NOTHING      0x0000
48 #define OF_SELECTABLE   0x0001
49
50
51 class cl_box: public cl_base
52 {
53 public:
54   int x, y;
55   int w, h;
56 public:
57   cl_box(int ix, int iy, int iw, int ih);
58   void set(int ix, int iy, int iw, int ih);
59   void move_rel(int dx, int dy);
60   void grow(int dw, int dh);
61 };
62
63
64 class cl_app;
65 class cl_group;
66
67 class cl_view: public cl_base
68 {
69 public:
70   char *name;
71   WINDOW *window;
72   PANEL *panel;
73   class cl_group *parent;
74   class cl_view *next, *last;
75   class cl_app *app;
76   class cl_gin *input;
77   class cl_box *pos;
78   int *palette;
79   unsigned int state; // See SF_XXXX
80   unsigned int options; // See OF_XXXX
81 public:
82   cl_view(class cl_box *ipos, char *iname, class cl_app *iapp);
83   cl_view(char *name, class cl_app *iapp);
84   ~cl_view(void);
85   virtual int init(void);
86   virtual class cl_gin *mk_input(void);
87   virtual int *mk_palette(void);
88   virtual int is_group(void) {return(0);}
89
90   virtual int ok(void);
91   virtual int draw(void);
92   virtual int update(void);
93   virtual int get_color(int color);
94   virtual int *get_palette(void);
95
96   virtual int get_event(struct t_event *event);
97   virtual int handle_event(struct t_event *event);
98   virtual int unhandled(struct t_event *event);
99   virtual int mk_event(struct t_event *event, FILE *f, int key);
100
101   virtual class cl_view *prev(void);
102   virtual class cl_view *prev_view(void);
103
104   virtual int select(void);
105   virtual int unselect(void);
106   virtual class cl_view *get_by_state(unsigned int what, int enabled)
107     {return(0);}
108   virtual int select_next() {return(0);}
109   virtual class cl_view *current_sub_view(void);
110   virtual void set_current(class cl_view *view) {}
111   virtual int terminal_view(void);
112   virtual void change_state(unsigned int what, int enable);
113 };
114
115
116 #endif
117
118 /* End of gui.src/viewcl.h */