/*------------------------------------------------------------------------*
  Filename....: notify_init.c


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

#include "notify.h"

#include "fz_plugin_glue_api.h"
#include "fz_tool_api.h"


notify_test_plugin_stuff		plugin_stuff;


/* TYPE OF NOTIFICATION ENUMERATOR */
typedef enum
{
	NOTF_OBJECT = 0,
	NOTF_LIGHT,
	NOTF_RMTL,
	NOTF_LAYER,
	NOTF_VIEW,
	NOTF_WINDOW,
	NOTF_PROJECT,
	NOTF_SYSTEM,
	NOTF_SYST_UNITS,
	NOTF_PROJ_UNITS,
	NOTF_WIND_UNITS,
	NOTF_ANIM,
	NOTF_PREF_DEFAULT,
	NOTF_PREF_MODEL_TYPE,
	NOTF_OS,
	NUM_NOTF
} notf_type_enum ;

/* NOTIFICATION RECORD */
typedef struct
{
	fzrt_int			windex;				/* WINDEX IN WHICH NOTIFICATION OCCURRED								*/
	notf_type_enum	type;				/* TYPE OF NOTIFICATION 												*/
	char			type_name[24];		/* NAME OF TYPE 														*/
	char			action_desc[48];	/* STRING WITH NOTIFICATION DESCRIPTION 								*/
	char			action_enum[48];	/* STRING WITH NOTIFICATION ENUM, AS IT APPERAS IN fz_notf_api.h 		*/
	fz_string_td	name;				/* ENTITY NAME, ASSOCIATED WITH THE NOTIFICATION, SUCH AS OBJECT NAME 	*/
} notf_data_td;

/* LIST COLUMNS */
enum
{
	NOTF_LIST_COLM_COUNT = 0,
	NOTF_LIST_COLM_WINDEX,
	NOTF_LIST_COLM_ENTITY,
	NOTF_LIST_COLM_NAME,
	NOTF_LIST_COLM_ACTION_ENUM,
	NOTF_LIST_COLM_ACTION_DESC,
	
	NOTF_LIST_NUM_COLM
};

/* GLOBALS */
fzrt_int					l_notf = -1,s_notf = 0;
notf_data_td			*notf_data = NULL;
fzrt_int					n_notf = 0;
fzrt_boolean			notf_show[NUM_NOTF];
fzrt_zone_ptr			notf_mem_zone	= NULL;
fz_fuim_tmpl_ptr 		notf_fuim_tmpl  = NULL;
fz_fuim_list_ptr		notf_list_ptr	= NULL;

/************************************************************************
	list counter callback
*************************************************************************/
static fzrt_error_td notify_test_list_get_num_items(fz_fuim_tmpl_ptr fuim_tmpl, fz_fuim_list_ptr list_data, fzrt_int *num_items)
{
	fzrt_int					i;
	fzrt_error_td 			err = FZRT_NOERR;
	
	if (num_items != NULL)
	{
		*num_items = 0;
		for(i = 0; i <= l_notf; i++)
		{	if ( notf_show[notf_data[i].type] ) (*num_items)++;
		}
	}
	
	return(err);
}

/************************************************************************
	list string callback
*************************************************************************/
static fzrt_error_td notify_test_list_get_str(fz_fuim_tmpl_ptr fuim_tmpl, fz_fuim_list_ptr list_data, fzrt_int row_indx, fzrt_int col_indx, char *str, fzrt_int max_len, fzrt_boolean *did)
{
	fzrt_int					stack_indx,i,cnt;
	fzrt_error_td			err = FZRT_NOERR;
	
	if ( row_indx <= l_notf )
	{
		notify_test_list_get_num_items(fuim_tmpl, list_data, &cnt);
		row_indx = (cnt - 1 - row_indx);
		for(i = l_notf; i >= 0; i--)
		{	if ( notf_show[notf_data[i].type] ) cnt--;
			if ( cnt == row_indx ) break;
		}

		stack_indx = i;
	
		*did = TRUE;
		switch ( col_indx )
		{
			/* COUNT */
			case NOTF_LIST_COLM_COUNT :
				sprintf(str, "%2d",stack_indx);
			break;
			
			/* WINDEX */
			case NOTF_LIST_COLM_WINDEX :
				sprintf(str, "%2d",notf_data[stack_indx].windex);
			break;
			
			/* ENTITY TYPE */
			case NOTF_LIST_COLM_ENTITY :
				strcpy(str,notf_data[stack_indx].type_name);
			break;
			
			/* ENTITY NAME */
			case NOTF_LIST_COLM_NAME :
				strcpy(str,notf_data[stack_indx].name);
			break;
			
			/* ACTION ENUM */
			case NOTF_LIST_COLM_ACTION_ENUM :
				strcpy(str,notf_data[stack_indx].action_enum);
			break;
			
			/* ACTION DESC */
			case NOTF_LIST_COLM_ACTION_DESC :
				strcpy(str,notf_data[stack_indx].action_desc);
			break;
		
		}
	}
	
	return(err);
}

/************************************************************************
	dialog finit callback
*************************************************************************/
static fzrt_boolean notify_test_fuim_finit(fz_fuim_tmpl_ptr fuim_tmpl, void *actn_data)
{
	notf_fuim_tmpl	= NULL;
	notf_list_ptr	= NULL;
	
	return TRUE;
}

/* ITEM ID'S FOR PALETTE */
enum
{
	NOTF_ITEM_ID_OBJECTS = 0,
	NOTF_ITEM_ID_LIGHTS,
	NOTF_ITEM_ID_RMTL,
	NOTF_ITEM_ID_LAYERS,
	NOTF_ITEM_ID_VIEWS,
	NOTF_ITEM_ID_WINDOW,
	NOTF_ITEM_ID_PROJECT,
	NOTF_ITEM_ID_SYSTEM,
	NOTF_ITEM_ID_SYST_UNITS,
	NOTF_ITEM_ID_PROJ_UNITS,
	NOTF_ITEM_ID_WIND_UNITS,
	NOTF_ITEM_ID_ANIM,
	NOTF_ITEM_ID_PREF_DEFAULT,
	NOTF_ITEM_ID_PREF_MODEL_TYPE,
	NOTF_ITEM_ID_OS,
	NOTF_ITEM_ID_ALL,
	NOTF_ITEM_ID_NONE,
	NOTF_ITEM_ID_CLEAR,
	
	
	NOTF_ITEM_ID_MAX
};

/************************************************************************
	palette item func
*************************************************************************/
static short notify_test_item_func(fz_fuim_tmpl_ptr fuim_tmpl, fzrt_int action, short item_id, void *func_data, fz_fuim_type_td *rv_data)
{
	fzrt_int		i;
	short		rv = FALSE;

	switch (action)
	{
		case FZ_FUIM_ACTN_NEW_VALUE :
			switch (item_id)			
			{
				case	NOTF_ITEM_ID_OBJECTS 			:
				case	NOTF_ITEM_ID_LIGHTS				:
				case	NOTF_ITEM_ID_RMTL				:
				case	NOTF_ITEM_ID_LAYERS				:
				case	NOTF_ITEM_ID_VIEWS				:
				case	NOTF_ITEM_ID_WINDOW				:
				case	NOTF_ITEM_ID_PROJECT			:
				case	NOTF_ITEM_ID_SYSTEM				:
				case	NOTF_ITEM_ID_SYST_UNITS			:
				case	NOTF_ITEM_ID_PROJ_UNITS			:
				case	NOTF_ITEM_ID_WIND_UNITS			:
				case	NOTF_ITEM_ID_ANIM				:
				case	NOTF_ITEM_ID_PREF_DEFAULT		:
				case	NOTF_ITEM_ID_PREF_MODEL_TYPE	:
				case	NOTF_ITEM_ID_OS					:
					plugin_stuff.fuim_funcs.fz_fuim_list_regen(notf_fuim_tmpl,notf_list_ptr);
					rv = TRUE;
				break;
			}
		break;
		
		case FZ_FUIM_ACTN_HIT :
			switch (item_id)			
			{
				case NOTF_ITEM_ID_ALL	:
				case NOTF_ITEM_ID_NONE	:
					for(i = 0; i < NUM_NOTF; i++)
					{	notf_show[i] = (item_id == NOTF_ITEM_ID_ALL) ? TRUE : FALSE;
					}					
					plugin_stuff.fuim_funcs.fz_fuim_list_regen(notf_fuim_tmpl,notf_list_ptr);
					rv = TRUE;
				break;
				
				case NOTF_ITEM_ID_CLEAR :
					l_notf = -1;
					n_notf =  0;
					plugin_stuff.fuim_funcs.fz_fuim_list_regen(notf_fuim_tmpl,notf_list_ptr);
					plugin_stuff.fuim_funcs.fz_fuim_tmpl_update_value(notf_fuim_tmpl,-1);
					rv = TRUE;
				break;
			}
		break;
	}
	
	
	return(rv);

}

