/*
** Generated Code
*/

extern void rungrep ();
extern void setcommand ();
Widget mainshell = (Widget) NULL;
Widget command = (Widget) NULL;
Widget commandline = (Widget) NULL;
Widget pattern = (Widget) NULL;
Widget searchfiles = (Widget) NULL;
Widget hitstring = (Widget) NULL;
Widget ignore_case = (Widget) NULL;
Widget show_files = (Widget) NULL;
Widget show_lines = (Widget) NULL;
Widget invert = (Widget) NULL;
Widget count_lines = (Widget) NULL;
Widget show_block = (Widget) NULL;



void create_mainshell (display, app_name, app_argc, app_argv)
Display *display;
char *app_name;
int app_argc;
char **app_argv;
{
	Widget children[7];      /* Children to manage */
	Arg al[64];                    /* Arg List */
	register int ac = 0;           /* Arg Count */
	char from_s [256];             /* For resource conversion */
	XrmValue from_value, to_value; /* ditto */
	XtPointer tmp_value;             /* ditto */
	int fg, bg;                    /* colour values for pixmaps */ 
	XmString *list_items;          /* For list items */
	int list_item;                 /* Index for list_items */
	Atom *atom_list;               /* For Drop Site targets */
	XmString xmstrings[16];    /* temporary storage for XmStrings */
	Widget widget2 = (Widget)NULL;
	Widget widget5 = (Widget)NULL;
	Widget widget8 = (Widget)NULL;
	Widget widget9 = (Widget)NULL;
	Widget widget11 = (Widget)NULL;
	Widget widget13 = (Widget)NULL;
	Widget widget14 = (Widget)NULL;
	Widget widget18 = (Widget)NULL;
/* Pre-manage prelude for main dialog shell */
/* Define and initialise client data structure for setcommand calback */
static ccdata_t ccdata= {
	&searchfiles,
	&pattern,
	&ignore_case,
	&show_lines,
	&show_files,
	&invert,
	&count_lines,
	&show_block,
	&command
};

/* Define and initialise client data for the rungrep callback */
static rcdata_t rcdata = {
	&hitstring,
	&errorshell,
	&errorform,
	&errortext,
	&mainshell
};

/* End of shell pre-manage prelude */

	XtSetArg(al[ac], XmNallowShellResize, TRUE); ac++;
	XtSetArg(al[ac], XmNtitle, "greptool"); ac++;
	XtSetArg(al[ac], XmNargc, app_argc); ac++;
	XtSetArg(al[ac], XmNargv, app_argv); ac++;
	mainshell = XtAppCreateShell ( app_name, "greptool", applicationShellWidgetClass, display, al, ac );
	ac = 0;
	XtSetArg(al[ac], XmNwidth, 480); ac++;
	XtSetArg(al[ac], XmNtextColumns, 62); ac++;
	xmstrings[0] = XmStringCreateLtoR("/bin/grep", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG);
	XtSetArg(al[ac], XmNcommand, xmstrings[0]); ac++;
	command = XmCreateCommand ( mainshell, "command", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	widget5 = XmCommandGetChild ( command, XmDIALOG_LIST );
	commandline = XmCommandGetChild ( command, XmDIALOG_COMMAND_TEXT );
	widget2 = XtParent ( widget5 );

	XtSetArg(al[ac], XmNlistSpacing, 0); ac++;
	XtSetValues ( widget5,al, ac );
	ac = 0;
	XtSetArg(al[ac], XmNautoUnmanage, FALSE); ac++;
	widget8 = XmCreateForm ( command, "widget8", al, ac );
	ac = 0;
	xmstrings[0] = XmStringCreateLtoR("Search for", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG);
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	widget9 = XmCreateLabelGadget ( widget8, "widget9", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	pattern = XmCreateText ( widget8, "pattern", al, ac );
	xmstrings[0] = XmStringCreateLtoR("File filter", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG);
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	widget11 = XmCreateLabelGadget ( widget8, "widget11", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	searchfiles = XmCreateText ( widget8, "searchfiles", al, ac );
	xmstrings[0] = XmStringCreateLtoR("Hits", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG);
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	widget13 = XmCreateLabelGadget ( widget8, "widget13", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	XtSetArg(al[ac], XmNeditable, FALSE); ac++;
	XtSetArg(al[ac], XmNresizeWidth, TRUE); ac++;
	XtSetArg(al[ac], XmNeditMode, XmMULTI_LINE_EDIT); ac++;
	XtSetArg(al[ac], XmNrows, 16); ac++;
	hitstring = XmCreateScrolledText ( widget8, "hitstring", al, ac );
	ac = 0;
	widget14 = XtParent ( hitstring );

	widget18 = XmCreateRowColumn ( widget8, "widget18", al, ac );
	xmstrings[0] = XmStringCreateLtoR("Ignore case", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG);
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	ignore_case = XmCreateToggleButton ( widget18, "ignore_case", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	xmstrings[0] = XmStringCreateLtoR("Show file names", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG);
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	show_files = XmCreateToggleButton ( widget18, "show_files", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	xmstrings[0] = XmStringCreateLtoR("Show line numbers", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG);
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	show_lines = XmCreateToggleButton ( widget18, "show_lines", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	xmstrings[0] = XmStringCreateLtoR("Invert search", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG);
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	invert = XmCreateToggleButton ( widget18, "invert", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	xmstrings[0] = XmStringCreateLtoR("Count lines only", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG);
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	count_lines = XmCreateToggleButton ( widget18, "count_lines", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	xmstrings[0] = XmStringCreateLtoR("Show block numbers", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG);
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	show_block = XmCreateToggleButton ( widget18, "show_block", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	XtAddCallback (command, XmNcommandEnteredCallback, rungrep,&rcdata);

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetValues ( widget9,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNtopOffset, 10); ac++;
	XtSetArg(al[ac], XmNtopWidget, widget9); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNrightOffset, 20); ac++;
	XtSetArg(al[ac], XmNrightWidget, widget18); ac++;
	XtSetValues ( pattern,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNtopOffset, 20); ac++;
	XtSetArg(al[ac], XmNtopWidget, pattern); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetValues ( widget11,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNtopOffset, 10); ac++;
	XtSetArg(al[ac], XmNtopWidget, widget11); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNrightOffset, 20); ac++;
	XtSetArg(al[ac], XmNrightWidget, widget18); ac++;
	XtSetValues ( searchfiles,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNtopOffset, 20); ac++;
	XtSetArg(al[ac], XmNtopWidget, searchfiles); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetValues ( widget13,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNtopOffset, 20); ac++;
	XtSetArg(al[ac], XmNtopWidget, widget13); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, 0); ac++;
	XtSetValues ( widget14,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, 0); ac++;
	XtSetValues ( widget18,al, ac );
	ac = 0;
	XtAddCallback (pattern, XmNactivateCallback, setcommand,&ccdata);
	XtAddCallback (searchfiles, XmNactivateCallback, setcommand,&ccdata);
	XtManageChild(hitstring);
	XtAddCallback (ignore_case, XmNvalueChangedCallback, setcommand,&ccdata);
	XtAddCallback (show_files, XmNvalueChangedCallback, setcommand,&ccdata);
	XtAddCallback (show_lines, XmNvalueChangedCallback, setcommand,&ccdata);
	XtAddCallback (invert, XmNvalueChangedCallback, setcommand,&ccdata);
	XtAddCallback (count_lines, XmNvalueChangedCallback, setcommand,&ccdata);
	XtAddCallback (show_block, XmNvalueChangedCallback, setcommand,&ccdata);
	children[ac++] = ignore_case;
	children[ac++] = show_files;
	children[ac++] = show_lines;
	children[ac++] = invert;
	children[ac++] = count_lines;
	children[ac++] = show_block;
	XtManageChildren(children, ac);
	ac = 0;
	children[ac++] = widget9;
	children[ac++] = pattern;
	children[ac++] = widget11;
	children[ac++] = searchfiles;
	children[ac++] = widget13;
	children[ac++] = widget18;
	XtManageChildren(children, ac);
	ac = 0;
	children[ac++] = widget8;
	XtManageChildren(children, ac);
	ac = 0;
	XtManageChild ( command);
}

