1 /********************************************************************
2 This file is part of the abs 0.907 distribution.  abs is a spreadsheet
3 with graphical user interface.
4 
5 Copyright (C) 1998-2001  Andr� Bertin (Andre.Bertin@ping.be)
6 
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version if in the same spirit as version 2.
11 
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 Concact: abs@pi.be
22          http://home.pi.be/bertin/abs.shtml
23 
24 *********************************************************************/
25 
26 
27 
28 
29 
30 
31 
32 
33 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 
44 
45 
46 
47 
48 
49 
50 
51 #ifndef FINITE_STATE_H
52 #define FINITE_STATE_H
53 
54 
55 
56 
57 
58 
59 
60 
61 
62 
63 
64 
65 
66 
67 
68 
69 
70 
71 
72 
73 
74 
75 
76 
77 
78 
79 
80 
81 
82 
83 
84 
85 
86 
87 
88 
89 
90 
91 
92 
93 
94 
95 
96 
97 
98 
99 
100 
101 
102 
103 
104 
105 
106 
107 
108 
109 
110 
111 
112 
113 
114 
115 
116 
117 
118 
119 
120 
121 
122 
123 
124 
125 
126 
127 
128 
129 
130 
131 
132 
133 
134 
135 
136 
137 
138 
139 
140 
141 
142 
143 
144 
145 
146 
147 
148 
149 
150 
151 
152 
153 
154 
155 
156 
157 
158 
159 
160 
161 
162 
163 
164 
165 
166 
167 
168 
169 
170 
171 
172 
173 
174 
175 
176 
177 
178 
179 
180 
181 
182 
183 
184 
185 
186 
187 
188 
189 
190 
191 
192 
193 
194 
195 
196 
197 
198 
199 
200 
201 
202 
203 
204 
205 
206 
207 
208 
209 
210 
211 
212 
213 
214 
215 
216 
217 
218 
219 
220 
221 
222 
223 
224 
225 
226 
227 
228 
229 
230 
231 
232 
233 
234 
235 
236 
237 
238 
239 
240 
241 #define START    0
242 #define BTN1DOWN 1
243 #define BTN1MOVE 2
244 #define BTN1UP   3
245 #define BTN2DOWN 4
246 #define BTN2MOVE 5
247 #define BTN2UP   6
248 #define BTN3DOWN 7
249 #define BTN3MOVE 8
250 #define BTN3UP   9
251 #define POINTERMOVE 10
252 
253 
254 #define EVENT_DRAW 1
255 #define EVENT_COLINDEX 2
256 #define EVENT_ROWINDEX 3
257 #define EVENT_CORNER 4
258 
259 
260 #define StBatch -1
261 #define StUndefine 0
262 #define StUndefined 0
263 #define StCell 1
264 #define StBorder 2
265 #define StSelection 10
266 #define StGrap 3
267 #define StBrush 4
268 #define StPopup 20
269 #define StChart 30
270 #define StDrawing 40
271 
272 
273 
274 #define SELECTING 100
275 #define EDITING   200
276 #define MODIFIED  300
277 
278 
279 #define StFree 1
280 #define StRight 5
281 
282 
283 
284 #define CREATE_CHART 1
285 #define END_CREATE_CHART 2
286 #define SELECT_CHART 3
287 
288 
289 #define StLinindex 1
290 #define StColindex 2
291 #define StCorner 3
292 
293 
294 #define StOn 1
295 #define StDown 2
296 #define StUp 3
297 #define StMotion 4
298 #define StShift 5
299 
300 
301 #define READYEDITDRAWING    1
302 #define STARTCREATEDRAWING  2
303 #define CREATINGDRAWING     3
304 #define ENDCREATEDRAWING  4
305 #define EDITINGDRAWING      5
306 #define StLine 1
307 #define StRect 2
308 #define StArc 3
309 #define StCircle 4
310 #define StButton 5
311 
312 struct _State
313   {
314     int l1;
315     int l2;
316     int l3;
317     int l4;
318     int l5;
319     int l6;
320     int downx;
321     int downy;
322     int movex;
323     int movey;
324     int upx;
325     int upy;
326     int downr;
327     int downc;
328     int mover;
329     int movec;
330     int upr;
331     int upc;
332     int row;
333     int col;
334   };
335 
336 typedef struct _State State;
337 
338 extern State *FS;
339 
340 extern int state_init ();
341 extern int state_print (char *message);
342 extern int state_reset_levels ();
343 #endif
344