
/*

	Custom ILBMInfo structure 

	(c) Copyright 1995-2001 Grzegorz Calkowski

	This file is part of SysPic.

	SysPic  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, or (at your option)
	any later version.

	Bison 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 Bison; see the file COPYING.  If not, write to
	the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.

*/

#ifndef ILBMINFO_H
#define ILBMINFO_H

#include "ilbm.h"

struct ILBMInfo
{
	/* filehandle */
	BPTR					fh;

	/* ILBM */
	BitMapHeader		bmhd;	
	ULONG					camg;

	/* for screens */
	struct Screen		*scr;				/* screen of loaded display   */
	struct Window		*win;				/* window of loaded display   */
	struct ViewPort	*vp;				/* viewport of loaded display */
	BOOL					TBState;			/* state of titlebar hiddenness */

	/* colors */
	WORD					*colorrecord;	/* Passed to LoadRGB32 (ncolors,firstreg,table) */
	Color32				*colortable32;	/* 32-bit-per-gun representation of colors      */
	ULONG					crecsize;		/* Bytes allocated including extra WORDs        */
	BOOL					nonstd;			/* TRUE indictaes HAM or EHB */

	/* workers */
	UBYTE					bmhdread, cmapread, camgread;
	BYTE					*bodybuf;
	ULONG					bodylen;

	/* caller preferences */
//	struct NewWindow	*windef;			/* definition for window */
//	UBYTE					*stitle;			/* screen title */
	LONG					stype;			/* additional screen types */
	ULONG					usermodeid;
	STRPTR				pubname;
	BYTE					pubsig;

	ULONG					flags;	
};

/* Flags for flags */

/* Force use of ilbm->usermodeid if mode is available */
#define ILBMB_USERMODE	1
#define ILBMF_USERMODE	(1L << ILBMB_USERMODE)

/* Force use of BestFit() under V39 only */
#define ILBMB_BESTFIT	2
#define ILBMF_BESTFIT	(1L << ILBMB_BESTFIT)

/* Disable centering */
#define ILBMB_NOCENTER	3
#define ILBMF_NOCENTER	(1L << ILBMB_NOCENTER)

/* Disable auto 4->8 bit CMAP conversion on apparently shifted 4-bit guns */
#define ILBMB_CMAPOK	7
#define ILBMF_CMAPOK	(1L << ILBMB_CMAPOK)

/* Disable v-centering */
#define ILBMB_NOVCENTER	5
#define ILBMF_NOVCENTER	(1L << ILBMB_NOVCENTER)

/*****************************************************************************/

/* ILBM module error definitions */

#define ILBMERR_NOTILBM			10
#define ILBMERR_MODENOTAVAIL	11
#define ILBMERR_TOODEEP			12
#define ILBMERR_CANTOPENDISP	13
#define ILBMERR_UNSUPPORTED	14
#define ILBMERR_24BIT			15

/*****************************************************************************/

/* protos */

LONG showilbm(struct ILBMInfo *ilbm, STRPTR filename);
void unshowilbm(struct ILBMInfo *ilbm);
void setcolors(struct ILBMInfo *ilbm);

#endif 
