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

  1. Path: uunet!snorkelwacker!usc!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: v08i095: tgif, (tgif-1.14 => tgif-1.15), Patch5, Part01/01
  5. Message-ID: <141428@sun.Eng.Sun.COM>
  6. Date: 28 Aug 90 07:45:02 GMT
  7. Sender: news@sun.Eng.Sun.COM
  8. Lines: 598
  9. Approved: argv@sun.com
  10.  
  11. Submitted-by: william@CS.UCLA.EDU (William Cheng)
  12. Posting-number: Volume 8, Issue 95
  13. Archive-name: tgif/patch5
  14. Patch-To: tgif: Volume 7, Issue 56-76 (original: tgif-1.2)
  15. Patch-To: tgif: Volume 8, Issue 46-48 (Patch1: tgif-1.2 => tgif-1.9)
  16. Patch-To: tgif: Volume 8, Issue 58-60 (Patch2: tgif-1.9 => tgif-1.12)
  17. Patch-To: tgif: Volume 8, Issue 87-89 (Patch3: tgif-1.12 => tgif-1.13)
  18. Patch-To: tgif: Volume 8, Issue 94 (Patch4: tgif-1.13 => tgif-1.14)
  19.  
  20. Patch5 of tgif takes tgif-1.14 to tgif-1.15.  Below is a list of
  21. added features/bug fixes, followed by the actual patch.
  22.  
  23. tgif-1.14 => tgif-1.15
  24.  
  25. 1) Fix bugs related to rewind() that it should not return any status.
  26.    Thanks to Carl Witty@Stanford for the patch.
  27. 2) Upgrade 'tgif.pl' (Prolog hints) to handle file version 8.
  28.  
  29. ---------------------------------> cut here <---------------------------------
  30. *** copypaste.c.orig    Mon Aug 27 11:30:57 1990
  31. --- copypaste.c    Mon Aug 27 11:30:58 1990
  32. ***************
  33. *** 7,11 ****
  34.   #ifndef lint
  35.   static char RCSid[] =
  36. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/copypaste.c,v 1.7 90/08/16 13:32:44 william Exp $";
  37.   #endif
  38.   
  39. --- 7,11 ----
  40.   #ifndef lint
  41.   static char RCSid[] =
  42. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/copypaste.c,v 1.8 90/08/25 17:26:51 william Exp $";
  43.   #endif
  44.   
  45. ***************
  46. *** 89,99 ****
  47.      cutBuffer = (char *) calloc (stat.st_size, sizeof(char));
  48.   
  49. !    if (rewind (fp) < 0)
  50.      {
  51. -       sprintf (message, "Error in rewinding %s.  Copy aborted!", tmpfile);
  52. -       Msg (message);
  53. -    }
  54. -    else if (read (fileno(fp), cutBuffer, stat.st_size) < stat.st_size)
  55. -    {
  56.         sprintf (message, "READ error in %s.  Copy aborted!", tmpfile);
  57.         Msg (message);
  58. --- 89,95 ----
  59.      cutBuffer = (char *) calloc (stat.st_size, sizeof(char));
  60.   
  61. !    rewind(fp);
  62. !    if (read (fileno(fp), cutBuffer, stat.st_size) < stat.st_size)
  63.      {
  64.         sprintf (message, "READ error in %s.  Copy aborted!", tmpfile);
  65.         Msg (message);
  66. ***************
  67. *** 246,257 ****
  68.      }
  69.      fflush (fp);
  70. !    if (rewind (fp) < 0)
  71. !    {
  72. !       fclose (fp);
  73. !       unlink (tmpfile);
  74. !       sprintf (message, "Error in rewinding %s.  Paste aborted!", tmpfile);
  75. !       Msg (message);
  76. !       return;
  77. !    }
  78.   
  79.      TieLooseEnds ();
  80. --- 242,246 ----
  81.      }
  82.      fflush (fp);
  83. !    rewind (fp);
  84.   
  85.      TieLooseEnds ();
  86. *** version.c.orig    Mon Aug 27 11:31:04 1990
  87. --- version.c    Mon Aug 27 11:31:04 1990
  88. ***************
  89. *** 6,11 ****
  90.   #ifndef lint
  91.   static char RCSid[] =
  92. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/version.c,v 1.17 90/08/21 21:30:03 william Exp $";
  93.   #endif
  94.   
  95. ! char    * version_string = "1.14";
  96. --- 6,11 ----
  97.   #ifndef lint
  98.   static char RCSid[] =
  99. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/version.c,v 1.19 90/08/27 10:32:54 william Exp $";
  100.   #endif
  101.   
  102. ! char    * version_string = "1.15";
  103. *** Makefile.noimake.orig    Mon Aug 27 11:31:09 1990
  104. --- Makefile.noimake    Mon Aug 27 11:31:10 1990
  105. ***************
  106. *** 4,8 ****
  107.   # Copyright (C) 1990, William Cheng.
  108.   #
  109. ! # @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/Makefile.noimake,v 1.23 90/08/21 16:09:05 william Exp $
  110.   #
  111.   
  112. --- 4,8 ----
  113.   # Copyright (C) 1990, William Cheng.
  114.   #
  115. ! # @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/Makefile.noimake,v 1.25 90/08/27 11:29:48 william Exp $
  116.   #
  117.   
  118. ***************
  119. *** 10,14 ****
  120.   LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
  121.   
  122. ! INSTALLDIR = /u/tangram/bin
  123.   
  124.   CC = cc
  125. --- 10,15 ----
  126.   LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
  127.   
  128. ! TGIFVERSION    = 1.15
  129. ! INSTALLDIR    = /u/tangram/bin
  130.   
  131.   CC = cc
  132. ***************
  133. *** 215,219 ****
  134.   
  135.   tar:
  136. !     tar cvf tgif-1.0.tar *.c *.e *.h Makefile.noimake Imakefile \
  137.           bitmaps/*.bm .psmac .*port .*land tgificon.obj \
  138.           $(OBJDEMO) \
  139. --- 216,226 ----
  140.   
  141.   tar:
  142. !     @if [ `hostname` != rye ] ; then \
  143. !         echo ''; \
  144. !         echo '    Error:  Can only generate tar file on rye'; \
  145. !         echo ''; \ exit 1; \
  146. !     fi;
  147. !     rm -f tgif-$(TGIFVERSION).tar*
  148. !     tar cvf tgif-$(TGIFVERSION).tar *.c *.e *.h Makefile.noimake Imakefile \
  149.           bitmaps/*.bm .psmac .*port .*land tgificon.obj \
  150.           $(OBJDEMO) \
  151. ***************
  152. *** 220,224 ****
  153.           $(SYMDEMO) \
  154.           $(MISCTAR)
  155. !     compress tgif-1.0.tar
  156.   
  157.   clean:
  158. --- 227,231 ----
  159.           $(SYMDEMO) \
  160.           $(MISCTAR)
  161. !     compress tgif-$(TGIFVERSION).tar
  162.   
  163.   clean:
  164. *** Imakefile.orig    Mon Aug 27 11:31:16 1990
  165. --- Imakefile    Mon Aug 27 11:31:17 1990
  166. ***************
  167. *** 4,11 ****
  168.   /**/# Copyright (C) 1990, William Cheng.
  169.   /**/#
  170. ! /**/# @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/Imakefile,v 1.25 90/08/21 21:30:40 william Exp $
  171.   /**/#
  172.   
  173. ! TGIFVERSION    = 1.14
  174.   PROGRAMS    = tgif prtgif tgif2ps frontend11.o
  175.   /**/#CDEBUGFLAGS= -g
  176. --- 4,11 ----
  177.   /**/# Copyright (C) 1990, William Cheng.
  178.   /**/#
  179. ! /**/# @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/Imakefile,v 1.28 90/08/27 11:29:39 william Exp $
  180.   /**/#
  181.   
  182. ! TGIFVERSION    = 1.15
  183.   PROGRAMS    = tgif prtgif tgif2ps frontend11.o
  184.   /**/#CDEBUGFLAGS= -g
  185. ***************
  186. *** 66,69 ****
  187. --- 66,74 ----
  188.   
  189.   tar:
  190. +     @if [ `hostname` != rye ] ; then \
  191. +         echo ''; \
  192. +         echo '    Error:  Can only generate tar file on rye'; \
  193. +         echo ''; \ exit 1; \
  194. +     fi;
  195.       rm -f tgif-$(TGIFVERSION).tar/**/*
  196.       tar cvf tgif-$(TGIFVERSION).tar /**/*.c /**/*.e /**/*.h \
  197. *** tgif.pl.orig    Mon Aug 27 11:31:21 1990
  198. --- tgif.pl    Mon Aug 27 11:31:22 1990
  199. ***************
  200. *** 1,141 ****
  201.   %
  202. ! % Consult a '.obj' file or a '.sym' file, then try to trace the following
  203. ! %    code.
  204.   %
  205. ! % @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/tgif.pl,v 1.3 90/07/30 17:30:05 william Exp $
  206.   %
  207.   
  208. ! tgif_state(FileVersion) :-
  209. !     %    Note:  This works for FileVersion>=6.
  210. !     state(_PageStyle,FileVersion,_OrigX,_OrigY,_Zoom,_GridSize,_Grid,
  211. !         _Color,_HoriAlign,_VertAlign,_LineWidth,_Spline,_LineStyle,
  212. !         _ObjFill,_PenPat,_TextJust,_Font,_TextStyle,_TextSize).
  213. ! tgif_text(FileVersion, Obj) :-
  214. !     FileVersion == 6,
  215. !     (    var(Obj) ->
  216. !         Obj = text(_Color,_X,_Y,_Font,_TextStyle,_TextSize,_NumLines,
  217. !             _TextJust,_TextRotate,_PenPat,StrList),
  218. !         call(Obj)
  219. !     ;    Obj = text(_Color,_X,_Y,_Font,_TextStyle,_TextSize,_NumLines,
  220. !             _TextJust,_TextRotate,_PenPat,StrList)
  221.       ),
  222. !     tgif_strs(FileVersion, StrList).
  223. ! tgif_text(FileVersion, Obj) :-
  224. !     FileVersion >= 7,
  225. !     (    var(Obj) ->
  226. !         Obj = text(_Color,_X,_Y,_Font,_TextStyle,_TextSize,_NumLines,
  227. !             _TextJust,_TextRotate,_PenPat,_BBoxW,_BBoxH,StrList),
  228. !         call(Obj)
  229. !     ;    Obj = text(_Color,_X,_Y,_Font,_TextStyle,_TextSize,_NumLines,
  230. !             _TextJust,_TextRotate,_PenPat,_BBoxW,_BBoxH,StrList)
  231.       ),
  232. !     tgif_strs(FileVersion, StrList).
  233.   
  234. ! tgif_box(FileVersion, Obj) :-
  235. !     FileVersion >= 6,
  236. !     (    var(Obj) ->
  237. !         Obj = box(_Color,_X1,_Y1,_X2,_Y2,_ObjFill,_LineWidth,_PenPat),
  238. !         call(Obj)
  239. !     ;    Obj = box(_Color,_X1,_Y1,_X2,_Y2,_ObjFill,_LineWidth,_PenPat)
  240. !     ).
  241.   
  242. ! tgif_oval(FileVersion, Obj) :-
  243. !     FileVersion >= 6,
  244. !     (    var(Obj) ->
  245. !         Obj = oval(_Color,_LeftTopX,_LeftTopY,_RightBotX,_RightBotY,
  246. !             _ObjFill,_LineWidth,_PenPat),
  247. !         call(Obj)
  248. !     ;    Obj = oval(_Color,_LeftTopX,_LeftTopY,_RightBotX,_RightBotY,
  249. !             _ObjFill,_LineWidth,_PenPat)
  250. !     ).
  251.   
  252. ! tgif_poly(FileVersion, Obj) :-
  253. !     FileVersion >= 6,
  254. !     (    var(Obj) ->
  255. !         Obj = poly(_Color,_NumVs,_Vs,_LineStyle,_LineWidth,_PenPat,_Id,
  256. !             _Spline,_ObjFill,AttrList),
  257. !         call(Obj)
  258. !     ;    Obj = poly(_Color,_NumVs,_Vs,_LineStyle,_LineWidth,_PenPat,_Id,
  259. !             _Spline,_ObjFill,AttrList)
  260. !     ),
  261. !     tgif_attrs(FileVersion, AttrList).
  262.   
  263. ! tgif_polygon(FileVersion, Obj) :-
  264. !     FileVersion >= 6,
  265. !     (    var(Obj) ->
  266. !         Obj = polygon(_Color,_NumVs,_Vs,_ObjFill,_LineWidth,_PenPat,
  267. !             _Spline),
  268. !         call(Obj)
  269. !     ;    Obj = polygon(_Color,_NumVs,_Vs,_ObjFill,_LineWidth,_PenPat,
  270. !             _Spline)
  271. !     ).
  272.   
  273. ! tgif_group(FileVersion, Obj) :-
  274. !     FileVersion >= 6,
  275. !     (    var(Obj) ->
  276. !         Obj = group(ObjList,AttrList),
  277. !         call(Obj)
  278. !     ;    Obj = group(ObjList,AttrList)
  279. !     ),
  280. !     tgif_objs(FileVersion, ObjList),
  281. !     tgif_attrs(FileVersion, AttrList).
  282.   
  283. ! tgif_sym(FileVersion, Obj) :-
  284. !     FileVersion >= 6,
  285. !     (    var(Obj) ->
  286. !         Obj = sym(ObjList,AttrList),
  287. !         call(Obj)
  288. !     ;    Obj = sym(ObjList,AttrList)
  289. !     ),
  290. !     tgif_objs(FileVersion, ObjList),
  291. !     tgif_attrs(FileVersion, AttrList).
  292.   
  293. ! tgif_icon(FileVersion, Obj) :-
  294. !     FileVersion >= 6,
  295. !     (    var(Obj) ->
  296. !         Obj = icon(ObjList,_Name,_Id,AttrList),
  297. !         call(Obj)
  298. !     ;    Obj = icon(ObjList,_Name,_Id,AttrList)
  299. !     ),
  300. !     tgif_objs(FileVersion, ObjList),
  301. !     tgif_attrs(FileVersion, AttrList).
  302.   
  303. ! % ----------------------------- support routines --------------------------- %
  304.   
  305. ! tgif_strs(_FileVersion, []) :- !.
  306. ! tgif_strs(FileVersion, [_Str|Strs]) :-
  307. !     FileVersion >= 6,
  308. !     !, tgif_strs(FileVersion, Strs).
  309.   
  310. ! tgif_objs(_FileVersion, []) :- !.
  311. ! tgif_objs(FileVersion, [Obj|Objs]) :-
  312. !     FileVersion >= 6,
  313.       !,
  314.       functor(Obj,Functor,_Arity),
  315.       (    Functor == text ->
  316. !         tgif_text(FileVersion, Obj)
  317.       ;    Functor == box ->
  318. !         tgif_box(FileVersion, Obj)
  319.       ;    Functor == oval ->
  320. !         tgif_oval(FileVersion, Obj)
  321.       ;    Functor == poly ->
  322. !         tgif_poly(FileVersion, Obj)
  323.       ;    Functor == polygon ->
  324. !         tgif_polygon(FileVersion, Obj)
  325.       ;    Functor == group ->
  326. !         tgif_group(FileVersion, Obj)
  327.       ;    Functor == sym ->
  328. !         tgif_sym(FileVersion, Obj)
  329.       ;    Functor == icon ->
  330. !         tgif_icon(FileVersion, Obj)
  331.       ;    true
  332.       ),
  333. !     !, tgif_objs(FileVersion, Objs).
  334.   
  335. ! tgif_attrs(_FileVersion, []) :- !.
  336. ! tgif_attrs(FileVersion, [Attr|Attrs]) :-
  337. !     FileVersion >= 6,
  338. !     !,
  339. !     Attr = attr(_Name,_Value,_ShowAll,_ShowNameOnly,_Inherited,_TextObj),
  340. !     !, tgif_attrs(FileVersion, Attrs).
  341. --- 1,256 ----
  342.   %
  343. ! % 1) Call tgif_clean/0 each time before step (2).
  344. ! % 2) Consult a '.obj' or a '.sym' file.
  345. ! % 3) Call tgif_state/2.  This must be called before any other tgif goals
  346. ! %    are called.
  347. ! % 4) Trace any other goals.
  348.   %
  349. ! % @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/tgif.pl,v 1.5 90/08/27 11:19:13 william Exp $
  350.   %
  351.   
  352. ! tgif_state(FileVersion,Obj) :-
  353. !     (    var(Obj) -> OutputObj = true,
  354. !         current_predicate(state,
  355. !             state(_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_))
  356. !     ;    OutputObj = false
  357.       ),
  358. !     Obj = state(_PageStyle,FileVersion,_OrigX,_OrigY,_Zoom,
  359. !         _GridSize,_Grid,_Color,_HoriAlign,_VertAlign,_LineWidth,
  360. !         _LineStyle,_ObjFill,_PenPat,_TextJust,_Font,
  361. !         _TextStyle,_TextSize),
  362. !     ( OutputObj == true -> call(Obj) ; true ),
  363. !     FileVersion =< 3,
  364. !     !, abolish(tgif_file_version/1),
  365. !     !, assert(tgif_file_version(FileVersion)).
  366. ! tgif_state(FileVersion,Obj) :-
  367. !     (    var(Obj) -> OutputObj = true,
  368. !         current_predicate(state,
  369. !             state(_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_))
  370. !     ;    OutputObj = false
  371.       ),
  372. !     Obj = state(_PageStyle,FileVersion,_OrigX,_OrigY,_Zoom,
  373. !         _GridSize,_Grid,_Color,_HoriAlign,_VertAlign,_LineWidth,
  374. !         _Spline,_LineStyle,_ObjFill,_PenPat,_TextJust,_Font,
  375. !         _TextStyle,_TextSize),
  376. !     ( OutputObj == true -> call(Obj) ; true ),
  377. !     FileVersion =< 7,
  378. !     !, abolish(tgif_file_version/1),
  379. !     !, assert(tgif_file_version(FileVersion)).
  380. ! tgif_state(FileVersion,Obj) :-
  381. !     (    var(Obj) -> OutputObj = true,
  382. !         current_predicate(state,
  383. !             state(_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_))
  384. !     ;    OutputObj = false
  385. !     ),
  386. !     Obj = state(_PageStyle,FileVersion,_OrigX,_OrigY,_Zoom,
  387. !         _GridSize,_Grid,_Color,_HoriAlign,_VertAlign,_LineWidth,
  388. !         _Spline,_LineStyle,_ObjFill,_PenPat,_TextJust,_Font,
  389. !         _TextStyle,_TextSize,_TextDPI),
  390. !     ( OutputObj == true -> call(Obj) ; true ),
  391. !     FileVersion >= 8,
  392. !     !, abolish(tgif_file_version/1),
  393. !     !, assert(tgif_file_version(FileVersion)).
  394.   
  395. ! % --------------------------------------------------------------------- %
  396.   
  397. ! tgif_text(Obj) :-
  398. !     current_predicate(tgif_file_version,tgif_file_version(_)),
  399. !     tgif_file_version(FileVersion),
  400. !     FileVersion =< 2, !,
  401. !     ( var(Obj) -> OutputObj = true ; OutputObj = false ),
  402. !     Obj = text(_Color,_X,_Y,_Font,_TextStyle,_TextSize,_NumLines,_TextJust,
  403. !         StrList),
  404. !     ( OutputObj == true -> call(Obj) ; true ),
  405. !     tgif_strs(StrList).
  406. ! tgif_text(Obj) :-
  407. !     current_predicate(tgif_file_version,tgif_file_version(_)),
  408. !     tgif_file_version(FileVersion),
  409. !     FileVersion =< 6, !,
  410. !     ( var(Obj) -> OutputObj = true ; OutputObj = false ),
  411. !     Obj = text(_Color,_X,_Y,_Font,_TextStyle,_TextSize,_NumLines,_TextJust,
  412. !         _TextRotate,_PenPat,StrList),
  413. !     ( OutputObj == true -> call(Obj) ; true ),
  414. !     tgif_strs(StrList).
  415. ! tgif_text(Obj) :-
  416. !     current_predicate(tgif_file_version,tgif_file_version(_)),
  417. !     tgif_file_version(FileVersion),
  418. !     FileVersion =< 7, !,
  419. !     ( var(Obj) -> OutputObj = true ; OutputObj = false ),
  420. !     Obj = text(_Color,_X,_Y,_Font,_TextStyle,_TextSize,_NumLines,_TextJust,
  421. !         _TextRotate,_PenPat,_BBoxW,_BBoxH,StrList),
  422. !     ( OutputObj == true -> call(Obj) ; true ),
  423. !     tgif_strs(StrList).
  424. ! tgif_text(Obj) :-
  425. !     current_predicate(tgif_file_version,tgif_file_version(_)),
  426. !     tgif_file_version(FileVersion),
  427. !     FileVersion >= 8, !,
  428. !     ( var(Obj) -> OutputObj = true ; OutputObj = false ),
  429. !     Obj = text(_Color,_X,_Y,_Font,_TextStyle,_TextSize,_NumLines,_TextJust,
  430. !         _TextRotate,_PenPat,_BBoxW,_BBoxH,_Id,_TextDPI,StrList),
  431. !     ( OutputObj == true -> call(Obj) ; true ),
  432. !     tgif_strs(StrList).
  433.   
  434. ! % --------------------------------------------------------------------- %
  435.   
  436. ! tgif_box(Obj) :-
  437. !     current_predicate(tgif_file_version,tgif_file_version(_)),
  438. !     tgif_file_version(FileVersion),
  439. !     FileVersion =< 7, !,
  440. !     ( var(Obj) -> OutputObj = true ; OutputObj = false ),
  441. !     Obj = box(_Color,_X1,_Y1,_X2,_Y2,_ObjFill,_LineWidth,_PenPat),
  442. !     ( OutputObj == true -> call(Obj) ; true ).
  443. ! tgif_box(Obj) :-
  444. !     current_predicate(tgif_file_version,tgif_file_version(_)),
  445. !     tgif_file_version(FileVersion),
  446. !     FileVersion >= 8, !,
  447. !     ( var(Obj) -> OutputObj = true ; OutputObj = false ),
  448. !     Obj = box(_Color,_X1,_Y1,_X2,_Y2,_ObjFill,_LineWidth,_PenPat,_Id,
  449. !         AttrList),
  450. !     ( OutputObj == true -> call(Obj) ; true ),
  451. !     tgif_attrs(AttrList).
  452.   
  453. ! % --------------------------------------------------------------------- %
  454.   
  455. ! tgif_oval(Obj) :-
  456. !     current_predicate(tgif_file_version,tgif_file_version(_)),
  457. !     tgif_file_version(FileVersion),
  458. !     FileVersion =< 7, !,
  459. !     ( var(Obj) -> OutputObj = true ; OutputObj = false ),
  460. !     Obj = oval(_Color,_LeftTopX,_LeftTopY,_RightBotX,_RightBotY,_ObjFill,
  461. !         _LineWidth,_PenPat),
  462. !     ( OutputObj == true -> call(Obj) ; true ).
  463. ! tgif_oval(Obj) :-
  464. !     current_predicate(tgif_file_version,tgif_file_version(_)),
  465. !     tgif_file_version(FileVersion),
  466. !     FileVersion >= 8, !,
  467. !     ( var(Obj) -> OutputObj = true ; OutputObj = false ),
  468. !     Obj = oval(_Color,_LeftTopX,_LeftTopY,_RightBotX,_RightBotY,_ObjFill,
  469. !         _LineWidth,_PenPat,_Id,AttrList),
  470. !     ( OutputObj == true -> call(Obj) ; true ),
  471. !     tgif_attrs(AttrList).
  472.   
  473. ! % --------------------------------------------------------------------- %
  474.   
  475. ! tgif_poly(Obj) :-
  476. !     current_predicate(tgif_file_version,tgif_file_version(_)),
  477. !     tgif_file_version(FileVersion),
  478. !     FileVersion =< 3, !,
  479. !     ( var(Obj) -> OutputObj = true ; OutputObj = false ),
  480. !     Obj = poly(_Color,_NumVs,_Vs,_LineStyle,_LineWidth,_PenPat,_Id,
  481. !         AttrList),
  482. !     ( OutputObj == true -> call(Obj) ; true ),
  483. !     tgif_attrs(AttrList).
  484. ! tgif_poly(Obj) :-
  485. !     current_predicate(tgif_file_version,tgif_file_version(_)),
  486. !     tgif_file_version(FileVersion),
  487. !     FileVersion =< 4, !,
  488. !     ( var(Obj) -> OutputObj = true ; OutputObj = false ),
  489. !     Obj = poly(_Color,_NumVs,_Vs,_LineStyle,_LineWidth,_PenPat,_Id,_Spline,
  490. !         AttrList),
  491. !     ( OutputObj == true -> call(Obj) ; true ),
  492. !     tgif_attrs(AttrList).
  493. ! tgif_poly(Obj) :-
  494. !     current_predicate(tgif_file_version,tgif_file_version(_)),
  495. !     tgif_file_version(FileVersion),
  496. !     FileVersion >= 5, !,
  497. !     ( var(Obj) -> OutputObj = true ; OutputObj = false ),
  498. !     Obj = poly(_Color,_NumVs,_Vs,_LineStyle,_LineWidth,_PenPat,_Id,_Spline,
  499. !         _ObjFill,AttrList),
  500. !     ( OutputObj == true -> call(Obj) ; true ),
  501. !     tgif_attrs(AttrList).
  502.   
  503. ! % --------------------------------------------------------------------- %
  504.   
  505. ! tgif_polygon(Obj) :-
  506. !     current_predicate(tgif_file_version,tgif_file_version(_)),
  507. !     tgif_file_version(FileVersion),
  508. !     FileVersion =< 3, !,
  509. !     ( var(Obj) -> OutputObj = true ; OutputObj = false ),
  510. !     Obj = polygon(_Color,_NumVs,_Vs,_ObjFill,_LineWidth,_PenPat),
  511. !     ( OutputObj == true -> call(Obj) ; true ).
  512. ! tgif_polygon(Obj) :-
  513. !     current_predicate(tgif_file_version,tgif_file_version(_)),
  514. !     tgif_file_version(FileVersion),
  515. !     FileVersion =< 7, !,
  516. !     ( var(Obj) -> OutputObj = true ; OutputObj = false ),
  517. !     Obj = polygon(_Color,_NumVs,_Vs,_ObjFill,_LineWidth,_PenPat,_Spline),
  518. !     ( OutputObj == true -> call(Obj) ; true ).
  519. ! tgif_polygon(Obj) :-
  520. !     current_predicate(tgif_file_version,tgif_file_version(_)),
  521. !     tgif_file_version(FileVersion),
  522. !     FileVersion >= 8, !,
  523. !     ( var(Obj) -> OutputObj = true ; OutputObj = false ),
  524. !     Obj = polygon(_Color,_NumVs,_Vs,_ObjFill,_LineWidth,_PenPat,_Spline,
  525. !         _Id,AttrList),
  526. !     ( OutputObj == true -> call(Obj) ; true ),
  527. !     tgif_attrs(AttrList).
  528. ! % --------------------------------------------------------------------- %
  529. ! tgif_group(Obj) :-
  530. !     ( var(Obj) -> OutputObj = true ; OutputObj = false ),
  531. !     Obj = group(ObjList,AttrList),
  532. !     ( OutputObj == true -> call(Obj) ; true ),
  533. !     tgif_objs(ObjList),
  534. !     tgif_attrs(AttrList).
  535. ! % --------------------------------------------------------------------- %
  536. ! tgif_sym(Obj) :-
  537. !     ( var(Obj) -> OutputObj = true ; OutputObj = false ),
  538. !     Obj = sym(ObjList,AttrList),
  539. !     ( OutputObj == true -> call(Obj) ; true ),
  540. !     tgif_objs(ObjList),
  541. !     tgif_attrs(AttrList).
  542. ! % --------------------------------------------------------------------- %
  543. ! tgif_icon(Obj) :-
  544. !     ( var(Obj) -> OutputObj = true ; OutputObj = false ),
  545. !     Obj = icon(ObjList,_Name,_Id,AttrList),
  546. !     ( OutputObj == true -> call(Obj) ; true ),
  547. !     tgif_objs(ObjList),
  548. !     tgif_attrs(AttrList).
  549. ! % ======================== support routines =========================== %
  550. ! tgif_clean :- abolish(state/18), abolish(state/19), abolish(state/20).
  551. ! % --------------------------------------------------------------------- %
  552. ! tgif_strs([]) :- !.
  553. ! tgif_strs([_Str|Strs]) :- !, tgif_strs(Strs).
  554. ! % --------------------------------------------------------------------- %
  555. ! tgif_objs([]) :- !.
  556. ! tgif_objs([Obj|Objs]) :-
  557.       !,
  558.       functor(Obj,Functor,_Arity),
  559.       (    Functor == text ->
  560. !         tgif_text(Obj)
  561.       ;    Functor == box ->
  562. !         tgif_box(Obj)
  563.       ;    Functor == oval ->
  564. !         tgif_oval(Obj)
  565.       ;    Functor == poly ->
  566. !         tgif_poly(Obj)
  567.       ;    Functor == polygon ->
  568. !         tgif_polygon(Obj)
  569.       ;    Functor == group ->
  570. !         tgif_group(Obj)
  571.       ;    Functor == sym ->
  572. !         tgif_sym(Obj)
  573.       ;    Functor == icon ->
  574. !         tgif_icon(Obj)
  575.       ;    true
  576.       ),
  577. !     !, tgif_objs(Objs).
  578.   
  579. ! % --------------------------------------------------------------------- %
  580. ! tgif_attrs([]) :- !.
  581. ! tgif_attrs([Attr|Attrs]) :-
  582. !     Attr = attr(_Name,_Value,_ShowAll,_ShowNameOnly,_Inherited,TextObj),
  583. !     tgif_text(TextObj),
  584. !     !, tgif_attrs(Attrs).
  585. ---------------------------------> cut here <---------------------------------
  586. --
  587. Bill Cheng // UCLA Computer Science Department // (213) 206-7135
  588. 3277 Boelter Hall // Los Angeles, California 90024 // USA
  589. william@CS.UCLA.EDU      ...!{uunet|ucbvax}!cs.ucla.edu!william
  590.  
  591. dan
  592. ----------------------------------------------------
  593. O'Reilly && Associates   argv@sun.com / argv@ora.com
  594. Opinions expressed reflect those of the author only.
  595.