/************************************************************************
	palette creation callback
************************************************************************/
static fzrt_error_td notify_test_fuim_dlog(fz_fuim_tmpl_ptr fuim_tmpl, fzrt_ptr fuim_data)
{
	short					g1,ghorz,gvert,gbrdr;
	fzrt_error_td			rv = FZRT_NOERR;
	
	if ((rv = plugin_stuff.fuim_funcs.fz_fuim_tmpl_init(fuim_tmpl, "Notification Monitor", FZ_FUIM_FLAG_NONE, NULL, 0)) == FZRT_NOERR) 
	{
		notf_fuim_tmpl = fuim_tmpl;
	
		/* SELECTOR GROUP */
		gbrdr = plugin_stuff.fuim_funcs.fz_fuim_new_text_static(fuim_tmpl, FZ_FUIM_ROOT, FZ_FUIM_NONE, FZ_FUIM_FLAG_BRDR,"Selector", NULL, NULL);
			ghorz = plugin_stuff.fuim_funcs.fz_fuim_new_group(fuim_tmpl, gbrdr, FZ_FUIM_NONE, FZ_FUIM_FLAG_HORZ, NULL);
				
				gvert = plugin_stuff.fuim_funcs.fz_fuim_new_group(fuim_tmpl, ghorz, FZ_FUIM_NONE, FZ_FUIM_FLAG_NONE, NULL);
					g1 = plugin_stuff.fuim_funcs.fz_fuim_new_check(fuim_tmpl, gvert, NOTF_ITEM_ID_OBJECTS, FZ_FUIM_FLAG_NONE, "Objects", notify_test_item_func, NULL);
					plugin_stuff.fuim_funcs.fz_fuim_item_unary_bool(fuim_tmpl, g1, &notf_show[NOTF_OBJECT],1);
					g1 = plugin_stuff.fuim_funcs.fz_fuim_new_check(fuim_tmpl, gvert, NOTF_ITEM_ID_LIGHTS, FZ_FUIM_FLAG_NONE, "Lights", notify_test_item_func, NULL);
					plugin_stuff.fuim_funcs.fz_fuim_item_unary_bool(fuim_tmpl, g1, &notf_show[NOTF_LIGHT],1);
					g1 = plugin_stuff.fuim_funcs.fz_fuim_new_check(fuim_tmpl, gvert, NOTF_ITEM_ID_VIEWS, FZ_FUIM_FLAG_NONE, "Views", notify_test_item_func, NULL);
					plugin_stuff.fuim_funcs.fz_fuim_item_unary_bool(fuim_tmpl, g1, &notf_show[NOTF_VIEW],1);
					
				gvert = plugin_stuff.fuim_funcs.fz_fuim_new_group(fuim_tmpl, ghorz, FZ_FUIM_NONE, FZ_FUIM_FLAG_NONE, NULL);
					g1 = plugin_stuff.fuim_funcs.fz_fuim_new_check(fuim_tmpl, gvert, NOTF_ITEM_ID_RMTL, FZ_FUIM_FLAG_NONE, "Surface Styles", notify_test_item_func, NULL);
					plugin_stuff.fuim_funcs.fz_fuim_item_unary_bool(fuim_tmpl, g1, &notf_show[NOTF_RMTL],1);
					g1 = plugin_stuff.fuim_funcs.fz_fuim_new_check(fuim_tmpl, gvert, NOTF_ITEM_ID_LAYERS, FZ_FUIM_FLAG_NONE, "Layers", notify_test_item_func, NULL);
					plugin_stuff.fuim_funcs.fz_fuim_item_unary_bool(fuim_tmpl, g1, &notf_show[NOTF_LAYER],1);
					g1 = plugin_stuff.fuim_funcs.fz_fuim_new_check(fuim_tmpl, gvert, NOTF_ITEM_ID_ANIM, FZ_FUIM_FLAG_NONE, "Animation", notify_test_item_func, NULL);
					plugin_stuff.fuim_funcs.fz_fuim_item_unary_bool(fuim_tmpl, g1, &notf_show[NOTF_ANIM],1);
				
				gvert = plugin_stuff.fuim_funcs.fz_fuim_new_group(fuim_tmpl, ghorz, FZ_FUIM_NONE, FZ_FUIM_FLAG_NONE, NULL);
					g1 = plugin_stuff.fuim_funcs.fz_fuim_new_check(fuim_tmpl, gvert, NOTF_ITEM_ID_WINDOW, FZ_FUIM_FLAG_NONE, "Window", notify_test_item_func, NULL);
					plugin_stuff.fuim_funcs.fz_fuim_item_unary_bool(fuim_tmpl, g1, &notf_show[NOTF_WINDOW],1);
					g1 = plugin_stuff.fuim_funcs.fz_fuim_new_check(fuim_tmpl, gvert, NOTF_ITEM_ID_PROJECT, FZ_FUIM_FLAG_NONE, "Project", notify_test_item_func, NULL);
					plugin_stuff.fuim_funcs.fz_fuim_item_unary_bool(fuim_tmpl, g1, &notf_show[NOTF_PROJECT],1);
					g1 = plugin_stuff.fuim_funcs.fz_fuim_new_check(fuim_tmpl, gvert, NOTF_ITEM_ID_SYSTEM, FZ_FUIM_FLAG_NONE, "System", notify_test_item_func, NULL);
					plugin_stuff.fuim_funcs.fz_fuim_item_unary_bool(fuim_tmpl, g1, &notf_show[NOTF_SYSTEM],1);
					
				gvert = plugin_stuff.fuim_funcs.fz_fuim_new_group(fuim_tmpl, ghorz, FZ_FUIM_NONE, FZ_FUIM_FLAG_NONE, NULL);
					g1 = plugin_stuff.fuim_funcs.fz_fuim_new_check(fuim_tmpl, gvert, NOTF_ITEM_ID_WIND_UNITS, FZ_FUIM_FLAG_NONE, "Window Units", notify_test_item_func, NULL);
					plugin_stuff.fuim_funcs.fz_fuim_item_unary_bool(fuim_tmpl, g1, &notf_show[NOTF_WIND_UNITS],1);
					g1 = plugin_stuff.fuim_funcs.fz_fuim_new_check(fuim_tmpl, gvert, NOTF_ITEM_ID_PROJ_UNITS, FZ_FUIM_FLAG_NONE, "Project Units", notify_test_item_func, NULL);
					plugin_stuff.fuim_funcs.fz_fuim_item_unary_bool(fuim_tmpl, g1, &notf_show[NOTF_PROJ_UNITS],1);
					g1 = plugin_stuff.fuim_funcs.fz_fuim_new_check(fuim_tmpl, gvert, NOTF_ITEM_ID_SYST_UNITS, FZ_FUIM_FLAG_NONE, "System Units", notify_test_item_func, NULL);
					plugin_stuff.fuim_funcs.fz_fuim_item_unary_bool(fuim_tmpl, g1, &notf_show[NOTF_SYST_UNITS],1);
					
				gvert = plugin_stuff.fuim_funcs.fz_fuim_new_group(fuim_tmpl, ghorz, FZ_FUIM_NONE, FZ_FUIM_FLAG_NONE, NULL);
					g1 = plugin_stuff.fuim_funcs.fz_fuim_new_check(fuim_tmpl, gvert, NOTF_ITEM_ID_OS, FZ_FUIM_FLAG_NONE, "OS", notify_test_item_func, NULL);
					plugin_stuff.fuim_funcs.fz_fuim_item_unary_bool(fuim_tmpl, g1, &notf_show[NOTF_OS],1);
					g1 = plugin_stuff.fuim_funcs.fz_fuim_new_check(fuim_tmpl, gvert, NOTF_ITEM_ID_PREF_DEFAULT, FZ_FUIM_FLAG_NONE, "Prefs Default", notify_test_item_func, NULL);
					plugin_stuff.fuim_funcs.fz_fuim_item_unary_bool(fuim_tmpl, g1, &notf_show[NOTF_PREF_DEFAULT],1);
					g1 = plugin_stuff.fuim_funcs.fz_fuim_new_check(fuim_tmpl, gvert, NOTF_ITEM_ID_PREF_MODEL_TYPE, FZ_FUIM_FLAG_NONE, "Prefs Model Type", notify_test_item_func, NULL);
					plugin_stuff.fuim_funcs.fz_fuim_item_unary_bool(fuim_tmpl, g1, &notf_show[NOTF_PREF_MODEL_TYPE],1);

			ghorz = plugin_stuff.fuim_funcs.fz_fuim_new_group(fuim_tmpl, gbrdr, FZ_FUIM_NONE, FZ_FUIM_FLAG_HORZ, NULL);
				g1 = plugin_stuff.fuim_funcs.fz_fuim_new_button(fuim_tmpl, ghorz, NOTF_ITEM_ID_ALL, FZ_FUIM_FLAG_NONE, "All", notify_test_item_func, NULL);
				g1 = plugin_stuff.fuim_funcs.fz_fuim_new_button(fuim_tmpl, ghorz, NOTF_ITEM_ID_NONE, FZ_FUIM_FLAG_NONE, "None", notify_test_item_func, NULL);
				
	
		/* LIST GROUP */
		gbrdr = plugin_stuff.fuim_funcs.fz_fuim_new_text_static(fuim_tmpl, FZ_FUIM_ROOT, FZ_FUIM_NONE, FZ_FUIM_FLAG_BRDR,"Actions", NULL, NULL);
			g1 = plugin_stuff.fuim_funcs.fz_fuim_new_text_static(fuim_tmpl, gbrdr, FZ_FUIM_NONE, FZ_FUIM_FLAG_HORZ | FZ_FUIM_FLAG_GFLT,"Count", NULL, NULL);
			plugin_stuff.fuim_funcs.fz_fuim_new_text_info_int(fuim_tmpl, g1, FZ_FUIM_NONE, FZ_FUIM_FLAG_NONE, FZ_FUIM_FORMAT_INT_DEFAULT, &n_notf, TRUE, 60, 0, NULL, NULL);

			plugin_stuff.fuim_funcs.fz_fuim_new_list(
				fuim_tmpl,
				gbrdr,
				FZ_FUIM_NONE,
				FZ_FUIM_LIST_TYPE_NONE,
				1 << FZ_FUIM_LIST_TITLE_BIT | 1 << FZ_FUIM_LIST_BG_LIST_BIT,
				500,
				20,
				NOTF_LIST_NUM_COLM,
				-1,
				&notf_list_ptr);
			plugin_stuff.fuim_funcs.fz_fuim_list_set_get_num_items_func(fuim_tmpl, notf_list_ptr, notify_test_list_get_num_items);
			plugin_stuff.fuim_funcs.fz_fuim_list_set_get_string_func(fuim_tmpl, notf_list_ptr, notify_test_list_get_str);
			
			plugin_stuff.fuim_funcs.fz_fuim_list_set_colm_width(fuim_tmpl,notf_list_ptr,NOTF_LIST_COLM_COUNT,20);
			plugin_stuff.fuim_funcs.fz_fuim_list_set_colm_width(fuim_tmpl,notf_list_ptr,NOTF_LIST_COLM_WINDEX,40);
			plugin_stuff.fuim_funcs.fz_fuim_list_set_colm_width(fuim_tmpl,notf_list_ptr,NOTF_LIST_COLM_ENTITY,80);
			plugin_stuff.fuim_funcs.fz_fuim_list_set_colm_width(fuim_tmpl,notf_list_ptr,NOTF_LIST_COLM_NAME,80);
			plugin_stuff.fuim_funcs.fz_fuim_list_set_colm_width(fuim_tmpl,notf_list_ptr,NOTF_LIST_COLM_ACTION_ENUM,120);
			
			plugin_stuff.fuim_funcs.fz_fuim_list_set_colm_title(fuim_tmpl,notf_list_ptr,NOTF_LIST_COLM_COUNT,"#");
			plugin_stuff.fuim_funcs.fz_fuim_list_set_colm_title(fuim_tmpl,notf_list_ptr,NOTF_LIST_COLM_WINDEX,"windex");
			plugin_stuff.fuim_funcs.fz_fuim_list_set_colm_title(fuim_tmpl,notf_list_ptr,NOTF_LIST_COLM_ENTITY,"Type");
			plugin_stuff.fuim_funcs.fz_fuim_list_set_colm_title(fuim_tmpl,notf_list_ptr,NOTF_LIST_COLM_NAME,"Name");
			plugin_stuff.fuim_funcs.fz_fuim_list_set_colm_title(fuim_tmpl,notf_list_ptr,NOTF_LIST_COLM_ACTION_ENUM,"Action Enum");
			plugin_stuff.fuim_funcs.fz_fuim_list_set_colm_title(fuim_tmpl,notf_list_ptr,NOTF_LIST_COLM_ACTION_DESC,"Action Description");
		
			g1 = plugin_stuff.fuim_funcs.fz_fuim_new_button(fuim_tmpl, gbrdr, NOTF_ITEM_ID_CLEAR, FZ_FUIM_FLAG_NONE, "Clear Actions", notify_test_item_func, NULL);
			plugin_stuff.fuim_funcs.fz_fuim_tmpl_update_value(notf_fuim_tmpl,-1);

		plugin_stuff.fuim_funcs.fz_fuim_tmpl_set_finit_func(fuim_tmpl, notify_test_fuim_finit, NULL);
	}
	return (rv);
}


