home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / programming / source / dr2d.lha / iffpdr2d.h next >
Encoding:
C/C++ Source or Header  |  1991-11-20  |  5.9 KB  |  218 lines

  1. #ifndef    IFFP_DR2D_H
  2. #    define    IFFP_DR2D_H
  3.  
  4. /* Header file describing chunk IDs and structures for FORM DR2D
  5.  *
  6.  * Ross Cunniff, Stylus, Inc. 9/21/91
  7.  */
  8.  
  9. #ifndef    IFFPARSE_H_INCLUDED
  10. #    include    <libraries/iffparse.h>
  11. #endif
  12.  
  13. /* This typedef is to avoid using any floating point arithmetic; */
  14. /* see the functions ieee2flt and flt2ieee for examples of */
  15. /* conversion operations */
  16.  
  17. typedef long    IEEE;
  18.  
  19. /* The FORM and CHUNK ID definitions */
  20. /* See dr2d.doc, included in this package, for */
  21. /* explanations */
  22.  
  23. #define    ID_DR2D        MAKE_ID('D','R','2','D')
  24. #define    ID_DRHD        MAKE_ID('D','R','H','D')
  25. #define ID_PPRF        MAKE_ID('P','P','R','F')
  26. #define ID_DASH        MAKE_ID('D','A','S','H')
  27. #define    ID_AROW        MAKE_ID('A','R','O','W')
  28. #define    ID_FILL        MAKE_ID('F','I','L','L')
  29. #define    ID_LAYR        MAKE_ID('L','A','Y','R')
  30. #define    ID_ATTR        MAKE_ID('A','T','T','R')
  31. #define    ID_BBOX        MAKE_ID('B','B','O','X')
  32. #define    ID_CPLY        MAKE_ID('C','P','L','Y')
  33. #define    ID_OPLY        MAKE_ID('O','P','L','Y')
  34. #define    ID_GRUP        MAKE_ID('G','R','U','P')
  35. #define    ID_XTRN        MAKE_ID('X','T','R','N')
  36. #define    ID_TPTH        MAKE_ID('T','P','T','H')
  37. #define    ID_STXT        MAKE_ID('S','T','X','T')
  38. #define    ID_VBM        MAKE_ID('V','B','M',' ')
  39.  
  40. #ifndef ID_CMAP
  41. #  define ID_CMAP    MAKE_ID('C','M','A','P')
  42. #endif
  43. #ifndef ID_CMYK
  44. #  define ID_CMYK    MAKE_ID('C','M','Y','K')
  45. #endif
  46. #ifndef ID_CNAM
  47. #  define ID_CNAM    MAKE_ID('C','N','A','M')
  48. #endif
  49. #ifndef ID_FONS
  50. #  define ID_FONS    MAKE_ID('F','O','N','S')
  51. #endif
  52.  
  53.  
  54. /* Structure for ID_DRHD - Drawing Header */
  55. struct DRHDstruct {
  56.     IEEE    UL_X, UL_Y,    /* Upper left corner of drawing area */
  57.         LR_X, LR_Y;    /* Lower right corner of drawing area */
  58. };
  59.  
  60.  
  61. /* Structure for ID_FONS, font table entry - from FORM FTXT */
  62. struct FONSstruct {
  63.     UBYTE    FontID;
  64.     UBYTE    Pad1;
  65.     UBYTE    Proportional;
  66.     UBYTE    Serif;
  67.     /* char    Name[Size-4]; */
  68. };
  69.  
  70.  
  71. /* Structure for ID_DASH, dash table entry */
  72. struct DASHstruct {
  73.     USHORT    DashID;
  74.     USHORT    NumDashes;
  75.     /* IEEE    Dashes[NumDashes]; */
  76. };
  77.  
  78.  
  79. /* Structure for ID_AROW, arrow table entry */
  80. #define    ARROW_FIRST    0x01        /* Draw an arrow on the first point */
  81. #define    ARROW_LAST    0x02        /* Draw an arrow on the last point */
  82.  
  83. struct AROWstruct {
  84.     UBYTE    Flags;        /* Flags, from ARROW_*, above */
  85.     UBYTE    Pad0;        /* Should always be 0 */
  86.     USHORT    ArrowID;    /* ID of the arrow head */
  87.     USHORT    NumPoints;    /* Size of the arrow head array */
  88.     /* IEEE    Points[NumPoints*2]; */    /* The array of points */
  89. };
  90.  
  91.  
  92. /* Structure for ID_CNAM, color name */
  93. struct CNAMstruct {
  94.     USHORT    First, Last;        /* First and last colors named */
  95.     /* char    CNames[Size-4]; */    /* Names of those colors */
  96. };
  97.  
  98.  
  99. /* Structure for ID_FILL, fill table entry */
  100. struct FILLstruct {
  101.     USHORT    FillID;
  102. };
  103.  
  104.  
  105. /* Structure and flags for ID_LAYR, layer table entry */
  106. #define LAYR_ACTIVE    0x01
  107. #define LAYR_DISPLAYED    0x02
  108.  
  109. struct LAYRstruct {
  110.     USHORT    LayerID;    /* For lookup with ATTR struct */
  111.     char    LayerName[16];    /* Null terminated and padded */
  112.     UBYTE    Flags;        /* From LAYR_*, above */
  113.     UBYTE    Pad0;        /* Always 0 */
  114. };
  115.  
  116.  
  117. /* Structure and flags for ID_ATTR, object attributes */
  118. /* Various fill types */
  119. #define FT_NONE        0    /* No fill            */
  120. #define FT_COLOR    1    /* Fill with color from palette */
  121. #define FT_OBJECTS    2    /* Fill with tiled objects    */
  122.  
  123. /* Join types */
  124. #define JT_NONE        0    /* No join */
  125. #define JT_MITER    1    /* Mitered join */
  126. #define JT_BEVEL    2    /* Beveled join */
  127. #define JT_ROUND    3    /* Round join */
  128.  
  129.  
  130. struct ATTRstruct {
  131.     UBYTE    FillType;    /* One of FT_*, above    */
  132.     UBYTE    JoinType;    /* One of JT_*, above    */
  133.     UBYTE    EdgePattern;    /* Lookup into edge pat    */
  134.     UBYTE    ArrowHeads;    /* Lookup into arrows    */
  135.     USHORT    FillValue;    /* Color or fill index    */
  136.     USHORT    EdgeValue;    /* Edge color index    */
  137.     USHORT    WhichLayer;    /* Which layer it's in    */
  138.     IEEE    EdgeThick;    /* Line width        */
  139. };
  140.  
  141.  
  142. /* Structure for ID_BBOX, object bounding box */
  143. struct BBOXstruct {
  144.     IEEE    XMin, YMin,
  145.         XMax, YMax;
  146. };
  147.  
  148.  
  149. /* Structure and flags for ID_CPLY and ID_OPLY */
  150. #define DR2D_IND    0xFFFFFFFF
  151. #define DR2D_SPLINE    0x00000001
  152. #define DR2D_MOVETO    0x00000002
  153.  
  154. struct POLYstruct {
  155.     USHORT    NumPoints;
  156.     /*IEEE    PolyPoints[2*NumPoints];*/
  157. };
  158.  
  159.  
  160. /* Structure for ID_GRUP - a group of objects */
  161. struct GRUPstruct {
  162.     USHORT    NumObjs;
  163. };
  164.  
  165.  
  166. /* Structure for ID_XTRN - an externally controlled object */
  167. /* Flags for application callbacks */
  168. #define    X_CLONE        0x0001    /* 'appl clone obj dx dy' */
  169. #define X_MOVE        0x0002    /* 'appl move obj dx dy' */
  170. #define    X_ROTATE    0x0004    /* 'appl rotate obj cx cy angle' */
  171. #define    X_RESIZE    0x0008    /* 'appl size obj cx cy sx sy' */
  172. #define X_CHANGE    0x0010    /* 'appl change obj et ev ft fv ew jt fn' */
  173. #define    X_DELETE    0x0020    /* 'appl delete obj' */
  174. #define X_CUT        0x0040    /* 'appl cut obj' */
  175. #define X_COPY        0x0080    /* 'appl copy obj' */
  176. #define X_UNGROUP    0x0100    /* 'appl ungroup obj' */
  177.  
  178. struct XTRNstruct {
  179.     USHORT    ApplCallBacks;        /* See definitions above */
  180.     USHORT    ApplNameLength;        /* Should ALWAYS be padded */
  181.     /*char    ApplName[ApplNameLength];*/
  182. };
  183.  
  184.  
  185. /* Structure for ID_TPTH - text along a path */
  186. struct TPTHstruct {
  187.     USHORT    WhichFont;        /* Which font to use */
  188.     IEEE    CharW, CharH;        /* W/H if an individual char */
  189.     USHORT    NumChars;        /* Number of chars in the string */
  190.     USHORT    NumPoints;        /* Number of points in the path */
  191.     /* char    TextChars[NumChars]; */    /* PAD TO EVEN #! */
  192.     /* IEEE    Path[2*NumPoints]; */    /* The path on which the text lies */
  193. };
  194.  
  195.  
  196. /* Structure for ID_STXT - simple text string */
  197. struct STXTstruct {
  198.     short    WhichFont;    /* Index into font table */
  199.     IEEE    CharW, CharH,    /* W/H of an individual char    */
  200.         BaseX, BaseY,    /* Start of baseline */
  201.         Rotation;    /* Angle of text (in radians) */
  202.     USHORT    NumChars;
  203.     /*char    TextChars[1];*/
  204. };
  205.  
  206.  
  207. /* Structure for ID_VBM - virtually positioned and sized bitmap */
  208. struct VBMstruct {
  209.     IEEE    XPos, YPos,        /* Virtual coords */
  210.         XSize, YSize,        /* Virtual size */
  211.         Rotation;        /* Ignored */
  212.     USHORT    PathLen;        /* Length of path, in chars */
  213.     /*char    Path[];               Directory/file path */
  214. };
  215.  
  216. #endif    /* DR2D_H_INCLUDED */
  217. /*** EOF dr2d.h ***/
  218.