#ifndef PV_SCREENBASE_H
#define PV_SCREENBASE_H TRUE
/*
**  $Filename: ScreenBase.h $
**  $Release: 1.10 $
**  $Revision: 37.615 $
**  $Date: 29 Sep 91 $
**
**  Structure definitions for Screen Base (see 'TheWizardCorner')
**
**  © 1991 Jorrit Tyberghein, included with PowerVisor
**	    All Rights Reserved
*/

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

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

#ifndef INTUITION_INTUITION_H
#include <intuition/intuition.h>
#endif


#define INTMODE_HEX		0
#define INTMODE_DEC		1
#define INTMODE_HEXDEC		2

#define SCROLLMODE_NOMORE	0
#define SCROLLMODE_MORE		1

#define SNAPMODE_NOSPACE	0
#define SNAPMODE_SPACE		1

#define LONESPC_NO		0
#define LONESPC_YES		1

#define SBOTTOMMODE_NO		0
#define SBOTTOMMODE_YES		1

#define INTERLACE_NO		0
#define INTERLACE_YES		1

#define FANCY_NO		0
#define FANCY_YES		1

#define LOGWINFLAGS_PRINTFILE	1
#define LOGWINFLAGS_PRINTSCREEN	2
#define LOGWINFLAGS_MORE	4
#define LOGWINFLAGS_TOTALHOME	32
#define LOGWINFLAGS_STATUSLINE	64
#define LOGWINFLAGS_BREAKCHECK	128
#define LOGWINFLAGS_AUTOOUTPUT	256

#define BOXTYPE_UPDOWN		0
#define BOXTYPE_LEFTRIGHT	1
#define BOXTYPE_ATOMIC		2

#define COLOR_GRAY		0
#define COLOR_BLACK		1
#define COLOR_WHITE		2
#define COLOR_BLUE		3

#define Pen_BoxBackground	0
#define Pen_LWBackground	1
#define Pen_NormalText		2
#define Pen_PromptText		3
#define Pen_StatusTextInActive	4
#define Pen_StatusTextActive	5
#define Pen_InActive		6
#define Pen_Active		7
#define Pen_TopLeft3D		8
#define Pen_BottomRight3D	9
#define Pen_BoxLine		10
#define Pen_EmptyBox		11
#define Pen_LeftBox		12
#define Pen_RightBox		13
#define Pen_ShowPos3D		14
#define Pen_SGInActiveText	15
#define Pen_SGInActiveBack	16
#define Pen_SGActiveText	17
#define Pen_SGActiveBack	18


/* Global structure holding some global window information
*/
struct Global
	{
		struct Global *NextGlobal,*PrevGlobal;
		struct List PhysWinList;
		struct LogicalWindow *ActiveLogWin;
		ULONG GlobalSignalSet;
		ULONG pad0;
	};

/* The physical window corresponding with an Intuition window. This
** physical window also manages the logical windows and the boxes.
** Do not depend on the size of this structure !!!
*/
struct PhysicalWindow
	{
		struct Node node;
		struct NewWindow NewWindow;
		struct Window *Window;
		ULONG SignalSet;
		WORD LastCode;
		WORD LastQualifier;
		BYTE LeftBorder;
		BYTE TopBorder;
		BYTE RightBorder;
		BYTE BottomBorder;
		struct Box *MasterBox;
		struct Global *Global;
		struct List LogWinList;
	};

/* The logical window.
** Do not depend on the size of this structure !!!
*/
struct LogicalWindow
	{
		struct Node node;
		struct Box *Box;
		WORD x;
		WORD y;
		WORD w;
		WORD h;
		WORD FirstVisibleCol;
		WORD FirstVisibleRow;
		WORD CurrentCol;
		WORD CurrentRow;
		WORD VisibleWidth;
		WORD VisibleHeight;
		ULONG Flags;
		struct TextAttr TextAttr;
		struct TextFont *Font;
		WORD FontWidth;
		WORD FontHeight;
		WORD FontBaseline;
		struct PhysicalWindow *PhysWin;
		WORD OptCol;
		WORD OptRow;
		WORD NrLinesInBuf;
		WORD NrColsInLine;
		APTR Buffer;
		BPTR LogFile;
		WORD MoreLines;
		ULONG pad0;
		ULONG pad1;
		UBYTE Active;
		BYTE TopBorderStatus;
		WORD RealTopCoordinate;
		APTR userdata;
	};

