#ifndef EVD_CONTEXT_H
#define EVD_CONTEXT_H

/*
 *  evd_context.h - context structure
 *  Copyright (C) 1997 Aki Laukkanen
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software Foundation,
 *  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#ifndef EXEC_TYPES_H
#include <exec/types.h>
#endif

#ifndef EXEC_EXECBASE_H
#include <exec/execbase.h>
#endif

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

#ifndef INTUITION_SCREENS_H
#include <intuition/screens.h>
#endif

#ifndef GRAPHICS_GFX_H
#include <graphics/gfx.h>
#endif

#ifndef GRAPHICS_GFXBASE_H
#include <graphics/gfxbase.h>
#endif

#ifndef GRAPHICS_VIEW_H
#include <graphics/view.h>
#endif

#ifndef UTILITY_TAGITEM_H
#include <utility/tagitem.h>
#endif

#ifndef EVD_PREFS_H
#include "evd_prefs.h"
#endif

#define CM_IMPRECISE ((1<<6)|(1<<5))
#define CM_PRECISE (1<<6)
#define CM_COPYBACK (1<<5)
#define CM_WRITETHROUGH 0x0
#define CM_MASK ((1<<6)|(1<<5))

typedef struct UpdateRegion
{
	struct UpdateRegion*    Next;
	UWORD                   x1,y1,x2,y2;
} region;

typedef struct Context
{
	struct ExecBase*        SysBase;
	struct IntuitionBase*   IntuitionBase;
	struct GfxBase*         GfxBase;
	struct Library*         UtilityBase;
	struct DosLibrary*      DOSBase;

	UBYTE*                  ChunkyBuffer;
	UBYTE*                  DeltaBuffer;
	struct Screen*          Screen;
	struct BitMap           BitMap;
	struct ViewPort*        ViewPort;

	UBYTE                   CM1;
	UBYTE                   CM2;
	UBYTE                   CM3;
	UBYTE                   CM4;

	LONG                    X;
	LONG                    Y;
	ULONG                   VideoMode;
	ULONG                   DisplayID;
	ULONG                   Overscan;

	ULONG                   Size;
	ULONG                   BMSize;
	LONG                    NumPlanes;
	APTR                    PageDesc;
	APTR                    Lut15;
	void                    (*C2P)(void);
	region*                 First;
	UWORD                   RefreshCnt;

	/* prefs */

	APTR                    PrefsTmp;       /* temporary storage pointer */
	BOOL                    FCached;
	BOOL                    CImprec;
	UWORD                   NumPalettes;
	struct palette_entry*   Palettes;
	BOOL                    BorderBlank;
	BOOL                    OwnRefresh;
	UWORD                   RefreshRate;
	UWORD                   UsedPalette;
} context;

#endif /* EVD_CONTEXT_H */
