home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Text⁄Files / MakeWrite / MakeWrite Folder / MWMain.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-16  |  2.0 KB  |  93 lines  |  [TEXT/KAHL]

  1. # include    "TransSkel.h"
  2.  
  3. # include    "ListEdit.h"
  4. # include    "MakeWrite.h"
  5.  
  6.  
  7. /*
  8.  * Offsets of each field in the map and font lists.  There is one
  9.  * extra value, which is actually the offset of the right edge of
  10.  * the last field.  These offsets are relative to the text area.
  11.  */
  12.  
  13.  
  14. # define    mapFields    4        /* number of fields in mapping */
  15.  
  16.  
  17. static short        mapOffsets[mapFields + 1] =
  18. {
  19.     0,
  20.     100,
  21.     217,
  22.     257,
  23.     313
  24. };
  25.  
  26.  
  27. static LineList    mapStruct =
  28. {
  29.     nil,                        /* port - filled in later        */
  30.     nil,                        /* control - filled in later     */
  31.     { 150, 124, 246, 436 },        /* text display rect, t, l, b, r */
  32.     0,                            /* max lines (set by InitList)   */
  33.     6,                            /* max visible lines             */
  34.     0,                            /* top visible line              */
  35.     16,                            /* line height                   */
  36.     0,                            /* number of lines               */
  37.     noLine,                        /* current line                  */
  38.     false,                        /* no hiliting                   */
  39.     mapFields,                    /* number of fields/line         */
  40.     mapOffsets,                    /* field offsets                 */
  41.     nil                            /* line array (set by InitList)  */
  42. };
  43.  
  44.  
  45.  
  46. WindowPtr    mapWind;
  47.  
  48. LListPtr    mapList = &mapStruct;
  49. MapSpec        mapSpec[maxMappings];
  50.  
  51. Boolean        mapModified = false;
  52.  
  53. short        undoOp = noUndo;
  54. short        undoVal;
  55. short        undoPos;
  56. short        undoFieldType;
  57. MapSpec        undoMSpec;
  58. Boolean        undoCPMarker;
  59.  
  60. Boolean        havePasteMSpec = false;    /* for setting Paste menu item */
  61.  
  62. Boolean        cpMarker = false;    /* whether cut/paste applies to marker */
  63.  
  64.  
  65. /*
  66.  * Paragraph style control
  67.  *
  68.  * Default is "every line a paragraph", ignore command-only lines
  69.  */
  70.  
  71. ParaStyle    paraStyle;
  72.  
  73. Str255    paraMark;    /* paragraph marker string */
  74. Str255    pageMark;    /* page break marker string */
  75. Str255    periodStr;    /* sentence "periods" (terminators) */
  76. Str255    quoteStr;    /* quotes to ignore after periods */
  77.  
  78. # ifdef    debug
  79. Boolean    debugOut = false;    /* controls debugging output during format */
  80. # endif
  81.  
  82.  
  83. int
  84. main (void)
  85. {
  86.     SkelInit ((SkelInitParamsPtr) nil);
  87.     InitParaStyle ();
  88.     SetupMenus ();
  89.     MapSetup ();
  90.     SkelEventLoop ();
  91.     SkelCleanup ();
  92. }
  93.