/* The box used to manage the available space of a physical window.
** Do not depend on the size of this structure !!!
*/
struct Box
	{
		struct Box *Parent,*ChildA,*ChildB;
		struct LogicalWindow *LogWin;
		struct PhysicalWindow *PhysWin;
		WORD ShareA;
		BYTE Type;
		BYTE Dirty;
		BYTE LeftBorder;
		BYTE TopBorder;
		BYTE RightBorder;
		BYTE BottomBorder;
		WORD realx;
		WORD realy;
		WORD realw;
		WORD realh;
		WORD x1scrollbar;
		WORD y1scrollbar;
		WORD x2scrollbar;
		WORD y2scrollbar;
	};

struct DefaultLWSize
	{
		WORD Columns;
		WORD Rows;
		UWORD Mask;
		UWORD Flags;
	};

struct LWOpenString
	{
		UBYTE OpenStr[8];
		UWORD Share;
	};


struct ScreenBase
	{
		UBYTE IntDisplayMode;
		UBYTE ScrollMode;
		UBYTE AddSpaceAfterSnap;
		UBYTE LoneSpcMode;
		UBYTE SBottomMode;
		UBYTE DontClearLine;
		UBYTE pad0;
		UBYTE InterlaceMode;
		UBYTE FancyMode;
		UBYTE pad1;
		ULONG CmdLineLen;
		UBYTE *CmdLine;
		UWORD CursorPos;
		struct DefaultLWSize MainDefSize;
		struct DefaultLWSize ExtraDefSize;
		struct DefaultLWSize RefreshDefSize;
		struct DefaultLWSize DebugDefSize;
		struct DefaultLWSize PPrintDefSize;
		struct DefaultLWSize RexxDefSize;
		PVBLOCK SnapCommand;
		LONG pad2;
		LONG pad3;
		struct PhysicalWindow *MainPW;
		struct LogicalWindow *MainLW;
		struct LogicalWindow *RefreshLW;
		struct LogicalWindow *DebugLW;
		struct LogicalWindow *ExtraLW;
		struct LogicalWindow *PPrintLW;
		struct LogicalWindow *RexxLW;
		struct LogicalWindow *CurrentLW;
		WORD PromptPosX;
		WORD LeftStringPosX;
		WORD RightStringPosX;
		struct Screen *OtherScreen;
		struct Screen *PVScreen;
		ULONG IMsgClass;
		UWORD IMsgCode;
		APTR IMsgIAddress;
		WORD IMsgMouseX;
		WORD IMsgMouseY;
		UWORD IMsgQualifier;
		struct Global *TheGlobal;
		LONG pad4;
		LONG pad5;
		struct LWOpenString MainString;
		struct LWOpenString ExtraString;
		struct LWOpenString DebugString;
		struct LWOpenString RefreshString;
		struct LWOpenString PPrintString;
		struct LWOpenString RexxString;
		ULONG StartupFlags;
		WORD WinX;
		WORD WinY;
		WORD WinW;
		WORD WinH;
		WORD ScreenW;
		WORD ScreenH;
		UBYTE FancyPens[24];
		UBYTE NoFancyPens[24];
		APTR CurrentPenTable;
		UBYTE BusyPrompt[6];
		UBYTE MorePrompt[6];
		UBYTE WaitPrompt[6];
		UBYTE LockPrompt[6];
		UBYTE ScanPrompt[4];
		UBYTE FeedBackPrompt[2];
		struct LogicalWindow *LockLW;
		UBYTE *LockPrompt;
		UBYTE LockState;
		UBYTE BusyMode;
		UBYTE GadgetExists;
		UBYTE pad6;
		UBYTE DefaultFontName[34];
		struct TextAttr DefaultFont;
		UWORD LogWinBorderHeight;
		UWORD pad7;
		WORD DragToleranceX1;
		WORD DragToleranceY1;
		WORD DragToleranceX2;
		WORD DragToleranceY2;
		WORD SizeToleranceX;
		WORD SizeToleranceY;
		APTR rtRequestStruct;
                struct Library *ReqToolsBase;
	};

#endif
