ViSP  2.8.0
vpCgidefs.h
1 /****************************************************************************
2  *
3  * $Id: vpCgidefs.h 4056 2013-01-05 13:04:42Z fspindle $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2013 by INRIA. All rights reserved.
7  *
8  * This software is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * ("GPL") version 2 as published by the Free Software Foundation.
11  * See the file LICENSE.txt at the root directory of this source
12  * distribution for additional information about the GNU GPL.
13  *
14  * For using ViSP with software that can not be combined with the GNU
15  * GPL, please contact INRIA about acquiring a ViSP Professional
16  * Edition License.
17  *
18  * See http://www.irisa.fr/lagadic/visp/visp.html for more information.
19  *
20  * This software was developed at:
21  * INRIA Rennes - Bretagne Atlantique
22  * Campus Universitaire de Beaulieu
23  * 35042 Rennes Cedex
24  * France
25  * http://www.irisa.fr/lagadic
26  *
27  * If you have questions regarding the use of this file, please contact
28  * INRIA at visp@inria.fr
29  *
30  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
31  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
32  *
33  *
34  * Description:
35  *
36  * Authors:
37  * Jean-Luc CORRE
38  *
39  *****************************************************************************/
40 
41 #ifndef vpCgidefs_H
42 #define vpCgidefs_H
43 
44 #include <visp/vpConfig.h>
45 #include <visp/vpCgiconstants.h> /* defines constants */
46 
47 #ifndef DOXYGEN_SHOULD_SKIP_THIS
48 
49 typedef char Cchar;
50 
51 typedef float Cfloat;
52 
53 typedef int Cint;
54 
55 typedef enum
56 {
57  ACTIVE, INACTIVE
58 } Cactstate;
59 
60 typedef enum
61 {
62  CLEAR, NO_OP, RETAIN
63 } Cacttype;
64 
65 
66 typedef enum
67 {
68  INDIVIDUAL, BUNDLED
69 } Casptype;
70 
71 typedef enum
72 {
73  VALID_DATA,
74  TIMED_OUT,
75  DISABLED,
76  WRONG_STATE,
77  NOT_SUPPORTED
78 } Cawresult;
79 
80 typedef enum
81 {
82  TRANSPARENT, OPAQUE
83 } Cbmode;
84 
85 typedef enum
86 {
87  BITNOT, BITTRUE
88 } Cbitmaptype;
89 
90 typedef enum
91 {
92  HOLLOW, SOLIDI, PATTERN, HATCH
93 } Cintertype;
94 
95 typedef enum
96 {
97  STRING, CHARACTER, STROKE
98 } Cprectype;
99 
100 typedef enum
101 {
102  SOLID, DOTTED, DASHED, DASHED_DOTTED, DASH_DOT_DOTTED, LONG_DASHED
103 } Clintype;
104 
105 typedef enum
106 {
107  DOT, PLUS, ASTERISK, CIRCLE, X
108 } Cmartype;
109 
110 typedef struct
111 {
112  Clintype line_type;
113  Cfloat line_width;
114  Cint line_color;
115  Cmartype marker_type;
116  Cfloat marker_size;
117  Cint marker_color;
118  Cintertype interior_style;
119  Cint hatch_index;
120  Cint pattern_index;
121  Cint fill_color;
122  Clintype perimeter_type;
123  Cfloat perimeter_width;
124  Cint perimeter_color;
125  Cint text_font;
126  Cprectype text_precision;
127  Cfloat character_expansion;
128  Cfloat character_spacing;
129  Cint text_color;
130 } Cbunatt;
131 
132 typedef struct
133 {
134  unsigned char *ra;
135  unsigned char *ga;
136  unsigned char *ba;
137  Cint n;
138 } Ccentry;
139 
140 typedef enum
141 {
142  OPEN, CLOSE
143 } Ccflag;
144 
145 typedef enum
146 {
147  YES, NO
148 } Cchangetype;
149 
150 typedef enum
151 {
152  NOCLIP,
153  CLIP,
154  CLIP_RECTANGLE
155 } Cclip;
156 
157 typedef enum
158 {
159  CHORD, PIE
160 } Cclosetype;
161 
162 typedef enum
163 {
164  REPLACE, AND, OR, NOT, XOR
165 } Ccombtype;
166 
167 typedef struct
168 {
169  Cint x;
170  Cint y;
171 } Ccoor;
172 
173 typedef struct
174 {
175  Ccoor *ptlist;
176  Cint n;
177 } Ccoorlist;
178 
179 typedef struct
180 {
181  Ccoor *upper;
182  Ccoor *lower;
183 } Ccoorpair;
184 
185 typedef enum
186 {
187  IC_LOCATOR,
188  IC_STROKE,
189  IC_VALUATOR,
190  IC_CHOICE,
191  IC_STRING,
192  IC_PICK
193 } Cdevoff;
194 
195 typedef enum
196 {
197  E_TRACK,
198  E_ECHO,
199  E_TRACK_OR_ECHO,
200  E_TRACK_AND_ECHO
201 } Cechoav;
202 
203 typedef enum
204 {
205  ECHO_OFF, ECHO_ON, TRACK_ON
206 } Cechostate;
207 
208 typedef enum
209 {
210  NO_ECHO, PRINTERS_FIST, HIGHLIGHT, RUBBER_BAND_BOX,
211  DOTTED_LINE, SOLID_LINE, STRING_ECHO, XLINE, YLINE
212 } Cechotype;
213 
214 typedef struct
215 {
216  Cint n;
217  Cechoav *elements;
218  Cechotype *echos;
219 } Cechotypelst;
220 
221 typedef struct
222 {
223  Cechostate *echos;
224  Cint n;
225 } Cechostatelst;
226 
227 typedef struct
228 {
229  int segid; /* segment */
230  int pickid; /* pick id */
231 } Cpick;
232 
233 typedef struct
234 {
235  Ccoor *xypt; /* LOCATOR */
236  Ccoorlist *points; /* STROKE devices */
237  Cfloat val; /* VALUATOR device */
238  Cint choice; /* CHOICE devices */
239  Cchar *string; /* STRING device */
240  Cpick *pick; /* PICK devices */
241 } Cinrep;
242 
243 typedef struct
244 {
245  Cinrep *echos;
246  Cint n;
247 } Cechodatalst;
248 
249 typedef enum
250 {
251  NATURAL, POINT, BEST_FIT
252 } Cendstyle;
253 
254 typedef enum
255 {
256  NO_OFLO, OFLO
257 } Ceqflow;
258 
259 typedef Cint Cerror;
260 
261 typedef enum
262 {
263  INTERRUPT, NO_ACTION, POLL
264 } Cerrtype;
265 
266 typedef enum
267 {
268  CLIP_RECT, VIEWPORT, VIEWSURFACE
269 } Cexttype;
270 
271 typedef enum
272 {
273  OFF, ON
274 } Cflag;
275 
276 typedef struct
277 {
278  Cintertype style;
279  Cflag visible;
280  Cint color;
281  Cint hatch_index;
282  Cint pattern_index;
283  Cint index;
284  Clintype pstyle;
285  Cfloat pwidth;
286  Cint pcolor;
287 } Cfillatt;
288 
289 typedef struct
290 {
291  Cint n;
292  Cint *num;
293  Casptype *value;
294 } Cflaglist;
295 
296 typedef enum
297 {
298  FREEZE, REMOVE
299 } Cfreeze;
300 
301 typedef struct
302 {
303  Clintype style;
304  Cfloat width;
305  Cint color;
306  Cint index;
307 } Clinatt;
308 
309 typedef enum
310 {
311  L_FALSE, L_TRUE
312 } Clogical;
313 
314 typedef struct pixrect Cpixrect;
315 
316 typedef enum
317 {
318  RELEASE, NO_EVENTS, REQUEST_EVENT, RESPOND_EVENT, QUEUE_EVENT
319 } Clidstate;
320 
321 typedef struct
322 {
323  Cmartype type;
324  Cfloat size;
325  Cint color;
326  Cint index;
327 } Cmarkatt;
328 
329 typedef enum
330 {
331  NO_INPUT, ALWAYS_ON, SETTABLE, DEPENDS_ON_LID
332 } Cinputability;
333 
334 typedef struct
335 {
336  Cint cur_index;
337  Cint row;
338  Cint column;
339  Cint *colorlist;
340  Ccoor *point;
341  Cint dx;
342  Cint dy;
343 } Cpatternatt;
344 
345 typedef enum
346 {
347  PROMPT_OFF, PROMPT_ON
348 } Cpromstate;
349 
350 typedef enum
351 {
352  ACK_ON, ACK_OFF
353 } Cackstate;
354 
355 
356 typedef struct
357 {
358  Cint n;
359  Cdevoff *class;
360  Cint *assoc;
361 } Cassoclid;
362 
363 typedef struct
364 {
365  Clidstate state;
366  Cpromstate prompt;
367  Cackstate acknowledgement;
368  Cinrep *current;
369  Cint n;
370  Cint *triggers;
371  Cechotype echotyp;
372  Cechostate echosta;
373  Cint echodat;
374 } Cstatelist;
375 
376 typedef struct
377 {
378  Clogical sample;
379  Cchangetype change;
380  Cint numassoc;
381  Cint *trigassoc;
382  Cinputability prompt;
383  Cinputability acknowledgement;
384  Cechotypelst *echo;
385  Cchar *classdep;
386  Cstatelist state;
387 } Cliddescript;
388 
389 typedef enum
390 {
391  SIMULTANEOUS_EVENT_FOLLOWS, SINGLE_EVENT
392 } Cmesstype;
393 
394 typedef enum
395 {
396  RIGHT, LEFT, UP, DOWN
397 } Cpathtype;
398 
399 typedef enum
400 {
401  LFT, CNTER, RGHT, NRMAL, CNT
402 } Chaligntype;
403 
404 typedef enum
405 {
406  TOP, CAP, HALF, BASE, BOTTOM, NORMAL, CONT
407 } Cvaligntype;
408 
409 typedef enum
410 {
411  NOT_VALID, EMPTY, NON_EMPTY, ALMOST_FULL, FULL
412 } Cqtype;
413 
414 typedef enum
415 {
416  ABSOLUTE, SCALED
417 } Cspecmode;
418 
419 typedef enum
420 {
421  NONE, REQUIRED_FUNCTIONS_ONLY, SOME_NON_REQUIRED_FUNCTIONS,
422  ALL_NON_REQUIRED_FUNCTIONS
423 } Csuptype;
424 
425 typedef struct
426 {
427  Cint fontset;
428  Cint index;
429  Cint current_font;
430  Cprectype precision;
431  Cfloat exp_factor;
432  Cfloat space;
433  Cint color;
434  Cint height;
435  Cfloat basex;
436  Cfloat basey;
437  Cfloat upx;
438  Cfloat upy;
439  Cpathtype path;
440  Chaligntype halign;
441  Cvaligntype valign;
442  Cfloat hcalind;
443  Cfloat vcalind;
444 } Ctextatt;
445 
446 typedef enum
447 {
448  NOT_FINAL, FINAL
449 } Ctextfinal;
450 
451 typedef struct
452 {
453  Cchangetype change;
454  Cassoclid *numassoc;
455  Cint maxassoc;
456  Cpromstate prompt;
457  Cackstate acknowledgement;
458  Cchar *name;
459  Cchar *description;
460 } Ctrigdis;
461 
462 typedef struct
463 {
464  Cactstate state;
465  Cassoclid *assoc;
466 } Ctrigstate;
467 
468 typedef enum
469 {
470  INTEGER, REAL, BOTH
471 } Cvdctype;
472 
473 typedef struct
474 {
475  Cint numloc;
476  Cint numval;
477  Cint numstrk;
478  Cint numchoice;
479  Cint numstr;
480  Cint numtrig;
481  Csuptype event_queue;
482  Csuptype asynch;
483  Csuptype coord_map;
484  Csuptype echo;
485  Csuptype tracking;
486  Csuptype prompt;
487  Csuptype acknowledgement;
488  Csuptype trigger_manipulation;
489 } Ccgidesctab;
490 
491 typedef struct
492 {
493  Cchar screenname[DEVNAMESIZE]; /* physical screen */
494  Cchar windowname[DEVNAMESIZE]; /* window */
495  Cint windowfd; /* window file */
496  Cint retained; /* retained flag */
497  Cint dd; /* device */
498  Cint cmapsize; /* color map size */
499  Cchar cmapname[DEVNAMESIZE]; /* color map name */
500  Cint flags; /* new flag */
501  Cchar **ptr; /* CGI tool descriptor */
502 } Cvwsurf;
503 
504 
505 
506 /* define abnormal function calls */
507 
508 Cpixrect *inquire_device_bitmap();
509 Clinatt *inquire_line_attributes();
510 Cmarkatt *inquire_marker_attributes();
511 Cfillatt *inquire_fill_area_attributes();
512 Cpatternatt *inquire_pattern_attributes();
513 Ctextatt *inquire_text_attributes();
514 Cflaglist *inquire_aspect_source_flags();
515 
516 /* define abnormal CGIPW function calls */
517 Clinatt *cgipw_inquire_line_attributes();
518 Cmarkatt *cgipw_inquire_marker_attributes();
519 Cfillatt *cgipw_inquire_fill_area_attributes();
520 Cpatternatt *cgipw_inquire_pattern_attributes();
521 Ctextatt *cgipw_inquire_text_attributes();
522 Cflaglist *cgipw_inquire_aspect_source_flags();
523 #endif
524 
525 #endif