/*
* Copyright (C) 2001-2008, CompHEP Collaboration
* Copyright (C) 2000, Alexander Pukhov 
* ------------------------------------------------------
* $Id: lbl.c,v 1.14 2004/05/25 10:46:13 kryukov Exp $
*
* $Log: lbl.c,v $
* Revision 1.14  2004/05/25 10:46:13  kryukov
* Remove bug of reduce prog. generator.
*
* Revision 1.13  2004/05/10 16:10:46  kryukov
* Join with 4.4.2
*
* Revision 1.12  2004/05/10 12:48:26  kryukov
* This version is equal to 4.4.1
*
* Revision 1.11.2.1  2004/04/30 15:08:36  sherstnv
* Old changes, included detween v_4_4_0 and tarball (comphep-4.4.0.tgz)
* from the CompHEP homepage.
*
* Revision 1.11  2003/11/09 16:08:11  kryukov
* New version: 4.4.0
*
* Revision 1.10  2003/11/06 22:31:37  sherstnv
* Current CompHEP version is 4.2.2
*
* Revision 1.9  2003/09/29 13:55:44  sherstnv
* New help files for the beam and strfun tables are added
*
* Revision 1.8  2003/07/11 20:41:04  kryukov
* Change title screen
*
* Revision 1.7  2003/07/01 14:30:46  kryukov
* *** empty log message ***
*
* Revision 1.6  2003/06/25 18:46:41  kryukov
* *** empty log message ***
*
* Revision 1.5  2003/06/24 12:06:33  kryukov
* 4.2.0rc5
*
* Revision 1.4  2003/06/19 07:06:38  kryukov
* Move global variable 'version' from file.c to lbl.c
*
* Revision 1.3  2003/04/22 09:01:20  kryukov
* Apply indent to improve readability of files
*
* Revision 1.2  2003/04/19 18:52:26  kryukov
* Set version to 4.2.0rc1
*
*/
#include <string.h>
#include <stdio.h>
#include <stdarg.h>

#include "chep_limits.h"
#include "chep_crt/include/chep_crt.h"

#include "unix_utils.h"
#include "syst.h"
#include "s_files.h"
#include "files.h"
#include "lbl.h"

static shortstr chepversion;
static shortstr chepname;

char * version (void) {
return chepversion;
}

void setversion (shortstr ver) {
  strcpy (chepversion, ver);
}

char * getname (void) {
  sprintf(chepname, "CompHEP version %s   ", chepversion);
  return chepname;
}

void 
cheplabel (void)
{
  int key;
  char fname[STRSIZ];
  FILE *f;

  while (1)
    {
      goto_xy (20, 2);
      print ("Skobeltsyn Institute of Nuclear Physics");
      goto_xy (28, 3);
      print ("Moscow State University");

      goto_xy (28, 5);
      print ("%s", getname ());
      goto_xy (17, 6);
/*      print ("(Version based on the code of comphep-4.1.10)");*/

      goto_xy (15, 7);
      print ("a package for computation in high energy physics");
/*
      scrcolor (Blue, LightGray);
      goto_xy (20, 8);
      print ("Preliminary release. Do not distribute it.");
*/
      scrcolor (FGmain, BGmain);
      goto_xy (16, 10);
      print ("Copyright (C) 2001-2008, CompHEP Collaboration:");
      goto_xy (15, 11);
      print ("E.Boos, V.Bunichev, M.Dubinin, L.Dudko, V.Edneral");
      goto_xy (15, 12);
      print ("V.Ilyin, A.Kryukov, V.Savrin, A.Sherstnev, A.Semenov");

      goto_xy (25, 14);
      print ("According to the license agreement");
      goto_xy (15, 15);
      print ("publications which result from using the program should");
      goto_xy (15, 16);
      print ("contain a reference to the article describing CompHEP.");

      goto_xy (25, 17);
      print ("Click the field below to get");
      chepbox (19, 18, 39, 20);
      chepbox (41, 18, 61, 20);
      scrcolor (Blue, LightGray);
      goto_xy (21, 19);
      print ("License Agreement");
      goto_xy (46, 19);
      print ("References");
      scrcolor (Black, LightGray);

      goto_xy (1, 22);
      print ("For contacts:");
      goto_xy (1, 23);
      print ("Alexander Kryukov<kryukov@theory.sinp.msu.ru>");

      goto_xy (47, 22);
      print ("Home page:");
      goto_xy (47, 23);
      print ("http://comphep.sinp.msu.ru");

      clearTypeAhead ();
      key = inkey ();
      if (key == KB_MOUSE && mouse_info.row == 19 &&
          mouse_info.col > 19 && mouse_info.col < 61)
        {
          if (mouse_info.col < 39)
            {
              sprintf (fname, "%s%cLicence.txt", pathtocomphep, f_slash);
              f = fopen (fname, "r");
              showtext (5, 1, 75, 1, "", f);
              fclose (f);
            }
          else if (mouse_info.col > 41)
            {
              sprintf (fname, "%s%cReference.txt", pathtocomphep, f_slash);
              f = fopen (fname, "r");
              showtext (5, 1, 75, 1, "", f);
              fclose (f);
            }
          else
            break;
        }
      else
        break;
    }
  clr_scr (FGmain, BGmain);
}
