 /*
  * Khoros: $Id$
  */

#if !defined(lint) && !defined(SABER)
static char rcsid[] = "Khoros: $Id$";
#endif

 /*
  * $Log$
  */

/*
 *---------------------------------------------------------------------
 *            Copyright 1990 University of New Mexico
 * 
 * Permission to copy and modify this software and its documen- 
 * tation only for internal use in your organization is hereby 
 * granted, provided that this notice is retained thereon and 
 * on all copies.  UNM makes no representations as too the sui- 
 * tability and operability of this software for any purpose. 
 * It is provided 'as is' without express or implied warranty. 
 *  
 * UNM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT- 
 * NESS.  IN NO EVENT SHALL UNM BE LIABLE FOR ANY SPECIAL, 
 * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY OTHER DAMAGES WHAT- 
 * SOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER 
 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 
 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PER- 
 * FORMANCE OF THIS SOFTWARE. 
 *  
 * No other rights, including for example, the right to redis- 
 * tribute this software and its documentation or the right to 
 * prepare derivative works, are granted unless specifically 
 * provided in a separate license agreement. 
 * 
 *---------------------------------------------------------------------
 */
#include "unmcopyright.h"
#include "xvforms.h"
#include "form_info.h"


/*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 >>>>
 >>>>         File Name:  form_init.c
 >>>>
 >>>>      Program Desc:  code to initialize fields
 >>>>                      in the structure found in form_info.h
 >>>>
 >>>>            Author:  automatically generated by conductor
 >>>>
 >>>> Date Last Updated:  Thu Oct 24 23:11:02 1991
 >>>>
 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/


_xvf_init_master(formptr,forminfo)

xvf_form *formptr; 
master *forminfo;
{
	int index;
	Line_Info line_info;
	char **database;

	xvf_clear_line_info(&line_info);
	database = formptr->db;

	/***** initializing 'master' Form Information structure *****/

	forminfo->image_workspace_index = 2;
	forminfo->quit = false;
	forminfo->files_subform = (master_files_subform *) 
			  malloc(sizeof(master_files_subform));


	index = 13;

	xvf_parse_startsubform_line(database[index], &line_info);
	forminfo->files_subform_selected = line_info.selected;
	forminfo->files_subform_index = 13;
	forminfo->files_subform_sfb_index = 3;

	/*** initializing 'forminfo->files_subform'
	      Subform Information structure ***/

	forminfo->files_subform->files = (files_subform_files *) 
			  malloc(sizeof(files_subform_files));


	index = 14;

	xvf_parse_startpane_line(database[index], &line_info);
	forminfo->files_subform->files_selected = line_info.selected;
	forminfo->files_subform->files_index = 14;
	forminfo->files_subform->files_gb_index = 0;
	index++;


	/* initializing 'forminfo->files_subform->files'
	       Pane Information structure */

	index++;

	xvf_parse_input_line(database[index], &line_info);
	if (line_info.file_def != NULL) {
	   forminfo->files_subform->files->in_image = 
		xvf_strcpy(line_info.file_def);
	}
	else  forminfo->files_subform->files->in_image = NULL;

	xvf_deparse_input_line(&line_info, database, index);
	forminfo->files_subform->files->in_image_index = index;
forminfo->files_subform->files->in_image_selected = false;
	index++;

	xvf_parse_output_line(database[index], &line_info);
	if (line_info.file_def != NULL) {
	   forminfo->files_subform->files->out_image = 
		xvf_strcpy(line_info.file_def);
	}
	else  forminfo->files_subform->files->out_image = NULL;

	xvf_deparse_output_line(&line_info, database,index);
	forminfo->files_subform->files->out_image_index = index;
forminfo->files_subform->files->out_image_selected = false;
	index++;

	index++;

	xvf_parse_input_line(database[index], &line_info);
	if (line_info.file_def != NULL) {
	   forminfo->files_subform->files->in_legend = 
		xvf_strcpy(line_info.file_def);
	}
	else  forminfo->files_subform->files->in_legend = NULL;

	xvf_deparse_input_line(&line_info, database, index);
	forminfo->files_subform->files->in_legend_index = index;