/************************************************************************
	handle record allocation
************************************************************************/
static fzrt_error_td	notf_data_check_stack(void)
{
	fzrt_error_td rv = FZRT_NOERR;

	if ( l_notf + 2 > s_notf )
	{	rv = plugin_stuff.fzrt_mem_funcs.fz_mem_zone_incr_array(notf_mem_zone,(fzrt_ptr*)&notf_data,&s_notf,sizeof(notf_data_td),l_notf + 2,10);
	}
	if ( rv == FZRT_NOERR )
	{
		l_notf++;
		n_notf++;
	}
	
	return(rv);
	
}

/************************************************************************
	regen palette
************************************************************************/
static void	notf_palette_regen(void)
{
	if ( notf_fuim_tmpl != NULL ) 
	{	plugin_stuff.fuim_funcs.fz_fuim_list_regen(notf_fuim_tmpl,notf_list_ptr);
		plugin_stuff.fuim_funcs.fz_fuim_tmpl_update_value(notf_fuim_tmpl,-1);
	}
}

/************************************************************************
	Lite notification callback
************************************************************************/
static fzrt_error_td notify_test_notf_lite (
	fzrt_int						windex,		
	fz_notf_lite_enum 			lite_notf,
	fz_lite_ptr 				lite 		
	)
{
	fz_type_td		data;
	
	if( notf_data_check_stack() == FZRT_NOERR )
	{
		notf_data[l_notf].type		= NOTF_LIGHT;
		strcpy(notf_data[l_notf].type_name,"Light");
		notf_data[l_notf].windex	= windex;
		switch ( lite_notf )
		{	case FZ_NOTF_LITE_DIRTY 	: 	
				strcpy(notf_data[l_notf].action_desc, "Dirty");		
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_LITE_DIRTY");		
			break;
			
			case FZ_NOTF_LITE_NEW 		:	
				strcpy(notf_data[l_notf].action_desc, "New");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_LITE_NEW");			
			break;
			
			case FZ_NOTF_LITE_DELETE 	:	
				strcpy(notf_data[l_notf].action_desc, "Deleted");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_LITE_DELETE");		
			break;
			
			default						:	
				strcpy(notf_data[l_notf].action_desc, "None");
				strcpy(notf_data[l_notf].action_enum, "None");					
			break;
		}
		plugin_stuff.lite_funcs.fz_lite_get_parm(windex,lite,FZ_LIGHT_REP_PARM_NAME,FALSE,&data);
		plugin_stuff.type_funcs.fz_type_get_string(&data,notf_data[l_notf].name);			
		
		notf_palette_regen();
	}
	
	return (FZRT_NOERR);
}

/************************************************************************
	Surface Style notification callback
************************************************************************/
static fzrt_error_td notify_test_notf_rmtl (
	fzrt_int						windex,		
	fz_notf_rmtl_enum 			rmtl_notf,
	fz_rmtl_ptr 				rmtl 		
	)
{
	fz_type_td		data;
	
	if( notf_data_check_stack() == FZRT_NOERR )
	{
		notf_data[l_notf].type		= NOTF_RMTL;
		strcpy(notf_data[l_notf].type_name,"Surface Style");
		notf_data[l_notf].windex	= windex;
		switch ( rmtl_notf )
		{	
			case FZ_NOTF_RMTL_DIRTY 	: 	
				strcpy(notf_data[l_notf].action_desc, "Dirty");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_RMTL_DIRTY");
			break;
			
			case FZ_NOTF_RMTL_NEW 	: 	
				strcpy(notf_data[l_notf].action_desc, "New");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_RMTL_NEW");
			break;
			
			case FZ_NOTF_RMTL_DELETE 	: 	
				strcpy(notf_data[l_notf].action_desc, "Deleted");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_RMTL_DELETE");
			break;
			
			default						:	
				strcpy(notf_data[l_notf].action_desc, "None");
				strcpy(notf_data[l_notf].action_enum, "None");					
			break;
		}
		plugin_stuff.rmtl_funcs.fz_rmtl_get_parm(windex,rmtl,FZ_RMTL_PARM_NAME,&data);
		plugin_stuff.type_funcs.fz_type_get_string(&data,notf_data[l_notf].name);			
		
		notf_palette_regen();
	}
	return (FZRT_NOERR);
}

/************************************************************************
	Project notification callback
************************************************************************/
static fzrt_error_td notify_test_notf_proj (
	fzrt_int						windex,		
	fz_notf_proj_enum 			proj_notf
	)
{
	if( notf_data_check_stack() == FZRT_NOERR )
	{
		notf_data[l_notf].type		= NOTF_PROJECT;
		strcpy(notf_data[l_notf].type_name,"Project");
		notf_data[l_notf].windex	= windex;
		switch ( proj_notf )
		{	
			case FZ_NOTF_PROJ_DIRTY 	: 	
				strcpy(notf_data[l_notf].action_desc, "Dirty");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_PROJ_DIRTY");
			break;

			case FZ_NOTF_PROJ_NEW 	: 	
				strcpy(notf_data[l_notf].action_desc, "New");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_PROJ_NEW");
			break;

			case FZ_NOTF_PROJ_OPEN 	: 	
				strcpy(notf_data[l_notf].action_desc, "Opened");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_PROJ_OPEN");
			break;

			case FZ_NOTF_PROJ_SAVE 	: 	
				strcpy(notf_data[l_notf].action_desc, "Saved");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_PROJ_SAVE");
			break;

			case FZ_NOTF_PROJ_SAVEAS 	: 	
				strcpy(notf_data[l_notf].action_desc, "Saved As");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_PROJ_SAVEAS");
			break;

			case FZ_NOTF_PROJ_CLOSE 	: 	
				strcpy(notf_data[l_notf].action_desc, "Closed");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_PROJ_CLOSE");
			break;

			case FZ_NOTF_PROJ_PICK 	: 	
				strcpy(notf_data[l_notf].action_desc, "Pick changed");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_PROJ_PICK");
			break;

			case FZ_NOTF_PROJ_LIGHTS: 	
				strcpy(notf_data[l_notf].action_desc, "Lights changed");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_PROJ_LIGHTS");
			break;

			case FZ_NOTF_PROJ_CAMERA: 	
				strcpy(notf_data[l_notf].action_desc, "Views changed");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_PROJ_CAMERA");
			break;

			case FZ_NOTF_PROJ_SNAPS: 	
				strcpy(notf_data[l_notf].action_desc, "Snap hightlight changed");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_PROJ_SNAPS");
			break;

			case FZ_NOTF_PROJ_COLORS: 	
				strcpy(notf_data[l_notf].action_desc, "Project colors changed");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_PROJ_COLORS");
			break;

			case FZ_NOTF_PROJ_SURF: 	
				strcpy(notf_data[l_notf].action_desc, "Surface Styles changed");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_PROJ_SURF");
			break;

			case FZ_NOTF_PROJ_SMTH: 	
				strcpy(notf_data[l_notf].action_desc, "Smooth shading options changed");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_PROJ_SMTH");
			break;

			case FZ_NOTF_PROJ_GEOM: 	
				strcpy(notf_data[l_notf].action_desc, "Geometry options changed");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_PROJ_GEOM");
			break;

			case FZ_NOTF_PROJ_DEFT: 	
				strcpy(notf_data[l_notf].action_desc, "Default texture map control changed");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_PROJ_DEFT");
			break;

			case FZ_NOTF_PROJ_PRESAVE: 	
				strcpy(notf_data[l_notf].action_desc, "Before save/save as execution");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_PROJ_PRESAVE");
			break;

			case FZ_NOTF_PROJ_TOGGLE: 	
				strcpy(notf_data[l_notf].action_desc, "Switched project");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_PROJ_TOGGLE");
			break;

			default						:	
				strcpy(notf_data[l_notf].action_desc, "None");
				strcpy(notf_data[l_notf].action_enum, "None");					
			break;
		}
		
		plugin_stuff.proj_funcs.fz_proj_get_name(windex,notf_data[l_notf].name,256,NULL);
			
		notf_palette_regen();
	}
	return (FZRT_NOERR);
}

