v10i064: tgif, Patch6, Part01/03

William Cheng william at CS.UCLA.EDU
Tue Dec 18 13:07:01 AEST 1990


Submitted-by: william at CS.UCLA.EDU (William Cheng)
Posting-number: Volume 10, Issue 64
Archive-name: tgif/patch6.01
Patch-To: Volume 7, Issue 56-76 (original: tgif-1.2)
Patch-To: Volume 8, Issue 46-48 (Patch1: tgif-1.2 => tgif-1.9)
Patch-To: Volume 8, Issue 58-60 (Patch2: tgif-1.9 => tgif-1.12)
Patch-To: Volume 8, Issue 87-89 (Patch3: tgif-1.12 => tgif-1.13)
Patch-To: Volume 8, Issue 94 (Patch4: tgif-1.13 => tgif-1.14)
Patch-To: Volume 8, Issue 95 (Patch5: tgif-1.14 => tgif-1.15)

Patch6 of tgif takes tgif-1.15 to tgif-1.16.  Below is a list of
added features/bug fixes, followed by the actual patch.

tgif-1.15 => tgif-1.16

1) Fix bugs related makeing a grouped object iconic.  Used to have the
   wrong file name.
2) Remove the restriction of just being able to edit files under the
   current directory.
3) New implementation of domains.  Now a domain specifies a search path
   for the .sym files.

The following is the patch to take tgif from version 1.15 to 1.16.
---------------------------------> cut here <---------------------------------
*** box.c.orig	Sat Oct 27 17:47:20 1990
--- box.c	Sat Oct 27 17:47:21 1990
***************
*** 6,10 ****
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/box.c,v 1.7 90/08/13 09:23:32 william Exp $";
  #endif
  
--- 6,10 ----
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/box.c,v 1.8 90/10/27 15:09:43 william Exp $";
  #endif
  
*** choice.c.orig	Sat Oct 27 17:47:26 1990
--- choice.c	Sat Oct 27 17:47:27 1990
***************
*** 6,10 ****
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/choice.c,v 1.8 90/08/21 15:55:15 william Exp $";
  #endif
  
--- 6,10 ----
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/choice.c,v 1.9 90/10/27 15:12:25 william Exp $";
  #endif
  
***************
*** 224,227 ****
--- 224,240 ----
     XFillRectangle (mainDisplay, choiceWindow, rasterGC, 3*choiceImageW, 0,
           choiceImageW, choiceImageH);
+ 
+ /* XGCValues	values;
+ 
+    XClearArea (mainDisplay, choiceWindow, 3*choiceImageW, 0,
+          choiceImageW, choiceImageH, FALSE);
+    if (curDash != 0)
+       XSetDashes (mainDisplay, rasterGC, 0, dashList[curDash],
+             dashListLength[curDash]);
+    values.line_width = widthOfLine[lineWidth];
+    XChangeGC (mainDisplay, rasterGC, GCLineWidth, &values);
+    XDrawLine (mainDisplay, choiceWindow, rasterGC,
+          3*choiceImageW+3, (int)(choiceImageH/2), 4*choiceImageW-3,
+          (int)(choiceImageH/2)); */
  }
  
*** color.c.orig	Sat Oct 27 17:47:33 1990
--- color.c	Sat Oct 27 17:47:34 1990
***************
*** 6,10 ****
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/color.c,v 1.11 90/07/31 15:11:08 william Exp $";
  #endif
  
--- 6,10 ----
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/color.c,v 1.14 90/10/27 16:29:54 william Exp $";
  #endif
  
***************
*** 28,31 ****
--- 28,34 ----
  int	* xorColorPixels = NULL;
  char	* * colorMenuItems = NULL;
+ XColor	* tgifColors;
+ int	maxRGB = 0;
+ int	colorDump = FALSE;
  
  static char	* defaultColorMenuItems[MAXCOLORS] =
