 /*
  * Khoros: $Id: form_init.c,v 1.2 1991/10/01 23:17:25 khoros Exp $
  */

#if !defined(lint) && !defined(SABER)
static char rcsid[] = "Khoros: $Id: form_init.c,v 1.2 1991/10/01 23:17:25 khoros Exp $";
#endif

 /*
  * $Log: form_init.c,v $
 * Revision 1.2  1991/10/01  23:17:25  khoros
 * HellPatch2
 *
  */

/*
 *---------------------------------------------------------------------
 *            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:  Wed Sep 25 14:09:19 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->sub = (master_sub *) 
			  malloc(sizeof(master_sub));


	index = 1;

	xvf_parse_startsubform_line(database[index], &line_info);
	forminfo->sub_selected = line_info.selected;
	forminfo->sub_index = 1;
	forminfo->sub_sfb_index = 0;

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

	forminfo->sub->pane = (sub_pane *) 
			  malloc(sizeof(sub_pane));


	index = 2;

	xvf_parse_startpane_line(database[index], &line_info);
	forminfo->sub->pane_selected = line_info.selected;
	forminfo->sub->pane_index = 2;
	forminfo->sub->pane_gb_index = 0;
	index++;


	/* initializing 'forminfo->sub->pane'
	       Pane Information structure */

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

	xvf_deparse_input_line(&line_info, database, index);
	forminfo->sub->pane->i_index = index;
forminfo->sub->pane->i_selected = false;
forminfo->sub->pane->i_selected = true;
	index++;

	if (!(xvf_create_subform(formptr->db, formptr, formptr->subform, true)))
	   return(false);
	_xvf_get_sub(formptr, forminfo->sub);
	_xvf_get_sub(formptr, forminfo->sub);
	_xvf_get_pane(formptr, forminfo->sub->pane);
	forminfo->sub->pane->canvas_index = 4;
	index++;

	index++;

	forminfo->sub->pane->quit = false;
	index++;

	return(true);

}

