home *** CD-ROM | disk | FTP | other *** search
/ Photo CD Demo 1 / Demo.bin / gle / gle / global.h < prev    next >
C/C++ Source or Header  |  1992-11-29  |  9KB  |  296 lines

  1. #define typ_end 0
  2. #define typ_val 1
  3. #define typ_val2 2
  4. #define typ_str 3
  5. #define typ_switch 4
  6. #define typ_color 5
  7. #define typ_fill 6
  8. #define typ_marker 7
  9. #define typ_lstyle 8
  10. #define typ_justify 9
  11. #define typ_arrow 10
  12.  
  13. /* pos=   Offset to find the data            */
  14. /* idx=   For switches, which can only have one value.     */
  15. /* The pos is the order the items will be placed in the pcode */
  16. /*
  17. /* Switches     LONG     placed in directly, 1 present, 0 not present
  18. /* expressions     LONG*     pointed to, 0 if not present.
  19. /* color/fill    LONG*     Pointer to exp 0 if not present.
  20. /* marker    LONG*    Pointer to exp 0 if not present.
  21. /* lstyle     LONG*    Pointer to exp 0 if not present.
  22. /* font     long*     Pointer to string expression.
  23. */
  24. /*---------------------------------------------------------------------------*/
  25.  
  26. char *zzzmainkey[] = {
  27. "","ALINE", "RLINE", "AMOVE", "RMOVE", "BOX"
  28. , "BEGIN" , "CIRCLE", "FOR", "NEXT", "SET"
  29. , "BEZIER", "RBEZIER", "ARCTO", "ARC", "NARC"
  30. , "CURV", "PIE", "MARKER", "TEXT", "END"
  31. , "IF", "ELSE", "GOTO", "GSAVE", "DEFINE"
  32. , "REGION", "UNTIL", "WHILE", "WRITE", "SUB"
  33. , "DFONT", "CLOSEPATH", "NEWPATH", "SCALE", "ROTATE"
  34. , "TRANSLATE", "ICON" , "INCLUDE", "JOIN", "SAVE"
  35. , "MOVE", "REVERSE", "FILL", "STROKE", "FOPEN"
  36. , "FCLOSE", "INPUT", "PRINT", "LET" };
  37.  
  38.  
  39. struct op_key op_box[] = {
  40.          "JUSTIFY",     typ_justify,     1, 0
  41.         ,"JUST",     typ_justify,     1, 0
  42.         ,"NOSTROKE",     typ_switch,     2, 1
  43.         ,"NOBORDER",     typ_switch,     2, 1
  44.         ,"NOBOX",     typ_switch,     2, 1
  45.         ,"FILL",     typ_fill,     3, 0
  46.         ,"NAME",     typ_str,     4, 0
  47.         ,"END",     typ_end,     0, 0  };
  48. struct op_key op_circle[] = {
  49.          "JUSTIFY",     typ_justify,     1, 0
  50.         ,"JUST",     typ_justify,     1, 0
  51.         ,"NOSTROKE",     typ_switch,     2, 1
  52.         ,"FILL",     typ_fill,     3, 0
  53.         ,"NAME",     typ_str,     4, 0
  54.         ,"END",     typ_end,     0, 0  };
  55. struct op_key op_defmarker[] = {
  56.          "FONT",     typ_str,     1, 0
  57.         ,"CHAR",     typ_str,     2, 0
  58.         ,"DX",         typ_val,     3, 0
  59.         ,"DY",         typ_val,     4, 0
  60.         ,"END",     typ_end,     0, 0  };
  61. struct op_key op_fill[] = {
  62.          "FILL",     typ_fill,     1, 0
  63.         ,"END",     typ_end,     0, 0  };
  64. struct op_key op_for_step[] = {
  65.          "STEP",     typ_val,     1, 0
  66.         ,"END",     typ_end,     0, 0  };
  67. struct op_key op_begin_text[] = {
  68.          "WIDTH",     typ_val,     1, 0
  69.         ,"DEPTH",     typ_val,     2, 0
  70.         ,"END",     typ_end,     0, 0  };
  71.  
  72. /* JUSTIFY:  stored as a long word string. 'LEFT', 'CENT', 'RIGH', 'LT' */
  73. struct op_key op_justify[] = {
  74.          "LEFT",     typ_switch,     1, 0x100
  75.         ,"CENT",     typ_switch,     1, 0x110
  76.         ,"CENTER",     typ_switch,     1, 0x110
  77.         ,"CENTRE",     typ_switch,     1, 0x110
  78.         ,"RIGHT",     typ_switch,     1, 0x120
  79.         ,"LT",         typ_switch,     1, 0x02
  80.         ,"TL",         typ_switch,     1, 0x02
  81.         ,"CL",         typ_switch,     1, 0x01
  82.         ,"LC",         typ_switch,     1, 0x01
  83.         ,"BL",         typ_switch,     1, 0x00
  84.         ,"LB",         typ_switch,     1, 0x00
  85.         ,"CB",         typ_switch,     1, 0x10
  86.         ,"BC",         typ_switch,     1, 0x10
  87.         ,"RB",         typ_switch,     1, 0x20
  88.         ,"BR",         typ_switch,     1, 0x20
  89.         ,"CR",         typ_switch,     1, 0x21
  90.         ,"RC",         typ_switch,     1, 0x21
  91.         ,"TR",         typ_switch,     1, 0x22
  92.         ,"RT",         typ_switch,     1, 0x22
  93.         ,"TC",         typ_switch,     1, 0x12
  94.         ,"CT",         typ_switch,     1, 0x12
  95.         ,"CC",         typ_switch,     1, 0x11
  96.         ,"CI",         typ_switch,     1, 0x1011
  97.         ,"C",         typ_switch,     1, 0x1011
  98.         ,"VI",         typ_switch,     1, 0x2000
  99.         ,"V",         typ_switch,     1, 0x2000
  100.         ,"HO",         typ_switch,     1, 0x3000
  101.         ,"H",         typ_switch,     1, 0x3000
  102.         ,"BOX",         typ_switch,     1, 0x5011
  103.         ,"BO",         typ_switch,     1, 0x5011
  104.         ,"END",     typ_end,     1, 1 };
  105. struct op_key op_begin[] = {
  106.          "PATH",     typ_switch,     1, 1
  107.         ,"BOX",     typ_switch,     1, 2
  108.         ,"SCALE",     typ_switch,     1, 3
  109.         ,"ROTATE",     typ_switch,     1, 4
  110.         ,"TRANSLATE",     typ_switch,     1, 5
  111.         ,"ROT",     typ_switch,     1, 4
  112.         ,"TRAN",     typ_switch,     1, 5
  113.         ,"IF",         typ_switch,     1, 6
  114.         ,"SUB",     typ_switch,     1, 7
  115.         ,"NAME",     typ_switch,     1, 8
  116.         ,"TEXT",     typ_switch,     1, 9
  117.         ,"GRAPH",     typ_switch,     1, 10
  118.         ,"XAXIS",     typ_switch,     1, 11
  119.         ,"YAXIS",     typ_switch,     1, 12
  120.         ,"X2AXIS",     typ_switch,     1, 13
  121.         ,"Y2AXIS",     typ_switch,     1, 14
  122.         ,"CURVE",    typ_switch,    1,15
  123.         ,"KEY",        typ_switch,    1,16
  124.         ,"ORIGIN",    typ_switch,    1,17
  125.         ,"TABLE",    typ_switch,    1,18
  126.         ,"CLIP",    typ_switch,    1,19
  127.         ,"UNTIL",    typ_switch,    1,20
  128.         ,"END",     typ_end,     1, 1 };
  129. struct op_key op_set[] = {
  130.          "HEI",     typ_switch,     1, 1
  131.         ,"FONT",     typ_switch,     1, 2
  132.         ,"JUSTIFY",     typ_switch,     1, 3
  133.         ,"JUST",     typ_switch,     1, 3
  134.         ,"COLOR",     typ_switch,     1, 4
  135.         ,"DASHLEN",     typ_switch,     1, 5
  136.         ,"DASH",     typ_switch,     1, 6
  137.         ,"LDIST",     typ_switch,     1, 5
  138.         ,"LSTYLE",     typ_switch,     1, 6
  139.         ,"LWIDTH",     typ_switch,     1, 7
  140.         ,"JOIN",     typ_switch,     1, 8
  141.         ,"CAP",     typ_switch,     1, 9
  142.         ,"FONTLWIDTH",     typ_switch,     1, 10
  143.         ,"END",     typ_end,     1, 1 };
  144. /* colors, fills,  First byte is pattern, then red,green,blue intensities*/
  145. /* currently defined patterns are,  ff=clear, 1=black,  */
  146. struct op_key op_color_typ[] = {
  147.          "CLEAR",     typ_switch,     1, 0XFF000000
  148.         ,"BLACK",     typ_switch,     1, 0X01000000
  149.         ,"WHITE",     typ_switch,     1, 0X01FFFFFF
  150.         ,"RED",     typ_switch,     1, 0X01FF0000
  151. /*        ,"VIOLET",     typ_switch,     1, 0X017F207F */
  152.         ,"VIOLET",     typ_switch,     1, 0X012F00FF
  153.         ,"ORANGE",     typ_switch,     1, 0X01ff7F10
  154.         ,"PURPLE",     typ_switch,     1, 0X0130107F
  155.         ,"BROWN",     typ_switch,     1, 0X013F1F24
  156.         ,"GREEN",     typ_switch,     1, 0X0100FF00
  157. /*        ,"CYAN",     typ_switch,     1, 0X010F609F */
  158.         ,"CYAN",     typ_switch,     1, 0X0100FFFF
  159. /*        ,"PINK",     typ_switch,     1, 0X017F1430 */
  160.         ,"PINK",     typ_switch,     1, 0X01FF7F0F
  161.         ,"BLUE",     typ_switch,     1, 0X010000FF
  162.         ,"MAGENTA",     typ_switch,     1, 0X01FF00FF
  163.         ,"YELLOW",     typ_switch,     1, 0X01FFFF00
  164.         ,"GREY",     typ_switch,     1, 0X017F7F7F
  165.         ,"GREY90",     typ_switch,     1, 0X01060606
  166.         ,"GREY80",     typ_switch,     1, 0X01191919
  167.         ,"GREY70",     typ_switch,     1, 0X01323232
  168.         ,"GREY60",     typ_switch,     1, 0X014b4b4b
  169.         ,"GREY50",     typ_switch,     1, 0X01646464
  170.         ,"GREY40",     typ_switch,     1, 0X017d7d7d
  171.         ,"GREY30",     typ_switch,     1, 0X01969696
  172.         ,"GREY20",     typ_switch,     1, 0X01afafaf
  173.         ,"GREY10",     typ_switch,     1, 0X01c8c8c8
  174.         ,"GREY5",     typ_switch,     1, 0X01f0f0f0
  175.         ,"GREY1",     typ_switch,     1, 0X01fdfdfd
  176.         ,"GRID",     typ_switch,     1, 0X02002020
  177.         ,"RED_GRID",     typ_switch,     1, 0X03002020
  178.         ,"GREEN_GRID",     typ_switch,     1, 0X04002020
  179.         ,"BLUE_GRID",     typ_switch,     1, 0X05002020
  180.         ,"YELLOW_GRID", typ_switch,     1, 0X06002020
  181.         ,"GRID1",     typ_switch,     1, 0X02040f0f
  182.         ,"GRID2",     typ_switch,     1, 0X02001010
  183.         ,"GRID3",     typ_switch,     1, 0X02052020
  184.         ,"GRID4",     typ_switch,     1, 0X02104040
  185.         ,"GRID5",     typ_switch,     1, 0X02206060
  186.         ,"SHADE",     typ_switch,     1, 0X02000020
  187.         ,"SHADE1",     typ_switch,     1, 0X0204000C
  188.         ,"SHADE2",     typ_switch,     1, 0X02000010
  189.         ,"SHADE3",     typ_switch,     1, 0X02050020
  190.         ,"SHADE4",     typ_switch,     1, 0X02100040
  191.         ,"SHADE5",     typ_switch,     1, 0X02200060
  192.         ,"RSHADE",     typ_switch,     1, 0X02002000
  193.         ,"RSHADE1",     typ_switch,     1, 0X02040C00
  194.         ,"RSHADE2",     typ_switch,     1, 0X02001000
  195.         ,"RSHADE3",     typ_switch,     1, 0X02052000
  196.         ,"RSHADE4",     typ_switch,     1, 0X02104000
  197.         ,"RSHADE5",     typ_switch,     1, 0X02206000
  198.         ,"END",     typ_end,     1, 1 };
  199. struct op_key op_marker[] = {
  200.         "DOT",     typ_switch,     1, 1
  201.         ,"CROSS",     typ_switch,     1, 2
  202.         ,"FCIRCLE",     typ_switch,     1, 3
  203.         ,"FSQUARE",     typ_switch,     1, 4
  204.         ,"FTRIANGLE",     typ_switch,     1, 5
  205.         ,"FDIAMOND",     typ_switch,     1, 6
  206.         ,"CIRCLE",     typ_switch,     1, 7
  207.         ,"SQUARE",     typ_switch,     1, 8
  208.         ,"TRIANGLE",     typ_switch,     1, 9
  209.         ,"DIAMOND",     typ_switch,     1, 10
  210.         ,"PLUS",     typ_switch,     1, 11
  211.         ,"CLUB",     typ_switch,     1, 12
  212.         ,"HEART",     typ_switch,     1, 13
  213.         ,"DIAMOND",     typ_switch,     1, 14
  214.         ,"SPADE",     typ_switch,     1, 15
  215.         ,"STAR",     typ_switch,     1, 16
  216.         ,"SNAKE",     typ_switch,     1, 17
  217.         ,"DAG",     typ_switch,     1, 18
  218.         ,"DDAG",     typ_switch,     1, 19
  219.         ,"ASTERIX",     typ_switch,     1, 20
  220.         ,"ASTERISK",     typ_switch,     1, 20
  221.         ,"OPLUS",     typ_switch,     1, 21
  222.         ,"OMINUS",     typ_switch,     1, 22
  223.         ,"OTIMES",     typ_switch,     1, 23
  224.         ,"ODOT",     typ_switch,     1, 24
  225.         ,"TRIANGLEZ",     typ_switch,     1, 25
  226.         ,"DIAMONDZ",     typ_switch,     1, 26
  227.         ,"WCIRCLE",     typ_switch,     1, 27
  228.         ,"WTRIANGLE",     typ_switch,     1, 28
  229.         ,"WSQUARE",     typ_switch,     1, 29
  230.         ,"WDIAMOND",     typ_switch,     1, 30
  231.         ,"END",     typ_end,     1, 1 };
  232.  
  233. struct op_key op_begin_path[] = {
  234.          "STROKE",     typ_switch,     1, 1
  235.         ,"FILL",     typ_fill,     2, 0
  236.         ,"CLIP",     typ_switch,     3, 1
  237.         ,"END",     typ_end,     0, 0 };
  238. struct op_key op_begin_box[] = {
  239.          "ADD",     typ_val,     1, 0
  240.         ,"FILL",     typ_fill,     2, 0
  241.         ,"NOSTROKE",     typ_switch,     3, 1
  242.         ,"NOBORDER",     typ_switch,     3, 1
  243.         ,"NOBOX",     typ_switch,     3, 1
  244.         ,"NAME",     typ_str,     4, 0
  245.         ,"END",     typ_end,     0, 0 };
  246. struct op_key op_begin_scale[] = {
  247.          "TRANSLATE",     typ_val2,     1, 0
  248.         ,"TRAN",     typ_val2,     1, 0
  249.         ,"SCALE",     typ_val2,     3, 0
  250.         ,"ROTATE",     typ_val,     5, 0
  251.         ,"ROT",     typ_val,     5, 0
  252.         ,"END",     typ_end,     0, 0 };
  253. struct op_key op_arrow[] = {
  254.          "START",     typ_switch,     1, 1
  255.         ,"END",     typ_switch,     1, 2
  256.         ,"BOTH",     typ_switch,     1, 3
  257.         ,"END",     typ_end,     0, 0 };
  258. struct op_key op_joinname[] = {
  259.          "->",         typ_switch,     1, 1
  260.         ,"<-",         typ_switch,     1, 2
  261.         ,"<->",     typ_switch,     1, 3
  262.         ,"-",         typ_switch,     1, 4
  263.         ,"END",     typ_end,     0, 0 };
  264. struct op_key op_line[] = {
  265.          "ARROW",     typ_arrow,     1, 1
  266.         ,"END",     typ_end,     0, 0 };
  267. struct op_key op_size[] = {
  268.          "BOX",     typ_switch,     1, 1
  269.         ,"END",     typ_end,     0, 0 };
  270.  
  271. struct op_key op_join[] = {
  272.          "MITRE",     typ_switch,     1, 0
  273.         ,"ROUND",     typ_switch,     1, 1
  274.         ,"BEVEL",     typ_switch,     1, 2
  275.         ,"END",     typ_end,     0, 0 };
  276. struct op_key op_cap[] = {
  277.          "BUTT",     typ_switch,     1, 0
  278.         ,"ROUND",     typ_switch,     1, 1
  279.         ,"SQUARE",     typ_switch,     1, 2
  280.         ,"END",     typ_end,     0, 0 };
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.