***************
*** 63,67 ****
     if (i == maxColors)
     {
!       printf ("Can not find color `%s', use `%s' instead.\n", s,
              colorMenuItems[defaultColorIndex]);
        return (defaultColorIndex);
--- 66,70 ----
     if (i == maxColors)
     {
!       printf ("Can not find color '%s', use '%s' instead.\n", s,
              colorMenuItems[defaultColorIndex]);
        return (defaultColorIndex);
***************
*** 77,80 ****
--- 80,84 ----
     int		num, color_in_x_default = FALSE;
     int		bg_allocated=FALSE, fg_allocated=FALSE, brdr_allocated=FALSE;
+    int		tmp_max, white_allocated=FALSE, black_allocated=TRUE;
  
     if ((c_ptr = XGetDefault (mainDisplay, TOOL_NAME, "ReverseVideo")) != NULL)
***************
*** 148,151 ****
--- 152,157 ----
     colorMenuItems = (char * *) calloc (maxColors, sizeof (char *));
  
+    tgifColors = (XColor *) calloc (maxColors, sizeof (XColor));
+ 
     if (color_in_x_default)
     {
***************
*** 176,179 ****
--- 182,189 ----
                 &exact_def);
           colorPixels[i] = color.pixel;
+ 
+          tgifColors[i].red = color.red;
+          tgifColors[i].green = color.green;
+          tgifColors[i].blue = color.blue;
     
           if (strcmp (colorMenuItems[i], fg_color) == 0)
***************
*** 248,251 ****
--- 258,269 ----
        colorIndex = 0;
     }
+    XAllocNamedColor(mainDisplay, mainColormap, "black", &color, &exact_def);
+    tmp_max = max(color.red,max(color.green,color.blue));
+    if (tmp_max > maxRGB) maxRGB = tmp_max;
+    XAllocNamedColor(mainDisplay, mainColormap, "white", &color, &exact_def);
+    tmp_max = max(color.red,max(color.green,color.blue));
+    if (tmp_max > maxRGB) maxRGB = tmp_max;
+    if (tmp_max == 0)
+       printf ("Warning:  Unexpected maximum RGB intensity 0.");
  }
  
*** copypaste.c.orig	Sat Oct 27 17:47:39 1990
--- copypaste.c	Sat Oct 27 17:47:40 1990
***************
*** 7,11 ****
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/copypaste.c,v 1.8 90/08/25 17:26:51 william Exp $";
  #endif
  
--- 7,11 ----
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/copypaste.c,v 1.10 90/09/04 07:26:02 william Exp $";
  #endif
  
***************
*** 219,225 ****
        return;
     }
- #ifdef KANJI
-       myPasteKanji (cut_buffer, len);
- #endif
     cut_buffer++;
     len--;
--- 219,222 ----
*** cursor.c.orig	Sat Oct 27 17:47:45 1990
--- cursor.c	Sat Oct 27 17:47:46 1990
***************
*** 6,10 ****
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/cursor.c,v 1.5 90/07/16 10:31:01 william Exp $";
  #endif
  
--- 6,10 ----
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/cursor.c,v 1.6 90/09/04 17:59:03 william Exp $";
  #endif
  
***************
*** 17,20 ****
--- 17,21 ----
  #include "setup.e"
  
+ #include "bitmaps/null.bm"
  #include "bitmaps/nullmask.bm"
  #include "bitmaps/text_cur_image.bm"
***************
*** 29,32 ****
--- 30,34 ----
  static Pixmap	textPixmap;
  static Pixmap	nullPixmap;
+ static Pixmap	nullMaskPixmap;
  
  static XImage	* textCursorImage;
***************
*** 85,91 ****
     handCursor = XCreateFontCursor (mainDisplay, XC_hand2);
  
!    nullPixmap = XCreatePixmap (mainDisplay, mainWindow, nullmask_width,
           nullmask_height, 1);
!    nullCursor = XCreatePixmapCursor (mainDisplay, nullPixmap, nullPixmap,
           &color, &color, 0, 0);
  }
--- 87,95 ----
     handCursor = XCreateFontCursor (mainDisplay, XC_hand2);
  
!    nullPixmap = XCreatePixmap (mainDisplay, mainWindow, null_width,
!          null_height, 1);
!    nullMaskPixmap = XCreatePixmap (mainDisplay, mainWindow, nullmask_width,
           nullmask_height, 1);
!    nullCursor = XCreatePixmapCursor (mainDisplay, nullPixmap, nullMaskPixmap,
           &color, &color, 0, 0);
  }
***************
*** 112,115 ****
--- 116,120 ----
  
     XFreePixmap (mainDisplay, nullPixmap);
