[comp.windows.x] Tgif-1.11

william@oahu.cs.ucla.edu (William Cheng) (07/31/90)

I've just put tgif-1.11 in the following places for anonymous ftp:

	expo.lcs.mit.edu	contrib/tgif-1.11.tar.Z
	rye.cs.ucla.edu		pub/tgif-1.11.tar.Z

Here's a short list of added features/bug fixes.

1) Fix bugs reported by Christos Zoulas regarding prtgif bounding box.
   Text objects was generating wrong boudning boxes.
2) When text objects are saved, its bounding boxes are also saved now.
   This fixes the problem in 1).  File version is bumped to 7!
3) Fix bugs in select.c (change calls to DelObj () to FreeObj ()).
   This caused segmentation faults when tgif is dbx-ed, it caused
   XError when not dbx-ed.
4) Prtgif is cleaned up to share functions with the tgif code.  (Turned
   out to be a lot of changes.)
5) Add double-clicking in selecting file names.  New Xdefaults
   Tgif*DoubleClickInterval (in milli-seconds) is added.

The following is the patch to take tgif from version 1.10 to 1.11.
---------------------------------> cut here <---------------------------------
*** attr.c.orig	Mon Jul 30 17:33:39 1990
--- attr.c	Mon Jul 30 17:33:41 1990
***************
*** 6,10 ****
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/attr.c,v 1.5 90/07/18 14:46:27 william Exp $";
  #endif
  
--- 6,10 ----
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/attr.c,v 1.6 90/07/30 11:09:21 william Exp $";
  #endif
  
***************
*** 496,502 ****
  }
  
! int ReadAttr (FP, AttrPtr)
     FILE			* FP;
     struct AttrRec	* * AttrPtr;
  {
     struct ObjRec	* TextObj;
--- 496,503 ----
  }
  
! int ReadAttr (FP, AttrPtr, PRTGIF)
     FILE			* FP;
     struct AttrRec	* * AttrPtr;
+    int			PRTGIF;
  {
     struct ObjRec	* TextObj;
***************
*** 533,537 ****
     (*AttrPtr)->inherited = inherited;
  
!    ReadObj (FP, &TextObj);
     TextObj->detail.t->attr = *AttrPtr;
     (*AttrPtr)->obj = TextObj;
--- 534,538 ----
     (*AttrPtr)->inherited = inherited;
  
!    ReadObj (FP, &TextObj, PRTGIF);
     TextObj->detail.t->attr = *AttrPtr;
     (*AttrPtr)->obj = TextObj;
*** drawing.c.orig	Mon Jul 30 17:33:53 1990
--- drawing.c	Mon Jul 30 17:33:55 1990
***************
*** 6,10 ****
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/drawing.c,v 1.7 90/07/16 10:41:06 william Exp $";
  #endif
  
--- 6,10 ----
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/drawing.c,v 1.8 90/07/29 15:34:38 william Exp $";
  #endif
  
***************
*** 471,475 ****
              case '\016': /*^N*/ NewProc (); break;
              case '\017': /*^O*/ OpenProc (); break;
!             case '\020': /*^P*/ Dump (); break;
              case '\021': /*^Q*/ return (QuitProc ());
              case '\022': /*^R*/ ClearAndRedrawDrawWindow (); break;
--- 471,475 ----
              case '\016': /*^N*/ NewProc (); break;
              case '\017': /*^O*/ OpenProc (); break;
!             case '\020': /*^P*/ Dump (FALSE, ""); break;
              case '\021': /*^Q*/ return (QuitProc ());
              case '\022': /*^R*/ ClearAndRedrawDrawWindow (); break;
*** file.c.orig	Mon Jul 30 17:34:17 1990
--- file.c	Mon Jul 30 17:34:20 1990
***************
*** 6,10 ****
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/file.c,v 1.25 90/07/18 16:46:33 william Exp $";
  #endif
  
--- 6,10 ----
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/file.c,v 1.28 90/07/30 16:08:30 william Exp $";
  #endif
  
***************
*** 32,40 ****
  #include "msg.e"
  #include "names.e"
  #include "poly.e"
  #include "polygon.e"
  #include "obj.e"
  #include "oval.e"
- #include "pattern.e"
  #include "rect.e"
  #include "ruler.e"
--- 32,41 ----
  #include "msg.e"
  #include "names.e"
+ #include "pattern.e"
  #include "poly.e"
  #include "polygon.e"
+ #include "prtgif.e"
  #include "obj.e"
  #include "oval.e"
  #include "rect.e"
  #include "ruler.e"
***************
*** 45,49 ****
  #include "text.e"
  
! #define CUR_VERSION 6
  
  char	curFileName[MAXPATHLENGTH];
--- 46,50 ----
  #include "text.e"
  
! #define CUR_VERSION 7
  
  char	curFileName[MAXPATHLENGTH];
***************
*** 358,363 ****
  }
  
! void ReadState (Inbuf)
     char	* Inbuf;
  {
     char	* s;
--- 359,365 ----
  }
  
! void ReadState (Inbuf, PRTGIF)
     char	* Inbuf;
