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

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

 /*
  * $Log: form_info.c,v $
 * Revision 1.2  1991/10/01  23:17:16  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_info.c
 >>>>
 >>>>      Program Desc:  code to extract values
 >>>>                     from the graphical user interface 
 >>>>
 >>>>            Author:  automatically generated by conductor
 >>>>
 >>>> Date Last Updated:  Wed Sep 25 14:09:20 1991
 >>>>
 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/


/********************************************************
*
*  Routine Name: xvf_get_master
*
*       Purpose: Fills in the user-specified
*                'master'
*                 structure according to the info currently
*                stored in the database by xvforms.
*
*        Input:  formptr - pointer to the xvf_form structure
*                forminfo - pointer to the user-specified
*                'master'
*
*       Output:  current values stored in  master
*
*    Called By:  the application program when appropriate
*
*   Automatically Generated By:  conductor*
********************************************************/


_xvf_get_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;

	/***** getting 'master' Form Information structure *****/


	index = 1;

	xvf_parse_startsubform_line(database[index], &line_info);
	forminfo->sub_selected = line_info.selected;
	_xvf_get_sub(formptr, forminfo->sub);

}

/********************************************************
*
*  Routine Name: xvf_get_sub
*
*       Purpose: Fills in the user-specified
*                'master_sub'
*                 structure according to the info currently
*                stored in the database by xvforms.
*
*        Input:  formptr - pointer to the xvf_form structure
*                subforminfo - pointer to the user-specified
*                'master_sub'
*
*       Output:  current values stored in  'master_sub'
*
*    Called By:  xvf_get_*
*   Automatically Generated By:  conductor*
********************************************************/


_xvf_get_sub(formptr, subforminfo)

xvf_form *formptr;
master_sub *subforminfo;
{
	int index;
	Line_Info line_info;
	char **database;

	xvf_clear_line_info(&line_info);

	database = formptr->db;
	index = 2;


	/*** extracting 'master->sub'
 	   Subform Information structure ***/


	index = 2;
	xvf_parse_startpane_line(database[index], &line_info);
	subforminfo->pane_selected = line_info.selected;
	_xvf_get_pane(formptr, subforminfo->pane);

}



/********************************************************
*
*  Routine Name: xvf_get_pane
*
*       Purpose: Fills in the user-specified
*                'sub_pane'
*                 structure according to the info currently
*                stored in the database by xvforms.
*
*        Input:  formptr - pointer to the xvf_form structure
*                paneinfo - pointer to the user-specified
*                'sub_pane'
*
*       Output:  current values stored in  'sub_pane'
*
*    Called By:  xvf_get_sub
*

*   Automatically Generated By:  conductor*
********************************************************/


_xvf_get_pane(formptr, paneinfo)

xvf_form *formptr;
sub_pane *paneinfo;
{
	int index;
	Line_Info line_info;
	char **database;

	xvf_clear_line_info(&line_info);

	database = formptr->db;
	index = 3;


	/* extracting 'master->sub->pane'
 	   Pane Information structure */

	xvf_parse_input_line(database[index], &line_info);
	if (line_info.filename != NULL) {
	   paneinfo->i = 
		xvf_strcpy(line_info.filename);
	}
	else  paneinfo->i = NULL;

	paneinfo->i_selected = line_info.opt_sel;
	index++;

	xvf_parse_workspace_line(database[index], &line_info);
	paneinfo->canvas = line_info.workspace;
	index++;

	index++;

	xvf_parse_quit_line(database[index], &line_info);
	paneinfo->quit = line_info.selected;
	index++;



}