forminfo->files_subform->files->in_legend_selected = false;
	index++;

	xvf_parse_output_line(database[index], &line_info);
	if (line_info.file_def != NULL) {
	   forminfo->files_subform->files->out_legend = 
		xvf_strcpy(line_info.file_def);
	}
	else  forminfo->files_subform->files->out_legend = NULL;

	xvf_deparse_output_line(&line_info, database,index);
	forminfo->files_subform->files->out_legend_index = index;
forminfo->files_subform->files->out_legend_selected = false;
	index++;

	index++;

	xvf_parse_output_line(database[index], &line_info);
	if (line_info.file_def != NULL) {
	   forminfo->files_subform->files->out_image_cmap = 
		xvf_strcpy(line_info.file_def);
	}
	else  forminfo->files_subform->files->out_image_cmap = NULL;

	xvf_deparse_output_line(&line_info, database,index);
	forminfo->files_subform->files->out_image_cmap_index = index;
forminfo->files_subform->files->out_image_cmap_selected = false;
	index++;

	xvf_parse_output_line(database[index], &line_info);
	if (line_info.file_def != NULL) {
	   forminfo->files_subform->files->out_cmap = 
		xvf_strcpy(line_info.file_def);
	}
	else  forminfo->files_subform->files->out_cmap = NULL;

	xvf_deparse_output_line(&line_info, database,index);
	forminfo->files_subform->files->out_cmap_index = index;
forminfo->files_subform->files->out_cmap_selected = false;
	index++;

	index++;

	forminfo->files_subform->files->quit = false;
	index++;

	forminfo->disp_subform = (master_disp_subform *) 
			  malloc(sizeof(master_disp_subform));


	index = 28;

	xvf_parse_startsubform_line(database[index], &line_info);
	forminfo->disp_subform_selected = line_info.selected;
	forminfo->disp_subform_index = 28;
	forminfo->disp_subform_sfb_index = 4;

	/*** initializing 'forminfo->disp_subform'
	      Subform Information structure ***/

	forminfo->disp_subform->disp = (disp_subform_disp *) 
			  malloc(sizeof(disp_subform_disp));


	index = 29;

	xvf_parse_startpane_line(database[index], &line_info);
	forminfo->disp_subform->disp_selected = line_info.selected;
	forminfo->disp_subform->disp_index = 29;
	forminfo->disp_subform->disp_gb_index = 0;
	index++;


	/* initializing 'forminfo->disp_subform->disp'
	       Pane Information structure */

	xvf_parse_cycle_line(database[index], &line_info);
	forminfo->disp_subform->disp->norm_type = line_info.cycle_val;
	xvf_deparse_cycle_line(&line_info, database,index);
	forminfo->disp_subform->disp->norm_type_index = index;
	forminfo->disp_subform->disp->norm_type_selected = false;
	index++;

	xvf_parse_logic_line(database[index], &line_info);
	forminfo->disp_subform->disp->norm_time = line_info.logical_def;
	line_info.logical_val = line_info.logical_def;
	xvf_deparse_logic_line(&line_info, database,index);
	forminfo->disp_subform->disp->norm_time_index = index;
forminfo->disp_subform->disp->norm_time_selected = false;
	index++;

	xvf_parse_logic_line(database[index], &line_info);
	forminfo->disp_subform->disp->norm_method = line_info.logical_def;
	line_info.logical_val = line_info.logical_def;
	xvf_deparse_logic_line(&line_info, database,index);
	forminfo->disp_subform->disp->norm_method_index = index;
forminfo->disp_subform->disp->norm_method_selected = false;
	index++;

	index++;

	forminfo->disp_subform->disp->red = false;
	forminfo->disp_subform->disp->red_index = index;
	index++;

	index++;

	forminfo->disp_subform->disp->green = false;
	forminfo->disp_subform->disp->green_index = index;
	index++;

	index++;

	forminfo->disp_subform->disp->blue = false;
	forminfo->disp_subform->disp->blue_index = index;
	index++;

	index++;

	index++;

	xvf_parse_string_line(database[index], &line_info);
	if (line_info.string_def != NULL) {
	   forminfo->disp_subform->disp->red_func = 
		xvf_strcpy(line_info.string_def);
	}
	else  forminfo->disp_subform->disp->red_func = NULL;

	xvf_deparse_string_line(&line_info, database,index);
	forminfo->disp_subform->disp->red_func_index = index;