/************************************************************************
	Window notification callback
************************************************************************/
static fzrt_error_td notify_test_notf_wind (
	fzrt_int						windex,		
	fz_notf_wind_enum 			wind_notf,
	fz_notf_proj_enum			proj_notf
	)
{
	fz_view_ptr		view;
	fz_type_td		data;
	char			name[256];
	
	if( notf_data_check_stack() == FZRT_NOERR )
	{
		notf_data[l_notf].type		= NOTF_WINDOW;
		strcpy(notf_data[l_notf].type_name,"Window");
		notf_data[l_notf].windex	= windex;
		switch ( wind_notf )
		{	
			case FZ_NOTF_WIND_DIRTY 	: 	
				strcpy(notf_data[l_notf].action_desc, "Dirty");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_WIND_DIRTY");
			break;
			
			case FZ_NOTF_WIND_NEW 	: 	
				strcpy(notf_data[l_notf].action_desc, "New");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_WIND_NEW");
			break;
			
			case FZ_NOTF_WIND_CLOSE 	: 	
				strcpy(notf_data[l_notf].action_desc, "Closed");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_WIND_CLOSE");
			break;
			
			case FZ_NOTF_WIND_RESIZE 	: 	
				strcpy(notf_data[l_notf].action_desc, "Resized");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_WIND_RESIZE");
			break;
			
			case FZ_NOTF_WIND_RESIZE_START 	: 	
				strcpy(notf_data[l_notf].action_desc, "Resize start");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_WIND_RESIZE_START");
			break;
			
			case FZ_NOTF_WIND_RESIZE_END 	: 	
				strcpy(notf_data[l_notf].action_desc, "Resize end");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_WIND_RESIZE_END");
			break;
			
			case FZ_NOTF_WIND_ISPEC 	: 	
				strcpy(notf_data[l_notf].action_desc, "Image spec changed");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_WIND_ISPEC");
			break;
			
			case FZ_NOTF_WIND_DEPTH 	: 	
				strcpy(notf_data[l_notf].action_desc, "Color depth changed");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_WIND_DEPTH");
			break;
			
			case FZ_NOTF_WIND_VIEW 	: 	
				plugin_stuff.view_funcs.fz_view_get_active(windex, &view);
				if(view== NULL)strcpy(notf_data[l_notf].action_desc, "View changed [<Current View>]");
				else 
				{
					plugin_stuff.view_funcs.fz_view_get_parm_data(windex, view, FZ_VIEW_PARM_NAME, &data);
					plugin_stuff.type_funcs.fz_type_get_string(&data,name);
					sprintf(notf_data[l_notf].action_desc, "View changed [%s]",name);
				}
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_WIND_VIEW");
			break;
			
			case FZ_NOTF_WIND_GRID 	: 	
				strcpy(notf_data[l_notf].action_desc, "Grid changed");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_WIND_GRID");
			break;
			
			case FZ_NOTF_WIND_ULAY 	: 	
				strcpy(notf_data[l_notf].action_desc, "Underlay changed");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_WIND_ULAY");
			break;
			
			case FZ_NOTF_WIND_OPTS 	: 	
				strcpy(notf_data[l_notf].action_desc, "Rendering options changed");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_WIND_OPTS");
			break;
			
			case FZ_NOTF_WIND_PROJ 	: 	
				strcpy(notf_data[l_notf].action_desc, "Project option changed");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_WIND_PROJ");
			break;
			
			case FZ_NOTF_WIND_RNDR_START 	: 	
				strcpy(notf_data[l_notf].action_desc, "Rendering start");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_WIND_RNDR_START");
			break;
			
			case FZ_NOTF_WIND_RNDR_END 	: 	
				strcpy(notf_data[l_notf].action_desc, "Rendering end");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_WIND_RNDR_END");
			break;
			
			case FZ_NOTF_WIND_TOGGLE 	: 	
				strcpy(notf_data[l_notf].action_desc, "Switched window");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_WIND_TOGGLE");
			break;

			default						:	
				strcpy(notf_data[l_notf].action_desc, "None");
				strcpy(notf_data[l_notf].action_enum, "None");					
			break;
		}
		
		plugin_stuff.proj_funcs.fz_proj_get_name(windex,notf_data[l_notf].name,256,NULL);
			
		notf_palette_regen();
	}
	return (FZRT_NOERR);
}

/************************************************************************
	Layer notification callback
************************************************************************/
static fzrt_error_td notify_test_notf_layr (
	fzrt_int						windex,		
	fz_notf_layr_enum 			layr_notf,
	fz_layr_ptr 				layr 		
	)
{
	fz_type_td		data;

	if( notf_data_check_stack() == FZRT_NOERR )
	{
		notf_data[l_notf].type		= NOTF_LAYER;
		strcpy(notf_data[l_notf].type_name,"Layer");
		notf_data[l_notf].windex	= windex;
		switch ( layr_notf )
		{	
			case FZ_NOTF_LAYR_DIRTY 	: 	
				strcpy(notf_data[l_notf].action_desc, "Dirty");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_LAYR_DIRTY");
			break;
			
			case FZ_NOTF_LAYR_NEW 	: 	
				strcpy(notf_data[l_notf].action_desc, "New");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_LAYR_NEW");
			break;
			
			case FZ_NOTF_LAYR_DELETE 	: 	
				strcpy(notf_data[l_notf].action_desc, "Deleted");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_LAYR_DELETE");
			break;

			default						:	
				strcpy(notf_data[l_notf].action_desc, "None");
				strcpy(notf_data[l_notf].action_enum, "None");					
			break;
		}
		
		plugin_stuff.layr_funcs.fz_layr_get_parm_data(windex, layr, FZ_LAYR_PARM_NAME, &data);
		plugin_stuff.type_funcs.fz_type_get_string(&data,notf_data[l_notf].name);			
			
		notf_palette_regen();
	}
	return (FZRT_NOERR);
}


/************************************************************************
	View notification callback
************************************************************************/
static fzrt_error_td notify_test_notf_view (
	fzrt_int						windex,		
	fz_notf_view_enum 			view_notf,
	fz_view_ptr 				view 		
	)
{
	fz_type_td		data;

	if( notf_data_check_stack() == FZRT_NOERR )
	{
		notf_data[l_notf].type		= NOTF_VIEW;
		strcpy(notf_data[l_notf].type_name,"View");
		notf_data[l_notf].windex	= windex;
		switch ( view_notf )
		{	
			case FZ_NOTF_VIEW_DIRTY 	: 	
				strcpy(notf_data[l_notf].action_desc, "Dirty");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_VIEW_DIRTY");
			break;
			
			case FZ_NOTF_VIEW_NEW 	: 	
				strcpy(notf_data[l_notf].action_desc, "New");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_VIEW_NEW");
			break;
			
			case FZ_NOTF_VIEW_DELETE 	: 	
				strcpy(notf_data[l_notf].action_desc, "Deleted");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_VIEW_DELETE");
			break;

			default						:	
				strcpy(notf_data[l_notf].action_desc, "None");
				strcpy(notf_data[l_notf].action_enum, "None");					
			break;
		}
		
		plugin_stuff.view_funcs.fz_view_get_parm_data(windex, view, FZ_VIEW_PARM_NAME, &data);
		plugin_stuff.type_funcs.fz_type_get_string(&data,notf_data[l_notf].name);
			
		notf_palette_regen();
	}
	return (FZRT_NOERR);
}


/************************************************************************
	Object notification callback
************************************************************************/
static fzrt_error_td notify_test_notf_objt (
	fzrt_int						windex,		
	fz_notf_objt_enum 			objt_notf,
	fz_objt_ptr 				objt		
	)
{
	if( notf_data_check_stack() == FZRT_NOERR )
	{
		notf_data[l_notf].type		= NOTF_OBJECT;
		strcpy(notf_data[l_notf].type_name,"Object");
		notf_data[l_notf].windex	= windex;
		switch ( objt_notf )
		{	
			case FZ_NOTF_OBJT_EDTOP 	: 	
				strcpy(notf_data[l_notf].action_desc, "Edited topology");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_OBJT_EDTOP");
			break;
			
			case FZ_NOTF_OBJT_EDGEO 	: 	
				strcpy(notf_data[l_notf].action_desc, "Edited geometry");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_OBJT_EDGEO");
			break;
			
			case FZ_NOTF_OBJT_EDATTR 	: 	
				strcpy(notf_data[l_notf].action_desc, "Edited attributes");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_OBJT_EDATTR");
			break;
			
			case FZ_NOTF_OBJT_NEW 	: 	
				strcpy(notf_data[l_notf].action_desc, "New");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_OBJT_NEW");
			break;
			
			case FZ_NOTF_OBJT_DELETE 	: 	
				strcpy(notf_data[l_notf].action_desc, "Deleted");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_OBJT_DELETE");
			break;

			default						:	
				strcpy(notf_data[l_notf].action_desc, "None");
				strcpy(notf_data[l_notf].action_enum, "None");					
			break;
		}
		plugin_stuff.obj_attr_funcs.fz_objt_attr_get_objt_name(windex, objt, notf_data[l_notf].name);
			
		notf_palette_regen();
	}
	return (FZRT_NOERR);
}


