#ifndef PV_MAINBASE_H
#define PV_MAINBASE_H TRUE
/*
**  $Filename: MainBase.h $
**  $Release: 1.10 $
**  $Revision: 37.517 $
**  $Date: 23 Sep 91 $
**
**  Structure definitions for Main Base (see 'TheWizardCorner')
**
**  © 1991 Jorrit Tyberghein, included with PowerVisor
**	    All Rights Reserved
*/

#ifndef PV_PVMEMORY_H
#include "PVMemory.h"
#endif

#ifndef EXEC_LISTS_H
#include <exec/lists.h>
#endif

#ifndef DOS_DOS_H
#include <dos/dos.h>
#endif


#define LASTCMD_NORMAL	0
#define LASTCMD_MEMORY	1
#define LASTCMD_UNASM	2
#define LASTCMD_VIEW	3

#define IDC_NEXTWIN	1
#define IDC_SCROLL1UP	2
#define IDC_SCROLLPGUP	3
#define IDC_SCROLLHOME	4
#define IDC_SCROLLEND	5
#define IDC_SCROLL1DO	6
#define IDC_SCROLLPGDO	7
#define IDC_SCROLLRIGHT	8
#define IDC_SCROLL1RI	9
#define IDC_SCROLL1LE	10
#define IDC_DSCROLL1UP	11
#define IDC_DSCROLLPGUP	12
#define IDC_DSCROLL1DO	13
#define IDC_DSCROLLPGDO	14
#define IDC_DSCROLLPC	15
#define IDC_EXEC	16
#define IDC_SNAP	17

#define KEYATTACH_INVISIBLE	1
#define KEYATTACH_SNAP		2
#define KEYATTACH_HOLDKEY	4


/* Structure describing a key
*/
struct CodeQual
	{
		UWORD Code,Qualifier;
	};

/* Structure describing a signal bit number and signal set mask
*/
struct SignalSet
	{
		ULONG BitNum,SigSet;
	};

/* One history line for the history buffer. These history lines are allocated
** as EXEC blocks (normal AllocMem)
*/
struct HistoryLine
	{
		struct HistoryLine *Next,*Prev;
		UWORD Size;		/* Size of complete structure */
		char String[1];		/* Variable sized structure */
	};

/* One structure for the aliases. These are EXEC blocks
*/
struct AliasLine
	{
		struct AliasLine *Next,*Prev;
		PVBLOCK CmdString;
		PVBLOCK AliasString;
	};

/* The keyattach node (or macro node). A keyattach node is an EXEC block
*/
struct KeyAttachNode
	{
		struct Node node;
		UWORD KeyCode;
		UWORD KeyQualifier;
		APTR CommandString;
		UWORD CommandStringLen;
		UWORD Flags;
	};

struct MainBase
	{
		UWORD OSVersion;
		APTR DosBase;
		APTR IntuitionBase;
		APTR GraphicsBase;
		APTR UtilityBase;
		APTR ExpansionBase;
		APTR DiskFontBase;
		APTR PowerVisorBase;
		APTR CliCmdLine;
		ULONG CliCmdLineLen;
		BPTR ErrorFile;
		ULONG pad0;
		ULONG pad1;
		UWORD RefreshSpeed;
		UWORD RefreshCounter;
		PVBLOCK RefreshCommand;
		struct CodeQual BreakKey;
		struct CodeQual HotKey;
		struct CodeQual PauseKey;
		struct CodeQual NextWinKey;
		struct CodeQual HistUpKey;
		struct CodeQual HistDoKey;
		UBYTE PVDebugMode;
		UBYTE pad2;
		UBYTE pad3;
		UBYTE pad4;
		PVBLOCK PreCommand;
		PVBLOCK PostCommand;
		PVBLOCK QuitCommand;
		struct HistoryLine *LastHistory;
		WORD LastError;
		WORD ExecLevel;
		struct SignalSet HoldSignal;
		struct SignalSet PortPrintSignal;
		struct SignalSet IDCSignal;
		struct SignalSet GadgetRefreshSignal;
		struct SignalSet PVtoFrontSignal;
		struct SignalSet InterruptSignal;
		struct Task *PowerVisorTask;
		struct IORequest *InputRequest;
		struct MsgPort *InputPort;
		struct HistoryLine *FirstHistLine;
		ULONG NumLines;
		ULONG MaxLines;
		UBYTE CodeTable[32];
		struct AliasLine *FirstAliasLine;
		APTR ScriptLine;
		UWORD DefLineLength;
		UBYTE CommentChar;
		UBYTE FeedbackSuppressChar;
		UBYTE QuickExecChar;
		UBYTE OutputSuppressChar;
		UBYTE LastCommand;
		UBYTE FeedBackMode;
		UBYTE AutoListMode;
		UBYTE HoldMode;
		UBYTE pad6;
		UBYTE IDCCommandNumber;
		ULONG IDCArgument;
		struct List KeyAttach;
		APTR WorkBenchMsg;
		struct HistoryLine *ScanHistory;
	};

#endif