+    XFreePixmap (mainDisplay, nullMaskPixmap);
     XFreeCursor (mainDisplay, nullCursor);
  }
*** file.c.orig	Sat Oct 27 17:48:07 1990
--- file.c	Sat Oct 27 17:48:08 1990
***************
*** 6,10 ****
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/file.c,v 1.32 90/08/15 16:00:43 william Exp $";
  #endif
  
--- 6,10 ----
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/file.c,v 1.38 90/10/27 15:07:35 william Exp $";
  #endif
  
***************
*** 49,52 ****
--- 49,54 ----
  #define START_HAVING_ATTRS 8
  
+ extern char	* getenv ();
+ 
  char	curFileName[MAXPATHLENGTH];
  int	curFileDefined = FALSE;
***************
*** 67,70 ****
--- 69,73 ----
     curFileName[0] = '\0';
     curFileDefined = FALSE;
+    *curSymDir = '\0';
  }
  
***************
*** 184,188 ****
  {
     char			new_file_name[MAXPATHLENGTH], s[MAXPATHLENGTH];
!    char			new_full_name[MAXPATHLENGTH];
     FILE			* fp;
     int			count = 0, len;
--- 187,191 ----
  {
     char			new_file_name[MAXPATHLENGTH], s[MAXPATHLENGTH];
!    char			new_full_name[MAXPATHLENGTH], tmp_str[MAXPATHLENGTH];
     FILE			* fp;
     int			count = 0, len;
***************
*** 243,249 ****
     }
  
!    strcpy (new_full_name, curDomainName);
!    if (*curDomainName != '\0') strcat (new_full_name, "/");
!    strcat (new_full_name, new_file_name);
  
     if (!OkayToCreateFile (new_full_name)) return;
--- 246,257 ----
     }
  
!    if (*new_file_name == '/')
!       strcat (new_full_name, new_file_name);
!    else
!    {
!       strcpy (new_full_name, curDir);
!       strcat (new_full_name, "/");
!       strcat (new_full_name, new_file_name);
!    }
  
     if (!OkayToCreateFile (new_full_name)) return;
***************
*** 256,266 ****
     }
  
!    strcpy (curFileName, new_file_name);
     curFileDefined = TRUE;
!    sprintf (s, "Saving '%s' ...", new_file_name);
     Msg (s);
     Save (fp, botObj, 0);
     fclose (fp);
!    sprintf (s, "File '%s' saved.", new_file_name);
     Msg (s);
     SetFileModified (FALSE);
--- 264,279 ----
     }
  
!    strcpy (tmp_str, curDir);
!    SetCurDir (new_full_name);
!    *curSymDir = '\0';
     curFileDefined = TRUE;
! 
!    if (strcmp (tmp_str, curDir) != 0) UpdateDirInfo ();
! 
!    sprintf (s, "Saving '%s/%s' ...", curDir, curFileName);
     Msg (s);
     Save (fp, botObj, 0);
     fclose (fp);
!    sprintf (s, "File '%s/%s' saved.", curDir, curFileName);
     Msg (s);
     SetFileModified (FALSE);
***************
*** 314,323 ****
     }
  
!    strcpy (full_name, curDomainName);
!    if (*curDomainName != '\0') strcat (full_name, "/");
!    strcat (full_name, curFileName);
     if ((fp = fopen (full_name, "w")) == NULL)
     {
!       sprintf (s, "Can not open %s, file not saved.", curFileName);
        Msg (s);
        return;
--- 327,346 ----
     }
  
!    if (strcmp (ext, "sym") == 0)
!    {
!       strcpy (full_name, curSymDir);
!       strcat (full_name, "/");
!       strcat (full_name, curFileName);
!    }
!    else if (strcmp (ext, "obj") == 0)
!    {
!       strcpy (full_name, curDir);
!       strcat (full_name, "/");
!       strcat (full_name, curFileName);
!    }
! 
     if ((fp = fopen (full_name, "w")) == NULL)
     {
!       sprintf (s, "Can not open '%s', file not saved.", full_name);
        Msg (s);
        return;
***************
*** 324,328 ****
     }
  
!    sprintf (s, "Saving '%s' ...", curFileName);
     Msg (s);
  
