/****************************************************************************
*
*	KeyMacro.h ------------	KeyMacro main include file.
*
*	Author ----------------	Olaf Barthel, MXM
*				Brabeckstrasse 35
*				D-3000 Hannover 71
*
*	KeyMacro  ©  Copyright  1990  by  MXM;  Executable  program,
*	documentation  and  source  code are shareware.  If you like
*	this  program  a  small donation will entitle you to receive
*	updates and new programs from MXM.
*
****************************************************************************/

#ifndef KEYMACRO_H
#define KEYMACRO_H 1

#include <intuition/intuitionbase.h>
#include <libraries/dosextens.h>
#include <workbench/workbench.h>
#include <devices/inputevent.h>
#include <workbench/startup.h>
#include <exec/interrupts.h>
#include <exec/execbase.h>
#include <devices/input.h>
#include <exec/memory.h>

#include <functions.h>

#include <mxmproto.h>

#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>

#define PORTNAME	"KeyMacro"
#define REVISION	4

#define SIG_CLOSE	SIGBREAKF_CTRL_C
#define SIG_PORT	(1 << SigBit)
#define SIG_SHAKE	SIGBREAKF_CTRL_F

#define MK_UNUSED	0
#define MK_WORD		1
#define MK_COMMAND	2

#define MM_INPUT	0
#define MM_UPDATE	1
#define MM_EXECUTE	2

#define MAXMACROS	30

struct KeyAlias
{
	char	*ka_Name;
	ULONG	 ka_Key;
};

struct MacroKey
{
	UBYTE	 mk_Type;

	LONG	 mk_CommandKey;
	LONG	 mk_CommandQualifier;

	UBYTE	*mk_String;
	UBYTE	*mk_Window;
};

struct MacroMessage
{
	struct Message	 mm_Message;

	UBYTE		 mm_Type;

	struct MacroKey	*mm_MacroKey;

	LONG		 mm_NumMacros;
	struct MacroKey	*mm_MacroList;

	UBYTE		*mm_FileName;
	UBYTE		*mm_WindowName;
};

struct MSeg
{
	struct MsgPort	 Port;

	BPTR		 Segment;
	LONG		 SegSize;

	struct Task	*Father;
	struct Task	*Child;

	ULONG		 RingBack;
	UBYTE		 Revision;

	LONG		 NumMacros;
	struct MacroKey	*MacroList;
};

#endif
