home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 145.lha / TableCloth / tablecloth.h < prev    next >
C/C++ Source or Header  |  1986-11-21  |  2KB  |  92 lines

  1.  
  2. #include <exec/types.h>
  3. #include <exec/memory.h>
  4. #include <intuition/intuition.h>
  5. #include <intuition/intuitionbase.h>
  6.  
  7. struct    Window        *getNewWind();
  8.  
  9. struct    IntuitionBase    *IntuitionBase;
  10. struct    GfxBase     *GfxBase;
  11.  
  12. #define debug(x)
  13.  
  14. #define MIN(x,y) ((x) < (y) ? (x) : (y))
  15. #define MAX(x,y) ((x) > (y) ? (x) : (y))
  16.  
  17. /* for my window structure */
  18.  
  19. extern ULONG flg;
  20. extern ULONG iflg;
  21.  
  22. /*------------------------------------------------------------------------*/
  23.                 /* IFF header stuff */
  24. /*------------------------------------------------------------------------*/
  25.  
  26. /* This was all lifted from an example by Leo Schwab */
  27.  
  28. /* turn 4 letters into a longword value */
  29. #define MAKE_ID(a,b,c,d) (((long)(a)<<24)+((long)(b)<<16)+((long)(c)<<8)+(long)(d))
  30.  
  31. /* chunk types; not all are relevant to the program */
  32.  
  33. #define FORM    MAKE_ID('F', 'O', 'R', 'M')
  34. #define ILBM    MAKE_ID('I', 'L', 'B', 'M')
  35. #define BMHD    MAKE_ID('B', 'M', 'H', 'D')
  36. #define CMAP    MAKE_ID('C', 'M', 'A', 'P')
  37. #define BODY    MAKE_ID('B', 'O', 'D', 'Y')
  38. #define GRAB    MAKE_ID('G', 'R', 'A', 'B')
  39. #define DEST    MAKE_ID('D', 'E', 'S', 'T')
  40. #define SPRT    MAKE_ID('S', 'P', 'R', 'T')
  41. #define CAMG    MAKE_ID('C', 'A', 'M', 'G')
  42. #define CRNG    MAKE_ID('C', 'R', 'N', 'G')
  43. #define CCRT    MAKE_ID('C', 'C', 'R', 'T')
  44. #define DPPV    MAKE_ID('D', 'P', 'P', 'V')
  45.  
  46. #define CHUNKHEADERSIZE     sizeof (struct ChunkHeader)
  47.  
  48. /*  Compression techniques  */
  49. #define cmpNone         0
  50. #define cmpByteRun1        1
  51.  
  52. /*  Bitmap header (BMHD) structure  */
  53. struct bmhd {
  54.     UWORD    w, h;        /*  Width, height in pixels */
  55.     WORD    x, y;        /*  x, y position for this bitmap  */
  56.     UBYTE    nplanes;    /*  # of planes  */
  57.     UBYTE    Masking;
  58.     UBYTE    Compression;
  59.     UBYTE    pad1;
  60.     UWORD    TransparentColor;
  61.     UWORD    XAspect, YAspect;
  62.     WORD    PageWidth, PageHeight;
  63. };
  64.  
  65. /* NB: IFF colours aren't quite the same as you normally think */
  66. struct ColorRegister {
  67.     UBYTE red, green, blue;
  68. };
  69.  
  70. /* since we can think of 'FORM' and the like as strings or longwords */
  71. union yachunk {
  72.     char name[4];
  73.     long type;
  74. };
  75.  
  76. struct ChunkHeader {
  77.     union yachunk chunktype;
  78.     long chunksize;
  79. };
  80.  
  81. #define TYPE        chunktype.type
  82. #define STRTYPE     chunktype.name
  83.  
  84. /*------------------------------------------------------------------------*/
  85.  
  86. /* Some IFF functions; sketchy, but I hope they're illustrative and adaptable */
  87.  
  88. BOOL get_body();
  89. long get_chunk();
  90. BOOL good_pict();
  91.  
  92.