/* KeyReq.h */

/*= Defines ============================================*/

/* LVO's */

#define LVO_FreeSysRequest -372
#define LVO_EasyRequestArgs -588
#define LVO_AutoRequest -348
#define LVO_OpenWindowTagList -606
#define LVO_BuildEasyRequestArgs -594
#define LVO_BuildSysRequest -360
#define LVO_SysReqHandler -600
#define LVO_FreeSysRequest -372

/* gadrect mode */

#define GRMOD_NORMAL 0
#define GRMOD_BACKFILL 1

/* Program Flags */

#define PFLG_NOHIGHLIGHT 1
#define PFLG_NOTAB 2
#define PFLG_NOCOMMAND 4
#define PFLG_NOKEYGADGET 8
#define PFLG_PORTADDED 16
#define PFLG_SOUNDDAEMON 32

/* Highlight color type */

#define HCTYP_PEN 0
#define HCTYP_RGB 1

/* Requester position */

#define RPOS_DONTCHANGE 0
#define RPOS_CENTER 1
#define RPOS_MOUSE 2

/* Patchtable defines */

#define LIB_INTUITION 1

/* misc */

#define NUM_REQTITLE 3
#define NUM_SOUNDMESSAGE 3


/*= Structures =========================================*/

struct ReqEntry
{
	struct Node node;
	struct Window *req;
	LONG	 highcol;
	BYTE	 activegad;
	BYTE	 numgadgets;
};

struct PatchEntry
{
	BOOL	DoPatch;
	WORD	LibID;
	WORD	LVO;
	APTR	NewFunction;
	APTR	&OldFunction;
};

/*= vars ===============================================*/

#ifndef NOVARS

extern "C"
{
	#include "vars.h"
};

#endif


/*= Protos =============================================*/

/* asm.s */

extern "ASM" ULONG MakeRGB32(register __d1 ULONG c);
extern "ASM" void New_EasyRequestArgs(void);
extern "ASM" void New_AutoRequest(void);
extern "ASM" void New_BuildEasyRequestArgs(void);
extern "ASM" void New_BuildSysRequest(void);
extern "ASM" void New_OpenWindowTagList(void);
extern "ASM" void New_SysReqHandler(void);
extern "ASM" void New_FreeSysRequest(void);

extern "ASM" LONG JumpOld_EasyRequestArgs(register __a0 struct Window *window,register __a1 struct EasyStruct *easystruct,register __a2 ULONG *idcmpflags,register __a3 APTR args);
extern "ASM" LONG JumpOld_AutoRequest(register __a0 struct Window *window,register __a1 struct IntuiText *bodytext,register __a2 struct IntuiText *positivetext, register __a3 struct IntuiText *negativetext,register __d0 ULONG positiveflags,register __d1 ULONG negativeflags,register __d2 ULONG width, register __d3 ULONG height);
extern "ASM" struct Window *JumpOld_BuildEasyRequestArgs(register __a0 struct Window *window,register __a1 struct EasyStruct *easystruct,register __d0 ULONG idcmpflags,register __a3 APTR args);
extern "ASM" struct Window *JumpOld_OpenWindowTagList(register __a0 struct NewWindow *nw,register __a1 struct TagItem *taglist);
extern "ASM" LONG JumpOld_SysReqHandler(register __a0 struct Window *reqwindow,register __a1 ULONG *idcmpflags,register __d0 LONG wait);

/* misc.c */

struct Gadget *FindGadget(struct Window *win,WORD id);
BOOL KeyGadget(struct Window *win,struct Gadget *gad,WORD icode);
void HighlightGadget(struct Window *win,struct DrawInfo *di,WORD gid,WORD mode,WORD col);
struct ReqEntry *Add_Requester(struct Window *req);
struct ReqEntry *Find_Requester(struct Window *req);
void Remove_Requester(struct ReqEntry *r);
BOOL OutOfAction(void);
char *GetTaskName(void);

/* patch.c */

LONG NEW_EasyRequestArgs(struct Window *window,struct EasyStruct *easystruct,ULONG *idcmpflags,APTR args);
LONG NEW_AutoRequest(struct Window *window,struct IntuiText *bodytext, struct IntuiText *positivetext, struct IntuiText *negativetext,ULONG positiveflags,ULONG negativeflags,ULONG width,ULONG height);

/* main.c */


