home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d5xx / d502 / cells.lha / CELLS / CELLSSource.lzh / cRequest.h < prev    next >
C/C++ Source or Header  |  1991-04-20  |  3KB  |  81 lines

  1. /*
  2.  *  CELLS       An Implementation of the WireWorld cellular automata
  3.  *              as described in Scientific American, Jan 1990.
  4.  *
  5.  *              Copyright 1990 by Davide P. Cervone.
  6.  *  You may use this code, provided this copyright notice is kept intact.
  7.  *  See the CELLS.HELP file for complete information on distribution conditions.
  8.  */
  9.  
  10. /*
  11.  *  File:  cRequest.h           Structures used for all requesters and for
  12.  *                              list gadgets
  13.  */
  14.  
  15.  
  16. #define MAXBUFFER       128             /* string buffer size */
  17. #define MAXPNAME        30              /* part name size */
  18. #define MAXFNAME        MAXBUFFER       /* file name size */
  19.  
  20. typedef struct ExtRequest EXTREQUEST;
  21. typedef struct ListInfo   LISTINFO;
  22. typedef struct ListItem   LISTITEM;
  23.  
  24.  
  25. /*
  26.  *  Extended Requester structure
  27.  */
  28.  
  29. struct ExtRequest
  30. {
  31.    struct Requester er_Request;
  32.    FUNCTION         er_GadgetDown;      /* function for Gadget Down */
  33.    FUNCTION         er_GadgetUp;        /* function for Gadget Up */
  34.    FUNCTION         er_MouseMove;       /* function for Mouse move */
  35.    struct Gadget   *er_ActiveGadget;    /* gadget to activate automatically */
  36. };
  37.  
  38.  
  39. /*
  40.  *  Linked list of items appearing in a list gadget on a requester 
  41.  */
  42.  
  43. struct ListItem
  44. {
  45.    struct ListItem *Next,*Prev;
  46.    char *Name;
  47.    UWORD NameLen;
  48.    UWORD Flags;
  49.       #define LI_SELECTED   BIT(0)      /* this is the selected item */
  50.       #define LI_NOFIRST    BIT(1)      /* kludge to prevent first character */
  51. };                                      /*  of directory name from being */
  52.                                         /*  copied to the name gadget
  53.  
  54. /*
  55.  *  Structure that controls the list gadget within a requester
  56.  */
  57.  
  58. struct ListInfo
  59. {
  60.    struct ExtRequest *Request;      /* the requester where this list exists */
  61.    struct Gadget *Gadget;           /* the list gadget itself */
  62.    struct Gadget *Name;             /* the name gadget for the list (or NULL) */
  63.    struct Gadget *Slider;           /* the vertical slider for the list */
  64.    struct ListItem *Item;           /* the list of items to be displayed */
  65.    struct ListItem *ItemTop;        /* the item currently at the top */
  66.    struct ListItem *ItemSelect;     /* the item currently selected */
  67.    struct IntuiText *IText;         /* the IntuiText array for the list */
  68.    struct Image *Image;             /* the Image array for the list */
  69.    short Height;                    /* height in pixels */
  70.    short Width;                     /* width in characters */
  71.    short TopText;                   /* array index of the IText of top item */
  72.    short TopItem;                   /* the position in the Item list */
  73.    short SelectedItem;              /* the position in the item list */
  74.       #define LI_NOSELECT   -1
  75.    short ListLen;                   /* the length of the item list */
  76.    UWORD Flags;                     /* flags */
  77. };
  78.  
  79. extern LISTITEM *DoListHit();
  80. extern LISTITEM *InitList();
  81.