+    int	PRTGIF;
  {
     char	* s;
***************
*** 372,375 ****
--- 374,379 ----
        sscanf (s, "%d", &fileVersion);
  
+    if (PRTGIF) return;
+ 
     if (!importingFile)
     {
***************
*** 422,428 ****
  }
  
! int ReadObj (FP, ObjPtr)
     FILE			* FP;
     struct ObjRec	* * ObjPtr;
  {
     char			inbuf[MAXSTRING+1], obj_name[10], tmp_str[MAXSTRING+1];
--- 426,433 ----
  }
  
! int ReadObj (FP, ObjPtr, PRTGIF)
     FILE			* FP;
     struct ObjRec	* * ObjPtr;
+    int			PRTGIF;
  {
     char			inbuf[MAXSTRING+1], obj_name[10], tmp_str[MAXSTRING+1];
***************
*** 478,482 ****
           ReadPolyObj (line, ObjPtr);
           if (fileVersion != INVALID)
!             while (ReadAttr (FP, &attr_ptr))
              {
                 attr_ptr->owner = *ObjPtr;
--- 483,487 ----
           ReadPolyObj (line, ObjPtr);
           if (fileVersion != INVALID)
!             while (ReadAttr (FP, &attr_ptr, PRTGIF))
              {
                 attr_ptr->owner = *ObjPtr;
***************
*** 510,514 ****
        else if (strcmp (obj_name, "text") == 0)
        {
!          ReadTextObj (FP, line, ObjPtr);
           if (allocated) cfree (line);
           return (TRUE);
--- 515,519 ----
        else if (strcmp (obj_name, "text") == 0)
        {
!          ReadTextObj (FP, line, ObjPtr, PRTGIF);
           if (allocated) cfree (line);
           return (TRUE);
***************
*** 522,528 ****
        else if (strcmp (obj_name, "group") == 0)
        {
!          ReadGroupObj (FP, ObjPtr);
           if (fileVersion != INVALID)
!             while (ReadAttr (FP, &attr_ptr))
              {
                 attr_ptr->owner = *ObjPtr;
--- 527,533 ----
        else if (strcmp (obj_name, "group") == 0)
        {
!          ReadGroupObj (FP, ObjPtr, PRTGIF);
           if (fileVersion != INVALID)
!             while (ReadAttr (FP, &attr_ptr, PRTGIF))
              {
                 attr_ptr->owner = *ObjPtr;
***************
*** 544,551 ****
        else if (strcmp (obj_name, "sym") == 0)
        {
!          ReadGroupObj (FP, ObjPtr);
           (*ObjPtr)->type = OBJ_SYM;
           if (fileVersion != INVALID)
!             while (ReadAttr (FP, &attr_ptr))
              {
                 attr_ptr->owner = *ObjPtr;
--- 549,556 ----
        else if (strcmp (obj_name, "sym") == 0)
        {
!          ReadGroupObj (FP, ObjPtr, PRTGIF);
           (*ObjPtr)->type = OBJ_SYM;
           if (fileVersion != INVALID)
!             while (ReadAttr (FP, &attr_ptr, PRTGIF))
              {
                 attr_ptr->owner = *ObjPtr;
***************
*** 567,571 ****
        else if (strcmp (obj_name, "icon") == 0)
        {
!          ReadGroupObj (FP, ObjPtr);
           (*ObjPtr)->type = OBJ_ICON;
           if (fgets (line, MAXSTRING, FP) == NULL)
--- 572,576 ----
        else if (strcmp (obj_name, "icon") == 0)
        {
!          ReadGroupObj (FP, ObjPtr, PRTGIF);
           (*ObjPtr)->type = OBJ_ICON;
           if (fgets (line, MAXSTRING, FP) == NULL)
***************
*** 588,592 ****
           strcpy ((*ObjPtr)->detail.r->s, tmp_str);
           if (fileVersion != INVALID)
!             while (ReadAttr (FP, &attr_ptr))
              {
                 attr_ptr->owner = *ObjPtr;
--- 593,597 ----
           strcpy ((*ObjPtr)->detail.r->s, tmp_str);
           if (fileVersion != INVALID)
!             while (ReadAttr (FP, &attr_ptr, PRTGIF))
              {
                 attr_ptr->owner = *ObjPtr;
***************
*** 608,612 ****
        else if (strcmp (obj_name, "state") == 0)
        {
!          ReadState (line);
           *ObjPtr = NULL;
           if (allocated) cfree (line);
--- 613,617 ----
        else if (strcmp (obj_name, "state") == 0)
        {
!          ReadState (line, PRTGIF);
           *ObjPtr = NULL;
           if (allocated) cfree (line);
***************
*** 692,696 ****
     Msg (s);
  
!    while (ReadObj (fp, &obj_ptr))
        if (obj_ptr != NULL)
           AddObj (NULL, topObj, obj_ptr);
--- 697,701 ----
     Msg (s);
  
!    while (ReadObj (fp, &obj_ptr, FALSE))
        if (obj_ptr != NULL)
           AddObj (NULL, topObj, obj_ptr);
***************
*** 747,751 ****
     XClearWindow (mainDisplay, drawWindow);
  
!    while (ReadObj (fp, &obj_ptr))
        if (obj_ptr != NULL)
        {
--- 752,756 ----
     XClearWindow (mainDisplay, drawWindow);
  
!    while (ReadObj (fp, &obj_ptr, FALSE))
        if (obj_ptr != NULL)
        {
***************
*** 794,809 ****
  }
  
! void DumpAttrs (FP, AttrPtr)
     FILE				* FP;
     register struct AttrRec	* AttrPtr;
  {
     for ( ; AttrPtr != NULL; AttrPtr = AttrPtr->prev)
        if (AttrPtr->shown)
!          DumpTextObj (FP, AttrPtr->obj);
  }
  
! void DumpAllObj (FP, ObjPtr)
     FILE				* FP;
     register struct ObjRec	* ObjPtr;
  {
     register struct ObjRec	* obj_ptr;
--- 799,816 ----
  }
  
! void DumpAttrs (FP, AttrPtr, PRTGIF)
     FILE				* FP;
     register struct AttrRec	* AttrPtr;
+    int				PRTGIF;
  {
     for ( ; AttrPtr != NULL; AttrPtr = AttrPtr->prev)
        if (AttrPtr->shown)
!          DumpTextObj (FP, AttrPtr->obj, PRTGIF);
  }
  
! void DumpAllObj (FP, ObjPtr, PRTGIF)
     FILE				* FP;
     register struct ObjRec	* ObjPtr;
+    int				PRTGIF;
  {
     register struct ObjRec	* obj_ptr;
***************
*** 813,821 ****
        case OBJ_POLY:
           DumpPolyObj (FP, ObjPtr);
!          DumpAttrs (FP, ObjPtr->detail.p->lattr);
           break;
        case OBJ_BOX: DumpBoxObj (FP, ObjPtr); break;
        case OBJ_OVAL: DumpOvalObj (FP, ObjPtr); break;
!       case OBJ_TEXT: DumpTextObj (FP, ObjPtr); break;
        case OBJ_POLYGON: DumpPolygonObj (FP, ObjPtr); break;
        case OBJ_SYM:
--- 820,828 ----
        case OBJ_POLY:
           DumpPolyObj (FP, ObjPtr);
!          DumpAttrs (FP, ObjPtr->detail.p->lattr, PRTGIF);
           break;
        case OBJ_BOX: DumpBoxObj (FP, ObjPtr); break;
        case OBJ_OVAL: DumpOvalObj (FP, ObjPtr); break;
!       case OBJ_TEXT: DumpTextObj (FP, ObjPtr, PRTGIF); break;
        case OBJ_POLYGON: DumpPolygonObj (FP, ObjPtr); break;
        case OBJ_SYM:
***************
*** 824,829 ****
           obj_ptr = ObjPtr->detail.r->last;
           for ( ; obj_ptr != NULL; obj_ptr = obj_ptr->prev)
!             DumpAllObj (FP, obj_ptr);
!          DumpAttrs (FP, ObjPtr->detail.r->lattr);
           if (ObjPtr->type == OBJ_SYM) DumpSymOutline (FP, ObjPtr);
           break;
--- 831,836 ----
           obj_ptr = ObjPtr->detail.r->last;
           for ( ; obj_ptr != NULL; obj_ptr = obj_ptr->prev)
!             DumpAllObj (FP, obj_ptr, PRTGIF);
!          DumpAttrs (FP, ObjPtr->detail.r->lattr, PRTGIF);
           if (ObjPtr->type == OBJ_SYM) DumpSymOutline (FP, ObjPtr);
           break;
***************
*** 875,879 ****
  }
  
! void Dump ()
  {
     register struct ObjRec	* obj_ptr;
--- 882,888 ----
  }
  
! void Dump (PRTGIF, FileName)
!    int	PRTGIF;
!    char	* FileName;
  {
     register struct ObjRec	* obj_ptr;
***************
*** 886,890 ****
     if (botObj == NULL) { Msg ("No object to print."); return; }
  
!    Msg ("Generating print file ...");
     strcpy (tmp_file, "/tmp/TgifXXXXXX");
     mktemp (tmp_file);
--- 895,900 ----
     if (botObj == NULL) { Msg ("No object to print."); return; }
  
!    if (!PRTGIF) Msg ("Generating print file ...");
! 
     strcpy (tmp_file, "/tmp/TgifXXXXXX");
     mktemp (tmp_file);
***************
*** 893,901 ****
     if ((fp = fopen (tmp_file, "w")) == NULL)
     {
!       sprintf (tmp_str, "Can not create %s, print aborted.", tmp_file);
!       Msg (tmp_str);
        return;
     }
  
     fprintf (fp, "%%!\n");
     DumpBBox (fp);
--- 903,918 ----
     if ((fp = fopen (tmp_file, "w")) == NULL)
     {
!       if (PRTGIF)
!          printf ("Can not create $s, print aborted.", tmp_file);
!       else
!       {
!          sprintf (tmp_str, "Can not create %s, print aborted.", tmp_file);
!          Msg (tmp_str);
!       }
        return;
     }
  
+    if (PRTGIF) printf ("Writing to %s ...\n", tmp_file);
+ 
     fprintf (fp, "%%!\n");
     DumpBBox (fp);
***************
*** 903,908 ****
     if ((fps = fopen (ps_file, "r")) == NULL) 
     {
!       sprintf (message, "Can not find %s, print aborted.", ps_file);
!       Msg (message);
        fclose (fp);
        unlink (tmp_file);
--- 920,930 ----
     if ((fps = fopen (ps_file, "r")) == NULL) 
     {
!       if (PRTGIF)
!          printf ("Can not find %s, print aborted.\n", ps_file);
!       else
!       {
!          sprintf (message, "Can not find %s, print aborted.", ps_file);
!          Msg (message);
!       }
        fclose (fp);
        unlink (tmp_file);
***************
*** 925,929 ****
  
     for (obj_ptr = botObj; obj_ptr != NULL; obj_ptr = obj_ptr->prev)
!       DumpAllObj (fp, obj_ptr);
  
     fprintf (fp, "grestore\n\n");
--- 947,951 ----
  
     for (obj_ptr = botObj; obj_ptr != NULL; obj_ptr = obj_ptr->prev)
!       DumpAllObj (fp, obj_ptr, PRTGIF);
  
     fprintf (fp, "grestore\n\n");
***************
*** 934,953 ****
     {
        case PRINTER:
!          if ((c_ptr = XGetDefault (mainDisplay,"Tgif","PrintCommand")) != NULL)
           {
!             sprintf (cmd, "%s %s 2>&1", c_ptr, tmp_file);
!             sprintf (message, "Printing with '%s' command.", c_ptr);
           }
           else
           {
!             sprintf (cmd, "lpr %s 2>&1", tmp_file);
!             sprintf (message, "Printing with 'lpr' command.");
           }
-          Msg (message);
  
           if ((fp = popen (cmd, "r")) == NULL)
           {
!             sprintf (message, "Can not execute '%s', print aborted.", cmd);
!             Msg (message);
              unlink (tmp_file);
              return;
--- 956,991 ----
     {
        case PRINTER:
!          if (PRTGIF)
           {
!             if (lastFile)
!                sprintf (cmd, "lpr %s 2>&1", tmp_file);
!             else
!                sprintf (cmd, "lpr -h %s 2>&1", tmp_file);
           }
           else
           {
!             if ((c_ptr = XGetDefault (mainDisplay,"Tgif","PrintCommand")) !=
!                   NULL)
!             {
!                sprintf (cmd, "%s %s 2>&1", c_ptr, tmp_file);
!                sprintf (message, "Printing with '%s' command.", c_ptr);
!             }
!             else
!             {
!                sprintf (cmd, "lpr %s 2>&1", tmp_file);
!                sprintf (message, "Printing with 'lpr' command.");
!             }
!             Msg (message);
           }
  
           if ((fp = popen (cmd, "r")) == NULL)
           {
!             if (PRTGIF)
!                printf ("Can not execute '%s', print aborted.\n", cmd);
!             else
!             {
!                sprintf (message, "Can not execute '%s', print aborted.", cmd);
!                Msg (message);
!             }
              unlink (tmp_file);
              return;
***************
*** 955,985 ****
           while (fgets (tmp_str, MAXSTRING, fp) != NULL)
           {
!             Msg (tmp_str);
              sleep (5);
           }
!          pclose (fp);
           break;
        case LATEX_FIG:
!          if (!curFileDefined)
           {
!             Dialog ("No current file.  Can not generate LaTeX output!", cmd);
!             unlink (tmp_file);
!             return;
           }
  
-          strcpy (ps_file, curDomainName);
-          if (*curDomainName != '\0') strcat (ps_file, "/");
-          strcat (ps_file, curFileName);
-          len = strlen (ps_file);
-          for (i = len-1; ps_file[i] != '.'; i--) ;
-          strcpy (&ps_file[i], ".ps");
-          sprintf (cmd, "Printing into '%s'.", ps_file);
-          Msg (cmd);
           sprintf (cmd, "tgif2ps < %s 1> %s 2>&1; chmod %s %s", tmp_file,
                 ps_file, PSFILE_MOD, ps_file);
           if ((fp = popen (cmd, "r")) == NULL)
           {
!             sprintf (message, "Can not execute '%s', file not saved.", cmd);
!             Msg (message);
              unlink (tmp_file);
              return;
--- 993,1038 ----
           while (fgets (tmp_str, MAXSTRING, fp) != NULL)
           {
!             if (PRTGIF)
!                printf ("%s", tmp_str);
!             else
!                Msg (tmp_str);
              sleep (5);
           }
!          if (PRTGIF) printf ("%s printed.\n\n", tmp_file);
           break;
        case LATEX_FIG:
!          if (PRTGIF)
!             sprintf (ps_file, "%s.ps", FileName);
!          else
           {
!             if (!curFileDefined)
!             {
!                Dialog ("No current file.  Can not generate LaTeX output!", cmd);
!                unlink (tmp_file);
!                return;
!             }
! 
!             strcpy (ps_file, curDomainName);
!             if (*curDomainName != '\0') strcat (ps_file, "/");
!             strcat (ps_file, curFileName);
!             len = strlen (ps_file);
!             for (i = len-1; ps_file[i] != '.'; i--) ;
!             strcpy (&ps_file[i], ".ps");
!             sprintf (cmd, "Printing into '%s'.", ps_file);
!             Msg (cmd);
           }
  
           sprintf (cmd, "tgif2ps < %s 1> %s 2>&1; chmod %s %s", tmp_file,
                 ps_file, PSFILE_MOD, ps_file);
+ 
           if ((fp = popen (cmd, "r")) == NULL)
           {
!             if (PRTGIF)
!                printf ("Can not execute '%s', print aborted.\n", cmd);
!             else
!             {
!                sprintf (message, "Can not execute '%s', file not saved.", cmd);
!                Msg (message);
!             }
              unlink (tmp_file);
              return;
***************
*** 987,996 ****
           while (fgets(tmp_str, MAXSTRING, fp) != NULL)
           {
!             Msg (tmp_str);
              sleep (5);
           }
!          pclose (fp);
           break;
     }
     unlink (tmp_file);
  }
--- 1040,1059 ----
           while (fgets(tmp_str, MAXSTRING, fp) != NULL)
           {
!             if (PRTGIF)
!                printf ("%s", tmp_str);
!             else
!                Msg (tmp_str);
              sleep (5);
           }
!          if (PRTGIF)
!             printf ("LaTeX figure printed into '%s'.\n\n", ps_file);
!          else
!          {
!             sprintf (message, "LaTeX figure printed into '%s'.\n\n", ps_file);
!             Msg (message);
!          }
           break;
     }
+    pclose (fp);
     unlink (tmp_file);
  }
***************
*** 1149,1153 ****
        case FILE_IMPORT: ImportFile (); break;
        case FILE_DOMAIN: ChangeDomain (); break;
!       case FILE_DUMP: Dump (); break;
        case FILE_SOLVE: return (SolveProc ()); break;
        case FILE_SIMULATE: return (SimulateProc ()); break;
--- 1212,1216 ----
        case FILE_IMPORT: ImportFile (); break;
        case FILE_DOMAIN: ChangeDomain (); break;
!       case FILE_DUMP: Dump (FALSE, ""); break;
        case FILE_SOLVE: return (SolveProc ()); break;
        case FILE_SIMULATE: return (SimulateProc ()); break;
***************
*** 1169,1172 ****
--- 1232,1240 ----
  {
     if (exitNormally) return;
+ 
+    signal (SIGHUP, SIG_DFL);
+    signal (SIGFPE, SIG_DFL);
+    signal (SIGBUS, SIG_DFL);
+    signal (SIGSEGV, SIG_DFL);
  
     switch (SaveTmpFile ("EmergencySave"))
*** font.c.orig	Mon Jul 30 17:34:33 1990
--- font.c	Mon Jul 30 17:34:35 1990
***************
*** 6,10 ****
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/font.c,v 1.4 90/07/16 09:04:29 william Exp $";
  #endif
  
--- 6,10 ----
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/font.c,v 1.5 90/07/30 15:54:02 william Exp $";
  #endif
  
*** group.c.orig	Mon Jul 30 17:34:41 1990
--- group.c	Mon Jul 30 17:34:42 1990
***************
*** 6,10 ****
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/group.c,v 1.2 90/06/26 00:05:45 william Exp $";
  #endif
  
--- 6,10 ----
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/group.c,v 1.3 90/07/30 11:10:25 william Exp $";
  #endif
  
***************
*** 86,92 ****
  }
  
! void ReadGroupObj (FP, ObjPtr)
     FILE			* FP;
     struct ObjRec	* * ObjPtr;
  {
     struct GroupRec	* group_ptr;
--- 86,93 ----
  }
  
! void ReadGroupObj (FP, ObjPtr, PRTGIF)
     FILE			* FP;
     struct ObjRec	* * ObjPtr;
+    int			PRTGIF;
  {
     struct GroupRec	* group_ptr;
***************
*** 97,101 ****
     * ObjPtr = (struct ObjRec *) calloc (1, sizeof(struct ObjRec));
  
!    while (ReadObj (FP, &obj_ptr))
     {
        obj_ptr->next = top_obj;
--- 98,102 ----
     * ObjPtr = (struct ObjRec *) calloc (1, sizeof(struct ObjRec));
  
!    while (ReadObj (FP, &obj_ptr, PRTGIF))
     {
        obj_ptr->next = top_obj;
*** mainloop.c.orig	Mon Jul 30 17:34:49 1990
--- mainloop.c	Mon Jul 30 17:34:51 1990
***************
*** 6,10 ****
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/mainloop.c,v 1.11 90/07/18 16:20:39 william Exp $";
  #endif
  
--- 6,10 ----
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/mainloop.c,v 1.12 90/07/30 11:01:17 william Exp $";
  #endif
  
***************
*** 168,172 ****
        rootWindow = RootWindow (mainDisplay, mainScreen);
  
! /*    XSetErrorHandler (MyErrorHandler); */
        XSetIOErrorHandler (EmergencySave);
        signal (SIGHUP, EmergencySave);
--- 168,172 ----
        rootWindow = RootWindow (mainDisplay, mainScreen);
  
!       XSetErrorHandler (EmergencySave);
        XSetIOErrorHandler (EmergencySave);
        signal (SIGHUP, EmergencySave);
***************
*** 192,196 ****
              Msg (s);
  
!             while (ReadObj (fp, &obj_ptr))
                 if (obj_ptr != NULL)
                    AddObj (NULL, topObj, obj_ptr);
--- 192,196 ----
              Msg (s);
  
!             while (ReadObj (fp, &obj_ptr, FALSE))
                 if (obj_ptr != NULL)
                    AddObj (NULL, topObj, obj_ptr);
*** menu.c.orig	Mon Jul 30 17:35:03 1990
--- menu.c	Mon Jul 30 17:35:04 1990
***************
*** 6,10 ****
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/menu.c,v 1.10 90/06/25 23:58:20 william Exp $";
  #endif
  
--- 6,10 ----
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/menu.c,v 1.11 90/07/30 11:00:59 william Exp $";
  #endif
  
***************
*** 525,529 ****
  
     importingFile = TRUE; /* ignore the 'state' predicate */
!    while (ReadObj (fp, &obj_ptr))
        if (obj_ptr != NULL)
        {
--- 525,529 ----
  
     importingFile = TRUE; /* ignore the 'state' predicate */
!    while (ReadObj (fp, &obj_ptr, FALSE))
        if (obj_ptr != NULL)
        {
*** names.c.orig	Mon Jul 30 17:35:16 1990
--- names.c	Mon Jul 30 17:35:18 1990
***************
*** 6,10 ****
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/names.c,v 1.5 90/07/16 08:58:26 william Exp $";
  #endif
  
--- 6,10 ----
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/names.c,v 1.6 90/07/27 14:39:29 william Exp $";
  #endif
  
***************
*** 50,53 ****
--- 50,55 ----
  static int	nameScrollAreaH;	/* heighr of the grey scroll area */
  
+ static int	doubleClickInterval;
+ 
  static GC	nameGC;
  static GC	revNameGC;
***************
*** 55,58 ****
--- 57,61 ----
  void InitNames ()
  {
+    char		* c_ptr;
     XGCValues	values;
  
***************
*** 76,79 ****
--- 79,88 ----
  
     *curDomainName = '\0';
+ 
+    if ((c_ptr = XGetDefault (mainDisplay, TOOL_NAME, "DoubleClickInterval")) !=
+          NULL)
+       doubleClickInterval = atoi (c_ptr);
+    else
+       doubleClickInterval = 300;
  }
  
***************
*** 281,289 ****
  }
  
  static
! void NameDspHandler (button_ev)
     XButtonEvent	* button_ev;
  {
!    int		row_offset, len, top;
  
     top = defaultFontAsc+1;
--- 290,303 ----
  }
  
+ static Time	lastClickTime;
+ static int	justClicked;
+ static int	lastNameMarked;
+ 
  static
! int NameDspHandler (button_ev)
     XButtonEvent	* button_ev;
  {
!    int	row_offset, len, top;
!    Time	click_time;
  
     top = defaultFontAsc+1;
***************
*** 290,294 ****
  
     row_offset = (int)(button_ev->y / ROW_HEIGHT);
-    if (nameMarked != INVALID && nameMarked == row_offset+nameFirst) return;
  
     if (nameMarked != INVALID &&
--- 304,307 ----
***************
*** 315,318 ****
--- 328,341 ----
              nameDspPtr[nameMarked], len);
     }
+ 
+    click_time = button_ev->time;
+    if (justClicked && nameMarked != INVALID && lastNameMarked == nameMarked &&
+          (click_time-lastClickTime) < doubleClickInterval)
+       return (TRUE);
+ 
+    justClicked = TRUE;
+    lastClickTime = click_time;
+    lastNameMarked = nameMarked;
+    return (INVALID);
  }
  
***************
*** 396,399 ****
--- 419,423 ----
           KeyPressMask | ButtonPressMask | ExposureMask);
  
+    justClicked = FALSE;
     while (looping)
     {
***************
*** 475,479 ****
              NameScrollHandler (button_ev);
           else if (button_ev->window == nameDspWin)
!             NameDspHandler (button_ev);
        }
     }
--- 499,509 ----
              NameScrollHandler (button_ev);
           else if (button_ev->window == nameDspWin)
!          {
!             if (NameDspHandler (button_ev) != INVALID)
!             {
!                looping = FALSE;
!                index = nameMarked;
!             }
!          }
        }
     }
*** prtgif.c.orig	Mon Jul 30 17:35:32 1990
--- prtgif.c	Mon Jul 30 17:35:33 1990
***************
*** 6,10 ****
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/prtgif.c,v 1.11 90/07/18 15:36:26 william Exp $";
  #endif
  
--- 6,10 ----
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/prtgif.c,v 1.14 90/07/30 11:02:37 william Exp $";
  #endif
  
***************
*** 14,39 ****
  #include "types.h"
  
- #include "attr.e"
- #include "box.e"
  #include "file.e"
- #include "font.e"
  #include "grid.e"
- #include "group.e"
  #include "obj.e"
- #include "oval.e"
- #include "pattern.e"
- #include "poly.e"
- #include "polygon.e"
  #include "setup.e"
- #include "text.e"
  
  extern char	* getenv ();
  /* extern int	malloc_debug (); */
- extern int	PDrawReadObj ();
  
! static int	lastFile = TRUE;
  
! static char	drawPath[MAXSTRING];
! static short	pDrawCursorH[] =
  {
     9,  11, 13, 14, 19, 26,
--- 14,30 ----
  #include "types.h"
  
  #include "file.e"
  #include "grid.e"
  #include "obj.e"
  #include "setup.e"
  
+ #define PRTGIF (TRUE)
+ 
  extern char	* getenv ();
  /* extern int	malloc_debug (); */
  
! int	lastFile = TRUE;
  
! short	pDrawCursorH[] =
  {
     9,  11, 13, 14, 19, 26,
***************
*** 55,59 ****
     11, 10, 12, 14, 18, 24
  };
! static short	pDrawFontAsc[] =
  {
     7, 8,  10, 11, 15, 20,
--- 46,51 ----
     11, 10, 12, 14, 18, 24
  };
! 
! short	pDrawFontAsc[] =
  {
     7, 8,  10, 11, 15, 20,
***************
*** 75,79 ****
     8, 8,  9,  11, 14, 19
  };
! static short	pDrawFontDes[] =
  {
     2, 3, 3, 3, 4, 6,
--- 67,72 ----
     8, 8,  9,  11, 14, 19
  };
! 
! short	pDrawFontDes[] =
  {
     2, 3, 3, 3, 4, 6,
***************
*** 97,688 ****
  
  static
- void PDrawDumpTextObj (FP, ObjPtr)
-    FILE				* FP;
-    register struct ObjRec	* ObjPtr;
- {
-    int			x, y, font_size, xinc, yinc;
-    struct StrRec	* s_ptr;
-    struct TextRec	* text_ptr = ObjPtr->detail.t;
- 
-    if (text_ptr->pen == NONEPAT) return;
- 
-    curFont = text_ptr->font;
-    curStyle = text_ptr->style;
-    curSize = text_ptr->size;
-    textJust = text_ptr->just;
-    curRotate = text_ptr->rotate;
-    penPat = text_ptr->pen;
-    textCursorH = pDrawCursorH[FontIndex(curFont,curSize,curStyle)];
-    canvasFontAsc = pDrawFontAsc[FontIndex(curFont,curSize,curStyle)];
-    canvasFontDes = pDrawFontDes[FontIndex(curFont,curSize,curStyle)];
- 
-    x = ObjPtr->x;
-    y = ObjPtr->y;
- 
-    if (curFont == FONT_SYM)
-    {
-       fprintf (FP, "/Symbol ");
-       font_size = pointSize[curSize];
-       fprintf (FP, "findfont [%1d 0 0 -%1d 0 %1d] makefont setfont\n",
-             font_size, font_size, font_size);
-    }
-    else
-    {
-       switch (curFont)
-       {
-          case FONT_TIM: fprintf (FP, "/Times"); break;
-          case FONT_COU: fprintf (FP, "/Courier"); break;
-          case FONT_HEL: fprintf (FP, "/Helvetica"); break;
-          case FONT_CEN: fprintf (FP, "/NewCenturySchlbk"); break;
-       }
-       switch (curStyle)
-       {
-          case STYLE_BI:
-             switch (curFont)
-             {
-                case FONT_TIM: fprintf (FP, "-BoldItalic "); break;
-                case FONT_COU: fprintf (FP, "-BoldOblique "); break;
-                case FONT_HEL: fprintf (FP, "-BoldOblique "); break;
-                case FONT_CEN: fprintf (FP, "-BoldItalic "); break;
-             }
-             break;
-          case STYLE_BR: fprintf (FP, "-Bold "); break;
-          case STYLE_NI:
-             switch (curFont)
-             {
-                case FONT_TIM: fprintf (FP, "-Italic "); break;
-                case FONT_COU: fprintf (FP, "-Oblique "); break;
-                case FONT_HEL: fprintf (FP, "-Oblique "); break;
-                case FONT_CEN: fprintf (FP, "-Italic "); break;
-             }
-             break;
-          case STYLE_NR:
-             switch (curFont)
-             {
-                case FONT_TIM: fprintf (FP, "-Roman "); break;
-                case FONT_COU: fprintf (FP, " "); break;
-                case FONT_HEL: fprintf (FP, " "); break;
-                case FONT_CEN: fprintf (FP, "-Roman "); break;
-             }
-             break;
-       }
-       font_size = pointSize[curSize];
-       fprintf (FP, "findfont [%1d 0 0 -%1d 0 %1d] makefont setfont\n",
-             font_size, font_size, font_size);
-    }
- 
-    fprintf (FP, "   gsave\n");
-    switch (penPat)
-    {
-       case SOLIDPAT: fprintf (FP, "      0 setgray\n"); break;
-       case BACKPAT: fprintf (FP, "      1 setgray\n"); break;
-       default:
-          fprintf (FP, "      pat%1d 8 1 0 72 300 32 div div setpattern\n",
-                penPat);
-          break;
-    }
- 
-    switch (curRotate)
-    {
-       case ROTATE0: xinc = 0; yinc = textCursorH; break;
-       case ROTATE90: xinc = -textCursorH; yinc = 0; break;
-       case ROTATE180: xinc = 0; yinc = -textCursorH; break;
-       case ROTATE270: xinc = textCursorH; yinc = 0; break;
-    }
- 
-    for (s_ptr = text_ptr->first; s_ptr != NULL; s_ptr = s_ptr->next)
-    {
-       switch (curRotate)
-       {
-          case ROTATE0:
-             fprintf (FP, "      %1d %1d moveto (", x, y-canvasFontDes);
-             break;
-          case ROTATE90:
-             fprintf (FP, "      %1d %1d moveto 90 rotate (", x+canvasFontDes, y);
-             break;
-          case ROTATE180:
-             fprintf (FP, "      %1d %1d moveto 180 rotate (", x, y+canvasFontDes);
-             break;
-          case ROTATE270:
-             fprintf (FP, "      %1d %1d moveto 270 rotate (", x-canvasFontDes, y);
-             break;
-       }
-       DumpOneStr (FP, s_ptr->s);
-       switch (textJust)
-       {
-          case JUST_L: fprintf (FP, ") show"); break;
-          case JUST_C: fprintf (FP, ") centertext"); break;
-          case JUST_R: fprintf (FP, ") righttext"); break;
-       }
-       switch (curRotate)
-       {
-          case ROTATE0: fprintf (FP, "\n"); break;
-          case ROTATE90: fprintf (FP, " -90 rotate \n"); break;
-          case ROTATE180: fprintf (FP, " -180 rotate \n"); break;
-          case ROTATE270: fprintf (FP, " -270 rotate \n"); break;
-       }
-       x += xinc;
-       y += yinc;
-    }
-    fprintf (FP, "\n");
-    fprintf (FP, "   grestore\n");
- }
- 
- static
- void PDrawDumpAttrs (FP, AttrPtr)
-    FILE				* FP;
-    register struct AttrRec	* AttrPtr;
- {
-    for ( ; AttrPtr != NULL; AttrPtr = AttrPtr->prev)
-       if (AttrPtr->shown)
-          PDrawDumpTextObj (FP, AttrPtr->obj);
- }
- 
- static
- void PDrawDumpAllObj (FP, ObjPtr)
-    FILE				* FP;
-    register struct ObjRec	* ObjPtr;
- {
-    register struct ObjRec	* obj_ptr;
- 
-    switch (ObjPtr->type)
-    {
-       case OBJ_POLY:
-          DumpPolyObj (FP, ObjPtr);
-          PDrawDumpAttrs (FP, ObjPtr->detail.p->lattr);
-          break;
-       case OBJ_BOX: DumpBoxObj (FP, ObjPtr); break;
-       case OBJ_OVAL: DumpOvalObj (FP, ObjPtr); break;
-       case OBJ_TEXT: PDrawDumpTextObj (FP, ObjPtr); break;
-       case OBJ_POLYGON: DumpPolygonObj (FP, ObjPtr); break;
-       case OBJ_SYM:
-       case OBJ_ICON:
-       case OBJ_GROUP:
-          obj_ptr = ObjPtr->detail.r->last;
-          for ( ; obj_ptr != NULL; obj_ptr = obj_ptr->prev)
-             PDrawDumpAllObj (FP, obj_ptr);
-          PDrawDumpAttrs (FP, ObjPtr->detail.r->lattr);
-          if (ObjPtr->type == OBJ_SYM) DumpSymOutline (FP, ObjPtr);
-          break;
-    }
- }
- 
- static struct StrRec	* pDrawFirstStr = NULL, * pDrawLastStr = NULL;
- 
- static
- void PDrawAddStr (PrevPtr, NextPtr, StrPtr)
-    struct StrRec	* PrevPtr, * NextPtr, * StrPtr;
- {
-    StrPtr->prev = PrevPtr;
-    StrPtr->next = NextPtr;
- 
-    if (PrevPtr == NULL)
-       pDrawFirstStr = StrPtr;
-    else
-       PrevPtr->next = StrPtr;
- 
-    if (NextPtr == NULL)
-       pDrawLastStr = StrPtr;
-    else
-       NextPtr->prev = StrPtr;
- }
- 
- static
- void PDrawReadTextObj (FP, Inbuf, ObjPtr)
-    FILE			* FP;
-    char			* Inbuf;
-    struct ObjRec	* * ObjPtr;
- {
-    register int		i;
-    struct StrRec	* s_ptr;
-    struct TextRec	* text_ptr;
-    char			color_str[80], * s;
-    char			tmp_str[MAXSTRING+1], inbuf[MAXSTRING+1];
-    int			num_lines, x, y, font, style, size;
-    int			text_just, rotate, pen;
- 
-    * ObjPtr = (struct ObjRec *) calloc (1, sizeof(struct ObjRec));
-    s = FindChar ('(', Inbuf);
-    s = ParseStr (s, ',', color_str);
-    if (fileVersion <= 2)
-    {
-       sscanf (s, "%d , %d , %d , %d , %d , %d , %d", &x, &y, &font, &style,
-             &size, &num_lines, &text_just);
-       rotate = 0;
-       pen = 1;
-    }
-    else
-       sscanf (s, "%d , %d , %d , %d , %d , %d , %d , %d , %d", &x, &y, &font,
-             &style, &size, &num_lines, &text_just, &rotate, &pen);
- 
-    text_ptr = (struct TextRec *) calloc (1, sizeof(struct TextRec));
-    text_ptr->just = text_just;
-    text_ptr->lines = num_lines;
-    text_ptr->rotate = rotate;
-    text_ptr->pen = pen;
- 
-    curFont = text_ptr->font = font;
-    curStyle = text_ptr->style = style;
-    curSize = text_ptr->size = size;
-    textJust = text_just;
-    curRotate = rotate;
-    penPat = pen;
-    textCursorH = pDrawCursorH[FontIndex(curFont,curSize,curStyle)];
-    canvasFontAsc = pDrawFontAsc[FontIndex(curFont,curSize,curStyle)];
- 
-    for (i = 0; i < num_lines; i++)
-    {
-       fgets (inbuf, MAXSTRING, FP);
-       strcpy(tmp_str, FindChar ('"', inbuf));
-       s = FindChar ('"', tmp_str);
-       *(--s) = '\0';
-       s_ptr = (struct StrRec *) calloc (1, sizeof(struct StrRec));
-       strcpy (s_ptr->s, tmp_str);
-       PDrawAddStr (pDrawLastStr, NULL, s_ptr);
-    }
-    text_ptr->first = pDrawFirstStr;
-    text_ptr->last = pDrawLastStr;
- 
-    pDrawFirstStr = pDrawLastStr = NULL;
- 
-    (*ObjPtr)->x = x;
-    (*ObjPtr)->y = y;
-    (*ObjPtr)->type = OBJ_TEXT;
-    (*ObjPtr)->color = FindColorIndex (color_str);
-    (*ObjPtr)->detail.t = text_ptr;
- }
- 
- static
- void PDrawReadState (Inbuf)
-    char	* Inbuf;
- {
-    char	* s;
- 
-    s = FindChar ('(', Inbuf);
-    sscanf (s, "%d", &pageStyle);
-    s = FindChar (',', s);
-    if (*s == '\0')
-       fileVersion = INVALID;
-    else
-       sscanf (s, "%d", &fileVersion);
- }
- 
- static
- void PDrawReadGroupObj (FP, ObjPtr)
-    FILE			* FP;
-    struct ObjRec	* * ObjPtr;
- {
-    struct GroupRec	* group_ptr;
-    struct ObjRec	* top_obj = NULL, * bot_obj = NULL, * obj_ptr;
-    int			ltx, lty, rbx, rby;
-    int			obj_ltx, obj_lty, obj_rbx, obj_rby;
- 
-    * ObjPtr = (struct ObjRec *) calloc (1, sizeof(struct ObjRec));
- 
-    while (PDrawReadObj (FP, &obj_ptr))
-    {
-       obj_ptr->next = top_obj;
-       if (top_obj == NULL)
-          bot_obj = obj_ptr;
-       else
-          top_obj->prev = obj_ptr;
-       top_obj = obj_ptr;
-    }
-    top_obj->prev = NULL;
- 
-    group_ptr = (struct GroupRec *) calloc (1, sizeof(struct GroupRec));
-    group_ptr->first = top_obj;
-    group_ptr->last = bot_obj;
- 
-    ltx = top_obj->bbox.ltx;
-    lty = top_obj->bbox.lty;
-    rbx = top_obj->bbox.rbx;
-    rby = top_obj->bbox.rby;
-    obj_ltx = top_obj->obbox.ltx;
-    obj_lty = top_obj->obbox.lty;
-    obj_rbx = top_obj->obbox.rbx;
-    obj_rby = top_obj->obbox.rby;
-    for (obj_ptr = top_obj->next; obj_ptr != NULL; obj_ptr = obj_ptr->next)
-    {
-       if (obj_ptr->bbox.ltx < ltx) ltx = obj_ptr->bbox.ltx;
-       if (obj_ptr->bbox.lty < lty) lty = obj_ptr->bbox.lty;
-       if (obj_ptr->bbox.rbx > rbx) rbx = obj_ptr->bbox.rbx;
-       if (obj_ptr->bbox.rby > rby) rby = obj_ptr->bbox.rby;
-       if (obj_ptr->obbox.ltx < obj_ltx) obj_ltx = obj_ptr->obbox.ltx;
-       if (obj_ptr->obbox.lty < obj_lty) obj_lty = obj_ptr->obbox.lty;
-       if (obj_ptr->obbox.rbx > obj_rbx) obj_rbx = obj_ptr->obbox.rbx;
-       if (obj_ptr->obbox.rby > obj_rby) obj_rby = obj_ptr->obbox.rby;
-    }
-    
-    (*ObjPtr)->x = obj_ltx;
-    (*ObjPtr)->y = obj_lty;
-    (*ObjPtr)->type = OBJ_GROUP;
-    (*ObjPtr)->bbox.ltx = ltx;
-    (*ObjPtr)->bbox.lty = lty;
-    (*ObjPtr)->bbox.rbx = rbx;
-    (*ObjPtr)->bbox.rby = rby;
-    (*ObjPtr)->obbox.ltx = obj_ltx;
-    (*ObjPtr)->obbox.lty = obj_lty;
-    (*ObjPtr)->obbox.rbx = obj_rbx;
-    (*ObjPtr)->obbox.rby = obj_rby;
-    (*ObjPtr)->detail.r = group_ptr;
- }
- 
- static
- char * PDrawReadAttrString (Str)
-    char	* Str;
- {
-    register char	* s = Str;
- 
-    for (s = Str; *s != '\0' && *s != '"'; s++)
-       if (*s == '\\')
-          s++;
- 
-    if (*s == '"') s++;
-    return (s);
- }
- 
- static
- int  PDrawReadAttr (FP, AttrPtr)
-    FILE			* FP;
-    struct AttrRec	* * AttrPtr;
- {
-    struct ObjRec	* TextObj;
-    char			inbuf[MAXSTRING+1], * s;
-    char			name[MAXSTRING+1], value[MAXSTRING+1];
-    int			len, shown, nameshown, inherited;
-  
-    fgets (inbuf, MAXSTRING, FP); 
- 
-    if (inbuf[0] == ']')  return (FALSE);
- 
-    *AttrPtr = (struct AttrRec *)  calloc (1, sizeof(struct AttrRec)); 
- 
-    len = strlen(inbuf) - 1;
-    inbuf[len] = '\0';
- 
-    strcpy(name, FindChar ('"', inbuf));
-    s = PDrawReadAttrString (inbuf);
-    s = FindChar (',', s);
-    strcpy(value, FindChar ('"', s));
-    s = PDrawReadAttrString (value);
-    s = FindChar (',', s);
-    sscanf (s, "%d, %d, %d", &shown, &nameshown, &inherited);
- 
-    s = FindChar ('"', name);
-    *(--s) = '\0';
-    strcpy ((*AttrPtr)->name, name);
-    s = FindChar ('"', value);
-    *(--s) = '\0';
-    strcpy ((*AttrPtr)->s, value);
- 
-    (*AttrPtr)->shown = shown;
-    (*AttrPtr)->nameshown = nameshown;
-    (*AttrPtr)->inherited = inherited;
- 
-    PDrawReadObj (FP, &TextObj);
-    TextObj->detail.t->attr = *AttrPtr;
-    (*AttrPtr)->obj = TextObj;
- 
-    return (TRUE);
- }
- 
- int PDrawReadObj (FP, ObjPtr)
-    FILE			* FP;
-    struct ObjRec	* * ObjPtr;
- {
-    char			inbuf[MAXSTRING+1], obj_name[10], tmp_str[MAXSTRING+1];
-    char			* line = NULL, * c_ptr, * s, * s1;
-    int			len, id, cur_size, done = FALSE, allocated = FALSE;
-    struct AttrRec       * top_attr = NULL, * bot_attr = NULL, * attr_ptr;
- 
-    while (fgets (inbuf, MAXSTRING, FP) != NULL)
-    {
-       if (inbuf[0] == ']') return (FALSE);
- 
-       len = strlen(inbuf);
-       if (inbuf[len-1] != '\r' && inbuf[len-1] != '\n')
-       {  /* line longer than MAXSTRING characters */
-          /* inbuf[MAXSTRING-1] == '\0' and len == MAXSTRING-1 now */
-          cur_size = 2*(MAXSTRING-1);
-          allocated = TRUE;
-          line = (char *) calloc (cur_size, sizeof(char));
-          strcpy (line, inbuf);
-          c_ptr = &(line[MAXSTRING-1]);
-          while (!done && fgets (inbuf, MAXSTRING, FP) != NULL)
-          {
-             len = strlen(inbuf);
-             if (inbuf[len-1] == '\r' || inbuf[len-1] == '\n')
-             {
-                done = TRUE;
-                inbuf[len-1] = '\0';
-                strcpy (c_ptr, inbuf);
-             }
-             else
-             {
-                cur_size += MAXSTRING-1;
-                line = (char *) realloc (line, cur_size);
-                strcpy (c_ptr, inbuf);
-                c_ptr += MAXSTRING-1;
-             }
-          }
-          if (!done)
-          {
-             if (allocated) cfree (line);
-             return (FALSE);
-          }
-       }
-       else
-       {
-          line = inbuf;
-          line[len-1] = '\0';
-       }
- 
-       ParseStr (line, '(', obj_name);
-       if (strcmp (obj_name, "poly") == 0)
-       {
-          ReadPolyObj (line, ObjPtr);
-          if (fileVersion != INVALID)
-             while (PDrawReadAttr (FP, &attr_ptr))
-             {
-                attr_ptr->owner = *ObjPtr;
-                attr_ptr->prev = NULL;
-                attr_ptr->next = top_attr;
-                if (top_attr == NULL)
-                   bot_attr = attr_ptr;
-                else
-                   top_attr->prev = attr_ptr;
-                top_attr = attr_ptr;
-             }
-          if (bot_attr != NULL) bot_attr->next = NULL;
-          (*ObjPtr)->detail.p->fattr = top_attr;
-          (*ObjPtr)->detail.p->lattr = bot_attr;
-          AdjObjBBox (*ObjPtr);
-          if (allocated) cfree (line);
-          return (TRUE);
-       }
-       else if (strcmp (obj_name, "box") == 0)
-       {
-          ReadBoxObj (line, ObjPtr);
-          if (allocated) cfree (line);
-          return (TRUE);
-       }
-       else if (strcmp (obj_name, "oval") == 0)
-       {
-          ReadOvalObj (line, ObjPtr);
-          if (allocated) cfree (line);
-          return (TRUE);
-       }
-       else if (strcmp (obj_name, "text") == 0)
-       {
-          PDrawReadTextObj (FP, line, ObjPtr);
-          if (allocated) cfree (line);
-          return (TRUE);
-       }
-       else if (strcmp (obj_name, "polygon") == 0)
-       {
-          ReadPolygonObj (line, ObjPtr);
-          if (allocated) cfree (line);
-          return (TRUE);
-       }
-       else if (strcmp (obj_name, "group") == 0)
-       {
-          PDrawReadGroupObj (FP, ObjPtr);
-          if (fileVersion != INVALID)
-             while (PDrawReadAttr (FP, &attr_ptr))
-             {
-                attr_ptr->owner = *ObjPtr;
-                attr_ptr->prev = NULL;
-                attr_ptr->next = top_attr;
-                if (top_attr == NULL)
-                   bot_attr = attr_ptr;
-                else
-                   top_attr->prev = attr_ptr;
-                top_attr = attr_ptr;
-             }
-          if (bot_attr != NULL) bot_attr->next = NULL;
-          (*ObjPtr)->detail.r->fattr = top_attr;
-          (*ObjPtr)->detail.r->lattr = bot_attr;
-          AdjObjBBox (*ObjPtr);
-          if (allocated) cfree (line);
-          return (TRUE);
-       }
-       else if (strcmp (obj_name, "sym") == 0)
-       {
-          PDrawReadGroupObj (FP, ObjPtr);
-          (*ObjPtr)->type = OBJ_SYM;
-          if (fileVersion != INVALID)
-             while (PDrawReadAttr (FP, &attr_ptr))
-             {
-                attr_ptr->owner = *ObjPtr;
-                attr_ptr->prev = NULL;
-                attr_ptr->next = top_attr;
-                if (top_attr == NULL)
-                   bot_attr = attr_ptr;
-                else
-                   top_attr->prev = attr_ptr;
-                top_attr = attr_ptr;
-             }
-          if (bot_attr != NULL) bot_attr->next = NULL;
-          (*ObjPtr)->detail.r->fattr = top_attr;
-          (*ObjPtr)->detail.r->lattr = bot_attr;
-          AdjObjBBox (*ObjPtr);
-          if (allocated) cfree (line);
-          return (TRUE);
-       }
-       else if (strcmp (obj_name, "icon") == 0)
-       {
-          PDrawReadGroupObj (FP, ObjPtr);
-          (*ObjPtr)->type = OBJ_ICON;
-          if (fgets (line, MAXSTRING, FP) == NULL)
-          {
-             if (allocated) cfree (line);
-             return (FALSE);
-          }
- 
-          strcpy(tmp_str, FindChar ('"', line));
-          s = FindChar ('"', tmp_str);
-          if (fileVersion != INVALID)
-          {
-             s1 = FindChar (',', s);
-             sscanf (s1, "%d", &id);
-             if (id >= objId) objId = id+1;
-             (*ObjPtr)->detail.r->id = id;
-          }
-          (*ObjPtr)->detail.r->dirty = FALSE;
-          *(--s) = '\0';
-          strcpy ((*ObjPtr)->detail.r->s, tmp_str);
-          if (fileVersion != INVALID)
-             while (PDrawReadAttr (FP, &attr_ptr))
-             {
-                attr_ptr->owner = *ObjPtr;
-                attr_ptr->prev = NULL;
-                attr_ptr->next = top_attr;
-                if (top_attr == NULL)
-                   bot_attr = attr_ptr;
-                else
-                   top_attr->prev = attr_ptr;
-                top_attr = attr_ptr;
-             }
-          if (bot_attr != NULL) bot_attr->next = NULL;
-          (*ObjPtr)->detail.r->fattr = top_attr;
-          (*ObjPtr)->detail.r->lattr = bot_attr;
-          AdjObjBBox (*ObjPtr);
-          if (allocated) cfree (line);
-          return (TRUE);
-       }
-       else if (strcmp (obj_name, "state") == 0)
-       {
-          PDrawReadState (line);
-          *ObjPtr = NULL;
-          if (allocated) cfree (line);
-          return (TRUE);
-       }
-    }
-    if (allocated) cfree (line);
-    return (FALSE);
- }
- 
- static
  int PDrawLoad (FileName)
     char	* FileName;
--- 90,93 ----
***************
*** 703,707 ****
     printf ("Reading '%s' ...\n", full_name);
  
!    while (PDrawReadObj (fp, &obj_ptr))
        if (obj_ptr != NULL)
           AddObj (NULL, topObj, obj_ptr);
--- 108,112 ----
     printf ("Reading '%s' ...\n", full_name);
  
!    while (ReadObj (fp, &obj_ptr, PRTGIF))
        if (obj_ptr != NULL)
           AddObj (NULL, topObj, obj_ptr);
***************
*** 711,813 ****
  }
  
- static
- void PDrawDump (FileName)
-    char	* FileName;
- {
-    register struct ObjRec	* obj_ptr;
-    char				cmd[MAXSTRING+1], tmp_str[MAXSTRING+1];
-    char				tmp_file[MAXSTRING+1], ps_file[MAXSTRING+1];
-    FILE				* fp, * fps;
- 
-    if (botObj == NULL) { printf ("No object to print."); return; }
- 
-    strcpy (tmp_file, "/tmp/TgifXXXXXX");
-    mktemp (tmp_file);
-    unlink (tmp_file);
- 
-    if ((fp = fopen (tmp_file, "w")) == NULL)
-    {
-       printf ("Can not create $s, print aborted.", tmp_file);
-       return;
-    }
- 
-    printf ("Writing to %s ...\n", tmp_file);
- 
-    fprintf (fp, "%%!\n");
-    DumpBBox (fp);
-    sprintf(ps_file, "%s/.psmac", drawPath);
-    if ((fps = fopen (ps_file, "r")) == NULL)
-    {
-       printf ("Can not find %s, print aborted.\n", ps_file);
-       fclose (fp);
-       unlink (tmp_file);
-       return;
-    }
-    while (fgets (tmp_str, 256, fps) != NULL) /* copy the header file */
-       fputs (tmp_str, fp);
- 
-    fprintf (fp, "gsave\n\n");
-    switch (pageStyle)
-    {
-       case LANDSCAPE:
-       case HIGHLAND:
-       case SLIDELAND: fprintf (fp, "90 rotate\n"); break;
-    }
-    fprintf (fp, "%1d %s mul %1d %s mul translate\n", psDotsPerInch,
-          psXOffStr[pageStyle], psDotsPerInch, psYOffStr[pageStyle]);
-    fprintf (fp, "%s -%s scale\n\n",
-          psScaleStr[pageStyle], psScaleStr[pageStyle]);
- 
-    for (obj_ptr = botObj; obj_ptr != NULL; obj_ptr = obj_ptr->prev)
-       PDrawDumpAllObj (fp, obj_ptr);
- 
-    fprintf (fp, "grestore\n\n");
-    fprintf (fp, "showpage\n");
-    fclose (fp);
- 
-    switch (whereToPrint)
-    {
-       case PRINTER:
-          if (lastFile)
-             sprintf (cmd, "lpr %s 2>&1", tmp_file);
-          else
-             sprintf (cmd, "lpr -h %s 2>&1", tmp_file);
- 
-          if ((fp = popen (cmd, "r")) == NULL)
-          {
-             printf ("Can not execute '%s', print aborted.\n", cmd);
-             unlink (tmp_file);
-             return;
-          }
-          while (fgets (tmp_str, 256, fp) != NULL)
-          {
-             printf ("%s", tmp_str);
-             sleep (5);
-          }
-          printf ("%s printed.\n\n", tmp_file);
-          break;
-       case LATEX_FIG:
-          sprintf (ps_file, "%s.ps", FileName);
-          sprintf (cmd, "tgif2ps < %s 1> %s 2>&1; chmod %s %s", tmp_file,
-                ps_file, PSFILE_MOD, ps_file);
- 
-          if ((fp = popen (cmd, "r")) == NULL)
-          {
-             printf ("Can not execute '%s', print aborted.\n", cmd);
-             unlink (tmp_file);
-             return;
-          }
-          while (fgets (tmp_str, 256, fp) != NULL)
-          {
-             printf ("%s", tmp_str);
-             sleep (5);
-          }
-          printf ("LaTeX figure printed into '%s'.\n\n", ps_file);
-          break;
-    }
-    pclose (fp);
-    unlink (tmp_file);
- }
- 
  main (argc, argv)
     int	argc;
--- 116,119 ----
***************
*** 848,852 ****
                 if (PDrawLoad (inbuf))
                 {
!                   PDrawDump (inbuf);
                    DelAllObj ();
                 }
--- 154,158 ----
                 if (PDrawLoad (inbuf))
                 {
!                   Dump (PRTGIF, inbuf);
                    DelAllObj ();
                 }
***************
*** 861,865 ****
              if (PDrawLoad (*argv))
              {
!                PDrawDump (*argv);
                 DelAllObj ();
              }
--- 167,171 ----
              if (PDrawLoad (*argv))
              {
!                Dump (PRTGIF, *argv);
                 DelAllObj ();
              }
***************
*** 866,868 ****
--- 172,175 ----
           }
     }
+    exit (0);
  }
*** select.c.orig	Mon Jul 30 17:35:48 1990
--- select.c	Mon Jul 30 17:35:49 1990
***************
*** 6,10 ****
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/select.c,v 1.6 90/07/16 10:55:20 william Exp $";
  #endif
  
--- 6,10 ----
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/select.c,v 1.7 90/07/27 14:37:59 william Exp $";
  #endif
  
***************
*** 581,585 ****
        for (sel_ptr = topCutSel->next; sel_ptr != NULL; sel_ptr = sel_ptr->next)
        {
!          DelObj (sel_ptr->obj);
           cfree (sel_ptr);
        }
--- 581,585 ----
        for (sel_ptr = topCutSel->next; sel_ptr != NULL; sel_ptr = sel_ptr->next)
        {
!          FreeObj (sel_ptr->obj);
           cfree (sel_ptr);
        }
*** special.c.orig	Mon Jul 30 17:35:57 1990
--- special.c	Mon Jul 30 17:35:59 1990
***************
*** 6,10 ****
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/special.c,v 1.4 90/06/26 13:05:00 william Exp $";
  #endif
  
--- 6,10 ----
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/special.c,v 1.6 90/07/30 11:00:16 william Exp $";
  #endif
  
***************
*** 84,90 ****
        if (strcmp (obj_name, "sym") == 0)
        {
!          ReadGroupObj (FP, &obj_ptr);
           obj_ptr->type = OBJ_ICON;
!          while (ReadAttr (FP, &attr_ptr))
           {
              attr_ptr->owner = obj_ptr;
--- 84,90 ----
        if (strcmp (obj_name, "sym") == 0)
        {
!          ReadGroupObj (FP, &obj_ptr, FALSE);
           obj_ptr->type = OBJ_ICON;
!          while (ReadAttr (FP, &attr_ptr, FALSE))
           {
              attr_ptr->owner = obj_ptr;
***************
*** 106,110 ****
        {
           importingFile = TRUE; /* ignore 'state' info but set fileVersion */
!          ReadState (inbuf);
           importingFile = FALSE;
        }
--- 106,110 ----
        {
           importingFile = TRUE; /* ignore 'state' info but set fileVersion */
!          ReadState (inbuf, FALSE);
           importingFile = FALSE;
        }
*** stk.c.orig	Mon Jul 30 17:36:05 1990
--- stk.c	Mon Jul 30 17:36:06 1990
***************
*** 6,10 ****
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/stk.c,v 1.4 90/07/16 09:30:47 william Exp $";
  #endif
  
--- 6,10 ----
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/stk.c,v 1.5 90/07/30 11:00:40 william Exp $";
  #endif
  
***************
*** 110,114 ****
     XClearWindow (mainDisplay, drawWindow);
  
!    while (ReadObj (fp, &obj_ptr))
        if (obj_ptr != NULL)
        {
--- 110,114 ----
     XClearWindow (mainDisplay, drawWindow);
  
!    while (ReadObj (fp, &obj_ptr, FALSE))
        if (obj_ptr != NULL)
        {
*** text.c.orig	Mon Jul 30 17:36:49 1990
--- text.c	Mon Jul 30 17:36:51 1990
***************
*** 6,10 ****
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/text.c,v 1.6 90/06/26 00:11:37 william Exp $";
  #endif
  
--- 6,10 ----
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/text.c,v 1.9 90/07/30 11:02:09 william Exp $";
  #endif
  
***************
*** 26,29 ****
--- 26,30 ----
  #include "pattern.e"
  #include "poly.e"
+ #include "prtgif.e"
  #include "raster.e"
  #include "ruler.e"
***************
*** 368,372 ****
  }
  
- static
  void SetTextBBox (ObjPtr, Just, W, H, Rotate)
     struct ObjRec	* ObjPtr;
--- 369,372 ----
***************
*** 1380,1386 ****
  }
  
! void DumpTextObj (FP, ObjPtr)
     FILE				* FP;
     register struct ObjRec	* ObjPtr;
  {
     int			x, y, font_size, xinc, yinc;
--- 1380,1387 ----
  }
  
! void DumpTextObj (FP, ObjPtr, PRTGIF)
     FILE				* FP;
     register struct ObjRec	* ObjPtr;
+    int				PRTGIF;
  {
     int			x, y, font_size, xinc, yinc;
***************
*** 1390,1394 ****
     if (text_ptr->pen == NONEPAT) return;
  
!    SaveCurFont ();
     curFont = text_ptr->font;
     curStyle = text_ptr->style;
--- 1391,1396 ----
     if (text_ptr->pen == NONEPAT) return;
  
!    if (!PRTGIF) SaveCurFont ();
! 
     curFont = text_ptr->font;
     curStyle = text_ptr->style;
***************
*** 1397,1402 ****
     curRotate = text_ptr->rotate;
     penPat = text_ptr->pen;
-    SetCanvasFont ();
  
     x = ObjPtr->x;
     y = ObjPtr->y;
--- 1399,1412 ----
     curRotate = text_ptr->rotate;
     penPat = text_ptr->pen;
  
+    if (PRTGIF)
+    {
+       textCursorH = pDrawCursorH[FontIndex(curFont,curSize,curStyle)];
+       canvasFontAsc = pDrawFontAsc[FontIndex(curFont,curSize,curStyle)];
+       canvasFontDes = pDrawFontDes[FontIndex(curFont,curSize,curStyle)];
+    }
+    else
+       SetCanvasFont ();
+ 
     x = ObjPtr->x;
     y = ObjPtr->y;
***************
*** 1510,1514 ****
     fprintf (FP, "   grestore\n");
  
!    RestoreCurFont ();
  }
  
--- 1520,1524 ----
     fprintf (FP, "   grestore\n");
  
!    if (!PRTGIF) RestoreCurFont ();
  }
  
***************
*** 1648,1654 ****
  
     fprintf (FP, "text(%s,", colorMenuItems[ObjPtr->color]);
!    fprintf (FP, "%1d,%1d,%1d,%1d,%1d,%1d,%1d,%1d,%1d,[\n", ObjPtr->x,
           ObjPtr->y, t_ptr->font, t_ptr->style, t_ptr->size,
!          t_ptr->lines, t_ptr->just, t_ptr->rotate, t_ptr->pen);
  
     for (s_ptr = t_ptr->first; s_ptr->next != NULL; s_ptr = s_ptr->next)
--- 1658,1666 ----
  
     fprintf (FP, "text(%s,", colorMenuItems[ObjPtr->color]);
!    fprintf (FP, "%1d,%1d,%1d,%1d,%1d,%1d,%1d,%1d,%1d,%1d,%1d,[\n", ObjPtr->x,
           ObjPtr->y, t_ptr->font, t_ptr->style, t_ptr->size,
!          t_ptr->lines, t_ptr->just, t_ptr->rotate, t_ptr->pen,
!          ObjPtr->obbox.rbx-ObjPtr->obbox.ltx,
!          ObjPtr->obbox.rby-ObjPtr->obbox.lty);
  
     for (s_ptr = t_ptr->first; s_ptr->next != NULL; s_ptr = s_ptr->next)
***************
*** 1677,1684 ****
  }
  
! void ReadTextObj (FP, Inbuf, ObjPtr)
     FILE			* FP;
     char			* Inbuf;
     struct ObjRec	* * ObjPtr;
  {
     register int		i, max_len = 0, len;
--- 1689,1697 ----
  }
  
! void ReadTextObj (FP, Inbuf, ObjPtr, PRTGIF)
     FILE			* FP;
     char			* Inbuf;
     struct ObjRec	* * ObjPtr;
+    int			PRTGIF;
  {
     register int		i, max_len = 0, len;
***************
*** 1689,1692 ****
--- 1702,1706 ----
     int			num_lines, x, y, font, style, size;
     int			text_just, rotate, pen;
+    int			bbox_w, bbox_h;
  
     * ObjPtr = (struct ObjRec *) calloc (1, sizeof(struct ObjRec));
***************
*** 1700,1706 ****
        pen = 1;
     }
!    else
        sscanf (s, "%d , %d , %d , %d , %d , %d , %d , %d , %d", &x, &y, &font,
              &style, &size, &num_lines, &text_just, &rotate, &pen);
  
     text_ptr = (struct TextRec *) calloc (1, sizeof(struct TextRec));
--- 1714,1725 ----
        pen = 1;
     }
!    else if (fileVersion <= 6)
        sscanf (s, "%d , %d , %d , %d , %d , %d , %d , %d , %d", &x, &y, &font,
              &style, &size, &num_lines, &text_just, &rotate, &pen);
+    else
+       sscanf (s,
+             "%d , %d , %d , %d , %d , %d , %d , %d , %d , %d , %d",
+             &x, &y, &font, &style, &size, &num_lines, &text_just, &rotate, &pen,
+             &bbox_w, &bbox_h);
  
     text_ptr = (struct TextRec *) calloc (1, sizeof(struct TextRec));
***************
*** 1710,1714 ****
     text_ptr->pen = pen;
  
!    SaveCurFont ();
     curFont = text_ptr->font = font;
     curStyle = text_ptr->style = style;
--- 1729,1734 ----
     text_ptr->pen = pen;
  
!    if (!PRTGIF) SaveCurFont ();
! 
     curFont = text_ptr->font = font;
     curStyle = text_ptr->style = style;
***************
*** 1716,1721 ****
     textJust = text_just;
     curRotate = rotate;
-    SetCanvasFont ();
  
     for (i = 0; i < num_lines; i++)
     {
--- 1736,1749 ----
     textJust = text_just;
     curRotate = rotate;
  
+    if (PRTGIF)
+    {
+       penPat = pen;
+       textCursorH = pDrawCursorH[FontIndex(curFont,curSize,curStyle)];
+       canvasFontAsc = pDrawFontAsc[FontIndex(curFont,curSize,curStyle)];
+    }
+    else
+       SetCanvasFont ();
+ 
     for (i = 0; i < num_lines; i++)
     {
***************
*** 1727,1731 ****
        strcpy (s_ptr->s, tmp_str);
        AddStr (lastStr, NULL, s_ptr);
!       len = XTextWidth (canvasFontPtr, tmp_str, strlen (tmp_str));
        if (len > max_len) max_len = len;
     }
--- 1755,1762 ----
        strcpy (s_ptr->s, tmp_str);
        AddStr (lastStr, NULL, s_ptr);
!       if (PRTGIF)
!          len = strlen (tmp_str); /* assume string width = 1 pixel per char */
!       else
!          len = XTextWidth (canvasFontPtr, tmp_str, strlen (tmp_str));
        if (len > max_len) max_len = len;
     }
***************
*** 1739,1743 ****
     (*ObjPtr)->y = y;
  
!    SetTextBBox (*ObjPtr, text_just, max_len, num_lines*textCursorH, rotate);
  
     (*ObjPtr)->type = OBJ_TEXT;
--- 1770,1777 ----
     (*ObjPtr)->y = y;
  
!    if (PRTGIF && fileVersion > 6)
!       SetTextBBox (*ObjPtr, text_just, bbox_w, bbox_h, rotate);
!    else
!       SetTextBBox (*ObjPtr, text_just, max_len, num_lines*textCursorH, rotate);
  
     (*ObjPtr)->type = OBJ_TEXT;
***************
*** 1745,1749 ****
     (*ObjPtr)->detail.t = text_ptr;
  
!    RestoreCurFont ();
  }
  
--- 1779,1783 ----
     (*ObjPtr)->detail.t = text_ptr;
  
!    if (!PRTGIF) RestoreCurFont ();
  }
  
*** tgif.c.orig	Mon Jul 30 17:37:02 1990
--- tgif.c	Mon Jul 30 17:37:03 1990
***************
*** 6,10 ****
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/tgif.c,v 1.4 90/05/17 08:23:08 william Exp $";
  #endif
  
--- 6,10 ----
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/tgif.c,v 1.6 90/07/30 11:04:46 william Exp $";
  #endif
  
***************
*** 19,22 ****
--- 19,27 ----
  
  /* extern int	malloc_debug (); */
+ 
+ int	lastFile;
+ short	* pDrawCursorH;
+ short	* pDrawFontAsc;
+ short	* pDrawFontDes;
  
  static
*** version.c.orig	Mon Jul 30 17:37:08 1990
--- version.c	Mon Jul 30 17:37:09 1990
***************
*** 6,11 ****
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/version.c,v 1.13 90/07/12 09:02:19 william Exp $";
  #endif
  
! char	* version_string = "1.10";
--- 6,11 ----
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/version.c,v 1.14 90/07/27 14:44:12 william Exp $";
  #endif
  
! char	* version_string = "1.11";
*** attr.e.orig	Mon Jul 30 17:37:14 1990
--- attr.e	Mon Jul 30 17:37:16 1990
***************
*** 4,8 ****
   * Copyright (C) 1989, William Cheng.
   *
!  * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/attr.e,v 1.1 90/04/01 22:16:53 william Exp $
   */
  
--- 4,8 ----
   * Copyright (C) 1989, William Cheng.
   *
!  * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/attr.e,v 1.2 90/07/30 11:09:08 william Exp $
   */
  
*** file.e.orig	Mon Jul 30 17:37:21 1990
--- file.e	Mon Jul 30 17:37:22 1990
***************
*** 4,8 ****
   * Copyright (C) 1989, William Cheng.
   *
!  * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/file.e,v 1.10 90/07/18 16:21:33 william Exp $
   */
  
--- 4,8 ----
   * Copyright (C) 1989, William Cheng.
   *
!  * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/file.e,v 1.11 90/07/30 15:53:31 william Exp $
   */
  
*** font.e.orig	Mon Jul 30 17:37:27 1990
--- font.e	Mon Jul 30 17:37:28 1990
***************
*** 4,8 ****
   * Copyright (C) 1989, William Cheng.
   *
!  * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/font.e,v 1.1 90/04/01 22:17:04 william Exp $
   */
  
--- 4,8 ----
   * Copyright (C) 1989, William Cheng.
   *
!  * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/font.e,v 1.3 90/07/20 16:59:06 william Exp $
   */
  
***************
*** 27,30 ****
--- 27,31 ----
  
  extern int	pointSize[];
+ extern int	curFontDPI;
  extern int	curFont;
  extern int	curSize;
*** text.e.orig	Mon Jul 30 17:37:33 1990
--- text.e	Mon Jul 30 17:37:34 1990
***************
*** 4,8 ****
   * Copyright (C) 1989, William Cheng.
   *
!  * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/text.e,v 1.1 90/04/01 22:17:26 william Exp $
   */
  
--- 4,8 ----
   * Copyright (C) 1989, William Cheng.
   *
!  * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/text.e,v 1.2 90/07/27 09:33:44 william Exp $
   */
  
***************
*** 18,21 ****
--- 18,22 ----
  extern void	EraseTextCursor ();
  extern void	NewCurText ();
+ extern void	SetTextBBox ();
  extern void	UpdTextBBox ();
  extern void	FreeTextObj ();
*** types.h.orig	Mon Jul 30 17:37:38 1990
--- types.h	Mon Jul 30 17:37:39 1990
***************
*** 4,8 ****
   * Copyright (C) 1990, William Cheng.
   *
!  * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/types.h,v 1.3 90/05/18 20:23:48 william Exp $
   */
  
--- 4,8 ----
   * Copyright (C) 1990, William Cheng.
   *
!  * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/types.h,v 1.4 90/07/30 15:53:05 william Exp $
   */
  
*** Makefile.noimake.orig	Mon Jul 30 17:37:46 1990
--- Makefile.noimake	Mon Jul 30 17:37:47 1990
***************
*** 4,8 ****
  # Copyright (C) 1990, William Cheng.
  #
! # @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/Makefile.noimake,v 1.16 90/07/17 18:06:05 william Exp $
  #
  
--- 4,8 ----
  # Copyright (C) 1990, William Cheng.
  #
! # @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/Makefile.noimake,v 1.19 90/07/30 11:05:05 william Exp $
  #
  
***************
*** 111,119 ****
  		align.e attr.e box.e button.e choice.e color.e dialog.e \
  		drawing.e font.e grid.e group.e mainloop.e menu.e msg.e \
! 		names.e poly.e polygon.e obj.e oval.e pattern.e rect.e ruler.e \
! 		scroll.e select.e setup.e stk.e text.e
  font.o:		const.h types.h \
! 		choice.e color.e drawing.e mark.e menu.e obj.e pattern.e \
! 		raster.e select.e setup.e text.e
  grid.o:		const.h types.h \
  		choice.e color.e drawing.e dup.e msg.e obj.e \
--- 111,119 ----
  		align.e attr.e box.e button.e choice.e color.e dialog.e \
  		drawing.e font.e grid.e group.e mainloop.e menu.e msg.e \
! 		names.e pattern.e poly.e polygon.e prtgif.e obj.e oval.e \
! 		rect.e ruler.e scroll.e select.e setup.e stk.e text.e
  font.o:		const.h types.h \
! 		choice.e color.e drawing.e mark.e menu.e obj.e \
! 		pattern.e raster.e select.e setup.e text.e
  grid.o:		const.h types.h \
  		choice.e color.e drawing.e dup.e msg.e obj.e \
***************
*** 154,159 ****
  		pattern.e poly.e raster.e ruler.e select.e setup.e spline.e
  prtgif.o:	const.h types.h \
! 		attr.e box.e file.e font.e grid.e group.e obj.e oval.e \
! 		pattern.e poly.e polygon.e setup.e text.e
  raster.o:	const.h types.h $(RASTER_BM) \
  		choice.e color.e font.e pattern.e setup.e
--- 154,158 ----
  		pattern.e poly.e raster.e ruler.e select.e setup.e spline.e
  prtgif.o:	const.h types.h \
! 		file.e grid.e obj.e setup.e
  raster.o:	const.h types.h $(RASTER_BM) \
  		choice.e color.e font.e pattern.e setup.e
***************
*** 184,188 ****
  text.o:		const.h types.h \
  		attr.e choice.e color.e cursor.e dup.e file.e font.e \
! 		grid.e obj.e pattern.e poly.e raster.e ruler.e setup.e
  tgif.o:		const.h types.h mainloop.e setup.e version.e
  version.o:
--- 183,187 ----
  text.o:		const.h types.h \
  		attr.e choice.e color.e cursor.e dup.e file.e font.e \
! 		grid.e obj.e pattern.e poly.e prtgif.e raster.e ruler.e setup.e
  tgif.o:		const.h types.h mainloop.e setup.e version.e
  version.o:
*** Imakefile.orig	Mon Jul 30 17:37:53 1990
--- Imakefile	Mon Jul 30 17:37:55 1990
***************
*** 4,11 ****
  /**/# Copyright (C) 1990, William Cheng.
  /**/#
! /**/# @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/Imakefile,v 1.18 90/07/17 16:54:34 william Exp $
  /**/#
  
! TGIFVERSION	= 1.10
  PROGRAMS	= tgif prtgif tgif2ps frontend11.o
  CDEBUGFLAGS	= -g
--- 4,11 ----
  /**/# Copyright (C) 1990, William Cheng.
  /**/#
! /**/# @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/Imakefile,v 1.19 90/07/27 14:44:28 william Exp $
  /**/#
  
! TGIFVERSION	= 1.11
  PROGRAMS	= tgif prtgif tgif2ps frontend11.o
  CDEBUGFLAGS	= -g
*** tgif.man.orig	Mon Jul 30 17:38:01 1990
--- tgif.man	Mon Jul 30 17:38:02 1990
***************
*** 1,3 ****
! .\"@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/tgif.man,v 1.9 90/07/19 11:08:00 william Exp $
  .TH TGIF 1 "Version 1.10 and Above" "Tgif"
  .SH NAME
--- 1,3 ----
! .\"@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/tgif.man,v 1.10 90/07/30 16:06:37 william Exp $
  .TH TGIF 1 "Version 1.10 and Above" "Tgif"
  .SH NAME
***************
*** 377,380 ****
--- 377,385 ----
  XSynchronize is called if this default is set to \fIon\fR.  Default is
  \fIoff\fR.
+ .TP
+ .I Tgif*DoubleClickInterval: NUMBER
+ This specifies the maximum interval (in milli-seconds)
+ between two clicked to be recognized as one double-click.
+ Default is 300.
  .SH ENVIRONMENT
  .TP
*** tgif.pl.orig	Mon Jul 30 17:38:07 1990
--- tgif.pl	Mon Jul 30 17:38:08 1990
***************
*** 3,7 ****
  %	code.
  %
! % @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/tgif.pl,v 1.2 90/05/10 15:22:58 william Exp $
  %
  
--- 3,7 ----
  %	code.
  %
! % @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/tgif.pl,v 1.3 90/07/30 17:30:05 william Exp $
  %
  
***************
*** 13,17 ****
  
  tgif_text(FileVersion, Obj) :-
! 	FileVersion >= 6,
  	(	var(Obj) ->
  		Obj = text(_Color,_X,_Y,_Font,_TextStyle,_TextSize,_NumLines,
--- 13,17 ----
  
  tgif_text(FileVersion, Obj) :-
! 	FileVersion == 6,
  	(	var(Obj) ->
  		Obj = text(_Color,_X,_Y,_Font,_TextStyle,_TextSize,_NumLines,
***************
*** 20,23 ****
--- 20,33 ----
  	;	Obj = text(_Color,_X,_Y,_Font,_TextStyle,_TextSize,_NumLines,
  			_TextJust,_TextRotate,_PenPat,StrList)
+ 	),
+ 	tgif_strs(FileVersion, StrList).
+ tgif_text(FileVersion, Obj) :-
+ 	FileVersion >= 7,
+ 	(	var(Obj) ->
+ 		Obj = text(_Color,_X,_Y,_Font,_TextStyle,_TextSize,_NumLines,
+ 			_TextJust,_TextRotate,_PenPat,_BBoxW,_BBoxH,StrList),
+ 		call(Obj)
+ 	;	Obj = text(_Color,_X,_Y,_Font,_TextStyle,_TextSize,_NumLines,
+ 			_TextJust,_TextRotate,_PenPat,_BBoxW,_BBoxH,StrList)
  	),
  	tgif_strs(FileVersion, StrList).
*** prtgif.e.orig	Mon Jul 30 17:20:49 1990
--- prtgif.e	Mon Jul 30 17:20:55 1990
***************
*** 0 ****
--- 1,12 ----
+ /*
+  * Author:	William Chia-Wei Cheng (william@cs.ucla.edu)
+  *
+  * Copyright (C) 1990, William Cheng.
+  *
+  * @(#) $Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/prtgif.e,v 1.1 90/07/30 11:08:07 william Exp $
+  */
+ 
+ extern int	lastFile;
+ extern short	pDrawCursorH[];
+ extern short	pDrawFontAsc[];
+ extern short	pDrawFontDes[];
---------------------------------> cut here <---------------------------------
--
Bill Cheng // UCLA Computer Science Department // (213) 206-7135
3277 Boelter Hall // Los Angeles, California 90024 // USA
william@CS.UCLA.EDU      ...!{uunet|ucbvax}!cs.ucla.edu!william