home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / demos / xgc / main.h < prev    next >
Encoding:
Text File  |  1989-07-21  |  4.1 KB  |  148 lines

  1. /*
  2. ** xgc
  3. **
  4. ** xgc.h
  5. **
  6. ** Initialization of structures, etc.
  7. */
  8.  
  9. /* The three columns in the XgcData arrays are:
  10. **   name: the name of the toggle button
  11. **   text: the corresponding text in the xgc syntax
  12. **   code: the integer that the text corresponds to, for sending stuff
  13. **         to X calls, etc.
  14. */
  15.  
  16. XgcData FunctionData[NUM_FUNCTIONS] = {
  17.   {"clear",        "clear",        GXclear},
  18.   {"and",          "and",          GXand},
  19.   {"andReverse",   "andReverse",   GXandReverse},
  20.   {"copy",         "copy",         GXcopy},
  21.   {"andInverted",  "andInverted",  GXandInverted},
  22.   {"noop",         "noop",         GXnoop},
  23.   {"xor",          "xor",          GXxor},
  24.   {"or",           "or",           GXor},
  25.   {"nor",          "nor",          GXnor},
  26.   {"equiv",        "equiv",        GXequiv},
  27.   {"invert",       "invert",       GXinvert},
  28.   {"orReverse",    "orReverse",    GXorReverse},
  29.   {"copyInverted", "copyInverted", GXcopyInverted},
  30.   {"orInverted",   "orInverted",   GXorInverted},
  31.   {"nand",         "nand",         GXnand},
  32.   {"set",          "set",          GXset}
  33. }; 
  34.  
  35. /* The two rows in the XgcStuff structure are:
  36. **   name of label, xgc syntax text, # of toggles, # of columns of toggles
  37. **     (0 columns means 1 row, as many columns as necessary)
  38. **   appropriate XgcData
  39. */
  40.  
  41. XgcStuff FunctionStuff = {
  42.   {"Function","function",NUM_FUNCTIONS,4},
  43.   FunctionData
  44. };
  45.  
  46. XgcData TestData[NUM_TESTS] = {
  47.   {"Copy Area",          "CopyArea",      CopyArea},
  48.   {"Copy Plane",         "CopyPlane",     CopyPlane},
  49.   {"Points",             "PolyPoint",     PolyPoint},
  50.   {"Lines",              "PolyLine",      PolyLine},
  51.   {"Segments",           "PolySegment",   PolySegment},
  52.   {"Rectangles",         "PolyRectangle", PolyRectangle},
  53.   {"Arcs",               "PolyArc",       PolyArc},
  54.   {"(Filled Polygons)",  "FillPolygon",   FillPolygon},
  55.   {"Filled Rectangles",  "PolyFillRect",  PolyFillRect},
  56.   {"Filled Arcs",        "PolyFillArc",   PolyFillArc},
  57.   {"Put Image",          "PutImage",      PutImage},
  58.   {"(Get Image)",        "GetImage",      GetImage},
  59.   {"Text 8",             "PolyText8",     PolyText8},
  60.   {"Image Text 8",       "ImageText8",    ImageText8},
  61.   {"(Text 16)",          "PolyText16",    PolyText16},
  62.   {"(Image Text 16)",    "ImageText16",   ImageText16}
  63. };
  64.  
  65. XgcStuff TestStuff = {
  66.   {"Test","test",NUM_TESTS,2},
  67.   TestData
  68. };
  69.  
  70. XgcData LinestyleData[NUM_LINESTYLES] = {
  71.   {"Solid",      "Solid",       LineSolid},
  72.   {"OnOffDash",  "OnOffDash",   LineOnOffDash},
  73.   {"DoubleDash", "DoubleDash",  LineDoubleDash}
  74. };
  75.  
  76. XgcStuff LinestyleStuff = {
  77.   {"LineStyle","linestyle",NUM_LINESTYLES,0},
  78.   LinestyleData
  79. };
  80.  
  81. XgcData CapstyleData[NUM_CAPSTYLES] = {
  82.   {"NotLast",    "NotLast",     CapNotLast},
  83.   {"Butt",       "Butt",        CapButt},
  84.   {"Round",      "Round",       CapRound},
  85.   {"Projecting", "Projecting",  CapProjecting}
  86. };
  87.  
  88. XgcStuff CapstyleStuff = {
  89.   {"CapStyle","capstyle",NUM_CAPSTYLES,2},
  90.   CapstyleData
  91. };
  92.  
  93. XgcData JoinstyleData[NUM_JOINSTYLES] = {
  94.   {"Miter",   "Miter",   JoinMiter},
  95.   {"Round",   "Round",   JoinRound},
  96.   {"Bevel",   "Bevel",   JoinBevel}
  97. };
  98.  
  99. XgcStuff JoinstyleStuff = {
  100.   {"JoinStyle","joinstyle",NUM_JOINSTYLES,0},
  101.   JoinstyleData
  102. };
  103.  
  104. XgcData FillstyleData[NUM_FILLSTYLES] = {
  105.   {"Solid",          "Solid",          FillSolid},
  106.   {"Tiled",          "Tiled",          FillTiled},
  107.   {"Stippled",       "Stippled",       FillStippled},
  108.   {"OpaqueStippled", "OpaqueStippled", FillOpaqueStippled}
  109. };
  110.  
  111. XgcStuff FillstyleStuff = {
  112.   {"FillStyle","fillstyle",NUM_FILLSTYLES,2},
  113.   FillstyleData
  114. };
  115.  
  116. XgcData FillruleData[NUM_FILLRULES] = {
  117.   {"EvenOdd",  "EvenOdd",  EvenOddRule},
  118.   {"Winding",  "Winding",  WindingRule}
  119. };
  120.  
  121. XgcStuff FillruleStuff = {
  122.   {"FillRule","fillrule",NUM_FILLRULES,0},
  123.   FillruleData
  124. };
  125.  
  126. XgcData ArcmodeData[NUM_ARCMODES] = {
  127.   {"Chord",    "Chord",    ArcChord},
  128.  {"PieSlice", "PieSlice", ArcPieSlice}
  129. };
  130.  
  131. XgcStuff ArcmodeStuff = {
  132.   {"ArcMode","arcmode",NUM_ARCMODES,0},
  133.   ArcmodeData
  134. };
  135.  
  136. /* Pointers to all the Xgcstuffs so we can run them through a loop */
  137.  
  138. static XgcStuff *Everything[8] = {
  139.   &FunctionStuff,
  140.   &LinestyleStuff,
  141.   &CapstyleStuff,
  142.   &JoinstyleStuff,
  143.   &FillstyleStuff,
  144.   &FillruleStuff,
  145.   &ArcmodeStuff,
  146.   &TestStuff
  147. };
  148.