--- 347,351 ----
     }
  
!    sprintf (s, "Saving '%s' ...", full_name);
     Msg (s);
  
***************
*** 330,334 ****
  
     fclose (fp);
!    sprintf (s, "File '%s' saved.", curFileName);
     Msg (s);
     SetFileModified (FALSE);
--- 353,357 ----
  
     fclose (fp);
!    sprintf (s, "File '%s' saved.", full_name);
     Msg (s);
     SetFileModified (FALSE);
***************
*** 424,428 ****
           if (colorIndex >= maxColors)
           {
!             printf ("Can not find color `%s', use `%s' instead.\n", s,
                    colorMenuItems[defaultColorIndex]);
              colorIndex = defaultColorIndex;
--- 447,451 ----
           if (colorIndex >= maxColors)
           {
!             printf ("Can not find color '%s', use `%s' instead.\n", s,
                    colorMenuItems[defaultColorIndex]);
              colorIndex = defaultColorIndex;
***************
*** 615,656 ****
  void ChangeDomain ()
  {
-    char 	domain_name[MAXPATHLENGTH], s[MAXPATHLENGTH];
     register int	i;
  
     if (SelectDomain (domain_name) == INVALID) return;
  
!    if (strcmp (domain_name, "..") == 0)
!    {
!       if (*curDomainName == '\0')
!          Msg ("Already at the top.  Domain not changed.");
!       else
!       {
!          i = strlen (curDomainName) - 1;
!          for ( ; i >= 0 && curDomainName[i] != '/'; i--) ;
!          if (i >= 0)
!          {
!             curDomainName[i] = '\0';
!             sprintf (s, "Current domain is %s.", curDomainName);
!             Msg (s);
!          }
!          else
!          {
!             curDomainName[0] = '\0';
!             Msg ("At the top of the domain hierarchy.");
!          }
!       }
!    }
!    else if (strcmp (domain_name, ".") == 0)
!    {
!       sprintf (s, "Current domain is %s.", curDomainName);
!       Msg (s);
!    }
     else
!    {
!       if (*curDomainName != '\0') strcat (curDomainName, "/");
!       strcat (curDomainName, domain_name);
!       sprintf (s, "Current domain is %s.", curDomainName);
!       Msg (s);
!    }
  }
  
--- 638,659 ----
  void ChangeDomain ()
  {
     register int	i;
+    char 	domain_name[MAXPATHLENGTH], env_str[MAXPATHLENGTH];
+    char 	s[MAXSTRING], s1[MAXSTRING], * c_ptr;
  
     if (SelectDomain (domain_name) == INVALID) return;
  
!    sprintf (env_str, "TGIF_%s", domain_name);
!    if ((c_ptr = getenv (env_str)) == NULL)
!       ParseSymPath (".");
     else
!       ParseSymPath (c_ptr);
! 
!    UpdateSymInfo ();
! 
!    strcpy (curDomainName, domain_name);
!    sprintf (s, "Current domain is '%s'.", curDomainName);
!    sprintf (s1, "Symbol path set to '%s'.", curDomainPath);
!    TwoLineMsg (s, s1);
  }
  
***************
*** 659,674 ****
     struct ObjRec	* obj_ptr, * saved_top_obj, * saved_bot_obj;
     char 		file_name[MAXPATHLENGTH], s[MAXPATHLENGTH];
-    char 		full_name[MAXPATHLENGTH];
     FILE			* fp;
  
!    if (SelectFileName ("obj", "Please Select A File To IMPORT ...",
!          file_name) == INVALID) return;
  
     strcat (file_name, ".obj");
-    strcpy (full_name, curDomainName);
-    if (*curDomainName != '\0') strcat (full_name, "/");
-    strcat (full_name, file_name);
  
!    if ((fp = fopen (full_name, "r")) == NULL)
     {
        sprintf (s, "Can not import '%s'.", file_name);
--- 662,674 ----
     struct ObjRec	* obj_ptr, * saved_top_obj, * saved_bot_obj;
     char 		file_name[MAXPATHLENGTH], s[MAXPATHLENGTH];
     FILE			* fp;
  
!    if (SelectFileName ("Please select a file to IMPORT ...", file_name)
!          == INVALID)
!       return;
  
     strcat (file_name, ".obj");
  
!    if ((fp = fopen (file_name, "r")) == NULL)
     {
        sprintf (s, "Can not import '%s'.", file_name);
***************
*** 720,732 ****
     FILE			* fp;
  
!    if (SelectFileName ("obj", "Please Select A File To OPEN ...",
!          file_name) == INVALID) return;
  
     strcat (file_name, ".obj");
-    strcpy (full_name, curDomainName);
-    if (*curDomainName != '\0') strcat (full_name, "/");
-    strcat (full_name, file_name);
  
!    if ((fp = fopen (full_name, "r")) == NULL)
     {
        sprintf (s, "Can not open '%s'.", file_name);
--- 720,729 ----
     FILE			* fp;
  
!    if (SelectFileName ("Please select a file to OPEN ...",file_name) == INVALID)
!       return;
  
     strcat (file_name, ".obj");
  
!    if ((fp = fopen (file_name, "r")) == NULL)
     {
        sprintf (s, "Can not open '%s'.", file_name);
***************
*** 758,762 ****
  
     fclose (fp);
!    strcpy (curFileName, file_name);
     curFileDefined = TRUE;
  
--- 755,760 ----
  
     fclose (fp);
!    SetCurDir (file_name);
!    *curSymDir = '\0';
     curFileDefined = TRUE;
  
***************
*** 1012,1017 ****
              }
  
!             strcpy (ps_file, curDomainName);
!             if (*curDomainName != '\0') strcat (ps_file, "/");
              strcat (ps_file, curFileName);
              len = strlen (ps_file);
--- 1010,1015 ----
              }
  
!             strcpy (ps_file, curDir);
!             strcat (ps_file, "/");
              strcat (ps_file, curFileName);
              len = strlen (ps_file);
*** font.c.orig	Sat Oct 27 17:48:30 1990
--- font.c	Sat Oct 27 17:48:31 1990
***************
*** 6,10 ****
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/font.c,v 1.9 90/08/16 15:44:24 william Exp $";
  #endif
  
--- 6,10 ----
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/font.c,v 1.11 90/10/27 15:45:24 william Exp $";
  #endif
  
***************
*** 25,35 ****
  #include "text.e"
  
- #define COUR8R  24
- #define COUR10R 25
- #define COUR12R 26
- #define COUR14R 27
- #define COUR18R 28
- #define COUR24R 29
- 
  #define FONTS_PER_DPI (((MAXFONTS-1)*MAXFONTSTYLES+1)*MAXFONTSIZES)
  #define FONTTABLESIZE (MAXFONTDPIS*FONTS_PER_DPI)
--- 25,28 ----
***************
*** 37,40 ****
--- 30,47 ----
  /* #define FONTTABLESIZE (MAXFONTSIZES*MAXFONTSTYLES*MAXFONTS) */
  
+ #define COUR8R_75  FontIndex(FONT_DPI_75,FONT_COU,0,STYLE_NR)
+ #define COUR10R_75 FontIndex(FONT_DPI_75,FONT_COU,1,STYLE_NR)
+ #define COUR12R_75 FontIndex(FONT_DPI_75,FONT_COU,2,STYLE_NR)
+ #define COUR14R_75 FontIndex(FONT_DPI_75,FONT_COU,3,STYLE_NR)
+ #define COUR18R_75 FontIndex(FONT_DPI_75,FONT_COU,4,STYLE_NR)
+ #define COUR24R_75 FontIndex(FONT_DPI_75,FONT_COU,5,STYLE_NR)
+ 
+ #define COUR11R_100 FontIndex(FONT_DPI_100,FONT_COU,0,STYLE_NR)
+ #define COUR14R_100 FontIndex(FONT_DPI_100,FONT_COU,1,STYLE_NR)
+ #define COUR17R_100 FontIndex(FONT_DPI_100,FONT_COU,2,STYLE_NR)
+ #define COUR20R_100 FontIndex(FONT_DPI_100,FONT_COU,3,STYLE_NR)
+ #define COUR25R_100 FontIndex(FONT_DPI_100,FONT_COU,4,STYLE_NR)
+ #define COUR34R_100 FontIndex(FONT_DPI_100,FONT_COU,5,STYLE_NR)
+ 
  struct MyFontRec {
     XFontStruct	* xfs;
***************
*** 382,385 ****
--- 389,393 ----
  {
     register int	i;
+    int		ruler_index, default_index;
  
     pointSize = (curFontDPI==FONT_DPI_75) ? pointSize75 : pointSize100;
***************
*** 388,404 ****
     for (i = 0; i < FONTTABLESIZE; i++) myFontInfo[i].valid = FALSE;
  
!    if ((myFontInfo[COUR18R].xfs =
!          XLoadQueryFont (mainDisplay, fontNameStr[COUR18R])) == NULL)
!    { printf ("Can not open %s.  Abort.\n\n", fontNameStr[COUR18R]); exit (-1); }
  
!    myFontInfo[COUR18R].valid = TRUE;
  
!    if ((myFontInfo[COUR10R].xfs =
!          XLoadQueryFont (mainDisplay, fontNameStr[COUR10R])) == NULL)
!    { printf ("Can not open %s.  Abort.\n\n", fontNameStr[COUR10R]); exit (-1); }
  
!    myFontInfo[COUR10R].valid = TRUE;
! 
!    rulerFontPtr = myFontInfo[COUR10R].xfs;
     rulerFontWidth = rulerFontPtr->max_bounds.width;
     rulerFontAsc = rulerFontPtr->max_bounds.ascent;
--- 396,445 ----
     for (i = 0; i < FONTTABLESIZE; i++) myFontInfo[i].valid = FALSE;
  
!    default_index = COUR18R_75;
!    if ((myFontInfo[default_index].xfs =
!          XLoadQueryFont (mainDisplay, fontNameStr[default_index])) == NULL)
!    {
!       default_index = COUR17R_100;
!       if ((myFontInfo[default_index].xfs =
!             XLoadQueryFont (mainDisplay, fontNameStr[default_index])) == NULL)
!       {
!          printf ("Can not open %s or %s.  Abort.\n\n",
!                fontNameStr[COUR18R_75], fontNameStr[COUR17R_100]);
!          exit (-1);
!       }
!    }
!    myFontInfo[default_index].valid = TRUE;
  
!    if (default_index == COUR18R_75)
!    {
!       ruler_index = COUR10R_75;
!       if ((myFontInfo[ruler_index].xfs =
!             XLoadQueryFont (mainDisplay, fontNameStr[ruler_index])) == NULL)
!       {
!          printf ("Can not open %s.  Abort.\n\n", fontNameStr[ruler_index]);
!          exit (-1);
!       }
!       curFontDPI = FONT_DPI_75;
!    }
!    else
!    {
!       ruler_index = COUR11R_100;
!       if ((myFontInfo[ruler_index].xfs =
!             XLoadQueryFont (mainDisplay, fontNameStr[ruler_index])) == NULL)
!       {
!          printf ("Can not open %s.  Abort.\n\n", fontNameStr[ruler_index]);
!          exit (-1);
!       }
!       curFontDPI = FONT_DPI_100;
!    }
!    myFontInfo[ruler_index].valid = TRUE;
  
!    defaultFontPtr = myFontInfo[default_index].xfs;
!    defaultFontWidth = defaultFontPtr->max_bounds.width;
!    defaultFontAsc = defaultFontPtr->max_bounds.ascent;
!    defaultFontDes = defaultFontPtr->max_bounds.descent;
!    defaultFontHeight = defaultFontAsc + defaultFontDes;
  
!    rulerFontPtr = myFontInfo[ruler_index].xfs;
     rulerFontWidth = rulerFontPtr->max_bounds.width;
     rulerFontAsc = rulerFontPtr->max_bounds.ascent;
***************
*** 405,414 ****
     rulerFontDes = rulerFontPtr->max_bounds.descent;
     rulerFontHeight = rulerFontAsc + rulerFontDes;
- 
-    defaultFontPtr = myFontInfo[COUR18R].xfs;
-    defaultFontWidth = defaultFontPtr->max_bounds.width;
-    defaultFontAsc = defaultFontPtr->max_bounds.ascent;
-    defaultFontDes = defaultFontPtr->max_bounds.descent;
-    defaultFontHeight = defaultFontAsc + defaultFontDes;
  }
  
--- 446,449 ----
*** frontend.c.orig	Sat Oct 27 17:48:35 1990
--- frontend.c	Sat Oct 27 17:48:36 1990
***************
*** 0 ****
--- 1,13 ----
+ /*
+  * Author:	William Chia-Wei Cheng (william at cs.ucla.edu)
+  *
+  * Copyright (C) 1990, William Cheng.
+  */
+ #ifndef lint
+ static char RCSid[] =
+       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/frontend.c,v 1.1 90/08/28 09:56:33 william Exp $";
+ #endif
+ 
+ int	lastFile;
+ short	* pDrawFontAsc;
+ short	* pDrawFontDes;
*** mainloop.c.orig	Sat Oct 27 17:48:42 1990
--- mainloop.c	Sat Oct 27 17:48:43 1990
***************
*** 6,10 ****
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/mainloop.c,v 1.15 90/08/16 09:35:09 william Exp $";
  #endif
  
--- 6,10 ----
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/mainloop.c,v 1.20 90/10/25 15:02:22 william Exp $";
  #endif
  
***************
*** 42,46 ****
  char	initMsg1[80], initMsg2[80];
  
! static quitDraw = TRUE;
  
  static
--- 42,46 ----
  char	initMsg1[80], initMsg2[80];
  
! static int	quitDraw = TRUE;
  
  static
***************
*** 150,154 ****
  {
     XEvent		input, ev;
!    char			* c_ptr, file_name[256], s[256];
     int			shorthand_rc, draw_rc;
     struct ObjRec	* obj_ptr;
--- 150,155 ----
  {
     XEvent		input, ev;
!    char			* c_ptr, file_name[MAXPATHLENGTH], s[MAXPATHLENGTH];
!    char			full_name[MAXPATHLENGTH];
     int			shorthand_rc, draw_rc;
     struct ObjRec	* obj_ptr;
***************
*** 199,203 ****
  
              fclose (fp);
!             strcpy (curFileName, file_name);
              curFileDefined = TRUE;
  
--- 200,214 ----
  
              fclose (fp);
! 
!             if (*file_name == '/')
!                strcat (full_name, file_name);
!             else
!             {
!                strcpy (full_name, curDir);
!                strcat (full_name, "/");
!                strcat (full_name, file_name);
!             }
!             SetCurDir (full_name);
!             *curSymDir = '\0';
              curFileDefined = TRUE;
  
***************
*** 207,210 ****
--- 218,222 ----
           }
        }
+       UpdateDirInfo ();
     }
     SaveDrawWinInfo ();
*** menu.c.orig	Sat Oct 27 17:48:53 1990
--- menu.c	Sat Oct 27 17:48:55 1990
***************
*** 6,10 ****
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/menu.c,v 1.12 90/08/15 16:00:27 william Exp $";
  #endif
  
--- 6,10 ----
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/menu.c,v 1.14 90/10/25 14:58:18 william Exp $";
  #endif
  
***************
*** 485,493 ****
     if (curFileDefined)
     {
!       strcpy (file_name, curFileName);
!       strcpy (s, curDomainName);
!       if (*curDomainName != '\0') strcat (s, "/");
!       strcat (s, file_name);
     }
  
     if (fileModified) strcat (s, " [Modified]");
--- 485,495 ----
     if (curFileDefined)
     {
!       if (*curSymDir == '\0')
!          sprintf (s, "%s:%s/%s", curDomainName, curDir, curFileName);
!       else
!          sprintf (s, "%s:%s/%s", curDomainName, curSymDir, curFileName);
     }
+    else
+       sprintf (s, "%s:[Unnamed]", curDomainName);
  
     if (fileModified) strcat (s, " [Modified]");
---------------------------------> cut here <---------------------------------
-- 
Bill Cheng // UCLA Computer Science Department // (213) 206-7135
3277 Boelter Hall // Los Angeles, California 90024 // USA
william at CS.UCLA.EDU      ...!{uunet|ucbvax}!cs.ucla.edu!william

dan
----------------------------------------------------
O'Reilly && Associates   argv at sun.com / argv at ora.com
Opinions expressed reflect those of the author only.
--
dan
----------------------------------------------------
O'Reilly && Associates   argv at sun.com / argv at ora.com
Opinions expressed reflect those of the author only.



More information about the Comp.sources.x mailing list