/************************************************************************
	System notification callback
************************************************************************/
static fzrt_error_td notify_test_notf_syst (
	fz_notf_syst_enum 			syst_notf
	)
{
	if( notf_data_check_stack() == FZRT_NOERR )
	{
		notf_data[l_notf].type		= NOTF_SYSTEM;
		strcpy(notf_data[l_notf].type_name,"System");
		notf_data[l_notf].windex	= -1;
		switch ( syst_notf )
		{	
			case FZ_NOTF_SYST_QUIT 	: 	
				strcpy(notf_data[l_notf].action_desc, "Quit");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_SYST_QUIT");
			break;
			
			case FZ_NOTF_SYST_SUSPEND 	: 	
				strcpy(notf_data[l_notf].action_desc, "Application suspended");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_SYST_SUSPEND");
			break;
			
			case FZ_NOTF_SYST_RESUME 	: 	
				strcpy(notf_data[l_notf].action_desc, "Application resumed");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_SYST_RESUME");
			break;
			
			case FZ_NOTF_SYST_CANCEL 	: 	
				strcpy(notf_data[l_notf].action_desc, "Operation cancelled");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_SYST_CANCEL");
			break;

			default						:	
				strcpy(notf_data[l_notf].action_desc, "None");
				strcpy(notf_data[l_notf].action_enum, "None");					
			break;
		}
		strcpy(notf_data[l_notf].name,"");			
			
		notf_palette_regen();
	}
	return (FZRT_NOERR);
}


/************************************************************************
	System units notification callback
************************************************************************/
static fzrt_error_td notify_test_notf_syst_units(
	fz_unit_type_enum 			units,		
	fz_unit_scale_enum 			scale
	)
{
	if( notf_data_check_stack() == FZRT_NOERR )
	{
		notf_data[l_notf].type		= NOTF_SYST_UNITS;
		strcpy(notf_data[l_notf].type_name,"System Units");
		notf_data[l_notf].windex	= -1;
		switch ( units )
		{	
			case FZ_UNIT_TYPE_ENGLISH 	: 	
				strcpy(notf_data[l_notf].action_desc, "English");
				strcpy(notf_data[l_notf].action_enum, "FZ_UNIT_TYPE_ENGLISH");
			break;
			
			case FZ_UNIT_TYPE_METRIC 	: 	
				strcpy(notf_data[l_notf].action_desc, "Metric");
				strcpy(notf_data[l_notf].action_enum, "FZ_UNIT_TYPE_METRIC");
			break;

			default						:	
				strcpy(notf_data[l_notf].action_desc, "None");
				strcpy(notf_data[l_notf].action_enum, "None");					
			break;
		}
		
		strcat(notf_data[l_notf].action_desc," ");
		strcat(notf_data[l_notf].action_enum," ");
		
		switch ( scale )
		{	
			case FZ_UNIT_SCAL_UNDEF 	: 	
				strcat(notf_data[l_notf].action_desc, "Undefined scale");
				strcat(notf_data[l_notf].action_enum, "FZ_UNIT_SCAL_UNDEF");
			break;
			
			case FZ_UNIT_SCAL_SMALL 	: 	
				strcat(notf_data[l_notf].action_desc, "Small");
				strcat(notf_data[l_notf].action_enum, "FZ_UNIT_SCAL_SMALL");
			break;
			
			case FZ_UNIT_SCAL_MEDIUM 	: 	
				strcat(notf_data[l_notf].action_desc, "Medium");
				strcat(notf_data[l_notf].action_enum, "FZ_UNIT_SCAL_MEDIUM");
			break;
			
			case FZ_UNIT_SCAL_LARGE 	: 	
				strcat(notf_data[l_notf].action_desc, "Large");
				strcat(notf_data[l_notf].action_enum, "FZ_UNIT_SCAL_LARGE");
			break;
			
			case FZ_UNIT_SCAL_MINI: 	
				strcat(notf_data[l_notf].action_desc, "Mini");
				strcat(notf_data[l_notf].action_enum, "FZ_UNIT_SCAL_MINI");
			break;

			default						:	
				strcat(notf_data[l_notf].action_desc, "None");
				strcat(notf_data[l_notf].action_enum, "None");					
			break;
		}

		strcpy(notf_data[l_notf].name,"");			
			
		notf_palette_regen();
	}
	return (FZRT_NOERR);
}

/************************************************************************
	Project units notification callback
************************************************************************/
static fzrt_error_td notify_test_notf_proj_units(
	fzrt_int						windex,
	fz_unit_type_enum 			units,		
	fz_unit_scale_enum 			scale
	)
{
	if( notf_data_check_stack() == FZRT_NOERR )
	{
		notf_data[l_notf].type		= NOTF_PROJ_UNITS;
		strcpy(notf_data[l_notf].type_name,"Project Units");
		notf_data[l_notf].windex	= windex;
		switch ( units )
		{	
			case FZ_UNIT_TYPE_ENGLISH 	: 	
				strcpy(notf_data[l_notf].action_desc, "English");
				strcpy(notf_data[l_notf].action_enum, "FZ_UNIT_TYPE_ENGLISH");
			break;
			
			case FZ_UNIT_TYPE_METRIC 	: 	
				strcpy(notf_data[l_notf].action_desc, "Metric");
				strcpy(notf_data[l_notf].action_enum, "FZ_UNIT_TYPE_METRIC");
			break;

			default						:	
				strcpy(notf_data[l_notf].action_desc, "None");
				strcpy(notf_data[l_notf].action_enum, "None");					
			break;
		}
		
		strcat(notf_data[l_notf].action_desc," ");
		strcat(notf_data[l_notf].action_enum," ");
		
		switch ( scale )
		{	
			case FZ_UNIT_SCAL_UNDEF 	: 	
				strcat(notf_data[l_notf].action_desc, "Undefined scale");
				strcat(notf_data[l_notf].action_enum, "FZ_UNIT_SCAL_UNDEF");
			break;
			
			case FZ_UNIT_SCAL_SMALL 	: 	
				strcat(notf_data[l_notf].action_desc, "Small");
				strcat(notf_data[l_notf].action_enum, "FZ_UNIT_SCAL_SMALL");
			break;
			
			case FZ_UNIT_SCAL_MEDIUM 	: 	
				strcat(notf_data[l_notf].action_desc, "Medium");
				strcat(notf_data[l_notf].action_enum, "FZ_UNIT_SCAL_MEDIUM");
			break;
			
			case FZ_UNIT_SCAL_LARGE 	: 	
				strcat(notf_data[l_notf].action_desc, "Large");
				strcat(notf_data[l_notf].action_enum, "FZ_UNIT_SCAL_LARGE");
			break;
			
			case FZ_UNIT_SCAL_MINI: 	
				strcat(notf_data[l_notf].action_desc, "Mini");
				strcat(notf_data[l_notf].action_enum, "FZ_UNIT_SCAL_MINI");
			break;

			default						:	
				strcat(notf_data[l_notf].action_desc, "None");
				strcat(notf_data[l_notf].action_enum, "None");					
			break;
		}
		strcpy(notf_data[l_notf].name,"");			
			
		notf_palette_regen();
	}
	return (FZRT_NOERR);
}

/************************************************************************
	Window units notification callback
************************************************************************/
static fzrt_error_td notify_test_notf_wind_units(
	fzrt_int						windex,
	fz_unit_type_enum 			units,		
	fz_unit_scale_enum 			scale
	)
{
	if( notf_data_check_stack() == FZRT_NOERR )
	{
		notf_data[l_notf].type		= NOTF_WIND_UNITS;
		strcpy(notf_data[l_notf].type_name,"Window Units");
		notf_data[l_notf].windex	= windex;
		switch ( units )
		{	
			case FZ_UNIT_TYPE_ENGLISH 	: 	
				strcpy(notf_data[l_notf].action_desc, "English");
				strcpy(notf_data[l_notf].action_enum, "FZ_UNIT_TYPE_ENGLISH");
			break;
			
			case FZ_UNIT_TYPE_METRIC 	: 	
				strcpy(notf_data[l_notf].action_desc, "Metric");
				strcpy(notf_data[l_notf].action_enum, "FZ_UNIT_TYPE_METRIC");
			break;

			default						:	
				strcpy(notf_data[l_notf].action_desc, "None");
				strcpy(notf_data[l_notf].action_enum, "None");					
			break;
		}
		
		strcat(notf_data[l_notf].action_desc," ");
		strcat(notf_data[l_notf].action_enum," ");
		
		switch ( scale )
		{	
			case FZ_UNIT_SCAL_UNDEF 	: 	
				strcat(notf_data[l_notf].action_desc, "Undefined scale");
				strcat(notf_data[l_notf].action_enum, "FZ_UNIT_SCAL_UNDEF");
			break;
			
			case FZ_UNIT_SCAL_SMALL 	: 	
				strcat(notf_data[l_notf].action_desc, "Small");
				strcat(notf_data[l_notf].action_enum, "FZ_UNIT_SCAL_SMALL");
			break;
			
			case FZ_UNIT_SCAL_MEDIUM 	: 	
				strcat(notf_data[l_notf].action_desc, "Medium");
				strcat(notf_data[l_notf].action_enum, "FZ_UNIT_SCAL_MEDIUM");
			break;
			
			case FZ_UNIT_SCAL_LARGE 	: 	
				strcat(notf_data[l_notf].action_desc, "Large");
				strcat(notf_data[l_notf].action_enum, "FZ_UNIT_SCAL_LARGE");
			break;
			
			case FZ_UNIT_SCAL_MINI: 	
				strcat(notf_data[l_notf].action_desc, "Mini");
				strcat(notf_data[l_notf].action_enum, "FZ_UNIT_SCAL_MINI");
			break;

			default						:	
				strcat(notf_data[l_notf].action_desc, "None");
				strcat(notf_data[l_notf].action_enum, "None");					
			break;
		}
		strcpy(notf_data[l_notf].name,"");			
			
		notf_palette_regen();
	}
	return (FZRT_NOERR);
}

