home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume8 / tgif / patch1.03 < prev    next >
Internet Message Format  |  1990-07-08  |  61KB

  1. Path: uunet!cs.utexas.edu!sun-barr!newstop!sun!CS.UCLA.EDU
  2. From: william@CS.UCLA.EDU (William Cheng)
  3. Newsgroups: comp.sources.x
  4. Subject: v08i048: tgif 1.9, Patch1, Part03/03
  5. Message-ID: <138564@sun.Eng.Sun.COM>
  6. Date: 9 Jul 90 07:22:23 GMT
  7. Sender: news@sun.Eng.Sun.COM
  8. Lines: 1941
  9. Approved: argv@sun.com
  10.  
  11. Submitted-by: william@CS.UCLA.EDU (William Cheng)
  12. Posting-number: Volume 8, Issue 48
  13. Archive-name: tgif/patch2.03
  14. Patch-To: tgif: Volume 7, Issue 56-76
  15.  
  16.  
  17. Here is part 03 of the patch that takes tgif from version 1.2 to 1.9.
  18. The most recent version is available for anonymous ftp at the following places.
  19.  
  20.         expo.lcs.mit.edu        contrib/tgif-1.9.tar.Z
  21.         rye.cs.ucla.edu         pub/tgif-1.9.tar.Z
  22.  
  23. --Bill
  24. ---------------------------------> cut here <---------------------------------
  25. *** setup.c.orig    Wed Jun 27 13:30:39 1990
  26. --- setup.c    Wed Jun 27 13:30:41 1990
  27. ***************
  28. *** 6,10 ****
  29.   #ifndef lint
  30.   static char RCSid[] =
  31. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/setup.c,v 1.3 90/05/15 09:33:59 william Exp $";
  32.   #endif
  33.   
  34. --- 6,10 ----
  35.   #ifndef lint
  36.   static char RCSid[] =
  37. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/setup.c,v 1.8 90/06/26 00:13:09 william Exp $";
  38.   #endif
  39.   
  40. ***************
  41. *** 105,110 ****
  42.   int    objId = 0;
  43.   
  44. ! int    myBlackPixel;
  45. ! int    myWhitePixel;
  46.   
  47.   char    drawPath[255];
  48. --- 105,112 ----
  49.   int    objId = 0;
  50.   
  51. ! int    myBgPixel;
  52. ! int    myFgPixel;
  53. ! int    myBorderPixel;
  54. ! int    reverseVideo = FALSE;
  55.   
  56.   char    drawPath[255];
  57. ***************
  58. *** 206,210 ****
  59.   void Setup ()
  60.   {
  61. !    int        num_of_planes, brdr_pixel, bg_pixel, bitmask = 0, index;
  62.      char        * c_ptr;
  63.      Window    root_win;
  64. --- 208,212 ----
  65.   void Setup ()
  66.   {
  67. !    int        num_of_planes, bitmask = 0, index;
  68.      char        * c_ptr;
  69.      Window    root_win;
  70. ***************
  71. *** 219,236 ****
  72.      InitColor ();
  73.   
  74. -    bg_pixel = myBlackPixel;
  75. -    if ((c_ptr = XGetDefault (mainDisplay, TOOL_NAME, "BorderColor")) == NULL ||
  76. -          XParseColor (mainDisplay, mainColormap, c_ptr, &color) == 0 ||
  77. -          XAllocColor (mainDisplay, mainColormap, &color) == 0)
  78. -       brdr_pixel = myWhitePixel;
  79. -    else
  80. -       brdr_pixel = color.pixel;
  81.      if ((c_ptr = getenv ("TGIFPATH")) == NULL)
  82. !       strcpy (drawPath, "/u/tangram/u/william/X11/TGIF");
  83.      else
  84.         if (strlen (c_ptr) >= 255)
  85. !          strcpy (drawPath, "/u/tangram/u/william/X11/TGIF");
  86.         else
  87.            strcpy (drawPath, c_ptr);
  88. --- 221,229 ----
  89.      InitColor ();
  90.   
  91.      if ((c_ptr = getenv ("TGIFPATH")) == NULL)
  92. !       strcpy (drawPath, TGIF_PATH);
  93.      else
  94.         if (strlen (c_ptr) >= 255)
  95. !          strcpy (drawPath, TGIF_PATH);
  96.         else
  97.            strcpy (drawPath, c_ptr);
  98. ***************
  99. *** 294,298 ****
  100.      if ((mainWindow = XCreateSimpleWindow (mainDisplay, rootWindow,
  101.            sizehints.x, sizehints.y, sizehints.width, sizehints.height,
  102. !          brdrW, brdr_pixel, bg_pixel)) == 0)
  103.      { printf ("Could not create main window!\n"); exit(1); }
  104.   
  105. --- 287,291 ----
  106.      if ((mainWindow = XCreateSimpleWindow (mainDisplay, rootWindow,
  107.            sizehints.x, sizehints.y, sizehints.width, sizehints.height,
  108. !          brdrW, myBorderPixel, myBgPixel)) == 0)
  109.      { printf ("Could not create main window!\n"); exit(1); }
  110.   
  111. ***************
  112. *** 310,319 ****
  113.   
  114.      if ((titleWindow = XCreateSimpleWindow (mainDisplay, mainWindow, 0, 0,
  115. !          titleWindowW, titleWindowH, brdrW, brdr_pixel, bg_pixel)) == 0) 
  116.      { printf ("Could not create menu window!\n"); exit(1); }
  117.   
  118.      if ((msgWindow = XCreateSimpleWindow (mainDisplay, mainWindow, 0,
  119. !          titleWindowH+2*brdrW, msgWindowW, msgWindowH, brdrW, brdr_pixel,
  120. !          bg_pixel)) == 0)
  121.      { printf ("Could not create message window!\n"); exit(1); }
  122.   
  123. --- 303,312 ----
  124.   
  125.      if ((titleWindow = XCreateSimpleWindow (mainDisplay, mainWindow, 0, 0,
  126. !          titleWindowW, titleWindowH, brdrW, myBorderPixel, myBgPixel)) == 0) 
  127.      { printf ("Could not create menu window!\n"); exit(1); }
  128.   
  129.      if ((msgWindow = XCreateSimpleWindow (mainDisplay, mainWindow, 0,
  130. !          titleWindowH+2*brdrW, msgWindowW, msgWindowH, brdrW, myBorderPixel,
  131. !          myBgPixel)) == 0)
  132.      { printf ("Could not create message window!\n"); exit(1); }
  133.   
  134. ***************
  135. *** 320,324 ****
  136.      if ((choiceWindow = XCreateSimpleWindow (mainDisplay, mainWindow,
  137.            msgWindowW+2*brdrW, titleWindowH+2*brdrW, choiceWindowW, choiceWindowH,
  138. !          brdrW, brdr_pixel, bg_pixel)) == 0)
  139.      { printf ("Could not create choice window!\n"); exit(1); }
  140.   
  141. --- 313,317 ----
  142.      if ((choiceWindow = XCreateSimpleWindow (mainDisplay, mainWindow,
  143.            msgWindowW+2*brdrW, titleWindowH+2*brdrW, choiceWindowW, choiceWindowH,
  144. !          brdrW, myBorderPixel, myBgPixel)) == 0)
  145.      { printf ("Could not create choice window!\n"); exit(1); }
  146.   
  147. ***************
  148. *** 327,331 ****
  149.      if ((hRuleWindow = XCreateSimpleWindow (mainDisplay, mainWindow,
  150.            rulerW+2*brdrW, titleWindowH+choiceWindowH+4*brdrW, drawWinW, rulerW,
  151. !          brdrW, brdr_pixel, bg_pixel)) == 0)
  152.      { printf ("Could not create horizontal ruler window!\n"); exit(1); }
  153.   
  154. --- 320,324 ----
  155.      if ((hRuleWindow = XCreateSimpleWindow (mainDisplay, mainWindow,
  156.            rulerW+2*brdrW, titleWindowH+choiceWindowH+4*brdrW, drawWinW, rulerW,
  157. !          brdrW, myBorderPixel, myBgPixel)) == 0)
  158.      { printf ("Could not create horizontal ruler window!\n"); exit(1); }
  159.   
  160. ***************
  161. *** 332,336 ****
  162.      if ((vRuleWindow = XCreateSimpleWindow (mainDisplay, mainWindow, 0,
  163.            titleWindowH+rulerW+choiceWindowH+6*brdrW, rulerW, drawWinH,
  164. !          brdrW, brdr_pixel, bg_pixel)) == 0)
  165.      { printf ("Could not create vertical ruler window!\n"); exit(1); }
  166.   
  167. --- 325,329 ----
  168.      if ((vRuleWindow = XCreateSimpleWindow (mainDisplay, mainWindow, 0,
  169.            titleWindowH+rulerW+choiceWindowH+6*brdrW, rulerW, drawWinH,
  170. !          brdrW, myBorderPixel, myBgPixel)) == 0)
  171.      { printf ("Could not create vertical ruler window!\n"); exit(1); }
  172.   
  173. ***************
  174. *** 337,341 ****
  175.      if ((drawWindow = XCreateSimpleWindow (mainDisplay, mainWindow,
  176.            rulerW+2*brdrW, titleWindowH+rulerW+choiceWindowH+6*brdrW,
  177. !          drawWinW, drawWinH, brdrW, brdr_pixel, bg_pixel)) == 0) 
  178.      { printf ("Could not create draw window!\n"); exit(1); }
  179.   
  180. --- 330,334 ----
  181.      if ((drawWindow = XCreateSimpleWindow (mainDisplay, mainWindow,
  182.            rulerW+2*brdrW, titleWindowH+rulerW+choiceWindowH+6*brdrW,
  183. !          drawWinW, drawWinH, brdrW, myBorderPixel, myBgPixel)) == 0) 
  184.      { printf ("Could not create draw window!\n"); exit(1); }
  185.   
  186. ***************
  187. *** 342,346 ****
  188.      if ((vSBarWindow = XCreateSimpleWindow (mainDisplay, mainWindow,
  189.            4*brdrW+rulerW+drawWinW, titleWindowH+choiceWindowH+4*brdrW,
  190. !          scrollBarW, vSBarH, brdrW, brdr_pixel, bg_pixel)) == 0) 
  191.      { printf ("Could not create vertical scrollbar window!\n"); exit(1); }
  192.   
  193. --- 335,339 ----
  194.      if ((vSBarWindow = XCreateSimpleWindow (mainDisplay, mainWindow,
  195.            4*brdrW+rulerW+drawWinW, titleWindowH+choiceWindowH+4*brdrW,
  196. !          scrollBarW, vSBarH, brdrW, myBorderPixel, myBgPixel)) == 0) 
  197.      { printf ("Could not create vertical scrollbar window!\n"); exit(1); }
  198.   
  199. ***************
  200. *** 347,351 ****
  201.      if ((hSBarWindow = XCreateSimpleWindow (mainDisplay, mainWindow, 0,
  202.            titleWindowH+rulerW+drawWinH+choiceWindowH+8*brdrW,
  203. !          hSBarW, scrollBarW, brdrW, brdr_pixel, bg_pixel)) == 0) 
  204.      { printf ("Could not create horizontal scrollbar window!\n"); exit(1); }
  205.   
  206. --- 340,344 ----
  207.      if ((hSBarWindow = XCreateSimpleWindow (mainDisplay, mainWindow, 0,
  208.            titleWindowH+rulerW+drawWinH+choiceWindowH+8*brdrW,
  209. !          hSBarW, scrollBarW, brdrW, myBorderPixel, myBgPixel)) == 0) 
  210.      { printf ("Could not create horizontal scrollbar window!\n"); exit(1); }
  211.   
  212. ***************
  213. *** 353,357 ****
  214.            rulerW+drawWinW+4*brdrW,
  215.            titleWindowH+choiceWindowH+rulerW+drawWinH+8*brdrW,
  216. !          scrollBarW, scrollBarW, brdrW, brdr_pixel, bg_pixel)) == 0) 
  217.      { printf ("Could not create dummy window!\n"); exit(1); }
  218.   
  219. --- 346,350 ----
  220.            rulerW+drawWinW+4*brdrW,
  221.            titleWindowH+choiceWindowH+rulerW+drawWinH+8*brdrW,
  222. !          scrollBarW, scrollBarW, brdrW, myBorderPixel, myBgPixel)) == 0) 
  223.      { printf ("Could not create dummy window!\n"); exit(1); }
  224.   
  225. ***************
  226. *** 358,362 ****
  227.      if ((dummyWindow2 = XCreateSimpleWindow (mainDisplay, mainWindow, 0,
  228.            titleWindowH+choiceWindowH+4*brdrW, rulerW, rulerW,
  229. !          brdrW, brdr_pixel, bg_pixel)) == 0) 
  230.      { printf ("Could not create dummy window!\n"); exit(1); }
  231.   
  232. --- 351,355 ----
  233.      if ((dummyWindow2 = XCreateSimpleWindow (mainDisplay, mainWindow, 0,
  234.            titleWindowH+choiceWindowH+4*brdrW, rulerW, rulerW,
  235. !          brdrW, myBorderPixel, myBgPixel)) == 0) 
  236.      { printf ("Could not create dummy window!\n"); exit(1); }
  237.   
  238. ***************
  239. *** 406,408 ****
  240. --- 399,411 ----
  241.      if (curChoice == DRAWTEXT) return (CreateTextObj ());
  242.      return (FALSE);
  243. + }
  244. + void SetFileModified (modified)
  245. +    int    modified;
  246. + {
  247. +    if (modified != fileModified)
  248. +    {
  249. +       fileModified = modified;
  250. +       RedrawTitleWindow ();
  251. +    }
  252.   }
  253. *** special.c.orig    Wed Jun 27 13:30:53 1990
  254. --- special.c    Wed Jun 27 13:30:55 1990
  255. ***************
  256. *** 6,10 ****
  257.   #ifndef lint
  258.   static char RCSid[] =
  259. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/special.c,v 1.1 90/04/01 22:16:42 william Exp $";
  260.   #endif
  261.   
  262. --- 6,10 ----
  263.   #ifndef lint
  264.   static char RCSid[] =
  265. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/special.c,v 1.4 90/06/26 13:05:00 william Exp $";
  266.   #endif
  267.   
  268. ***************
  269. *** 74,81 ****
  270.      struct ObjRec    * obj_ptr;
  271.      struct AttrRec       * attr_ptr, * top_attr = NULL, * bot_attr = NULL;
  272. !    char            inbuf[255], obj_name[10];
  273.      int            len;
  274.   
  275. !    while (fgets (inbuf, 255, FP) != NULL)
  276.      {
  277.         len = strlen (inbuf) - 1;
  278. --- 74,81 ----
  279.      struct ObjRec    * obj_ptr;
  280.      struct AttrRec       * attr_ptr, * top_attr = NULL, * bot_attr = NULL;
  281. !    char            inbuf[MAXPATHLENGTH], obj_name[10];
  282.      int            len;
  283.   
  284. !    while (fgets (inbuf, MAXPATHLENGTH, FP) != NULL)
  285.      {
  286.         len = strlen (inbuf) - 1;
  287. ***************
  288. *** 185,189 ****
  289.   void Instantiate ()
  290.   {
  291. !    char            file_name[80], sym_name[80], full_name[MAXPATHLENGTH];
  292.      struct ObjRec    * obj_ptr;
  293.      FILE            * fp;
  294. --- 185,189 ----
  295.   void Instantiate ()
  296.   {
  297. !    char            file_name[MAXPATHLENGTH], sym_name[MAXPATHLENGTH], full_name[MAXPATHLENGTH];
  298.      struct ObjRec    * obj_ptr;
  299.      FILE            * fp;
  300. ***************
  301. *** 220,224 ****
  302.         if (topObj != NULL) SelectTopObj ();
  303.         ShowCursor ();
  304. !       fileModified = TRUE;
  305.         justDupped = FALSE;
  306.      }
  307. --- 220,224 ----
  308.         if (topObj != NULL) SelectTopObj ();
  309.         ShowCursor ();
  310. !       SetFileModified (TRUE);
  311.         justDupped = FALSE;
  312.      }
  313. ***************
  314. *** 234,238 ****
  315.         topSel->obj->type = OBJ_SYM;
  316.         Msg ("Selected GROUP object is now SYMBOLIC.");
  317. !       fileModified = TRUE;
  318.         AdjObjBBox (topSel->obj);
  319.         UpdSelBBox ();
  320. --- 234,238 ----
  321.         topSel->obj->type = OBJ_SYM;
  322.         Msg ("Selected GROUP object is now SYMBOLIC.");
  323. !       SetFileModified (TRUE);
  324.         AdjObjBBox (topSel->obj);
  325.         UpdSelBBox ();
  326. ***************
  327. *** 280,284 ****
  328.      {
  329.         HighLightReverse ();
  330. !       fileModified = TRUE;
  331.         UpdSelBBox ();
  332.         RedrawAnArea (botObj,
  333. --- 280,284 ----
  334.      {
  335.         HighLightReverse ();
  336. !       SetFileModified (TRUE);
  337.         UpdSelBBox ();
  338.         RedrawAnArea (botObj,
  339. ***************
  340. *** 291,297 ****
  341.   void MakeIconic ()
  342.   {
  343. !    char         icon_name[80], file_name[80], s[255];
  344.      FILE            * fp;
  345.      struct ObjRec    * saved_obj_ptr;
  346.   
  347.      if (topSel!=NULL && topSel==botSel && topSel->obj->type==OBJ_GROUP)
  348. --- 291,299 ----
  349.   void MakeIconic ()
  350.   {
  351. !    char         icon_name[MAXPATHLENGTH], file_name[MAXPATHLENGTH];
  352. !    char         s[MAXPATHLENGTH];
  353.      FILE            * fp;
  354.      struct ObjRec    * saved_obj_ptr;
  355. +    int            len;
  356.   
  357.      if (topSel!=NULL && topSel==botSel && topSel->obj->type==OBJ_GROUP)
  358. ***************
  359. *** 298,301 ****
  360. --- 300,304 ----
  361.      {
  362.         Dialog ("Please Enter Name of the Icon:", icon_name);
  363. +       len = strlen (icon_name);
  364.         if (*icon_name == '\0')
  365.         {
  366. ***************
  367. *** 303,310 ****
  368.            return;
  369.         }
  370.         if (*curDomainName != '\0')
  371. !          sprintf (file_name, "%s/%s.sym", curDomainName, icon_name);
  372.         else
  373. !          sprintf (file_name, "%s.sym", icon_name);
  374.         if (!OkayToCreateFile (file_name)) return;
  375.         if ((fp = fopen (file_name, "w")) == NULL)
  376. --- 306,333 ----
  377.            return;
  378.         }
  379. +       if (strlen (icon_name) >= 4)
  380. +       {
  381. +          if (strcmp (&icon_name[len-4], ".obj") == 0)
  382. +          {
  383. +             Msg ("Can not save as a .obj file, icon not created.");
  384. +             return;
  385. +          }
  386. +          else if (strcmp (&icon_name[len-4], ".sym") != 0)
  387. +             strcat (icon_name, ".sym");
  388. +          if (strlen (icon_name) == 4)
  389. +          {
  390. +             Msg ("No file name specified.  File not saved.");
  391. +             return;
  392. +          }
  393. +       }
  394. +       else
  395. +          strcat (icon_name, ".sym");
  396.         if (*curDomainName != '\0')
  397. !          sprintf (file_name, "%s/%s", curDomainName, icon_name);
  398.         else
  399. !          sprintf (file_name, "%s", icon_name);
  400.         if (!OkayToCreateFile (file_name)) return;
  401.         if ((fp = fopen (file_name, "w")) == NULL)
  402. ***************
  403. *** 332,336 ****
  404.         topSel->obj->detail.r->id = objId++;
  405.         Msg ("Selected GROUP object is now ICONIC.");
  406. !       fileModified = TRUE;
  407.         AdjObjBBox (topSel->obj);
  408.         UpdSelBBox ();
  409. --- 355,359 ----
  410.         topSel->obj->detail.r->id = objId++;
  411.         Msg ("Selected GROUP object is now ICONIC.");
  412. !       SetFileModified (TRUE);
  413.         AdjObjBBox (topSel->obj);
  414.         UpdSelBBox ();
  415. ***************
  416. *** 366,370 ****
  417.      {
  418.         Msg ("Selected ICONIC objects are GROUP objects now.");
  419. !       fileModified = TRUE;
  420.         UpdSelBBox ();
  421.         RedrawAnArea (botObj, selLtX-(1<<zoomScale), selLtY-(1<<zoomScale),
  422. --- 389,393 ----
  423.      {
  424.         Msg ("Selected ICONIC objects are GROUP objects now.");
  425. !       SetFileModified (TRUE);
  426.         UpdSelBBox ();
  427.         RedrawAnArea (botObj, selLtX-(1<<zoomScale), selLtY-(1<<zoomScale),
  428. ***************
  429. *** 378,382 ****
  430.   {
  431.      register int    index;
  432. -    char        s[80];
  433.      int        * fore_colors, * valid;
  434.   
  435. --- 401,404 ----
  436. *** spline.c.orig    Wed Jun 27 13:31:02 1990
  437. --- spline.c    Wed Jun 27 13:31:04 1990
  438. ***************
  439. *** 6,10 ****
  440.   #ifndef lint
  441.   static char RCSid[] =
  442. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/spline.c,v 1.1 90/04/30 10:36:03 william Exp $";
  443.   #endif
  444.   
  445. --- 6,10 ----
  446.   #ifndef lint
  447.   static char RCSid[] =
  448. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/spline.c,v 1.2 90/05/22 14:38:02 william Exp $";
  449.   #endif
  450.   
  451. ***************
  452. *** 181,185 ****
  453.      {
  454.         sv[sn].x = sv[0].x; sv[sn].y = sv[0].y;
  455. !       values.foreground = (Fill == 2) ? myBlackPixel : Pixel;
  456.         values.function = GXcopy;
  457.         values.fill_style = FillOpaqueStippled;
  458. --- 181,185 ----
  459.      {
  460.         sv[sn].x = sv[0].x; sv[sn].y = sv[0].y;
  461. !       values.foreground = (Fill == 2) ? myBgPixel : Pixel;
  462.         values.function = GXcopy;
  463.         values.fill_style = FillOpaqueStippled;
  464. ***************
  465. *** 194,198 ****
  466.      if (Pen != 0)
  467.      {
  468. !       values.foreground = (Pen == 2) ? myBlackPixel : Pixel;
  469.         values.function = GXcopy;
  470.         values.fill_style = FillOpaqueStippled;
  471. --- 194,198 ----
  472.      if (Pen != 0)
  473.      {
  474. !       values.foreground = (Pen == 2) ? myBgPixel : Pixel;
  475.         values.function = GXcopy;
  476.         values.fill_style = FillOpaqueStippled;
  477. ***************
  478. *** 292,296 ****
  479.      if (Fill != 0)
  480.      {
  481. !       values.foreground = (Fill == 2) ? myBlackPixel : Pixel;
  482.         values.function = GXcopy;
  483.         values.fill_style = FillOpaqueStippled;
  484. --- 292,296 ----
  485.      if (Fill != 0)
  486.      {
  487. !       values.foreground = (Fill == 2) ? myBgPixel : Pixel;
  488.         values.function = GXcopy;
  489.         values.fill_style = FillOpaqueStippled;
  490. ***************
  491. *** 303,307 ****
  492.      if (Pen != 0)
  493.      {
  494. !       values.foreground = (Pen == 2) ? myBlackPixel : Pixel;
  495.         values.function = GXcopy;
  496.         values.fill_style = FillOpaqueStippled;
  497. --- 303,307 ----
  498.      if (Pen != 0)
  499.      {
  500. !       values.foreground = (Pen == 2) ? myBgPixel : Pixel;
  501.         values.function = GXcopy;
  502.         values.fill_style = FillOpaqueStippled;
  503. *** stk.c.orig    Wed Jun 27 13:31:12 1990
  504. --- stk.c    Wed Jun 27 13:31:13 1990
  505. ***************
  506. *** 6,10 ****
  507.   #ifndef lint
  508.   static char RCSid[] =
  509. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/stk.c,v 1.1 90/04/01 22:16:44 william Exp $";
  510.   #endif
  511.   
  512. --- 6,10 ----
  513.   #ifndef lint
  514.   static char RCSid[] =
  515. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/stk.c,v 1.3 90/06/26 00:11:30 william Exp $";
  516.   #endif
  517.   
  518. ***************
  519. *** 49,53 ****
  520.      struct StkRec    * stk_ptr;
  521.      struct ObjRec    * obj_ptr;
  522. !    char            file_name[80], s[80], full_name[MAXPATHLENGTH];
  523.      FILE            * fp;
  524.   
  525. --- 49,54 ----
  526.      struct StkRec    * stk_ptr;
  527.      struct ObjRec    * obj_ptr;
  528. !    char            file_name[MAXPATHLENGTH], s[MAXPATHLENGTH];
  529. !    char            full_name[MAXPATHLENGTH];
  530.      FILE            * fp;
  531.   
  532. ***************
  533. *** 128,132 ****
  534.      curFileDefined = TRUE;
  535.   
  536. !    fileModified = FALSE;
  537.      sprintf (s, "Current file is '%s'.", file_name);
  538.      Msg (s);
  539. --- 129,133 ----
  540.      curFileDefined = TRUE;
  541.   
  542. !    SetFileModified (FALSE);
  543.      sprintf (s, "Current file is '%s'.", file_name);
  544.      Msg (s);
  545. ***************
  546. *** 137,141 ****
  547.   void PopIcon ()
  548.   {
  549. !    char    dummy[80];
  550.   
  551.      if (topStk == NULL)
  552. --- 138,142 ----
  553.   void PopIcon ()
  554.   {
  555. !    char    dummy[MAXPATHLENGTH];
  556.   
  557.      if (topStk == NULL)
  558. *** stretch.c.orig    Wed Jun 27 13:31:29 1990
  559. --- stretch.c    Wed Jun 27 13:31:33 1990
  560. ***************
  561. *** 6,10 ****
  562.   #ifndef lint
  563.   static char RCSid[] =
  564. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/stretch.c,v 1.1 90/04/01 22:16:45 william Exp $";
  565.   #endif
  566.   
  567. --- 6,10 ----
  568.   #ifndef lint
  569.   static char RCSid[] =
  570. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/stretch.c,v 1.4 90/06/26 00:11:32 william Exp $";
  571.   #endif
  572.   
  573. ***************
  574. *** 173,181 ****
  575.      int        x, y, dx, dy, num, pixel, stretching = TRUE;
  576.      int        ltx, lty, rbx, rby, curved;
  577. !    int        grid_x = XGridOff, grid_y = YGridOff, new_grid_x, new_grid_y;
  578. !    Window    root_win, child_win;
  579. !    int        root_x, root_y;
  580. !    unsigned int    status;
  581. !    XGCValues    values;
  582.   
  583.      switch (ObjPtr->type)
  584. --- 173,178 ----
  585.      int        x, y, dx, dy, num, pixel, stretching = TRUE;
  586.      int        ltx, lty, rbx, rby, curved;
  587. !    int        grid_x = XGridOff, grid_y = YGridOff;
  588. !    XEvent    input;
  589.   
  590.      switch (ObjPtr->type)
  591. ***************
  592. *** 230,260 ****
  593.      rby = ObjPtr->bbox.rby;
  594.   
  595. !    XGrabPointer (mainDisplay, drawWindow, FALSE, ButtonReleaseMask,
  596.            GrabModeAsync, GrabModeAsync, None, handCursor, CurrentTime);
  597.   
  598. !    if (curved == LT_SPLINE) MyDashedLine (drawWindow, revDefaultGC, v, num);
  599.      dx = dy = 0;
  600.      while (stretching)
  601.      {
  602. !       XQueryPointer (mainDisplay, drawWindow, &root_win, &child_win,
  603. !             &root_x, &root_y, &x, &y, &status);
  604. !       GridXY (x, y, &new_grid_x, &new_grid_y);
  605. !       if (new_grid_x==grid_x && new_grid_y==grid_y && (status & Button1Mask)!=0)
  606. !          continue;
  607. !       grid_x = new_grid_x; grid_y = new_grid_y;
  608. !       MyDashedLine (drawWindow, revDefaultGC, v, num);
  609. !       dx = grid_x - XGridOff;
  610. !       dy = grid_y - YGridOff;
  611. !       v[1].x = OFFSET_X(V[Index].x) + dx;
  612. !       v[1].y = OFFSET_Y(V[Index].y) + dy;
  613. !       MarkRulers (grid_x, grid_y);
  614. !       if ((status & Button1Mask) == 0)
  615.         {
  616.            XUngrabPointer (mainDisplay, CurrentTime);
  617.            stretching = FALSE;
  618.            HighLightReverse ();
  619.   
  620. --- 227,245 ----
  621.      rby = ObjPtr->bbox.rby;
  622.   
  623. !    XGrabPointer (mainDisplay, drawWindow, FALSE,
  624. !          PointerMotionMask | ButtonReleaseMask,
  625.            GrabModeAsync, GrabModeAsync, None, handCursor, CurrentTime);
  626.   
  627. !    MyDashedLine (drawWindow, revDefaultGC, v, num);
  628.      dx = dy = 0;
  629.      while (stretching)
  630.      {
  631. !       XNextEvent (mainDisplay, &input);
  632. !       if (input.type == ButtonRelease)
  633.         {
  634.            XUngrabPointer (mainDisplay, CurrentTime);
  635.            stretching = FALSE;
  636. +          MyDashedLine (drawWindow, revDefaultGC, v, num);
  637.            HighLightReverse ();
  638.   
  639. ***************
  640. *** 303,315 ****
  641.                     ObjPtr->bbox.rbx+(1<<zoomScale),
  642.                     ObjPtr->bbox.rby+(1<<zoomScale));
  643. !             fileModified = TRUE;
  644.            }
  645. -          else
  646. -             MyDashedLine (drawWindow, revDefaultGC, v, num);
  647.            HighLightForward ();
  648.         }
  649. !       else
  650.            MyDashedLine (drawWindow, revDefaultGC, v, num);
  651.      }
  652.   }
  653. --- 288,311 ----
  654.                     ObjPtr->bbox.rbx+(1<<zoomScale),
  655.                     ObjPtr->bbox.rby+(1<<zoomScale));
  656. !             SetFileModified (TRUE);
  657.            }
  658.            HighLightForward ();
  659.         }
  660. !       else if (input.type == MotionNotify)
  661. !       {
  662. !          x = input.xmotion.x;
  663. !          y = input.xmotion.y;
  664. !          GridXY (x, y, &grid_x, &grid_y);
  665.            MyDashedLine (drawWindow, revDefaultGC, v, num);
  666. +          dx = grid_x - XGridOff;
  667. +          dy = grid_y - YGridOff;
  668. +          v[1].x = OFFSET_X(V[Index].x) + dx;
  669. +          v[1].y = OFFSET_Y(V[Index].y) + dy;
  670. +          MarkRulers (grid_x, grid_y);
  671. +          MyDashedLine (drawWindow, revDefaultGC, v, num);
  672. +       }
  673.      }
  674.   }
  675. ***************
  676. *** 516,525 ****
  677.      int        stretched_sel_ltx, stretched_sel_lty, stretched_sel_rbx;
  678.      int        stretched_sel_rby;
  679. -    Window    root_win, child_win;
  680. -    int        root_x, root_y;
  681. -    unsigned int    status;
  682.      double    obj_w, obj_h;
  683. !    int        grid_x = XGridOff, grid_y = YGridOff, new_grid_x, new_grid_y;
  684. !    XGCValues    values;
  685.   
  686.      SetPivot (Corner, ObjPtr->obbox);
  687. --- 512,518 ----
  688.      int        stretched_sel_ltx, stretched_sel_lty, stretched_sel_rbx;
  689.      int        stretched_sel_rby;
  690.      double    obj_w, obj_h;
  691. !    int        grid_x = XGridOff, grid_y = YGridOff;
  692. !    XEvent    input;
  693.   
  694.      SetPivot (Corner, ObjPtr->obbox);
  695. ***************
  696. *** 542,546 ****
  697.      obj_h = (double)(moveY - pivotY);
  698.   
  699. !    XGrabPointer (mainDisplay, drawWindow, FALSE, ButtonReleaseMask,
  700.            GrabModeAsync, GrabModeAsync, None, handCursor, CurrentTime);
  701.   
  702. --- 535,540 ----
  703.      obj_h = (double)(moveY - pivotY);
  704.   
  705. !    XGrabPointer (mainDisplay, drawWindow, FALSE,
  706. !          PointerMotionMask | ButtonReleaseMask,
  707.            GrabModeAsync, GrabModeAsync, None, handCursor, CurrentTime);
  708.   
  709. ***************
  710. *** 547,579 ****
  711.      while (stretching)
  712.      {
  713. !       XQueryPointer (mainDisplay, drawWindow, &root_win, &child_win,
  714. !             &root_x, &root_y, &x, &y, &status);
  715. !       GridXY (x, y, &new_grid_x, &new_grid_y);
  716. !       if (new_grid_x==grid_x && new_grid_y==grid_y && (status & Button1Mask)!=0)
  717. !          continue;
  718. !       grid_x = new_grid_x; grid_y = new_grid_y;
  719. !       MarkRulers (grid_x, grid_y);
  720. !       SelBox (drawWindow, revDefaultGC, stretched_ltx, stretched_lty,
  721. !             stretched_rbx, stretched_rby);
  722. !       SelBox (drawWindow, revDefaultGC, stretched_sel_ltx-1,
  723. !             stretched_sel_lty-1, stretched_sel_rbx+1, stretched_sel_rby+1);
  724. !       if (changeX)
  725. !          multX = (double)(moveX + grid_x - XGridOff - pivotX) / obj_w;
  726. !       else
  727. !          multX = (double)1.0;
  728. !       if (changeY)
  729. !          multY = (double)(moveY + grid_y - YGridOff - pivotY) / obj_h;
  730. !       else
  731. !          multY = (double)1.0;
  732. !       if ((status & Button1Mask) == 0)
  733.         {
  734.            XUngrabPointer (mainDisplay, CurrentTime);
  735.            stretching = FALSE;
  736.            if (multX != (double)1.0 || multY != (double)1.0)
  737.            {
  738. --- 541,555 ----
  739.      while (stretching)
  740.      {
  741. !       XNextEvent (mainDisplay, &input);
  742. !       if (input.type == ButtonRelease)
  743.         {
  744.            XUngrabPointer (mainDisplay, CurrentTime);
  745.            stretching = FALSE;
  746. +          SelBox (drawWindow, revDefaultGC, stretched_ltx, stretched_lty,
  747. +                stretched_rbx, stretched_rby);
  748. +          SelBox (drawWindow, revDefaultGC, stretched_sel_ltx-1,
  749. +                stretched_sel_lty-1, stretched_sel_rbx+1, stretched_sel_rby+1);
  750.            if (multX != (double)1.0 || multY != (double)1.0)
  751.            {
  752. ***************
  753. *** 590,598 ****
  754.               HighLightForward ();
  755.               UpdSelBBox ();
  756. !             fileModified = TRUE;
  757.            }
  758.         }
  759. !       else
  760.         {
  761.            StretchedXY (sel_ltx, sel_lty, &stretched_sel_ltx, &stretched_sel_lty);
  762.            StretchedXY (sel_rbx, sel_rby, &stretched_sel_rbx, &stretched_sel_rby);
  763. --- 566,593 ----
  764.               HighLightForward ();
  765.               UpdSelBBox ();
  766. !             SetFileModified (TRUE);
  767.            }
  768.         }
  769. !       else if (input.type == MotionNotify)
  770.         {
  771. +          x = input.xmotion.x;
  772. +          y = input.xmotion.y;
  773. +          GridXY (x, y, &grid_x, &grid_y);
  774. +          MarkRulers (grid_x, grid_y);
  775. +          SelBox (drawWindow, revDefaultGC, stretched_ltx, stretched_lty,
  776. +                stretched_rbx, stretched_rby);
  777. +          SelBox (drawWindow, revDefaultGC, stretched_sel_ltx-1,
  778. +                stretched_sel_lty-1, stretched_sel_rbx+1, stretched_sel_rby+1);
  779. +          if (changeX)
  780. +             multX = (double)(moveX + grid_x - XGridOff - pivotX) / obj_w;
  781. +          else
  782. +             multX = (double)1.0;
  783. +          if (changeY)
  784. +             multY = (double)(moveY + grid_y - YGridOff - pivotY) / obj_h;
  785. +          else
  786. +             multY = (double)1.0;
  787.            StretchedXY (sel_ltx, sel_lty, &stretched_sel_ltx, &stretched_sel_lty);
  788.            StretchedXY (sel_rbx, sel_rby, &stretched_sel_rbx, &stretched_sel_rby);
  789. ***************
  790. *** 643,647 ****
  791.      struct AttrRec    * attr_ptr;
  792.   
  793. !    fileModified = TRUE;
  794.      two_x_pivot = selObjLtX + selObjRbX;
  795.      new_obj_ltx = two_x_pivot - ObjPtr->obbox.rbx;
  796. --- 638,642 ----
  797.      struct AttrRec    * attr_ptr;
  798.   
  799. !    SetFileModified (TRUE);
  800.      two_x_pivot = selObjLtX + selObjRbX;
  801.      new_obj_ltx = two_x_pivot - ObjPtr->obbox.rbx;
  802. ***************
  803. *** 734,738 ****
  804.      struct AttrRec    * attr_ptr;
  805.   
  806. !    fileModified = TRUE;
  807.      two_x_pivot = selObjLtY + selObjRbY;
  808.      new_obj_lty = two_x_pivot - ObjPtr->obbox.rby;
  809. --- 729,733 ----
  810.      struct AttrRec    * attr_ptr;
  811.   
  812. !    SetFileModified (TRUE);
  813.      two_x_pivot = selObjLtY + selObjRbY;
  814.      new_obj_lty = two_x_pivot - ObjPtr->obbox.rby;
  815. ***************
  816. *** 851,855 ****
  817.      struct AttrRec    * attr_ptr;
  818.   
  819. !    fileModified = TRUE;
  820.      switch (ObjPtr->type)
  821.      {
  822. --- 846,850 ----
  823.      struct AttrRec    * attr_ptr;
  824.   
  825. !    SetFileModified (TRUE);
  826.      switch (ObjPtr->type)
  827.      {
  828. ***************
  829. *** 957,961 ****
  830.      struct AttrRec    * attr_ptr;
  831.   
  832. !    fileModified = TRUE;
  833.      switch (ObjPtr->type)
  834.      {
  835. --- 952,956 ----
  836.      struct AttrRec    * attr_ptr;
  837.   
  838. !    SetFileModified (TRUE);
  839.      switch (ObjPtr->type)
  840.      {
  841. *** text.c.orig    Wed Jun 27 13:32:29 1990
  842. --- text.c    Wed Jun 27 13:32:33 1990
  843. ***************
  844. *** 6,10 ****
  845.   #ifndef lint
  846.   static char RCSid[] =
  847. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/text.c,v 1.1 90/04/01 22:16:47 william Exp $";
  848.   #endif
  849.   
  850. --- 6,10 ----
  851.   #ifndef lint
  852.   static char RCSid[] =
  853. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/text.c,v 1.6 90/06/26 00:11:37 william Exp $";
  854.   #endif
  855.   
  856. ***************
  857. *** 265,274 ****
  858.            }
  859.   
  860. !          XSetFont (mainDisplay, defaultGC, canvasFontPtr->fid);
  861. !          XDrawImageString (mainDisplay, textBackingPixmap, defaultGC, 0,
  862.                  canvasFontAsc, Str, len);
  863.            from_image = XGetImage (mainDisplay, textBackingPixmap, 0, 0, w, h, 1,
  864.                  XYPixmap);
  865. -          XSetFont (mainDisplay, defaultGC, defaultFontPtr->fid);
  866.   
  867.            values.foreground = colorPixels[ColorIndex];
  868. --- 265,273 ----
  869.            }
  870.   
  871. !          XSetFont (mainDisplay, revDefaultGC, canvasFontPtr->fid);
  872. !          XDrawImageString (mainDisplay, textBackingPixmap, revDefaultGC, 0,
  873.                  canvasFontAsc, Str, len);
  874.            from_image = XGetImage (mainDisplay, textBackingPixmap, 0, 0, w, h, 1,
  875.                  XYPixmap);
  876.   
  877.            values.foreground = colorPixels[ColorIndex];
  878. ***************
  879. *** 282,286 ****
  880.            for (i = 0; i < w; i++)
  881.               for (j = 0; j < h; j++)
  882. !                if (XGetPixel (from_image, i, j) == myWhitePixel)
  883.                     switch (Rotate)
  884.                     {
  885. --- 281,285 ----
  886.            for (i = 0; i < w; i++)
  887.               for (j = 0; j < h; j++)
  888. !                if (XGetPixel (from_image, i, j) == 1)
  889.                     switch (Rotate)
  890.                     {
  891. ***************
  892. *** 287,291 ****
  893.                        case ROTATE90:
  894.   /*                      XDrawPoint (mainDisplay, Win, gc, XOff-j, YOff+i); */
  895. !                         /* Hack to run on RTs -- stupid IBM */
  896.                           XDrawLine (mainDisplay, Win, gc, XOff-j, YOff+i,
  897.                                 XOff-j, YOff+i);
  898. --- 286,290 ----
  899.                        case ROTATE90:
  900.   /*                      XDrawPoint (mainDisplay, Win, gc, XOff-j, YOff+i); */
  901. ! /*                         Hack to run on RTs -- crash server on RTs       */
  902.                           XDrawLine (mainDisplay, Win, gc, XOff-j, YOff+i,
  903.                                 XOff-j, YOff+i);
  904. ***************
  905. *** 293,297 ****
  906.                        case ROTATE180:
  907.   /*                      XDrawPoint (mainDisplay, Win, gc, XOff-i, YOff-j); */
  908. !                         /* Hack to run on RTs -- stupid IBM */
  909.                           XDrawLine (mainDisplay, Win, gc, XOff-i, YOff-j,
  910.                                 XOff-i, YOff-j);
  911. --- 292,296 ----
  912.                        case ROTATE180:
  913.   /*                      XDrawPoint (mainDisplay, Win, gc, XOff-i, YOff-j); */
  914. ! /*                         Hack to run on RTs -- crash server on RTs       */
  915.                           XDrawLine (mainDisplay, Win, gc, XOff-i, YOff-j,
  916.                                 XOff-i, YOff-j);
  917. ***************
  918. *** 299,303 ****
  919.                        case ROTATE270:
  920.   /*                      XDrawPoint (mainDisplay, Win, gc, XOff+j, YOff-i); */
  921. !                         /* Hack to run on RTs -- stupid IBM */
  922.                           XDrawLine (mainDisplay, Win, gc, XOff+j, YOff-i,
  923.                                 XOff+j, YOff-i);
  924. --- 298,302 ----
  925.                        case ROTATE270:
  926.   /*                      XDrawPoint (mainDisplay, Win, gc, XOff+j, YOff-i); */
  927. ! /*                         Hack to run on RTs -- crash server on RTs       */
  928.                           XDrawLine (mainDisplay, Win, gc, XOff+j, YOff-i,
  929.                                 XOff+j, YOff-i);
  930. ***************
  931. *** 309,313 ****
  932.      else
  933.      {
  934. !       values.foreground = myBlackPixel;
  935.         values.function = GXcopy;
  936.         values.fill_style = FillSolid;
  937. --- 308,312 ----
  938.      else
  939.      {
  940. !       values.foreground = myBgPixel;
  941.         values.function = GXcopy;
  942.         values.fill_style = FillSolid;
  943. ***************
  944. *** 328,334 ****
  945. --- 327,335 ----
  946.   void EraseTextCursor ()
  947.   {
  948. +    XSetForeground (mainDisplay, revDefaultGC, myFgPixel^myBgPixel);
  949.      XDrawLine (mainDisplay, drawWindow, revDefaultGC, textCurX>>zoomScale,
  950.            textCurY>>zoomScale, textCurX>>zoomScale,
  951.            (textCurY+textCursorH)>>zoomScale);
  952. +    XSetForeground (mainDisplay, revDefaultGC, 1);
  953.   }
  954.   
  955. ***************
  956. *** 728,732 ****
  957.   {
  958.      register int    left, w;
  959. !    char        s[256];
  960.   
  961.      strcpy (s, curStr->s);
  962. --- 729,733 ----
  963.   {
  964.      register int    left, w;
  965. !    char        s[MAXSTRING+1];
  966.   
  967.      strcpy (s, curStr->s);
  968. ***************
  969. *** 745,776 ****
  970.   
  971.   static
  972. - int DrawAttrAndName (AttrPtr)
  973. -    struct AttrRec    * AttrPtr;
  974. - {
  975. -    struct TextRec    * text_ptr;
  976. -    struct BBRec        old_bbox, new_bbox;
  977. -    int            offset = 0;
  978. -    if (AttrPtr->nameshown != TRUE)
  979. -    {
  980. -       text_ptr = AttrPtr->obj->detail.t;
  981. -       strcpy (text_ptr->first->s, AttrPtr->name);
  982. -       strcat (text_ptr->first->s, AttrPtr->s);
  983. -       offset = XTextWidth (canvasFontPtr, text_ptr->first->s,
  984. -             strlen (text_ptr->first->s));
  985. -       old_bbox = AttrPtr->obj->bbox;
  986. -       UpdTextBBox (AttrPtr->obj);
  987. -       new_bbox = AttrPtr->obj->bbox;
  988. -       RedrawAreas (botObj,
  989. -             old_bbox.ltx-(1<<zoomScale), old_bbox.lty-(1<<zoomScale),
  990. -             old_bbox.rbx+(1<<zoomScale), old_bbox.rby+(1<<zoomScale),
  991. -             new_bbox.ltx-(1<<zoomScale), new_bbox.lty-(1<<zoomScale),
  992. -             new_bbox.rbx+(1<<zoomScale), new_bbox.rby+(1<<zoomScale)); 
  993. -    }
  994. -    return (offset);
  995. - }
  996. - static
  997.   void HandleButton (Button_Ev)
  998.      XButtonEvent    * Button_Ev;
  999. --- 746,749 ----
  1000. ***************
  1001. *** 1077,1082 ****
  1002.      struct StrRec    * s_ptr, * s_ptr1, * new_cur_str;
  1003.      int            highlighting = FALSE, new_cur_index, second_index, len;
  1004. !    int            i, y, new_cur_y;
  1005. !    char            * s;
  1006.   
  1007.      if (!textHighlight) return;
  1008. --- 1050,1055 ----
  1009.      struct StrRec    * s_ptr, * s_ptr1, * new_cur_str;
  1010.      int            highlighting = FALSE, new_cur_index, second_index, len;
  1011. !    int            i, y, new_cur_y, len1, len2;
  1012. !    char            * s, msg[80];
  1013.   
  1014.      if (!textHighlight) return;
  1015. ***************
  1016. *** 1090,1093 ****
  1017. --- 1063,1075 ----
  1018.            {
  1019.               second_index = (s_ptr == curStr) ? textCurIndex : textEndIndex;
  1020. +             len1 = strlen (new_cur_str->s);
  1021. +             len2 = strlen (&(s_ptr->s[second_index]));
  1022. +             if (len1+len2 >= MAXSTRING)
  1023. +             {
  1024. +                sprintf (msg, "String length exceeds %1d.  String truncated.",
  1025. +                      MAXSTRING);
  1026. +                Msg (msg);
  1027. +                s_ptr->s[MAXSTRING-len1+second_index] = '\0';
  1028. +             }
  1029.               strcat (new_cur_str->s, &(s_ptr->s[second_index]));
  1030.               if (s_ptr == lastStr)
  1031. ***************
  1032. *** 1167,1174 ****
  1033.      AddStr (curStr, curStr->next, str_ptr);
  1034.      curStr = str_ptr;
  1035. -    textCurX = textOrigX;
  1036.      textCurY += textCursorH;
  1037.      textCurIndex = 0;
  1038.      curStrW = XTextWidth (canvasFontPtr, curStr->s, strlen (curStr->s));
  1039.      i = textCursorH * NumLines ();
  1040.      if (i > textH)
  1041. --- 1149,1156 ----
  1042.      AddStr (curStr, curStr->next, str_ptr);
  1043.      curStr = str_ptr;
  1044.      textCurY += textCursorH;
  1045.      textCurIndex = 0;
  1046.      curStrW = XTextWidth (canvasFontPtr, curStr->s, strlen (curStr->s));
  1047. +    SetTextCurX ();
  1048.      i = textCursorH * NumLines ();
  1049.      if (i > textH)
  1050. ***************
  1051. *** 1200,1203 ****
  1052. --- 1182,1187 ----
  1053.      struct StrRec    * str_ptr;
  1054.      struct AttrRec       * attr_ptr;
  1055. +    int            len1, len2;
  1056. +    char            msg[80];
  1057.   
  1058.      if (textHighlight)
  1059. ***************
  1060. *** 1249,1252 ****
  1061. --- 1233,1245 ----
  1062.               curStr->prev->next = curStr->next;
  1063.               textCurIndex = strlen (curStr->prev->s);
  1064. +             len1 = strlen (curStr->prev->s);
  1065. +             len2 = strlen (curStr->s);
  1066. +             if (len1+len2 >= MAXSTRING)
  1067. +             {
  1068. +                sprintf (msg, "String length exceeds %1d.  String truncated.",
  1069. +                      MAXSTRING);
  1070. +                Msg (msg);
  1071. +                curStr->s[MAXSTRING-len1] = '\0';
  1072. +             }
  1073.               strcat (curStr->prev->s, curStr->s);
  1074.               cfree (curStr);
  1075. ***************
  1076. *** 1283,1289 ****
  1077. --- 1276,1293 ----
  1078.      register int        amount;
  1079.      int            need_redraw;
  1080. +    char            msg[80];
  1081. +    XEvent        ev;
  1082.   
  1083.      if (need_redraw = textHighlight) DeleteHighlightedText ();
  1084.   
  1085. +    if (textCurIndex+strlen (&(curStr->s[textCurIndex])) >= MAXSTRING)
  1086. +    {
  1087. +       sprintf (msg, "String length exceeds %1d.  Character ignored.",MAXSTRING);
  1088. +       Msg (msg);
  1089. +       RedrawCurText ();
  1090. +       while (XCheckWindowEvent (mainDisplay, drawWindow, KeyPressMask, &ev)) ;
  1091. +       return;
  1092. +    }
  1093.      amount = XTextWidth (canvasFontPtr, Str, 1);
  1094.    
  1095. ***************
  1096. *** 1356,1360 ****
  1097.         PutTextCursor ();
  1098.         MarkRulers (textCurX>>zoomScale, textCurY>>zoomScale);
  1099. !       fileModified = TRUE;
  1100.      }
  1101.   }
  1102. --- 1360,1364 ----
  1103.         PutTextCursor ();
  1104.         MarkRulers (textCurX>>zoomScale, textCurY>>zoomScale);
  1105. !       SetFileModified (TRUE);
  1106.      }
  1107.   }
  1108. ***************
  1109. *** 1681,1685 ****
  1110.      struct StrRec    * s_ptr;
  1111.      struct TextRec    * text_ptr;
  1112. !    char            color_str[20], * s, tmp_str[80], inbuf[255];
  1113.      int            num_lines, x, y, font, style, size;
  1114.      int            text_just, rotate, pen;
  1115. --- 1685,1690 ----
  1116.      struct StrRec    * s_ptr;
  1117.      struct TextRec    * text_ptr;
  1118. !    char            color_str[80], * s;
  1119. !    char            tmp_str[MAXSTRING+1], inbuf[MAXSTRING+1];
  1120.      int            num_lines, x, y, font, style, size;
  1121.      int            text_just, rotate, pen;
  1122. ***************
  1123. *** 1715,1719 ****
  1124.      for (i = 0; i < num_lines; i++)
  1125.      {
  1126. !       fgets (inbuf, 255, FP);
  1127.         strcpy(tmp_str, FindChar ('"', inbuf));
  1128.         s = ReadString (tmp_str);
  1129. --- 1720,1724 ----
  1130.      for (i = 0; i < num_lines; i++)
  1131.      {
  1132. !       fgets (inbuf, MAXSTRING, FP);
  1133.         strcpy(tmp_str, FindChar ('"', inbuf));
  1134.         s = ReadString (tmp_str);
  1135. ***************
  1136. *** 1805,1809 ****
  1137.   {
  1138.      register char    * s = ObjPtr->detail.t->first->s, * s1 = Str;
  1139. !    char            tmp_str[80], * c_ptr;
  1140.      int            len;
  1141.      struct BBRec        bbox;
  1142. --- 1810,1814 ----
  1143.   {
  1144.      register char    * s = ObjPtr->detail.t->first->s, * s1 = Str;
  1145. !    char            tmp_str[MAXSTRING+1], * c_ptr;
  1146.      int            len;
  1147.      struct BBRec        bbox;
  1148. ***************
  1149. *** 1830,1834 ****
  1150.      if (*s != '\0')
  1151.      {
  1152. !       values.foreground = myBlackPixel;
  1153.         values.function = GXcopy;
  1154.         values.fill_style = FillSolid;
  1155. --- 1835,1839 ----
  1156.      if (*s != '\0')
  1157.      {
  1158. !       values.foreground = myBgPixel;
  1159.         values.function = GXcopy;
  1160.         values.fill_style = FillSolid;
  1161. *** tgif2ps.c.orig    Wed Jun 27 13:32:59 1990
  1162. --- tgif2ps.c    Wed Jun 27 13:33:00 1990
  1163. ***************
  1164. *** 6,10 ****
  1165.   #ifndef lint
  1166.   static char RCSid[] =
  1167. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/tgif2ps.c,v 1.1 90/04/04 22:59:59 william Exp $";
  1168.   #endif
  1169.   
  1170. --- 6,10 ----
  1171.   #ifndef lint
  1172.   static char RCSid[] =
  1173. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/tgif2ps.c,v 1.4 90/06/05 09:31:14 william Exp $";
  1174.   #endif
  1175.   
  1176. ***************
  1177. *** 25,28 ****
  1178. --- 25,29 ----
  1179.         exit (-1);
  1180.      }
  1181. +    printf ("%%!\n");
  1182.   }
  1183.   
  1184. ***************
  1185. *** 79,83 ****
  1186.         }
  1187.         else if (strcmp (inbuf, "72 0.4 mul 72 -0.6 mul translate\n") == 0)
  1188. !       {  /* landscape format */
  1189.   /*       printf ("72 3.5 mul 72 -0.6 mul translate\n"); */
  1190.        if (fgets (inbuf, 255, stdin) == NULL)
  1191. --- 80,84 ----
  1192.         }
  1193.         else if (strcmp (inbuf, "72 0.4 mul 72 -0.6 mul translate\n") == 0)
  1194. !       {  /* landscape or slide-landscape format */
  1195.   /*       printf ("72 3.5 mul 72 -0.6 mul translate\n"); */
  1196.        if (fgets (inbuf, 255, stdin) == NULL)
  1197. ***************
  1198. *** 88,95 ****
  1199.            if (strcmp (inbuf, "0.565 -0.565 scale\n") != 0)
  1200.            {
  1201. !             fprintf (stderr, "ERROR:  '0.565 -0.565 scale' not found.\n");
  1202. !             exit (-1);
  1203.            }
  1204. !          printf ("0.565 -0.565 scale\n");
  1205.         }
  1206.         else if (strcmp (inbuf, "72 0.2 mul 72 -0.3 mul translate\n") == 0)
  1207. --- 89,102 ----
  1208.            if (strcmp (inbuf, "0.565 -0.565 scale\n") != 0)
  1209.            {
  1210. !             if (strcmp (inbuf, "1.13 -1.13 scale\n") != 0)
  1211. !             {
  1212. !                fprintf (stderr, "ERROR:  neither '0.565 -0.565 scale' nor ");
  1213. !                fprintf (stderr, "'1.13 -1.13 scale' is found.\n");
  1214. !                exit (-1);
  1215. !             }
  1216. !             printf ("1.13 -1.13 scale\n");
  1217.            }
  1218. !          else
  1219. !             printf ("0.565 -0.565 scale\n");
  1220.         }
  1221.         else if (strcmp (inbuf, "72 0.2 mul 72 -0.3 mul translate\n") == 0)
  1222. ***************
  1223. *** 107,125 ****
  1224.            }
  1225.            printf ("0.28 -0.28 scale\n");
  1226. -       }
  1227. -       else if (strcmp (inbuf, "72 0.4 mul 72 -0.6 mul translate\n") == 0)
  1228. -       {  /* slide-landscape format */
  1229. - /*       printf ("72 3.5 mul 72 -0.6 mul translate\n"); */
  1230. -      if (fgets (inbuf, 255, stdin) == NULL)
  1231. -          {
  1232. -             fprintf (stderr, "ERROR:  Incomplete file.\n");
  1233. -             exit (-1);
  1234. -          }
  1235. -          if (strcmp (inbuf, "1.13 -1.13 scale\n") != 0)
  1236. -          {
  1237. -             fprintf (stderr, "ERROR:  '1.13 -1.13 scale' not found.\n");
  1238. -             exit (-1);
  1239. -          }
  1240. -          printf ("1.13 -1.13 scale\n");
  1241.         }
  1242.         else if (strcmp (inbuf, "showpage\n") == 0)
  1243. --- 114,117 ----
  1244. *** version.c.orig    Wed Jun 27 13:33:08 1990
  1245. --- version.c    Wed Jun 27 13:33:09 1990
  1246. ***************
  1247. *** 6,11 ****
  1248.   #ifndef lint
  1249.   static char RCSid[] =
  1250. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/version.c,v 1.3 90/05/16 08:31:53 william Exp $";
  1251.   #endif
  1252.   
  1253. ! char    * version_string = "1.2";
  1254. --- 6,11 ----
  1255.   #ifndef lint
  1256.   static char RCSid[] =
  1257. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/version.c,v 1.12 90/06/26 08:47:59 william Exp $";
  1258.   #endif
  1259.   
  1260. ! char    * version_string = "1.9";
  1261. *** file.e.orig    Wed Jun 27 13:33:15 1990
  1262. --- file.e    Wed Jun 27 13:33:17 1990
  1263. ***************
  1264. *** 4,8 ****
  1265.    * Copyright (C) 1989, William Cheng.
  1266.    *
  1267. !  * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/file.e,v 1.1 90/04/01 22:17:03 william Exp $
  1268.    */
  1269.   
  1270. --- 4,8 ----
  1271.    * Copyright (C) 1989, William Cheng.
  1272.    *
  1273. !  * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/file.e,v 1.6 90/05/24 10:35:30 william Exp $
  1274.    */
  1275.   
  1276. ***************
  1277. *** 12,15 ****
  1278. --- 12,24 ----
  1279.   extern int    importingFile;
  1280.   extern char    * fileMenuStr[];
  1281. + extern int    psDotsPerInch;
  1282. + extern char    * psScaleStr[];
  1283. + extern float    psScale[];
  1284. + extern char    * psXOffStr[];
  1285. + extern float    psXOff[];
  1286. + extern char    * psYOffStr[];
  1287. + extern float    psYOff[];
  1288. + extern float    psPageWidthInInch[];
  1289. + extern float    psPageHeightInInch[];
  1290.   
  1291.   extern void    ClearFileInfo ();
  1292. ***************
  1293. *** 28,31 ****
  1294. --- 37,41 ----
  1295.   extern void    DumpAttrs ();
  1296.   extern void    DumpAllObj ();
  1297. + extern void    DumpBBox ();
  1298.   extern void    Dump ();
  1299.   extern void    NewProc ();
  1300. *** scroll.e.orig    Wed Jun 27 13:33:22 1990
  1301. --- scroll.e    Wed Jun 27 13:33:23 1990
  1302. ***************
  1303. *** 4,8 ****
  1304.    * Copyright (C) 1989, William Cheng.
  1305.    *
  1306. !  * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/scroll.e,v 1.1 90/04/01 22:17:19 william Exp $
  1307.    */
  1308.   
  1309. --- 4,8 ----
  1310.    * Copyright (C) 1989, William Cheng.
  1311.    *
  1312. !  * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/scroll.e,v 1.2 90/05/21 16:43:32 william Exp $
  1313.    */
  1314.   
  1315. ***************
  1316. *** 15,18 ****
  1317. --- 15,22 ----
  1318.   extern void    InitScroll ();
  1319.   extern void    RedrawScrollBars ();
  1320. + extern void    ScrollUp ();
  1321. + extern void    ScrollDown ();
  1322. + extern void    ScrollLeft ();
  1323. + extern void    ScrollRight ();
  1324.   extern void    ScrollEventHandler ();
  1325.   extern void    CleanUpScrolls ();
  1326. *** setup.e.orig    Wed Jun 27 13:33:28 1990
  1327. --- setup.e    Wed Jun 27 13:33:29 1990
  1328. ***************
  1329. *** 4,8 ****
  1330.    * Copyright (C) 1989, William Cheng.
  1331.    *
  1332. !  * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/setup.e,v 1.2 90/05/15 09:33:37 william Exp $
  1333.    */
  1334.   
  1335. --- 4,8 ----
  1336.    * Copyright (C) 1989, William Cheng.
  1337.    *
  1338. !  * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/setup.e,v 1.6 90/06/25 23:44:35 william Exp $
  1339.    */
  1340.   
  1341. ***************
  1342. *** 66,72 ****
  1343.   extern void    Setup ();
  1344.   extern int    TieLooseEnds ();
  1345.   
  1346. ! extern int    myBlackPixel;
  1347. ! extern int    myWhitePixel;
  1348.   
  1349.   extern char    drawPath[];
  1350. --- 66,75 ----
  1351.   extern void    Setup ();
  1352.   extern int    TieLooseEnds ();
  1353. + extern void    SetFileModified ();
  1354.   
  1355. ! extern int    myBgPixel;
  1356. ! extern int    myFgPixel;
  1357. ! extern int    myBorderPixel;
  1358. ! extern int    reverseVideo;
  1359.   
  1360.   extern char    drawPath[];
  1361. *** const.h.orig    Wed Jun 27 13:33:34 1990
  1362. --- const.h    Wed Jun 27 13:33:35 1990
  1363. ***************
  1364. *** 4,8 ****
  1365.    * Copyright (C) 1990, William Cheng.
  1366.    *
  1367. !  * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/const.h,v 1.1 90/04/01 22:17:28 william Exp $
  1368.    */
  1369.   
  1370. --- 4,8 ----
  1371.    * Copyright (C) 1990, William Cheng.
  1372.    *
  1373. !  * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/const.h,v 1.5 90/05/23 08:54:00 william Exp Locker: william $
  1374.    */
  1375.   
  1376. ***************
  1377. *** 37,40 ****
  1378. --- 37,41 ----
  1379.   #define SetRecVals(R,X,Y,W,H) ((R).x=(X),(R).y=(Y),(R).width=(W),(R).height=(H))
  1380.   
  1381. + #define MAXSTRING 256
  1382.   #define MAXPATHLENGTH 256
  1383.   
  1384. ***************
  1385. *** 175,178 ****
  1386. --- 176,181 ----
  1387.   #define SLIDEPORT 4
  1388.   #define SLIDELAND 5
  1389. + #define MAXPAGESTYLES 6
  1390.   
  1391.   /* where to print */
  1392. *** types.h.orig    Wed Jun 27 13:33:40 1990
  1393. --- types.h    Wed Jun 27 13:33:41 1990
  1394. ***************
  1395. *** 4,10 ****
  1396.    * Copyright (C) 1990, William Cheng.
  1397.    *
  1398. !  * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/types.h,v 1.1 90/04/01 22:17:28 william Exp $
  1399.    */
  1400.   
  1401.   typedef struct BBRec {
  1402.      int    ltx, lty, rbx, rby;
  1403. --- 4,12 ----
  1404.    * Copyright (C) 1990, William Cheng.
  1405.    *
  1406. !  * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/types.h,v 1.3 90/05/18 20:23:48 william Exp $
  1407.    */
  1408.   
  1409. + #include "const.h"
  1410.   typedef struct BBRec {
  1411.      int    ltx, lty, rbx, rby;
  1412. ***************
  1413. *** 32,37 ****
  1414.   
  1415.   typedef struct AttrRec {
  1416. !    char            name[80]; /* attribute name */
  1417. !    char            s[80]; /* attribute value string */
  1418.      short        shown; /* TRUE if the attribute is shown */
  1419.      short        nameshown; /* TRUE if the attr name is also shown */
  1420. --- 34,39 ----
  1421.   
  1422.   typedef struct AttrRec {
  1423. !    char            name[MAXSTRING+1]; /* attribute name */
  1424. !    char            s[MAXSTRING+1]; /* attribute value string */
  1425.      short        shown; /* TRUE if the attribute is shown */
  1426.      short        nameshown; /* TRUE if the attr name is also shown */
  1427. ***************
  1428. *** 44,48 ****
  1429.   typedef struct GroupRec {
  1430.      struct ObjRec    * first, * last;
  1431. !    char            s[80];
  1432.      int            id, dirty;
  1433.      struct AttrRec    * fattr, *lattr; /* first and last attributes */
  1434. --- 46,50 ----
  1435.   typedef struct GroupRec {
  1436.      struct ObjRec    * first, * last;
  1437. !    char            s[MAXSTRING+1];
  1438.      int            id, dirty;
  1439.      struct AttrRec    * fattr, *lattr; /* first and last attributes */
  1440. ***************
  1441. *** 76,80 ****
  1442.   
  1443.   typedef struct StrRec {
  1444. !    char            s[80];
  1445.      struct StrRec    * next, * prev;
  1446.   } * StrRecPtr;
  1447. --- 78,82 ----
  1448.   
  1449.   typedef struct StrRec {
  1450. !    char            s[MAXSTRING+1];
  1451.      struct StrRec    * next, * prev;
  1452.   } * StrRecPtr;
  1453. ***************
  1454. *** 100,112 ****
  1455.      int            color, h_align, v_align, line_w, line_s;
  1456.      int            fill, pen, just, font, font_s, f_size, f_comp_size;
  1457. !    char            name[80], domain[256];
  1458.   } * StkRecPtr;
  1459.   
  1460.   typedef struct _DspItem {
  1461. !    char        s[256];
  1462.   } DspItem;
  1463.   
  1464.   typedef struct _DspList {
  1465. !    char            itemstr[256];
  1466.      struct _DspList    * next;
  1467.   } DspList;
  1468. --- 102,114 ----
  1469.      int            color, h_align, v_align, line_w, line_s;
  1470.      int            fill, pen, just, font, font_s, f_size, f_comp_size;
  1471. !    char            name[MAXPATHLENGTH+1], domain[MAXPATHLENGTH+1];
  1472.   } * StkRecPtr;
  1473.   
  1474.   typedef struct _DspItem {
  1475. !    char        s[MAXPATHLENGTH+1];
  1476.   } DspItem;
  1477.   
  1478.   typedef struct _DspList {
  1479. !    char            itemstr[MAXPATHLENGTH+1];
  1480.      struct _DspList    * next;
  1481.   } DspList;
  1482. *** Makefile.noimake.orig    Wed Jun 27 13:33:50 1990
  1483. --- Makefile.noimake    Wed Jun 27 13:33:51 1990
  1484. ***************
  1485. *** 4,8 ****
  1486.   # Copyright (C) 1990, William Cheng.
  1487.   #
  1488. ! # @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/Makefile.noimake,v 1.3 90/05/10 09:12:10 william Exp $
  1489.   #
  1490.   
  1491. --- 4,8 ----
  1492.   # Copyright (C) 1990, William Cheng.
  1493.   #
  1494. ! # @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/Makefile.noimake,v 1.10 90/06/13 14:32:34 william Exp $
  1495.   #
  1496.   
  1497. ***************
  1498. *** 13,17 ****
  1499.   
  1500.   CC = cc
  1501. ! CFLAGS = -g -I/usr/local/include
  1502.   LFLAGS = -lX11 -lm
  1503.   
  1504. --- 13,18 ----
  1505.   
  1506.   CC = cc
  1507. ! CFLAGS = -g -DTGIF_PATH=\"/u/tangram/u/william/X11/TGIF\" -DPSFILE_MOD=\"664\" \
  1508. !         -I/usr/local/include
  1509.   LFLAGS = -lX11 -lm
  1510.   
  1511. ***************
  1512. *** 94,103 ****
  1513.   cursor.o:    const.h types.h $(CURSOR_BM) choice.e setup.e
  1514.   tgif.o:        const.h types.h mainloop.e setup.e version.e
  1515. ! dialog.o:    const.h types.h cursor.e box.e font.e mainloop.e raster.e
  1516.   drawing.o:    const.h types.h \
  1517.           align.e animate.e attr.e box.e choice.e cursor.e dialog.e \
  1518.           dup.e edit.e file.e font.e grid.e group.e mark.e menu.e msg.e \
  1519. !         obj.e oval.e poly.e polygon.e raster.e rect.e ruler.e \
  1520. !         select.e setup.e special.e stk.e stretch.e text.e
  1521.   dup.o:        const.h types.h \
  1522.           attr.e drawing.e grid.e obj.e select.e setup.e
  1523. --- 95,105 ----
  1524.   cursor.o:    const.h types.h $(CURSOR_BM) choice.e setup.e
  1525.   tgif.o:        const.h types.h mainloop.e setup.e version.e
  1526. ! dialog.o:    const.h cursor.e box.e font.e mainloop.e raster.e setup.e
  1527.   drawing.o:    const.h types.h \
  1528.           align.e animate.e attr.e box.e choice.e cursor.e dialog.e \
  1529.           dup.e edit.e file.e font.e grid.e group.e mark.e menu.e msg.e \
  1530. !         obj.e oval.e pattern.e poly.e polygon.e raster.e rect.e \
  1531. !         ruler.e scroll.e select.e setup.e special.e stk.e stretch.e \
  1532. !         text.e
  1533.   dup.o:        const.h types.h \
  1534.           attr.e drawing.e grid.e obj.e select.e setup.e
  1535. ***************
  1536. *** 127,131 ****
  1537.           box.e choice.e color.e cursor.e dialog.e drawing.e edit.e \
  1538.           file.e font.e grid.e msg.e names.e obj.e pattern.e raster.e \
  1539. !         select.e setup.e special.e text.e
  1540.   move.o:        const.h types.h \
  1541.           attr.e cursor.e drawing.e dup.e grid.e obj.e oval.e \
  1542. --- 129,133 ----
  1543.           box.e choice.e color.e cursor.e dialog.e drawing.e edit.e \
  1544.           file.e font.e grid.e msg.e names.e obj.e pattern.e raster.e \
  1545. !         select.e setup.e special.e text.e version.e
  1546.   move.o:        const.h types.h \
  1547.           attr.e cursor.e drawing.e dup.e grid.e obj.e oval.e \
  1548. *** Imakefile.orig    Wed Jun 27 13:33:58 1990
  1549. --- Imakefile    Wed Jun 27 13:33:59 1990
  1550. ***************
  1551. *** 4,18 ****
  1552.   /**/# Copyright (C) 1990, William Cheng.
  1553.   /**/#
  1554. ! /**/# @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/Imakefile,v 1.5 90/05/17 08:34:23 william Exp $
  1555.   /**/#
  1556.   
  1557. ! XLIB        = -lX11
  1558. ! MATHLIB        = -lm
  1559.   PROGRAMS    = tgif prtgif tgif2ps frontend11.o
  1560.   CDEBUGFLAGS    = -g
  1561.   BINDIR        = /u/tangram/bin
  1562. ! /**/# MY_LIBRARIES    = /usr/lib/debug/malloc.o $(XLIB) $(MATHLIB)
  1563. ! MY_LIBRARIES    = $(XLIB) $(MATHLIB)
  1564. ! TGIFVERSION    = 1.2
  1565.   
  1566.   OBJ1 =    align.o animate.o attr.o \
  1567. --- 4,18 ----
  1568.   /**/# Copyright (C) 1990, William Cheng.
  1569.   /**/#
  1570. ! /**/# @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/Imakefile,v 1.16 90/06/26 08:48:16 william Exp $
  1571.   /**/#
  1572.   
  1573. ! TGIFVERSION    = 1.9
  1574.   PROGRAMS    = tgif prtgif tgif2ps frontend11.o
  1575.   CDEBUGFLAGS    = -g
  1576.   BINDIR        = /u/tangram/bin
  1577. ! DEFINES        = -DTGIF_PATH=\"/u/tangram/u/william/X11/TGIF\" \
  1578. !           -DPSFILE_MOD=\"664\"
  1579. ! LOCAL_LIBRARIES    = $(XLIB)
  1580. ! SYS_LIBRARIES    = -lm
  1581.   
  1582.   OBJ1 =    align.o animate.o attr.o \
  1583. ***************
  1584. *** 34,43 ****
  1585.   OBJS1 = tgif.o $(OBJ1)
  1586.   OBJS2 = prtgif.o $(OBJ1)
  1587. ! OBJS3 = $(OBJ1)
  1588.   
  1589.   SRCS1 = .//**/*.c
  1590. ! SRCS2 = .//**/*.c
  1591. ! SRCS3 = .//**/*.c
  1592.   
  1593.   .SUFFIXES: .l .man
  1594.   
  1595. --- 34,49 ----
  1596.   OBJS1 = tgif.o $(OBJ1)
  1597.   OBJS2 = prtgif.o $(OBJ1)
  1598. ! OBJS3 = tgif2ps.o
  1599.   
  1600.   SRCS1 = .//**/*.c
  1601. ! SRCS2 = 
  1602. ! SRCS3 = 
  1603.   
  1604. + ComplexProgramTarget_1(tgif,$(LOCAL_LIBRARIES),)
  1605. + ComplexProgramTarget_2(prtgif,$(LOCAL_LIBRARIES),)
  1606. + ComplexProgramTarget_3(tgif2ps,,)
  1607. + NormalRelocatableTarget(frontend11,$(OBJ1))
  1608.   .SUFFIXES: .l .man
  1609.   
  1610. ***************
  1611. *** 46,59 ****
  1612.       cp $*.l $*.man
  1613.   
  1614. - ComplexProgramTarget_1(tgif,,$(MY_LIBRARIES))
  1615. - NormalProgramTarget(prtgif,$(OBJS2),,,$(MY_LIBRARIES))
  1616. - NormalProgramTarget(tgif2ps,tgif2ps.o,,,)
  1617. - NormalRelocatableTarget(frontend11,$(OBJS3))
  1618. - InstallProgram(tgif2ps,$(BINDIR))
  1619. - InstallProgram(prtgif,$(BINDIR))
  1620.   OBJDEMO = an-sr-flip-flop.obj fonts.obj slide-demo.obj spice//**/*.obj
  1621.   SYMDEMO = flip-flop.sym nand2.sym pin.sym tangram.sym spice//**/*.sym
  1622. ! MISCTAR = *.man README Copyright tgif.pl spice//**/*.mod
  1623.   
  1624.   distr: tar shar version
  1625. --- 52,58 ----
  1626.       cp $*.l $*.man
  1627.   
  1628.   OBJDEMO = an-sr-flip-flop.obj fonts.obj slide-demo.obj spice//**/*.obj
  1629.   SYMDEMO = flip-flop.sym nand2.sym pin.sym tangram.sym spice//**/*.sym
  1630. ! MISCTAR = *.man README Copyright tgif.pl spice//**/*.mod example.tex
  1631.   
  1632.   distr: tar shar version
  1633. ***************
  1634. *** 60,64 ****
  1635.   
  1636.   tar:
  1637. !     rm tgif-$(TGIFVERSION).tar/**/*
  1638.       tar cvf tgif-$(TGIFVERSION).tar /**/*.c /**/*.e /**/*.h \
  1639.           Makefile.noimake Imakefile bitmaps//**/*.bm \
  1640. --- 59,63 ----
  1641.   
  1642.   tar:
  1643. !     rm -f tgif-$(TGIFVERSION).tar/**/*
  1644.       tar cvf tgif-$(TGIFVERSION).tar /**/*.c /**/*.e /**/*.h \
  1645.           Makefile.noimake Imakefile bitmaps//**/*.bm \
  1646. ***************
  1647. *** 70,74 ****
  1648.   
  1649.   SPICE_1 = spice spice//**/*.obj spice//**/*.sym spice//**/*.mod
  1650. ! MAN_1 = /**/*.man
  1651.   MISC_1 = Makefile.noimake Imakefile .psmac ./**/*port ./**/*land \
  1652.           README Copyright tgif.pl tgificon.obj
  1653. --- 69,73 ----
  1654.   
  1655.   SPICE_1 = spice spice//**/*.obj spice//**/*.sym spice//**/*.mod
  1656. ! MAN_1 = /**/*.man example.tex
  1657.   MISC_1 = Makefile.noimake Imakefile .psmac ./**/*port ./**/*land \
  1658.           README Copyright tgif.pl tgificon.obj
  1659. ***************
  1660. *** 77,81 ****
  1661.   
  1662.   shar:
  1663. !     rm tgif-$(TGIFVERSION).shar./**/*
  1664.       shar -otgif-$(TGIFVERSION).shar.1 -n1 -e21 a/**/*.c
  1665.       shar -otgif-$(TGIFVERSION).shar.2 -n2 -e21 b/**/*.c c/**/*.c
  1666. --- 76,80 ----
  1667.   
  1668.   shar:
  1669. !     rm -f tgif-$(TGIFVERSION).shar./**/*
  1670.       shar -otgif-$(TGIFVERSION).shar.1 -n1 -e21 a/**/*.c
  1671.       shar -otgif-$(TGIFVERSION).shar.2 -n2 -e21 b/**/*.c c/**/*.c
  1672. *** tgif.man.orig    Wed Jun 27 13:34:05 1990
  1673. --- tgif.man    Wed Jun 27 13:34:06 1990
  1674. ***************
  1675. *** 1,4 ****
  1676. ! .\"@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/tgif.man,v 1.4 90/05/17 09:21:26 william Exp $
  1677. ! .TH TGIF 1 "Version 1.1" "Tgif"
  1678.   .SH NAME
  1679.   \fItgif\fR \- Xlib based 2-D drawing facility under X11.  Also supports
  1680. --- 1,4 ----
  1681. ! .\"@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/tgif.man,v 1.6 90/06/05 12:19:24 william Exp $
  1682. ! .TH TGIF 1 "Version 1.6" "Tgif"
  1683.   .SH NAME
  1684.   \fItgif\fR \- Xlib based 2-D drawing facility under X11.  Also supports
  1685. ***************
  1686. *** 176,179 ****
  1687. --- 176,181 ----
  1688.     ^X    delete all selected objects\br
  1689.     ^Z    escape to Prolog\br
  1690. +   ^,    scroll left\br
  1691. +   ^.    scroll right\br
  1692.   \br
  1693.     #A    attach selected attributes to the selected complex object\br
  1694. ***************
  1695. *** 187,190 ****
  1696. --- 189,193 ----
  1697.     #I    increment the grid size\br
  1698.     #J    hide attribute names on the selected objects\br
  1699. +   #K    change the drawing mode to select\br
  1700.     #L    give the line style and line width pop-up menu\br
  1701.     #M    move the attributes of a selected object\br
  1702. ***************
  1703. *** 208,211 ****
  1704. --- 211,216 ----
  1705.     #4    change the font size to 18\br
  1706.     #5    change the font size to 24\br
  1707. +   #,    scroll up\br
  1708. +   #.    scroll down\br
  1709.   \br
  1710.    ^#B    change the text style to bold\br
  1711. ***************
  1712. *** 265,271 ****
  1713.   Save and name the file.
  1714.   .SH LATEX FIGURE FORMATS
  1715. ! Here we show how to make a figure for a LaTeX file.
  1716.   .PP
  1717. ! Before printing a file in the \fI.ps\fR format, center the picture
  1718.   on the page (e.g., the width of a portrait style page is 7.5 inch, so the
  1719.   center of the page is at the 3.75 inch mark),
  1720. --- 270,311 ----
  1721.   Save and name the file.
  1722.   .SH LATEX FIGURE FORMATS
  1723. ! Here we show how to make a figure for a LaTeX file, first with
  1724. ! the \fIpsfig\fR (or \fIepsf\fR) special construct, then with the
  1725. ! \fIpsfile\fR special construct.  An example of both can be found
  1726. ! in ``example.tex'' included with this distribution.
  1727.   .PP
  1728. ! To print a tgif file to be included in a LaTeX document with
  1729. ! the \fIpsfig\fR or \fIepsf\fR special construct
  1730. ! (files generated will be in the
  1731. ! \fIencapsulated PostScript\fR format), first
  1732. ! select LaTeX format in the panel window (click the left mouse
  1733. ! button on the laser printer icon), then type ^P to generate
  1734. ! the PostScript file.  If the file name is ``an-sr-flip-flop.obj'',
  1735. ! then the LaTeX figure file generated will be named
  1736. ! ``an-sr-flip-flop.ps''.  This file can be included in a LaTeX
  1737. ! document as follows,
  1738. ! .PP
  1739. ! .DS I
  1740. ! \\begin{figure*}[htb]
  1741. ! .br
  1742. ! \\input{psfig}
  1743. ! .br
  1744. ! \\centerline{\\psfig{figure=an-sr-flip-flop.ps}}
  1745. ! .br
  1746. ! \\caption{An SR flip-flop.  \\label{fig:an-sr-flip-flop}}
  1747. ! .br
  1748. ! \\end{figure*}
  1749. ! .br
  1750. ! .DE
  1751. ! .br
  1752. ! .PP
  1753. ! The \\centerline command above centers the picture.  Also, \fItgif2ps\fR is
  1754. ! used to generate the \fI.ps\fR file, so it should be
  1755. ! installed (see the man pages on tgif2ps,
  1756. ! which is included in the tgif distribution).
  1757. ! .PP
  1758. ! If encapsulated PostScript is not desired, the \fIpsfile\fR
  1759. ! special construct can be used as described here.
  1760. ! First, center the picture
  1761.   on the page (e.g., the width of a portrait style page is 7.5 inch, so the
  1762.   center of the page is at the 3.75 inch mark),
  1763. ***************
  1764. *** 272,281 ****
  1765.   and make the top object on the page as close to
  1766.   the top of the page as possible.
  1767. ! Select LaTeX format in the panel window (click the left mouse button
  1768. ! in the laser printer icon),
  1769.   then print in the LaTeX format.
  1770. ! For example, if the file name is ``an-sr-flip-flop.obj'', the LaTeX figure
  1771. ! file generated will be named ``an-sr-flip-flop.ps''.  This file can be
  1772. ! included in a LaTeX document as follows,
  1773.   .PP
  1774.   .DS I
  1775. --- 312,320 ----
  1776.   and make the top object on the page as close to
  1777.   the top of the page as possible.
  1778. ! Select LaTeX format in the panel window,
  1779.   then print in the LaTeX format.
  1780. ! Same as with the \fIpsfig\fR construct, a file with the \fI.ps\fR
  1781. ! extention will be generated.
  1782. ! This file can be included in a LaTeX document as follows,
  1783.   .PP
  1784.   .DS I
  1785. ***************
  1786. *** 297,304 ****
  1787.   
  1788.   Notice that the psfile special construct is used.  Encapsulated
  1789. ! PostScript format is not supported.  Also, \fItgif2ps\fR is
  1790.   used to generate the \fI.ps\fR file, so it should be
  1791. ! installed (see the man pages on tgif2ps,
  1792. ! which is included in the tgif distribution).
  1793.   .SH X DEFAULTS
  1794.   .TP
  1795. --- 336,342 ----
  1796.   
  1797.   Notice that the psfile special construct is used.  Encapsulated
  1798. ! PostScript format is not supported.  Again, \fItgif2ps\fR is
  1799.   used to generate the \fI.ps\fR file, so it should be
  1800. ! installed in the path.
  1801.   .SH X DEFAULTS
  1802.   .TP
  1803. ***************
  1804. *** 307,312 ****
  1805. --- 345,359 ----
  1806.   .I Tgif*IconGeometry: +X+Y
  1807.   .TP
  1808. + .I Tgif*Foreground: COLORSTRING
  1809. + .TP
  1810. + .I Tgif*Background: COLORSTRING
  1811. + .TP
  1812.   .I Tgif*BorderColor: COLORSTRING
  1813.   .TP
  1814. + .I Tgif*ReverseVideo: [on,off]
  1815. + For black and white terminal, reverse video ``on'' means the background
  1816. + is black.  For color terminal, reverse video ``on'' means the background
  1817. + is specified by the Tgif*Foreground color.
  1818. + .TP
  1819.   .I Tgif*Color#: COLORSTRING
  1820.   This specified the correspondance between the color number and a color.
  1821. ***************
  1822. *** 319,322 ****
  1823. --- 366,373 ----
  1824.   This specified the default color index if certain color can not be found.
  1825.   Default is 0.
  1826. + .TP
  1827. + .I Tgif*PrintCommand: COMMAND
  1828. + This specified the print command used for printing the PostScript file.
  1829. + Default is lpr (without any quotes).
  1830.   .SH ENVIRONMENT
  1831.   .TP
  1832. ***************
  1833. *** 345,350 ****
  1834.   .br
  1835.   .DE
  1836.   .SH SEE ALSO
  1837. ! \fBlatex\fR(1L), \fBlpr\fR(1), \fBenv\fR(1), \fBX\fR(1), \fBtgif2ps\fR(1)
  1838.   .SH BUGS
  1839.   When any of the ``escape to Prolog'' commands are accidentally
  1840. --- 396,406 ----
  1841.   .br
  1842.   .DE
  1843. + .br
  1844. + .PP
  1845. + Note that the last 6 files are no longer needed for version 1.3
  1846. + and above.
  1847.   .SH SEE ALSO
  1848. ! \fBlatex\fR(1L), \fBlpr\fR(1), \fBenv\fR(1), \fBX\fR(1), \fBtgif2ps\fR(1),
  1849. ! \fBdvips\fR(1)
  1850.   .SH BUGS
  1851.   When any of the ``escape to Prolog'' commands are accidentally
  1852. *** README.orig    Wed Jun 27 13:34:11 1990
  1853. --- README    Wed Jun 27 13:34:12 1990
  1854. ***************
  1855. *** 2,6 ****
  1856.    * Author:    William Chia-Wei Cheng (william@cs.ucla.edu)
  1857.    *
  1858. !  * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/README,v 1.2 90/05/10 09:23:20 william Exp $
  1859.    */
  1860.   
  1861. --- 2,6 ----
  1862.    * Author:    William Chia-Wei Cheng (william@cs.ucla.edu)
  1863.    *
  1864. !  * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/README,v 1.3 90/05/25 14:34:11 william Exp $
  1865.    */
  1866.   
  1867. ***************
  1868. *** 16,20 ****
  1869.       psroff -man tgif.man        <== to print
  1870.   
  1871. ! 3) If you don't have imake, just do the following,
  1872.       cp Makefile.noimake Makefile
  1873.       make tgif
  1874. --- 16,23 ----
  1875.       psroff -man tgif.man        <== to print
  1876.   
  1877. ! 3) Modify Makefile.noimake or Imakefile such that TGIF_PATH is set
  1878. !    to the directory where the icon file and the PostScript macro file are.
  1879. ! 4) If you don't have imake, just do the following,
  1880.       cp Makefile.noimake Makefile
  1881.       make tgif
  1882. ***************
  1883. *** 24,29 ****
  1884.       make tgif
  1885.   
  1886. ! 4) Remember to set the environment variables TGIFPATH and TGIFICON (see
  1887.       the man pages).
  1888.   
  1889. ! 5) Please also note that tgif has nothing to do with GIF files/formats.
  1890. --- 27,32 ----
  1891.       make tgif
  1892.   
  1893. ! 5) Remember to set the environment variables TGIFPATH and TGIFICON (see
  1894.       the man pages).
  1895.   
  1896. ! 6) Please also note that tgif has nothing to do with GIF files/formats.
  1897. *** .psmac.orig    Wed Jun 27 14:28:37 1990
  1898. --- .psmac    Wed Jun 27 14:28:37 1990
  1899. ***************
  1900. *** 1,3 ****
  1901. - %!
  1902.   
  1903.   /ellipsedict 6 dict def
  1904. --- 1,2 ----
  1905. ---------------------------------> cut here <---------------------------------
  1906. --
  1907.  
  1908. -- Bill Cheng // UCLA Computer Science Department // (213) 206-7135
  1909.    3277 Boelter Hall // Los Angeles, California 90024 // USA
  1910.    william@CS.UCLA.EDU      ...!{uunet|ucbvax}!cs.ucla.edu!william
  1911.  
  1912. dan
  1913. ----------------------------------------------------
  1914. O'Reilly && Associates   argv@sun.com / argv@ora.com
  1915. Opinions expressed reflect those of the author only.
  1916.