home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 530b.lha / AMenu_v1.3 / AMenu.h < prev    next >
C/C++ Source or Header  |  1991-07-03  |  4KB  |  100 lines

  1. /*********************************************************************\
  2. **                               ________________________________    **
  3. **    A n t h o n y             |________    __    __    ________|   **
  4. **                                       |  |o_|  |o_|  |            **
  5. **            T h y s s e n            __|   __    __   |__          **
  6. **                                  __|   __|  |  |  |__   |__       **
  7. **   `` Dragon Computing ! ''    __|   __|     |  |     |__   |__    **
  8. **                              |_____|        |__|        |_____|   **
  9. **                                                                   **
  10. \*********************************************************************/
  11. /* Reprogrammed by  Anthony Thyssen Feburary 1991 --
  12. **   Original Program "MyMenu" from `Fred Fish Disk 225' by
  13. ** Darin Johnson, 1989.  Thanks for the original program it is
  14. ** the best I had seen, but has a number of mistakes.
  15. **   Thanks to Sylvain Rougier & Pierre Carrette for their version
  16. ** of Run.o which was also reprogrammed.
  17. **   Edited with Dme and Compiled with Lattice C v5.0 and my own
  18. ** "ArpC" startup code for Arp Programs.
  19. */
  20.  
  21. #define  DO_ARP_COPIES         /* replace Dos calls with Arp Calls */
  22. #include <Libraries/ArpBase.h>
  23. #include <Proto/Arp.h>
  24. #include <Proto/Exec.h>
  25. #include <Proto/Intuition.h>
  26. #include <Proto/Graphics.h>
  27. #include <Exec/Memory.h>
  28. #include <String.h>
  29.  
  30. #define VERSION         "AMenu v1.3"
  31. #define COPYRIGHT \
  32.  "AMenu v1.3 -- WorkBench menu support\n by Anthony Thyssen (Dragon Computing)"
  33.  
  34. #define AMENU_CONFIG    "S:AMenu.Config"
  35. #define AMENU_CONFIG2   "AMenu.Config"
  36. #define AMENU_HANDLER   "L:AMenu-Handler"
  37. #define AMENU_HANDLER2  "AMenu-Handler"
  38. #define AMENU_PORT      "AMenu-Port"
  39. #define AMENU_WBPORT    "AMenu-WBPort"
  40.  
  41.  
  42.   /* AMenu Defaults */
  43. #define DEF_STACK        4096         /* Defaults used by program */
  44. #define DEF_CONSOLE     "CON:100/11/200/20/AMenu Command"
  45. #define DEF_DIRECTORY   "SYS:"        /* the assigned Sys: not boot device */
  46.  
  47.  
  48.   /* Debugging Macros */
  49. #ifdef DBUG     /* Debuging macros -- only compile DB( stmt ) on DBUG */
  50. #  define DB(stmt)   stmt
  51. #  define DBConsole  "CON:250/155/300/100/Debug Console"  /* PAL screen only */
  52.    extern BPTR   DBWindow;   /* file handle to above window */
  53. #else
  54. #  define DB(stmt)
  55. #endif
  56.  
  57.  
  58. extern struct ArpBase       *ArpBase;
  59. extern struct IntuitionBase *IntuitionBase;
  60. extern struct GfxBase       *GfxBase;
  61.  
  62.  
  63.   /* information about what to run on menu entry selection */
  64. struct ExtMenuItem {
  65.   struct MenuItem     MenuItem;     /* MenuItem it extend */
  66.   struct ExtMenuItem *NextEItem;    /* Search and Freeing List Link */
  67.   char               *Cmd;          /* Command to execute */
  68.   char               *Args;         /* Arguments for Non-WorkBench */
  69.   char               *Console;      /* Window to use  `'   `' */
  70.   char               *Directory;    /* Directory      `'   `' */
  71.   ULONG               Stack;        /* Stack          `'   `' */
  72.   BYTE                Pri;          /* Prioity        `'   `' */
  73.   char                Mode;         /* How to execute the item R,C,W */
  74. };
  75.  
  76.  
  77.   /* Error codes returned by Handler in M->ErrorCode */
  78. typedef enum {
  79.  ERR_OK, ERR_LIB, ERR_MPORT, ERR_DIR, ERR_MON, ERR_REPLYPORT, ERR_WBOPEN
  80. } HandlerError;
  81.  
  82.  
  83.   /* shared data structure attached to a Named Port */
  84. struct MPort {
  85.   struct MsgPort      Port;                   /* Port data is attacted to */
  86.   struct ExtMenuItem *EItemList;              /* List for search and Free */
  87.   struct Menu        *AMenu;                  /* Pointer to My New Menus */
  88.   struct Window      *WBWindow;               /* BackGround Window of WB */
  89.   BPTR                Segment;                /* struct Segment ptr */
  90.   char               *Console;                /* Default Console */
  91.   char               *Directory;              /* Default Directory */
  92.   struct Task        *Handler, *Parent;       /* Other Task */
  93.   USHORT              HandlerSig, ParentSig;  /* signals to flag with */
  94.   HandlerError        ErrorCode;              /* Returned error code */
  95. };
  96.  
  97. extern struct MPort *M;       /* Pointer to the Named Port */
  98.  
  99.  
  100.