home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 500-599 / ff562.lza / Intuisup / Menus / source.lzh / menus.h < prev   
C/C++ Source or Header  |  1991-09-23  |  2KB  |  69 lines

  1.         /*************************************
  2.          *                                   *
  3.          *             Menus v2.0            *
  4.          *   by Torsten Jürgeleit in 05/91   *
  5.          *                                   *
  6.          *    Defines, structs and protos    *
  7.          *                                   *
  8.          *************************************/
  9.  
  10. #ifndef    MENU_LIST_H
  11. #define    MENU_LIST_H
  12.  
  13.     /* Defines */
  14.  
  15. #define MENU_DATA_TYPE_TITLE    1
  16. #define MENU_DATA_TYPE_ITEM    2
  17. #define MENU_DATA_TYPE_SUBITEM    3
  18.  
  19. #define MAX_MENU_DATA_TYPE    MENU_DATA_TYPE_SUBITEM
  20.  
  21. #define MENU_DATA_FLAG_DISABLED        (1 << 0)    /* disable menu or menu item */
  22. #define MENU_DATA_FLAG_ATTRIBUTE    (1 << 1)    /* attribute menu item */
  23. #define MENU_DATA_FLAG_SELECTED        (1 << 2)    /* selected attribute menu item */
  24. #define MENU_DATA_FLAG_EMPTY_LINE    (1 << 3)    /* insert empty line before this item */
  25. #define MENU_DATA_FLAG_HIGH_NONE    (1 << 4)    /* no highliting */
  26. #define MENU_DATA_FLAG_HIGH_BOX        (1 << 5)    /* highliting with box, otherwise with complement */
  27.  
  28. #define MENU_LIST_FLAG_ATTACHED        (1 << 0)    /* menu list is currently attached to a window */
  29.  
  30.     /* Structures */
  31.  
  32. struct MenuList {
  33.     struct RenderInfo  *ml_RenderInfo;
  34.     struct Window      *ml_Window;
  35.     struct TextAttr    *ml_TextAttr;
  36.     struct TextFont    *ml_TextFont;
  37.     struct MenuData    *ml_Data;
  38.     USHORT    ml_Flags;
  39.     UBYTE    ml_TextPen1;
  40.     UBYTE    ml_TextPen2;
  41.     BYTE    *ml_Buffer;
  42.     ULONG    ml_BufferSize;
  43. };
  44. struct MenuData {
  45.     USHORT    md_Type;
  46.     USHORT    md_Flags;
  47.     BYTE    *md_Name;
  48.     BYTE    *md_CommandKey;
  49.     ULONG    md_MutualExclude;
  50. };
  51.     /* Global prototypes */
  52.  
  53. struct MenuList  *create_menu(struct RenderInfo  *ri, struct Window  *win,
  54.                 struct MenuData  *md, struct TextAttr  *ta);
  55. VOID attach_menu(struct Window  *win, struct MenuList  *ml);
  56. struct MenuItem  *menu_item_address(struct MenuList  *ml, USHORT menu_num);
  57. VOID remove_menu(struct MenuList  *ml);
  58. VOID free_menu(struct MenuList  *ml);
  59.  
  60.     /* Global pragmas */
  61.  
  62. #pragma regcall(create_menu(a0,a1,a2,a3))
  63. #pragma regcall(attach_menu(a0,a1))
  64. #pragma regcall(menu_item_address(a0,d0))
  65. #pragma regcall(remove_menu(a0))
  66. #pragma regcall(free_menu(a0))
  67.  
  68. #endif
  69.