/*	PredefTypes.cpp
 *
 *		This contains the place where the predefined types (the types
 *	which are fundamental to YAAF) are stored.
 *
 *		The view class types are:
 *
 *				0	Integer
 *				1	Boolean
 *				2	String
 */
 
/*  YAAF Constructor - Rapid application development for YAAF
 *  Copyright (C) 1998 William Edward Woody
 *  
 *  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.
 *  
 *  To contact the author, either e-mail me at woody@pandawave.com, 
 *	or write to
 *  
 *          William Edward Woody
 *          In Phase Consulting
 *          1545 Ard Eevin Avenue
 *          Glendale, CA 91202
 *
 *	Or visit us on the web at http://www.pandawave.com
 */

#include "TResDocument.h"

/************************************************************************/
/*																		*/
/*	Basic Window Types													*/
/*																		*/
/************************************************************************/

/*	type_wind
 *
 *		The declaration of the window type
 */

static struct PredefDeclaration type_wind[] = {
	{	0,	"Window Kind"			},
	{	0,	"Window ID"				},
	{	1,	"Visible"				},
	{	0,	"Screen Left"			},
	{	0,	"Screen Top"			},
	{	0,	"Screen Right"			},
	{	0,	"Screen Bottom"			},
	{	0,	"Min X Size"			},
	{	0,	"Min Y Size"			},
	{	0,	"Max X Size"			},
	{	0,	"Max Y Size"			},
	{	0,	"Initial X Size"		},
	{	0,	"Initial Y Size"		},
	{	0,	"Zoom X Size"			},
	{	0,	"Zoom Y Size"			},
	{	2,	"Window Name"			},
	{	0,	"Menu ID"				},
	{	-1, NULL					}
};

static struct PredefValue value_wind[] = {
	"0",
	"0",
	"True",
	"0",
	"0",
	"0",
	"0",
	"0",
	"0",
	"0",
	"0",
	"0",
	"0",
	"0",
	"0",
	"Untitled",
	"0",
	NULL
};

/*	type_dlog
 *
 *		The declaration of a dialog type
 */

static struct PredefDeclaration type_dlog[] = {
	{	0,	"OK"					},
	{	0,	"Cancel"				},
	{	-1, NULL					}
};

static struct PredefValue value_dlog[] = {
	"18",			// alert center, modal document defaults
	"0",
	"True",
	"0",
	"0",
	"0",
	"0",
	"0",
	"0",
	"0",
	"0",
	"0",
	"0",
	"0",
	"0",
	"Untitled",
	"0",
	"100",
	"101",
	NULL
};


/************************************************************************/
/*																		*/
/*	Basic View Types													*/
/*																		*/
/************************************************************************/

/*	type_view
 *
 *		The declaration of the view type
 */

static struct PredefDeclaration type_view[] = {
	{	0,	"View ID"				},
	{	0,	"RefNum"				},
	{	1,	"Lock Left Flag"		},
	{	1,	"Lock Top Flag"			},
	{	1,	"Lock Right Flag"		},
	{	1,	"Lock Bottom Flag"		},
	{	0,	"Left"					},
	{	0,	"Top"					},
	{	0,	"Right"					},
	{	0,	"Bottom"				},
	{	1,	"Visible"				},
	{	1,	"Enabled"				},
	{	1,	"Tab Stop"				},
	{	-1, NULL					}
};

static struct PredefValue value_view[] = {
	"0",
	"0",
	"True",
	"True",
	"True",
	"True",
	"0",
	"0",
	"0",
	"0",
	"True",
	"True",
	"False",
	NULL
};

/*	type_scrv
 *
 *		Scroll view
 */

static struct PredefDeclaration type_scrv[] = {
	{	1,	"Horizontal"			},
	{	1,	"Vertical"				},
	{	1,	"Corner"				},
	{	-1, NULL					}
};

static struct PredefValue value_scrv[] = {
	"0",
	"0",
	"True",
	"True",
	"True",
	"True",
	"-1",
	"-1",
	"1",
	"1",
	"True",
	"True",
	"False",
	"True",
	"True",
	"True",
	NULL
};

/*	type_list
 *
 *		List view
 */

static struct PredefDeclaration type_list[] = {
	{	1,	"Multiple Select"		},
	{	0,	"Font"					},
	{	-1, NULL					}
};

static struct PredefValue value_list[] = {
	"0",
	"0",
	"True",
	"True",
	"True",
	"True",
	"-1",
	"-1",
	"1",
	"1",
	"True",
	"True",
	"True",
	"True",
	"True",
	"True",
	"False",
	"0",
	NULL
};

/*	type_popm
 *
 *		Popup menu
 */

static struct PredefDeclaration type_popm[] = {
	{	0,	"Font"					},
	{	-1, NULL					}
};


static struct PredefValue value_popm[] = {
	"0",
	"0",
	"True",
	"True",
	"False",
	"False",
	"16",
	"16",
	"116",
	"38",
	"True",
	"True",
	"True",
	"0",
	NULL
};

/*	type_pbtn
 *
 *		Push button type
 */

static struct PredefDeclaration type_pbtn[] = {
	{	0,	"Font"					},
	{	0,	"Value"					},
	{	2,	"Label"					},
	{	-1, NULL					}
};

static struct PredefValue value_pbtn[] = {
	"0",
	"0",
	"True",
	"True",
	"False",
	"False",
	"16",
	"16",
	"82",
	"44",
	"True",
	"True",
	"True",
	"0",
	"0",
	"Untitled",
	NULL
};

/*	type_radb
 *
 *		Radio button type
 */

static struct PredefDeclaration type_radb[] = {
	{	0,	"Font"					},
	{	0,	"Value"					},
	{	2,	"Label"					},
	{	-1, NULL					}
};