/************************************************************************
	Animation notification callback
************************************************************************/
static fzrt_error_td notify_test_notf_anim(
	fzrt_int						windex,		
	fz_notf_anim_enum 			anim_notf,	
	fz_view_ptr 				anim_view	
	)
{
	fz_type_td		data;

	if( notf_data_check_stack() == FZRT_NOERR )
	{
		notf_data[l_notf].type		= NOTF_ANIM;
		strcpy(notf_data[l_notf].type_name,"Animation");
		notf_data[l_notf].windex	= windex;
		switch ( anim_notf )
		{	
			case FZ_NOTF_ANIM_DIRTY 	: 	
				strcpy(notf_data[l_notf].action_desc, "Dirty");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_ANIM_DIRTY");
			break;
			
			case FZ_NOTF_ANIM_FRAME_CHANGED 	: 	
				strcpy(notf_data[l_notf].action_desc, "Frame changed");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_ANIM_FRAME_CHANGED");
			break;
			
			case FZ_NOTF_ANIM_GEN_START 	: 	
				strcpy(notf_data[l_notf].action_desc, "Generation start");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_ANIM_GEN_START");
			break;
			
			case FZ_NOTF_ANIM_GEN_END 	: 	
				strcpy(notf_data[l_notf].action_desc, "Generation end");
				strcpy(notf_data[l_notf].action_enum, "FZ_NOTF_ANIM_GEN_END");
			break;

			default						:	
				strcat(notf_data[l_notf].action_desc, "None");
				strcat(notf_data[l_notf].action_enum, "None");					
			break;
		}
		plugin_stuff.view_funcs.fz_view_get_parm_data(windex, anim_view, FZ_VIEW_PARM_NAME, &data);
		plugin_stuff.type_funcs.fz_type_get_string(&data,notf_data[l_notf].name);
			
		notf_palette_regen();
	}
	return (FZRT_NOERR);
}

/************************************************************************
	Prefs default notification callback
************************************************************************/
static fzrt_error_td notify_test_notf_pref_default(
	fz_unit_type_enum 			pref_units, 	
	fz_unit_scale_enum 			pref_scale	
	)
{
	if( notf_data_check_stack() == FZRT_NOERR )
	{
		notf_data[l_notf].type		= NOTF_PREF_DEFAULT;
		strcpy(notf_data[l_notf].type_name,"Preferences Default");
		notf_data[l_notf].windex	= -1;
		switch ( pref_units )
		{	
			case FZ_UNIT_TYPE_ENGLISH 	: 	
				strcpy(notf_data[l_notf].action_desc, "English");
				strcpy(notf_data[l_notf].action_enum, "FZ_UNIT_TYPE_ENGLISH");
			break;
			
			case FZ_UNIT_TYPE_METRIC 	: 	
				strcpy(notf_data[l_notf].action_desc, "Metric");
				strcpy(notf_data[l_notf].action_enum, "FZ_UNIT_TYPE_METRIC");
			break;

			default						:	
				strcpy(notf_data[l_notf].action_desc, "None");
				strcpy(notf_data[l_notf].action_enum, "None");					
			break;
		}
		
		strcat(notf_data[l_notf].action_desc," ");
		strcat(notf_data[l_notf].action_enum," ");
		
		switch ( pref_scale )
		{	
			case FZ_UNIT_SCAL_UNDEF 	: 	
				strcat(notf_data[l_notf].action_desc, "Undefined Scale");
				strcat(notf_data[l_notf].action_enum, "FZ_UNIT_SCAL_UNDEF");
			break;
			
			case FZ_UNIT_SCAL_SMALL 	: 	
				strcat(notf_data[l_notf].action_desc, "Small");
				strcat(notf_data[l_notf].action_enum, "FZ_UNIT_SCAL_SMALL");
			break;
			
			case FZ_UNIT_SCAL_MEDIUM 	: 	
				strcat(notf_data[l_notf].action_desc, "Medium");
				strcat(notf_data[l_notf].action_enum, "FZ_UNIT_SCAL_MEDIUM");
			break;
			
			case FZ_UNIT_SCAL_LARGE 	: 	
				strcat(notf_data[l_notf].action_desc, "Large");
				strcat(notf_data[l_notf].action_enum, "FZ_UNIT_SCAL_LARGE");
			break;
			
			case FZ_UNIT_SCAL_MINI: 	
				strcat(notf_data[l_notf].action_desc, "Mini");
				strcat(notf_data[l_notf].action_enum, "FZ_UNIT_SCAL_MINI");
			break;

			default						:	
				strcat(notf_data[l_notf].action_desc, "None");
				strcat(notf_data[l_notf].action_enum, "None");					
			break;
		}
			
		strcpy(notf_data[l_notf].name,"");			
			
		notf_palette_regen();
	}
	return (FZRT_NOERR);
}

/************************************************************************
	Prefs model type notification callback
************************************************************************/
static fzrt_error_td notify_test_notf_pref_model_type(
	fz_objt_model_type_enum 	model_type
	)
{
	if( notf_data_check_stack() == FZRT_NOERR )
	{
		notf_data[l_notf].type		= NOTF_PREF_MODEL_TYPE;
		strcpy(notf_data[l_notf].type_name,"Preferences Model Type");
		notf_data[l_notf].windex	= -1;
		switch ( model_type )
		{	
			case FZ_OBJT_MODEL_TYPE_FACT 	: 	
				strcpy(notf_data[l_notf].action_desc, "Facetted");
				strcpy(notf_data[l_notf].action_enum, "FZ_OBJT_MODEL_TYPE_FACT");
			break;
			
			case FZ_OBJT_MODEL_TYPE_SMOD 	: 	
				strcpy(notf_data[l_notf].action_desc, "Smooth");
				strcpy(notf_data[l_notf].action_enum, "FZ_OBJT_MODEL_TYPE_SMOD");
			break;

			default						:	
				strcat(notf_data[l_notf].action_desc, "None");
				strcat(notf_data[l_notf].action_enum, "None");					
			break;
		}
		strcpy(notf_data[l_notf].name,"");			
			
		notf_palette_regen();
	}
	return (FZRT_NOERR);
}

/************************************************************************
	OS notification callback
************************************************************************/
static fzrt_error_td notify_test_notf_os(
	void 			*event
	)
{
	if( notf_data_check_stack() == FZRT_NOERR )
	{
		notf_data[l_notf].type		= NOTF_PREF_MODEL_TYPE;
		strcpy(notf_data[l_notf].type_name,"OS");
		notf_data[l_notf].windex	= -1;
		strcpy(notf_data[l_notf].action_desc, "");
		strcpy(notf_data[l_notf].action_enum, "");
		strcpy(notf_data[l_notf].name,"");			
			
		notf_palette_regen();
	}
	return (FZRT_NOERR);
}


/************************************************************************
	Fill the notification function set with the callback functions.
*************************************************************************/
static fzrt_error_td notify_test_notf_get_callback_fset ( const fzpl_fset_def_ptr fset_def, fzpl_fset_td * const fset )
{
	fzrt_error_td						err = FZRT_NOERR;
	fz_notf_cbak_fset 				*notf_func;

	plugin_stuff.fsf->fzpl_fset_def_check ( fset_def, FZ_NOTF_CBAK_FSET_VERSION, FZPL_TYPE_STRING(fz_notf_cbak_fset), sizeof ( notf_func ), FZPL_VERSION_OP_NEWER );
	if ( err == FZRT_NOERR )
	{
		notf_func = (fz_notf_cbak_fset *)fset;
		
		notf_func->fz_notf_cbak_lite			= notify_test_notf_lite;
		notf_func->fz_notf_cbak_rmtl			= notify_test_notf_rmtl;
		notf_func->fz_notf_cbak_proj			= notify_test_notf_proj;
		notf_func->fz_notf_cbak_wind			= notify_test_notf_wind;
		notf_func->fz_notf_cbak_layr			= notify_test_notf_layr;
		notf_func->fz_notf_cbak_view			= notify_test_notf_view;
		notf_func->fz_notf_cbak_objt			= notify_test_notf_objt;
		notf_func->fz_notf_cbak_syst			= notify_test_notf_syst;
		notf_func->fz_notf_cbak_syst_units		= notify_test_notf_syst_units;
		notf_func->fz_notf_cbak_proj_units		= notify_test_notf_proj_units;
		notf_func->fz_notf_cbak_wind_units		= notify_test_notf_wind_units;
		notf_func->fz_notf_cbak_anim			= notify_test_notf_anim;
		notf_func->fz_notf_cbak_pref_default	= notify_test_notf_pref_default;
		notf_func->fz_notf_cbak_pref_model_type	= notify_test_notf_pref_model_type;
		notf_func->fz_notf_cbak_os				= notify_test_notf_os;

	}

	return err;
}

