/* $Revision Header *** Header built automatically - do not edit! ***********
 *
 *	(C) Copyright 1991 by Torsten Jürgeleit
 *
 *	Name .....: defines.h
 *	Created ..: Sunday 22-Dec-91 21:22:12
 *	Revision .: 1
 *
 *	Date        Author                 Comment
 *	=========   ====================   ====================
 *	31-Dec-91   Torsten Jürgeleit      new font management
 *	22-Dec-91   Torsten Jürgeleit      Created this file!
 *
 ****************************************************************************
 *
 *	Defines and structures
 *
 * $Revision Header ********************************************************/

	/* Defines for defaults */

#define DEFAULT_PROJECT_NAME		"unnamed"
#define DEFAULT_PROJECT_ID		"test"
#define DEFAULT_EDITOR_MODE		EDITOR_MODE_CREATE
#define DEFAULT_SNAP_OFFSET		1
#define DEFAULT_TEMPLATE_TYPE		TEMPLATE_TYPE_BUTTON
#define DEFAULT_TEMPLATE_LIST_FLAGS	(TEMPLATE_LIST_FLAG_RESIZING | TEMPLATE_LIST_FLAG_AVAIL_FONTS)
#define DEFAULT_LIST_MODE		LIST_MODE_EDIT

#define DEFAULT_PROJECT_FILE_NAME	(DEFAULT_PROJECT_NAME ".tpl")
#define DEFAULT_CSOURCE_FILE_NAME	(DEFAULT_PROJECT_NAME ".c")

#define DEFAULT_FONT_NAME		"topaz.font"
#define DEFAULT_FONT_YSIZE		TOPAZ_EIGHTY

	/* Defines for windows */

#define EDIT_RENDER_INFO_FLAGS		(RENDER_INFO_FLAG_INNER_WINDOW | RENDER_INFO_FLAG_BACK_FILL)
#define EDIT_OPEN_WINDOW_FLAGS		0

#define PROJECT_RENDER_INFO_FLAGS	0
#define PROJECT_OPEN_WINDOW_FLAGS	0

#define EDITOR_WINDOW_LEFT		0
#define EDITOR_WINDOW_TOP		0
#define EDITOR_WINDOW_WIDTH		518
#define EDITOR_WINDOW_HEIGHT		112
#define EDITOR_WINDOW_DETAIL_PEN	0
#define EDITOR_WINDOW_BLOCK_PEN		1
#define EDITOR_WINDOW_IDCMP		(CLOSEWINDOW | GADGET_IDCMP_FLAGS_ALL | MENUPICK)
#define EDITOR_WINDOW_FLAGS		(WINDOWCLOSE | WINDOWDRAG | WINDOWDEPTH | SMART_REFRESH | NOCAREREFRESH | ACTIVATE)
#define EDITOR_WINDOW_TITLE		(UBYTE *)" Template Editor v1.0 "

#define PROJECT_WINDOW_DETAIL_PEN	0
#define PROJECT_WINDOW_BLOCK_PEN	1
#define PROJECT_WINDOW_IDCMP		(MOUSEMOVE | MOUSEBUTTONS | NEWSIZE | GADGET_IDCMP_FLAGS_ALL)
#define PROJECT_WINDOW_FLAGS		(WINDOWDRAG | WINDOWDEPTH | WINDOWSIZING | SMART_REFRESH | RMBTRAP | REPORTMOUSE)
#define PROJECT_WINDOW_TITLE		(UBYTE *)NULL
#define PROJECT_WINDOW_MIN_WIDTH	100
#define PROJECT_WINDOW_MIN_HEIGHT	20

	/* Defines for text len */

#define MAX_PROJECT_NAME_LEN	(LONG_FSIZE + 1)
#define MAX_PROJECT_ID_LEN	10
#define MAX_TEMPLATE_NAME_LEN	30
#define MAX_TEXT_LEN		40

	/* Defines for editor status */

#define EDITOR_STATUS_NORMAL		0
#define EDITOR_STATUS_ERROR		1
#define EDITOR_STATUS_EOF		2
#define EDITOR_STATUS_EOB		3
#define EDITOR_STATUS_EDIT		4
#define EDITOR_STATUS_WINDOW		5
#define EDITOR_STATUS_NEW		6
#define EDITOR_STATUS_LOAD		7
#define EDITOR_STATUS_APPEND		8
#define EDITOR_STATUS_SAVE		9
#define EDITOR_STATUS_SAVE_C		10
#define EDITOR_STATUS_ABOUT		11
#define EDITOR_STATUS_QUIT		12

	/* Defines for editor error messages */

