#if ( !defined(lint) && !defined(SABER))
  static char rcsid_module_c[] = "$Header: main.c,v 1.1 88/08/26 12:46:26 kit Exp $";
  static char rcs_version[] = "$Athena: main.c,v 1.1 88/08/26 12:46:26 kit Exp $";
#endif

/*
 *  This is the file main.c for xvdp.  It created all the buttons
 *  for player display.
 *
 *  Created:    8/25/88
 *  By:         Chris D. Peterson 
 *
 *  
 *
 *      $Source: /u1/Video/tools/Xvdp/RCS/main.c,v $
 *      $Author: kit $
 *      $Header: main.c,v 1.1 88/08/26 12:46:26 kit Exp $
 *	
 *  	Copyright 1988 by the Massachusetts Institute of Technology.
 *
 *	For further information on copyright and distribution 
 *	see the file mit-copyright.h
 */

#include "mit-copyright.h"

#include <stdio.h>
#include <X11/Xos.h>
#include <X11/Intrinsic.h>

#include "xvdp.h"

Widget InitWorld();
void StartDriver(), ChangeLabel();

/*	Function Name: main
 *	Description: main driver.
 *	Arguments:   argc, argv - standard arguments.
 *	Returns:  none.
 */

void
main(argc, argv)
int argc;
char ** argv;
{
  XtRealizeWidget(InitWorld(&argc, argv));
  ChangeLabel("Normal Startup - Ready");
  XtMainLoop();
}

/*    Function Name: PrintError
 *    Description: This Function prints an error message and exits.
 *    Arguments: string - the specific message.
 *    Returns: none. - exits tho.
 */

void
PrintError(string)
char * string;
{
  fprintf(stderr,"xvdp error: %s\n",string);

  exit(42);
}

/*    Function Name: PrintWarning
 *    Description: This function prints a warning message to stderr.
 *    Arguments: string - the specific warning string.
 *    Returns: none
 */

void
PrintWarning(string)
char * string;
{
  fprintf(stderr,"xvdp warning: %s\n",string);
}

/*	Function Name: ArgError
 *	Description: prints sytax info on argument error.
 *	Arguments: argc, argv
 *	Returns: none.
 */

void
ArgError(argc, argv)
int argc;
char ** argv;
{
  int i;
  char * prog;

  static char **syntax, *syntax_def[] = {
  "-baud",                   "The baud rate.",
  "-tty",                    "The tty to connect the disk player too.",
  "-model",                  "Model of disk player.",
  "-geometery <geom>",       "Specifies the geometry of the window.",
  "=<geom>",                 "Specifies the geometry of the window.",
  "-bw <pixels>",            "Width of all window borders.",
  "-borderwidth <pixels>",   "Width of all window borders.",
  "-bd <color>",             "Color of all window borders.",
  "-bordercolor <color>",    "Color of all window borders.",
  "-fg <color>",             "Foreground color for the application.",
  "-foreground <color>",     "Foreground color for the application.",
  "-bg <color>",             "Background color for the application.",
  "-background <color>",     "Background color for the application.",
  "-display <display name>", "Specify a display that is not the default",
  "-fn <font>",              "Font to be used for button and label text.",
  "-font <font>",            "Font to be used for button and label text.",
  "-name <name>",            "Change the name used for retrieving resources.",
  "-title <name>",           "Change the name without affecting resources.",
  "-xrm <resource>",         "Specifies a resource on the command line.",
  NULL, NULL,
  };
  
  syntax = syntax_def;

  for (i = 1; i < argc ; i++) 
    (void) printf("This argument is unknown to %s: %s\n", argv[0], argv[i]);
  
  if ( (prog = rindex(argv[0], '/')) == NULL)
    prog = argv[0];

  (void) printf("\nKnown arguments are:\n");

  while ( *syntax != NULL ) {
    printf("%-20s - %s\n", syntax[0], syntax[1]);
    syntax += 2;
  }

  printf("\nKnown model types are: DEC_VDP50, SONY_LDP1000A, PANA_OMDR\n");
  printf("\nThere are also 'baud', 'tty', and 'model' Xresources.\n");
}
