home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magazyn Amiga Shareware Floppies
/
ma15.dms
/
ma15.adf
/
Yak
/
Source
/
hotkey_types.h
< prev
next >
Wrap
C/C++ Source or Header
|
1993-05-17
|
3KB
|
109 lines
/*
* Definitions for generic Yak hotkeys.
* mws, 27 April 1993
*/
#ifndef HOTKEY_TYPES_H
#define HOTKEY_TYPES_H
#ifndef EXEC_TYPES_H
#include <exec/types.h>
#endif /* EXEC_TYPES_H */
#ifndef EXEC_NODES_H
#include <exec/nodes.h>
#endif /* EXEC_NODES_H */
#ifndef EXEC_LISTS_H
#include <exec/lists.h>
#endif /* EXEC_LISTS_H */
#ifndef LIBRARIES_COMMODITIES_H
#include <libraries/commodities.h>
#endif /* LIBRARIES_COMMODITIES_H */
/*
* YakHotKey structure definition
*/
typedef struct {
struct Node yhk_Node; /* node for linked-list */
CxObj *yhk_CxObj; /* cx object list */
char *yhk_KeyDef; /* actual key definition */
char *yhk_ArgStr; /* command argument */
UWORD yhk_Type; /* hotkey type */
UWORD yhk_Options; /* hotkey options */
} YakHotKey;
/*
* Types of hotkey currently supported
*/
#define DOS_COMMAND 0
#define CLOSE_WINDOW 1
#define ZIP_WINDOW 2
#define SHRINK_WINDOW 3
#define EXPAND_WINDOW 4
#define CYCLE_WINDOWS 5
#define OPEN_PALETTE 6
#define SCREEN_TO_FRONT 7
#define SCREEN_TO_BACK 8
#define ACTIVATE_WORKBENCH 9
#define CENTRE_SCREEN 10
#define BLANK_DISPLAY 11
#define INSERT_TEXT 12
#define INSERT_DATE 13
#define SHOW_INTERFACE 14
#define NUM_HOTKEY_TYPES 15
/*
* YakHotKey options.
*/
#define NO_OPTIONS 0
#define WB_TO_FRONT 1
#define DEF_PUBSCR_TO_FRONT 2
#define NUM_OPTIONS 3
/*
* YakHotKeyType structure
*/
typedef struct {
struct MinList yhkt_list; /* list of keys */
void (*yhkt_Command)(YakHotKey *); /* command to call */
UWORD yhkt_count; /* # of keys attached */
WORD yhkt_Flags;
} YakHotKeyType;
/*
* Flags for YakHotKeyType
*/
#define TAKES_ARGUMENT (1<<0) /* ArgStr is relevant */
#define HAS_OPTIONS (1<<1) /* let user set screen behaviour */
/*
* Info for anyone to examine
*/
extern YakHotKeyType yhktypes[NUM_HOTKEY_TYPES];
extern UWORD num_hkeys;
#define YHK_Takes_Arg(yhk) (yhktypes[(yhk)->yhk_Type].yhkt_Flags & TAKES_ARGUMENT)
#define YHK_Has_Options(yhk) (yhktypes[(yhk)->yhk_Type].yhkt_Flags & HAS_OPTIONS)
#define keylist(type) ((struct List *)&yhktypes[type].yhkt_list)
#define numkeys(type) yhktypes[type].yhkt_count
/*
* And functions for anyone to call
*/
void PerformAction(YakHotKey *yhk);
void DeleteYakHotKey(YakHotKey *yhk);
int ModifyYHKKeyDef(YakHotKey *yhk, char *keystr);
int ModifyYHKArgStr(YakHotKey *yhk, char *argstr);
YakHotKey *NewYakHotKey(UWORD type);
void InitYakHotKeyList(void);
void DeleteYakHotKeyList(void);
int OkayToExit(void);
char *DupStr(char *str);
#define FreeStr(s) FreeVec(s)
#endif /* HOTKEY_TYPES_H */