/* Y o u r   D e s c r i p t i o n                       */
/*                            AppBuilder Photon Code Lib */
/*                                         Version 2.01  */

/* Standard headers */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>

/* Local headers */
#include "ablibs.h"
#include "abimport.h"
#include "proto.h"


char *server_path = "/opt/Mozilla/mozilla/mozserver.sh -nMozillaServer";
char *ServerName = "MozillaServer";
char *url = "http://www.mozilla.org";

int
setup( PtWidget_t *link_instance, ApInfo_t *apinfo, PtCallbackInfo_t *cbinfo )
	{
	PtArg_t args[5];

	if( apinfo->reason == ABR_PRE_REALIZE ) {

		PtSetArg( &args[0], Pt_ARG_CLIENT_NAME, ServerName, 0 );
		PtSetResources( ABW_web_client, 1, args );

		PtSetArg( &args[0], Pt_ARG_CLIENT_NAME, 0, 0 );
		PtGetResources( ABW_web_client, 1, args );

		if ( args[0].value == 0 ) {
			PtSetArg( &args[0], Pt_ARG_WEB_SERVER, server_path, 0);
			PtSetResources( ABW_web_client, 1, args );
			}

		PtSetArg( &args[0], Pt_ARG_WEB_OPTION, "0", "iUserTextSize" ); 
		PtSetResources( ABW_web_client, 1, args );
		}
	else {
		PtSetArg( &args[0], Pt_ARG_WEB_GET_URL, url, WWW_ACTION_DISPLAY );
		PtSetResources( ABW_web_client, 1, args );
		}

	return( Pt_CONTINUE );
	}