forminfo->disp_subform->disp->red_func_selected = false;
	index++;

	xvf_parse_string_line(database[index], &line_info);
	if (line_info.string_def != NULL) {
	   forminfo->disp_subform->disp->green_func = 
		xvf_strcpy(line_info.string_def);
	}
	else  forminfo->disp_subform->disp->green_func = NULL;

	xvf_deparse_string_line(&line_info, database,index);
	forminfo->disp_subform->disp->green_func_index = index;
forminfo->disp_subform->disp->green_func_selected = false;
	index++;

	xvf_parse_string_line(database[index], &line_info);
	if (line_info.string_def != NULL) {
	   forminfo->disp_subform->disp->blue_func = 
		xvf_strcpy(line_info.string_def);
	}
	else  forminfo->disp_subform->disp->blue_func = NULL;

	xvf_deparse_string_line(&line_info, database,index);
	forminfo->disp_subform->disp->blue_func_index = index;
forminfo->disp_subform->disp->blue_func_selected = false;
	index++;

	xvf_parse_input_line(database[index], &line_info);
	if (line_info.file_def != NULL) {
	   forminfo->disp_subform->disp->file_view = 
		xvf_strcpy(line_info.file_def);
	}
	else  forminfo->disp_subform->disp->file_view = NULL;

	xvf_deparse_input_line(&line_info, database, index);
	forminfo->disp_subform->disp->file_view_index = index;
forminfo->disp_subform->disp->file_view_selected = false;
	index++;

	index++;

	forminfo->disp_subform->disp->quit = false;
	index++;

	forminfo->class_subform = (master_class_subform *) 
			  malloc(sizeof(master_class_subform));


	index = 49;

	xvf_parse_startsubform_line(database[index], &line_info);
	forminfo->class_subform_selected = line_info.selected;
	forminfo->class_subform_index = 49;
	forminfo->class_subform_sfb_index = 5;

	/*** initializing 'forminfo->class_subform'
	      Subform Information structure ***/

	forminfo->class_subform->class = (class_subform_class *) 
			  malloc(sizeof(class_subform_class));


	index = 50;

	xvf_parse_startpane_line(database[index], &line_info);
	forminfo->class_subform->class_selected = line_info.selected;
	forminfo->class_subform->class_index = 50;
	forminfo->class_subform->class_gb_index = 0;
	index++;


	/* initializing 'forminfo->class_subform->class'
	       Pane Information structure */

	if (!(xvf_create_subform(formptr->db, formptr, formptr->subform->next_subform->next_subform->next_subform, true)))
	   return(false);
	_xvf_get_class_subform(formptr, forminfo->class_subform);
	_xvf_get_class_subform(formptr, forminfo->class_subform);
	_xvf_get_class(formptr, forminfo->class_subform->class);
	forminfo->class_subform->class->class_workspace_index = 51;
	index++;

	index++;

	forminfo->class_subform->class->quit = false;
	index++;

	forminfo->legend_subform = (master_legend_subform *) 
			  malloc(sizeof(master_legend_subform));


	index = 56;

	xvf_parse_startsubform_line(database[index], &line_info);
	forminfo->legend_subform_selected = line_info.selected;
	forminfo->legend_subform_index = 56;
	forminfo->legend_subform_sfb_index = 6;

	/*** initializing 'forminfo->legend_subform'
	      Subform Information structure ***/

	forminfo->legend_subform->legend = (legend_subform_legend *) 
			  malloc(sizeof(legend_subform_legend));


	index = 57;

	xvf_parse_startpane_line(database[index], &line_info);
	forminfo->legend_subform->legend_selected = line_info.selected;
	forminfo->legend_subform->legend_index = 57;
	forminfo->legend_subform->legend_gb_index = 0;
	index++;


	/* initializing 'forminfo->legend_subform->legend'
	       Pane Information structure */

	xvf_parse_toggle_line(database[index], &line_info);
	forminfo->legend_subform->legend->color_model_val = line_info.toggle_def;
	line_info.toggle_val = line_info.toggle_def;
	xvf_deparse_toggle_line(&line_info, database,index);
	forminfo->legend_subform->legend->color_model_index = index;