#define EDITOR_ERROR_NO_ARP		-1
#define EDITOR_ERROR_NO_INTUISUP	-2
#define EDITOR_ERROR_NO_WINDOW		-3
#define EDITOR_ERROR_OUT_OF_MEM		-4
#define EDITOR_ERROR_OPEN_FAILED	-5
#define EDITOR_ERROR_WRITE_FAILED	-6
#define EDITOR_ERROR_READ_FAILED	-7
#define EDITOR_ERROR_LINE_TOO_LONG	-8
#define EDITOR_ERROR_NO_ARGUMENT	-9
#define EDITOR_ERROR_END_WRONG_BLOCK	-10
#define EDITOR_ERROR_INVALID_FONT	-11

	/* Defines for editor gadgets */

#define EDITOR_GADGET_TYPE		0
#define EDITOR_GADGET_CREATE		1
#define EDITOR_GADGET_MODIFY		2
#define EDITOR_GADGET_CLONE		3
#define EDITOR_GADGET_DELETE		4
#define EDITOR_GADGET_EDIT		5
#define EDITOR_GADGET_USE		6
#define EDITOR_GADGET_TEMPLATES		7

#define EDITOR_MODE_CREATE	0
#define EDITOR_MODE_MODIFY	1
#define EDITOR_MODE_CLONE	2
#define EDITOR_MODE_DELETE	3
#define EDITOR_MODE_EDIT	4
#define EDITOR_MODE_USE		5

#define MODIFY_MODE_MOVE	0
#define MODIFY_MODE_RESIZE	1

	/* Defines for templates */

#define TEMPLATE_TYPE_BORDER	0
#define TEMPLATE_TYPE_TEXT	1
#define TEMPLATE_TYPE_BUTTON	2
#define TEMPLATE_TYPE_CHECK	3
#define TEMPLATE_TYPE_MX	4
#define TEMPLATE_TYPE_STRING	5
#define TEMPLATE_TYPE_INTEGER	6
#define TEMPLATE_TYPE_SLIDER	7
#define TEMPLATE_TYPE_SCROLLER	8
#define TEMPLATE_TYPE_CYCLE	9
#define TEMPLATE_TYPE_COUNT	10
#define TEMPLATE_TYPE_LISTVIEW	11
#define TEMPLATE_TYPE_PALETTE	12

#define MAX_TEMPLATE_TYPES	13

#define FIRST_GADGET_TEMPLATE_TYPE	TEMPLATE_TYPE_BUTTON

#define TEMPLATE_FLAG_DEFAULT_NAME	(1 << 0)
#define TEMPLATE_FLAG_MODIFIED		(1 << 1)

	/* Defines for template groups */

#define TEMPLATE_GROUP(tp)	(tp->tp_Type < FIRST_GADGET_TEMPLATE_TYPE ? tp->tp_Type : TEMPLATE_GROUP_GADGET)

#define TEMPLATE_GROUP_BORDER	0
#define TEMPLATE_GROUP_TEXT	1
#define TEMPLATE_GROUP_GADGET	2

	/* Defines for template list */

#define TEMPLATE_LIST_FLAG_CHANGED		(1 << 0)	/* template list modified */
#define TEMPLATE_LIST_FLAG_RESIZING		(1 << 1)	/* enable resizing of project window */
#define TEMPLATE_LIST_FLAG_BACK_FILL		(1 << 2)	/* fill background of project window */
#define TEMPLATE_LIST_FLAG_RENDER_COLORS	(1 << 3)	/* use colors from render info for rendering project window */
#define TEMPLATE_LIST_FLAG_AVAIL_FONTS		(1 << 4)	/* scan avail fonts for project window */
#define TEMPLATE_LIST_FLAG_DEFAULT_WINDOW	(1 << 5)	/* use default flags and dimension for project window */
#define TEMPLATE_LIST_FLAG_SOURCE_STATIC_DATA	(1 << 6)	/* define all data as static */
#define TEMPLATE_LIST_FLAG_SOURCE_INNER_WINDOW	(1 << 7)	/* use for all offsets and dimensions data of the inner window */
#define TEMPLATE_LIST_FLAG_SOURCE_CENTER_WINDOW	(1 << 8)	/* center window on screen */
#define TEMPLATE_LIST_FLAG_SOURCE_WINDOW	(1 << 9)	/* generate C source for project window */
#define TEMPLATE_LIST_FLAG_SOURCE_PROGRAM	(1 << 10)	/* generate C source for project test program */

	/* Defines for file requesters */