/************************************************************************
	Palette init callback
************************************************************************/
static fzrt_error_td notify_test_init(void)
{
	fzrt_int	i;
	
	plugin_stuff.fzrt_mem_funcs.fz_mem_zone_dynamic_init(&notf_mem_zone,sizeof(notf_data_td) * 10000);

	for(i = 0; i < NUM_NOTF; i++)
	{	notf_show[i] = 1;
	}
	return (FZRT_NOERR);
}

/************************************************************************
	Palette finit callback
************************************************************************/
static fzrt_error_td notify_test_finit(void)
{
	plugin_stuff.fzrt_mem_funcs.fz_mem_zone_finit(&notf_mem_zone);

	return (FZRT_NOERR);

}
/************************************************************************
	Palette name callback
************************************************************************/
static fzrt_error_td notify_test_palt_name( char *name, fzrt_int max_len )
{
	strncpy(name, "Notification Monitor", max_len);

	return (FZRT_NOERR);
}

/************************************************************************
	Palette uuid callback
************************************************************************/
static fzrt_error_td notify_test_palt_uuid(fzrt_UUID_td 	uuid)
{
	fzrt_error_td err = FZRT_NOERR;
	plugin_stuff.fzrt_base_funcs.fzrt_UUID_copy(NOTIFY_TEST_PALT_ID, uuid);

	return (err);
}

/************************************************************************
	Palette sizes
************************************************************************/
static fzrt_error_td notify_test_syst_size(
	fzrt_int	*def_width,	
	fzrt_int	*def_height,		
	fzrt_int	*min_width,		
	fzrt_int	*min_height,		
	fzrt_int	*max_width,		
	fzrt_int	*max_height				
	)
{
	/* default dimensions */
	if(def_width != NULL)*def_width = 300;
	if(def_height != NULL)*def_height = 300;

	/* min dimensions */
	if(min_width != NULL)*min_width = 100;
	if(min_height != NULL)*min_height = 100;

	/* max dimensions */
	if(max_width != NULL)*max_width = 700;
	if(max_height != NULL)*max_height = 900;
	
	return(FZRT_NOERR);
}
/************************************************************************
	Palette resize notification
************************************************************************/
static fzrt_error_td notify_test_syst_resize(
	fzrt_int	new_width,	
	fzrt_int	new_height		
	)
{
	printf("notify_test_syst_resize: new_width = %d new_height = %d\n", new_width, new_height);
	
	return(FZRT_NOERR);
}
/************************************************************************
	Palette visibility notification
************************************************************************/
static fzrt_error_td notify_test_syst_visible(
	fzrt_boolean	is_visible
	)
{
	printf("notify_test_syst_visible: fzrt_boolean = %d\n", (fzrt_int)is_visible);
	
	return(FZRT_NOERR);
}

/************************************************************************
	Palette callback assignment
************************************************************************/
static fzrt_error_td notify_test_palt_syst_get_callback_fset (const fzpl_fset_def_ptr fset_def, fzpl_fset_td * const fset)
{
	fzrt_error_td						err = FZRT_NOERR;
	fz_palt_cbak_syst_fset 			*palt_syst_fset;

	palt_syst_fset = (fz_palt_cbak_syst_fset *)fset;

	palt_syst_fset->fz_palt_cbak_syst_init			= notify_test_init;
	palt_syst_fset->fz_palt_cbak_syst_finit			= notify_test_finit;
	palt_syst_fset->fz_palt_cbak_syst_name			= notify_test_palt_name;
	palt_syst_fset->fz_palt_cbak_syst_uuid 			= notify_test_palt_uuid;
	palt_syst_fset->fz_palt_cbak_syst_iface_tmpl	= notify_test_fuim_dlog;

	palt_syst_fset->fz_palt_cbak_syst_size			= notify_test_syst_size;
	palt_syst_fset->fz_palt_cbak_syst_resize		= notify_test_syst_resize;
	palt_syst_fset->fz_palt_cbak_syst_visible		= notify_test_syst_visible;
	
	return (err);
}
/************************************************************************
	acquires all application provided service function sets.
*************************************************************************/
static fzrt_error_td notify_test_acquire_fsets ( void )
{
	fzrt_error_td err = FZRT_NOERR;

	
	if(err == FZRT_NOERR)
	{
		err = (*plugin_stuff.fsf->fzpl_fset_acquire) ( FZ_MATH_FSET_TYPE, FZ_MATH_FSET_VERSION, FZRT_UUID_NULL,
									 FZPL_TYPE_STRING(fz_math_fset), sizeof(plugin_stuff.math_funcs),
									 (fzpl_fset_td *)&plugin_stuff.math_funcs );
	}
	
	if(err == FZRT_NOERR)
	{
		err =(*plugin_stuff.fsf->fzpl_fset_acquire)(FZ_MODEL_FSET_TYPE, FZ_MODEL_FSET_VERSION, FZRT_UUID_NULL,
									 FZPL_TYPE_STRING(fz_model_fset), sizeof(plugin_stuff.model_funcs),
									(fzpl_fset_td *)&plugin_stuff.model_funcs);
	}

	if(err == FZRT_NOERR)
	{
		err = (*plugin_stuff.fsf->fzpl_fset_acquire) ( FZ_TYPE_FSET_TYPE, FZ_TYPE_FSET_VERSION, FZRT_UUID_NULL,
									 FZPL_TYPE_STRING(fz_type_fset), sizeof(plugin_stuff.type_funcs),
									 (fzpl_fset_td *)&plugin_stuff.type_funcs );
	}

	if(err == FZRT_NOERR)
	{
		err = (*plugin_stuff.fsf->fzpl_fset_acquire) ( FZ_LITE_FSET_TYPE, FZ_LITE_FSET_VERSION, FZRT_UUID_NULL,
									 FZPL_TYPE_STRING(fz_lite_fset), sizeof(plugin_stuff.lite_funcs),
									 (fzpl_fset_td *)&plugin_stuff.lite_funcs );
	}
	
	if(err == FZRT_NOERR)
	{
		err = (*plugin_stuff.fsf->fzpl_fset_acquire) ( FZ_RMTL_FSET_TYPE, FZ_RMTL_FSET_VERSION, FZRT_UUID_NULL,
									 FZPL_TYPE_STRING(fz_rmtl_fset), sizeof(plugin_stuff.rmtl_funcs),
									 (fzpl_fset_td *)&plugin_stuff.rmtl_funcs );
	}
	
	if(err == FZRT_NOERR)
	{
		err = (*plugin_stuff.fsf->fzpl_fset_acquire) ( FZ_LAYR_FSET_TYPE, FZ_LAYR_FSET_VERSION, FZRT_UUID_NULL,
									 FZPL_TYPE_STRING(fz_layr_fset), sizeof(plugin_stuff.layr_funcs),
									 (fzpl_fset_td *)&plugin_stuff.layr_funcs );
	}

	if(err == FZRT_NOERR)
	{
		err = (*plugin_stuff.fsf->fzpl_fset_acquire) ( FZ_FUIM_FSET_TYPE, FZ_FUIM_FSET_VERSION, FZRT_UUID_NULL,
									 FZPL_TYPE_STRING(fz_fuim_fset), sizeof(plugin_stuff.fuim_funcs),
									 (fzpl_fset_td *)&plugin_stuff.fuim_funcs );
	}
	
	if(err == FZRT_NOERR)
	{
		err = (*plugin_stuff.fsf->fzpl_fset_acquire) ( FZ_FZRT_BASE_FSET_TYPE, FZ_FZRT_BASE_FSET_VERSION, FZRT_UUID_NULL,
									 FZPL_TYPE_STRING(fz_fzrt_base_fset), sizeof(plugin_stuff.fzrt_base_funcs),
									 (fzpl_fset_td *)&plugin_stuff.fzrt_base_funcs );
	}

	if(err == FZRT_NOERR)
	{
		err = (*plugin_stuff.fsf->fzpl_fset_acquire) ( FZ_FZRT_MEM_FSET_TYPE, FZ_FZRT_MEM_FSET_VERSION, FZRT_UUID_NULL,
									 FZPL_TYPE_STRING(fz_fzrt_mem_fset), sizeof(plugin_stuff.fzrt_mem_funcs),
									 (fzpl_fset_td *)&plugin_stuff.fzrt_mem_funcs );
	}

	if(err == FZRT_NOERR)
	{
		err = (*plugin_stuff.fsf->fzpl_fset_acquire) ( FZ_FZRT_FILE_FSET_TYPE, FZ_FZRT_FILE_FSET_VERSION, FZRT_UUID_NULL,
									 FZPL_TYPE_STRING(fz_fzrt_file_fset), sizeof(plugin_stuff.fzrt_file_funcs),
									 (fzpl_fset_td *)&plugin_stuff.fzrt_file_funcs );
	}

	if(err == FZRT_NOERR)
	{
		err = (*plugin_stuff.fsf->fzpl_fset_acquire) ( FZ_FZRT_GRAF_FSET_TYPE, FZ_FZRT_GRAF_FSET_VERSION, FZRT_UUID_NULL,
									 FZPL_TYPE_STRING(fz_fzrt_graf_fset), sizeof(plugin_stuff.fzrt_graf_funcs),
									 (fzpl_fset_td *)&plugin_stuff.fzrt_graf_funcs );
	}
	
	if(err == FZRT_NOERR)
	{
		err = (*plugin_stuff.fsf->fzpl_fset_acquire) ( FZ_FZRT_UI_FSET_TYPE, FZ_FZRT_UI_FSET_VERSION, FZRT_UUID_NULL,
									 FZPL_TYPE_STRING(fz_fzrt_ui_fset), sizeof(plugin_stuff.fzrt_ui_funcs),
									 (fzpl_fset_td *)&plugin_stuff.fzrt_ui_funcs );
	}

	if(err == FZRT_NOERR)
	{
		err = (*plugin_stuff.fsf->fzpl_fset_acquire) ( FZ_FZRT_UTIL_FSET_TYPE, FZ_FZRT_UTIL_FSET_VERSION, FZRT_UUID_NULL,
									 FZPL_TYPE_STRING(fz_fzrt_util_fset), sizeof(plugin_stuff.fzrt_util_funcs),
									 (fzpl_fset_td *)&plugin_stuff.fzrt_util_funcs );
	}

	if(err == FZRT_NOERR)
	{
		err = (*plugin_stuff.fsf->fzpl_fset_acquire) ( FZ_IOST_FSET_TYPE, FZ_IOST_FSET_VERSION, FZRT_UUID_NULL,
									 FZPL_TYPE_STRING(fz_iost_fset), sizeof(fz_iost_fset),
									 (fzpl_fset_td *)&plugin_stuff.iost_funcs );
	}
	
	if(err == FZRT_NOERR)
	{
		err = (*plugin_stuff.fsf->fzpl_fset_acquire) ( FZ_VIEW_FSET_TYPE, FZ_VIEW_FSET_VERSION, FZRT_UUID_NULL,
									 FZPL_TYPE_STRING(fz_view_fset), sizeof(fz_view_fset),
									 (fzpl_fset_td *)&plugin_stuff.view_funcs );

	}
	if(err == FZRT_NOERR)
	{
		err = (*plugin_stuff.fsf->fzpl_fset_acquire) ( FZ_WIND_FSET_TYPE, FZ_WIND_FSET_VERSION, FZRT_UUID_NULL,
									 FZPL_TYPE_STRING(fz_wind_fset), sizeof(fz_wind_fset),
									 (fzpl_fset_td *)&plugin_stuff.wind_funcs );

	}
	if(err == FZRT_NOERR)
	{
		err =(*plugin_stuff.fsf->fzpl_fset_acquire)(FZ_OBJT_ATTR_FSET_TYPE, FZ_OBJT_ATTR_FSET_VERSION, FZRT_UUID_NULL,
									 FZPL_TYPE_STRING(fz_objt_attr_fset), sizeof(fz_objt_attr_fset),
									(fzpl_fset_td *)&plugin_stuff.obj_attr_funcs);
	}
	if(err == FZRT_NOERR)
	{
		err = (*plugin_stuff.fsf->fzpl_fset_acquire) ( FZ_PROJ_FSET_TYPE,  FZ_PROJ_FSET_VERSION, FZRT_UUID_NULL,
									 FZPL_TYPE_STRING(fz_proj_fset), sizeof(plugin_stuff.proj_funcs),
									 (fzpl_fset_td *)&plugin_stuff.proj_funcs );
	}
	return err;
}

