/*===============================
Copyright © 1998-2002 Brian Hall

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 __BLUGS_R__
#define __BLUGS_R__ 1



#if REZ
#include "Blugs.h"


/*	=============================
	This is the REZ version.
	If you want to see the DEREZ version, see below.
	=============================*/

type 'LiSt'
{
	unsigned integer;			/* Number of columns */
	unsigned integer;			/* Number of rows */
	longint;					/* List flags (see above) */
	integer;					/* Drag flags (see above) */
	Rect;						/* List rectangle */
	Point;						/* Default cell size */
	
/*=========== ROW DATA ===========*/
	unsigned integer = $$CountOf(RowDataArray); /* Number of row data entries */
	array RowDataArray
	{
		unsigned integer;		/* Row height */
		unsigned integer;		/* Disclosure level */
		unsigned integer;		/* Row flags */
		fill word;				/* 2 bytes reserved */
		unsigned longint;		/* Identifier */
	};
	fill word;					/* 2 bytes reserved */
	
/*=========== COLUMN DATA ===========*/
	unsigned integer = $$CountOf(ColumnDataArray); /* Number of column data entries */
	array ColumnDataArray
	{
		unsigned integer;		/* Column width */
		unsigned integer;		/* Content type (tables only) */
		unsigned integer;		/* Column flags */
		fill word;				/* 2 bytes reserved */
		unsigned longint;		/* Identifier */
	};
	
/*=========== CELL DATA ===========*/
	unsigned longint = $$CountOf(DataArray); /* Number of cell data entries */
	array DataArray
	{
		literal longint;		/* Data flavor */
		unsigned integer;		/* Content type (spreadsheets only) */
	DataStart:
		unsigned integer = ((DataEnd[$$ArrayIndex(DataArray)] -
							DataStart[$$ArrayIndex(DataArray)]) / 8) - 2;
		hex string;				/*	Data */
	DataEnd:
		align long;
	};
	
/*=========== HORIZONTAL TITLE BAR DATA ===========*/
	switch
	{
		case blNotHasHTitleBar:
		key integer = 0;
						
		case blHasHTitleBar:
		key integer = 1;
		unsigned integer = $$CountOf(hTitles);	/* Number of titles */
		unsigned integer;						/* Thickness */
		unsigned integer;						/* Default content type */
		unsigned integer;						/* Flags */
		array hTitles
		{
			literal longint;		/* Data flavor */
			unsigned integer;		/* Content type */
		HDataStart:
			unsigned integer = ((HDataEnd[$$ArrayIndex(hTitles)] -
									HDataStart[$$ArrayIndex(hTitles)]) / 8) - 2;
			hex string;				/* Data */
		HDataEnd:
			align long;				/* We want our data flavor field word-aligned */
		};							
	};
	/*=========== VERTICAL TITLE BAR DATA ===========*/
	switch
	{
		case blNotHasVTitleBar:
		key integer = 0;
				
		case blHasVTitleBar:
		key integer = 1;
		unsigned integer = $$CountOf(vTitles);	/* Number of titles */
		unsigned integer;						/* Thickness */
		unsigned integer;						/* Default content type */
		unsigned integer;						/* Flags */
		array vTitles
		{
			literal longint;		/* Data flavor */
			unsigned integer;		/* Content type */
		VDataStart:
			unsigned integer = ((VDataEnd[$$ArrayIndex(vTitles)] -
									VDataStart[$$ArrayIndex(vTitles)]) / 8) - 2;
			hex string;				/* Data */
		VDataEnd:
			align long;				/* We want our data flavor field word-aligned */
		};							
	};
};


#else
/*	=============================
	This is the DEREZ version.
	It's a little messy, so it is here to keep you from being distracted when
	you're just trying to use Rez.
	=============================*/