#define PROJECT_LOAD_HAIL_TEXT		" Load Project "
#define PROJECT_APPEND_HAIL_TEXT	" Append Project "
#define PROJECT_SAVE_HAIL_TEXT		" Save Project "

#define CSOURCE_SAVE_HAIL_TEXT		" Save C Source "

	/* Defines for edit gadgets */

#define EDIT_GADGET_OK		0
#define EDIT_GADGET_DEFAULT	1
#define EDIT_GADGET_SWITCH	2
#define EDIT_GADGET_CANCEL	3

#define BORDER_GADGET_NAME	0
#define BORDER_GADGET_TYPE	1

#define TEXT_GADGET_NAME	0
#define TEXT_GADGET_TEXT	1
#define TEXT_GADGET_FONT	2
#define TEXT_GADGET_SIZE	3
#define TEXT_GADGET_TYPE	4
#define TEXT_GADGET_BOLD	5
#define TEXT_GADGET_ITALIC	6
#define TEXT_GADGET_UNDERLINED	7
#define TEXT_GADGET_COLOR2	8
#define TEXT_GADGET_COMPLEMENT	9

#define NORMAL_GADGET_NAME		0
#define NORMAL_GADGET_TEXT		1
#define NORMAL_GADGET_FONT		2
#define NORMAL_GADGET_SIZE		3
#define NORMAL_GADGET_POS		4
#define NORMAL_GADGET_DISABLED		5
#define NORMAL_GADGET_NO_BORDER		6
#define NORMAL_GADGET_HIGHCOMP		7
#define NORMAL_GADGET_HOTKEY		8
#define NORMAL_GADGET_COLOR2		9

#define TEXT_POS_LEFT		0
#define TEXT_POS_RIGHT		1
#define TEXT_POS_ABOVE		2
#define TEXT_POS_BELOW		3
#define TEXT_POS_INSIDE		4

#define GADGET_TEXT_POS_MASK(flags)	(flags & (GADGET_DATA_FLAG_TEXT_LEFT | GADGET_DATA_FLAG_TEXT_RIGHT | GADGET_DATA_FLAG_TEXT_ABOVE | GADGET_DATA_FLAG_TEXT_BELOW))

	/* Defines for load file */

#define LOAD_MODE_NORMAL	0
#define LOAD_MODE_APPEND	1

	/* Defines for text list editor modes */

#define LIST_MODE_EDIT		0
#define LIST_MODE_ADD		1
#define LIST_MODE_INSERT	2
#define LIST_MODE_DELETE	3

	/* Structures */

struct TemplateFont {
	struct MinNode   tf_MinNode;
	struct TextAttr  tf_TextAttr;
	SHORT	tf_UseCount;
};
struct Box {
	SHORT	bo_X1;
	SHORT	bo_Y1;
	SHORT	bo_X2;
	SHORT	bo_Y2;
};
struct Dimension {
	USHORT	dim_Width;
	USHORT	dim_Height;
};
struct Template {
	struct Node        tp_Node;		/* ln_Name points to tp_Name */
	USHORT	tp_Type;			/* long word align */
	USHORT	tp_Flags;
	USHORT  tp_GroupEntryNum;		/* ordinal number of group entry in template list -> used for default name */
	struct Box   tp_Box;
	struct List  tp_TextList; 		/* list for MX, Cycle und ListView template texts */
	union {
		struct BorderData  tp_BorderData;
		struct TextData    tp_TextData;
		struct GadgetData  tp_GadgetData;
	} tp_Data;
	ULONG	tp_DataEnd;			/* needed for data end marker ISUP_DATA_END */
	struct Template  *tp_PrevLocked;	/* ptr to previous locked template */
	struct Template  *tp_NextLocked;	/* ptr to next locked template */
	BYTE	tp_TemplateName[MAX_TEMPLATE_NAME_LEN + 1];
};
struct TemplateList {
	struct MinList  tl_Fonts;
	struct MinList  tl_Templates;
	USHORT	tl_BorderTemplates;
	USHORT	tl_TextTemplates;
	USHORT	tl_GadgetTemplates;
	USHORT	tl_Flags;
	BYTE	tl_ProjectName[MAX_PROJECT_NAME_LEN + 1];
	BYTE	tl_ProjectID[MAX_PROJECT_ID_LEN + 1];
};
