home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 240.lha / PickPacket_v1.0 / Sources / struct.h < prev    next >
C/C++ Source or Header  |  1989-05-04  |  4KB  |  119 lines

  1. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
  2. * |_o_o|\\ Copyright (c) 1989 The Software Distillery.                    *
  3. * |. o.| ||          All Rights Reserved                                  *
  4. * | .  | ||          Written by John Toebes and Doug Walker               *
  5. * | o  | ||          The Software Distillery                              *
  6. * |  . |//           235 Trillingham Lane                                 *
  7. * ======             Cary, NC 27513                                       *
  8. *                    BBS:(919)-471-6436                                   *
  9. \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  10. #ifndef DSTRUCT
  11. #define DSTRUCT
  12.  
  13.  
  14. struct BUFDATA
  15. {
  16. struct Gadget Gadget1;
  17. struct Gadget Gadget2;
  18. struct Gadget Gadget3;
  19. struct PropInfo Gadget1SInfo;
  20. int    pos;
  21. int    size;
  22. char   buf[1];
  23. };
  24.  
  25. struct VIEWDATA
  26. {
  27. struct Gadget Gadget1;
  28. struct Gadget Gadget2;
  29. struct Gadget Gadget3;
  30. struct PropInfo Gadget1SInfo;
  31. int    pos;
  32. int    size;
  33. /* THROUGH HERE MUST BE IDENTICAL TO TOP OF STRUCT BUFDATA */
  34. int    lines;
  35. char  *posptr;
  36. char   buf[1];
  37. };
  38.  
  39. union STDATA
  40. {
  41.    APTR data;
  42.    struct BUFDATA *bdata;
  43.    struct VIEWDATA *vdata;
  44.    struct FileInfoBlock *fib;
  45.    struct FileHandle *fh;
  46.    struct FileLock *lock;
  47.    struct InfoData *info;
  48.    struct DeviceList *volume;
  49.    struct DevInfo *device;
  50.    struct DosList *assign;
  51. };
  52.  
  53. #define WNAMELEN 20
  54.  
  55. struct STNODE
  56. {
  57.    struct STNODE *next, *prev;
  58.    int len;              /* Length of this allocation, for convenience   */
  59.    int num;              /* Number of the node within its type           */
  60.    int type;             /* One of the ST_ defines above                 */
  61.    union STDATA d;       /* Points to the mem allocted for the struct    */
  62.    char wname[WNAMELEN]; /* Name of the window                           */
  63.    char *oname;          /* Name of the object associated with it        */
  64.    struct Window *w;     /* Points to the window opened to display it    */
  65.    struct MsgPort *pid;  /* Process filehandle allocated on              */
  66. };
  67.  
  68. struct STGLOB
  69. {
  70.    struct STNODE *stlist;/* Linked list of STNODE structures             */
  71.    struct STNODE *unlist;/* Linked list of unlinked nodes                */
  72.    int count[ST_NUM];    /* How many of each type there are              */
  73.    struct MsgPort *Port; /* Message port to use for comm with Intuition  */
  74. };
  75.  
  76. #define DOTEXT(y, format, val) \
  77.    sprintf(data, format, val); \
  78.    PrintIText(n->w->RPort, &IText, 0, y);
  79.  
  80.  
  81. #define INITTEXT(top)                    \
  82.  int T_windwidth = (n->w->Width-21)/8;   \
  83.  int T_windheight = (n->w->Height - 8); \
  84.  int T_windpos = top;                    \
  85.  IText.IText = (UBYTE *)data;
  86.  
  87. #define SHOWTEXT                         \
  88.  data[T_windwidth] = 0;                  \
  89.  if (T_windpos < T_windheight)           \
  90.     PrintIText(n->w->RPort, &IText, 5, T_windpos); \
  91.  T_windpos += 9;
  92.  
  93. #define SHOWNAME                         \
  94.  data[T_windwidth] = 0;                  \
  95.  if (T_windpos < T_windheight)           \
  96.     PrintIText(n->w->RPort, &NameText, 5, T_windpos); \
  97.  T_windpos += 9;
  98.  
  99.  
  100. void stfhnew(struct NewWindow **, struct IntuiText **, struct STNODE *);
  101. void stlocknew(struct NewWindow **, struct IntuiText **, struct STNODE *);
  102. void stfibnew(struct NewWindow **, struct IntuiText **, struct STNODE *);
  103. void stinfnew(struct NewWindow **, struct IntuiText **, struct STNODE *);
  104. void stbufnew(struct NewWindow **, struct IntuiText **, struct STNODE *);
  105. void stviewnew(struct NewWindow **, struct IntuiText **, struct STNODE *);
  106.  
  107.  
  108. int stfhdisp(struct STNODE *);
  109. int stlockdisp(struct STNODE *);
  110. int stfibdisp(struct STNODE *);
  111. int stinfdisp(struct STNODE *);
  112. int stbufdisp(struct STNODE *);
  113. int stviewdisp(struct STNODE *);
  114.  
  115. int stbufmove(struct STNODE *, int);
  116. int stviewmove(struct STNODE *, int);
  117.  
  118.  
  119. #endif