home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 2: PC / frozenfish_august_1995.bin / bbs / d09xx / d0912.lha / Yak / Source / Source.lha / hotkey_types.h < prev    next >
C/C++ Source or Header  |  1993-07-31  |  3KB  |  109 lines

  1. /*
  2.  * Definitions for generic Yak hotkeys.
  3.  * mws, 27 April 1993
  4.  */
  5.  
  6. #ifndef HOTKEY_TYPES_H
  7. #define HOTKEY_TYPES_H
  8.  
  9. #ifndef EXEC_TYPES_H
  10. #include <exec/types.h>
  11. #endif /* EXEC_TYPES_H */
  12.  
  13. #ifndef EXEC_NODES_H
  14. #include <exec/nodes.h>
  15. #endif /* EXEC_NODES_H */
  16.  
  17. #ifndef EXEC_LISTS_H
  18. #include <exec/lists.h>
  19. #endif /* EXEC_LISTS_H */
  20.  
  21. #ifndef LIBRARIES_COMMODITIES_H
  22. #include <libraries/commodities.h>
  23. #endif /* LIBRARIES_COMMODITIES_H */
  24.  
  25.  
  26. /*
  27.  * YakHotKey structure definition
  28.  */
  29. typedef struct {
  30.     struct Node     yhk_Node;    /* node for linked-list */
  31.     CxObj        *yhk_CxObj;    /* cx object list */
  32.     char        *yhk_KeyDef;    /* actual key definition */
  33.     char        *yhk_ArgStr;    /* command argument */
  34.     UWORD         yhk_Type;    /* hotkey type */
  35.     UWORD         yhk_Options;    /* hotkey options */
  36. } YakHotKey;
  37.  
  38. /*
  39.  * Types of hotkey currently supported
  40.  */
  41. #define DOS_COMMAND    0
  42. #define CLOSE_WINDOW    1
  43. #define ZIP_WINDOW    2
  44. #define SHRINK_WINDOW    3
  45. #define EXPAND_WINDOW    4
  46. #define CYCLE_WINDOWS    5
  47. #define OPEN_PALETTE    6
  48. #define SCREEN_TO_FRONT    7
  49. #define SCREEN_TO_BACK    8
  50. #define ACTIVATE_WORKBENCH 9
  51. #define CENTRE_SCREEN    10
  52. #define BLANK_DISPLAY    11
  53. #define INSERT_TEXT    12
  54. #define INSERT_DATE    13
  55. #define SHOW_INTERFACE    14
  56. #define NUM_HOTKEY_TYPES 15
  57.  
  58. /*
  59.  * YakHotKey options.
  60.  */
  61. #define NO_OPTIONS    0
  62. #define WB_TO_FRONT    1
  63. #define DEF_PUBSCR_TO_FRONT 2
  64. #define NUM_OPTIONS 3
  65.  
  66. /*
  67.  * YakHotKeyType structure
  68.  */
  69. typedef struct {
  70.     struct    MinList yhkt_list;        /* list of keys */
  71.     void    (*yhkt_Command)(YakHotKey *);    /* command to call */
  72.     UWORD    yhkt_count;            /* # of keys attached */
  73.     WORD    yhkt_Flags;
  74. } YakHotKeyType;
  75.  
  76. /*
  77.  * Flags for YakHotKeyType
  78.  */
  79. #define    TAKES_ARGUMENT    (1<<0)        /* ArgStr is relevant */
  80. #define HAS_OPTIONS    (1<<1)        /* let user set screen behaviour */
  81.  
  82. /*
  83.  * Info for anyone to examine
  84.  */
  85. extern YakHotKeyType yhktypes[NUM_HOTKEY_TYPES];
  86. extern UWORD num_hkeys;
  87.  
  88. #define YHK_Takes_Arg(yhk)    (yhktypes[(yhk)->yhk_Type].yhkt_Flags & TAKES_ARGUMENT)
  89. #define YHK_Has_Options(yhk)    (yhktypes[(yhk)->yhk_Type].yhkt_Flags & HAS_OPTIONS)
  90. #define keylist(type)        ((struct List *)&yhktypes[type].yhkt_list)
  91. #define numkeys(type)        yhktypes[type].yhkt_count
  92.  
  93. /*
  94.  * And functions for anyone to call
  95.  */
  96. void PerformAction(YakHotKey *yhk);
  97. void DeleteYakHotKey(YakHotKey *yhk);
  98. int ModifyYHKKeyDef(YakHotKey *yhk, char *keystr);
  99. int ModifyYHKArgStr(YakHotKey *yhk, char *argstr);
  100. YakHotKey *NewYakHotKey(UWORD type);
  101. void InitYakHotKeyList(void);
  102. void DeleteYakHotKeyList(void);
  103. int OkayToExit(void);
  104. char *DupStr(char *str);
  105. #define FreeStr(s) FreeVec(s)
  106.  
  107.  
  108. #endif /* HOTKEY_TYPES_H */
  109.