/*------------------------------------------------------------------------*
  Filename....: star.h


		 COPYRIGHT (C) 2001.  All Rights Reserved.
		 auto*des*sys, Inc., Columbus, Ohio, USA.
 *------------------------------------------------------------------------*/

#ifndef _STAR_H
#define _STAR_H 1

#include <math.h>
#include <float.h>
#include <stdlib.h>
#include <time.h>
#include <ctype.h>
#include <errno.h>

#include "fzrt_api.h"
#include "fz_api.h"

#include "fz_math_api.h"
#include "fz_objt_api.h"
#include "fz_otyp_api.h"
#include "fz_type_api.h"
#include "fz_iost_api.h"
#include "fz_notf_api.h"

#include "formz_vendor.h"

#include "fzpl_plugin.h"


/*************************************************************************
						OBJECT TYPE STUFF
**************************************************************************/

/* Star Object Type Plugin Identification */
/* UUID : {2ef9e70a-a91b-4634-9921-0bd47df216b9} */

#define STAR_OTYP_PLUGIN_ID				"\x2e\xf9\xe7\x0a\xa9\x1b\x46\x34\x99\x21\x0b\xd4\x7d\xf2\x16\xb9"
#define STAR_OTYP_PLUGIN_VERSION		FZPL_VERS_MAKE(8,0,0,0)
#define STAR_OTYP_PLUGIN_NAME			"Star Object Type Plugin - SDK Sample"
#define STAR_OTYP_PLUGIN_VENDOR			FORMZ_VENDOR
#define STAR_OTYP_PLUGIN_ATTR_STR		"FFMT=OTYP;FVERS=1.0"
#define STAR_OTYP_PLUGIN_URL			FORMZ_VENDOR_URL

#define STAR_STRINGS		11									/* TAH 01/23/04 */

#define	STAR_OTYP_PLUGIN_NAME_STR	1							/* TAH 01/23/04 */
#define STAR_TOOL_PLUGIN_NAME_STR	2							/* TAH 01/23/04 */

/* Object Type Identification */
/* UUID :  {d9b67e06-95b7-46e8-ba2d-702327ca0303}*/

#define STAR_OTYP_ID		"\xd9\xb6\x7e\x06\x95\xb7\x46\xe8\xba\x2d\x70\x23\x27\xca\x03\x03"

/* STAR PARMATERS */
#define STAR_PARM_BASE_TYPE_UUID 	"\x6d\x8f\x6d\x80\x73\x37\x72\x4b\xbf\x02\x17\x90\xce\x44\x41\x59"
#define STAR_PARM_RADIUS_UUID		"\x8a\x5e\x98\xfe\xf4\x56\x8c\x4a\xba\x5d\xca\x66\x88\xb2\x87\xd8"
#define STAR_PARM_RAY_RATIO_UUID	"\x62\xd3\x3b\x97\xdb\x2a\x3f\x46\xaa\xc9\x03\x8d\xe8\x5d\x54\xc8"

typedef struct	star_otyp_parms_td
{
	fzrt_int		base_type;		/* BASE TYPE. ONE OF THE SPHEROID TYPES		*/
	short		fixed;			/* FIXED DIMENSION 							*/
	fz_xyz_td	origin;			/* ORIGIN									*/
	fz_xyz_td	xaxis;			/* LOCAL X AXIS								*/
	fz_xyz_td	yaxis;			/* LOCAL Y AXIS								*/
	double		radius;			/* STAR RADIUS 								*/
	double		rad_ratio;		/* RATIO OF STAR CORE RADIUS TO STAR RADIUS */
}  star_otyp_parms_td;

fzrt_error_td star_otyp_get_callback_fset ( const fzpl_fset_def_ptr fset_def, fzpl_fset_td * const fset );
fzrt_error_td star_notf_get_callback_fset ( const fzpl_fset_def_ptr fset_def, fzpl_fset_td * const fset );

/*************************************************************************
						TOOL STUFF
**************************************************************************/
/* Star Tool Plugin Identification */
/* UUID : {411472e9-02df-441c-8a07-c19d56fb6bbe} */

#define STAR_TOOL_PLUGIN_ID				"\x41\x14\x72\xe9\x02\xdf\x44\x1c\x8a\x07\xc1\x9d\x56\xfb\x6b\xbe"
#define STAR_TOOL_PLUGIN_VERSION		FZPL_VERS_MAKE(8,0,0,0)
#define STAR_TOOL_PLUGIN_NAME			"Star Tool Plugin"
#define STAR_TOOL_PLUGIN_VENDOR			FORMZ_VENDOR
#define STAR_TOOL_PLUGIN_ATTR_STR		"FFMT=OTYP;FVERS=1.0"
#define STAR_TOOL_PLUGIN_URL			FORMZ_VENDOR_URL

/* Star Tool Id */
/* UUID : {f4885201-0511-42d7-bb6f-d8f85c67ead1} */
#define STAR_TOOL_ID	"\xf4\x88\x52\x01\x05\x11\x42\xd7\xbb\x6f\xd8\xf8\x5c\x67\xea\xd1"

/* Star Tool Options Id */
/* UUID : {853d9b1e-2353-4f06-bdcb-df20f7c70d2c} */

#define STAR_TOOL_OPTS_ID	"\x85\x3d\x9b\x1e\x23\x53\x4f\x06\xbd\xcb\xdf\x20\xf7\xc7\x0d\x2c"

/* HOLDS THE TOOL OPTION PARAMETER VALUES */
extern star_otyp_parms_td		*_star_tool_opts;

fzrt_error_td star_tool_get_callback_fset ( const fzpl_fset_def_ptr fset_def, fzpl_fset_td * const fset );

/*************************************************************************
						PLUGIN STUFF
**************************************************************************/
#define STAR_STR_ID			1
#define STAR_BASE_MENU_ID	1
enum
{
	STAR_STR_OTYP_NAME = 1,
	STAR_STR_TOOL_NAME,
	STAR_STR_EDIT_TITLE,
	STAR_STR_OPTS_TITLE,
	STAR_STR_BASE_TYPE,
	STAR_STR_RADIUS,
	STAR_STR_RAY_RATIO,
	STAR_STR_DYNAMIC,
	STAR_STR_PRESET,
	STAR_STR_ORIGIN_PROMPT,
	STAR_STR_RADIUS_PROMPT,
	STAR_STR_MAX
};

typedef struct
{
	const fzpl_fset_glue_fset *fsf;

	/* application provided function sets to hold on to */
	
	fz_math_fset			math_funcs;
	fz_model_fset			model_funcs;
	fz_type_fset			type_funcs;
	fz_fuim_fset			fuim_funcs;
	fz_iost_fset			iost_funcs;

	fz_fzrt_base_fset		fzrt_base_funcs;
	fz_fzrt_mem_fset		fzrt_mem_funcs;
	fz_fzrt_file_fset		fzrt_file_funcs;
	fz_fzrt_graf_fset		fzrt_graf_funcs;
	fz_fzrt_ui_fset		fzrt_ui_funcs;

	fzrt_unsigned_int			star_otyp_plugin_runtime_id;
	fzrt_unsigned_int			star_tool_plugin_runtime_id;
	fzrt_fzr_ref_td			fz_rsrc_ref_func;
	fzrt_floc_ptr			floc;
		
}  star_plugin_stuff;

extern star_plugin_stuff		plugin_stuff;

#endif /* _STAR_H */