type 'LiSt'
{
	unsigned integer;			/* Number of columns */
	unsigned integer;			/* Number of rows */
	fill bit[7];				/* Reserved list flags*/
	Boolean		blNoDisjoint = true, blNotNoDisjoint = false;
	Boolean		blNoExtend = true, blNotNoExtend = false;
	Boolean		blUseSense = true, blNotUseSense = false;
	Boolean		blOnlyOne = true, blNotOnlyOne = false;
	Boolean		blTable = true, blSpreadsheet = false;
	Boolean		blDrawSortButton = true, blNotDrawSortButton = false;
	Boolean		blSortable = true, blNotSortable = false;
	Boolean		blDrawBorder = true, blNotDrawBorder = false;
	Boolean		blBorderMetrics = true, blNotBorderMetrics = false;
	Boolean		blDisclosure = true, blNotDisclosure = false;
	Boolean		blInlineEditOnClick = true, blNotInlineEditOnClick = false;
	Boolean		blActive = true, blInactive = false;
	Boolean		blVisible = true, blInvisible = false;
	Boolean		blCanFocus = true, blCantFocus = false;
	Boolean		blDrawGrow = true, blNotDrawGrow = false;
	Boolean		blHasGrow = true, blNotHasGrow = false;
	Boolean		blAutodraw = true, blNotAutodraw = false;
	Boolean		blSmallScroll = true, blNotSmallScroll = false;
	Boolean		blLiveScroll = true, blNotLiveScroll = false;
	Boolean		blVerticalScroll = true, blNotVerticalScroll = false;
	Boolean		blHorizontalScroll = true, blNotHorizontalScroll = false;
	Boolean		blResizableWidth = true, blNotResizableWidth = false;
	Boolean		blResizableHeight = true, blNotResizableHeight = false;
	
	fill bit[10];		/* Reserved drag flags*/
	Boolean		blReceiveDragsOnlyFromSelf = true, blNotReceiveDragsOnlyFromSelf = false;
	Boolean		blReceiveDragsFromSelf = true, blNotReceiveDragsFromSelf = false;
	Boolean		blReceiveDrags = true, blNotReceiveDrags = false;
	Boolean		blImmediateDrag = true, blNotImmediateDrag = false;
	Boolean		blAllowDragsOnlyToSelf = true, blNotAllowDragsOnlyToSelf = false;
	Boolean		blCanStartDrags = true, blNotCanStartDrags = false;
	
	Rect;						/* List rectangle */
	Point;						/* Default cell size */
	
/*=========== ROW DATA ===========*/
	unsigned integer = $$CountOf(RowDataArray); /* Number of row data entries */
	wide array RowDataArray
	{
		unsigned integer;		/* Row height */
		unsigned integer;		/* Disclosure level */
		fill bit[11];			/* Reserved row flags*/
		Boolean			blRowMarkedForMovement = true, blNotRowMarkedForMovement = false;
		Boolean			blRowDrawBorder = true, blNotRowDrawBorder = false;
		Boolean			blRowIsTitleRow = true, blNotRowIsTitleRow = false;
		Boolean			blRowIsExpanded = true, blNotRowIsExpanded = false;
		Boolean			blRowHasChildren = true, blNotRowHasChildren = false;
		
		fill word;				/* 2 bytes reserved */
		literal longint;		/* Identifier */
	};
	fill word;					/* 2 bytes reserved */
	
/*=========== COLUMN DATA ===========*/
	unsigned integer = $$CountOf(ColumnDataArray); /* Number of column data entries */
	wide array ColumnDataArray
	{
		unsigned integer;		/* Column width */
		unsigned integer;		/* Content type (tables only) */
		fill bit[14];			/* Reserved column flags*/
		Boolean			blColumnDrawBorder = true, blNotColumnDrawBorder = false;
		Boolean			blColumnCantSelect = true, blNotColumnCantSelect = false;
		fill word;				/* 2 bytes reserved */
		literal longint;		/* Identifier */
	};
	
/*=========== CELL DATA ===========*/
	unsigned longint = $$CountOf(DataArray); /* Number of cell data entries */
	wide array DataArray
	{
		literal longint;		/* Data flavor */
		unsigned integer;		/* Content type (spreadsheets only) */
		wstring;				/*	Data */
		align long;
	};
	
/*=========== HORIZONTAL TITLE BAR DATA ===========*/
	switch
	{
		case blNotHasHTitleBar:
		key integer = 0;
						
		case blHasHTitleBar:
		key integer = 1;
		unsigned integer = $$CountOf(hTitles);	/* Number of titles */
		unsigned integer;						/* Thickness */
		unsigned integer;						/* Content type */
		fill bit[11];							/* Reserved bits */
		/* Features: */
		Boolean		blTitlesPinToEdge = true, blTitlesNotPinToEdge = false;
		Boolean		blTitlesOneContentType = true, blTitlesNotOneContentType = false;
		Boolean		blTitlesResizableThickness = true, blTitlesNotResizableThickness = false;
		Boolean		blTitlesReorderable = true, blTitlesNotReorderable = false;
		Boolean		blTitlesSelectable = true, blTitlesNotSelectable = false;
		
		wide array hTitles
		{
			literal longint;		/* Data flavor */
			unsigned integer;		/* Content type */
			wstring;				/* Data */
			align long;				/* We want our data flavor field word-aligned */
		};							
	};
	/*=========== VERTICAL TITLE BAR DATA ===========*/
	switch
	{
		case blNotHasVTitleBar:
		key integer = 0;
				
		case blHasVTitleBar:
		key integer = 1;
		unsigned integer = $$CountOf(vTitles);	/* Number of titles */
		unsigned integer;						/* Thickness */
		unsigned integer;						/* Content type*/
		fill bit[11];							/* Reserved bits */
		/* Features: */
		Boolean		blTitlesPinToEdge = true, blTitlesNotPinToEdge = false;
		Boolean		blTitlesOneContentType = true, blTitlesNotOneContentType = false;
		Boolean		blTitlesResizableThickness = true, blTitlesNotResizableThickness = false;
		Boolean		blTitlesReorderable = true, blTitlesNotReorderable = false;
		Boolean		blTitlesSelectable = true, blTitlesNotSelectable = false;
		
		wide array vTitles
		{
			literal longint;		/* Data flavor */
			unsigned integer;		/* Content type */
			wstring;				/* Data */
			align long;				/* We want our data flavor field word-aligned */
		};							
	};
};

#endif /* DEREZ */


#endif //__BLUGS_R__
