1 /*
2  * Author:      William Chia-Wei Cheng (bill.cheng@acm.org)
3  *
4  * Copyright (C) 2001-2009, William Chia-Wei Cheng.
5  *
6  * This file may be distributed under the terms of the Q Public License
7  * as defined by Trolltech AS of Norway and appearing in the file
8  * LICENSE.QPL included in the packaging of this file.
9  *
10  * THIS FILE IS PROVIDED AS IS WITH NO WARRANTY OF ANY KIND, INCLUDING
11  * THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
12  * PURPOSE.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
13  * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
14  * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
15  * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
16  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17  *
18  * @(#)$Header: /mm2/home/cvs/bc-src/tgif/const.h,v 1.24 2011/05/16 16:21:57 william Exp $
19  */
20 
21 #ifndef _TGIF_CONST_H_
22 #define _TGIF_CONST_H_
23 
24 #if __STDC__ || defined(__cplusplus) || defined(c_plusplus)
25 /* ANSI || C++ */
26 #ifdef _NO_PROTO
27    /* just in case ANSI or C++ doesn't handle function prototypes well */
28 #define ARGS_DECL(args) ()
29 #undef ARGS_DECL_USED
30 #else /* ~_NO_PROTO */
31 #define ARGS_DECL(args) args
32 #undef ARGS_DECL_USED
33 #define ARGS_DECL_USED 1
34 #endif /* _NO_PROTO */
35 #else /* ~(__STDC__ || defined(__cplusplus) || defined(c_plusplus)) */
36 #define ARGS_DECL(args) ()
37 #undef ARGS_DECL_USED
38 #endif /* __STDC__ || defined(__cplusplus) || defined(c_plusplus) */
39 
40 #include "tgif_dbg.h"
41 
42 #ifndef _NO_LOCALE_SUPPORT
43 #ifdef ENABLE_NLS
44 #define _(text)  gettext(text)
45 #define N_(text) text
46 #else /* ~ENABLE_NLS */
47 #define _(text)  text
48 #define N_(text) text
49 #endif /* ENABLE_NLS */
50 #else /* _NO_LOCALE_SUPPORT */
51 #define _(text)  text
52 #define N_(text) text
53 #endif /* ~_NO_LOCALE_SUPPORT */
54 
55 #define TOOL_NAME "Tgif"
56 
57 #ifndef NULL
58 #define NULL 0
59 #endif /* ~NULL */
60 
61 #ifndef TRUE
62 #define FALSE 0
63 #define TRUE 1
64 #endif /* ~TRUE */
65 
66 #define INVALID (-1)
67 #undef BAD
68 #define BAD (-2)
69 
70 #ifdef WIN32
71 #define DIR_SEP '\\'
72 #define DIR_SEP_STR "\\"
73 #else /* ~WIN32 */
74 #define DIR_SEP '/'
75 #define DIR_SEP_STR "/"
76 #endif /* WIN32 */
77 
78 #define SINGLECOLOR (FALSE)
79 #define MULTICOLOR (TRUE)
80 
81 #define BUTTONSMASK ((Button1Mask)|(Button2Mask)|(Button3Mask))
82 
83 #ifndef max
84 #define max(A,B) (((A)>(B)) ? (A) : (B))
85 #define min(A,B) (((A)>(B)) ? (B) : (A))
86 #endif /* ~max */
87 
88 #ifndef round
89 #define round(X) (((X) >= 0) ? (int)((X)+0.5) : (int)((X)-0.5))
90 #endif /* ~round */
91 
92 #ifndef M_PI
93 #define M_PI 3.14159265358979323846
94 #endif /* ~M_PI */
95 
96 #define INT_TOL (1.0e-5)
97 #define EQ_TOL (1.0e-8)
98 
99 #ifndef XK_KP_Left
100 #define XK_KP_Left      0xFF96
101 #define XK_KP_Up        0xFF97
102 #define XK_KP_Right     0xFF98
103 #define XK_KP_Down      0xFF99
104 #endif /* ~XK_KP_LEFT */
105 
106 #ifndef XK_KP_Delete
107 #define XK_KP_Insert    0xFF9E
108 #define XK_KP_Delete    0xFF9F
109 #endif /* ~XK_KP_Delete */
110 
111 #ifndef XK_Page_Up
112 #define XK_Page_Up      0xFF55
113 #define XK_Page_Down    0xFF56
114 #endif /* ~XK_Page_Up */
115 
116 #ifndef XK_KP_Page_Up
117 #define XK_KP_Page_Up   0xFF9A
118 #define XK_KP_Page_Down 0xFF9B
119 #endif /* ~XK_KP_Page_Up */
120 
121 #ifndef XK_KP_Home
122 #define XK_KP_Home      0xFF95
123 #define XK_KP_End       0xFF9C
124 #endif /* ~XK_KP_Home */
125 
126 #ifndef XK_Home
127 #define XK_Home         0xFF50
128 #define XK_End          0xFF57
129 #endif /* ~XK_Home */
130 
131 #define MAX_ZOOMED_IN 3
132 #define HALF_W(w) (((w)&0x1) ? ((w)>>1)+1 : ((w)>>1))
133 #define ZOOMED_HALF_W(w) ((zoomedIn) ? ((w)<<(zoomScale-1)) : \
134       ((((w)>>(zoomScale))&0x1) ? (((w)>>(zoomScale+1))+1) : \
135       ((w)>>(zoomScale+1))))
136 
137 #define OFFSET_X(AbsX) ((zoomedIn) ? (((AbsX)-drawOrigX)<<zoomScale) : \
138                                      (((AbsX)-drawOrigX)>>zoomScale))
139 #define OFFSET_Y(AbsY) ((zoomedIn) ? (((AbsY)-drawOrigY)<<zoomScale) : \
140                                      (((AbsY)-drawOrigY)>>zoomScale))
141 
142 #define OFFSET_DOUBLE_X(AbsX) \
143       ((zoomedIn) ? \
144       (((AbsX)-((double)drawOrigX))*((double)(1<<zoomScale))) : \
145       (((AbsX)-((double)drawOrigX))/((double)(1<<zoomScale))))
146 #define OFFSET_DOUBLE_Y(AbsY) \
147       ((zoomedIn) ? \
148       (((AbsY)-((double)drawOrigY))*((double)(1<<zoomScale))) : \
149       (((AbsY)-((double)drawOrigY))/((double)(1<<zoomScale))))
150 
151 #define ABS_X(OffsetX) ((zoomedIn) ? (((OffsetX)>>zoomScale)+drawOrigX) : \
152                                      (((OffsetX)<<zoomScale)+drawOrigX))
153 #define ABS_Y(OffsetY) ((zoomedIn) ? (((OffsetY)>>zoomScale)+drawOrigY) : \
154                                      (((OffsetY)<<zoomScale)+drawOrigY))
155 
156 #define ZOOMED_SIZE(AbsSize) ((zoomedIn) ? ((AbsSize)<<zoomScale) : \
157                                            ((AbsSize)>>zoomScale))
158 
159 #define ZOOMED_DOUBLE_SIZE(AbsSize) ((zoomedIn) ? \
160                                     ((AbsSize)*((double)(1<<zoomScale))) : \
161                                     ((AbsSize)/((double)(1<<zoomScale))))
162 
163 #define GRID_ZOOMED_SIZE(AbsSize) ((zoomedIn) ? (AbsSize) : \
164                                                 ((AbsSize)>>zoomScale))
165 
166 #define ABS_SIZE(ZoomedSize) ((zoomedIn) ? ((ZoomedSize)>>zoomScale) : \
167                                            ((ZoomedSize)<<zoomScale))
168 #define GRID_ABS_SIZE(ZoomedSize) ((zoomedIn) ? (ZoomedSize) : \
169                                                 ((ZoomedSize)<<zoomScale))
170 
171 #define SetRecVals(R,X,Y,W,H) ((R).x=(X),(R).y=(Y),(R).width=(W),(R).height=(H))
172 
173 #define MARK(W,GC,X,Y) XFillRectangle(mainDisplay,W,GC, \
174       (X)-handleSize,(Y)-handleSize,(handleSize<<1)+1,(handleSize<<1)+1)
175 #define MARKHR(W,GC,X,Y) XDrawRectangle(mainDisplay,W,GC, \
176       (X)-handleSize,(Y)-handleSize,(handleSize<<1),(handleSize<<1))
177 #define MARKV(W,GC,X,Y) XDrawLine(mainDisplay,W,GC, \
178       (X)-(handleSize+1),(Y),(X)+(handleSize+1),(Y)); \
179       XDrawLine(mainDisplay,W,GC,(X),(Y)-(handleSize+1),(X),(Y)+(handleSize+1))
180 #define MARKO(W,GC,X,Y) XFillArc(mainDisplay,W,GC, \
181       (X)-handleSize,(Y)-handleSize,(handleSize<<1)+1,(handleSize<<1)+1, \
182       0,(360<<6))
183 #define MARKHO(W,GC,X,Y) XDrawArc(mainDisplay,W,GC, \
184       (X)-handleSize,(Y)-handleSize,(handleSize<<1),(handleSize<<1), \
185       0,(360<<6))
186 #define PtInMark(PtX,PtY,MarkX,MarkY) ((PtX) >= (MarkX)-handleSize && \
187       (PtY) >= (MarkY)-handleSize && (PtX) <= (MarkX)+handleSize && \
188       (PtY) <= (MarkY)+handleSize)
189 #define MyDashedLine(W,GC,V,N) XDrawLines(mainDisplay,W,GC,V,N,CoordModeOrigin)
190 
191 #define GETINT(category,val,name) ScanValue("%d", &(val), name, category)
192 #define GETFLT(category,val,name) ScanValue("%f", &(val), name, category)
193 #define GETDBL(category,val,name) ScanValue("%lg", &(val), name, category)
194 #define GETSTR(category,val,name) ScanValue("%s", (val), name, category)
195 #define GETDYN(category,val,name) ScanDynStrValue(&(val), name, category)
196 
197 #define GetPinObj(ObjPtr) ((ObjPtr)->detail.r->pin_connected ? \
198       (ObjPtr)->detail.r->last : (ObjPtr)->detail.r->first)
199 #define GetTextObjFirstStrSeg(ObjPtr) \
200       ((ObjPtr)->detail.t->minilines.first->first_block->seg)
201 #define GetTextPtrFirstStrSeg(TextPtr) \
202       ((TextPtr)->minilines.first->first_block->seg)
203 
204 #define MAXSTRING 256
205 #define MAXPATHLENGTH 256
206 
207 #define COLORSTRLEN 40
208 
209 /* geometry stuff */
210 
211 #define MENU_IMAGE_W 64
212 #define MENU_IMAGE_H 20
213 #define CHOICE_IMAGE_W 32
214 #define CHOICE_IMAGE_H 20
215 #define SCROLLBAR_W 16
216 #define RULER_W 20
217 #define BRDR_W 1
218 #define WINDOW_PADDING 2
219 
220 /* object types */
221 
222 #define OBJ_POLY 0
223 #define OBJ_BOX 1
224 #define OBJ_OVAL 2
225 #define OBJ_TEXT 3
226 #define OBJ_POLYGON 4
227 #define OBJ_GROUP 5
228 #define OBJ_SYM 6
229 #define OBJ_ICON 7
230 #define OBJ_ARC 8
231 #define OBJ_RCBOX 9
232 #define OBJ_XBM 10
233 #define OBJ_XPM 11
234 #define OBJ_PIN 12 /* Please note that pins are not implemented yet! */
235 #define OBJ_SS 13 /* This is reserved */
236 
237 /* drawing modes */
238 
239 #define NOTHING 0
240 #define DRAWTEXT 1
241 #define DRAWBOX 2
242 #define DRAWCORNEROVAL 3
243 #define DRAWCENTEROVAL 4
244 #define DRAWEDGECIRCLE 5
245 #define DRAWPOLY 6
246 #define DRAWPOLYGON 7
247 #define DRAWARC 8
248 #define DRAWEDGEARC 9
249 #define DRAWRCBOX 10
250 #define FREEHAND 11
251 #define VERTEXMODE 12
252 #define ROTATEMODE 13
253 
254 #define MAXCHOICES 14
255 
256 /* stipple patterns */
257 
258 #define NONEPAT 0
259 #define SOLIDPAT 1
260 #define BACKPAT 2
261 #define SCROLLPAT 7
262 #define MAXPATTERNS 32
263 
264 #define NO_TRANSPAT_MODE 0
265 #define TRANSPAT_MODE 1
266 
267 #define MAXTRANSPATMODES 2
268 
269 /* line stuff */
270 
271 #define LINE_THIN 0
272 #define LINE_MEDIUM 1
273 #define LINE_THICK 2
274 #define LINE_CURVED 3 /* compatibility hack for fileVersion <= 3 */
275 
276 #define MAXLINEWIDTHS 7
277 
278 #define LT_STRAIGHT 0
279 #define LT_SPLINE 1
280 #define LT_INTSPLINE 2
281 #define LT_STRUCT_SPLINE 3
282 
283 #define MAXLINETYPES 4
284 
285 #define LS_PLAIN 0
286 #define LS_RIGHT 1
287 #define LS_LEFT 2
288 #define LS_DOUBLE 3
289 
290 #define MAXLINESTYLES 4
291 
292 #define MAXDASHES 9
293 
294 #define NOCONT (FALSE)
295 #define CONT (TRUE)
296 
297 #define NORB (FALSE)
298 #define RB (TRUE)
299 
300 #define CHANGE_WIDTH 0x1
301 #define CHANGE_AW    0x2
302 #define CHANGE_AH    0x4
303 
304 #define CHANGE_LINE_ALL (CHANGE_WIDTH|CHANGE_AW|CHANGE_AH)
305 
306 #define LCAP_BUTT 0
307 #define LCAP_ROUND 1
308 #define LCAP_SQUARE 2
309 
310 #define MAXLINECAPS 3
311 
312 #define ASTY_MASK_COMPAT  0x0001
313 #define ASTY_MASK_FILL    0x0002
314 #define ASTY_MASK_HALVES  0x000c
315 #define ASTY_MASK_SHAPES  0x0010
316 
317 #define ASTY_COMPAT       0x0 /* ASTY_MASK_COMPAT */
318 #define ASTY_FLEX         0x1 /* ASTY_MASK_COMPAT */
319 
320 #define ASTY_SOLIDPAT     0x0 /* ASTY_MASK_FILL */
321 #define ASTY_BACKPAT      0x2 /* ASTY_MASK_FILL */
322 
323 #define ASTY_LF_HALF_ONLY 0x4 /* ASTY_MASK_HALVES */
324 #define ASTY_RT_HALF_ONLY 0x8 /* ASTY_MASK_HALVES */
325 
326 #define ASTY_CIRCLE       1 /* not used */
327 #define ASTY_BOX          2 /* not used */
328 
329 /* font stuff */
330 
331 #define FONT_TIM 0
332 #define FONT_COU 1
333 #define FONT_HEL 2
334 #define FONT_CEN 3
335 #define FONT_SYM 4
336 
337 #define MAXFONTS 5
338 
339 #define STYLE_NR 0
340 #define STYLE_BR 1
341 #define STYLE_NI 2
342 #define STYLE_BI 3
343 
344 #define MAXFONTSTYLES 4
345 
346 #define FONT_DPI_75 0
347 #define FONT_DPI_100 1
348 
349 #define MAXFONTDPIS 2
350 
351 #define MAXFONTSIZES 6
352 
353 #define JUST_L 0
354 #define JUST_C 1
355 #define JUST_R 2
356 
357 #define MAXJUSTS 3
358 
359 #define PUSH_FONT 0
360 #define PUSH_SZ_UNIT 1
361 #define PUSH_STYLE 2
362 #define PUSH_JUST 3
363 #define PUSH_ROTATE 4
364 #define PUSH_PEN 5
365 #define PUSH_FILL 6
366 #define PUSH_TRANSPAT 7
367 #define PUSH_VSPACE 8
368 #define PUSH_COLORINDEX 9
369 #define PUSH_UNDERLINE_ON 10
370 #define PUSH_UNDERLINE_Y_OFFSET 11
371 #define PUSH_DOUBLEBYTE 12
372 #define PUSH_OVERLINE_ON 13
373 #define PUSH_OVERLINE_Y_OFFSET 14
374 
375 #define NUM_SZ_UNIT_PER_FONT_SIZE 5760
376 #define NUM_SZ_UNIT_PER_POINT_SIZE 10240
377 
378 #define FontSizeToSzUnit(font_sz) ((font_sz)*NUM_SZ_UNIT_PER_FONT_SIZE)
379 #define PointSizeToSzUnit(point_sz) ((point_sz)*NUM_SZ_UNIT_PER_POINT_SIZE)
380 
381 /* alignment */
382 
383 #define ALIGN_N 0
384 
385 #define ALIGN_L 1
386 #define ALIGN_C 2
387 #define ALIGN_R 3
388 
389 #define ALIGN_T 1
390 #define ALIGN_M 2
391 #define ALIGN_B 3
392 
393 #define ALIGN_S 4
394 
395 #define MAXALIGNS 5
396 
397 #define ALIGN_SHIFT (MAXALIGNS)
398 
399 #define ALIGN_NN ((ALIGN_N<<ALIGN_SHIFT)|ALIGN_N)
400 #define ALIGN_NT ((ALIGN_N<<ALIGN_SHIFT)|ALIGN_T)
401 #define ALIGN_NM ((ALIGN_N<<ALIGN_SHIFT)|ALIGN_M)
402 #define ALIGN_NB ((ALIGN_N<<ALIGN_SHIFT)|ALIGN_B)
403 #define ALIGN_NS ((ALIGN_N<<ALIGN_SHIFT)|ALIGN_S)
404 #define ALIGN_LN ((ALIGN_L<<ALIGN_SHIFT)|ALIGN_N)
405 #define ALIGN_LT ((ALIGN_L<<ALIGN_SHIFT)|ALIGN_T)
406 #define ALIGN_LM ((ALIGN_L<<ALIGN_SHIFT)|ALIGN_M)
407 #define ALIGN_LB ((ALIGN_L<<ALIGN_SHIFT)|ALIGN_B)
408 #define ALIGN_LS ((ALIGN_L<<ALIGN_SHIFT)|ALIGN_S)
409 #define ALIGN_CN ((ALIGN_C<<ALIGN_SHIFT)|ALIGN_N)
410 #define ALIGN_CT ((ALIGN_C<<ALIGN_SHIFT)|ALIGN_T)
411 #define ALIGN_CM ((ALIGN_C<<ALIGN_SHIFT)|ALIGN_M)
412 #define ALIGN_CB ((ALIGN_C<<ALIGN_SHIFT)|ALIGN_B)
413 #define ALIGN_CS ((ALIGN_C<<ALIGN_SHIFT)|ALIGN_S)
414 #define ALIGN_RN ((ALIGN_R<<ALIGN_SHIFT)|ALIGN_N)
415 #define ALIGN_RT ((ALIGN_R<<ALIGN_SHIFT)|ALIGN_T)
416 #define ALIGN_RM ((ALIGN_R<<ALIGN_SHIFT)|ALIGN_M)
417 #define ALIGN_RB ((ALIGN_R<<ALIGN_SHIFT)|ALIGN_B)
418 #define ALIGN_RS ((ALIGN_R<<ALIGN_SHIFT)|ALIGN_S)
419 #define ALIGN_SN ((ALIGN_S<<ALIGN_SHIFT)|ALIGN_N)
420 #define ALIGN_ST ((ALIGN_S<<ALIGN_SHIFT)|ALIGN_T)
421 #define ALIGN_SM ((ALIGN_S<<ALIGN_SHIFT)|ALIGN_M)
422 #define ALIGN_SB ((ALIGN_S<<ALIGN_SHIFT)|ALIGN_B)
423 #define ALIGN_SS ((ALIGN_S<<ALIGN_SHIFT)|ALIGN_S)
424 
425 #define ALIGN_OBJS_DIRECT 0
426 #define ALIGN_TO_GRID_DIRECT 1
427 #define ALIGN_TO_PAGE_DIRECT 2
428 
429 /* color */
430 
431 #define MAXCOLORS 11
432 
433 /* button stuff */
434 
435 #define BUTTON_INVERT 0
436 #define BUTTON_NORMAL 1
437 
438 /* page style */
439 
440 #define PORTRAIT 0
441 #define LANDSCAPE 1
442 #define HIGHPORT 2 /* obsolete */
443 #define HIGHLAND 3 /* obsolete */
444 #define SLIDEPORT 4 /* obsolete */
445 #define SLIDELAND 5 /* obsolete */
446 
447 #define MAXPAGESTYLES 2
448 
449 /* where to print */
450 
451 #define PRINTER 0
452 #define LATEX_FIG 1
453 #define PS_FILE 2
454 #define XBM_FILE 3
455 #define TEXT_FILE 4
456 #define EPSI_FILE 5
457 #define GIF_FILE 6
458 #define HTML_FILE 7
459 #define PDF_FILE 8
460 #define TIFFEPSI_FILE 9
461 #define PNG_FILE 10
462 #define JPEG_FILE 11
463 #define PPM_FILE 12
464 #define NETLIST_FILE 13
465 #define SVG_FILE 14
466 
467 #define MAXDEFWHERETOPRINT 15
468 
469 /* measurement */
470 
471 #define TIK_PER_PIXEL_SHIFTS 12
472 #define TIK_PER_PIXEL (1<<TIK_PER_PIXEL_SHIFTS)
473 
474 #define ENGLISH_GRID 0
475 #define METRIC_GRID 1
476 
477 #define PIX_PER_INCH 128
478 #define ONE_INCH (PIX_PER_INCH)
479 #define HALF_INCH (PIX_PER_INCH/2)
480 #define QUARTER_INCH (PIX_PER_INCH/4)
481 #define EIGHTH_INCH (PIX_PER_INCH/8)
482 
483 #define DEFAULT_ENGLISH_GRID (EIGHTH_INCH)
484 
485 #define PIX_PER_MM 5
486 #define ONE_MM (PIX_PER_MM)
487 #define TWO_MM (PIX_PER_MM*2)
488 #define FIVE_MM (PIX_PER_MM*5)
489 #define ONE_CM (PIX_PER_MM*10)
490 
491 #define DEFAULT_METRIC_GRID (TWO_MM)
492 
493 /* rotation -- clockwise */
494 
495 #define ROTATE0 0
496 #define ROTATE90 1
497 #define ROTATE180 2
498 #define ROTATE270 3
499 
500 #define CLOCKWISE90 (90<<6)
501 #define COUNTER90 ((-90)<<6)
502 #define CLOCKWISE180 (180<<6)
503 #define COUNTER180 ((-180)<<6)
504 #define CLOCKWISE270 (270<<6)
505 #define COUNTER270 ((-270)<<6)
506 
507 /* flipping */
508 
509 #define NO_FLIP 0
510 #define HORI_ODD (1<<0)
511 #define HORI_EVEN (1<<1)
512 #define VERT_ODD (1<<2)
513 #define VERT_EVEN (1<<3)
514 
515 /* arc */
516 
517 #define ARC_CCW 0 /* counter-clock-wise */
518 #define ARC_CW 1 /* clock-wise */
519 
520 /* main menu */
521 
522 #define MENU_FILE 0
523 #define MENU_EDIT 1
524 #define MENU_LAYOUT 2
525 #define MENU_ARRANGE 3
526 #define MENU_PROPERTIES 4
527 #define MENU_MOVEMODE 5
528 #define MENU_STACKEDPAGE 6
529 #define MENU_TILEDPAGE 7
530 #define MENU_PAGE 8
531 #define MENU_PAGELAYOUT 9
532 #define MENU_HORIALIGN 10
533 #define MENU_VERTALIGN 11
534 #define MENU_FONT 12
535 #define MENU_STYLE 13
536 #define MENU_SIZE 14
537 #define MENU_SHAPE 15
538 #define MENU_STRETCHTEXT 16
539 #define MENU_LINEDASH 17
540 #define MENU_LINESTYLE 18
541 #define MENU_LINETYPE 19
542 #define MENU_LINEWIDTH 20
543 #define MENU_FILL 21
544 #define MENU_PEN 22
545 #define MENU_TRANSPAT 23
546 #define MENU_COLOR 24
547 #define MENU_IMAGEPROC 25
548 #define MENU_NAVIGATE 26
549 #define MENU_SPECIAL 27
550 #define MENU_HELP 28
551 #define MENU_MODE 29
552 #define MENU_TANGRAM2 30
553 
554 #define MAXMENUS 31
555 #define MENU_MAIN 31 /* mainMenu is treated differently */
556 
557 /* file menu */
558 
559 #define FILE_NEW 0
560 #define FILE_OPEN 1
561 #define FILE_SAVE 2
562 #define FILE_SAVENEW 3
563 #define FILE_IMPORT 4
564 #define FILE_IMPORTXBM 5
565 #define FILE_IMPORTXPM 6
566 #define FILE_IMPORTEPS 7
567 #define FILE_IMPORTGIF 8
568 #define FILE_IMPORTOTHERS 9
569 #define FILE_EMBEDEPS 10
570 #define FILE_BROWSEXBM 11
571 #define FILE_BROWSEXPM 12
572 #define FILE_BROWSEOTHERS 13
573 #define FILE_DOMAIN 14
574 #define FILE_DUMP 15
575 #define FILE_USR_DUMP 16
576 #define FILE_DUMPSELECTED 17
577 #define FILE_PRINTONE 18
578 #define FILE_SETEXPORTTRIM 19
579 #define FILE_INPUT_POLY 20
580 #define FILE_INPUT_POLYGON 21
581 #define FILE_SET_TEMPLATE 22
582 #define FILE_SOLVE 23
583 #define FILE_SIMULATE 24
584 #define FILE_PROBE 25
585 #define FILE_ANIMATE 26
586 #define FILE_ESCAPE 27
587 #define FILE_SAVESELAS 28
588 #define FILE_SAVESYMINLIB 29
589 #define FILE_QUIT 30
590 
591 #define FILEMENUENTRIES 31
592 
593 /* move mode stuff */
594 
595 #define CONST_MOVE 0
596 #define UNCONST_MOVE 1
597 
598 #define MAXMOVEMODES 2
599 
600 /* stretchable text stuff */
601 
602 #define NO_STRETCHABLE_TEXT 0
603 #define STRETCHABLE_TEXT 1
604 
605 #define MAXSTRETCHABLEMODES 2
606 
607 /* arrange menu */
608 
609 #define ABUT_HORIZONTAL 0
610 #define ABUT_VERTICAL 1
611 
612 /* nagivate menu */
613 
614 #define NAVIGATE_BACK 0
615 #define NAVIGATE_FORWARD 1
616 #define NAVIGATE_REFRESH 2
617 #define NAVIGATE_HOTLIST 3
618 #define NAVIGATE_ADD 4
619 #define NAVIGATE_HISTORY 5
620 #define NAVIGATE_HYPERSPACE 6
621 
622 #define MAXNAVIGATEMENUS 7
623 
624 /* page menu */
625 
626 #define PAGE_NEXT 0
627 #define PAGE_PREV 1
628 #define PAGE_NAME 2
629 #define PAGE_GOTO 3
630 #define PAGE_ADDBEFORE 4
631 #define PAGE_ADDAFTER 5
632 #define PAGE_DEL 6
633 #define PAGE_PRINT_ONE_IN_STACK 7
634 #define PAGE_PAPER_SIZE_IN_STACK 8
635 #define PAGE_DEL_MANY 9
636 #define PAGE_PRINT_ONE_FILE_PER_PAGE 10
637 
638 #define MAXPAGESTACKMENUS 11
639 
640 #define PAGE_TOGGLELINE 0
641 #define PAGE_SIZING 1
642 #define PAGE_PRINT_ONE 2
643 #define PAGE_PAPER_SIZE 3
644 
645 #define MAXPAGETILEMENUS 4
646 
647 #define PAGE_STACK 0
648 #define PAGE_TILE 1
649 
650 #define MAXPAGELAYOUTMODES 2
651 
652 /* scroll stuff */
653 
654 #define VERT_SCROLLBAR 0
655 #define HORI_SCROLLBAR 1
656 
657 #define SCROLL_LEFTEND 0
658 #define SCROLL_LEFT 1
659 #define SCROLL_RIGHT 2
660 #define SCROLL_RIGHTEND 3
661 #define SCROLL_UPEND 4
662 #define SCROLL_UP 5
663 #define SCROLL_CHECKALL 6
664 #define SCROLL_UNCHECKALL 7
665 #define SCROLL_DOWN 8
666 #define SCROLL_DOWNEND 9
667 
668 #define MAXSCROLLBUTTONS 10
669 
670 #define SCRL_UP 0
671 #define SCRL_DN 1
672 #define SCRL_LF 2
673 #define SCRL_RT 3
674 
675 #define NO_UPDATE_SCROLLING 0
676 #define JUMP_SCROLLING 1
677 #define SMOOTH_SCROLLING 2
678 
679 /* pixel stuff */
680 
681 #ifdef sun
682 #define PUT_A_POINT(dpy,win,gc,x,y) XDrawPoint(dpy,win,gc,x,y)
683 #else /* ~sun */
684 #ifdef ultrix
685 #define PUT_A_POINT(dpy,win,gc,x,y) XDrawPoint(dpy,win,gc,x,y)
686 #else /* ~ultrix */
687 #ifdef _USE_XDRAWPOINT_TO_PUT_A_POINT
688 #define PUT_A_POINT(dpy,win,gc,x,y) XDrawPoint(dpy,win,gc,x,y)
689 #else /* ~_USE_XDRAWPOINT_TO_PUT_A_POINT */
690 #define PUT_A_POINT(dpy,win,gc,x,y) XDrawLine(dpy,win,gc,x,y,x,y)
691 #endif /* _USE_XDRAWPOINT_TO_PUT_A_POINT */
692 #endif /* ultrix */
693 #endif /* sun */
694 
695 /* file stuff */
696 
697 #define OBJ_FILE_TYPE 0
698 #define SYM_FILE_TYPE 1
699 #define PIN_FILE_TYPE 2
700 
701 /* xbm real_type */
702 
703 #define XBM_XBM 0
704 #define XBM_EPS 1
705 #define XBM_EPSI 2
706 
707 /* xpm real_type */
708 
709 #define XPM_XPM  0
710 #define XPM_JPEG 1
711 #define PPM_TRUE 2
712 #define XPM_EPS  3 /* not implemented */
713 #define XPM_EPSI 4 /* not implemented */
714 
715 #define PPM_DATA_RAW      0 /* not used */
716 #define PPM_JPEG_COMPRESS 1
717 #define PPM_DATA_DEFLATED 2
718 
719 /* cmd stuff */
720 
721 #define CMD_COMPOSITE     0
722 #define CMD_NEW           1
723 #define CMD_DELETE        2
724 #define CMD_MOVE          3
725 #define CMD_STRETCH       4
726 #define CMD_ONE_TO_MANY   5
727 #define CMD_MANY_TO_ONE   6
728 #define CMD_REPLACE       7
729 #define CMD_GOTO_PAGE     8
730 #define CMD_WB_CLEARALL   9
731 #define CMD_CHAT_A_LINE  10
732 #define CMD_WB_SLIDESHOW 11
733 
734 /* rcb radius stuff */
735 
736 #define DEF_RCB_RADIUS (EIGHTH_INCH)
737 #define MIN_RCB_RADIUS 4
738 
739 /* select name dialog box stuff */
740 
741 #define ITEM_DSPED 10
742 #define ITEM_LEN 30
743 #define ROW_HEIGHT \
744   ((msgFontSet==NULL&&msgFontPtr==NULL)?(defaultFontHeight+1):(msgFontHeight+1))
745 #define BUTTON_OK 0
746 #define BUTTON_SETDIR 1
747 #define BUTTON_CANCEL 2
748 #define MAXBUTTONS 3
749 
750 /* user redraw window stuff */
751 
752 #define MAX_USER_REDRAWS 2
753 
754 /* status window stuff */
755 
756 #define MAX_STATUS_BTNS 3
757 
758 /* copypaste stuff */
759 
760 #define TGIF_HEADER 0x80
761 #define TGIF_PROTOCOL_ATOM "_TGIF_PROTOCOL_ATOM"
762 
763 /* interrupt stuff */
764 
765 #define MAXINTRS 2
766 
767 /* remote status */
768 
769 #define TG_REMOTE_STATUS_OK 0
770 #define TG_REMOTE_STATUS_INTR 1 /* user interrupt */
771 #define TG_REMOTE_STATUS_MEM 2 /* memory allocation failed */
772 #define TG_REMOTE_STATUS_WRITE 3 /* write failed */
773 #define TG_REMOTE_STATUS_READ 4 /* read failed */
774 #define TG_REMOTE_STATUS_NET 5 /* unexpect network error */
775 #define TG_REMOTE_STATUS_HOST 6 /* gethostbyname failed */
776 #define TG_REMOTE_STATUS_FORMAT 7 /* format error */
777 #define TG_REMOTE_STATUS_TERM 8 /* terminated by the server */
778 #define TG_REMOTE_STATUS_FILE 9 /* fail to open file/socket */
779 
780 #define FTP_LOGGED_IN 0x10000
781 
782 /* corner stuff */
783 
784 #define CORNER_NONE 0
785 #define CORNER_LT 1
786 #define CORNER_TOP 2
787 #define CORNER_RT 3
788 #define CORNER_RIGHT 4
789 #define CORNER_RB 5
790 #define CORNER_BOTTOM 6
791 #define CORNER_LB 7
792 #define CORNER_LEFT 8
793 
794 /* free rotation stuff */
795 
796 #define CTM_SX 0
797 #define CTM_SIN 1
798 #define CTM_MSIN 2
799 #define CTM_SY 3
800 
801 #define CTM_TX 0
802 #define CTM_TY 1
803 
804 /* msgbox stuff */
805 
806 #define MB_ID_FAILED 0
807 #define MB_ID_OK 1
808 #define MB_ID_CANCEL 2
809 #define MB_ID_YES 3
810 #define MB_ID_NO 4
811 #define MB_ID_EXTRA 5
812 
813 #define MB_BTN_NONE		0
814 #define MB_BTN_OK		1
815 #define MB_BTN_YESNOCANCEL	2
816 #define MB_BTN_OKCANCEL		3
817 #define MB_BTN_YESNO		4
818 #define MB_BTN_EXTRA		0x0008
819 
820 #define MB_ICON_STOP		0x0010
821 #define MB_ICON_QUESTION	0x0020
822 #define MB_ICON_INFORMATION	0x0040
823 #define MB_ICON_DIALOG		0x0080
824 
825 #define MB_BTNMASK		0x0007
826 #define MB_ICONMASK		0x00f0
827 
828 #define INFO_MB (MB_BTN_OK | MB_ICON_INFORMATION)
829 #define YNC_MB  (MB_BTN_YESNOCANCEL | MB_ICON_QUESTION)
830 #define YN_MB   (MB_BTN_YESNO | MB_ICON_QUESTION)
831 #define STOP_MB (MB_BTN_OK | MB_ICON_STOP)
832 
833 #define MB_PIXMAP_STOP 0
834 #define MB_PIXMAP_QUESTION 1
835 #define MB_PIXMAP_INFORMATION 2
836 #define MB_PIXMAP_DIALOG 3
837 
838 #define MAX_MB_ICONS 4
839 
840 /* expr stuff */
841 
842 #define NULL_VAL 0
843 #define INT_VAL 1
844 #define DBL_VAL 2
845 #define STR_VAL 3
846 
847 /* file version stuff */
848 
849 #define START_HAVING_ATTRS 8
850 
851 /* input method stuff */
852 
853 #define TGIM_NONE       INVALID
854 #define TGIM_XCIN       0
855 #define TGIM_CHINPUT    1
856 #define TGIM_KINPUT     2
857 #define TGIM_XIM        3
858 #define TGIM_TGTWB5     4
859 
860 #define TGIM_DBIM       0x1
861 #define TGIM_SBIM       0x2
862 
863 /* postscript stuff */
864 
865 #define PS_GSAVE             0
866 #define PS_GRESTORE          1
867 #define PS_NEWPATH           2
868 #define PS_CLOSEPATH         3
869 #define PS_CHARPATH          4
870 #define PS_CURVETO           5
871 #define PS_LINETO            6
872 #define PS_RLINETO           7
873 #define PS_MOVETO            8
874 #define PS_RMOVETO           9
875 #define PS_STROKE            10
876 #define PS_FILL              11
877 #define PS_TRANSLATE         12
878 #define PS_ROTATE            13
879 #define PS_SCALE             14
880 #define PS_MUL               15
881 #define PS_DIV               16
882 #define PS_DUP               17
883 #define PS_NEG               18
884 #define PS_ADD               19
885 #define PS_SUB               20
886 #define PS_POP               21
887 #define PS_EXCH              22
888 #define PS_CONCAT            23
889 #define PS_CLIP              24
890 #define PS_EOCLIP            25
891 #define PS_EOFILL            26
892 #define PS_IMAGE             27
893 #define PS_IMAGEMASK         28
894 #define PS_ARRAY             29
895 #define PS_SETGRAY           30
896 #define PS_SETRGBCOLOR       31
897 #define PS_SETDASH           32
898 #define PS_SETLINEWIDTH      33
899 #define PS_SETMITERLIMIT     34
900 #define PS_SETLINECAP        35
901 #define PS_SETLINEJOIN       36
902 #define PS_SHOW              37
903 #define PS_FINDFONT          38
904 #define PS_MAKESETFONT       39
905 #define PS_ARCTO4            40
906 #define PS_CURRENTPOINT      41
907 #define PS_FLATTENPATH       42
908 #define PS_TGIFSETMATRIX     43
909 #define PS_TGIFRESTOREMATRIX 44
910 
911 /* shape stuff */
912 
913 #define SHAPE_BOX 0
914 #define SHAPE_PARALLEL 1
915 #define SHAPE_TRAPEZOID 2
916 #define SHAPE_RHOMBUS 3
917 #define SHAPE_RCBOX 4
918 #define SHAPE_OCTAGON 5
919 #define SHAPE_CROSS 6
920 #define SHAPE_OVAL 7
921 #define SHAPE_WORDS 8
922 #define SHAPE_HEXAGON 9
923 #define SHAPE_TRIANGLE 10
924 #define SHAPE_BLAST 11
925 #define SHAPE_STAR 12
926 #define SHAPE_DISK 13
927 #define SHAPE_RIGHTARROW 14
928 #define SHAPE_UPARROW 15
929 #define SHAPE_FATRIGHTARROW 16
930 #define SHAPE_FATUPARROW 17
931 #define SHAPE_RIGHTTAB 18
932 #define SHAPE_UPTAB 19
933 
934 #define MAXSHAPES 20
935 
936 /* export filter stuff */
937 
938 #define EXPORT_NEXT 1
939 #define EXPORT_PREV -1
940 #define EXPORT_THIS 0
941 
942 /* generic object stuff */
943 
944 #define TGO_STRING 0
945 #define TGO_VISUAL 1
946 #define TGO_MATH 2
947 #define TGO_DATE 3
948 #define TGO_USER 4
949 
950 /* break up text stuff */
951 
952 #define BREAK_CHAR 0
953 #define BREAK_WORD 1
954 #define BREAK_LINE 2
955 
956 /* xpm stuff */
957 
958 #define MAXXPMEXPORTCOLORS 6400
959 
960 /* choose a file stuff */
961 
962 #define NAMES_SIMPLE_SELECT_NAME 0
963 #define NAMES_COMPLEX_SELECT_NAME 1
964 #define NAMES_SELECT_FILE 2
965 #define NAMES_EDIT_ATTR 3
966 #define NAMES_EDIT_NAME 4
967 
968 #define NAMES_LOOP_MANY 0
969 #define NAMES_LOOP_ONCE 1
970 
971 /* properties stuff */
972 
973 #define PROP_MASK_CTM		0x00000001
974 #define PROP_MASK_COLOR		0x00000002
975 #define PROP_MASK_WIDTH		0x00000004
976 #define PROP_MASK_AW		0x00000008
977 #define PROP_MASK_AH		0x00000010
978 #define PROP_MASK_TRANSPAT	0x00000020
979 #define PROP_MASK_FILL		0x00000040
980 #define PROP_MASK_PEN		0x00000080
981 #define PROP_MASK_DASH		0x00000100
982 #define PROP_MASK_ARROW_STYLE	0x00000200
983 #define PROP_MASK_CURVED	0x00000400
984 #define PROP_MASK_RCB_RADIUS	0x00000800
985 #define PROP_MASK_TEXT_JUST	0x00001000
986 #define PROP_MASK_TEXT_SZ_UNIT	0x00002000
987 #define PROP_MASK_TEXT_FONT	0x00004000
988 #define PROP_MASK_TEXT_STYLE	0x00008000 /* ChangeEditTextProperty() only */
989 #define PROP_MASK_VSPACE	0x00010000
990 #define PROP_MASK_UNDERLINE_ON	0x00020000
991 #define PROP_MASK_OVERLINE_ON	0x00040000
992 #define PROP_MASK_WIDTH_INDEX	0x00100000 /* GetProperty() only */
993 
994 /* mark stuff */
995 
996 #define FORWARD 0
997 #define REVERSE 1
998 
999 /* auto rotate pivot stuff */
1000 
1001 #define AUTO_ROTATE_PIVOT 0
1002 #define USER_ROTATE_PIVOT 1
1003 
1004 #define MAX_ROTATE_PIVOT 2
1005 
1006 #endif /*_TGIF_CONST_H_*/
1007