forminfo->legend_subform->legend->color_model_selected = false;
	index++;

	index = 65;
	forminfo->legend_subform->legend->delete = false;
	forminfo->legend_subform->legend->delete_index = index;
	index++;

	forminfo->legend_subform->legend->empty = false;
	forminfo->legend_subform->legend->empty_index = index;
	index++;

	forminfo->legend_subform->legend->show = false;
	forminfo->legend_subform->legend->show_index = index;
	index++;

	forminfo->legend_subform->legend->hide = false;
	forminfo->legend_subform->legend->hide_index = index;
	index++;

	forminfo->legend_subform->legend->catch_all = false;
	forminfo->legend_subform->legend->catch_all_index = index;
	index++;

	forminfo->legend_subform->legend->transfer = false;
	forminfo->legend_subform->legend->transfer_index = index;
	index++;

	if (!(xvf_create_subform(formptr->db, formptr, formptr->subform->next_subform->next_subform->next_subform->next_subform, true)))
	   return(false);
	_xvf_get_legend_subform(formptr, forminfo->legend_subform);
	_xvf_get_legend_subform(formptr, forminfo->legend_subform);
	_xvf_get_legend(formptr, forminfo->legend_subform->legend);
	forminfo->legend_subform->legend->legend_workspace_index = 71;
	index++;

	index++;

	forminfo->legend_subform->legend->quit = false;
	index++;

	forminfo->zoom_subform = (master_zoom_subform *) 
			  malloc(sizeof(master_zoom_subform));


	index = 76;

	xvf_parse_startsubform_line(database[index], &line_info);
	forminfo->zoom_subform_selected = line_info.selected;
	forminfo->zoom_subform_index = 76;
	forminfo->zoom_subform_sfb_index = 7;

	/*** initializing 'forminfo->zoom_subform'
	      Subform Information structure ***/

	forminfo->zoom_subform->zoom = (zoom_subform_zoom *) 
			  malloc(sizeof(zoom_subform_zoom));


	index = 77;

	xvf_parse_startpane_line(database[index], &line_info);
	forminfo->zoom_subform->zoom_selected = line_info.selected;
	forminfo->zoom_subform->zoom_index = 77;
	forminfo->zoom_subform->zoom_gb_index = 0;
	index++;


	/* initializing 'forminfo->zoom_subform->zoom'
	       Pane Information structure */

	xvf_parse_float_line(database[index], &line_info);
	forminfo->zoom_subform->zoom->zoomfactor = line_info.float_def;
	line_info.float_val = line_info.float_def;
	xvf_deparse_float_line(&line_info, database,index);
	forminfo->zoom_subform->zoom->zoomfactor_index = index;