static struct PredefValue value_radb[] = {
	"0",
	"0",
	"True",
	"True",
	"False",
	"False",
	"16",
	"16",
	"96",
	"32",
	"True",
	"True",
	"True",
	"0",
	"0",
	"Untitled",
	NULL
};

/*	type_chkb
 *
 *		Check button type
 */

static struct PredefDeclaration type_chkb[] = {
	{	0,	"Font"					},
	{	0,	"Value"					},
	{	2,	"Label"					},
	{	-1, NULL					}
};

static struct PredefValue value_chkb[] = {
	"0",
	"0",
	"True",
	"True",
	"False",
	"False",
	"16",
	"16",
	"96",
	"32",
	"True",
	"True",
	"True",
	"0",
	"0",
	"Untitled",
	NULL
};

/*	type_scrb
 *
 *		Scroll bar
 */

static struct PredefDeclaration type_scrb[] = {
	{	0,	"Value"					},
	{	0,	"Minimum"				},
	{	0,	"Maximum"				},
	{	0,	"Step"					},
	{	0,	"Page"					},
	{	-1, NULL					}
};

static struct PredefValue value_scrb[] = {
	"0",
	"0",
	"True",
	"True",
	"False",
	"False",
	"16",
	"16",
	"32",
	"96",
	"True",
	"True",
	"True",
	"0",
	"0",
	"100",
	"1",
	"10",
	NULL
};

/*	type_pict
 *
 *		Picture
 */

static struct PredefDeclaration type_pict[] = {
	{	0,	"Picture Resource"		},
	{	0,	"Width"					},
	{	0,	"Height"				},
	{	-1, NULL					}
};

static struct PredefValue value_pict[] = {
	"0",
	"0",
	"True",
	"True",
	"False",
	"False",
	"16",
	"16",
	"96",
	"96",
	"True",
	"True",
	"False",
	"128",
	"80",
	"80",
	NULL
};

/*	type_text
 *
 *		Text
 */

static struct PredefDeclaration type_text[] = {
	{	2,	"String"				},
	{	0,	"Font"					},
	{	-1, NULL					}
};

static struct PredefValue value_text[] = {
	"0",
	"0",
	"True",
	"True",
	"False",
	"False",
	"16",
	"16",
	"96",
	"32",
	"True",
	"True",
	"False",
	"Untitled",
	"0",
	NULL
};

/*	type_edit
 *
 *		Edit box
 */

static struct PredefDeclaration type_edit[] = {
	{	2,	"String"				},
	{	0,	"Font"					},
	{	0,	"Maximum chars"			},
	{	0,	"Character type"		},
	{	-1, NULL					}
};


static struct PredefValue value_edit[] = {
	"0",
	"0",
	"True",
	"True",
	"False",
	"False",
	"16",
	"16",
	"96",
	"38",
	"True",
	"True",
	"True",
	"Untitled",
	"0",
	"0",
	"0",
	NULL
};

/*	type_grou
 *
 *		Group box
 */

static struct PredefDeclaration type_grou[] = {
	{	2,	"String"				},
	{	0,	"Font"					},
	{	-1, NULL					}
};


static struct PredefValue value_grou[] = {
	"0",
	"0",
	"True",
	"True",
	"False",
	"False",
	"16",
	"16",
	"96",
	"96",
	"True",
	"True",
	"False",
	"Untitled",
	"0",
	NULL
};

/*	type_stat
 *
 *		Status bar
 */

static struct PredefDeclaration type_stat[] = {
	{	0,	"Value"					},
	{	0,	"Minimum"				},
	{	0,	"Maximum"				},
	{	-1, NULL					}
};


static struct PredefValue value_stat[] = {
	"0",
	"0",
	"True",
	"True",
	"False",
	"False",
	"16",
	"16",
	"96",
	"32",
	"True",
	"True",
	"False",
	"0",
	"0",
	"100",
	NULL
};

/************************************************************************/
/*																		*/
/*	Type Directory														*/
/*																		*/
/************************************************************************/

/*	GPredefTypes
 *
 *		The predefined types
 */

struct PredefTypeRecord GPredefTypes[] = {
	{	'wind', 0, "Window", type_wind },
	{	'dlog', 'wind', "Dialog Box", type_dlog },

	{	'view', 0, "View", type_view },
	{	'scrv', 'view', "Scroll View", type_scrv },
	{	'popm', 'view', "Popup Menu", type_popm },
	{	'pbtn', 'view', "Push Button", type_pbtn },
	{	'radb', 'view', "Radio Button", type_radb },
	{	'chkb', 'view', "Check Button", type_chkb },
	{	'scrb', 'view', "Scroll Bar", type_scrb },
	{	'pict', 'view', "Picture", type_pict },
	{	'text', 'view', "Text", type_text },
	{	'edit', 'view', "Edit Box", type_edit },
	{	'grou', 'view', "Group Box", type_grou },
	{	'stat', 'view', "Status Bar", type_stat },
	{	'list', 'scrv', "List Box", type_list },
	{	0, 0, NULL, 0 },
};

/*	GPredefValues
 *
 *		Predefine values for predefined types
 */

struct PredefValueRecord GPredefValues[] = {
	{	'wind', value_wind },
	{	'dlog', value_dlog },

	{	'view', value_view },
	{	'scrv', value_scrv },
	{	'list', value_list },
	{	'popm', value_popm },
	{	'pbtn', value_pbtn },
	{	'radb', value_radb },
	{	'chkb', value_chkb },
	{	'scrb', value_scrb },
	{	'pict', value_pict },
	{	'text', value_text },
	{	'edit', value_edit },
	{	'grou', value_grou },
	{	'stat', value_stat },
};