/************************************************************************
	releases all application provided service function sets.
*************************************************************************/
static void notify_test_release_fsets ( void )
{
	(*plugin_stuff.fsf->fzpl_fset_release) ( (fzpl_fset_td *)&plugin_stuff.math_funcs );
	(*plugin_stuff.fsf->fzpl_fset_release) ( (fzpl_fset_td *)&plugin_stuff.model_funcs );
	(*plugin_stuff.fsf->fzpl_fset_release) ( (fzpl_fset_td *)&plugin_stuff.type_funcs );
	(*plugin_stuff.fsf->fzpl_fset_release) ( (fzpl_fset_td *)&plugin_stuff.fuim_funcs );
	(*plugin_stuff.fsf->fzpl_fset_release) ( (fzpl_fset_td *)&plugin_stuff.iost_funcs );
	(*plugin_stuff.fsf->fzpl_fset_release) ( (fzpl_fset_td *)&plugin_stuff.fzrt_base_funcs );
	(*plugin_stuff.fsf->fzpl_fset_release) ( (fzpl_fset_td *)&plugin_stuff.fzrt_mem_funcs );
	(*plugin_stuff.fsf->fzpl_fset_release) ( (fzpl_fset_td *)&plugin_stuff.fzrt_file_funcs );
	(*plugin_stuff.fsf->fzpl_fset_release) ( (fzpl_fset_td *)&plugin_stuff.fzrt_graf_funcs );
	(*plugin_stuff.fsf->fzpl_fset_release) ( (fzpl_fset_td *)&plugin_stuff.fzrt_ui_funcs );
	(*plugin_stuff.fsf->fzpl_fset_release) ( (fzpl_fset_td *)&plugin_stuff.view_funcs );
	(*plugin_stuff.fsf->fzpl_fset_release) ( (fzpl_fset_td *)&plugin_stuff.wind_funcs );
	(*plugin_stuff.fsf->fzpl_fset_release) ( (fzpl_fset_td *)&plugin_stuff.fzrt_util_funcs );
	(*plugin_stuff.fsf->fzpl_fset_release) ( (fzpl_fset_td *)&plugin_stuff.obj_attr_funcs );
	(*plugin_stuff.fsf->fzpl_fset_release) ( (fzpl_fset_td *)&plugin_stuff.lite_funcs );

}


/************************************************************************
	A first pass check to see if the plugin can be loaded.
	Checks licensing.
	Checks that application defined function sets which are
		needed by the plugins are available.
	Verifies that plugin and application are compatible.
	Verifies that plugin type is expected by application.
	Informs the application if this plugin is dependent on
		function sets from other plugins.
*************************************************************************/
static fzrt_error_td notify_test_check_config ( const fzpl_fset_glue_fset * const fsf, const fzpl_host_config_td * const hostConfig )
{
	fzrt_error_td					err = FZRT_NOERR;

	plugin_stuff.fsf = fsf;

	/*  Make sure required application defined function sets are available */
	/*  Release the function sets at unload. */
	err = notify_test_acquire_fsets();

	if ( err != FZRT_NOERR )
	{
		notify_test_release_fsets();
	}

	return err;
}


/************************************************************************
	Generates error strings for any errors created by the plugin
*************************************************************************/
static fzrt_boolean notify_test_error_str_func(fzrt_int err, char *str, short str_len)
{
	/* ADD ERROR STRINGS, IF ANY */
	
	return(FALSE);
}

/************************************************************************
	Registers plugins and their assocoated function sets.
*************************************************************************/
static fzrt_error_td notify_test_register_plugins ( const fzpl_fset_glue_fset * const fsf, const fzpl_host_config_td * const hostConfig )
{
	fzrt_error_td	err = FZRT_NOERR;

	/* REGISTER THE PLUGIN */
	err = (*fsf->fzpl_plugin_register)( NOTIFY_TEST_PALT_PLUGIN_ID, "Notification Monitor", NOTIFY_TEST_PALT_PLUGIN_VERSION,
						NOTIFY_TEST_PALT_PLUGIN_VENDOR,
						NOTIFY_TEST_PALT_PLUGIN_URL,
						FZ_PALT_EXTS_TYPE, FZ_PALT_EXTS_VERSION,
						notify_test_error_str_func, 0, NULL,
						&plugin_stuff.notify_test_tool_plugin_runtime_id);
	
	if ( err == FZRT_NOERR )
	{
		/* THE PALETTE FUNCTION SET */
		err = (*fsf->fzpl_plugin_add_fset)( plugin_stuff.notify_test_tool_plugin_runtime_id, FZ_PALT_CBAK_SYST_FSET_TYPE,
				  FZ_PALT_CBAK_SYST_FSET_VERSION, FZ_PALT_CBAK_SYST_FSET_NAME,
				  FZPL_TYPE_STRING(fz_palt_cbak_syst_fset), sizeof ( fz_palt_cbak_syst_fset ),
				  notify_test_palt_syst_get_callback_fset, FALSE);

		if ( err == FZRT_NOERR )
		{
			/* THE NOTIFICATION FUNCTION SET */
			err = (*fsf->fzpl_plugin_add_fset)( plugin_stuff.notify_test_tool_plugin_runtime_id, FZ_NOTF_CBAK_FSET_TYPE,
					  FZ_NOTF_CBAK_FSET_VERSION, FZ_NOTF_CBAK_FSET_NAME,
					  FZPL_TYPE_STRING(fz_notf_cbak_fset), sizeof ( fz_notf_cbak_fset ),
					  notify_test_notf_get_callback_fset, FALSE);
		}
	}

	if ( err != FZRT_NOERR )
	{	notify_test_release_fsets();
	}

	return err;
}

/************************************************************************
	Unregisters plugins.
*************************************************************************/
static fzrt_error_td notify_test_unregister_plugins ( const fzpl_fset_glue_fset * const fsf )
{
	fzrt_error_td					err = FZRT_NOERR;

	/* Unregister the plugins */
	err  = (*fsf->fzpl_plugin_unregister)( plugin_stuff.notify_test_tool_plugin_runtime_id );

	/* Release application implemented function sets */
	notify_test_release_fsets();

	return err;
}

/************************************************************************
	The main plugin file entry point.  Plugin initialization happens via this function.
*************************************************************************/
FZPL_PLUGIN_FUNC(fzrt_error_td) fz_plugin_entry( const fzpl_fset_glue_fset * const fsf, fzpl_command_td cmd, const fzpl_host_config_td * const hostConfig )
{
	fzrt_error_td err = FZRT_NOERR;
	
	
	switch ( cmd )
	{
		case FZPL_PLUGIN_CHECK:
			err = notify_test_check_config ( fsf, hostConfig );
		break;
			
		case FZPL_PLUGIN_INITIALIZE:
			err = notify_test_register_plugins ( fsf, hostConfig );
		break;
			
		case FZPL_PLUGIN_EXIT:
			err = notify_test_unregister_plugins ( fsf );
		break;
	}
	
	
	return ( err );
}