forminfo->zoom_subform->zoom->zoomfactor_selected = false;
	index++;

	forminfo->zoom_subform->zoom->do_zoom = false;
	forminfo->zoom_subform->zoom->do_zoom_index = index;
	index++;

	if (!(xvf_create_subform(formptr->db, formptr, formptr->subform->next_subform->next_subform->next_subform->next_subform->next_subform, true)))
	   return(false);
	_xvf_get_zoom_subform(formptr, forminfo->zoom_subform);
	_xvf_get_zoom_subform(formptr, forminfo->zoom_subform);
	_xvf_get_zoom(formptr, forminfo->zoom_subform->zoom);
	forminfo->zoom_subform->zoom->zoom_workspace_index = 80;
	index++;

	index++;

	forminfo->zoom_subform->zoom->quit = false;
	index++;

	forminfo->scatter_plot = (master_scatter_plot *) 
			  malloc(sizeof(master_scatter_plot));


	index = 85;

	xvf_parse_startsubform_line(database[index], &line_info);
	forminfo->scatter_plot_selected = line_info.selected;
	forminfo->scatter_plot_index = 85;
	forminfo->scatter_plot_sfb_index = 8;

	/*** initializing 'forminfo->scatter_plot'
	      Subform Information structure ***/

	forminfo->scatter_plot->scatter = (scatter_plot_scatter *) 
			  malloc(sizeof(scatter_plot_scatter));


	index = 86;

	xvf_parse_startpane_line(database[index], &line_info);
	forminfo->scatter_plot->scatter_selected = line_info.selected;
	forminfo->scatter_plot->scatter_index = 86;
	forminfo->scatter_plot->scatter_gb_index = 0;
	index++;


	/* initializing 'forminfo->scatter_plot->scatter'
	       Pane Information structure */

	forminfo->scatter_plot->scatter->x_column = false;
	forminfo->scatter_plot->scatter->x_column_index = index;
	index++;

	index++;

	forminfo->scatter_plot->scatter->y_column = false;
	forminfo->scatter_plot->scatter->y_column_index = index;
	index++;

	index++;

	xvf_parse_string_line(database[index], &line_info);
	if (line_info.string_def != NULL) {
	   forminfo->scatter_plot->scatter->x_func = 
		xvf_strcpy(line_info.string_def);
	}
	else  forminfo->scatter_plot->scatter->x_func = NULL;

	xvf_deparse_string_line(&line_info, database,index);
	forminfo->scatter_plot->scatter->x_func_index = index;
forminfo->scatter_plot->scatter->x_func_selected = false;
	index++;

	xvf_parse_string_line(database[index], &line_info);
	if (line_info.string_def != NULL) {
	   forminfo->scatter_plot->scatter->y_func = 
		xvf_strcpy(line_info.string_def);
	}
	else  forminfo->scatter_plot->scatter->y_func = NULL;

	xvf_deparse_string_line(&line_info, database,index);
	forminfo->scatter_plot->scatter->y_func_index = index;
forminfo->scatter_plot->scatter->y_func_selected = false;
	index++;

	xvf_parse_logic_line(database[index], &line_info);
	forminfo->scatter_plot->scatter->prop = line_info.logical_def;
	line_info.logical_val = line_info.logical_def;
	xvf_deparse_logic_line(&line_info, database,index);
	forminfo->scatter_plot->scatter->prop_index = index;
forminfo->scatter_plot->scatter->prop_selected = false;
	index++;

	xvf_parse_logic_line(database[index], &line_info);
	forminfo->scatter_plot->scatter->operation = line_info.logical_def;
	line_info.logical_val = line_info.logical_def;
	xvf_deparse_logic_line(&line_info, database,index);
	forminfo->scatter_plot->scatter->operation_index = index;
forminfo->scatter_plot->scatter->operation_selected = false;
	index++;

	xvf_parse_float_line(database[index], &line_info);
	forminfo->scatter_plot->scatter->zoomfactor = line_info.float_def;
	line_info.float_val = line_info.float_def;
	xvf_deparse_float_line(&line_info, database,index);
	forminfo->scatter_plot->scatter->zoomfactor_index = index;
forminfo->scatter_plot->scatter->zoomfactor_selected = false;
	index++;

	forminfo->scatter_plot->scatter->select = false;
	forminfo->scatter_plot->scatter->select_index = index;
	index++;

	index++;

	forminfo->scatter_plot->scatter->set = false;
	forminfo->scatter_plot->scatter->set_index = index;
	index++;

	if (!(xvf_create_subform(formptr->db, formptr, formptr->subform->next_subform->next_subform->next_subform->next_subform->next_subform->next_subform, true)))
	   return(false);
	_xvf_get_scatter_plot(formptr, forminfo->scatter_plot);
	_xvf_get_scatter_plot(formptr, forminfo->scatter_plot);
	_xvf_get_scatter(formptr, forminfo->scatter_plot->scatter);
	forminfo->scatter_plot->scatter->plot_workspace_index = 99;
	index++;

	index++;

	forminfo->scatter_plot->scatter->quit = false;
	index++;

	_xvf_get_master(formptr, forminfo);
	return(true);

}

