ivtools-patch Mailing List for ivtools (Page 8)
Brought to you by:
johnston
You can subscribe to this list here.
1999 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2000 |
Jan
(17) |
Feb
(14) |
Mar
(7) |
Apr
(7) |
May
(20) |
Jun
(18) |
Jul
(5) |
Aug
(9) |
Sep
(4) |
Oct
(2) |
Nov
(2) |
Dec
(1) |
2001 |
Jan
(3) |
Feb
(2) |
Mar
(5) |
Apr
(7) |
May
(9) |
Jun
(15) |
Jul
(10) |
Aug
(2) |
Sep
(10) |
Oct
(15) |
Nov
(14) |
Dec
(2) |
2002 |
Jan
(8) |
Feb
(13) |
Mar
(10) |
Apr
(3) |
May
(2) |
Jun
(7) |
Jul
(5) |
Aug
(3) |
Sep
(1) |
Oct
(1) |
Nov
(10) |
Dec
|
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
|
Sep
|
Oct
(4) |
Nov
(1) |
Dec
(3) |
2004 |
Jan
(2) |
Feb
(6) |
Mar
(1) |
Apr
(1) |
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2005 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
(4) |
Nov
(1) |
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
(2) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
2010 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ivt...@li...> - 2000-11-20 22:39:42
|
Patch: ivtools-001120-johnston-104 For: ivtools-0.8 Author: joh...@us... Subject: fix up the construction of symbolic links done by configure script Requires: This is an intermediate patch to ivtools-0.8. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - this patch fixes up the construction of symbolic links for Unidraw-common done by the configure script. Index: top_ivtools/configure diff -c top_ivtools/configure:1.2 top_ivtools/configure:1.3 *** top_ivtools/configure:1.2 Tue Sep 19 16:35:26 2000 --- ./configure Mon Nov 20 14:35:44 2000 *************** *** 2051,2056 **** --- 2051,2057 ---- ln -s ../InterViews; cd ../../..; fi + if test ! -f src/IV-common/listimpl.c ; then echo "establishing symbolic links for src/IV-common" cd src/IV-common; *************** *** 2065,2075 **** ln -s ../IV-2_6/tform2_6.c; cd ../..; fi ! if test ! -f src/Unidraw-common/iterator.c ; then ! echo "establishing symbolic links for src/Unidraw-common" cd src/Unidraw-common; ln -s ../Unidraw/geomobjs.c; ln -s ../Unidraw/iterator.c; ln -s ../Unidraw/ulist.c; cd ../..; fi --- 2066,2111 ---- ln -s ../IV-2_6/tform2_6.c; cd ../..; fi ! ! if test ! -f src/Unidraw-common/component.c ; then ! echo "establishing symbolic link for src/Unidraw-common/component.c" ! cd src/Unidraw-common; ! ln -s ../Unidraw/component.c; ! cd ../..; ! fi ! if test ! -f src/Unidraw-common/compview.c ; then ! echo "establishing symbolic link for src/Unidraw-common/compview.c" ! cd src/Unidraw-common; ! ln -s ../Unidraw/compview.c; ! cd ../..; ! fi ! if test ! -f src/Unidraw-common/geomobjs.c ; then ! echo "establishing symbolic link for src/Unidraw-common/geomobjs.c" cd src/Unidraw-common; ln -s ../Unidraw/geomobjs.c; + cd ../..; + fi + if test ! -f src/Unidraw-common/iterator.c ; then + echo "establishing symbolic link for src/Unidraw-common/iterator.c" + cd src/Unidraw-common; ln -s ../Unidraw/iterator.c; + cd ../..; + fi + if test ! -f src/Unidraw-common/uarray.c ; then + echo "establishing symbolic link for src/Unidraw-common/uarray.c" + cd src/Unidraw-common; + ln -s ../Unidraw/uarray.c; + cd ../..; + fi + if test ! -f src/Unidraw-common/uhash.c ; then + echo "establishing symbolic link for src/Unidraw-common/uhash.c" + cd src/Unidraw-common; + ln -s ../Unidraw/uhash.c; + cd ../..; + fi + if test ! -f src/Unidraw-common/ulist.c ; then + echo "establishing symbolic link for src/Unidraw-common/ulist.c" + cd src/Unidraw-common; ln -s ../Unidraw/ulist.c; cd ../..; fi Index: top_ivtools/configure.in diff -c top_ivtools/configure.in:1.2 top_ivtools/configure.in:1.3 *** top_ivtools/configure.in:1.2 Tue Sep 19 16:35:26 2000 --- ./configure.in Mon Nov 20 14:35:44 2000 *************** *** 333,338 **** --- 333,339 ---- ln -s ../InterViews; cd ../../..; fi + if test ! -f src/IV-common/listimpl.c ; then echo "establishing symbolic links for src/IV-common" cd src/IV-common; *************** *** 347,357 **** ln -s ../IV-2_6/tform2_6.c; cd ../..; fi ! if test ! -f src/Unidraw-common/iterator.c ; then ! echo "establishing symbolic links for src/Unidraw-common" cd src/Unidraw-common; ln -s ../Unidraw/geomobjs.c; ln -s ../Unidraw/iterator.c; ln -s ../Unidraw/ulist.c; cd ../..; fi --- 348,393 ---- ln -s ../IV-2_6/tform2_6.c; cd ../..; fi ! ! if test ! -f src/Unidraw-common/component.c ; then ! echo "establishing symbolic link for src/Unidraw-common/component.c" ! cd src/Unidraw-common; ! ln -s ../Unidraw/component.c; ! cd ../..; ! fi ! if test ! -f src/Unidraw-common/compview.c ; then ! echo "establishing symbolic link for src/Unidraw-common/compview.c" ! cd src/Unidraw-common; ! ln -s ../Unidraw/compview.c; ! cd ../..; ! fi ! if test ! -f src/Unidraw-common/geomobjs.c ; then ! echo "establishing symbolic link for src/Unidraw-common/geomobjs.c" cd src/Unidraw-common; ln -s ../Unidraw/geomobjs.c; + cd ../..; + fi + if test ! -f src/Unidraw-common/iterator.c ; then + echo "establishing symbolic link for src/Unidraw-common/iterator.c" + cd src/Unidraw-common; ln -s ../Unidraw/iterator.c; + cd ../..; + fi + if test ! -f src/Unidraw-common/uarray.c ; then + echo "establishing symbolic link for src/Unidraw-common/uarray.c" + cd src/Unidraw-common; + ln -s ../Unidraw/uarray.c; + cd ../..; + fi + if test ! -f src/Unidraw-common/uhash.c ; then + echo "establishing symbolic link for src/Unidraw-common/uhash.c" + cd src/Unidraw-common; + ln -s ../Unidraw/uhash.c; + cd ../..; + fi + if test ! -f src/Unidraw-common/ulist.c ; then + echo "establishing symbolic link for src/Unidraw-common/ulist.c" + cd src/Unidraw-common; ln -s ../Unidraw/ulist.c; cd ../..; fi *** /dev/null Mon Nov 20 14:36:07 PST 2000 --- patches/ivtools-001120-johnston-104 *************** patches/ivtools-001120-johnston-104 *** 0 **** --- 1 ---- + ivtools-001120-johnston-104 |
From: <ivt...@li...> - 2000-11-20 19:50:47
|
Patch: ivtools-001120-johnston-103 For: ivtools-0.8 Author: joh...@us... Subject: building with libace5.0 for Debian 2.3 Requires: This is an intermediate patch to ivtools-0.8. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - these are patches for building with libace5.0 under Debian 2.3 (woody). Index: ComTerp/comhandler.h diff -c ComTerp/comhandler.h:1.1 ComTerp/comhandler.h:1.2 *** ComTerp/comhandler.h:1.1 Wed Aug 30 09:59:30 2000 --- src/ComTerp/comhandler.h Mon Nov 20 11:41:46 2000 *************** *** 30,35 **** --- 30,38 ---- #ifdef HAVE_ACE + #include <stdio.h> + #define __USE_GNU + #include <sys/msg.h> #include <signal.h> #include <ace/Acceptor.h> #include <ace/Reactor.h> Index: OverlayUnidraw/aceimport.h diff -c OverlayUnidraw/aceimport.h:1.1 OverlayUnidraw/aceimport.h:1.2 *** OverlayUnidraw/aceimport.h:1.1 Wed Aug 30 10:00:55 2000 --- src/OverlayUnidraw/aceimport.h Mon Nov 20 11:41:53 2000 *************** *** 26,31 **** --- 26,34 ---- #ifndef _unidraw_import_handler_ #define _unidraw_import_handler_ + #include <stdio.h> + #define __USE_GNU + #include <sys/msg.h> #include <signal.h> #include <ace/Acceptor.h> #include <ace/Reactor.h> *** /dev/null Mon Nov 20 11:42:00 PST 2000 --- patches/ivtools-001120-johnston-103 *************** patches/ivtools-001120-johnston-103 *** 0 **** --- 1 ---- + ivtools-001120-johnston-103 |
From: <ivt...@li...> - 2000-10-07 00:03:45
|
Patch: ivtools-001006-johnston-102 For: ivtools-0.8.4 Author: joh...@us... Subject: adjust dispatcher.* diffs to be specific to gcc-2.4.5 Requires: This is an intermediate patch to ivtools-0.8.4. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - adjust the diffs to dispatcher.h and dispatcher.c to be specific to gcc-2.4.5 (and earlier), instead of SunOS 4.1.4 Index: src_dispatch/dispatcher.c diff -c src_dispatch/dispatcher.c:1.2 src_dispatch/dispatcher.c:1.3 *** src_dispatch/dispatcher.c:1.2 Fri Oct 6 16:50:01 2000 --- src/Dispatch/dispatcher.c Fri Oct 6 17:02:41 2000 *************** *** 597,603 **** --- 597,607 ---- return rmaskret.numSet() + wmaskret.numSet() + emaskret.numSet(); } + #if defined(__GNUC__) && !defined(__GNUC_MINOR__) void Dispatcher::sigCLD() { + #else + void Dispatcher::sigCLD(...) { + #endif pid_t pid; int status; Index: include_dispatch/dispatcher.h diff -c include_dispatch/dispatcher.h:1.2 include_dispatch/dispatcher.h:1.3 *** include_dispatch/dispatcher.h:1.2 Fri Oct 6 16:50:13 2000 --- src/include/Dispatch/dispatcher.h Fri Oct 6 17:02:47 2000 *************** *** 91,97 **** --- 91,101 ---- TimerQueue* _queue; ChildQueue* _cqueue; + #if defined(__GNUC__) && !defined(__GNUC_MINOR__) static void sigCLD(); + #else + static void sigCLD(...); + #endif private: static Dispatcher* _instance; *** /dev/null Fri Oct 6 17:02:52 PDT 2000 --- patches/ivtools-001006-johnston-102 *************** patches/ivtools-001006-johnston-102 *** 0 **** --- 1 ---- + ivtools-001006-johnston-102 |
From: <ivt...@li...> - 2000-10-07 00:03:12
|
Patch: ivtools-001006-johnston-101 For: ivtools-0.8.4 Author: joh...@us... Subject: build on SunOS 4.1.4 with gcc-2.4.5 Requires: This is an intermediate patch to ivtools-0.8.4. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - partial build (up to glyphterp and comterp) on SunOS 4.1.4 with gcc-2.4.5. After that I ran into static initialization (even though using collect2) and multiple-inheritance problems that made it no longer worth it. diff -c top_ivtools/MANIFEST:1.1 top_ivtools/MANIFEST:1.2 *** top_ivtools/MANIFEST:1.1 Fri Oct 6 16:29:43 2000 --- ./MANIFEST Fri Oct 6 16:29:43 2000 *************** *** 810,816 **** --- 810,819 ---- ivtools-0.8/src/Unidraw-common/compview.c ivtools-0.8/src/Unidraw-common/geomobjs.c ivtools-0.8/src/Unidraw-common/iterator.c + ivtools-0.8/src/Unidraw-common/uarray.c + ivtools-0.8/src/Unidraw-common/uhash.c ivtools-0.8/src/Unidraw-common/ulist.c + ivtools-0.8/src/Unidraw-common/umap.c ivtools-0.8/src/Unidraw/Imakefile ivtools-0.8/src/Unidraw/Makefile ivtools-0.8/src/Unidraw/align.c diff -c top_ivtools/README:1.1 top_ivtools/README:1.2 *** top_ivtools/README:1.1 Fri Oct 6 16:29:44 2000 --- ./README Fri Oct 6 16:29:44 2000 *************** *** 2,10 **** README for ivtools 0.8 ! This directory contains a release of ivtools 0.8.4 from Vectaport ! Inc.. You should read the rest of this file for information on what ! ivtools is and the INSTALL file for instructions on how to build it. The overall copyright and permission notice for ivtools can be found in the COPYRIGHT file in this directory. It is similar to the X11 --- 2,10 ---- README for ivtools 0.8 ! This directory contains a release of ivtools 0.8.4. You should read ! the rest of this file for information on what ivtools is and the ! INSTALL file for instructions on how to build it. The overall copyright and permission notice for ivtools can be found in the COPYRIGHT file in this directory. It is similar to the X11 *************** *** 19,25 **** class libraries and sample programs for a wide variety of generic spatial data applications. ! ivtools comprises four sets of interrelated capabilities useful for application programmers. The first set is the libraries and example programs borrowed whole from InterViews 3.1. The second set is for reusing and extending the light-weight glyph objects of InterViews 3.1 --- 19,25 ---- class libraries and sample programs for a wide variety of generic spatial data applications. ! ivtools comprises four sets of interrelated capabilities useful to application programmers. The first set is the libraries and example programs borrowed whole from InterViews 3.1. The second set is for reusing and extending the light-weight glyph objects of InterViews 3.1 *************** *** 29,37 **** custom drawing editors). The fourth set adds a command interpreter and server mechanism to ivtools, and demonstrates these capabilities with text, glyph, and graphic front-ends. To get more of an overview ! of these layers you can read ! http://www.vectaport.com/ivtools/ivtools-layers.html. These are the libraries and example programs borrowed straight from InterViews 3.1: --- 29,38 ---- custom drawing editors). The fourth set adds a command interpreter and server mechanism to ivtools, and demonstrates these capabilities with text, glyph, and graphic front-ends. To get more of an overview ! of these layers you can read: + http://www.ivtools.org/ivtools/ivtools-layers.html. + These are the libraries and example programs borrowed straight from InterViews 3.1: *************** *** 109,115 **** A series of makefile targets support the checkin of sources to cvs/rcs, and their subsequent update and modification. This requires a copy of cvs available from the Free Software Foundation and ! ivmkcm-0.7.2 available through http://www.vectaport.com/ivmkcm/ * More ivtools details --- 110,116 ---- A series of makefile targets support the checkin of sources to cvs/rcs, and their subsequent update and modification. This requires a copy of cvs available from the Free Software Foundation and ! ivmkcm-0.7.2 available through http://www.ivtools.org/ivmkcm/ * More ivtools details *************** *** 121,142 **** for HPUX and Dec Alpha. Recently it has been built on Windows NT 4.0 using Cygwin from Cygnus Solutions (see README.cygwin). You can pick up Linux-ELF binaries from the ivtools web page ! (http://www.vectaport.com/ivtools/). If you have a question about this software, desire to add code, found a bug, want to request a feature, or wonder how to get further assistance, please send e-mail to the general purpose ivtools mailing ! list, ivt...@li..., or this Vectaport e-mail ! address: ivt...@ve.... To subcribe to the mailing list, ! visit http://lists.sourceforge.net/mailman/listinfo/ivtools-discuss or ! send an informal request to ivt...@ve.... Other ! ivtools related mailing lists can be found at: ! http://www.vectaport.com/ivtools/mailinglists.html Online documentation (including an FAQ) is available for ivtools at: ! http://www.vectaport.com/ivtools/doc/ Read about finding and generating all this from inline documentation below. A copy of the ivtools html documentation is available for --- 122,143 ---- for HPUX and Dec Alpha. Recently it has been built on Windows NT 4.0 using Cygwin from Cygnus Solutions (see README.cygwin). You can pick up Linux-ELF binaries from the ivtools web page ! (http://www.ivtools.org). If you have a question about this software, desire to add code, found a bug, want to request a feature, or wonder how to get further assistance, please send e-mail to the general purpose ivtools mailing ! list, ivt...@li..., or this e-mail address: ! ivt...@ve.... To subcribe to the mailing list, visit ! http://lists.sourceforge.net/mailman/listinfo/ivtools-discuss or send ! an informal request to ivt...@ve.... Other ivtools ! related mailing lists can be found at: ! http://www.ivtools.org/ivtools/mailinglists.html Online documentation (including an FAQ) is available for ivtools at: ! http://www.ivtools.org/ivtools/doc/ Read about finding and generating all this from inline documentation below. A copy of the ivtools html documentation is available for *************** *** 175,181 **** See src/html/README for instructions on auto-generating these web pages yourself, or see the result on-line at: ! http://www.vectaport.com/ivtools/doc/classes/ - InterViews 3.1 and Unidraw man pages --- 176,182 ---- See src/html/README for instructions on auto-generating these web pages yourself, or see the result on-line at: ! http://www.ivtools.org/ivtools/doc/classes/ - InterViews 3.1 and Unidraw man pages *************** *** 183,189 **** been preserved, and can be found in src/man/man3, or where ever you elect to install them. They also can be browsed online at: ! http://www.vectaport.com/ivtools/doc/man3.1/ - InterViews 3.1 reference manual --- 184,190 ---- been preserved, and can be found in src/man/man3, or where ever you elect to install them. They also can be browsed online at: ! http://www.ivtools.org/ivtools/doc/man3.1/ - InterViews 3.1 reference manual *************** *** 191,197 **** PostScript form at src/man/refman3.1/refman.PS. It is also found in page-indexable online form at: ! http://www.vectaport.com/ivtools/doc/refman3.1/ * Building on top of ivtools --- 192,198 ---- PostScript form at src/man/refman3.1/refman.PS. It is also found in page-indexable online form at: ! http://www.ivtools.org/ivtools/doc/refman3.1/ * Building on top of ivtools *************** *** 198,204 **** Copied from the ivtools FAQ: ! http://www.vectaport.com/ivtools/faq.html#standalonedevel Q: How do I set up a stand-alone program or source tree on top of ivtools for development purposes? --- 199,205 ---- Copied from the ivtools FAQ: ! http://www.ivtools.org/ivtools/faq.html#standalonedevel Q: How do I set up a stand-alone program or source tree on top of ivtools for development purposes? *************** *** 219,230 **** an equivalent source tree (i.e. vhclmaps) and change or rename all directories or files as appropriate. ! ** read more on vhclmaps at http://www.vectaport.com/vhclmaps/ ** * Acknowledgements: ! ivtools programmers at Vectaport: Scott Johnston Jorge Gautier --- 220,231 ---- an equivalent source tree (i.e. vhclmaps) and change or rename all directories or files as appropriate. ! ** read more on vhclmaps at http://www.ivtools.org/vhclmaps/ ** * Acknowledgements: ! ivtools programmers at Vectaport (http://www.vectaport.com): Scott Johnston Jorge Gautier *************** *** 320,326 **** * OF THIS SOFTWARE. */ ! The building of iv-3.1 with gcc-2.5.* (and subsequent versions) was enabled by a patch from Adam Zell. The TIFF library was written by Sam Leffler and published with this --- 321,327 ---- * OF THIS SOFTWARE. */ ! The building of Unidraw with gcc-2.5.* (and subsequent versions) was enabled by a patch from Adam Zell. The TIFF library was written by Sam Leffler and published with this *************** *** 434,441 **** The balance of ivtools has been developed by Vectaport Inc. (P.O. Box 7141, Redwood City, CA 94063), with additional support from IET Inc. (P.O. Box 112450, Campbell, CA 95011) in the form of ARPA ! subcontracts (DACA76-93-C-0025 and DACA76-97-C-0005), and more ! recently by granting part-time employee Scott Johnston the freedom to ! evolve ivtools and related open-source frameworks as part of his ! job. There was also support from Applied Sciences Inc, San Francisco, ! CA, in the form of a subcontract for a Phase II SBIR from NASA Ames. --- 435,443 ---- The balance of ivtools has been developed by Vectaport Inc. (P.O. Box 7141, Redwood City, CA 94063), with additional support from IET Inc. (P.O. Box 112450, Campbell, CA 95011) in the form of ARPA ! subcontracts (DACA76-93-C-0025 and DACA76-97-C-0005), as well as ! directly employing Scott Johnston from April 1999 thru August 2000 and ! giving him the freedom to evolve ivtools and related open-source ! frameworks as part of his job. There was also support from Applied ! Sciences Inc, San Francisco, CA, in the form of a subcontract for a ! Phase II SBIR from NASA Ames. diff -c Attribute/attribute.h:1.1 Attribute/attribute.h:1.2 *** Attribute/attribute.h:1.1 Fri Oct 6 16:29:54 2000 --- src/Attribute/attribute.h Fri Oct 6 16:29:54 2000 *************** *** 45,51 **** Attribute(const Attribute&); // copy constructor. ! ~Attribute(); // deallocate memory for internal AttributeValue. char* Name(); --- 45,51 ---- Attribute(const Attribute&); // copy constructor. ! virtual ~Attribute(); // deallocate memory for internal AttributeValue. char* Name(); diff -c TopoFace/fgeomobjs.c:1.1 TopoFace/fgeomobjs.c:1.2 *** TopoFace/fgeomobjs.c:1.1 Fri Oct 6 16:29:59 2000 --- src/TopoFace/fgeomobjs.c Fri Oct 6 16:29:59 2000 *************** *** 635,642 **** ypts = _ypts; int curpt = 0; int npts; ! for (int i=0; i<_count-1; i++) { ! npts = edges[i]->Bresenham(temp_xpts, temp_ypts); for (int j=0; j<npts-1; j++) { _xpts[curpt] = temp_xpts[j]; _ypts[curpt] = temp_ypts[j]; --- 635,642 ---- ypts = _ypts; int curpt = 0; int npts; ! for (int k=0; k<_count-1; k++) { ! npts = edges[k]->Bresenham(temp_xpts, temp_ypts); for (int j=0; j<npts-1; j++) { _xpts[curpt] = temp_xpts[j]; _ypts[curpt] = temp_ypts[j]; *************** *** 646,653 **** _xpts[curpt] = temp_xpts[npts-1]; _ypts[curpt] = temp_ypts[npts-1]; _npts = curpt+1; ! for (int i=0; i<_count-1; i++) ! delete edges[i]; } return _npts; } --- 646,653 ---- _xpts[curpt] = temp_xpts[npts-1]; _ypts[curpt] = temp_ypts[npts-1]; _npts = curpt+1; ! for (int j=0; j<_count-1; j++) ! delete edges[j]; } return _npts; } *************** *** 858,865 **** ypts = _ypts; int curpt = 0; int npts; ! for (int i=0; i<_count; i++) { ! npts = edges[i]->Bresenham(temp_xpts, temp_ypts); for (int j=0; j<npts-1; j++) { _xpts[curpt] = temp_xpts[j]; _ypts[curpt] = temp_ypts[j]; --- 858,865 ---- ypts = _ypts; int curpt = 0; int npts; ! for (int k=0; k<_count; k++) { ! npts = edges[k]->Bresenham(temp_xpts, temp_ypts); for (int j=0; j<npts-1; j++) { _xpts[curpt] = temp_xpts[j]; _ypts[curpt] = temp_ypts[j]; *************** *** 867,874 **** } } _npts = curpt; ! for (int i=0; i<_count; i++) ! delete edges[i]; } return _npts; } --- 867,874 ---- } } _npts = curpt; ! for (int j=0; j<_count; j++) ! delete edges[j]; } return _npts; } diff -c ComTerp/comfunc.c:1.1 ComTerp/comfunc.c:1.2 *** ComTerp/comfunc.c:1.1 Fri Oct 6 16:30:09 2000 --- src/ComTerp/comfunc.c Fri Oct 6 16:30:09 2000 *************** *** 42,48 **** if (!post_eval()) { int count = nargs() + nkeys() - npops(); for (int i=1; i<=npops(); i++) ! _comterp->stack_top(i).AttributeValue::~AttributeValue(); _comterp->decr_stack(count); } else --- 42,48 ---- if (!post_eval()) { int count = nargs() + nkeys() - npops(); for (int i=1; i<=npops(); i++) ! ((AttributeValue)_comterp->stack_top(i)).AttributeValue::~AttributeValue(); _comterp->decr_stack(count); } else *************** *** 124,130 **** if (n>=nargsfixed()) return dflt; ! for (int i=nargsfixed(); i>n; i--) { argcnt = 0; skip_arg_in_expr(offtop, argcnt); } --- 124,130 ---- if (n>=nargsfixed()) return dflt; ! for (int j=nargsfixed(); j>n; j--) { argcnt = 0; skip_arg_in_expr(offtop, argcnt); } *************** *** 168,174 **** if (n>=nargsfixed()) return dflt; ! for (int i=nargsfixed(); i>n; i--) { argcnt = 0; skip_arg_in_expr(offtop, argcnt); } --- 168,174 ---- if (n>=nargsfixed()) return dflt; ! for (int j=nargsfixed(); j>n; j--) { argcnt = 0; skip_arg_in_expr(offtop, argcnt); } diff -c ComTerp/comterp.c:1.1 ComTerp/comterp.c:1.2 *** ComTerp/comterp.c:1.1 Fri Oct 6 16:30:09 2000 --- src/ComTerp/comterp.c Fri Oct 6 16:30:09 2000 *************** *** 308,324 **** token_to_comvalue(_pfbuf+i, sv); } int offset = 0; ! for (int i=_pfnum-1; i>=0; i--) { ! ComValue* sv = _pfcomvals + i; if (sv->is_type(ComValue::CommandType)) { ComFunc* func = (ComFunc*)sv->obj_val(); if (func && func->post_eval()) { int newoffset = offset; skip_func(_pfcomvals+_pfnum-1, newoffset, -_pfnum); ! int start = i-1; int stop = _pfnum+newoffset; ! for (int j=start; j>=stop; j--) ! _pfcomvals[j].pedepth()++; } } offset--; --- 308,324 ---- token_to_comvalue(_pfbuf+i, sv); } int offset = 0; ! for (int j=_pfnum-1; j>=0; j--) { ! ComValue* sv = _pfcomvals + j; if (sv->is_type(ComValue::CommandType)) { ComFunc* func = (ComFunc*)sv->obj_val(); if (func && func->post_eval()) { int newoffset = offset; skip_func(_pfcomvals+_pfnum-1, newoffset, -_pfnum); ! int start = j-1; int stop = _pfnum+newoffset; ! for (int k=start; k>=stop; k--) ! _pfcomvals[k].pedepth()++; } } offset--; *************** *** 1087,1099 **** if (sort) { int* sortedbuffer = new int[ncomm]; int i = 0; /* operators first */ ! for (int j=0; j< ncomm; j++) sortedbuffer[j] = -1; ! for (int j=0; j< ncomm; j++) if (!isalpha(*symbol_pntr(buffer[j]))) sortedbuffer[i++] = buffer[j]; if (i != opercnt) cerr << "bad number of operators\n"; ! for (int j=0; j<ncomm; j++) { if (!isalpha(*symbol_pntr(buffer[j]))) continue; /* count the number of strings greater than this one */ --- 1087,1100 ---- if (sort) { int* sortedbuffer = new int[ncomm]; int i = 0; /* operators first */ ! int j; ! for (j=0; j< ncomm; j++) sortedbuffer[j] = -1; ! for (j=0; j< ncomm; j++) if (!isalpha(*symbol_pntr(buffer[j]))) sortedbuffer[i++] = buffer[j]; if (i != opercnt) cerr << "bad number of operators\n"; ! for (j=0; j<ncomm; j++) { if (!isalpha(*symbol_pntr(buffer[j]))) continue; /* count the number of strings greater than this one */ *************** *** 1108,1114 **** /* one more pass over the sorted buffer to remove duplicates */ int copydist = 0; ! for (int j=0; j<ncomm; j++) { if (sortedbuffer[j]<0) copydist++; else --- 1109,1115 ---- /* one more pass over the sorted buffer to remove duplicates */ int copydist = 0; ! for (j=0; j<ncomm; j++) { if (sortedbuffer[j]<0) copydist++; else diff -c ComTerp/comvalue.h:1.1 ComTerp/comvalue.h:1.2 *** ComTerp/comvalue.h:1.1 Fri Oct 6 16:30:10 2000 --- src/ComTerp/comvalue.h Fri Oct 6 16:30:10 2000 *************** *** 62,72 **** // ShortType constructor. ComValue(unsigned short val); // UShortType constructor. ! ComValue(int val, ValueType type=ComValue::IntType); // IntType constructor or any other int-like value. ! ComValue(unsigned int val, ValueType type=ComValue::IntType); // UIntType constructor or any other unsigned-int-like value including SymbolType. ! ComValue(unsigned int val, unsigned int, ValueType type=ComValue::KeywordType); // KeywordType constructor (or can be used for ObjectType). ComValue(long val); // LongType constructor. --- 62,72 ---- // ShortType constructor. ComValue(unsigned short val); // UShortType constructor. ! ComValue(int val, ValueType type=IntType); // IntType constructor or any other int-like value. ! ComValue(unsigned int val, ValueType type=IntType); // UIntType constructor or any other unsigned-int-like value including SymbolType. ! ComValue(unsigned int val, unsigned int, ValueType type=KeywordType); // KeywordType constructor (or can be used for ObjectType). ComValue(long val); // LongType constructor. diff -c ComTerp/xformfunc.c:1.1 ComTerp/xformfunc.c:1.2 *** ComTerp/xformfunc.c:1.1 Fri Oct 6 16:30:10 2000 --- src/ComTerp/xformfunc.c Fri Oct 6 16:30:10 2000 *************** *** 122,129 **** t.matrix(affine[0], affine[1], affine[2], affine[3], affine[4], affine[5]); AttributeValueList* avl = new AttributeValueList(); ! for (int i=0; i<6; i++) ! avl->Append(new ComValue(affine[i])); ComValue array(avl); push_stack(array); --- 122,129 ---- t.matrix(affine[0], affine[1], affine[2], affine[3], affine[4], affine[5]); AttributeValueList* avl = new AttributeValueList(); ! for (int j=0; j<6; j++) ! avl->Append(new ComValue(affine[j])); ComValue array(avl); push_stack(array); diff -c src_os/string.c:1.1 src_os/string.c:1.2 *** src_os/string.c:1.1 Fri Oct 6 16:30:25 2000 --- src/OS/string.c Fri Oct 6 16:30:25 2000 *************** *** 26,31 **** --- 26,32 ---- #include <ctype.h> #include <string.h> #include <iostream.h> + #include <streambuf.h> /* * Just to be sure ... *************** *** 327,333 **** --- 328,339 ---- }; ostream& operator<< (ostream& out, const String& str) { + #if defined(sun) && !defined(solaris) + out.write(str.string(), str.length()); + #else out.write(str.string(), (streamsize)str.length()); + #endif + return out; } /* class CopyString */ diff -c src_dispatch/dispatcher.c:1.1 src_dispatch/dispatcher.c:1.2 *** src_dispatch/dispatcher.c:1.1 Fri Oct 6 16:30:32 2000 --- src/Dispatch/dispatcher.c Fri Oct 6 16:30:32 2000 *************** *** 597,603 **** return rmaskret.numSet() + wmaskret.numSet() + emaskret.numSet(); } ! void Dispatcher::sigCLD(...) { pid_t pid; int status; --- 597,603 ---- return rmaskret.numSet() + wmaskret.numSet() + emaskret.numSet(); } ! void Dispatcher::sigCLD() { pid_t pid; int status; diff -c src_dispatch/rpcbuf.c:1.1 src_dispatch/rpcbuf.c:1.2 *** src_dispatch/rpcbuf.c:1.1 Fri Oct 6 16:30:32 2000 --- src/Dispatch/rpcbuf.c Fri Oct 6 16:30:32 2000 *************** *** 25,31 **** --- 25,33 ---- #include <Dispatch/rpcbuf.h> #include <OS/memory.h> #include <OS/types.h> /* must come before <netinet/in.h> on some systems */ + extern "C" { #include <arpa/inet.h> + } #include "netinet_in.h" #include <ctype.h> #include <errno.h> diff -c iclass/main.c:1.1 iclass/main.c:1.2 *** iclass/main.c:1.1 Fri Oct 6 16:30:38 2000 --- src/iclass/main.c Fri Oct 6 16:30:38 2000 *************** *** 75,81 **** << classname << "</a><br>\n"; const char* childname; ! const char* prevname=strdup(""); int childindex=0; while (childname = cbuffer->Child(classname, childindex)) { if (strcmp(prevname, childname)!=0) --- 75,81 ---- << classname << "</a><br>\n"; const char* childname; ! char* prevname=strdup(""); int childindex=0; while (childname = cbuffer->Child(classname, childindex)) { if (strcmp(prevname, childname)!=0) *************** *** 112,118 **** cout << "<a name=" << classname << " href=" << classname << ".html>" << classname << "</a>:<br>\n"; const char* childname; ! const char* prevname=strdup(""); int childindex = 0; while (childname = buffer->Child(classname, childindex)) { childindex++; --- 112,118 ---- cout << "<a name=" << classname << " href=" << classname << ".html>" << classname << "</a>:<br>\n"; const char* childname; ! char* prevname=strdup(""); int childindex = 0; while (childname = buffer->Child(classname, childindex)) { childindex++; diff -c Time/Time.c:1.1 Time/Time.c:1.2 *** Time/Time.c:1.1 Fri Oct 6 16:30:45 2000 --- src/Time/Time.c Fri Oct 6 16:30:45 2000 *************** *** 59,65 **** #include <sys/time.h> #if defined(__DECCXX) || (defined(__sun) && !defined(__svr4__)) extern "C" { ! void gettimeofday(struct timeval *tp, struct timezone *tzp); } #endif --- 59,65 ---- #include <sys/time.h> #if defined(__DECCXX) || (defined(__sun) && !defined(__svr4__)) extern "C" { ! int gettimeofday(struct timeval *tp, struct timezone *tzp); } #endif *************** *** 142,148 **** sec += TIME_ZONE; // adjust to GMT } ! Time::operator Date() const /* Convert a Time to a local Date */ --- 142,148 ---- sec += TIME_ZONE; // adjust to GMT } ! Date Time::date() const /* Convert a Time to a local Date */ *************** *** 237,243 **** Adjusts this GM Time for local time zone and Daylight Savings Time. */ { ! Time &local_time = *new Time(sec-TIME_ZONE); if (local_time.isDST()) local_time.sec += 3600; return local_time; } --- 237,243 ---- Adjusts this GM Time for local time zone and Daylight Savings Time. */ { ! Time local_time(sec-TIME_ZONE); if (local_time.isDST()) local_time.sec += 3600; return local_time; } *************** *** 294,300 **** void Time::printOn(ostream& strm) const { register unsigned hh = hour(); ! Date(*this).printOn(strm); strm << ' ' << ((hh <= 12) ? hh : hh-12) << ':'; strm << setfill('0') << setw(2) << minute() << ':'; strm << setfill('0') << setw(2) << second() << ' '; --- 294,300 ---- void Time::printOn(ostream& strm) const { register unsigned hh = hour(); ! this->date().printOn(strm); strm << ' ' << ((hh <= 12) ? hh : hh-12) << ':'; strm << setfill('0') << setw(2) << minute() << ':'; strm << setfill('0') << setw(2) << second() << ' '; diff -c Time/Time.h:1.1 Time/Time.h:1.2 *** Time/Time.h:1.1 Fri Oct 6 16:30:45 2000 --- src/Time/Time.h Fri Oct 6 16:30:45 2000 *************** *** 72,78 **** Time(clockTy s) { sec = s; } Time(hourTy h, minuteTy m, secondTy s =0, boolean dst =false); Time(const Date&, hourTy h =0, minuteTy m =0, secondTy s=0, boolean dst =false); ! operator Date() const; boolean operator<(const Time& t) const { return sec < t.sec; } boolean operator<=(const Time& t) const { return sec <= t.sec; } boolean operator>(const Time& t) const { return sec > t.sec; } --- 72,78 ---- Time(clockTy s) { sec = s; } Time(hourTy h, minuteTy m, secondTy s =0, boolean dst =false); Time(const Date&, hourTy h =0, minuteTy m =0, secondTy s=0, boolean dst =false); ! Date date() const; boolean operator<(const Time& t) const { return sec < t.sec; } boolean operator<=(const Time& t) const { return sec <= t.sec; } boolean operator>(const Time& t) const { return sec > t.sec; } diff -c Time/timeglyph.c:1.1 Time/timeglyph.c:1.2 *** Time/timeglyph.c:1.1 Fri Oct 6 16:30:45 2000 --- src/Time/timeglyph.c Fri Oct 6 16:30:45 2000 *************** *** 58,64 **** const LayoutKit& layout_ = *LayoutKit::instance(); Style* s = kit_.style(); ! Date date(*time_->time()); StringList* wdaylist = new StringList(7); wdaylist->append(String("Mon")); wdaylist->append(String("Tue")); --- 58,64 ---- const LayoutKit& layout_ = *LayoutKit::instance(); Style* s = kit_.style(); ! Date date(time_->time()->date()); StringList* wdaylist = new StringList(7); wdaylist->append(String("Mon")); wdaylist->append(String("Tue")); *************** *** 213,219 **** } void TimeGlyph::updatevalues() { ! Date date(*time_->time()); wdayvalue->current_value(date.weekDay()-1); monthvalue->current_value(date.month()-1); mdayvalue->current_value(date.dayOfMonth()); --- 213,219 ---- } void TimeGlyph::updatevalues() { ! Date date(time_->time()->date()); wdayvalue->current_value(date.weekDay()-1); monthvalue->current_value(date.month()-1); mdayvalue->current_value(date.dayOfMonth()); diff -c IVGlyph/enumform.c:1.1 IVGlyph/enumform.c:1.2 *** IVGlyph/enumform.c:1.1 Fri Oct 6 16:31:00 2000 --- src/IVGlyph/enumform.c Fri Oct 6 16:31:00 2000 *************** *** 114,120 **** action1 = new EnumActionCallback(MenuEnumEditor)( this, &MenuEnumEditor::edit, _obs->labelvalue(i) ); ! _macro ? action2 = _macro->action(i) : action2 = nil; MenuItem* mi = wk.menu_item(lk.overlay( lk.vcenter(lk.hspace(maxwidth)), lk.vcenter(wk.label(_obs->labelvalue(i))))); --- 114,120 ---- action1 = new EnumActionCallback(MenuEnumEditor)( this, &MenuEnumEditor::edit, _obs->labelvalue(i) ); ! action2 = _macro ? _macro->action(i) : nil; MenuItem* mi = wk.menu_item(lk.overlay( lk.vcenter(lk.hspace(maxwidth)), lk.vcenter(wk.label(_obs->labelvalue(i))))); diff -c IVGlyph/ofilechooser.c:1.1 IVGlyph/ofilechooser.c:1.2 *** IVGlyph/ofilechooser.c:1.1 Fri Oct 6 16:31:00 2000 --- src/IVGlyph/ofilechooser.c Fri Oct 6 16:31:00 2000 *************** *** 454,461 **** void OpenFileChooserImpl::accept_editor(FieldEditor* e) { boolean urlflag = OpenFileChooser::urltest(e->text()->string()); ! const String* path = urlflag ! ? e->text() : Directory::canonical(*e->text()); e->field(*path); if (!urlflag && chdir(*path)) { /* chdir has copied the string */ --- 454,460 ---- void OpenFileChooserImpl::accept_editor(FieldEditor* e) { boolean urlflag = OpenFileChooser::urltest(e->text()->string()); ! String* path = (String *) (urlflag ? e->text() : Directory::canonical(*e->text())); e->field(*path); if (!urlflag && chdir(*path)) { /* chdir has copied the string */ diff -c IVGlyph/textbuff.c:1.1 IVGlyph/textbuff.c:1.2 *** IVGlyph/textbuff.c:1.1 Fri Oct 6 16:31:00 2000 --- src/IVGlyph/textbuff.c Fri Oct 6 16:31:00 2000 *************** *** 15,24 **** --- 15,30 ---- // Jan Andersson, Torpa Konsult AB // ja...@to... - 1993-08-29 + #if defined(sun) && !defined(solaris) && __GNUC__==2 && !defined(__GNUC_MINOR__) + #define _GCC_SIZE_T /* workaround for _G_size_t conflict */ + #endif + #include <stdio.h> #include <fcntl.h> #include <sys/stat.h> + extern "C" { #include <malloc.h> + } #include <InterViews/regexp.h> diff -c IVGlyph/textedit.c:1.1 IVGlyph/textedit.c:1.2 *** IVGlyph/textedit.c:1.1 Fri Oct 6 16:31:01 2000 --- src/IVGlyph/textedit.c Fri Oct 6 16:31:01 2000 *************** *** 64,115 **** notify(Dimension_Y); // notify scrollbar } ! inline Coord TE_Adjustable::lower(DimensionName) const { return Coord(0); } ! inline Coord TE_Adjustable::upper(DimensionName) const { return Coord(te_view_->lines()); } ! inline Coord TE_Adjustable::length(DimensionName) const { return Coord(te_view_->lines() /*- 1*/); } ! inline Coord TE_Adjustable::cur_lower(DimensionName) const { return Coord(te_view_->lines() - te_view_->end_row() -1); } ! inline Coord TE_Adjustable::cur_upper(DimensionName) const { return Coord(te_view_->lines() /*- 1*/ - te_view_->start_row()); } ! inline Coord TE_Adjustable::cur_length(DimensionName) const { return Coord(te_view_->end_row() - te_view_->start_row() +1); } ! inline void TE_Adjustable::scroll_forward(DimensionName d) { scroll_by(d, -long(small_scroll(d))); } ! inline void TE_Adjustable::scroll_backward(DimensionName d) { scroll_by(d, long(small_scroll(d))); } ! inline void TE_Adjustable::page_forward(DimensionName d) { scroll_by(d, -long(large_scroll(d))); } ! inline void TE_Adjustable::page_backward(DimensionName d) { scroll_by(d, long(large_scroll(d))); } --- 64,115 ---- notify(Dimension_Y); // notify scrollbar } ! Coord TE_Adjustable::lower(DimensionName) const { return Coord(0); } ! Coord TE_Adjustable::upper(DimensionName) const { return Coord(te_view_->lines()); } ! Coord TE_Adjustable::length(DimensionName) const { return Coord(te_view_->lines() /*- 1*/); } ! Coord TE_Adjustable::cur_lower(DimensionName) const { return Coord(te_view_->lines() - te_view_->end_row() -1); } ! Coord TE_Adjustable::cur_upper(DimensionName) const { return Coord(te_view_->lines() /*- 1*/ - te_view_->start_row()); } ! Coord TE_Adjustable::cur_length(DimensionName) const { return Coord(te_view_->end_row() - te_view_->start_row() +1); } ! void TE_Adjustable::scroll_forward(DimensionName d) { scroll_by(d, -long(small_scroll(d))); } ! void TE_Adjustable::scroll_backward(DimensionName d) { scroll_by(d, long(small_scroll(d))); } ! void TE_Adjustable::page_forward(DimensionName d) { scroll_by(d, -long(large_scroll(d))); } ! void TE_Adjustable::page_backward(DimensionName d) { scroll_by(d, long(large_scroll(d))); } diff -c AttrGlyph/Imakefile:1.1 AttrGlyph/Imakefile:1.2 *** AttrGlyph/Imakefile:1.1 Fri Oct 6 16:31:49 2000 --- src/AttrGlyph/Imakefile Fri Oct 6 16:31:49 2000 *************** *** 12,20 **** MakeLibrary($(LIB),$(VERSION)) ! #define Obj(file) MakeObjectFromSrcFlags(file,) ! Obj(attredit) IncludeDependencies() --- 12,20 ---- MakeLibrary($(LIB),$(VERSION)) ! #define Obj(file,flags) MakeObjectFromSrcFlags(file,flags) ! Obj(attredit,-DLibStdCPlusPlus=$(LIBSTDCPLUSPLUS)) IncludeDependencies() diff -c AttrGlyph/attredit.c:1.1 AttrGlyph/attredit.c:1.2 *** AttrGlyph/attredit.c:1.1 Fri Oct 6 16:31:49 2000 --- src/AttrGlyph/attredit.c Fri Oct 6 16:31:49 2000 *************** *** 43,49 **** --- 43,52 ---- #include <strstream.h> #include <string.h> + #if LibStdCPlusPlus + #define STL_VECTOR #include <vector.h> + #endif declareActionCallback(AttributeListEditor) implementActionCallback(AttributeListEditor) *************** *** 102,108 **** } } - #define STL_VECTOR void AttributeListEditor::update_text(boolean update) { ALIterator i; #ifndef STL_VECTOR --- 105,110 ---- diff -c include_dispatch/dispatcher.h:1.1 include_dispatch/dispatcher.h:1.2 *** include_dispatch/dispatcher.h:1.1 Fri Oct 6 16:32:21 2000 --- src/include/Dispatch/dispatcher.h Fri Oct 6 16:32:21 2000 *************** *** 91,97 **** TimerQueue* _queue; ChildQueue* _cqueue; ! static void sigCLD(...); private: static Dispatcher* _instance; --- 91,97 ---- TimerQueue* _queue; ChildQueue* _cqueue; ! static void sigCLD(); private: static Dispatcher* _instance; diff -c include_std/string.h:1.1 include_std/string.h:1.2 *** include_std/string.h:1.1 Fri Oct 6 16:32:46 2000 --- src/include/ivstd/string.h Fri Oct 6 16:32:46 2000 *************** *** 6,11 **** --- 6,14 ---- #if defined(sun) && !defined(solaris) extern "C" { int strcasecmp(const char*, const char*); + int strncasecmp(const char*, const char*,int); + #undef size_t + #define size_t long unsigned int } #endif diff -c config_ivtools/site.def.SUN4:1.1 config_ivtools/site.def.SUN4:1.2 *** config_ivtools/site.def.SUN4:1.1 Fri Oct 6 16:33:08 2000 --- config/site.def.SUN4 Fri Oct 6 16:33:08 2000 *************** *** 34,40 **** /* link libraries for the above */ #undef ExtraCCLdLibs #ifndef SVR4Architecture ! #define ExtraCCLdLibs -Xlinker -Bstatic -lstdc++ -lm -Xlinker -Bdynamic -ldl -Xlinker -Bstatic #else #if 0 /* static linking of libstdc++ not necessarly needed */ #define ExtraCCLdLibs -Xlinker -Bstatic -lstdc++ -Xlinker -Bdynamic -lsocket -lnsl -lSM -lICE -lm --- 34,44 ---- /* link libraries for the above */ #undef ExtraCCLdLibs #ifndef SVR4Architecture ! #if 0 ! #define ExtraCCLdLibs -Xlinker -Bstatic -lstdc++ -lm -Xlinker -Bdynamic -ldl ! #else ! #define ExtraCCLdLibs -Xlinker -Bstatic -lm -Xlinker -Bdynamic -ldl ! #endif #else #if 0 /* static linking of libstdc++ not necessarly needed */ #define ExtraCCLdLibs -Xlinker -Bstatic -lstdc++ -Xlinker -Bdynamic -lsocket -lnsl -lSM -lICE -lm |
From: <ivt...@li...> - 2000-09-22 16:11:20
|
Patch: ivtools-000919-johnston-100 For: ivtools-0.8.4 Author: joh...@us... Subject: set up configure script to test for libstdc++ Requires: This is an intermediate patch to ivtools-0.8.4. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - set up configure script to test for the presence of libstdc++. Index: top_ivtools/configure diff -c top_ivtools/configure:1.1 top_ivtools/configure:1.2 *** top_ivtools/configure:1.1 Wed Aug 30 09:59:22 2000 --- ./configure Tue Sep 19 16:35:26 2000 *************** *** 1,7 **** #! /bin/sh # Guess values for system-dependent variables and create Makefiles. ! # Generated automatically using autoconf version 2.12 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation --- 1,7 ---- #! /bin/sh # Guess values for system-dependent variables and create Makefiles. ! # Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation *************** *** 71,76 **** --- 71,77 ---- # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= + SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. ac_max_here_lines=12 *************** *** 327,333 **** verbose=yes ;; -version | --version | --versio | --versi | --vers) ! echo "configure generated by autoconf version 2.12" exit 0 ;; -with-* | --with-*) --- 328,334 ---- verbose=yes ;; -version | --version | --versio | --versi | --vers) ! echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) *************** *** 497,505 **** # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ! ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says gh...@ca.... if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then --- 498,508 ---- # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ! ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross + ac_exeext= + ac_objext=o if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says gh...@ca.... if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then *************** *** 535,560 **** # set the canonical host vars # Make sure we can run config.sub. ! if $ac_config_sub sun4 >/dev/null 2>&1; then : else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 ! echo "configure:573: checking host system type" >&5 host_alias=$host case "$host_alias" in NONE) case $nonopt in NONE) ! if host_alias=`$ac_config_guess`; then : else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } fi ;; *) host_alias=$nonopt ;; esac ;; esac ! host=`$ac_config_sub $host_alias` host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` --- 538,563 ---- # set the canonical host vars # Make sure we can run config.sub. ! if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 ! echo "configure:576: checking host system type" >&5 host_alias=$host case "$host_alias" in NONE) case $nonopt in NONE) ! if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } fi ;; *) host_alias=$nonopt ;; esac ;; esac ! host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` *************** *** 800,819 **** # check of the c++ compiler ! for ac_prog in $CCC c++ g++ gcc CC cxx cc++ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:838: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else ! IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" ! for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CXX="$ac_prog" --- 803,823 ---- # check of the c++ compiler ! for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:841: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else ! IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ! ac_dummy="$PATH" ! for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CXX="$ac_prog" *************** *** 836,856 **** echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:869: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ! ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross ! cat > conftest.$ac_ext <<EOF ! #line 879 "configure" #include "confdefs.h" ! main(){return(0);} EOF ! if { (eval echo configure:883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then --- 840,862 ---- echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:873: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ! ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross ! cat > conftest.$ac_ext << EOF ! ! #line 884 "configure" #include "confdefs.h" ! ! int main(){return(0);} EOF ! if { (eval echo configure:889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then *************** *** 868,874 **** # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ! ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6 --- 874,880 ---- # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ! ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6 *************** *** 876,887 **** { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:909: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 ! echo "configure:914: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 882,893 ---- { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:915: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 ! echo "configure:920: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 890,896 **** yes; #endif EOF ! if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:923: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no --- 896,902 ---- yes; #endif EOF ! if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:929: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no *************** *** 901,911 **** if test $ac_cv_prog_gxx = yes; then GXX=yes ! ac_test_CXXFLAGS="${CXXFLAGS+set}" ! ac_save_CXXFLAGS="$CXXFLAGS" ! CXXFLAGS= ! echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 ! echo "configure:938: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 907,921 ---- if test $ac_cv_prog_gxx = yes; then GXX=yes ! else ! GXX= ! fi ! ! ac_test_CXXFLAGS="${CXXFLAGS+set}" ! ac_save_CXXFLAGS="$CXXFLAGS" ! CXXFLAGS= ! echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 ! echo "configure:948: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 920,950 **** fi echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6 ! if test "$ac_test_CXXFLAGS" = set; then ! CXXFLAGS="$ac_save_CXXFLAGS" ! elif test $ac_cv_prog_cxx_g = yes; then CXXFLAGS="-g -O2" else ! CXXFLAGS="-O2" fi else ! GXX= ! test "${CXXFLAGS+set}" = set || CXXFLAGS="-g" fi # check for the c compiler # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:969: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ! IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" ! for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="gcc" --- 930,965 ---- fi echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6 ! if test "$ac_test_CXXFLAGS" = set; then ! CXXFLAGS="$ac_save_CXXFLAGS" ! elif test $ac_cv_prog_cxx_g = yes; then ! if test "$GXX" = yes; then CXXFLAGS="-g -O2" else ! CXXFLAGS="-g" fi else ! if test "$GXX" = yes; then ! CXXFLAGS="-O2" ! else ! CXXFLAGS= ! fi fi # check for the c compiler # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:983: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ! IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ! ac_dummy="$PATH" ! for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="gcc" *************** *** 965,980 **** # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:998: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ! IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" ac_prog_rejected=no ! for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then --- 980,996 ---- # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1013: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ! IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no ! ac_dummy="$PATH" ! for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then *************** *** 1009,1033 **** echo "$ac_t""no" 1>&6 fi test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:1046: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ! ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross ! cat > conftest.$ac_ext <<EOF ! #line 1056 "configure" #include "confdefs.h" main(){return(0);} EOF ! if { (eval echo configure:1060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then --- 1025,1085 ---- echo "$ac_t""no" 1>&6 fi + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + # Extract the first word of "cl", so it can be a program name with args. + set dummy cl; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 + echo "configure:1064: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. + else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="cl" + break + fi + done + IFS="$ac_save_ifs" + fi + fi + CC="$ac_cv_prog_CC" + if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 + else + echo "$ac_t""no" 1>&6 + fi + ;; + esac + fi test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:1096: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ! ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross ! cat > conftest.$ac_ext << EOF ! ! #line 1107 "configure" #include "confdefs.h" + main(){return(0);} EOF ! if { (eval echo configure:1112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then *************** *** 1041,1058 **** ac_cv_prog_cc_works=no fi rm -fr conftest* echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:1080: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 ! echo "configure:1085: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1093,1116 ---- ac_cv_prog_cc_works=no fi rm -fr conftest* + ac_ext=c + # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. + ac_cpp='$CPP $CPPFLAGS' + ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' + ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' + cross_compiling=$ac_cv_prog_cc_cross echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:1138: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 ! echo "configure:1143: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 1061,1067 **** yes; #endif EOF ! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1094: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no --- 1119,1125 ---- yes; #endif EOF ! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1152: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no *************** *** 1072,1082 **** if test $ac_cv_prog_gcc = yes; then GCC=yes ! ac_test_CFLAGS="${CFLAGS+set}" ! ac_save_CFLAGS="$CFLAGS" ! CFLAGS= ! echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ! echo "configure:1109: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1130,1144 ---- if test $ac_cv_prog_gcc = yes; then GCC=yes ! else ! GCC= ! fi ! ! ac_test_CFLAGS="${CFLAGS+set}" ! ac_save_CFLAGS="$CFLAGS" ! CFLAGS= ! echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ! echo "configure:1171: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 1091,1111 **** fi echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 ! if test "$ac_test_CFLAGS" = set; then ! CFLAGS="$ac_save_CFLAGS" ! elif test $ac_cv_prog_cc_g = yes; then CFLAGS="-g -O2" else ! CFLAGS="-O2" fi else ! GCC= ! test "${CFLAGS+set}" = set || CFLAGS="-g" fi # check for CPP echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 ! echo "configure:1138: checking how to run the C++ preprocessor" >&5 if test -z "$CXXCPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1153,1177 ---- fi echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 ! if test "$ac_test_CFLAGS" = set; then ! CFLAGS="$ac_save_CFLAGS" ! elif test $ac_cv_prog_cc_g = yes; then ! if test "$GCC" = yes; then CFLAGS="-g -O2" else ! CFLAGS="-g" fi else ! if test "$GCC" = yes; then ! CFLAGS="-O2" ! else ! CFLAGS= ! fi fi # check for CPP echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 ! echo "configure:1204: checking how to run the C++ preprocessor" >&5 if test -z "$CXXCPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1114,1130 **** # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ! ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross CXXCPP="${CXX-g++} -E" cat > conftest.$ac_ext <<EOF ! #line 1151 "configure" #include "confdefs.h" #include <stdlib.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1156: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ! ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : else --- 1180,1196 ---- # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ! ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross CXXCPP="${CXX-g++} -E" cat > conftest.$ac_ext <<EOF ! #line 1217 "configure" #include "confdefs.h" #include <stdlib.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1222: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ! ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else *************** *** 1140,1146 **** # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ! ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross fi fi --- 1206,1212 ---- # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ! ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross fi fi *************** *** 1151,1165 **** # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1184: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else ! IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" ! for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_RANLIB="ranlib" --- 1217,1232 ---- # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1250: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else ! IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ! ac_dummy="$PATH" ! for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_RANLIB="ranlib" *************** *** 1179,1185 **** # check for X paths echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ! echo "configure:1212: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= --- 1246,1252 ---- # check for X paths echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ! echo "configure:1279: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= *************** *** 1194,1207 **** # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF ! #line 1227 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1233: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ! ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : else --- 1261,1274 ---- # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF ! #line 1294 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1300: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ! ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else *************** *** 1211,1224 **** rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF ! #line 1244 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1250: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ! ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : else --- 1278,1291 ---- rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF ! #line 1311 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1317: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ! ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else *************** *** 1226,1236 **** --- 1293,1322 ---- echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext <<EOF + #line 1328 "configure" + #include "confdefs.h" + #include <assert.h> + Syntax Error + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" + { (eval echo configure:1334: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + : + else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* CPP=/lib/cpp fi rm -f conftest* fi rm -f conftest* + fi + rm -f conftest* ac_cv_prog_CPP="$CPP" fi CPP="$ac_cv_prog_CPP" *************** *** 1244,1250 **** # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 ! echo "configure:1277: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then --- 1330,1336 ---- # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 ! echo "configure:1363: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then *************** *** 1306,1318 **** # First, try using that file with no special directory specified. cat > conftest.$ac_ext <<EOF ! #line 1339 "configure" #include "confdefs.h" #include <$x_direct_test_include> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1344: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ! ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* # We can compile using X headers with no special include directory. --- 1392,1404 ---- # First, try using that file with no special directory specified. cat > conftest.$ac_ext <<EOF ! #line 1425 "configure" #include "confdefs.h" #include <$x_direct_test_include> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1430: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ! ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* # We can compile using X headers with no special include directory. *************** *** 1380,1393 **** ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <<EOF ! #line 1413 "configure" #include "confdefs.h" int main() { ${x_direct_test_function}() ; return 0; } EOF ! if { (eval echo configure:1420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. --- 1466,1479 ---- ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <<EOF ! #line 1499 "configure" #include "confdefs.h" int main() { ${x_direct_test_function}() ; return 0; } EOF ! if { (eval echo configure:1506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. *************** *** 1479,1485 **** #AC_CXX_HEADERS echo $ac_n "checking for directory to install c++ include files""... $ac_c" 1>&6 ! echo "configure:1512: checking for directory to install c++ include files" >&5 if eval "test \"`echo '$''{'ice_cv_cxx_include_dir'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1565,1571 ---- #AC_CXX_HEADERS echo $ac_n "checking for directory to install c++ include files""... $ac_c" 1>&6 ! echo "configure:1598: checking for directory to install c++ include files" >&5 if eval "test \"`echo '$''{'ice_cv_cxx_include_dir'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 1519,1524 **** --- 1605,1652 ---- #AC_CXX_EGCS # check for gettimeofday #AC_TWO_ARG_TIMEOFDAY + # check for libstdc++ + echo $ac_n "checking for peek__7istream in -lstdc++""... $ac_c" 1>&6 + echo "configure:1640: checking for peek__7istream in -lstdc++" >&5 + ac_lib_var=`echo stdc++'_'peek__7istream | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" + LIBS="-lstdc++ $LIBS" + cat > conftest.$ac_ext <<EOF + #line 1648 "configure" + #include "confdefs.h" + /* Override any gcc2 internal prototype to avoid an error. */ + /* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ + char peek__7istream(); + + int main() { + peek__7istream() + ; return 0; } + EOF + if { (eval echo configure:1659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" + fi + rm -f conftest* + LIBS="$ac_save_LIBS" + + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBSTDCPLUSPLUS=1 + else + echo "$ac_t""no" 1>&6 + LIBSTDCPLUSPLUS=0 + fi + # check for bigendian #AC_C_BIGENDIAN *************** *** 1653,1659 **** # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | ! case `(ac_space=' '; set) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). --- 1781,1787 ---- # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | ! case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). *************** *** 1732,1738 **** echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) ! echo "$CONFIG_STATUS generated by autoconf version 2.12" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; --- 1860,1866 ---- echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) ! echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; *************** *** 1751,1759 **** --- 1879,1889 ---- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF $ac_vpsub $extrasub + s%@SHELL@%$SHELL%g s%@CFLAGS@%$CFLAGS%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CXXFLAGS@%$CXXFLAGS%g + s%@FFLAGS@%$FFLAGS%g s%@DEFS@%$DEFS%g s%@LDFLAGS@%$LDFLAGS%g s%@LIBS@%$LIBS%g *************** *** 1953,1958 **** --- 2083,2090 ---- echo ABSTOP = `pwd` >>config/config.mk echo writing \"CPU = `make CPU`\" echo CPU = `make CPU` >>config/config.mk + echo writing \"LIBSTDCPLUSPLUS = $LIBSTDCPLUSPLUS\" + echo LIBSTDCPLUSPLUS = $LIBSTDCPLUSPLUS >>config/config.mk echo echo "now do a \"make\"" echo Index: top_ivtools/configure.in diff -c top_ivtools/configure.in:1.1 top_ivtools/configure.in:1.2 *** top_ivtools/configure.in:1.1 Wed Aug 30 09:59:22 2000 --- ./configure.in Tue Sep 19 16:35:26 2000 *************** *** 231,236 **** --- 231,238 ---- #AC_CXX_EGCS # check for gettimeofday #AC_TWO_ARG_TIMEOFDAY + # check for libstdc++ + AC_CHECK_LIB(stdc++,peek__7istream,LIBSTDCPLUSPLUS=1,LIBSTDCPLUSPLUS=0) # check for bigendian #AC_C_BIGENDIAN *************** *** 363,368 **** --- 365,372 ---- echo ABSTOP = `pwd` >>config/config.mk echo writing \"CPU = `make CPU`\" echo CPU = `make CPU` >>config/config.mk + echo writing \"LIBSTDCPLUSPLUS = $LIBSTDCPLUSPLUS\" + echo LIBSTDCPLUSPLUS = $LIBSTDCPLUSPLUS >>config/config.mk echo echo "now do a \"make\"" echo *** /dev/null Tue Sep 19 16:35:43 PDT 2000 --- patches/ivtools-000919-johnston-100 *************** patches/ivtools-000919-johnston-100 *** 0 **** --- 1 ---- + ivtools-000919-johnston-100 |
From: <ivt...@li...> - 2000-09-15 21:09:46
|
Patch: ivtools-000916-johnston-099 For: ivtools-0.8.4 Author: joh...@us... Subject: Requires: This is an intermediate patch to ivtools-0.8.4. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - changes type of third argument to accept() from an unportable (unsigned int*) to a more correct (socklent_t *) (in src/utils/sockets.cc). First done by Guenter Geiger in his Debianization of ivtools-0.8.3 Index: utils_ivtools/sockets.cc diff -c utils_ivtools/sockets.cc:1.1 utils_ivtools/sockets.cc:1.2 *** utils_ivtools/sockets.cc:1.1 Wed Aug 30 10:01:38 2000 --- src/utils/sockets.cc Sat Sep 16 05:10:38 2000 *************** *** 98,104 **** int data_fd; if ((data_fd = accept(Psocket_fd, (struct sockaddr *)&Pclient_addr, ! (unsigned int *)&Palen)) < 0) { // we can break out of accept if the system call was interrupted #ifndef ERESTART /* ERESTART not defined on some systems */ if (errno != EINTR) { --- 98,104 ---- int data_fd; if ((data_fd = accept(Psocket_fd, (struct sockaddr *)&Pclient_addr, ! (socklen_t *)&Palen)) < 0) { // we can break out of accept if the system call was interrupted #ifndef ERESTART /* ERESTART not defined on some systems */ if (errno != EINTR) { *** /dev/null Sat Sep 16 05:10:42 PDT 2000 --- patches/ivtools-000916-johnston-099 *************** patches/ivtools-000916-johnston-099 *** 0 **** --- 1 ---- + ivtools-000916-johnston-099 |
From: <ivt...@li...> - 2000-09-06 19:09:39
|
Patch: ivtools-000906-johnston-098 For: ivtools-0.8.4 Author: joh...@us... Subject: dual-license with the GPL Requires: This is an intermediate patch to ivtools-0.8.4. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - make ivtools available under the GPL as well as the original X11 style license. Index: top_ivtools/COPYING diff -c /dev/null top_ivtools/COPYING:1.1 *** /dev/null Wed Sep 6 12:07:57 2000 --- ./COPYING Wed Sep 6 12:07:56 2000 *************** *** 0 **** --- 1,340 ---- + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your + freedom to share and change it. By contrast, the GNU General Public + License is intended to guarantee your freedom to share and change free + software--to make sure the software is free for all its users. This + General Public License applies to most of the Free Software + Foundation's software and to any other program whose authors commit to + using it. (Some other Free Software Foundation software is covered by + the GNU Library General Public License instead.) You can apply it to + your programs, too. + + When we speak of free software, we are referring to freedom, not + price. Our General Public Licenses are designed to make sure that you + have the freedom to distribute copies of free software (and charge for + this service if you wish), that you receive source code or can get it + if you want it, that you can change the software or use pieces of it + in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid + anyone to deny you these rights or to ask you to surrender the rights. + These restrictions translate to certain responsibilities for you if you + distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether + gratis or for a fee, you must give the recipients all the rights that + you have. You must make sure that they, too, receive or can get the + source code. And you must show them these terms so they know their + rights. + + We protect your rights with two steps: (1) copyright the software, and + (2) offer you this license which gives you legal permission to copy, + distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain + that everyone understands that there is no warranty for this free + software. If the software is modified by someone else and passed on, we + want its recipients to know that what they have is not the original, so + that any problems introduced by others will not reflect on the original + authors' reputations. + + Finally, any free program is threatened constantly by software + patents. We wish to avoid the danger that redistributors of a free + program will individually obtain patent licenses, in effect making the + program proprietary. To prevent this, we have made it clear that any + patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and + modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains + a notice placed by the copyright holder saying it may be distributed + under the terms of this General Public License. The "Program", below, + refers to any such program or work, and a "work based on the Program" + means either the Program or any derivative work under copyright law: + that is to say, a work containing the Program or a portion of it, + either verbatim or with modifications and/or translated into another + language. (Hereinafter, translation is included without limitation in + the term "modification".) Each licensee is addressed as "you". + + Activities other than copying, distribution and modification are not + covered by this License; they are outside its scope. The act of + running the Program is not restricted, and the output from the Program + is covered only if its contents constitute a work based on the + Program (independent of having been made by running the Program). + Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's + source code as you receive it, in any medium, provided that you + conspicuously and appropriately publish on each copy an appropriate + copyright notice and disclaimer of warranty; keep intact all the + notices that refer to this License and to the absence of any warranty; + and give any other recipients of the Program a copy of this License + along with the Program. + + You may charge a fee for the physical act of transferring a copy, and + you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion + of it, thus forming a work based on the Program, and copy and + distribute such modifications or work under the terms of Section 1 + above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + + These requirements apply to the modified work as a whole. If + identifiable sections of that work are not derived from the Program, + and can be reasonably considered independent and separate works in + themselves, then this License, and its terms, do not apply to those + sections when you distribute them as separate works. But when you + distribute the same sections as part of a whole which is a work based + on the Program, the distribution of the whole must be on the terms of + this License, whose permissions for other licensees extend to the + entire whole, and thus to each and every part regardless of who wrote it. + + Thus, it is not the intent of this section to claim rights or contest + your rights to work written entirely by you; rather, the intent is to + exercise the right to control the distribution of derivative or + collective works based on the Program. + + In addition, mere aggregation of another work not based on the Program + with the Program (or with a work based on the Program) on a volume of + a storage or distribution medium does not bring the other work under + the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, + under Section 2) in object code or executable form under the terms of + Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + + The source code for a work means the preferred form of the work for + making modifications to it. For an executable work, complete source + code means all the source code for all modules it contains, plus any + associated interface definition files, plus the scripts used to + control compilation and installation of the executable. However, as a + special exception, the source code distributed need not include + anything that is normally distributed (in either source or binary + form) with the major components (compiler, kernel, and so on) of the + operating system on which the executable runs, unless that component + itself accompanies the executable. + + If distribution of executable or object code is made by offering + access to copy from a designated place, then offering equivalent + access to copy the source code from the same place counts as + distribution of the source code, even though third parties are not + compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense or distribute the Program is + void, and will automatically terminate your rights under this License. + However, parties who have received copies, or rights, from you under + this License will not have their licenses terminated so long as such + parties remain in full compliance. + + 5. You are not required to accept this License, since you have not + signed it. However, nothing else grants you permission to modify or + distribute the Program or its derivative works. These actions are + prohibited by law if you do not accept this License. Therefore, by + modifying or distributing the Program (or any work based on the + Program), you indicate your acceptance of this License to do so, and + all its terms and conditions for copying, distributing or modifying + the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the + Program), the recipient automatically receives a license from the + original licensor to copy, distribute or modify the Program subject to + these terms and conditions. You may not impose any further + restrictions on the recipients' exercise of the rights granted herein. + You are not responsible for enforcing compliance by third parties to + this License. + + 7. If, as a consequence of a court judgment or allegation of patent + infringement or for any other reason (not limited to patent issues), + conditions are imposed on you (whether by court order, agreement or + otherwise) that contradict the conditions of this License, they do not + excuse you from the conditions of this License. If you cannot + distribute so as to satisfy simultaneously your obligations under this + License and any other pertinent obligations, then as a consequence you + may not distribute the Program at all. For example, if a patent + license would not permit royalty-free redistribution of the Program by + all those who receive copies directly or indirectly through you, then + the only way you could satisfy both it and this License would be to + refrain entirely from distribution of the Program. + + If any portion of this section is held invalid or unenforceable under + any particular circumstance, the balance of the section is intended to + apply and the section as a whole is intended to apply in other + circumstances. + + It is not the purpose of this section to induce you to infringe any + patents or other property right claims or to contest validity of any + such claims; this section has the sole purpose of protecting the + integrity of the free software distribution system, which is + implemented by public license practices. Many people have made + generous contributions to the wide range of software distributed + through that system in reliance on consistent application of that + system; it is up to the author/donor to decide if he or she is willing + to distribute software through any other system and a licensee cannot + impose that choice. + + This section is intended to make thoroughly clear what is believed to + be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in + certain countries either by patents or by copyrighted interfaces, the + original copyright holder who places the Program under this License + may add an explicit geographical distribution limitation excluding + those countries, so that distribution is permitted only in or among + countries not thus excluded. In such case, this License incorporates + the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions + of the General Public License from time to time. Such new versions will + be similar in spirit to the present version, but may differ in detail to + address new problems or concerns. + + Each version is given a distinguishing version number. If the Program + specifies a version number of this License which applies to it and "any + later version", you have the option of following the terms and conditions + either of that version or of any later version published by the Free + Software Foundation. If the Program does not specify a version number of + this License, you may choose any version ever published by the Free Software + Foundation. + + 10. If you wish to incorporate parts of the Program into other free + programs whose distribution conditions are different, write to the author + to ask for permission. For software which is copyrighted by the Free + Software Foundation, write to the Free Software Foundation; we sometimes + make exceptions for this. Our decision will be guided by the two goals + of preserving the free status of all derivatives of our free software and + of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY + FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN + OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES + PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED + OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS + TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE + PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, + REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING + WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR + REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, + INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING + OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED + TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY + YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER + PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE + POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest + possible use to the public, the best way to achieve this is to make it + free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest + to attach them to the start of each source file to most effectively + convey the exclusion of warranty; and each file should have at least + the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) 19yy <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + Also add information on how to contact you by electronic and paper mail. + + If the program is interactive, make it output a short notice like this + when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + + The hypothetical commands `show w' and `show c' should show the appropriate + parts of the General Public License. Of course, the commands you use may + be called something other than `show w' and `show c'; they could even be + mouse-clicks or menu items--whatever suits your program. + + You should also get your employer (if you work as a programmer) or your + school, if any, to sign a "copyright disclaimer" for the program, if + necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + + This General Public License does not permit incorporating your program into + proprietary programs. If your program is a subroutine library, you may + consider it more useful to permit linking proprietary applications with the + library. If this is what you want to do, use the GNU Library General + Public License instead of this License. Index: top_ivtools/COPYRIGHT diff -c top_ivtools/COPYRIGHT:1.1 top_ivtools/COPYRIGHT:1.2 *** top_ivtools/COPYRIGHT:1.1 Wed Aug 30 09:59:22 2000 --- ./COPYRIGHT Wed Sep 6 12:07:56 2000 *************** *** 1,3 **** --- 1,8 ---- + As of September 6th 2000 the portion of ivtools for which Vectaport + Inc. holds the copyright is made available under the GPL as + well as the following license. See the file COPYING for details on + the GPL. + /* * Copyright (c) 2000 Vectaport Inc., IET Inc * Copyright (c) 1999 Vectaport Inc., IET Inc, R.B. Kissh and Associates Index: top_ivtools/MANIFEST diff -c top_ivtools/MANIFEST:1.1 top_ivtools/MANIFEST:1.2 *** top_ivtools/MANIFEST:1.1 Wed Aug 30 09:59:22 2000 --- ./MANIFEST Wed Sep 6 12:07:56 2000 *************** *** 3,10 **** ivtools-0.8/CHANGES-0.5 ivtools-0.8/CHANGES-0.6 ivtools-0.8/CHANGES-0.7 ivtools-0.8/COPYRIGHT - ivtools-0.8/COPYRIGHT.proposed ivtools-0.8/INSTALL ivtools-0.8/Imakefile ivtools-0.8/MANIFEST --- 3,10 ---- ivtools-0.8/CHANGES-0.5 ivtools-0.8/CHANGES-0.6 ivtools-0.8/CHANGES-0.7 + ivtools-0.8/COPYING ivtools-0.8/COPYRIGHT ivtools-0.8/INSTALL ivtools-0.8/Imakefile ivtools-0.8/MANIFEST *** /dev/null Wed Sep 6 12:08:20 PDT 2000 --- patches/ivtools-000906-johnston-098 *************** patches/ivtools-000906-johnston-098 *** 0 **** --- 1 ---- + ivtools-000906-johnston-098 |
From: <ivt...@li...> - 2000-09-05 22:59:07
|
Patch: ivtools-000905-johnston-097 For: ivtools-0.8.4 Author: joh...@us... Subject: use symbols without initial value in comterp assignment operators Requires: This is an intermediate patch to ivtools-0.8.4. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - allow for using new symbols (those with a nil value) in the various assignment operators of comterp, i.e. x++ or x+=1 work if x was undefined. Index: ComTerp/assignfunc.c diff -c ComTerp/assignfunc.c:1.1 ComTerp/assignfunc.c:1.2 *** ComTerp/assignfunc.c:1.1 Wed Aug 30 09:59:30 2000 --- src/ComTerp/assignfunc.c Tue Sep 5 15:57:27 2000 *************** *** 85,95 **** if (operand1.type() == ComValue::SymbolType) { void* op1val = nil; _comterp->localtable()->find_and_remove(op1val, operand1.symbol_val()); ! if (!op1val) { ! push_stack(ComValue::nullval()); ! return; ! } ! push_stack(*(ComValue*)op1val); delete (ComValue*)op1val; push_stack(operand2); push_funcstate(2,0); --- 85,91 ---- if (operand1.type() == ComValue::SymbolType) { void* op1val = nil; _comterp->localtable()->find_and_remove(op1val, operand1.symbol_val()); ! push_stack(op1val ? *(ComValue*)op1val : ComValue::zeroval()); delete (ComValue*)op1val; push_stack(operand2); push_funcstate(2,0); *************** *** 118,128 **** if (operand1.type() == ComValue::SymbolType) { void* op1val = nil; _comterp->localtable()->find_and_remove(op1val, operand1.symbol_val()); ! if (!op1val) { ! push_stack(ComValue::nullval()); ! return; ! } ! push_stack(*(ComValue*)op1val); delete (ComValue*)op1val; push_stack(operand2); push_funcstate(2,0); --- 114,120 ---- if (operand1.type() == ComValue::SymbolType) { void* op1val = nil; _comterp->localtable()->find_and_remove(op1val, operand1.symbol_val()); ! push_stack(op1val ? *(ComValue*)op1val : ComValue::zeroval()); delete (ComValue*)op1val; push_stack(operand2); push_funcstate(2,0); *************** *** 151,161 **** if (operand1.type() == ComValue::SymbolType) { void* op1val = nil; _comterp->localtable()->find_and_remove(op1val, operand1.symbol_val()); ! if (!op1val) { ! push_stack(ComValue::nullval()); ! return; ! } ! push_stack(*(ComValue*)op1val); delete (ComValue*)op1val; push_stack(operand2); push_funcstate(2,0); --- 143,149 ---- if (operand1.type() == ComValue::SymbolType) { void* op1val = nil; _comterp->localtable()->find_and_remove(op1val, operand1.symbol_val()); ! push_stack(op1val ? *(ComValue*)op1val : ComValue::zeroval()); delete (ComValue*)op1val; push_stack(operand2); push_funcstate(2,0); *************** *** 184,194 **** if (operand1.type() == ComValue::SymbolType) { void* op1val = nil; _comterp->localtable()->find_and_remove(op1val, operand1.symbol_val()); ! if (!op1val) { ! push_stack(ComValue::nullval()); ! return; ! } ! push_stack(*(ComValue*)op1val); delete (ComValue*)op1val; push_stack(operand2); push_funcstate(2,0); --- 172,178 ---- if (operand1.type() == ComValue::SymbolType) { void* op1val = nil; _comterp->localtable()->find_and_remove(op1val, operand1.symbol_val()); ! push_stack(op1val ? *(ComValue*)op1val : ComValue::zeroval()); delete (ComValue*)op1val; push_stack(operand2); push_funcstate(2,0); *************** *** 217,227 **** if (operand1.type() == ComValue::SymbolType) { void* op1val = nil; _comterp->localtable()->find_and_remove(op1val, operand1.symbol_val()); ! if (!op1val) { ! push_stack(ComValue::nullval()); ! return; ! } ! push_stack(*(ComValue*)op1val); delete (ComValue*)op1val; push_stack(operand2); push_funcstate(2,0); --- 201,207 ---- if (operand1.type() == ComValue::SymbolType) { void* op1val = nil; _comterp->localtable()->find_and_remove(op1val, operand1.symbol_val()); ! push_stack(op1val ? *(ComValue*)op1val : ComValue::zeroval()); delete (ComValue*)op1val; push_stack(operand2); push_funcstate(2,0); *************** *** 247,269 **** if (operand1.type() == ComValue::SymbolType) { void* op1val = nil; _comterp->localtable()->find_and_remove(op1val, operand1.symbol_val()); ! if (!op1val) ! push_stack(ComValue::nullval()); ! else { ! push_stack(*(ComValue*)op1val); ! delete (ComValue*)op1val; ! ComValue one; ! one.type(ComValue::IntType); ! one.int_ref() = 1; ! push_stack(one); ! push_funcstate(2,0); ! static AddFunc* subfunc = new AddFunc(comterp()); ! subfunc->execute(); ! pop_funcstate(); ! ComValue* result = new ComValue(pop_stack()); ! _comterp->localtable()->insert(operand1.symbol_val(), result); ! push_stack(*result); ! } } else push_stack(ComValue::nullval()); --- 227,245 ---- if (operand1.type() == ComValue::SymbolType) { void* op1val = nil; _comterp->localtable()->find_and_remove(op1val, operand1.symbol_val()); ! push_stack(op1val ? *(ComValue*)op1val : ComValue::zeroval()); ! delete (ComValue*)op1val; ! ComValue one; ! one.type(ComValue::IntType); ! one.int_ref() = 1; ! push_stack(one); ! push_funcstate(2,0); ! static AddFunc* subfunc = new AddFunc(comterp()); ! subfunc->execute(); ! pop_funcstate(); ! ComValue* result = new ComValue(pop_stack()); ! _comterp->localtable()->insert(operand1.symbol_val(), result); ! push_stack(*result); } else push_stack(ComValue::nullval()); *************** *** 281,303 **** if (operand1.type() == ComValue::SymbolType) { void* op1val = nil; _comterp->localtable()->find_and_remove(op1val, operand1.symbol_val()); ! if (!op1val) ! push_stack(ComValue::nullval()); ! else { ! push_stack(*(ComValue*)op1val); ! ComValue one; ! one.type(ComValue::IntType); ! one.int_ref() = 1; ! push_stack(one); ! push_funcstate(2,0); ! static AddFunc* subfunc = new AddFunc(comterp()); ! subfunc->execute(); ! pop_funcstate(); ! ComValue* result = new ComValue(pop_stack()); ! _comterp->localtable()->insert(operand1.symbol_val(), result); ! push_stack(*(ComValue*)op1val); ! delete (ComValue*)op1val; ! } } else push_stack(ComValue::nullval()); --- 257,275 ---- if (operand1.type() == ComValue::SymbolType) { void* op1val = nil; _comterp->localtable()->find_and_remove(op1val, operand1.symbol_val()); ! push_stack(op1val ? *(ComValue*)op1val: ComValue::zeroval()); ! ComValue one; ! one.type(ComValue::IntType); ! one.int_ref() = 1; ! push_stack(one); ! push_funcstate(2,0); ! static AddFunc* subfunc = new AddFunc(comterp()); ! subfunc->execute(); ! pop_funcstate(); ! ComValue* result = new ComValue(pop_stack()); ! _comterp->localtable()->insert(operand1.symbol_val(), result); ! push_stack(op1val ? *(ComValue*)op1val : ComValue::nullval()); ! delete (ComValue*)op1val; } else push_stack(ComValue::nullval()); *************** *** 315,337 **** if (operand1.type() == ComValue::SymbolType) { void* op1val = nil; _comterp->localtable()->find_and_remove(op1val, operand1.symbol_val()); ! if (!op1val) ! push_stack(ComValue::nullval()); ! else { ! push_stack(*(ComValue*)op1val); ! delete (ComValue*)op1val; ! ComValue one; ! one.type(ComValue::IntType); ! one.int_ref() = 1; ! push_stack(one); ! push_funcstate(2,0); ! static SubFunc* subfunc = new SubFunc(comterp()); ! subfunc->execute(); ! pop_funcstate(); ! ComValue* result = new ComValue(pop_stack()); ! _comterp->localtable()->insert(operand1.symbol_val(), result); ! push_stack(*result); ! } } else push_stack(ComValue::nullval()); --- 287,305 ---- if (operand1.type() == ComValue::SymbolType) { void* op1val = nil; _comterp->localtable()->find_and_remove(op1val, operand1.symbol_val()); ! push_stack(op1val ? *(ComValue*)op1val : ComValue::zeroval()); ! delete (ComValue*)op1val; ! ComValue one; ! one.type(ComValue::IntType); ! one.int_ref() = 1; ! push_stack(one); ! push_funcstate(2,0); ! static SubFunc* subfunc = new SubFunc(comterp()); ! subfunc->execute(); ! pop_funcstate(); ! ComValue* result = new ComValue(pop_stack()); ! _comterp->localtable()->insert(operand1.symbol_val(), result); ! push_stack(*result); } else push_stack(ComValue::nullval()); *************** *** 349,371 **** if (operand1.type() == ComValue::SymbolType) { void* op1val = nil; _comterp->localtable()->find_and_remove(op1val, operand1.symbol_val()); ! if (!op1val) ! push_stack(ComValue::nullval()); ! else { ! push_stack(*(ComValue*)op1val); ! ComValue one; ! one.type(ComValue::IntType); ! one.int_ref() = 1; ! push_stack(one); ! push_funcstate(2,0); ! static SubFunc* subfunc = new SubFunc(comterp()); ! subfunc->execute(); ! pop_funcstate(); ! ComValue* result = new ComValue(pop_stack()); ! _comterp->localtable()->insert(operand1.symbol_val(), result); ! push_stack(*(ComValue*)op1val); ! delete (ComValue*)op1val; ! } } else push_stack(ComValue::nullval()); --- 317,335 ---- if (operand1.type() == ComValue::SymbolType) { void* op1val = nil; _comterp->localtable()->find_and_remove(op1val, operand1.symbol_val()); ! push_stack(op1val ? *(ComValue*)op1val : ComValue::zeroval()); ! ComValue one; ! one.type(ComValue::IntType); ! one.int_ref() = 1; ! push_stack(one); ! push_funcstate(2,0); ! static SubFunc* subfunc = new SubFunc(comterp()); ! subfunc->execute(); ! pop_funcstate(); ! ComValue* result = new ComValue(pop_stack()); ! _comterp->localtable()->insert(operand1.symbol_val(), result); ! push_stack(op1val ? *(ComValue*)op1val : ComValue::nullval()); ! delete (ComValue*)op1val; } else push_stack(ComValue::nullval()); *** /dev/null Tue Sep 5 15:57:39 PDT 2000 --- patches/ivtools-000905-johnston-096 *************** patches/ivtools-000905-johnston-096 *** 0 **** --- 1 ---- + ivtools-000905-johnston-096 |
From: <ivt...@li...> - 2000-08-30 18:20:14
|
Patch: ivtools-000830-johnston-096 For: ivtools-0.8.4 Author: joh...@us... Subject: fix segfault in new comdraw addtool command Requires: This is an intermediate patch to ivtools-0.8.4. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - fix segfault in new comdraw addtool command when the supplied pathname is non-existent. Index: ComUnidraw/unifunc.c diff -c ComUnidraw/unifunc.c:1.5 ComUnidraw/unifunc.c:1.6 *** ComUnidraw/unifunc.c:1.5 Wed Aug 30 10:44:06 2000 --- src/ComUnidraw/unifunc.c Wed Aug 30 10:45:02 2000 *************** *** 373,380 **** reset_stack(); OverlayEditor* ed = (OverlayEditor*)GetEditor(); OverlayComp* comp = ed->overlay_kit()->add_tool_button(pathnamev.symbol_ptr()); ! ComValue retval(comp->classid(), new ComponentView(comp)); ! retval.object_compview(true); ! push_stack(retval); } --- 373,383 ---- reset_stack(); OverlayEditor* ed = (OverlayEditor*)GetEditor(); OverlayComp* comp = ed->overlay_kit()->add_tool_button(pathnamev.symbol_ptr()); ! if (comp) { ! ComValue retval(comp->classid(), new ComponentView(comp)); ! retval.object_compview(true); ! push_stack(retval); ! } else ! push_stack(ComValue::nullval()); } *** /dev/null Wed Aug 30 10:45:07 PDT 2000 --- patches/ivtools-000830-johnston-093 *************** patches/ivtools-000830-johnston-093 *** 0 **** --- 1 ---- + ivtools-000830-johnston-093 |
From: <ivt...@li...> - 2000-08-30 18:20:05
|
Patch: ivtools-000823-johnston-095 For: ivtools-0.8.3 Author: joh...@us... Subject: final changes for building on FreeBSD 4.0 Requires: This is an intermediate patch to ivtools-0.8.3. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - final changes for ivtools-0.8.4 to make it build completely on FreeBSD 4.0 Index: top_ivtools/CHANGES diff -c top_ivtools/CHANGES:1.6 top_ivtools/CHANGES:1.7 *** top_ivtools/CHANGES:1.6 Wed Aug 23 02:16:48 2000 --- ./CHANGES Wed Aug 23 23:31:25 2000 *************** *** 1,5 **** --- 1,7 ---- August 23rd 2000 ivtools-0.8.4 + - builds and works on FreeBSD 4.0 (tested at bsd.compile.sourceforge.net) + - add :popen keyword to comdraw import command, so that Unix command lines can be substituted for pathnames, i.e.: Index: src_tiff/prototypes.h diff -c src_tiff/prototypes.h:1.1 src_tiff/prototypes.h:1.2 *** src_tiff/prototypes.h:1.1 Tue Jan 18 03:07:52 2000 --- src/TIFF/prototypes.h Wed Aug 23 23:31:55 2000 *************** *** 53,58 **** #define DECLARE3V(f,t1,a1,t2,a2,t3,a3) \ f(a1, a2, a3, va_alist) t1 a1; t2 a2; t3 a3; va_dcl #else ! "Help, I don't know how to handle this case: !USE_PROTOTYPES and !USE_VARARGS?" #endif #endif --- 53,58 ---- #define DECLARE3V(f,t1,a1,t2,a2,t3,a3) \ f(a1, a2, a3, va_alist) t1 a1; t2 a2; t3 a3; va_dcl #else ! /* "Help, I don't know how to handle this case: !USE_PROTOTYPES and !USE_VARARGS?" */ #endif #endif Index: src_tiff/tif_machdep.c diff -c src_tiff/tif_machdep.c:1.1 src_tiff/tif_machdep.c:1.2 *** src_tiff/tif_machdep.c:1.1 Tue Jan 18 03:07:54 2000 --- src/TIFF/tif_machdep.c Wed Aug 23 23:31:55 2000 *************** *** 135,142 **** --- 135,144 ---- #if !HAVE_IEEEFP #if !defined(IEEEFLOAT2NATIVE) || !defined(NATIVE2IEEEFLOAT) + /* "Help, you've configured the library to not have IEEE floating point,\ but not defined how to convert between IEEE and native formats!" + */ #endif /* Index: src_dispatch/rpcregistry.c diff -c src_dispatch/rpcregistry.c:1.1 src_dispatch/rpcregistry.c:1.2 *** src_dispatch/rpcregistry.c:1.1 Tue Jan 18 03:08:00 2000 --- src/Dispatch/rpcregistry.c Wed Aug 23 23:32:00 2000 *************** *** 37,43 **** #include <sys/utsname.h> #define MAXHOSTNAMELEN SYS_NMLN #endif ! #ifdef __linux__ #include <stdio.h> #endif // Print a short error message describing the last error encountered --- 37,43 ---- #include <sys/utsname.h> #define MAXHOSTNAMELEN SYS_NMLN #endif ! #if defined(__linux__) || defined(__FreeBSD__) #include <stdio.h> #endif // Print a short error message describing the last error encountered Index: Time/Time.c diff -c Time/Time.c:1.1 Time/Time.c:1.2 *** Time/Time.c:1.1 Tue Jan 18 03:08:11 2000 --- src/Time/Time.c Wed Aug 23 23:32:03 2000 *************** *** 51,57 **** #endif ! #if defined(BSD) || defined(hpux) || defined(linux) || defined(__sun) || defined(__alpha) || defined(__CYGWIN__) #ifdef hpux #include <time.h> --- 51,57 ---- #endif ! #if defined(BSD) || defined(hpux) || defined(linux) || defined(__sun) || defined(__alpha) || defined(__CYGWIN__) || defined(__FreeBSD__) #ifdef hpux #include <time.h> Index: config_iv/iv-freebsd.cf diff -c config_iv/iv-freebsd.cf:1.1 config_iv/iv-freebsd.cf:1.2 *** config_iv/iv-freebsd.cf:1.1 Sat Aug 5 02:38:25 2000 --- config/InterViews/iv-freebsd.cf Wed Aug 23 23:32:45 2000 *************** *** 5,10 **** --- 5,11 ---- #define OptimizeCCFlags -O6 #define TIFFOptimizeCFlags -O + #define TIFFStdCDefines -DHAVE_IEEEFP #ifndef ExtraCCLdFlags #define ExtraCCLdFlags /**/ *** /dev/null Wed Aug 23 23:32:50 PDT 2000 --- patches/ivtools-000823-johnston-095 *************** patches/ivtools-000823-johnston-095 *** 0 **** --- 1 ---- + ivtools-000823-johnston-095 |
From: <ivt...@li...> - 2000-08-30 18:19:38
|
Patch: ivtools-000823-johnston-094 For: ivtools-0.8.3 Author: joh...@us... Subject: more FreeBSD changes, last of ivtools-0.8.4 Requires: This is an intermediate patch to ivtools-0.8.3. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - more FreeBSD changes, last of ivtools-0.8.4 Index: top_ivtools/CHANGES diff -c top_ivtools/CHANGES:1.5 top_ivtools/CHANGES:1.6 *** top_ivtools/CHANGES:1.5 Wed Aug 23 00:34:51 2000 --- ./CHANGES Wed Aug 23 02:16:48 2000 *************** *** 194,199 **** --- 194,200 ---- followed by ^X (File/Export) with idraw format checked. + - perhaps now building on FreeBSD. June 12th 2000 ivtools-0.8.3 Index: top_ivtools/README diff -c top_ivtools/README:1.6 top_ivtools/README:1.7 *** top_ivtools/README:1.6 Wed Aug 23 00:34:51 2000 --- ./README Wed Aug 23 02:16:49 2000 *************** *** 117,126 **** gcc-2.8.1, >= egcs-1.0.1) and on a variety of Unix'es: SunOS 4.1 (MIT's X11R5), Solaris 2.6 (X11R6), Irix 5.2 (SGI's X11R5), Linux 1.2 (Slackware 3.0, XFree86 3.1), Linux 2.* (RedHat 4.0 thru 6.0, Debian ! 2.*), and NetBSD. There are contributed configs for HPUX and Dec ! Alpha. Recently it has been built on Windows NT 4.0 using Cygwin from ! Cygnus Solutions (see README.cygwin). You can pick up Linux-ELF ! binaries from the ivtools web page (http://www.vectaport.com/ivtools/). If you have a question about this software, desire to add code, found --- 117,126 ---- gcc-2.8.1, >= egcs-1.0.1) and on a variety of Unix'es: SunOS 4.1 (MIT's X11R5), Solaris 2.6 (X11R6), Irix 5.2 (SGI's X11R5), Linux 1.2 (Slackware 3.0, XFree86 3.1), Linux 2.* (RedHat 4.0 thru 6.0, Debian ! 2.*), NetBSD, and perhaps now FreeBSD. There are contributed configs ! for HPUX and Dec Alpha. Recently it has been built on Windows NT 4.0 ! using Cygwin from Cygnus Solutions (see README.cygwin). You can pick ! up Linux-ELF binaries from the ivtools web page (http://www.vectaport.com/ivtools/). If you have a question about this software, desire to add code, found Index: src_tiff/tiffcompat.h diff -c src_tiff/tiffcompat.h:1.1 src_tiff/tiffcompat.h:1.2 *** src_tiff/tiffcompat.h:1.1 Tue Jan 18 03:07:56 2000 --- src/TIFF/tiffcompat.h Wed Aug 23 02:16:59 2000 *************** *** 152,158 **** #define lseek mpw_lseek extern long mpw_lseek(int, long, int); #else ! #if !defined(__NetBSD__) extern long lseek(); #endif #endif --- 152,158 ---- #define lseek mpw_lseek extern long mpw_lseek(int, long, int); #else ! #if !defined(__NetBSD__) && !defined(__FreeBSD__) extern long lseek(); #endif #endif Index: include_std/nan.h diff -c include_std/nan.h:1.2 include_std/nan.h:1.3 *** include_std/nan.h:1.2 Tue Jan 18 21:53:09 2000 --- src/include/ivstd/nan.h Wed Aug 23 02:17:36 2000 *************** *** 3,15 **** #if defined(__GLIBC__) && (__GLIBC__==2 && __GLIBC_MINOR__>0 || __GLIBC__>2) #include <bits/nan.h> ! #elif !defined(__CYGWIN__) && !defined(__NetBSD__) #include_next <nan.h> #else #include <math.h> #endif ! #if defined(__sun__) && defined(__svr4__) || defined(__CYGWIN__) || defined(__linux__) || defined(__NetBSD__) #define isnanorinf(dval) (isnan(dval)||isinf(dval)) #elif defined(__alpha) #define isnanorinf(dval) (IsNANorINF(dval)) --- 3,15 ---- #if defined(__GLIBC__) && (__GLIBC__==2 && __GLIBC_MINOR__>0 || __GLIBC__>2) #include <bits/nan.h> ! #elif !defined(__CYGWIN__) && !defined(__NetBSD__) && !defined(__FreeBSD__) #include_next <nan.h> #else #include <math.h> #endif ! #if defined(__sun__) && defined(__svr4__) || defined(__CYGWIN__) || defined(__linux__) || defined(__NetBSD__) || defined(__FreeBSD__) #define isnanorinf(dval) (isnan(dval)||isinf(dval)) #elif defined(__alpha) #define isnanorinf(dval) (IsNANorINF(dval)) Index: config_ivtools/site.def.FREEBSD diff -c config_ivtools/site.def.FREEBSD:1.1 config_ivtools/site.def.FREEBSD:1.2 *** config_ivtools/site.def.FREEBSD:1.1 Sat Aug 5 02:38:23 2000 --- config/site.def.FREEBSD Wed Aug 23 02:17:42 2000 *************** *** 38,44 **** #define SharedLibraryCmd(ldobjs,extra_flags) gcc -shared extra_flags -o $@ ldobjs /* ! * Install a shared library on NetBSD. */ #ifndef InstallDynamicSharedLibrary #define InstallDynamicSharedLibrary(libname,rev,dest) @@\ --- 38,44 ---- #define SharedLibraryCmd(ldobjs,extra_flags) gcc -shared extra_flags -o $@ ldobjs /* ! * Install a shared library on FreeBSD. */ #ifndef InstallDynamicSharedLibrary #define InstallDynamicSharedLibrary(libname,rev,dest) @@\ *** /dev/null Wed Aug 23 02:17:48 PDT 2000 --- patches/ivtools-000823-johnston-094 *************** patches/ivtools-000823-johnston-094 *** 0 **** --- 1 ---- + ivtools-000823-johnston-094 |
From: <ivt...@li...> - 2000-08-30 18:19:13
|
Patch: ivtools-000823-johnston-093 For: ivtools-0.8.3 Author: joh...@us... Subject: change for FreeBSD compilation Requires: This is an intermediate patch to ivtools-0.8.3. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - change for FreeBSD compilation, last patch for ivtools-0.8.4. Index: src_x11/xwindow.c diff -c src_x11/xwindow.c:1.2 src_x11/xwindow.c:1.3 *** src_x11/xwindow.c:1.2 Tue Jan 18 21:52:42 2000 --- src/IV-X11/xwindow.c Wed Aug 23 01:56:31 2000 *************** *** 62,68 **** #include <stropts.h> #include <sys/conf.h> #endif ! #if !defined(__NetBSD__) #if !defined(__linux__) && !defined(__CYGWIN__) /* no standard place for this */ extern "C" { --- 62,68 ---- #include <stropts.h> #include <sys/conf.h> #endif ! #if !defined(__NetBSD__) && !defined(__FreeBSD__) #if !defined(__linux__) && !defined(__CYGWIN__) /* no standard place for this */ extern "C" { *** /dev/null Wed Aug 23 01:58:58 PDT 2000 --- patches/ivtools-000823-johnston-093 *************** patches/ivtools-000823-johnston-093 *** 0 **** --- 1 ---- + ivtools-000823-johnston-093 |
From: <ivt...@li...> - 2000-08-22 20:33:53
|
Patch: ivtools-000823-johnston-092 For: ivtools-0.8.3 Author: joh...@us... Subject: last patch for ivtools-0.8.4 Requires: This is an intermediate patch to ivtools-0.8.3. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - last patch for ivtools-0.8.4 Index: top_ivtools/CHANGES diff -c top_ivtools/CHANGES:1.4 top_ivtools/CHANGES:1.5 *** top_ivtools/CHANGES:1.4 Tue Jun 13 02:02:23 2000 --- ./CHANGES Wed Aug 23 00:34:51 2000 *************** *** 1,3 **** --- 1,200 ---- + August 23rd 2000 ivtools-0.8.4 + + - add :popen keyword to comdraw import command, so that Unix command + lines can be substituted for pathnames, i.e.: + + import("pbmtext \"TEST STRING\" | pnmalias" :popen) + + will cause a anti-aliased rendering of TEST STRING to be imported as a + PPM raster file. + + - fix bug in editing text graphics in Landscape mode. A while back + things were changed so you could enter horizontal text in landscape + mode. This changed code that was used both when you typed in new + text, and when you edited existing text. But the test for Landscape + mode (and the resultant rotation by 90 degrees before pasting) needed + only to be done in the case of new text. This is the explanation for + the text disappearing after its been edited with the Reshape tool + which some have seen, but seemed to be a hard-to-replicate bug. + + - extend the use of -stripped to ivtools flipbook as well as comdraw. + Now you can bring up a flipbook without any toolbar or menubar. + + - cause the menubar and toolbar (and state variables) to be + constructed anyways when -stripped is given. This keeps the keyboard + shortcuts working, a necessary feature when there is no GUI for those + commands and tools. + + - part 2 of patch to fix Landscape-mode text editing. This makes all + cases works, and propogates the fix to idraw as well. + + - make a brush undashed when drawing any arrowhead. It just didn't + look good to see three quarters of an arrowhead at the end of a dashed + line. There are still discrepancies between the how an arrowhead + looks in the ArrowVarView and how it looks in a drawing. This math + could be reviewed and improved. + + - rename ComTerpServState to ComTerpState (because that is what it + was), and make more widespread use of it in all the ::run* methods. + This makes multiple run commands on the same line work for the first + time. + + - first version of comterp trace command: + + trace([flag] :get) -- toggle or set trace mode + + When true, the trace mode causes the interpreter to print out the name + of the command (ComFunc) ready to be executed, and the number of + arguments and number of keywords supplied to it. Indentation is 4 + spaces time the depth of post-evaluate expression, i.e. a doubly + nested for-loop has 8 spaces of indentation on the inner loop, four + for the outer loop. + + - expand on the trace output for non-post-evaluated commands + (ComFunc's). Since each of them has all its arguments (and keywords) + ready to go on the stack, it is a simple matter to loop through and + print these. It gives an interesting visualization of the innards of + any complex comterp expression with control constructs, because you + get to see what the arguments of each command (or operator) evaluated + to before the command itself was executed. + + The next step would be print the unevaluated expressions for a + post-evaluated command before they are executed. It might also be + possible to trace their value after they are determined at run-time, + to see what the "cond" or "if" conditional evaluated too. + + - if the pathname given to drawing editor doesn't exist, launch the + drawing editor so that it is ready to edit a file of that name. The + file won't come into existence until a File/Save is done, but the user + doesn't have to enter the pathname again if they don't want to. + + - attempt to workaround an ACE-related NetBSD bug. Todd Gruhn has + been faced with the problem comterp doesn't work in server mode when + compiled with ACE on NetBSD for quite a while. We confirmed that for + whatever reason, ACE would accept the connection to the port, and + construct the handler, but subsequent data transmitted to the port + would not cause select() to return. + + We also confirmed that ACE_wrappers/examples/Logger did work on NetBSD + (the Acceptor-server version). Since this was the example from which + comterp's use of ACE was derived, the next thing to do was a + line-by-line comparison of the comterp ACE code to the Logger example. + + I found that little had changed in the past five years regarding the + ACE Acceptor/Handler/Reactor API. But I did find two differences + between how that API was used in the Logger example, and how it was + used by comterp in server mode. + + The first was I had removed the call to Reactor::schedule_timerin + ComterpHandler::open, something that had been used in + Logging_Handler::open. I was trying to avoid the use of timers in the + case of comterp in server mode. This patch conditionally enables this + again for NetBSD. + + The second was I had added a call to Reactor::register_handler in + comterp's main.c (to register the templated Acceptor object) that + wasn't to be found in the main program of the Logger Acceptor-server + example. This patch backs that out for NetBSD. I think I had done + this to fix things after the change described in the previous + paragraph. The pair of changes worked quite well on Linux, but might + be the cause of the problem on NetBSD. + + - this patch also fixes an initialization bug in the TextView object, + one that only recently surfaced. + + - fix bug in use of ComTerpState. The ComTerp::pop_servstate method + always deletes the _pfnum member variable, but in the case of the + ComTerpServ::run method that takes a buffer of tokens as an argument, + you don't want to do this. The fix was to nil out _pfbuf before + popping the state. + + - add method to return symbol associated with type of an + AttributeValue (AttributeValue::type_symid()). + + - add comterp commands for returning the type of a value, and the + class of a value of object type. + + - modify the various comterp assignment operators to look up the value + of an attribute given as the second, or right-hand side operand. + Symbols are treated differently, in that they behave like attributes + when explicitly given, but get assigned as symbols when they are + computed and returned from some other expression. + + - add a symbol comparison option to EqualFunc, i.e.: + + eq(sym1 sym2 :sym) + + This assumes sym1 and sym2 are computed by an expression that returns + symbols, and then subsequent lookup is suppressed. + + - set limits on the traversal of the posteval expression buffer by + adding an offlimit argument to the various ComTerp::skip_* methods + (i.e. ::skip_func, ::skip_arg, and ::skip_key). Now you get a warning + when this condition occurs, and the related segfault is avoided. + + - remove printf in EivTextBuffer that squawked when the text buffer + was reallocated into large space. + + - add a LISP-like backquote operator to comterp. Works for attributes + as well. + + - add floor, ceil, and round commands to comterp. In each case a long + integer is returned when the argument is a float or double. + + - add pastemode command to comdraw, to allow for construction of + off-screen graphics. These can be later inserted with the comdraw + paste command, or maybe they can be used as a prototype for a + toolbutton. This will require investigating the graphics-to-glyph + conversion software that exists somewhere in the glyphs examples + source tree. + + - modify the comterp lexical scanner to always skip lines that begin + with a "#". This allows someone to write stand-alone executable + scripts for comterp that begin like this: + + #!/usr/local/bin/comterp run + + - migrate classes for representing graphics as glyphs from the morpher + example program to the IVGlyph library. This includes a method for + constructing glyphs given an idraw file. + + - migrate the morpher example from the examples3.1 sub-tree to the + main glyphs directory. + + - add customizable toolbar to drawtool, that consists of everything + but the Annotate and graphic drawing tools. You switch to this + toolbar by using a new "Tools" menu in the top menu bar. Also in that + new menu is an "Add Custom Tool" menu item, that brings up a + filechooser and prompts you to enter the path of an idraw document to + use as the prototype for the tool button and for the tool action. + + The reason it needs to be an idraw document is the tool button glyph + construction relies on an IdrawReader::load method reused from the + InterViews 3.1 morpher example. This is the gateway between glyphs + and graphics, which finally allows the same drawing to be used in both + worlds. This gives extra usefulness to the Export-in-idraw-format + mode. + + These idraw-format icons need to be small enough to fit in a + toolbutton, and they need to centered on 0,0. + + - attempt to set up configuration files for a port of ivtools to + FreeBSD, at the request of Wilhelm B. Kloke. + + - new addtool command in comdraw takes the pathname of an idraw drawn + (or drawtool, etc. exported) picture and makes it a button in the + alternate toolbar. + + compview=addtool(pathname) -- add button to toolbar based on zero-centered idraw drawing. + + The idraw graphics need to be zero-centered, which can be done in comdraw like this: + + g=at(select) /* gets the first graphic in the selection */ + move(-at(center(g) -at(center(g) 1))) /* zero-centers */ + + followed by ^X (File/Export) with idraw format checked. + + June 12th 2000 ivtools-0.8.3 - remove the output for a ComValue of BlankType in the related ostream Index: top_ivtools/INSTALL diff -c top_ivtools/INSTALL:1.8 top_ivtools/INSTALL:1.9 *** top_ivtools/INSTALL:1.8 Tue Jun 13 02:02:23 2000 --- ./INSTALL Wed Aug 23 00:34:51 2000 *************** *** 1,7 **** INSTALL for ivtools-0.8 ! Instructions for building ivtools-0.8.3 from source: 0. Compilation Environment --- 1,7 ---- INSTALL for ivtools-0.8 ! Instructions for building ivtools-0.8.4 from source: 0. Compilation Environment Index: top_ivtools/README diff -c top_ivtools/README:1.5 top_ivtools/README:1.6 *** top_ivtools/README:1.5 Tue Jun 13 02:02:23 2000 --- ./README Wed Aug 23 00:34:51 2000 *************** *** 2,8 **** README for ivtools 0.8 ! This directory contains a release of ivtools 0.8.3 from Vectaport Inc.. You should read the rest of this file for information on what ivtools is and the INSTALL file for instructions on how to build it. --- 2,8 ---- README for ivtools 0.8 ! This directory contains a release of ivtools 0.8.4 from Vectaport Inc.. You should read the rest of this file for information on what ivtools is and the INSTALL file for instructions on how to build it. Index: top_ivtools/VERSION diff -c top_ivtools/VERSION:1.4 top_ivtools/VERSION:1.5 *** top_ivtools/VERSION:1.4 Tue Jun 13 02:02:23 2000 --- ./VERSION Wed Aug 23 00:34:51 2000 *************** *** 1 **** ! Release 0.8.3 --- 1 ---- ! Release 0.8.4 Index: ComUnidraw/unifunc.c diff -c ComUnidraw/unifunc.c:1.10 ComUnidraw/unifunc.c:1.11 *** ComUnidraw/unifunc.c:1.10 Tue Aug 22 23:54:01 2000 --- src/ComUnidraw/unifunc.c Wed Aug 23 00:35:11 2000 *************** *** 370,377 **** void AddToolButtonFunc::execute() { ComValue pathnamev(stack_arg(0)); - static int popen_symid = symbol_add("popen"); - boolean popen_flag = stack_key(popen_symid).is_true(); reset_stack(); OverlayEditor* ed = (OverlayEditor*)GetEditor(); OverlayComp* comp = ed->overlay_kit()->add_tool_button(pathnamev.symbol_ptr()); --- 370,375 ---- Index: ComUnidraw/unifunc.h diff -c ComUnidraw/unifunc.h:1.7 ComUnidraw/unifunc.h:1.8 *** ComUnidraw/unifunc.h:1.7 Tue Aug 22 23:54:01 2000 --- src/ComUnidraw/unifunc.h Wed Aug 23 00:35:11 2000 *************** *** 154,166 **** }; //: command to add button to custom toolbar ! // compview=addtool(pathname :popen) -- add button to toolbar based on zero-centered idraw drawing. class AddToolButtonFunc : public UnidrawFunc { public: AddToolButtonFunc(ComTerp*,Editor*); virtual void execute(); virtual const char* docstring() { ! return "compview=%s(pathname :popen) -- add button to toolbar based on zero-centered idraw drawing."; } }; --- 154,166 ---- }; //: command to add button to custom toolbar ! // compview=addtool(pathname) -- add button to toolbar based on zero-centered idraw drawing. class AddToolButtonFunc : public UnidrawFunc { public: AddToolButtonFunc(ComTerp*,Editor*); virtual void execute(); virtual const char* docstring() { ! return "compview=%s(pathname) -- add button to toolbar based on zero-centered idraw drawing."; } }; Index: comdraw/README diff -c comdraw/README:1.12 comdraw/README:1.13 *** comdraw/README:1.12 Tue Aug 22 23:54:02 2000 --- src/comdraw/README Wed Aug 23 00:35:12 2000 *************** *** 85,91 **** compview=import(pathstr :popen) -- import graphic file from pathname or URL, or from a command if :popen compview=paste(compview [xscale yscale xoff yoff | a00,a01,a10,a11,a20,a21]) -- paste graphic into the viewer val=pastemode([val] :get) -- toggle or set paste mode, default is 0, always paste new graphics ! compview=addtool(pathname :popen) -- add button to toolbar based on zero-centered idraw drawing. ncols() -- onscreen horizontal extent in pixels nrows() -- onscreen vertical extent in pixels --- 85,91 ---- compview=import(pathstr :popen) -- import graphic file from pathname or URL, or from a command if :popen compview=paste(compview [xscale yscale xoff yoff | a00,a01,a10,a11,a20,a21]) -- paste graphic into the viewer val=pastemode([val] :get) -- toggle or set paste mode, default is 0, always paste new graphics ! compview=addtool(pathname) -- add button to toolbar based on zero-centered idraw drawing. ncols() -- onscreen horizontal extent in pixels nrows() -- onscreen vertical extent in pixels Index: include_std/version.h diff -c include_std/version.h:1.5 include_std/version.h:1.6 *** include_std/version.h:1.5 Tue Jun 13 02:02:56 2000 --- src/include/ivstd/version.h Wed Aug 23 00:35:21 2000 *************** *** 1,3 **** ! #define IvtoolsVersion 0.8.3 ! #define VersionString "0.8.3" ! #define ReleaseString "ivtools-0.8.3" --- 1,3 ---- ! #define IvtoolsVersion 0.8.4 ! #define VersionString "0.8.4" ! #define ReleaseString "ivtools-0.8.4" Index: config_ivtools/params.def diff -c config_ivtools/params.def:1.5 config_ivtools/params.def:1.6 *** config_ivtools/params.def:1.5 Sat Aug 5 02:38:23 2000 --- config/params.def Wed Aug 23 00:35:27 2000 *************** *** 36,42 **** * VersionNumber */ #ifndef Version ! #define Version 0.8.3 #endif VERSION = Version --- 36,42 ---- * VersionNumber */ #ifndef Version ! #define Version 0.8.4 #endif VERSION = Version *** /dev/null Wed Aug 23 00:35:30 PDT 2000 --- patches/ivtools-000823-johnston-092 *************** patches/ivtools-000823-johnston-092 *** 0 **** --- 1 ---- + ivtools-000823-johnston-092 |
From: <ivt...@li...> - 2000-08-22 18:20:07
|
Patch: ivtools-000822-johnston-091 For: ivtools-0.8.3 Author: joh...@us... Subject: addtool command for comdraw takes idraw-format buttons URL: http://www.ivtools.org/pub/src/patches/ivtools-000822-johnston-091 This is an intermediate patch to ivtools-0.8.3. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - new addtool command in comdraw takes the pathname of an idraw drawn (or drawtool, etc. exported) picture and makes it a button in the alternate toolbar. compview=addtool(pathname) -- add button to toolbar based on zero-centered idraw drawing. The idraw graphics need to be zero-centered, which can be done in comdraw like this: g=at(select) /* gets the first graphic in the selection */ move(-at(center(g) -at(center(g) 1))) /* zero-centers */ followed by ^X (File/Export) with idraw format checked. Index: OverlayUnidraw/oved.h diff -c OverlayUnidraw/oved.h:1.3 OverlayUnidraw/oved.h:1.4 *** OverlayUnidraw/oved.h:1.3 Tue Mar 14 23:18:59 2000 --- src/OverlayUnidraw/oved.h Tue Aug 22 23:53:55 2000 *************** *** 172,177 **** --- 172,180 ---- void UpdateText(OverlayComp*, boolean update =true); // update contents of text-editor with frame annotation. + OverlayKit* overlay_kit() { return _overlay_kit; } + // return pointer to paired OverlayKit + protected: void Init(OverlayComp* = nil, const char* = "OverlayEditor"); // construct empty component tree if necessary, and pass to Index: OverlayUnidraw/ovkit.c diff -c OverlayUnidraw/ovkit.c:1.7 OverlayUnidraw/ovkit.c:1.8 *** OverlayUnidraw/ovkit.c:1.7 Fri Jul 28 01:21:04 2000 --- src/OverlayUnidraw/ovkit.c Tue Aug 22 23:53:55 2000 *************** *** 1430,1436 **** void OverlayKit::add_custom_tool() { static OpenFileChooser* chooser = nil; Editor* ed = GetEditor(); - LayoutKit& layout = *LayoutKit::instance(); Style* style = new Style(Session::instance()->style()); if (!chooser) { style->attribute("subcaption", "Open Idraw Icon For Tool Button:"); --- 1430,1435 ---- *************** *** 1463,1480 **** if (reset_caption) { style->attribute("caption", " "); } _toolbars->flip_to(1); ! Glyph* newbutton = name&&comp ? IdrawReader::load(name) : nil; if (newbutton) { _toolbar_vbox[1]->append(MakeTool(new GraphicCompTool(new ControlInfo(comp, "", ""), comp), layout.overlay(layout.hcenter(layout.hspace(_maxwidth)), layout.hcenter(newbutton)), _tg, _ed->MouseDocObservable(), mouse_custom)); ! } else delete comp; _ed->GetKeyMap()->Execute(CODE_SELECT); _toolbar->redraw(); } MenuItem * OverlayKit::MakeViewersMenu() { --- 1462,1490 ---- if (reset_caption) { style->attribute("caption", " "); } + add_tool_button(name, (OverlayComp*)comp); + } + OverlayComp* OverlayKit::add_tool_button(const char* path, OverlayComp* comp) { + LayoutKit& layout = *LayoutKit::instance(); + if (!comp) { + IdrawCatalog* catalog = (IdrawCatalog*)unidraw->GetCatalog(); + catalog->IdrawCatalog::Retrieve(path, (Component*&)comp); + } _toolbars->flip_to(1); ! Glyph* newbutton = path&&comp ? IdrawReader::load(path) : nil; if (newbutton) { _toolbar_vbox[1]->append(MakeTool(new GraphicCompTool(new ControlInfo(comp, "", ""), comp), layout.overlay(layout.hcenter(layout.hspace(_maxwidth)), layout.hcenter(newbutton)), _tg, _ed->MouseDocObservable(), mouse_custom)); ! } else { delete comp; + comp = nil; + } _ed->GetKeyMap()->Execute(CODE_SELECT); _toolbar->redraw(); + return comp; } MenuItem * OverlayKit::MakeViewersMenu() { Index: OverlayUnidraw/ovkit.h diff -c OverlayUnidraw/ovkit.h:1.4 OverlayUnidraw/ovkit.h:1.5 *** OverlayUnidraw/ovkit.h:1.4 Fri Jul 28 01:21:04 2000 --- src/OverlayUnidraw/ovkit.h Tue Aug 22 23:53:55 2000 *************** *** 187,192 **** --- 187,195 ---- // flag to add setr button to text editor boolean& clr_button_flag() { return _clr_button_flag; } // flag to add clear button to text editor + + OverlayComp* add_tool_button(const char* path, OverlayComp* comp=nil); + // low-level routine used by ::add_custom_tool and others protected: Glyph* MenuLine(PSBrush*); // create line to put in a pulldown menu. Index: ComUnidraw/comeditor.c diff -c ComUnidraw/comeditor.c:1.13 ComUnidraw/comeditor.c:1.14 *** ComUnidraw/comeditor.c:1.13 Tue Jul 25 02:23:57 2000 --- src/ComUnidraw/comeditor.c Tue Aug 22 23:54:00 2000 *************** *** 201,206 **** --- 201,207 ---- comterp->add_command("paste", new PasteFunc(comterp, this)); comterp->add_command("pastemode", new PasteModeFunc(comterp, this)); + comterp->add_command("addtool", new AddToolButtonFunc(comterp, this)); } /* virtual */ void ComEditor::ExecuteCmd(Command* cmd) { Index: ComUnidraw/unifunc.c diff -c ComUnidraw/unifunc.c:1.9 ComUnidraw/unifunc.c:1.10 *** ComUnidraw/unifunc.c:1.9 Tue Jul 25 02:23:57 2000 --- src/ComUnidraw/unifunc.c Tue Aug 22 23:54:01 2000 *************** *** 363,365 **** --- 363,382 ---- } } + /*****************************************************************************/ + + AddToolButtonFunc::AddToolButtonFunc(ComTerp* comterp, Editor* ed) : UnidrawFunc(comterp, ed) { + } + + void AddToolButtonFunc::execute() { + ComValue pathnamev(stack_arg(0)); + static int popen_symid = symbol_add("popen"); + boolean popen_flag = stack_key(popen_symid).is_true(); + reset_stack(); + OverlayEditor* ed = (OverlayEditor*)GetEditor(); + OverlayComp* comp = ed->overlay_kit()->add_tool_button(pathnamev.symbol_ptr()); + ComValue retval(comp->classid(), new ComponentView(comp)); + retval.object_compview(true); + push_stack(retval); + } + Index: ComUnidraw/unifunc.h diff -c ComUnidraw/unifunc.h:1.6 ComUnidraw/unifunc.h:1.7 *** ComUnidraw/unifunc.h:1.6 Tue Jul 25 02:23:57 2000 --- src/ComUnidraw/unifunc.h Tue Aug 22 23:54:01 2000 *************** *** 153,157 **** --- 153,168 ---- }; + //: command to add button to custom toolbar + // compview=addtool(pathname :popen) -- add button to toolbar based on zero-centered idraw drawing. + class AddToolButtonFunc : public UnidrawFunc { + public: + AddToolButtonFunc(ComTerp*,Editor*); + virtual void execute(); + virtual const char* docstring() { + return "compview=%s(pathname :popen) -- add button to toolbar based on zero-centered idraw drawing."; } + + }; + #endif /* !defined(_unifunc_h) */ Index: comdraw/README diff -c comdraw/README:1.11 comdraw/README:1.12 *** comdraw/README:1.11 Tue Jul 25 02:23:59 2000 --- src/comdraw/README Tue Aug 22 23:54:02 2000 *************** *** 85,90 **** --- 85,91 ---- compview=import(pathstr :popen) -- import graphic file from pathname or URL, or from a command if :popen compview=paste(compview [xscale yscale xoff yoff | a00,a01,a10,a11,a20,a21]) -- paste graphic into the viewer val=pastemode([val] :get) -- toggle or set paste mode, default is 0, always paste new graphics + compview=addtool(pathname :popen) -- add button to toolbar based on zero-centered idraw drawing. ncols() -- onscreen horizontal extent in pixels nrows() -- onscreen vertical extent in pixels *** /dev/null Tue Aug 22 23:54:21 PDT 2000 --- patches/ivtools-000822-johnston-091 *************** patches/ivtools-000822-johnston-091 *** 0 **** --- 1 ---- + ivtools-000822-johnston-091 |
From: <ivt...@li...> - 2000-08-21 23:16:06
|
Patch: ivtools-000822-johnston-090 For: ivtools-0.8.3 Author: joh...@us... Subject: back out last patch that experimented with comterp step/pause commands Requires: This is an intermediate patch to ivtools-0.8.3. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - back out last patch that experimented with comterp step/pause commands. Index: ComTerp/comfunc.c diff -c ComTerp/comfunc.c:1.7 ComTerp/comfunc.c:1.8 *** ComTerp/comfunc.c:1.7 Tue Aug 22 03:01:07 2000 --- src/ComTerp/comfunc.c Tue Aug 22 05:32:56 2000 *************** *** 25,31 **** #include <ComTerp/comfunc.h> #include <ComTerp/comterp.h> #include <ComTerp/comvalue.h> - #include <ComUtil/comutil.h> #include <Attribute/attrlist.h> #include <string.h> --- 25,30 ---- *************** *** 418,432 **** return al; } - ComTerpServ* ComFunc::comterpserv() { - return _comterp && _comterp->is_serv() ? (ComTerpServ*)_comterp : nil; - } - - ostream& operator<< (ostream& out, const ComFunc& cf) { - out << symbol_pntr(cf.funcid()); - return out; - } - /*****************************************************************************/ ComFuncState::ComFuncState(int narg, int nkey, int pedepth, --- 417,422 ---- *************** *** 443,453 **** ComFuncState::ComFuncState(ComFuncState& cfs) { *this = cfs; } - - ostream& operator<< (ostream& out, const ComFuncState& cf) { - out << "nargs = " << cf._nargs; - out << ";nkeys = " << cf._nkeys; - return out; - } - --- 433,436 ---- Index: ComTerp/comfunc.h diff -c ComTerp/comfunc.h:1.4 ComTerp/comfunc.h:1.5 *** ComTerp/comfunc.h:1.4 Tue Aug 22 03:01:07 2000 --- src/ComTerp/comfunc.h Tue Aug 22 05:32:56 2000 *************** *** 95,105 **** ComTerp* comterp() { return _comterp; } // return ComTerp this ComFunc is associated with. ! ComTerpServ* comterpserv(); // return ComTerpServ this ComFunc is associated with. ! ComValue& pop_stack(); // pop top off the stack. ComValue& pop_symbol(); // pop top off the stack preserving symbol ids if ComValue is a symbol type. --- 95,105 ---- ComTerp* comterp() { return _comterp; } // return ComTerp this ComFunc is associated with. ! ComTerpServ* comterpserv() { return (ComTerpServ*)_comterp; } // return ComTerpServ this ComFunc is associated with. ! ComValue& pop_stack(); // pop top off the stack. ComValue& pop_symbol(); // pop top off the stack preserving symbol ids if ComValue is a symbol type. *************** *** 153,159 **** void funcid(int id) { _funcid = id; } // set symbol id of name for func ! int funcid() const { return _funcid; } // get symbol id of name for func ComValue& lookup_symval(ComValue&); --- 153,159 ---- void funcid(int id) { _funcid = id; } // set symbol id of name for func ! int funcid() { return _funcid; } // get symbol id of name for func ComValue& lookup_symval(ComValue&); *************** *** 167,175 **** static int bintest(const char* name); static boolean bincheck(const char* name); - friend ostream& operator << (ostream& s, const ComFunc&); - // print contents to ostream, brief or not depending on - // associated ComTerp brief flag. protected: --- 167,172 ---- *************** *** 243,252 **** // within blocks of conditionally executing control commands. int& command_symid() { return _command_symid; } // symbol id associated with the ComFunc. - - friend ostream& operator << (ostream& s, const ComFuncState&); - // print contents to ostream, brief or not depending on - // associated ComTerp brief flag. protected: --- 240,245 ---- Index: ComTerp/comterp.c diff -c ComTerp/comterp.c:1.24 ComTerp/comterp.c:1.25 *** ComTerp/comterp.c:1.24 Tue Aug 22 03:01:07 2000 --- src/ComTerp/comterp.c Tue Aug 22 05:32:56 2000 *************** *** 30,36 **** #include <ComTerp/comfunc.h> #include <ComTerp/comhandler.h> #include <ComTerp/comterp.h> - #include <ComTerp/comterpserv.h> #include <ComTerp/comvalue.h> #include <ComTerp/condfunc.h> #include <ComTerp/ctrlfunc.h> --- 30,35 ---- *************** *** 129,136 **** _val_for_next_func = nil; _func_for_next_expr = nil; _trace_mode = 0; - _npause = 0; - _stepflag = 0; } --- 128,133 ---- *************** *** 212,227 **** } void ComTerp::eval_expr_internals(int pedepth) { - static int step_symid = symbol_add("step"); - static ComFunc* stepfunc = nil; - if (!stepfunc) - stepfunc = new ComterpStepFunc(this); - ComValue sv = pop_stack(false); if (sv.type() == ComValue::CommandType) { - ComFunc* func = nil; if (_func_for_next_expr) { func = _func_for_next_expr; --- 209,218 ---- *************** *** 253,274 **** } } - if (stepflag()) { - filebuf fbufout; - fbufout.attach(handler() ? max(1, handler()->get_handle()) : fileno(stdout)); - ostream out(&fbufout); - out << *func << "(" << *func->funcstate() << ")\n"; - static int pause_symid = symbol_add("pause"); - ComValue pausekey(pause_symid, 0, ComValue::KeywordType); - push_stack(pausekey); - stepfunc->push_funcstate(0,1, pedepth, step_symid); - stepfunc->execute(); - stepfunc->pop_funcstate(); - } - func->execute(); - func->pop_funcstate(); if (_just_reset && !_func_for_next_expr) { push_stack(ComValue::blankval()); _just_reset = false; --- 244,252 ---- } } func->execute(); + func->pop_funcstate(); if (_just_reset && !_func_for_next_expr) { push_stack(ComValue::blankval()); _just_reset = false; *************** *** 930,938 **** add_command("run", new RunFunc(this)); add_command("help", new HelpFunc(this)); ! add_command("trace", new ComterpTraceFunc(this)); ! add_command("pause", new ComterpPauseFunc(this)); ! add_command("step", new ComterpStepFunc(this)); add_command("symid", new SymIdFunc(this)); add_command("symval", new SymValFunc(this)); add_command("symbol", new SymbolFunc(this)); --- 908,914 ---- add_command("run", new RunFunc(this)); add_command("help", new HelpFunc(this)); ! add_command("trace", new TraceFunc(this)); add_command("symid", new SymIdFunc(this)); add_command("symval", new SymValFunc(this)); add_command("symbol", new SymbolFunc(this)); Index: ComTerp/comterp.h diff -c ComTerp/comterp.h:1.12 ComTerp/comterp.h:1.13 *** ComTerp/comterp.h:1.12 Tue Aug 22 03:01:07 2000 --- src/ComTerp/comterp.h Tue Aug 22 05:32:56 2000 *************** *** 232,243 **** int trace_mode() { return _trace_mode; } // return trace mode - int& npause() { return _npause; } - // return (reference to) number of pauses - - int& stepflag() { return _stepflag; } - // return flag that controls stepwise execution - protected: void incr_stack(); void incr_stack(int n); --- 232,237 ---- *************** *** 301,312 **** int _trace_mode; // trace mode - - int _npause; - // depth of pause - - int _stepflag; - // true if single-stepping interpreter friend class ComFunc; friend class ComterpHandler; --- 295,300 ---- Index: ComTerp/comterpserv.c diff -c ComTerp/comterpserv.c:1.7 ComTerp/comterpserv.c:1.8 *** ComTerp/comterpserv.c:1.7 Tue Aug 22 03:01:07 2000 --- src/ComTerp/comterpserv.c Tue Aug 22 05:32:56 2000 *************** *** 60,65 **** --- 60,67 ---- /* inform the parser which infunc is the oneshot infunc */ _oneshot_infunc = (infuncptr)&s_fgets; + _npause = 0; + _logger_mode = 0; } Index: ComTerp/comterpserv.h diff -c ComTerp/comterpserv.h:1.6 ComTerp/comterpserv.h:1.7 *** ComTerp/comterpserv.h:1.6 Tue Aug 22 03:01:07 2000 --- src/ComTerp/comterpserv.h Tue Aug 22 05:32:56 2000 *************** *** 69,74 **** --- 69,77 ---- virtual boolean is_serv() { return true; } // flag to test if ComTerp or ComTerpServ + int& npause() { return _npause; } + // return (reference to) number of pauses + protected: static char* s_fgets(char* s, int n, void* serv); *************** *** 92,97 **** --- 95,101 ---- int _fd; FILE* _fptr; int _instat; + int _npause; int _logger_mode; friend class ComterpHandler; Index: ComTerp/debugfunc.c diff -c ComTerp/debugfunc.c:1.2 ComTerp/debugfunc.c:1.3 *** ComTerp/debugfunc.c:1.2 Tue Aug 22 03:01:07 2000 --- src/ComTerp/debugfunc.c Tue Aug 22 05:32:56 2000 *************** *** 21,40 **** * */ - #include <ComTerp/comhandler.h> #include <ComTerp/debugfunc.h> ! #include <ComTerp/comterpserv.h> ! #include <strstream.h> ! #include <vector.h> #define TITLE "DebugFunc" /*****************************************************************************/ ! ComterpTraceFunc::ComterpTraceFunc(ComTerp* comterp) : ComFunc(comterp) { } ! void ComterpTraceFunc::execute() { static int get_symid = symbol_add("get"); boolean get_flag = stack_key(get_symid).is_true(); if (get_flag) { --- 21,37 ---- * */ #include <ComTerp/debugfunc.h> ! #include <ComTerp/comterp.h> #define TITLE "DebugFunc" /*****************************************************************************/ ! TraceFunc::TraceFunc(ComTerp* comterp) : ComFunc(comterp) { } ! void TraceFunc::execute() { static int get_symid = symbol_add("get"); boolean get_flag = stack_key(get_symid).is_true(); if (get_flag) { *************** *** 57,147 **** } } } - - /*****************************************************************************/ - - ComterpPauseFunc::ComterpPauseFunc(ComTerp* comterp) : ComFunc(comterp) { - } - - void ComterpPauseFunc::execute_body(ComValue& msgstrv) { - - comterp()->npause()++; - - if (msgstrv.is_string()) - cerr << msgstrv.string_ptr() << "\n"; - ostrstream sbuf_s; - sbuf_s << (stepfunc() ? "step(" : "pause(") << comterp()->npause() << "): enter command or press C/R to continue\n"; - sbuf_s.put('\0'); - cerr << sbuf_s.str(); - comterp()->push_servstate(); - filebuf fbufin; - if (comterp()->handler()) { - int fd = max(0, comterp()->handler()->get_handle()); - fbufin.attach(fd); - } else - fbufin.attach(fileno(stdin)); - istream in(&fbufin); - filebuf fbufout; - if (comterp()->handler()) { - int fd = max(1, comterp()->handler()->get_handle()); - fbufout.attach(fd); - } else - fbufout.attach(fileno(stdout)); - ostream out(&fbufout); - vector<char> cvect; - ComValue retval; - do { - char ch; - cvect.clear(); - /* need to handle embedded newlines differently */ - do { - ch = in.get(); - cvect.push_back(ch); - } while (in.good() && ch != '\n'); - if (cvect[0] != '\n') { - if (comterpserv()) { - retval.assignval(comterpserv()->run(&cvect[0])); - out << retval << "\n"; - } else { - cerr << "execution of commands during step requires comterp in server or remote mode\n"; - } - } - } while (cvect[0] != '\n'); - comterp()->pop_servstate(); - ostrstream sbuf_e; - sbuf_e << (stepfunc() ? "end of step(" : "end of pause(") << comterp()->npause()-- << ")\n"; - sbuf_e.put('\0'); - cerr << sbuf_e.str(); - push_stack(retval); - } - - void ComterpPauseFunc::execute() { - ComValue msgstrv(stack_arg(0)); - reset_stack(); - execute_body(msgstrv); - } - - - /*****************************************************************************/ - - ComterpStepFunc::ComterpStepFunc(ComTerp* comterp) : ComterpPauseFunc(comterp) { - } - - void ComterpStepFunc::execute() { - ComValue msgstrv(stack_arg(0)); - static int pause_symid = symbol_add("pause"); - ComValue pausekey(stack_key(pause_symid)); - reset_stack(); - if (pausekey.is_true()) { - execute_body(msgstrv); - } else { - comterp()->stepflag() = !comterp()->stepflag(); - ComValue retval(comterp()->stepflag()); - push_stack(retval); - } - } - - - - --- 54,57 ---- Index: ComTerp/debugfunc.h diff -c ComTerp/debugfunc.h:1.3 ComTerp/debugfunc.h:1.4 *** ComTerp/debugfunc.h:1.3 Tue Aug 22 03:01:07 2000 --- src/ComTerp/debugfunc.h Tue Aug 22 05:32:56 2000 *************** *** 1,5 **** /* ! * Copyright (c) 2000 Vectaport Inc, IET Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided --- 1,5 ---- /* ! * Copyright (c) 2000 IET Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided *************** *** 35,71 **** //: command for toggling or setting trace mode // val=trace([flag] :val) -- toggle or set trace mode ! class ComterpTraceFunc : public ComFunc { public: ! ComterpTraceFunc(ComTerp*); virtual void execute(); virtual const char* docstring() { return "val=%s([flag] :val) -- toggle or set trace mode"; } - }; - - //: command to pause script execution until C/R - // pause -- pause script execution until C/R - class ComterpPauseFunc : public ComFunc { - public: - ComterpPauseFunc(ComTerp*); - virtual void execute(); - virtual void execute_body(ComValue&); - virtual const char* docstring() { - return "%s -- pause script execution until C/R"; } - virtual boolean stepfunc() { return false; } - - }; - - //: command to toggle step script execution - // pause -- toggle stepwise script execution - class ComterpStepFunc : public ComterpPauseFunc { - public: - ComterpStepFunc(ComTerp*); - virtual void execute(); - virtual const char* docstring() { - return "%s -- toggle stepwise script execution"; } - virtual boolean stepfunc() { return true; } }; #endif /* !defined(_debugfunc_h) */ --- 35,47 ---- //: command for toggling or setting trace mode // val=trace([flag] :val) -- toggle or set trace mode ! class TraceFunc : public ComFunc { public: ! TraceFunc(ComTerp*); virtual void execute(); virtual const char* docstring() { return "val=%s([flag] :val) -- toggle or set trace mode"; } }; #endif /* !defined(_debugfunc_h) */ *** /dev/null Tue Aug 22 05:33:39 PDT 2000 --- patches/ivtools-000822-johnston-090 *************** patches/ivtools-000822-johnston-090 *** 0 **** --- 1 ---- + ivtools-000822-johnston-090 |
From: <ivt...@li...> - 2000-08-21 23:15:33
|
Patch: ivtools-000822-johnston-089 For: ivtools-0.8.3 Author: joh...@us... Subject: experimentation with comterp pause and step commands Requires: This is an intermediate patch to ivtools-0.8.3. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - experimentation with comterp pause and step commands. Index: ComTerp/comfunc.c diff -c ComTerp/comfunc.c:1.6 ComTerp/comfunc.c:1.7 *** ComTerp/comfunc.c:1.6 Fri Jul 21 01:15:11 2000 --- src/ComTerp/comfunc.c Tue Aug 22 03:01:07 2000 *************** *** 25,30 **** --- 25,31 ---- #include <ComTerp/comfunc.h> #include <ComTerp/comterp.h> #include <ComTerp/comvalue.h> + #include <ComUtil/comutil.h> #include <Attribute/attrlist.h> #include <string.h> *************** *** 417,422 **** --- 418,432 ---- return al; } + ComTerpServ* ComFunc::comterpserv() { + return _comterp && _comterp->is_serv() ? (ComTerpServ*)_comterp : nil; + } + + ostream& operator<< (ostream& out, const ComFunc& cf) { + out << symbol_pntr(cf.funcid()); + return out; + } + /*****************************************************************************/ ComFuncState::ComFuncState(int narg, int nkey, int pedepth, *************** *** 433,436 **** --- 443,453 ---- ComFuncState::ComFuncState(ComFuncState& cfs) { *this = cfs; } + + ostream& operator<< (ostream& out, const ComFuncState& cf) { + out << "nargs = " << cf._nargs; + out << ";nkeys = " << cf._nkeys; + return out; + } + Index: ComTerp/comfunc.h diff -c ComTerp/comfunc.h:1.3 ComTerp/comfunc.h:1.4 *** ComTerp/comfunc.h:1.3 Fri Mar 24 23:15:20 2000 --- src/ComTerp/comfunc.h Tue Aug 22 03:01:07 2000 *************** *** 95,105 **** ComTerp* comterp() { return _comterp; } // return ComTerp this ComFunc is associated with. ! ComTerpServ* comterpserv() { return (ComTerpServ*)_comterp; } // return ComTerpServ this ComFunc is associated with. ! ComValue& pop_stack(); // pop top off the stack. ComValue& pop_symbol(); // pop top off the stack preserving symbol ids if ComValue is a symbol type. --- 95,105 ---- ComTerp* comterp() { return _comterp; } // return ComTerp this ComFunc is associated with. ! ComTerpServ* comterpserv(); // return ComTerpServ this ComFunc is associated with. ! ComValue& pop_stack(); // pop top off the stack. ComValue& pop_symbol(); // pop top off the stack preserving symbol ids if ComValue is a symbol type. *************** *** 153,159 **** void funcid(int id) { _funcid = id; } // set symbol id of name for func ! int funcid() { return _funcid; } // get symbol id of name for func ComValue& lookup_symval(ComValue&); --- 153,159 ---- void funcid(int id) { _funcid = id; } // set symbol id of name for func ! int funcid() const { return _funcid; } // get symbol id of name for func ComValue& lookup_symval(ComValue&); *************** *** 167,172 **** --- 167,175 ---- static int bintest(const char* name); static boolean bincheck(const char* name); + friend ostream& operator << (ostream& s, const ComFunc&); + // print contents to ostream, brief or not depending on + // associated ComTerp brief flag. protected: *************** *** 240,245 **** --- 243,252 ---- // within blocks of conditionally executing control commands. int& command_symid() { return _command_symid; } // symbol id associated with the ComFunc. + + friend ostream& operator << (ostream& s, const ComFuncState&); + // print contents to ostream, brief or not depending on + // associated ComTerp brief flag. protected: Index: ComTerp/comterp.c diff -c ComTerp/comterp.c:1.23 ComTerp/comterp.c:1.24 *** ComTerp/comterp.c:1.23 Sun Jul 23 00:19:36 2000 --- src/ComTerp/comterp.c Tue Aug 22 03:01:07 2000 *************** *** 30,35 **** --- 30,36 ---- #include <ComTerp/comfunc.h> #include <ComTerp/comhandler.h> #include <ComTerp/comterp.h> + #include <ComTerp/comterpserv.h> #include <ComTerp/comvalue.h> #include <ComTerp/condfunc.h> #include <ComTerp/ctrlfunc.h> *************** *** 128,133 **** --- 129,136 ---- _val_for_next_func = nil; _func_for_next_expr = nil; _trace_mode = 0; + _npause = 0; + _stepflag = 0; } *************** *** 209,218 **** --- 212,227 ---- } void ComTerp::eval_expr_internals(int pedepth) { + static int step_symid = symbol_add("step"); + static ComFunc* stepfunc = nil; + if (!stepfunc) + stepfunc = new ComterpStepFunc(this); + ComValue sv = pop_stack(false); if (sv.type() == ComValue::CommandType) { + ComFunc* func = nil; if (_func_for_next_expr) { func = _func_for_next_expr; *************** *** 244,252 **** } } ! func->execute(); func->pop_funcstate(); if (_just_reset && !_func_for_next_expr) { push_stack(ComValue::blankval()); _just_reset = false; --- 253,274 ---- } } ! if (stepflag()) { ! filebuf fbufout; ! fbufout.attach(handler() ? max(1, handler()->get_handle()) : fileno(stdout)); ! ostream out(&fbufout); ! out << *func << "(" << *func->funcstate() << ")\n"; ! static int pause_symid = symbol_add("pause"); ! ComValue pausekey(pause_symid, 0, ComValue::KeywordType); ! push_stack(pausekey); ! stepfunc->push_funcstate(0,1, pedepth, step_symid); ! stepfunc->execute(); ! stepfunc->pop_funcstate(); ! } + func->execute(); func->pop_funcstate(); + if (_just_reset && !_func_for_next_expr) { push_stack(ComValue::blankval()); _just_reset = false; *************** *** 908,914 **** add_command("run", new RunFunc(this)); add_command("help", new HelpFunc(this)); ! add_command("trace", new TraceFunc(this)); add_command("symid", new SymIdFunc(this)); add_command("symval", new SymValFunc(this)); add_command("symbol", new SymbolFunc(this)); --- 930,938 ---- add_command("run", new RunFunc(this)); add_command("help", new HelpFunc(this)); ! add_command("trace", new ComterpTraceFunc(this)); ! add_command("pause", new ComterpPauseFunc(this)); ! add_command("step", new ComterpStepFunc(this)); add_command("symid", new SymIdFunc(this)); add_command("symval", new SymValFunc(this)); add_command("symbol", new SymbolFunc(this)); Index: ComTerp/comterp.h diff -c ComTerp/comterp.h:1.11 ComTerp/comterp.h:1.12 *** ComTerp/comterp.h:1.11 Thu Jul 20 03:27:13 2000 --- src/ComTerp/comterp.h Tue Aug 22 03:01:07 2000 *************** *** 232,237 **** --- 232,243 ---- int trace_mode() { return _trace_mode; } // return trace mode + int& npause() { return _npause; } + // return (reference to) number of pauses + + int& stepflag() { return _stepflag; } + // return flag that controls stepwise execution + protected: void incr_stack(); void incr_stack(int n); *************** *** 295,300 **** --- 301,312 ---- int _trace_mode; // trace mode + + int _npause; + // depth of pause + + int _stepflag; + // true if single-stepping interpreter friend class ComFunc; friend class ComterpHandler; Index: ComTerp/comterpserv.c diff -c ComTerp/comterpserv.c:1.6 ComTerp/comterpserv.c:1.7 *** ComTerp/comterpserv.c:1.6 Sat Jun 24 22:37:42 2000 --- src/ComTerp/comterpserv.c Tue Aug 22 03:01:07 2000 *************** *** 60,67 **** /* inform the parser which infunc is the oneshot infunc */ _oneshot_infunc = (infuncptr)&s_fgets; - _npause = 0; - _logger_mode = 0; } --- 60,65 ---- Index: ComTerp/comterpserv.h diff -c ComTerp/comterpserv.h:1.5 ComTerp/comterpserv.h:1.6 *** ComTerp/comterpserv.h:1.5 Tue Jun 20 04:31:39 2000 --- src/ComTerp/comterpserv.h Tue Aug 22 03:01:07 2000 *************** *** 69,77 **** virtual boolean is_serv() { return true; } // flag to test if ComTerp or ComTerpServ - int& npause() { return _npause; } - // return (reference to) number of pauses - protected: static char* s_fgets(char* s, int n, void* serv); --- 69,74 ---- *************** *** 95,101 **** int _fd; FILE* _fptr; int _instat; - int _npause; int _logger_mode; friend class ComterpHandler; --- 92,97 ---- Index: ComTerp/debugfunc.c diff -c ComTerp/debugfunc.c:1.1 ComTerp/debugfunc.c:1.2 *** ComTerp/debugfunc.c:1.1 Tue Jun 20 06:20:22 2000 --- src/ComTerp/debugfunc.c Tue Aug 22 03:01:07 2000 *************** *** 21,37 **** * */ #include <ComTerp/debugfunc.h> ! #include <ComTerp/comterp.h> #define TITLE "DebugFunc" /*****************************************************************************/ ! TraceFunc::TraceFunc(ComTerp* comterp) : ComFunc(comterp) { } ! void TraceFunc::execute() { static int get_symid = symbol_add("get"); boolean get_flag = stack_key(get_symid).is_true(); if (get_flag) { --- 21,40 ---- * */ + #include <ComTerp/comhandler.h> #include <ComTerp/debugfunc.h> ! #include <ComTerp/comterpserv.h> ! #include <strstream.h> ! #include <vector.h> #define TITLE "DebugFunc" /*****************************************************************************/ ! ComterpTraceFunc::ComterpTraceFunc(ComTerp* comterp) : ComFunc(comterp) { } ! void ComterpTraceFunc::execute() { static int get_symid = symbol_add("get"); boolean get_flag = stack_key(get_symid).is_true(); if (get_flag) { *************** *** 54,57 **** --- 57,147 ---- } } } + + /*****************************************************************************/ + + ComterpPauseFunc::ComterpPauseFunc(ComTerp* comterp) : ComFunc(comterp) { + } + + void ComterpPauseFunc::execute_body(ComValue& msgstrv) { + + comterp()->npause()++; + + if (msgstrv.is_string()) + cerr << msgstrv.string_ptr() << "\n"; + ostrstream sbuf_s; + sbuf_s << (stepfunc() ? "step(" : "pause(") << comterp()->npause() << "): enter command or press C/R to continue\n"; + sbuf_s.put('\0'); + cerr << sbuf_s.str(); + comterp()->push_servstate(); + filebuf fbufin; + if (comterp()->handler()) { + int fd = max(0, comterp()->handler()->get_handle()); + fbufin.attach(fd); + } else + fbufin.attach(fileno(stdin)); + istream in(&fbufin); + filebuf fbufout; + if (comterp()->handler()) { + int fd = max(1, comterp()->handler()->get_handle()); + fbufout.attach(fd); + } else + fbufout.attach(fileno(stdout)); + ostream out(&fbufout); + vector<char> cvect; + ComValue retval; + do { + char ch; + cvect.clear(); + /* need to handle embedded newlines differently */ + do { + ch = in.get(); + cvect.push_back(ch); + } while (in.good() && ch != '\n'); + if (cvect[0] != '\n') { + if (comterpserv()) { + retval.assignval(comterpserv()->run(&cvect[0])); + out << retval << "\n"; + } else { + cerr << "execution of commands during step requires comterp in server or remote mode\n"; + } + } + } while (cvect[0] != '\n'); + comterp()->pop_servstate(); + ostrstream sbuf_e; + sbuf_e << (stepfunc() ? "end of step(" : "end of pause(") << comterp()->npause()-- << ")\n"; + sbuf_e.put('\0'); + cerr << sbuf_e.str(); + push_stack(retval); + } + + void ComterpPauseFunc::execute() { + ComValue msgstrv(stack_arg(0)); + reset_stack(); + execute_body(msgstrv); + } + + + /*****************************************************************************/ + + ComterpStepFunc::ComterpStepFunc(ComTerp* comterp) : ComterpPauseFunc(comterp) { + } + + void ComterpStepFunc::execute() { + ComValue msgstrv(stack_arg(0)); + static int pause_symid = symbol_add("pause"); + ComValue pausekey(stack_key(pause_symid)); + reset_stack(); + if (pausekey.is_true()) { + execute_body(msgstrv); + } else { + comterp()->stepflag() = !comterp()->stepflag(); + ComValue retval(comterp()->stepflag()); + push_stack(retval); + } + } + + + + Index: ComTerp/debugfunc.h diff -c ComTerp/debugfunc.h:1.2 ComTerp/debugfunc.h:1.3 *** ComTerp/debugfunc.h:1.2 Tue Jul 25 02:23:24 2000 --- src/ComTerp/debugfunc.h Tue Aug 22 03:01:07 2000 *************** *** 1,5 **** /* ! * Copyright (c) 2000 IET Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided --- 1,5 ---- /* ! * Copyright (c) 2000 Vectaport Inc, IET Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided *************** *** 35,47 **** //: command for toggling or setting trace mode // val=trace([flag] :val) -- toggle or set trace mode ! class TraceFunc : public ComFunc { public: ! TraceFunc(ComTerp*); virtual void execute(); virtual const char* docstring() { return "val=%s([flag] :val) -- toggle or set trace mode"; } }; #endif /* !defined(_debugfunc_h) */ --- 35,71 ---- //: command for toggling or setting trace mode // val=trace([flag] :val) -- toggle or set trace mode ! class ComterpTraceFunc : public ComFunc { public: ! ComterpTraceFunc(ComTerp*); virtual void execute(); virtual const char* docstring() { return "val=%s([flag] :val) -- toggle or set trace mode"; } + }; + + //: command to pause script execution until C/R + // pause -- pause script execution until C/R + class ComterpPauseFunc : public ComFunc { + public: + ComterpPauseFunc(ComTerp*); + virtual void execute(); + virtual void execute_body(ComValue&); + virtual const char* docstring() { + return "%s -- pause script execution until C/R"; } + virtual boolean stepfunc() { return false; } + + }; + + //: command to toggle step script execution + // pause -- toggle stepwise script execution + class ComterpStepFunc : public ComterpPauseFunc { + public: + ComterpStepFunc(ComTerp*); + virtual void execute(); + virtual const char* docstring() { + return "%s -- toggle stepwise script execution"; } + virtual boolean stepfunc() { return true; } }; #endif /* !defined(_debugfunc_h) */ *** /dev/null Tue Aug 22 03:02:04 PDT 2000 --- patches/ivtools-000822-johnston-089 *************** patches/ivtools-000822-johnston-089 *** 0 **** --- 1 ---- + ivtools-000822-johnston-089 |
From: <ivt...@li...> - 2000-08-04 20:37:11
|
Patch: ivtools-000805-johnston-088 For: ivtools-0.8.3 Author: joh...@us... Subject: first attempt at setting up config files for FreeBSD Requires: This is an intermediate patch to ivtools-0.8.3. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile After applying this patch it will be necessary to remake the top-level makefile and test to see what symbol will be used to refer to the FreeBSD operating system: make Makefile make CPU The "make CPU" should print out FREEBSD if everything is working so far. After this succeeds, run the configure script and do a make, logging the results: ./configure >& configure.log make >>& make.log If everything works, congratulations. If there are problems, please forward the logs to johnston at vectaport dot com, and I will help resolve them. Good luck. Summary of Changes: - attempt to set up configuration files for a port of ivtools to FreeBSD, at the request of Wilhelm B. Kloke. Index: top_ivtools/MANIFEST diff -c top_ivtools/MANIFEST:1.15 top_ivtools/MANIFEST:1.16 *** top_ivtools/MANIFEST:1.15 Wed Jul 26 01:29:57 2000 --- ./MANIFEST Sat Aug 5 02:37:30 2000 *************** *** 33,38 **** --- 33,39 ---- ivtools-0.8/config/InterViews/iv-convex.cf ivtools-0.8/config/InterViews/iv-cray.cf ivtools-0.8/config/InterViews/iv-cygwin.cf + ivtools-0.8/config/InterViews/iv-freebsd.cf ivtools-0.8/config/InterViews/iv-generic.cf ivtools-0.8/config/InterViews/iv-hp.cf ivtools-0.8/config/InterViews/iv-ibm.cf *************** *** 63,68 **** --- 64,70 ---- ivtools-0.8/config/config.mk ivtools-0.8/config/config.null.mk ivtools-0.8/config/default-gcc.mk + ivtools-0.8/config/freebsd-gcc.mk ivtools-0.8/config/freebsd2.1-gcc.mk ivtools-0.8/config/gcc.def ivtools-0.8/config/hpux-gcc.mk *************** *** 80,85 **** --- 82,88 ---- ivtools-0.8/config/sco3.2.4-gcc.mk ivtools-0.8/config/site.def.ALPHA ivtools-0.8/config/site.def.CYGWIN + ivtools-0.8/config/site.def.FREEBSD ivtools-0.8/config/site.def.HP800 ivtools-0.8/config/site.def.LINUX ivtools-0.8/config/site.def.NETBSD Index: top_ivtools/configure diff -c top_ivtools/configure:1.3 top_ivtools/configure:1.4 *** top_ivtools/configure:1.3 Thu Mar 9 02:16:30 2000 --- ./configure Sat Aug 5 02:37:30 2000 *************** *** 563,568 **** --- 563,569 ---- case "$host" in *freebsd2.1.* ) platform_part=freebsd2.1 ;; + *freebsd* ) platform_part=freebsd ;; *hpux*10*20) platform_part=hpux10.20 ;; *hpux* ) platform_part=hpux ;; *netbsd* ) platform_part=netbsd ;; *************** *** 804,810 **** # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:837: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 805,811 ---- # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:838: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 835,841 **** echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:868: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. --- 836,842 ---- echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:869: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. *************** *** 845,855 **** cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext <<EOF ! #line 878 "configure" #include "confdefs.h" main(){return(0);} EOF ! if { (eval echo configure:882: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then --- 846,856 ---- cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext <<EOF ! #line 879 "configure" #include "confdefs.h" main(){return(0);} EOF ! if { (eval echo configure:883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then *************** *** 875,886 **** { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:908: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 ! echo "configure:913: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 876,887 ---- { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:909: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 ! echo "configure:914: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 889,895 **** yes; #endif EOF ! if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:922: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no --- 890,896 ---- yes; #endif EOF ! if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:923: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no *************** *** 904,910 **** ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 ! echo "configure:937: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 905,911 ---- ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 ! echo "configure:938: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 935,941 **** # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:968: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 936,942 ---- # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:969: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 964,970 **** # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:997: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 965,971 ---- # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:998: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 1012,1018 **** fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:1045: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. --- 1013,1019 ---- fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:1046: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. *************** *** 1022,1032 **** cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <<EOF ! #line 1055 "configure" #include "confdefs.h" main(){return(0);} EOF ! if { (eval echo configure:1059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then --- 1023,1033 ---- cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <<EOF ! #line 1056 "configure" #include "confdefs.h" main(){return(0);} EOF ! if { (eval echo configure:1060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then *************** *** 1046,1057 **** { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:1079: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 ! echo "configure:1084: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1047,1058 ---- { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:1080: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 ! echo "configure:1085: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 1060,1066 **** yes; #endif EOF ! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1093: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no --- 1061,1067 ---- yes; #endif EOF ! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1094: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no *************** *** 1075,1081 **** ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ! echo "configure:1108: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1076,1082 ---- ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ! echo "configure:1109: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 1104,1110 **** # check for CPP echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 ! echo "configure:1137: checking how to run the C++ preprocessor" >&5 if test -z "$CXXCPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1105,1111 ---- # check for CPP echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 ! echo "configure:1138: checking how to run the C++ preprocessor" >&5 if test -z "$CXXCPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1117,1128 **** cross_compiling=$ac_cv_prog_cxx_cross CXXCPP="${CXX-g++} -E" cat > conftest.$ac_ext <<EOF ! #line 1150 "configure" #include "confdefs.h" #include <stdlib.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1155: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : --- 1118,1129 ---- cross_compiling=$ac_cv_prog_cxx_cross CXXCPP="${CXX-g++} -E" cat > conftest.$ac_ext <<EOF ! #line 1151 "configure" #include "confdefs.h" #include <stdlib.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1156: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : *************** *** 1150,1156 **** # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1183: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1151,1157 ---- # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1184: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 1178,1184 **** # check for X paths echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ! echo "configure:1211: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= --- 1179,1185 ---- # check for X paths echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ! echo "configure:1212: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= *************** *** 1193,1205 **** # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF ! #line 1226 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1232: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : --- 1194,1206 ---- # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF ! #line 1227 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1233: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : *************** *** 1210,1222 **** rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF ! #line 1243 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1249: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : --- 1211,1223 ---- rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF ! #line 1244 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1250: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : *************** *** 1243,1249 **** # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 ! echo "configure:1276: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then --- 1244,1250 ---- # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 ! echo "configure:1277: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then *************** *** 1305,1316 **** # First, try using that file with no special directory specified. cat > conftest.$ac_ext <<EOF ! #line 1338 "configure" #include "confdefs.h" #include <$x_direct_test_include> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1343: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* --- 1306,1317 ---- # First, try using that file with no special directory specified. cat > conftest.$ac_ext <<EOF ! #line 1339 "configure" #include "confdefs.h" #include <$x_direct_test_include> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1344: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* *************** *** 1379,1392 **** ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <<EOF ! #line 1412 "configure" #include "confdefs.h" int main() { ${x_direct_test_function}() ; return 0; } EOF ! if { (eval echo configure:1419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. --- 1380,1393 ---- ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <<EOF ! #line 1413 "configure" #include "confdefs.h" int main() { ${x_direct_test_function}() ; return 0; } EOF ! if { (eval echo configure:1420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. *************** *** 1478,1484 **** #AC_CXX_HEADERS echo $ac_n "checking for directory to install c++ include files""... $ac_c" 1>&6 ! echo "configure:1511: checking for directory to install c++ include files" >&5 if eval "test \"`echo '$''{'ice_cv_cxx_include_dir'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1479,1485 ---- #AC_CXX_HEADERS echo $ac_n "checking for directory to install c++ include files""... $ac_c" 1>&6 ! echo "configure:1512: checking for directory to install c++ include files" >&5 if eval "test \"`echo '$''{'ice_cv_cxx_include_dir'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else Index: top_ivtools/configure.in diff -c top_ivtools/configure.in:1.3 top_ivtools/configure.in:1.4 *** top_ivtools/configure.in:1.3 Thu Mar 9 02:16:30 2000 --- ./configure.in Sat Aug 5 02:37:30 2000 *************** *** 8,13 **** --- 8,14 ---- case "$host" in *freebsd2.1.* ) platform_part=freebsd2.1 ;; + *freebsd* ) platform_part=freebsd ;; *hpux*10*20) platform_part=hpux10.20 ;; *hpux* ) platform_part=hpux ;; *netbsd* ) platform_part=netbsd ;; Index: config_ivtools/arch.def diff -c config_ivtools/arch.def:1.1 config_ivtools/arch.def:1.2 *** config_ivtools/arch.def:1.1 Tue Jan 18 03:14:40 2000 --- config/arch.def Sat Aug 5 02:38:21 2000 *************** *** 463,468 **** --- 463,479 ---- #define MacroFile InterViews/iv-netbsd.cf #endif /* __NetBSD__ */ + #if defined(__FreeBSD__) + #undef FREEBSD + #undef freebsd + #define FreeBSDArchitecture + #define ArchitectureName FREEBSD + #define architectureName freebsd + #define SiteDefCpu <site.def.FREEBSD> + #define MacroIncludeFile <InterViews/iv-freebsd.cf> + #define MacroFile InterViews/iv-freebsd.cf + #endif /* __FreeBSD__ */ + #ifndef ArchitectureName XCOMM WARNING: Imakefile not configured; guessing at definitions!!! XCOMM This might mean that BOOTSTRAPCFLAGS was not set when building imake. Index: config_ivtools/params.def diff -c config_ivtools/params.def:1.4 config_ivtools/params.def:1.5 *** config_ivtools/params.def:1.4 Tue Jun 13 02:03:02 2000 --- config/params.def Sat Aug 5 02:38:23 2000 *************** *** 49,55 **** #define RepositoryFiles *.c *.cc *.cxx *.C *.h Imakefile *.def template \ README INSTALL VERSION MANIFEST COPYRIGHT ANNOUNCE README.ivmkcm *.patch *.bugfix.? *.script \ *.sed comutil.arg comterp.err comutil.ci comterp.arg comterp.ci \ ! site.def.SUN4 site.def.LINUX site.def.SGI site.def.HP800 site.def.ALPHA site.def.CYGWIN site.def.NETBSD \ WishList *.defaults *.cf HOWTO Copyright *.sh CHANGES CHANGES-0.? *.cpp ivmkmf *.bash *.1 *.3 \ config.guess config.sub configure configure.in MANIFEST.perceps MANIFEST.comterp *.mk config.mk.in *.tmpl *.flt *.m4 config.defs.in #endif --- 49,55 ---- #define RepositoryFiles *.c *.cc *.cxx *.C *.h Imakefile *.def template \ README INSTALL VERSION MANIFEST COPYRIGHT ANNOUNCE README.ivmkcm *.patch *.bugfix.? *.script \ *.sed comutil.arg comterp.err comutil.ci comterp.arg comterp.ci \ ! site.def.SUN4 site.def.LINUX site.def.SGI site.def.HP800 site.def.ALPHA site.def.CYGWIN site.def.NETBSD site.def.FREEBSD \ WishList *.defaults *.cf HOWTO Copyright *.sh CHANGES CHANGES-0.? *.cpp ivmkmf *.bash *.1 *.3 \ config.guess config.sub configure configure.in MANIFEST.perceps MANIFEST.comterp *.mk config.mk.in *.tmpl *.flt *.m4 config.defs.in #endif Index: config_ivtools/site.def.FREEBSD diff -c /dev/null config_ivtools/site.def.FREEBSD:1.1 *** /dev/null Sat Aug 5 02:38:24 2000 --- config/site.def.FREEBSD Sat Aug 5 02:38:23 2000 *************** *** 0 **** --- 1,61 ---- + /* base directory for software projects */ + #define ProjectDir /proj + + /* gcc command line with -V for version and -O for optimize */ + #define CCDriver g++ + + #undef HasDynamicSharedLibraries + #define HasDynamicSharedLibraries YES + + #undef SharedCCFlags + #define SharedCCFlags -fPIC + + #undef SharedCCLdFlags + #define SharedCCLdFlags + + #undef TroffCmd + #define TroffCmd groff + + /* + * build RPC classes -- requires iostreams & TCP sockets + */ + #undef BuildRPCClasses + #define BuildRPCClasses YES + #define SOMAXCONN 5 + + /* override -ansi -pedantic from xfree86.cf */ + #undef DefaultCCOptions + #define DefaultCCOptions /**/ + + /* machine-specific gcc include directory -- does not change with each new version of gcc */ + #define ToolIncludeDir /usr/local/include + + /* link libraries for the above */ + #undef ExtraCCLdLibs + #define ExtraCCLdLibs -lstdc++ -lm + + /* command to create shared libraries */ + #define SharedLibraryCmd(ldobjs,extra_flags) gcc -shared extra_flags -o $@ ldobjs + + /* + * Install a shared library on NetBSD. + */ + #ifndef InstallDynamicSharedLibrary + #define InstallDynamicSharedLibrary(libname,rev,dest) @@\ + install:: Concat(lib,libname.so.rev) @@\ + MakeDir(dest) @@\ + $(INSTALL) -c $(INSTLIBFLAGS) Concat(lib,libname.so.rev) dest @@\ + -@$(RM) dest/Concat(lib,libname.so) @@\ + -@(cd dest;$(LN) Concat(lib,libname.so.rev) \ @@\ + Concat(lib,libname.so)) @@\ + @@\ + uninstall:: @@\ + $(RM) dest/Concat(lib,libname.so.rev) @@\ + $(RM) dest/Concat(lib,libname.so) + #endif + + /* file output by configure script */ + #include "config-freebsd-gcc.defs" + + + Index: config_iv/iv-freebsd.cf diff -c /dev/null config_iv/iv-freebsd.cf:1.1 *** /dev/null Sat Aug 5 02:38:26 2000 --- config/InterViews/iv-freebsd.cf Sat Aug 5 02:38:25 2000 *************** *** 0 **** --- 1,13 ---- + /* + * This is the FreeBSD configuration file for Interviews 3.1 + * Set up to use gcc in local.def + */ + + #define OptimizeCCFlags -O6 + #define TIFFOptimizeCFlags -O + + #ifndef ExtraCCLdFlags + #define ExtraCCLdFlags /**/ + #endif + + #include <InterViews/xparams.cf> *** /dev/null Sat Aug 5 02:38:29 PDT 2000 --- patches/ivtools-000805-johnston-088 *************** patches/ivtools-000805-johnston-088 *** 0 **** --- 1 ---- + ivtools-000805-johnston-088 |
From: <ivt...@li...> - 2000-07-27 21:12:46
|
Patch: ivtools-000728-johnston-087 For: ivtools-0.8.3 Author: joh...@us... Subject: add custom toolbar to drawtool, and menu-item to populate it with icons Requires: This is an intermediate patch to ivtools-0.8.3. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - add customizable toolbar to drawtool, that consists of everything but the Annotate and graphic drawing tools. You switch to this toolbar by using a new "Tools" menu in the top menu bar. Also in that new menu is an "Add Custom Tool" menu item, that brings up a filechooser and prompts you to enter the path of an idraw document to use as the prototype for the tool button and for the tool action. The reason it needs to be an idraw document is the tool button glyph construction relies on an IdrawReader::load method reused from the InterViews 3.1 morpher example. This is the gateway between glyphs and graphics, which finally allows the same drawing to be used in both worlds. This gives extra usefulness to the Export-in-idraw-format mode. These idraw-format icons need to be small enough to fit in a toolbutton, and they need to centered on 0,0. Here is the test file I used, a chemical glyph created by Todd Gruhn (the patch follows this PostScript doc, which you can cut-and-paste into a stand-alone file): %!PS-Adobe-2.0 EPSF-1.2 %%Creator: idraw %%DocumentFonts: %%Pages: 1 %%BoundingBox: -20 -17 21 18 %%EndComments %%BeginIdrawPrologue /arrowhead { 0 begin transform originalCTM itransform /taily exch def /tailx exch def transform originalCTM itransform /tipy exch def /tipx exch def /dy tipy taily sub def /dx tipx tailx sub def /angle dx 0 ne dy 0 ne or { dy dx atan } { 90 } ifelse def gsave originalCTM setmatrix tipx tipy translate angle rotate newpath arrowHeight neg arrowWidth 2 div moveto 0 0 lineto arrowHeight neg arrowWidth 2 div neg lineto patternNone not { originalCTM setmatrix /padtip arrowHeight 2 exp 0.25 arrowWidth 2 exp mul add sqrt brushWidth mul arrowWidth div def /padtail brushWidth 2 div def tipx tipy translate angle rotate padtip 0 translate arrowHeight padtip add padtail add arrowHeight div dup scale arrowheadpath ifill } if brushNone not { originalCTM setmatrix tipx tipy translate angle rotate arrowheadpath istroke } if grestore end } dup 0 9 dict put def /arrowheadpath { newpath arrowHeight neg arrowWidth 2 div moveto 0 0 lineto arrowHeight neg arrowWidth 2 div neg lineto } def /leftarrow { 0 begin y exch get /taily exch def x exch get /tailx exch def y exch get /tipy exch def x exch get /tipx exch def brushLeftArrow { tipx tipy tailx taily arrowhead } if end } dup 0 4 dict put def /rightarrow { 0 begin y exch get /tipy exch def x exch get /tipx exch def y exch get /taily exch def x exch get /tailx exch def brushRightArrow { tipx tipy tailx taily arrowhead } if end } dup 0 4 dict put def %%EndIdrawPrologue /arrowHeight 8 def /arrowWidth 4 def /IdrawDict 50 dict def IdrawDict begin /none null def /numGraphicParameters 17 def /stringLimit 65535 def /Begin { save numGraphicParameters dict begin } def /End { end restore } def /SetB { dup type /nulltype eq { pop false /brushRightArrow idef false /brushLeftArrow idef true /brushNone idef } { /brushDashOffset idef /brushDashArray idef 0 ne /brushRightArrow idef 0 ne /brushLeftArrow idef /brushWidth idef false /brushNone idef } ifelse } def /SetCFg { /fgblue idef /fggreen idef /fgred idef } def /SetCBg { /bgblue idef /bggreen idef /bgred idef } def /SetF { /printSize idef /printFont idef } def /SetP { dup type /nulltype eq { pop true /patternNone idef } { dup -1 eq { /patternGrayLevel idef /patternString idef } { /patternGrayLevel idef } ifelse false /patternNone idef } ifelse } def /BSpl { 0 begin storexyn newpath n 1 gt { 0 0 0 0 0 0 1 1 true subspline n 2 gt { 0 0 0 0 1 1 2 2 false subspline 1 1 n 3 sub { /i exch def i 1 sub dup i dup i 1 add dup i 2 add dup false subspline } for n 3 sub dup n 2 sub dup n 1 sub dup 2 copy false subspline } if n 2 sub dup n 1 sub dup 2 copy 2 copy false subspline patternNone not brushLeftArrow not brushRightArrow not and and { ifill } if brushNone not { istroke } if 0 0 1 1 leftarrow n 2 sub dup n 1 sub dup rightarrow } if end } dup 0 4 dict put def /Circ { newpath 0 360 arc closepath patternNone not { ifill } if brushNone not { istroke } if } def /CBSpl { 0 begin dup 2 gt { storexyn newpath n 1 sub dup 0 0 1 1 2 2 true subspline 1 1 n 3 sub { /i exch def i 1 sub dup i dup i 1 add dup i 2 add dup false subspline } for n 3 sub dup n 2 sub dup n 1 sub dup 0 0 false subspline n 2 sub dup n 1 sub dup 0 0 1 1 false subspline patternNone not { ifill } if brushNone not { istroke } if } { Poly } ifelse end } dup 0 4 dict put def /Elli { 0 begin newpath 4 2 roll translate scale 0 0 1 0 360 arc closepath patternNone not { ifill } if brushNone not { istroke } if end } dup 0 1 dict put def /Line { 0 begin 2 storexyn newpath x 0 get y 0 get moveto x 1 get y 1 get lineto brushNone not { istroke } if 0 0 1 1 leftarrow 0 0 1 1 rightarrow end } dup 0 4 dict put def /MLine { 0 begin storexyn newpath n 1 gt { x 0 get y 0 get moveto 1 1 n 1 sub { /i exch def x i get y i get lineto } for patternNone not brushLeftArrow not brushRightArrow not and and { ifill } if brushNone not { istroke } if 0 0 1 1 leftarrow n 2 sub dup n 1 sub dup rightarrow } if end } dup 0 4 dict put def /Poly { 3 1 roll newpath moveto -1 add { lineto } repeat closepath patternNone not { ifill } if brushNone not { istroke } if } def /Rect { 0 begin /t exch def /r exch def /b exch def /l exch def newpath l b moveto l t lineto r t lineto r b lineto closepath patternNone not { ifill } if brushNone not { istroke } if end } dup 0 4 dict put def /Text { ishow } def /idef { dup where { pop pop pop } { exch def } ifelse } def /ifill { 0 begin gsave patternGrayLevel -1 ne { fgred bgred fgred sub patternGrayLevel mul add fggreen bggreen fggreen sub patternGrayLevel mul add fgblue bgblue fgblue sub patternGrayLevel mul add setrgbcolor eofill } { eoclip originalCTM setmatrix pathbbox /t exch def /r exch def /b exch def /l exch def /w r l sub ceiling cvi def /h t b sub ceiling cvi def /imageByteWidth w 8 div ceiling cvi def /imageHeight h def bgred bggreen bgblue setrgbcolor eofill fgred fggreen fgblue setrgbcolor w 0 gt h 0 gt and { l w add b translate w neg h scale w h true [w 0 0 h neg 0 h] { patternproc } imagemask } if } ifelse grestore end } dup 0 8 dict put def /istroke { gsave brushDashOffset -1 eq { [] 0 setdash 1 setgray } { brushDashArray brushDashOffset setdash fgred fggreen fgblue setrgbcolor } ifelse brushWidth setlinewidth originalCTM setmatrix stroke grestore } def /ishow { 0 begin gsave fgred fggreen fgblue setrgbcolor /fontDict printFont printSize scalefont dup setfont def /descender fontDict begin 0 [FontBBox] 1 get FontMatrix end transform exch pop def /vertoffset 1 printSize sub descender sub def { 0 vertoffset moveto show /vertoffset vertoffset printSize sub def } forall grestore end } dup 0 3 dict put def /patternproc { 0 begin /patternByteLength patternString length def /patternHeight patternByteLength 8 mul sqrt cvi def /patternWidth patternHeight def /patternByteWidth patternWidth 8 idiv def /imageByteMaxLength imageByteWidth imageHeight mul stringLimit patternByteWidth sub min def /imageMaxHeight imageByteMaxLength imageByteWidth idiv patternHeight idiv patternHeight mul patternHeight max def /imageHeight imageHeight imageMaxHeight sub store /imageString imageByteWidth imageMaxHeight mul patternByteWidth add string def 0 1 imageMaxHeight 1 sub { /y exch def /patternRow y patternByteWidth mul patternByteLength mod def /patternRowString patternString patternRow patternByteWidth getinterval def /imageRow y imageByteWidth mul def 0 patternByteWidth imageByteWidth 1 sub { /x exch def imageString imageRow x add patternRowString putinterval } for } for imageString end } dup 0 12 dict put def /min { dup 3 2 roll dup 4 3 roll lt { exch } if pop } def /max { dup 3 2 roll dup 4 3 roll gt { exch } if pop } def /midpoint { 0 begin /y1 exch def /x1 exch def /y0 exch def /x0 exch def x0 x1 add 2 div y0 y1 add 2 div end } dup 0 4 dict put def /thirdpoint { 0 begin /y1 exch def /x1 exch def /y0 exch def /x0 exch def x0 2 mul x1 add 3 div y0 2 mul y1 add 3 div end } dup 0 4 dict put def /subspline { 0 begin /movetoNeeded exch def y exch get /y3 exch def x exch get /x3 exch def y exch get /y2 exch def x exch get /x2 exch def y exch get /y1 exch def x exch get /x1 exch def y exch get /y0 exch def x exch get /x0 exch def x1 y1 x2 y2 thirdpoint /p1y exch def /p1x exch def x2 y2 x1 y1 thirdpoint /p2y exch def /p2x exch def x1 y1 x0 y0 thirdpoint p1x p1y midpoint /p0y exch def /p0x exch def x2 y2 x3 y3 thirdpoint p2x p2y midpoint /p3y exch def /p3x exch def movetoNeeded { p0x p0y moveto } if p1x p1y p2x p2y p3x p3y curveto end } dup 0 17 dict put def /storexyn { /n exch def /y n array def /x n array def n 1 sub -1 0 { /i exch def y i 3 2 roll put x i 3 2 roll put } for } def /SSten { fgred fggreen fgblue setrgbcolor dup true exch 1 0 0 -1 0 6 -1 roll matrix astore } def /FSten { dup 3 -1 roll dup 4 1 roll exch newpath 0 0 moveto dup 0 exch lineto exch dup 3 1 roll exch lineto 0 lineto closepath bgred bggreen bgblue setrgbcolor eofill SSten } def /Rast { exch dup 3 1 roll 1 0 0 -1 0 6 -1 roll matrix astore } def %%EndProlog %I Idraw 12 Grid 8 8 %%Page: 1 1 Begin %I b u %I cfg u %I cbg u %I f u %I p u %I t [ 0.95698 0 0 0.95698 0 0 ] concat /originalCTM matrix currentmatrix def Begin %I Pict %I b u %I cfg Red 0.976577 0.0742199 0.250004 SetCFg %I cbg u %I f u %I p u %I t [ 1 0 0 1 -19.9997 -16.9996 ] concat Begin %I Pict %I b u %I cfg u %I cbg u %I f u %I p u %I t [ 1 0 0 1 -228.446 -223.188 ] concat Begin %I Pict %I b u %I cfg u %I cbg u %I f u %I p u %I t [ 0.677686 0 0 0.677686 809.392 -908.329 ] concat Begin %I MLine %I b 65535 3 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 -1019 1155 ] concat %I 2 173 525 206 525 2 MLine %I 1 End Begin %I MLine %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 -1021 1155 ] concat %I 2 175 526 177 526 2 MLine %I 1 End Begin %I MLine %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 -1021 1155 ] concat %I 4 176 525 166 542 178 559 201 559 4 MLine %I 1 End Begin %I MLine %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 -1021 1155 ] concat %I 3 214 555 221 544 208 525 3 MLine %I 1 End Begin %I Line %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 -1021 1155 ] concat %I 179 564 179 551 Line %I 1 End Begin %I Line %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 -1021 1155 ] concat %I 167 550 167 535 Line %I 1 End Begin %I Line %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 -1023 1155 ] concat %I 177 535 177 517 Line %I 1 End Begin %I Line %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 -1021 1157 ] concat %I 208 532 208 515 Line %I 1 End Begin %I Line %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 -1021 1155 ] concat %I 222 555 222 535 Line %I 1 End End %I eop End %I eop End %I eop End %I eop showpage %%Trailer end Index: IVGlyph/figure.c diff -c IVGlyph/figure.c:1.2 IVGlyph/figure.c:1.3 *** IVGlyph/figure.c:1.2 Wed Jul 26 01:27:49 2000 --- src/IVGlyph/figure.c Fri Jul 28 01:20:42 2000 *************** *** 684,698 **** void Graphic31::draw(Canvas* c, const Allocation& a) const { if (c != nil) { boolean no_transformer = !_t; ! if (no_transformer) ((Graphic31*)this)->_t = new Transformer(); ! _t->Translate(a.x(), a.y()); ! Graphic31* gr = (Graphic31*) this; CanvasDamage& cd = c->rep()->damage_; gr->drawclipped( c, cd.left, cd.bottom, cd.right, cd.top ); - _t->Translate(-a.x(), -a.y()); if (no_transformer) { delete _t; ((Graphic31*)this)->_t = nil; } --- 684,700 ---- void Graphic31::draw(Canvas* c, const Allocation& a) const { if (c != nil) { boolean no_transformer = !_t; ! if (no_transformer) { ! ((Graphic31*)this)->_t = new Transformer(); ! _t->Translate(a.x(), a.y()); ! } ! Graphic31* gr = (Graphic31*) this; CanvasDamage& cd = c->rep()->damage_; gr->drawclipped( c, cd.left, cd.bottom, cd.right, cd.top ); if (no_transformer) { + _t->Translate(-a.x(), -a.y()); delete _t; ((Graphic31*)this)->_t = nil; } Index: IVGlyph/toolbutton.c diff -c IVGlyph/toolbutton.c:1.1 IVGlyph/toolbutton.c:1.2 *** IVGlyph/toolbutton.c:1.1 Tue Jan 18 03:08:22 2000 --- src/IVGlyph/toolbutton.c Fri Jul 28 01:20:43 2000 *************** *** 102,108 **** void ToolButton::update(Observable* obs) { if (((TelltaleState*)obs)->test(TelltaleState::is_chosen)) { deck->flip_to(0); ! if (_mousedoc) _mousedoc->textvalue(_doc); } else --- 102,108 ---- void ToolButton::update(Observable* obs) { if (((TelltaleState*)obs)->test(TelltaleState::is_chosen)) { deck->flip_to(0); ! if (_mousedoc && _doc) _mousedoc->textvalue(_doc); } else Index: OverlayUnidraw/ovkit.c diff -c OverlayUnidraw/ovkit.c:1.6 OverlayUnidraw/ovkit.c:1.7 *** OverlayUnidraw/ovkit.c:1.6 Wed Jul 26 01:30:20 2000 --- src/OverlayUnidraw/ovkit.c Fri Jul 28 01:21:04 2000 *************** *** 1,4 **** --- 1,5 ---- /* + * Copyright (c) 2000 IET Inc. * Copyright (c) 1998-2000 Vectaport Inc. * Copyright (c) 1994-1995 Vectaport Inc., Cartoactive Systems * Copyright (c) 1994 Cartoactive Systems *************** *** 68,76 **** #include <ComGlyph/attrdialog.h> #include <ComGlyph/comtextedit.h> #include <IVGlyph/exportchooser.h> #include <IVGlyph/saveaschooser.h> - #include <Unidraw/catalog.h> #include <Unidraw/ctrlinfo.h> #include <Unidraw/editor.h> #include <Unidraw/grid.h> --- 69,79 ---- #include <ComGlyph/attrdialog.h> #include <ComGlyph/comtextedit.h> #include <IVGlyph/exportchooser.h> + #include <IVGlyph/idraw.h> #include <IVGlyph/saveaschooser.h> + + #include <UniIdraw/idcatalog.h> #include <Unidraw/ctrlinfo.h> #include <Unidraw/editor.h> #include <Unidraw/grid.h> *************** *** 138,147 **** #undef None #include <OS/math.h> - #define TEST_PICTOOLS - #if defined(TEST_PICTOOLS) #include <IVGlyph/idraw.h> - #endif #include <IVGlyph/figure.h> #include <IVGlyph/textform.h> #include <IVGlyph/toolbutton.h> --- 141,147 ---- *************** *** 199,204 **** --- 199,206 ---- _otherdisplay = nil; _set_button_flag = false; _clr_button_flag = false; + _tg = nil; + _toolbar_vbox = nil; } OverlayKit::~OverlayKit() { *************** *** 449,459 **** const LayoutKit& layout = *LayoutKit::instance(); Style* s = kit.style(); _toolbars = layout.deck(1); PolyGlyph* vb = layout.vbox(19); ! TelltaleGroup* tg = new TelltaleGroup(); Glyph* sel = kit.label("Select"); Glyph* mov = kit.label("Move"); --- 451,474 ---- const LayoutKit& layout = *LayoutKit::instance(); Style* s = kit.style(); + /* tools shared between pallettes */ + ToolButton* select; + ToolButton* move; + ToolButton* scale; + ToolButton* stretch; + ToolButton* rotate; + ToolButton* reshape; + ToolButton* magnify; + ToolButton* attribute; + _toolbars = layout.deck(1); + PolyGlyph* vb = layout.vbox(19); + _toolbar_vbox = new Glyph*[2]; + _toolbar_vbox[0] = vb; ! _tg = new TelltaleGroup(); Glyph* sel = kit.label("Select"); Glyph* mov = kit.label("Move"); *************** *** 477,485 **** fxClosed, fyClosed, nClosed); Glyph* gcspl = new Fig31Closed_BSpline(new Brush(0), kit.foreground(), nil, fxClosed, fyClosed, nClosed); - #if defined(TEST_PICTOOLS) /* test of zero-centered idraw drawing toolbutton */ - Glyph* gtest = IdrawReader::load("/tmp/test.idr"); - #endif Glyph* anno = kit.label("Annotate"); Glyph* attr = kit.label("Attribute"); Glyph* clipr = kit.label("ClipRect"); --- 492,497 ---- *************** *** 487,655 **** Glyph* hull = kit.label("ConvexHull"); Glyph* grloc = kit.label("GraphicLoc"); ! Coord maxwidth = 0; Requisition req; ! maxwidth = Math::max((sel->request(req), req.x_requirement().natural()), ! maxwidth); ! maxwidth = Math::max((mov->request(req), req.x_requirement().natural()), ! maxwidth); ! maxwidth = Math::max((scl->request(req), req.x_requirement().natural()), ! maxwidth); ! maxwidth = Math::max((str->request(req), req.x_requirement().natural()), ! maxwidth); ! maxwidth = Math::max((rot->request(req), req.x_requirement().natural()), ! maxwidth); ! maxwidth = Math::max((alt->request(req), req.x_requirement().natural()), ! maxwidth); ! maxwidth = Math::max((mag->request(req), req.x_requirement().natural()), ! maxwidth); ! maxwidth = Math::max((txt->request(req), req.x_requirement().natural()), ! maxwidth); ! maxwidth = Math::max((glin->request(req), req.x_requirement().natural()), ! maxwidth); ! maxwidth = Math::max((gmlin->request(req), req.x_requirement().natural()), ! maxwidth); ! maxwidth = Math::max((gospl->request(req), req.x_requirement().natural()), ! maxwidth); ! maxwidth = Math::max((grect->request(req), req.x_requirement().natural()), ! maxwidth); ! maxwidth = Math::max((gellp->request(req), req.x_requirement().natural()), ! maxwidth); ! maxwidth = Math::max((gpoly->request(req), req.x_requirement().natural()), ! maxwidth); ! maxwidth = Math::max((gcspl->request(req), req.x_requirement().natural()), ! maxwidth); ! #if defined(TEST_PICTOOLS) ! maxwidth = Math::max((gtest->request(req), req.x_requirement().natural()), ! maxwidth); ! #endif ! maxwidth = Math::max((anno->request(req), req.x_requirement().natural()), ! maxwidth); ! maxwidth = Math::max((attr->request(req), req.x_requirement().natural()), ! maxwidth); ! maxwidth = Math::max((clipr->request(req), req.x_requirement().natural()), ! maxwidth); ! maxwidth = Math::max((clipp->request(req), req.x_requirement().natural()), ! maxwidth); ! maxwidth = Math::max((hull->request(req), req.x_requirement().natural()), ! maxwidth); ! maxwidth = Math::max((grloc->request(req), req.x_requirement().natural()), ! maxwidth); ! vb->append(MakeTool(new SelectTool(new ControlInfo("Select", KLBL_SELECT, CODE_SELECT)), ! layout.overlay(layout.hcenter(layout.hspace(maxwidth)), layout.hcenter(sel)), ! tg, _ed->MouseDocObservable(), mouse_sel)); ! vb->append(MakeTool(new MoveTool(new ControlInfo("Move", KLBL_MOVE, CODE_MOVE)), ! layout.overlay(layout.hcenter(layout.hspace(maxwidth)), layout.hcenter(mov)), ! tg, _ed->MouseDocObservable(), mouse_mov)); ! vb->append(MakeTool(new ScaleTool(new ControlInfo("Scale", KLBL_SCALE, CODE_SCALE)), ! layout.overlay(layout.hcenter(layout.hspace(maxwidth)), ! layout.hcenter(scl)), tg, _ed->MouseDocObservable(), mouse_scl)); ! vb->append(MakeTool(new StretchTool(new ControlInfo("Stretch", KLBL_STRETCH,CODE_STRETCH)), ! layout.overlay(layout.hcenter(layout.hspace(maxwidth)), ! layout.hcenter(str)), tg, _ed->MouseDocObservable(), mouse_str)); ! vb->append(MakeTool(new RotateTool(new ControlInfo("Rotate", KLBL_ROTATE, CODE_ROTATE)), ! layout.overlay(layout.hcenter(layout.hspace(maxwidth)), ! layout.hcenter(rot)), tg, _ed->MouseDocObservable(), mouse_rot)); ! vb->append(MakeTool(new ReshapeTool(new ControlInfo("Alter", KLBL_RESHAPE, CODE_RESHAPE)), ! layout.overlay(layout.hcenter(layout.hspace(maxwidth)), ! layout.hcenter(alt)), tg, _ed->MouseDocObservable(), mouse_alt)); ! vb->append(MakeTool(new MagnifyTool(new ControlInfo("Magnify", KLBL_MAGNIFY,CODE_MAGNIFY)), ! layout.overlay(layout.hcenter(layout.hspace(maxwidth)), ! layout.hcenter(mag)), tg, _ed->MouseDocObservable(), mouse_mag)); TextGraphic* text = new TextGraphic("Text", stdgraphic); TextOvComp* textComp = new TextOvComp(text); vb->append(MakeTool(new GraphicCompTool(new ControlInfo("Text", KLBL_TEXT, CODE_TEXT), textComp), ! layout.overlay(layout.hcenter(layout.hspace(maxwidth)), ! layout.hcenter(txt)), tg, _ed->MouseDocObservable(), mouse_txt)); ArrowLine* line = new ArrowLine( 0, 0, unit, unit, false, false, 1., stdgraphic ); ArrowLineOvComp* arrowLineComp = new ArrowLineOvComp(line); vb->append(MakeTool(new GraphicCompTool(new ControlInfo(arrowLineComp, KLBL_LINE, CODE_LINE), arrowLineComp), ! layout.overlay(layout.hcenter(layout.hspace(maxwidth)), layout.hcenter(glin)), ! tg, _ed->MouseDocObservable(), mouse_lin)); ArrowMultiLine* ml = new ArrowMultiLine( xOpen, yOpen, nOpen, false, false, 1., stdgraphic ); ml->SetPattern(psnonepat); ArrowMultiLineOvComp* mlComp = new ArrowMultiLineOvComp(ml); vb->append(MakeTool(new GraphicCompTool(new ControlInfo(mlComp, KLBL_MULTILINE, CODE_MULTILINE), mlComp), ! layout.overlay(layout.hcenter(layout.hspace(maxwidth)), layout.hcenter(gmlin)), ! tg, _ed->MouseDocObservable(), mouse_mlin)); ArrowOpenBSpline* spl = new ArrowOpenBSpline( xOpen, yOpen, nOpen, false, false, 1., stdgraphic ); spl->SetPattern(psnonepat); ArrowSplineOvComp* splComp = new ArrowSplineOvComp(spl); vb->append(MakeTool(new GraphicCompTool(new ControlInfo(splComp, KLBL_SPLINE, CODE_SPLINE), splComp), ! layout.overlay(layout.hcenter(layout.hspace(maxwidth)), layout.hcenter(gospl)), ! tg, _ed->MouseDocObservable(), mouse_ospl)); SF_Rect* rect = new SF_Rect(0, 0, unit, unit*4/5, stdgraphic); rect->SetPattern(psnonepat); RectOvComp* rectComp = new RectOvComp(rect); vb->append(MakeTool(new GraphicCompTool(new ControlInfo(rectComp, KLBL_RECT, CODE_RECT), rectComp), ! layout.overlay(layout.hcenter(layout.hspace(maxwidth)), layout.hcenter(grect)), ! tg, _ed->MouseDocObservable(), mouse_rect)); SF_Ellipse* ellipse = new SF_Ellipse(0, 0, unit*2/3, unit*2/5, stdgraphic); ellipse->SetPattern(psnonepat); EllipseOvComp* ellipseComp = new EllipseOvComp(ellipse); vb->append(MakeTool(new GraphicCompTool(new ControlInfo(ellipseComp, KLBL_ELLIPSE, CODE_ELLIPSE), ellipseComp), ! layout.overlay(layout.hcenter(layout.hspace(maxwidth)), layout.hcenter(gellp)), ! tg, _ed->MouseDocObservable(), mouse_ellp)); SF_Polygon* polygon = new SF_Polygon(xClosed, yClosed, nClosed,stdgraphic); polygon->SetPattern(psnonepat); PolygonOvComp* polygonComp = new PolygonOvComp(polygon); vb->append(MakeTool(new GraphicCompTool(new ControlInfo(polygonComp, KLBL_POLY, CODE_POLY), polygonComp), ! layout.overlay(layout.hcenter(layout.hspace(maxwidth)), layout.hcenter(gpoly)), ! tg, _ed->MouseDocObservable(), mouse_poly)); SFH_ClosedBSpline* cspline = new SFH_ClosedBSpline( xClosed, yClosed, nClosed, stdgraphic ); cspline->SetPattern(psnonepat); ClosedSplineOvComp* csplineComp = new ClosedSplineOvComp(cspline); vb->append(MakeTool(new GraphicCompTool(new ControlInfo(csplineComp, KLBL_CSPLINE,CODE_CSPLINE), csplineComp), ! layout.overlay(layout.hcenter(layout.hspace(maxwidth)), layout.hcenter(gcspl)), ! tg, _ed->MouseDocObservable(), mouse_cspl)); ! #if defined(TEST_PICTOOLS) ! vb->append(MakeTool(new GraphicCompTool(new ControlInfo(csplineComp, "X", "X"), csplineComp), ! layout.overlay(layout.hcenter(layout.hspace(maxwidth)), ! layout.hcenter(gtest)), ! tg, _ed->MouseDocObservable(), mouse_cspl)); ! #endif vb->append(MakeTool(new AnnotateTool(new ControlInfo("Annotate", "A", "A")), ! layout.overlay(layout.hcenter(layout.hspace(maxwidth)), ! layout.hcenter(anno)), tg, _ed->MouseDocObservable(), mouse_anno)); ! vb->append(MakeTool(new AttributeTool(new ControlInfo("Attribute", "T", "T")), ! layout.overlay(layout.hcenter(layout.hspace(maxwidth)), ! layout.hcenter(attr)), tg, _ed->MouseDocObservable(), mouse_attr)); #ifdef CLIPPOLY vb->append(MakeTool(new ClipRectTool(new ControlInfo("ClipRect", "C", "C")), ! layout.overlay(layout.hcenter(layout.hspace(maxwidth)), ! layout.hcenter(clipr)), tg, _ed->MouseDocObservable(), mouse_clipr)); vb->append(MakeTool(new ClipPolyTool(new ControlInfo("ClipPoly")), ! layout.overlay(layout.hcenter(layout.hspace(maxwidth)), ! layout.hcenter(clipp)), tg, _ed->MouseDocObservable(), mouse_clipp)); if (!bintest("qhull")) vb->append(MakeTool(new ConvexHullTool(new ControlInfo("ConvexHull")), ! layout.overlay(layout.hcenter(layout.hspace(maxwidth)), ! layout.hcenter(hull)), tg, _ed->MouseDocObservable(), mouse_convexhull)); #endif vb->append(MakeTool(new GrLocTool(new ControlInfo("GraphicLoc", "", "")), ! layout.overlay(layout.hcenter(layout.hspace(maxwidth)), ! layout.hcenter(grloc)), tg, _ed->MouseDocObservable(), mouse_grloc)); _toolbars->append(vb); _toolbars->flip_to(0); _toolbar = new Patch(_toolbars); --- 499,667 ---- Glyph* hull = kit.label("ConvexHull"); Glyph* grloc = kit.label("GraphicLoc"); ! _maxwidth = 0; Requisition req; ! _maxwidth = Math::max((sel->request(req), req.x_requirement().natural()), ! _maxwidth); ! _maxwidth = Math::max((mov->request(req), req.x_requirement().natural()), ! _maxwidth); ! _maxwidth = Math::max((scl->request(req), req.x_requirement().natural()), ! _maxwidth); ! _maxwidth = Math::max((str->request(req), req.x_requirement().natural()), ! _maxwidth); ! _maxwidth = Math::max((rot->request(req), req.x_requirement().natural()), ! _maxwidth); ! _maxwidth = Math::max((alt->request(req), req.x_requirement().natural()), ! _maxwidth); ! _maxwidth = Math::max((mag->request(req), req.x_requirement().natural()), ! _maxwidth); ! _maxwidth = Math::max((txt->request(req), req.x_requirement().natural()), ! _maxwidth); ! _maxwidth = Math::max((glin->request(req), req.x_requirement().natural()), ! _maxwidth); ! _maxwidth = Math::max((gmlin->request(req), req.x_requirement().natural()), ! _maxwidth); ! _maxwidth = Math::max((gospl->request(req), req.x_requirement().natural()), ! _maxwidth); ! _maxwidth = Math::max((grect->request(req), req.x_requirement().natural()), ! _maxwidth); ! _maxwidth = Math::max((gellp->request(req), req.x_requirement().natural()), ! _maxwidth); ! _maxwidth = Math::max((gpoly->request(req), req.x_requirement().natural()), ! _maxwidth); ! _maxwidth = Math::max((gcspl->request(req), req.x_requirement().natural()), ! _maxwidth); ! _maxwidth = Math::max((anno->request(req), req.x_requirement().natural()), ! _maxwidth); ! _maxwidth = Math::max((attr->request(req), req.x_requirement().natural()), ! _maxwidth); ! _maxwidth = Math::max((clipr->request(req), req.x_requirement().natural()), ! _maxwidth); ! _maxwidth = Math::max((clipp->request(req), req.x_requirement().natural()), ! _maxwidth); ! _maxwidth = Math::max((hull->request(req), req.x_requirement().natural()), ! _maxwidth); ! _maxwidth = Math::max((grloc->request(req), req.x_requirement().natural()), ! _maxwidth); ! vb->append(select = MakeTool(new SelectTool(new ControlInfo("Select", KLBL_SELECT, CODE_SELECT)), ! layout.overlay(layout.hcenter(layout.hspace(_maxwidth)), layout.hcenter(sel)), ! _tg, _ed->MouseDocObservable(), mouse_sel)); ! vb->append(move = MakeTool(new MoveTool(new ControlInfo("Move", KLBL_MOVE, CODE_MOVE)), ! layout.overlay(layout.hcenter(layout.hspace(_maxwidth)), layout.hcenter(mov)), ! _tg, _ed->MouseDocObservable(), mouse_mov)); ! vb->append(scale = MakeTool(new ScaleTool(new ControlInfo("Scale", KLBL_SCALE, CODE_SCALE)), ! layout.overlay(layout.hcenter(layout.hspace(_maxwidth)), ! layout.hcenter(scl)), _tg, _ed->MouseDocObservable(), mouse_scl)); ! vb->append(stretch = MakeTool(new StretchTool(new ControlInfo("Stretch", KLBL_STRETCH,CODE_STRETCH)), ! layout.overlay(layout.hcenter(layout.hspace(_maxwidth)), ! layout.hcenter(str)), _tg, _ed->MouseDocObservable(), mouse_str)); ! vb->append(rotate = MakeTool(new RotateTool(new ControlInfo("Rotate", KLBL_ROTATE, CODE_ROTATE)), ! layout.overlay(layout.hcenter(layout.hspace(_maxwidth)), ! layout.hcenter(rot)), _tg, _ed->MouseDocObservable(), mouse_rot)); ! vb->append(reshape = MakeTool(new ReshapeTool(new ControlInfo("Alter", KLBL_RESHAPE, CODE_RESHAPE)), ! layout.overlay(layout.hcenter(layout.hspace(_maxwidth)), ! layout.hcenter(alt)), _tg, _ed->MouseDocObservable(), mouse_alt)); ! vb->append(magnify = MakeTool(new MagnifyTool(new ControlInfo("Magnify", KLBL_MAGNIFY,CODE_MAGNIFY)), ! layout.overlay(layout.hcenter(layout.hspace(_maxwidth)), ! layout.hcenter(mag)), _tg, _ed->MouseDocObservable(), mouse_mag)); TextGraphic* text = new TextGraphic("Text", stdgraphic); TextOvComp* textComp = new TextOvComp(text); vb->append(MakeTool(new GraphicCompTool(new ControlInfo("Text", KLBL_TEXT, CODE_TEXT), textComp), ! layout.overlay(layout.hcenter(layout.hspace(_maxwidth)), ! layout.hcenter(txt)), _tg, _ed->MouseDocObservable(), mouse_txt)); ArrowLine* line = new ArrowLine( 0, 0, unit, unit, false, false, 1., stdgraphic ); ArrowLineOvComp* arrowLineComp = new ArrowLineOvComp(line); vb->append(MakeTool(new GraphicCompTool(new ControlInfo(arrowLineComp, KLBL_LINE, CODE_LINE), arrowLineComp), ! layout.overlay(layout.hcenter(layout.hspace(_maxwidth)), layout.hcenter(glin)), ! _tg, _ed->MouseDocObservable(), mouse_lin)); ArrowMultiLine* ml = new ArrowMultiLine( xOpen, yOpen, nOpen, false, false, 1., stdgraphic ); ml->SetPattern(psnonepat); ArrowMultiLineOvComp* mlComp = new ArrowMultiLineOvComp(ml); vb->append(MakeTool(new GraphicCompTool(new ControlInfo(mlComp, KLBL_MULTILINE, CODE_MULTILINE), mlComp), ! layout.overlay(layout.hcenter(layout.hspace(_maxwidth)), layout.hcenter(gmlin)), ! _tg, _ed->MouseDocObservable(), mouse_mlin)); ArrowOpenBSpline* spl = new ArrowOpenBSpline( xOpen, yOpen, nOpen, false, false, 1., stdgraphic ); spl->SetPattern(psnonepat); ArrowSplineOvComp* splComp = new ArrowSplineOvComp(spl); vb->append(MakeTool(new GraphicCompTool(new ControlInfo(splComp, KLBL_SPLINE, CODE_SPLINE), splComp), ! layout.overlay(layout.hcenter(layout.hspace(_maxwidth)), layout.hcenter(gospl)), ! _tg, _ed->MouseDocObservable(), mouse_ospl)); SF_Rect* rect = new SF_Rect(0, 0, unit, unit*4/5, stdgraphic); rect->SetPattern(psnonepat); RectOvComp* rectComp = new RectOvComp(rect); vb->append(MakeTool(new GraphicCompTool(new ControlInfo(rectComp, KLBL_RECT, CODE_RECT), rectComp), ! layout.overlay(layout.hcenter(layout.hspace(_maxwidth)), layout.hcenter(grect)), ! _tg, _ed->MouseDocObservable(), mouse_rect)); SF_Ellipse* ellipse = new SF_Ellipse(0, 0, unit*2/3, unit*2/5, stdgraphic); ellipse->SetPattern(psnonepat); EllipseOvComp* ellipseComp = new EllipseOvComp(ellipse); vb->append(MakeTool(new GraphicCompTool(new ControlInfo(ellipseComp, KLBL_ELLIPSE, CODE_ELLIPSE), ellipseComp), ! layout.overlay(layout.hcenter(layout.hspace(_maxwidth)), layout.hcenter(gellp)), ! _tg, _ed->MouseDocObservable(), mouse_ellp)); SF_Polygon* polygon = new SF_Polygon(xClosed, yClosed, nClosed,stdgraphic); polygon->SetPattern(psnonepat); PolygonOvComp* polygonComp = new PolygonOvComp(polygon); vb->append(MakeTool(new GraphicCompTool(new ControlInfo(polygonComp, KLBL_POLY, CODE_POLY), polygonComp), ! layout.overlay(layout.hcenter(layout.hspace(_maxwidth)), layout.hcenter(gpoly)), ! _tg, _ed->MouseDocObservable(), mouse_poly)); SFH_ClosedBSpline* cspline = new SFH_ClosedBSpline( xClosed, yClosed, nClosed, stdgraphic ); cspline->SetPattern(psnonepat); ClosedSplineOvComp* csplineComp = new ClosedSplineOvComp(cspline); vb->append(MakeTool(new GraphicCompTool(new ControlInfo(csplineComp, KLBL_CSPLINE,CODE_CSPLINE), csplineComp), ! layout.overlay(layout.hcenter(layout.hspace(_maxwidth)), layout.hcenter(gcspl)), ! _tg, _ed->MouseDocObservable(), mouse_cspl)); vb->append(MakeTool(new AnnotateTool(new ControlInfo("Annotate", "A", "A")), ! layout.overlay(layout.hcenter(layout.hspace(_maxwidth)), ! layout.hcenter(anno)), _tg, _ed->MouseDocObservable(), mouse_anno)); ! vb->append(attribute = MakeTool(new AttributeTool(new ControlInfo("Attribute", "T", "T")), ! layout.overlay(layout.hcenter(layout.hspace(_maxwidth)), ! layout.hcenter(attr)), _tg, _ed->MouseDocObservable(), mouse_attr)); #ifdef CLIPPOLY vb->append(MakeTool(new ClipRectTool(new ControlInfo("ClipRect", "C", "C")), ! layout.overlay(layout.hcenter(layout.hspace(_maxwidth)), ! layout.hcenter(clipr)), _tg, _ed->MouseDocObservable(), mouse_clipr)); vb->append(MakeTool(new ClipPolyTool(new ControlInfo("ClipPoly")), ! layout.overlay(layout.hcenter(layout.hspace(_maxwidth)), ! layout.hcenter(clipp)), _tg, _ed->MouseDocObservable(), mouse_clipp)); if (!bintest("qhull")) vb->append(MakeTool(new ConvexHullTool(new ControlInfo("ConvexHull")), ! layout.overlay(layout.hcenter(layout.hspace(_maxwidth)), ! layout.hcenter(hull)), _tg, _ed->MouseDocObservable(), mouse_convexhull)); #endif vb->append(MakeTool(new GrLocTool(new ControlInfo("GraphicLoc", "", "")), ! layout.overlay(layout.hcenter(layout.hspace(_maxwidth)), ! layout.hcenter(grloc)), _tg, _ed->MouseDocObservable(), mouse_grloc)); _toolbars->append(vb); + vb = layout.vbox(); + _toolbar_vbox[1] = vb; + vb->append(select); + vb->append(move); + vb->append(scale); + vb->append(rotate); + vb->append(reshape); + vb->append(magnify); + vb->append(attribute); + _toolbars->append(vb); _toolbars->flip_to(0); _toolbar = new Patch(_toolbars); *************** *** 1381,1388 **** } ! MenuItem* OverlayKit::MakeToolsMenu() { ! return nil; } MenuItem * OverlayKit::MakeViewersMenu() { --- 1393,1480 ---- } ! MenuItem * OverlayKit::MakeToolsMenu() { ! LayoutKit& lk = *LayoutKit::instance(); ! WidgetKit& kit = *WidgetKit::instance(); ! ! MenuItem *mbi = kit.menubar_item(kit.label("Tools")); ! mbi->menu(kit.pulldown()); ! ! MenuItem* menu_item = kit.menu_item(kit.label("Custom Tools")); ! menu_item->action(new ActionCallback(OverlayKit)(this, &OverlayKit::toolbar1)); ! mbi->menu()->append_item(menu_item); ! ! menu_item = kit.menu_item(kit.label("Idraw Tools")); ! menu_item->action(new ActionCallback(OverlayKit)(this, &OverlayKit::toolbar0)); ! mbi->menu()->append_item(menu_item); ! ! menu_item = kit.menu_item(kit.label("Add Custom Tool")); ! menu_item->action(new ActionCallback(OverlayKit)(this, &OverlayKit::add_custom_tool)); ! mbi->menu()->append_item(menu_item); ! ! return mbi; ! } ! ! void OverlayKit::toolbar0() { ! _toolbars->flip_to(0); ! _ed->GetKeyMap()->Execute(CODE_SELECT); ! _toolbar->redraw(); ! } ! ! void OverlayKit::toolbar1() { ! _toolbars->flip_to(1); ! _ed->GetKeyMap()->Execute(CODE_SELECT); ! _toolbar->redraw(); ! } ! ! void OverlayKit::add_custom_tool() { ! static OpenFileChooser* chooser = nil; ! Editor* ed = GetEditor(); ! LayoutKit& layout = *LayoutKit::instance(); ! Style* style = new Style(Session::instance()->style()); ! if (!chooser) { ! style->attribute("subcaption", "Open Idraw Icon For Tool Button:"); ! style->attribute("open", "Open"); ! chooser = new OpenFileChooser(".", WidgetKit::instance(), style); ! Resource::ref(chooser); ! } ! boolean again; ! boolean reset_caption = false; ! const char* name = nil; ! GraphicComp* comp = nil; ! while (again = chooser->post_for(ed->GetWindow())) { ! const String* str = chooser->selected(); ! NullTerminatedString ns(*str); ! name = ns.string(); ! IdrawCatalog* catalog = (IdrawCatalog*)unidraw->GetCatalog(); ! boolean ok = true; ! style->attribute("caption", " " ); ! chooser->twindow()->repair(); ! chooser->twindow()->display()->sync(); ! if (catalog->IdrawCatalog::Retrieve(name, (Component*&)comp)) { ! break; ! } else { ! style->attribute("caption", "Open failed!" ); ! reset_caption = true; ! } ! ! } ! chooser->unmap(); ! if (reset_caption) { ! style->attribute("caption", " "); ! } ! ! _toolbars->flip_to(1); ! Glyph* newbutton = name&&comp ? IdrawReader::load(name) : nil; ! if (newbutton) { ! _toolbar_vbox[1]->append(MakeTool(new GraphicCompTool(new ControlInfo(comp, "", ""), comp), ! layout.overlay(layout.hcenter(layout.hspace(_maxwidth)), ! layout.hcenter(newbutton)), ! _tg, _ed->MouseDocObservable(), mouse_custom)); ! } else ! delete comp; ! _ed->GetKeyMap()->Execute(CODE_SELECT); ! _toolbar->redraw(); } MenuItem * OverlayKit::MakeViewersMenu() { *************** *** 1391,1397 **** AttributeList* edlaunchlist = _ed->edlauncherlist(); AttributeList* comterplist = _ed->comterplist(); ! if (!edlaunchlist && !comterplist) return nil; MenuItem *mbi = kit.menubar_item(kit.label("Editors")); mbi->menu(kit.pulldown()); --- 1483,1489 ---- AttributeList* edlaunchlist = _ed->edlauncherlist(); AttributeList* comterplist = _ed->comterplist(); ! if (!edlaunchlist /* && !comterplist */) return nil; MenuItem *mbi = kit.menubar_item(kit.label("Editors")); mbi->menu(kit.pulldown()); Index: OverlayUnidraw/ovkit.h diff -c OverlayUnidraw/ovkit.h:1.3 OverlayUnidraw/ovkit.h:1.4 *** OverlayUnidraw/ovkit.h:1.3 Sat Mar 18 02:04:37 2000 --- src/OverlayUnidraw/ovkit.h Fri Jul 28 01:21:04 2000 *************** *** 1,4 **** --- 1,5 ---- /* + * Copyright (c) 2000 IET Inc. * Copyright (c) 1995-1999 Vectaport Inc. * Copyright (c) 1994 Vectaport Inc., Cartoactive Systems * Copyright (c) 1993 David B. Hollenbeck *************** *** 176,181 **** --- 177,183 ---- static const char mouse_logscale[] = "l-drag: Logarithmically Scale Image between Pixel Values on Line; m-drag: Move; r-click/drag: Select"; static const char mouse_pseudocolor[] = "l-drag: Pseudocolor Image between Pixel Values on Line; m-drag: Move; r-click/drag: Select"; static const char mouse_grloc[] = "l-click: Location within Graphic; m-drag: Move; r-click/drag: Select"; + static const char mouse_custom[] = "l-click: Drop icon; m-drag: Move; r-click/drag: Select"; void otherdisplay(const char* display); // set possible alternate X display string for constructing viewer. *************** *** 204,213 **** --- 206,227 ---- const char* otherdisplay(); // returns string that might specify an alternate X display. + + protected: + void toolbar0(); + // switch to default toolbar + void toolbar1(); + // switch to alternate toolbar + void add_custom_tool(); + // import idraw-format tool button + protected: OverlayEditor* _ed; Deck* _toolbars; Patch* _toolbar; + Glyph** _toolbar_vbox; + TelltaleGroup* _tg; + FloatCoord _maxwidth; char* _otherdisplay; boolean _set_button_flag; Index: OverlayUnidraw/ovviews.c diff -c OverlayUnidraw/ovviews.c:1.2 OverlayUnidraw/ovviews.c:1.3 *** OverlayUnidraw/ovviews.c:1.2 Tue May 16 06:21:47 2000 --- src/OverlayUnidraw/ovviews.c Fri Jul 28 01:21:04 2000 *************** *** 1,4 **** --- 1,5 ---- /* + * Copyright (c) 2000 IET Inc. * Copyright (c) 1994 Vectaport Inc., Cartoactive Systems * Copyright (c) 1990, 1991 Stanford University * *************** *** 34,45 **** --- 35,48 ---- #include <OverlayUnidraw/ovselection.h> #include <OverlayUnidraw/ovviews.h> + #include <Unidraw/clipboard.h> #include <Unidraw/grid.h> #include <Unidraw/iterator.h> #include <Unidraw/ulist.h> #include <Unidraw/viewer.h> #include <Unidraw/Commands/align.h> + #include <Unidraw/Commands/edit.h> #include <Unidraw/Components/grcomp.h> #include <Unidraw/Components/gvupdater.h> *************** *** 653,658 **** --- 656,716 ---- ((OverlayView*)GetView(i))->AdjustForPan(dx, dy); } OverlayView::AdjustForPan(dx, dy); + } + + Manipulator* OverlaysView::CreateManipulator ( + Viewer* v, Event& e, Transformer* rel, Tool* tool + ) { + Rubberband* rub = nil; + Manipulator* m = nil; + IntCoord l, b, r, t; + + if (tool->IsA(GRAPHIC_COMP_TOOL)) { + v->Constrain(e.x, e.y); + m = new DragManip(v, nil, rel, tool, + DragConstraint(XFixed | YFixed)); + } else + m = OverlayView::CreateManipulator(v, e, rel, tool); + + return m; + } + + Command* OverlaysView::InterpretManipulator(Manipulator* m) { + Tool* tool = m->GetTool(); + Command* cmd = nil; + + if (tool->IsA(GRAPHIC_COMP_TOOL)) + { + DragManip* dm = (DragManip*) m; + Editor* ed = dm->GetViewer()->GetEditor(); + Transformer* rel = dm->GetTransformer(); + + Event initial = dm->GraspEvent(); + Coord x = initial.x; + Coord y = initial.y; + + if (rel != nil) { + rel = new Transformer(rel); + rel->Invert(); + } + /* get the comp */ + OverlaysComp* comp = (OverlaysComp*)GetSubject()->Copy(); + Transformer* t = comp->GetGraphic()->GetTransformer(); + if (!t) { + t = new Transformer(); + comp->GetGraphic()->SetTransformer(t); + } + t->Translate(x, y); + t->postmultiply(rel); + Unref(rel); + + cmd = new PasteCmd(ed, new Clipboard(comp)); + + } else + { + cmd = OverlayView::InterpretManipulator(m); + } + return cmd; } /*****************************************************************************/ Index: OverlayUnidraw/ovviews.h diff -c OverlayUnidraw/ovviews.h:1.2 OverlayUnidraw/ovviews.h:1.3 *** OverlayUnidraw/ovviews.h:1.2 Tue May 16 06:21:48 2000 --- src/OverlayUnidraw/ovviews.h Fri Jul 28 01:21:04 2000 *************** *** 1,4 **** --- 1,5 ---- /* + * Copyright (c) 2000 IET Inc. * Copyright (c) 1994 Vectaport Inc., Cartoactive Systems * Copyright (c) 1990, 1991 Stanford University * *************** *** 198,203 **** --- 199,208 ---- // called once per OverlayView before each pan, to let // fixed location graphics adjust accordingly. + virtual Manipulator* CreateManipulator(Viewer*,Event&,Transformer*,Tool*); + // create manipulator for laying down composite graphic + virtual Command* InterpretManipulator(Manipulator*); + // interpret manipulator by copying prototype protected: UList* Elem(Iterator); Index: GraphUnidraw/graphkit.c diff -c GraphUnidraw/graphkit.c:1.1 GraphUnidraw/graphkit.c:1.2 *** GraphUnidraw/graphkit.c:1.1 Tue Jan 18 03:11:27 2000 --- src/GraphUnidraw/graphkit.c Fri Jul 28 01:21:10 2000 *************** *** 331,341 **** mbi->menu(kit.pulldown()); MenuItem* menu_item = kit.menu_item(kit.label("Graph Tools")); ! menu_item->action(new ActionCallback(GraphKit)(this, &GraphKit::toolbar1)); mbi->menu()->append_item(menu_item); menu_item = kit.menu_item(kit.label("Idraw Tools")); ! menu_item->action(new ActionCallback(GraphKit)(this, &GraphKit::toolbar0)); mbi->menu()->append_item(menu_item); return mbi; --- 331,341 ---- mbi->menu(kit.pulldown()); MenuItem* menu_item = kit.menu_item(kit.label("Graph Tools")); ! menu_item->action(new ActionCallback(OverlayKit)(this, &OverlayKit::toolbar1)); mbi->menu()->append_item(menu_item); menu_item = kit.menu_item(kit.label("Idraw Tools")); ! menu_item->action(new ActionCallback(OverlayKit)(this, &OverlayKit::toolbar0)); mbi->menu()->append_item(menu_item); return mbi; *************** *** 586,603 **** fil, 0.0 ) ); - } - - void GraphKit::toolbar0() { - _toolbars->flip_to(0); - _ed->GetKeyMap()->Execute(CODE_SELECT); - _toolbar->redraw(); - } - - void GraphKit::toolbar1() { - _toolbars->flip_to(1); - _ed->GetKeyMap()->Execute("L"); - _toolbar->redraw(); } void GraphKit::InitLayout(const char* name) { --- 586,591 ---- Index: GraphUnidraw/graphkit.h diff -c GraphUnidraw/graphkit.h:1.1 GraphUnidraw/graphkit.h:1.2 *** GraphUnidraw/graphkit.h:1.1 Tue Jan 18 03:11:27 2000 --- src/GraphUnidraw/graphkit.h Fri Jul 28 01:21:10 2000 *************** *** 59,69 **** static const char mouse_edge[] = "l-drag: Connect; m-drag: Move; r-click/drag: Select"; protected: - void toolbar0(); - // switch to graph drawing toolbar. - void toolbar1(); - // switch to graphics drawing toolbar. - protected: static GraphKit* _graphkit; }; --- 59,64 ---- Index: config_ivtools/rules.def diff -c config_ivtools/rules.def:1.2 config_ivtools/rules.def:1.3 *** config_ivtools/rules.def:1.2 Fri Feb 11 22:24:25 2000 --- config/rules.def Fri Jul 28 01:21:29 2000 *************** *** 434,440 **** #ifndef DependTarget #define DependTarget() @@\ depend:: @@\ ! gcc -M $(DEPEND_CCFLAGS) $(SRCS) >Makefile.depend #endif /* --- 434,440 ---- #ifndef DependTarget #define DependTarget() @@\ depend:: @@\ ! g++ -M $(DEPEND_CCFLAGS) $(SRCS) >Makefile.depend #endif /* *** /dev/null Fri Jul 28 01:21:39 PDT 2000 --- patches/ivtools-000728-johnston-087 *************** patches/ivtools-000728-johnston-087 *** 0 **** --- 1 ---- + ivtools-000728-johnston-087 |
From: <ivt...@li...> - 2000-07-25 19:42:36
|
Patch: ivtools-000726-johnston-086 For: ivtools-0.8.3 Author: joh...@us... Subject: migrate classes for glyph graphics to IVGlyph Requires: This is an intermediate patch to ivtools-0.8.3. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - migrate classes for representing graphics as glyphs from the morpher example program to the IVGlyph library. This includes a method for constructing glyphs given an idraw file. - migrate the morpher example from the examples3.1 sub-tree to the main glyphs directory. Index: top_ivtools/MANIFEST diff -c top_ivtools/MANIFEST:1.14 top_ivtools/MANIFEST:1.15 *** top_ivtools/MANIFEST:1.14 Fri Jul 21 01:14:52 2000 --- ./MANIFEST Wed Jul 26 01:29:57 2000 *************** *** 427,435 **** --- 427,443 ---- ivtools-0.8/src/IVGlyph/fieldedit.c ivtools-0.8/src/IVGlyph/fieldedit.h ivtools-0.8/src/IVGlyph/figure.c + ivtools-0.8/src/IVGlyph/figure.c ivtools-0.8/src/IVGlyph/figure.h + ivtools-0.8/src/IVGlyph/figure.h ivtools-0.8/src/IVGlyph/gdialogs.c ivtools-0.8/src/IVGlyph/gdialogs.h + ivtools-0.8/src/IVGlyph/globals.c + ivtools-0.8/src/IVGlyph/globals.h + ivtools-0.8/src/IVGlyph/grabber.bm + ivtools-0.8/src/IVGlyph/grabberMask.bm + ivtools-0.8/src/IVGlyph/idraw.c + ivtools-0.8/src/IVGlyph/idraw.h ivtools-0.8/src/IVGlyph/importchooser.c ivtools-0.8/src/IVGlyph/importchooser.h ivtools-0.8/src/IVGlyph/namestate.c *************** *** 994,1032 **** ivtools-0.8/src/glyphs/examples3.1/menu/Imakefile ivtools-0.8/src/glyphs/examples3.1/menu/Makefile ivtools-0.8/src/glyphs/examples3.1/menu/main.c - ivtools-0.8/src/glyphs/examples3.1/morpher/Imakefile - ivtools-0.8/src/glyphs/examples3.1/morpher/Makefile - ivtools-0.8/src/glyphs/examples3.1/morpher/README - ivtools-0.8/src/glyphs/examples3.1/morpher/balls - ivtools-0.8/src/glyphs/examples3.1/morpher/figure.c - ivtools-0.8/src/glyphs/examples3.1/morpher/figure.h - ivtools-0.8/src/glyphs/examples3.1/morpher/globals.c - ivtools-0.8/src/glyphs/examples3.1/morpher/globals.h - ivtools-0.8/src/glyphs/examples3.1/morpher/glypheditor.c - ivtools-0.8/src/glyphs/examples3.1/morpher/glypheditor.h - ivtools-0.8/src/glyphs/examples3.1/morpher/glyphviewer.c - ivtools-0.8/src/glyphs/examples3.1/morpher/glyphviewer.h - ivtools-0.8/src/glyphs/examples3.1/morpher/grabber.bm - ivtools-0.8/src/glyphs/examples3.1/morpher/grabberMask.bm - ivtools-0.8/src/glyphs/examples3.1/morpher/icons/cont_play - ivtools-0.8/src/glyphs/examples3.1/morpher/icons/fast_forward - ivtools-0.8/src/glyphs/examples3.1/morpher/icons/fast_reverse - ivtools-0.8/src/glyphs/examples3.1/morpher/icons/forward_pause - ivtools-0.8/src/glyphs/examples3.1/morpher/icons/forward_play - ivtools-0.8/src/glyphs/examples3.1/morpher/icons/new-record - ivtools-0.8/src/glyphs/examples3.1/morpher/icons/panel - ivtools-0.8/src/glyphs/examples3.1/morpher/icons/pause - ivtools-0.8/src/glyphs/examples3.1/morpher/icons/record - ivtools-0.8/src/glyphs/examples3.1/morpher/icons/reverse_pause - ivtools-0.8/src/glyphs/examples3.1/morpher/icons/reverse_play - ivtools-0.8/src/glyphs/examples3.1/morpher/idraw.c - ivtools-0.8/src/glyphs/examples3.1/morpher/idraw.h - ivtools-0.8/src/glyphs/examples3.1/morpher/main.c - ivtools-0.8/src/glyphs/examples3.1/morpher/man.0 - ivtools-0.8/src/glyphs/examples3.1/morpher/man.1 - ivtools-0.8/src/glyphs/examples3.1/morpher/morpher.c - ivtools-0.8/src/glyphs/examples3.1/morpher/morpher.h - ivtools-0.8/src/glyphs/examples3.1/morpher/rect ivtools-0.8/src/glyphs/examples3.1/patch/Imakefile ivtools-0.8/src/glyphs/examples3.1/patch/Makefile ivtools-0.8/src/glyphs/examples3.1/patch/main.c --- 1002,1007 ---- *************** *** 1069,1074 **** --- 1044,1074 ---- ivtools-0.8/src/glyphs/meter/Imakefile ivtools-0.8/src/glyphs/meter/Makefile ivtools-0.8/src/glyphs/meter/main.c + ivtools-0.8/src/glyphs/morpher/Imakefile + ivtools-0.8/src/glyphs/morpher/Makefile + ivtools-0.8/src/glyphs/morpher/README + ivtools-0.8/src/glyphs/morpher/balls + ivtools-0.8/src/glyphs/morpher/glypheditor.c + ivtools-0.8/src/glyphs/morpher/glypheditor.h + ivtools-0.8/src/glyphs/morpher/glyphviewer.c + ivtools-0.8/src/glyphs/morpher/glyphviewer.h + ivtools-0.8/src/glyphs/morpher/icons/cont_play + ivtools-0.8/src/glyphs/morpher/icons/fast_forward + ivtools-0.8/src/glyphs/morpher/icons/fast_reverse + ivtools-0.8/src/glyphs/morpher/icons/forward_pause + ivtools-0.8/src/glyphs/morpher/icons/forward_play + ivtools-0.8/src/glyphs/morpher/icons/new-record + ivtools-0.8/src/glyphs/morpher/icons/panel + ivtools-0.8/src/glyphs/morpher/icons/pause + ivtools-0.8/src/glyphs/morpher/icons/record + ivtools-0.8/src/glyphs/morpher/icons/reverse_pause + ivtools-0.8/src/glyphs/morpher/icons/reverse_play + ivtools-0.8/src/glyphs/morpher/main.c + ivtools-0.8/src/glyphs/morpher/man.0 + ivtools-0.8/src/glyphs/morpher/man.1 + ivtools-0.8/src/glyphs/morpher/morpher.c + ivtools-0.8/src/glyphs/morpher/morpher.h + ivtools-0.8/src/glyphs/morpher/rect ivtools-0.8/src/glyphs/radiogroup/Imakefile ivtools-0.8/src/glyphs/radiogroup/Makefile ivtools-0.8/src/glyphs/radiogroup/main.c Index: top_ivtools/MANIFEST.perceps diff -c top_ivtools/MANIFEST.perceps:1.10 top_ivtools/MANIFEST.perceps:1.11 *** top_ivtools/MANIFEST.perceps:1.10 Fri Jul 21 01:14:52 2000 --- ./MANIFEST.perceps Wed Jul 26 01:29:57 2000 *************** *** 108,113 **** --- 108,114 ---- IVGlyph/fieldedit.h IVGlyph/figure.h IVGlyph/gdialogs.h + IVGlyph/idraw.h IVGlyph/importchooser.h IVGlyph/namestate.h IVGlyph/observables.h Index: IVGlyph/Imakefile diff -c IVGlyph/Imakefile:1.2 IVGlyph/Imakefile:1.3 *** IVGlyph/Imakefile:1.2 Thu Jan 27 01:51:33 2000 --- src/IVGlyph/Imakefile Wed Jul 26 01:27:48 2000 *************** *** 25,30 **** --- 25,32 ---- Obj(fieldedit) Obj(figure) Obj(gdialogs) + Obj(globals) + Obj(idraw) Obj(importchooser) Obj(namestate) Obj(observables) Index: IVGlyph/figure.c diff -c IVGlyph/figure.c:1.1 IVGlyph/figure.c:1.2 *** IVGlyph/figure.c:1.1 Tue Jan 18 03:08:18 2000 --- src/IVGlyph/figure.c Wed Jul 26 01:27:49 2000 *************** *** 1,38 **** /* - * Copyright (c) 1991 Stanford University - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided - * that the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Stanford not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. Stanford makes no representations about - * the suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * STANFORD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. - * IN NO EVENT SHALL STANFORD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION - * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - /* * planar figures */ #include "figure.h" #include <InterViews/brush.h> #include <InterViews/canvas.h> #include <InterViews/color.h> #include <OS/math.h> ! Fig31::Fig31 ( const Brush* brush, const Color* stroke, const Color* fill, ! boolean closed, boolean curved, int coords ) { _brush = brush; Resource::ref(_brush); --- 1,92 ---- /* * planar figures */ #include "figure.h" + #include "grabber.bm" + #include "grabberMask.bm" + #include <InterViews/bitmap.h> #include <InterViews/brush.h> #include <InterViews/canvas.h> + #include <InterViews/character.h> #include <InterViews/color.h> + #include <InterViews/cursor.h> + #include <InterViews/display.h> + #include <InterViews/font.h> + #include <InterViews/handler.h> + #include <InterViews/layout.h> + #include <InterViews/tformsetter.h> + #include <InterViews/transformer.h> + #include <InterViews/window.h> + #include <IV-X11/xcanvas.h> + #include <OS/list.h> #include <OS/math.h> + #include <OS/memory.h> + #include <OS/string.h> + #include <stdlib.h> + #include <ctype.h> + #include <math.h> ! static void corners( ! Coord& left, Coord& bottom, Coord& right, Coord& top, const Transformer& t ! ) { ! Coord x1, y1, x2, y2, x3, y3, x4, y4; ! ! t.transform(left, bottom, x1, y1); ! t.transform(left, top, x2, y2); ! t.transform(right, top, x3, y3); ! t.transform(right, bottom, x4, y4); ! left = Math::min(x1, x2, x3, x4); ! bottom = Math::min(y1, y2, y3, y4); ! right = Math::max(x1, x2, x3, x4); ! top = Math::max(y1, y2, y3, y4); ! } ! ! Graphic31::Graphic31 (Graphic31* gr) { ! if (gr != nil) { ! _brush = gr->brush(); ! Resource::ref(_brush); ! _stroke = gr->stroke(); ! Resource::ref(_stroke); ! _fill = gr->fill(); ! Resource::ref(_fill); ! _font = gr->font(); ! Resource::ref(_font); ! _closed = gr->closed(); ! _curved = gr->curved(); ! Coord* foo; ! ! _ctrlpts = gr->ctrlpts(foo, foo); ! _x = new Coord[buf_size]; ! _y = new Coord[buf_size]; ! _buf_size = buf_size; ! if (gr->transformer() != nil) { ! _t = new Transformer; ! *_t = *gr->transformer(); ! } else { ! _t = nil; ! } ! } else { ! _brush = nil; ! _stroke = nil; ! _fill = nil; ! _font = nil; ! _closed = false; ! _curved = false; ! _ctrlpts = 0; ! _x = new Coord[buf_size]; ! _y = new Coord[buf_size]; ! _buf_size = buf_size; ! _t = nil; ! } ! _xmin = _xmax = _ymin = _ymax = 0.0; ! _parent = nil; ! } ! ! Graphic31::Graphic31 ( const Brush* brush, const Color* stroke, const Color* fill, ! const Font* font, boolean closed, boolean curved, int coords, ! Transformer* t ) { _brush = brush; Resource::ref(_brush); *************** *** 40,62 **** Resource::ref(_stroke); _fill = fill; Resource::ref(_fill); _closed = closed; _curved = curved; ! _count = 0; ! _x = new Coord[coords]; ! _y = new Coord[coords]; } ! Fig31::~Fig31 () { Resource::unref(_brush); Resource::unref(_stroke); Resource::unref(_fill); ! delete [] _x; ! delete [] _y; } ! void Fig31::add_point(Coord x, Coord y) { ! if (_count == 0) { _xmin = x - 1; _xmax = x + 1; _ymin = y - 1; --- 94,595 ---- Resource::ref(_stroke); _fill = fill; Resource::ref(_fill); + _font = font; + Resource::ref(_font); _closed = closed; _curved = curved; ! _ctrlpts = 0; ! if (coords > 0) { ! _x = new Coord[coords]; ! _y = new Coord[coords]; ! } else { ! _x = nil; ! _y = nil; ! } ! _buf_size = coords; ! _t = nil; ! if (t != nil) { ! _t = new Transformer; ! *_t = *t; ! } ! _parent = nil; } ! Graphic31::~Graphic31 () { Resource::unref(_brush); Resource::unref(_stroke); Resource::unref(_fill); ! Resource::unref(_font); ! Resource::unref(_t); ! delete _x; ! delete _y; ! } ! ! int Graphic31::ctrlpts (Coord*& x, Coord*& y) const{ ! x = _x; ! y = _y; ! return _ctrlpts; ! } ! ! void Graphic31::ctrlpts (Coord* x, Coord* y, int count) { ! delete _x; ! delete _y; ! _ctrlpts = max(count+1, buf_size); ! _x = new Coord[_ctrlpts]; ! _y = new Coord[_ctrlpts]; ! for (int i = 0; i < count; i++) { ! _x[i] = x[i]; ! _y[i] = y[i]; ! } ! } ! ! boolean Graphic31::grasp (const Event& e, Tool31& tool) { ! ToolState& ts = tool.toolstate(); ! ts._init = e; ! ts._last = e; ! getbounds(ts._l, ts._b, ts._r, ts._t); ! if (tool.tool() == Tool31::scale) { ! Coord lx, ly; ! Coord cx, cy; ! lx = e.pointer_x(); ! ly = e.pointer_y(); ! cx = (ts._l + ts._r)/2.0; ! cy = (ts._b + ts._t)/2.0; ! ! scale( ! Math::abs((lx-cx)*2.0/(ts._r-ts._l)), ! Math::abs((ly-cy)*2.0/(ts._t-ts._b)), ! cx, cy ! ); ! } ! ! return true; ! } ! ! boolean Graphic31::manipulating (const Event& e, Tool31& tool) { ! if (e.type() == Event::up) { ! return false; ! } else if (e.type() == Event::motion) { ! unsigned int tool_type = tool.tool(); ! ToolState& ts = tool.toolstate(); ! ! if (tool_type != Tool31::nop) { ! float pi = 3.14159; ! Graphic31 gs; ! Transformer* tx = ts._gs.transformer(); ! ! Coord x, y, lx, ly; ! ! x = ts._last.pointer_x(); ! y = ts._last.pointer_y(); ! lx = e.pointer_x(); ! ly = e.pointer_y(); ! ! switch(tool_type) { ! case Tool31::select: ! break; ! case Tool31::move: ! { ! if (tx != nil) { ! tx->inverse_transform(lx, ly); ! tx->inverse_transform(x, y); ! } ! translate(lx-x, ly-y); ! ts._last = e; ! } ! break; ! case Tool31::scale: ! { ! Coord cx, cy; ! cx = (ts._l + ts._r)/2.0; ! cy = (ts._b + ts._t)/2.0; ! ! scale((lx-cx)/(x-cx), (ly-cy)/(y-cy), cx, cy); ! ts._last = e; ! } ! break; ! case Tool31::rotate: ! { ! Coord cx, cy; ! cx = (ts._l + ts._r)/2.0; ! cy = (ts._b + ts._t)/2.0; ! ! float ldy = ly-cy; float ldx = lx-cx; ! float dy = y-cy; float dx = x-cx; ! ! float cur = atan(ldy/ldx)/pi*180.0; ! float last = atan(dy/dx)/pi*180.0; ! ! if (ldx < 0.0) { ! cur += 180.0; ! } ! if (dx < 0.0) { ! last += 180.0; ! } ! ! rotate(cur-last, cx, cy); ! ts._last = e; ! } ! break; ! } ! } ! } ! return true; ! } ! ! boolean Graphic31::effect (const Event&, Tool31&) { ! return true; ! } ! ! void Graphic31::flush () {} ! ! Glyph* Graphic31::clone () const { return nil; } ! ! Transformer* Graphic31::transformer() { return _t; } ! ! /* To be replaced by templates */ ! ! void Graphic31::transformer(Transformer* t) { ! if (t != nil) { ! Resource::ref(t); ! } ! if (_t != nil) { ! Resource::unref(_t); ! } ! _t = t; ! } ! ! const Brush* Graphic31::brush() { return _brush; } ! ! void Graphic31::brush(const Brush* b) { ! if (b != nil) { ! Resource::ref(b); ! } ! if (_brush != nil) { ! Resource::unref(_brush); ! } ! _brush = b; ! } ! ! const Color* Graphic31::stroke() { return _stroke; } ! ! void Graphic31::stroke(const Color* s) { ! if (s != nil) { ! Resource::ref(s); ! } ! if (_stroke != nil) { ! Resource::unref(_stroke); ! } ! _stroke = s; ! } ! ! const Color* Graphic31::fill() { return _fill; } ! ! void Graphic31::fill(const Color* f) { ! if (f != nil) { ! Resource::ref(f); ! } ! if (_fill != nil) { ! Resource::unref(_fill); ! } ! _fill = f; ! } ! ! const Font* Graphic31::font() { return _font; } ! ! void Graphic31::font(const Font* f) { ! if (f != nil) { ! Resource::ref(f); ! } ! if (_font != nil) { ! Resource::unref(_font); ! } ! _font = f; ! } ! ! void Graphic31::closed (boolean c) { _closed = c; } ! ! boolean Graphic31::closed () { return _closed; } ! ! void Graphic31::curved (boolean c) { _curved = c; } ! ! boolean Graphic31::curved () { return _curved; } ! ! void Graphic31::parent (Graphic31* p) { _parent = p; } ! ! Graphic31* Graphic31::parent () { return _parent; } ! ! Graphic31* Graphic31::root () { ! Graphic31* cur, *parent = this; ! ! do { ! cur = parent; ! parent = cur->parent(); ! } while (parent != nil); ! ! return cur; ! } ! ! void Graphic31::total_gs (Graphic31& gs) { ! Graphic31* p = parent(); ! ! if (p == nil) { ! concat(nil, this, &gs); ! ! } else { ! p->total_gs(gs); ! concat(this, &gs, &gs); ! } ! } ! ! void Graphic31::translate (float dx, float dy) { ! if (dx != 0 || dy != 0) { ! if (_t == nil) { ! _t = new Transformer; ! } ! _t->translate(dx, dy); ! } ! } ! ! void Graphic31::scale (float sx, float sy, float cx, float cy) { ! float ncx, ncy; ! ! if (sx != 1.0 || sy != 1.0) { ! if (_t == nil) { ! _t = new Transformer; ! } ! Transformer parents; ! parentXform(parents); ! parents.InvTransform(cx, cy, ncx, ncy); ! ! if (ncx != 0 || ncy != 0) { ! _t->translate(-ncx, -ncy); ! _t->scale(sx, sy); ! _t->translate(ncx, ncy); ! } else { ! _t->scale(sx, sy); ! } ! } ! } ! ! void Graphic31::rotate (float angle, float cx, float cy) { ! float mag = (angle < 0) ? -angle : angle; ! float ncx, ncy; ! ! if ((mag - int(mag)) != 0 || int(mag)%360 != 0) { ! if (_t == nil) { ! _t = new Transformer; ! } ! Transformer parents; ! parentXform(parents); ! parents.InvTransform(cx, cy, ncx, ncy); ! ! if (ncx != 0 || ncy != 0) { ! _t->translate(-ncx, -ncy); ! _t->rotate(angle); ! _t->translate(ncx, ncy); ! } else { ! _t->rotate(angle); ! } ! } ! } ! ! void Graphic31::align (Alignment falign, Graphic31* moved, Alignment malign) { ! float fx0, fy0, fx1, fy1, mx0, my0, mx1, my1, dx = 0, dy = 0; ! ! getbounds(fx0, fy0, fx1, fy1); ! moved->getbounds(mx0, my0, mx1, my1); ! ! switch (falign) { ! case BottomLeft: ! case CenterLeft: ! case TopLeft: ! case Left: ! dx = fx0; ! break; ! case BottomCenter: ! case Center: ! case TopCenter: ! case HorizCenter: ! dx = (fx0 + fx1 + 1)/2; ! break; ! case BottomRight: ! case CenterRight: ! case TopRight: ! case Right: ! dx = fx1 + 1; ! break; ! } ! switch (falign) { ! case BottomLeft: ! case BottomCenter: ! case BottomRight: ! case Bottom: ! dy = fy0; ! break; ! case CenterLeft: ! case Center: ! case CenterRight: ! case VertCenter: ! dy = (fy0 + fy1 + 1)/2; ! break; ! case TopLeft: ! case TopCenter: ! case TopRight: ! case Top: ! dy = fy1 + 1; ! break; ! } ! ! switch (malign) { ! case BottomLeft: ! case CenterLeft: ! case TopLeft: ! case Left: ! dx -= mx0; ! break; ! case BottomCenter: ! case Center: ! case TopCenter: ! case HorizCenter: ! dx -= (mx0 + mx1 + 1)/2; ! break; ! case BottomRight: ! case CenterRight: ! case TopRight: ! case Right: ! dx -= (mx1 + 1); ! break; ! } ! switch (malign) { ! case BottomLeft: ! case BottomCenter: ! case BottomRight: ! case Bottom: ! dy -= my0; ! break; ! case CenterLeft: ! case Center: ! case CenterRight: ! case VertCenter: ! dy -= (my0 + my1 + 1)/2; ! break; ! case TopLeft: ! case TopCenter: ! case TopRight: ! case Top: ! dy -= (my1 + 1); ! break; ! } ! if (dx != 0 || dy != 0) { ! Transformer parents; ! moved->parentXform(parents); ! ! parents.Invert(); ! parents.Transform(0.0, 0.0, fx0, fy0); ! parents.Transform(dx, dy, mx0, my0); ! ! moved->translate(mx0-fx0, my0-fy0); ! } ! } ! ! void Graphic31::recompute_shape () { ! if (_ctrlpts == 0) { ! return; ! } else { ! _xmin = _xmax = _x[0]; ! _ymin = _ymax = _y[0]; ! } ! for (int i = 1; i < _ctrlpts; i++) { ! _xmin = Math::min(_xmin, _x[i]); ! _xmax = Math::max(_xmax, _x[i]); ! _ymin = Math::min(_ymin, _y[i]); ! _ymax = Math::max(_ymax, _y[i]); ! } ! } ! ! void Graphic31::getbounds (float& x0, float& y0, float& x1, float& y1) { ! Graphic31 gs; ! ! total_gs(gs); ! getbounds_gs(x0, y0, x1, y1, &gs); ! } ! ! void Graphic31::getcenter (float& x, float& y) { ! Graphic31 gs; ! float l, b, tol; ! ! total_gs(gs); ! getextent_gs(l, b, x, y, tol, &gs); ! } ! ! boolean Graphic31::contains (PointObj& p) { ! if (parent() == nil) { ! return contains_gs(p, this); ! ! } else { ! Graphic31 gs; ! total_gs(gs); ! return contains_gs(p, &gs); ! } ! } ! ! boolean Graphic31::intersects (BoxObj& b) { ! if (parent() == nil) { ! return intersects_gs(b, this); ! ! } else { ! Graphic31 gs; ! total_gs(gs); ! return intersects_gs(b, &gs); ! } ! } ! ! void Graphic31::undraw () {} ! void Graphic31::append_(Graphic31*) {} ! void Graphic31::prepend_(Graphic31*) {} ! void Graphic31::insert_(GlyphIndex, Graphic31*) {} ! void Graphic31::remove_(GlyphIndex) {} ! void Graphic31::replace_(GlyphIndex, Graphic31*) {} ! void Graphic31::change_(GlyphIndex) {} ! GlyphIndex Graphic31::count_ () const { return 0; } ! Graphic31* Graphic31::component_ (GlyphIndex) const { return nil; } ! void Graphic31::modified_ (GlyphIndex) {} ! ! Graphic31* Graphic31::first_containing (PointObj&) { return nil; } ! Graphic31* Graphic31::last_containing (PointObj&) { return nil; } ! Graphic31* Graphic31::first_intersecting (BoxObj&) { return nil; } ! Graphic31* Graphic31::last_intersecting (BoxObj&) { return nil; } ! Graphic31* Graphic31::first_within (BoxObj&) { return nil; } ! Graphic31* Graphic31::last_within (BoxObj&) { return nil; } ! ! Graphic31& Graphic31::operator = (Graphic31& g) { ! brush(g.brush()); ! stroke(g.stroke()); ! fill(g.fill()); ! font(g.font()); ! ! if (g._t == nil) { ! Resource::unref(_t); ! _t = nil; ! ! } else { ! if (_t == nil) { ! _t = new Transformer(g._t); ! } else { ! *_t = *g._t; ! } ! } ! return *this; } ! void Graphic31::get_original (const Coord*& x, const Coord*& y) { ! x = _x; ! y = _y; ! } ! ! void Graphic31::add_point(Coord x, Coord y) { ! if (_ctrlpts == 0) { _xmin = x - 1; _xmax = x + 1; _ymin = y - 1; *************** *** 67,78 **** _ymin = Math::min(_ymin, y); _ymax = Math::max(_ymax, y); } ! _x[_count] = x; ! _y[_count] = y; ! _count += 1; } ! void Fig31::add_curve( Coord x, Coord y, Coord x1, Coord y1, Coord x2, Coord y2 ) { add_point(x1, y1); --- 600,622 ---- _ymin = Math::min(_ymin, y); _ymax = Math::max(_ymax, y); } ! _x[_ctrlpts] = x; ! _y[_ctrlpts] = y; ! _ctrlpts += 1; ! if (_ctrlpts >= _buf_size) { ! _buf_size = buf_size + _buf_size; ! Coord* x = new Coord[_buf_size]; ! Coord* y = new Coord[_buf_size]; ! Memory::copy(_x, x, _ctrlpts*sizeof(int)); ! Memory::copy(_y, y, _ctrlpts*sizeof(int)); ! delete _x; ! delete _y; ! _x = x; ! _y = y; ! } } ! void Graphic31::add_curve( Coord x, Coord y, Coord x1, Coord y1, Coord x2, Coord y2 ) { add_point(x1, y1); *************** *** 80,86 **** add_point(x, y); } ! void Fig31::Bspline_move_to ( Coord x, Coord y, Coord x1, Coord y1, Coord x2, Coord y2 ) { Coord p1x = (x + x + x1) / 3; --- 624,630 ---- add_point(x, y); } ! void Graphic31::Bspline_move_to ( Coord x, Coord y, Coord x1, Coord y1, Coord x2, Coord y2 ) { Coord p1x = (x + x + x1) / 3; *************** *** 90,96 **** add_point((p1x + p2x) / 2, (p1y + p2y) / 2); } ! void Fig31::Bspline_curve_to ( Coord x, Coord y, Coord x1, Coord y1, Coord x2, Coord y2 ) { Coord p1x = (x + x + x1) / 3; --- 634,640 ---- add_point((p1x + p2x) / 2, (p1y + p2y) / 2); } ! void Graphic31::Bspline_curve_to ( Coord x, Coord y, Coord x1, Coord y1, Coord x2, Coord y2 ) { Coord p1x = (x + x + x1) / 3; *************** *** 102,191 **** add_curve((p1x + p2x) / 2, (p1y + p2y) / 2, p3x, p3y, p1x, p1y); } ! void Fig31::request(Requisition& requisition) const { ! if (_count > 0) { ! Requirement rx(-_xmin, -_xmin, -_xmin, _xmax, _xmax, _xmax); ! Requirement ry(-_ymin, -_ymin, -_ymin, _ymax, _ymax, _ymax); ! requisition.require(Dimension_X, rx); ! requisition.require(Dimension_Y, ry); } } ! void Fig31::allocate(Canvas* c, const Allocation& a, Extension& ext) { ! if (_count > 0) { Coord w = _brush == nil ? 0 : _brush->width(); Coord x = a.x(); Coord y = a.y(); ! ext.merge_xy( ! c, x + _xmin - w, y + _ymin - w, ! x + _xmax + w, y + _ymax + w ! ); } } ! void Fig31::draw(Canvas* c, const Allocation& allocation) const { ! if (c != nil && _count > 0) { ! Coord x = allocation.x(); ! Coord y = allocation.y(); ! c->new_path(); ! c->move_to(x + _x[0], y + _y[0]); ! if (_curved) { ! for (int i = 1; i < _count; i += 3) { ! c->curve_to( ! x + _x[i + 2], y + _y[i + 2], ! x + _x[i], y + _y[i], ! x + _x[i + 1], y + _y[i + 1] ! ); } ! } else { ! for (int i = 1; i < _count; ++i) { ! c->line_to(x + _x[i], y + _y[i]); } } ! if (_closed) { ! c->close_path(); } ! if (_fill != nil) { ! c->fill(_fill); } ! if (_brush != nil && _stroke != nil) { ! c->stroke(_stroke, _brush); } } } ! Fig31Line::Fig31Line( const Brush* brush, const Color* stroke, const Color* fill, ! Coord x1, Coord y1, Coord x2, Coord y2 ! ) : Fig31(brush, stroke, fill, false, false, 2) { add_point(x1, y1); add_point(x2, y2); } ! Fig31Line::~Fig31Line () { } ! Fig31Rectangle::Fig31Rectangle ( const Brush* brush, const Color* stroke, const Color* fill, ! Coord l, Coord b, Coord r, Coord t ! ) : Fig31(brush, stroke, fill, true, false, 4) { ! add_point(l, b); ! add_point(l, t); ! add_point(r, t); add_point(r, b); } ! Fig31Rectangle::~Fig31Rectangle () { } static float p0 = 1.00000000; static float p1 = 0.89657547; // cos 30 * sqrt(1 + tan 15 * tan 15) static float p2 = 0.70710678; // cos 45 static float p3 = 0.51763809; // cos 60 * sqrt(1 + tan 15 * tan 15) static float p4 = 0.26794919; // tan 15 ! Fig31Circle::Fig31Circle ( const Brush* brush, const Color* stroke, const Color* fill, ! Coord x, Coord y, Coord r ! ) : Fig31(brush, stroke, fill, true, true, 25) { float px0 = p0 * r, py0 = p0 * r; float px1 = p1 * r, py1 = p1 * r; float px2 = p2 * r, py2 = p2 * r; --- 646,1623 ---- add_curve((p1x + p2x) / 2, (p1y + p2y) / 2, p3x, p3y, p1x, p1y); } ! void Graphic31::request(Requisition& req) const { ! if (_ctrlpts > 0) { ! Coord left = _xmin, bottom = _ymin; ! Coord right = _xmax, top = _ymax; ! Requirement& rx = req.x_requirement(); ! Requirement& ry = req.y_requirement(); ! ! if (_t != nil) { ! corners(left, bottom, right, top, *_t); ! } ! ! rx.natural(right - left); ! rx.stretch(0.0); ! rx.shrink(0.0); ! rx.alignment(-left / rx.natural()); ! ! ry.natural(top - bottom); ! ry.stretch(0.0); ! ry.shrink(0.0); ! ry.alignment(-bottom / ry.natural()); } } ! void Graphic31::allocate(Canvas* c, const Allocation& a, Extension& ext) { ! if (_ctrlpts > 0) { Coord w = _brush == nil ? 0 : _brush->width(); Coord x = a.x(); Coord y = a.y(); ! ext.merge_xy( ! c, x + _xmin - w, x + _xmax + w, ! y + _ymin - w, y + _ymax + w ! ); ! } ! } ! ! void Graphic31::draw(Canvas* c, const Allocation& a) const { ! if (c != nil) { ! boolean no_transformer = !_t; ! if (no_transformer) ((Graphic31*)this)->_t = new Transformer(); ! _t->Translate(a.x(), a.y()); ! Graphic31* gr = (Graphic31*) this; ! CanvasDamage& cd = c->rep()->damage_; ! gr->drawclipped( ! c, cd.left, cd.bottom, cd.right, cd.top ! ); ! _t->Translate(-a.x(), -a.y()); ! if (no_transformer) { ! delete _t; ! ((Graphic31*)this)->_t = nil; ! } ! } ! } ! ! void Graphic31::drawit (Canvas* c) { ! if (parent() == nil) { ! draw_gs(c, this); ! ! } else { ! Graphic31 gs; ! total_gs(gs); ! draw_gs(c, &gs); ! } ! } ! ! void Graphic31::drawclipped (Canvas* c, Coord l, Coord b, Coord r, Coord t) { ! if (parent() == nil) { ! drawclipped_gs(c, l, b, r, t, this); ! } else { ! Graphic31 gs; ! total_gs(gs); ! drawclipped_gs(c, l, b, r, t, &gs); ! } ! } ! ! void Graphic31::draw_gs (Canvas* c, Graphic31* gs) { ! const Brush* brush = gs->brush(); ! const Color* stroke = gs->stroke(); ! const Color* fill = gs->fill(); ! Transformer* tx = gs->transformer(); ! if (tx != nil) { ! c->push_transform(); ! c->transform(*tx); ! } ! c->new_path(); ! c->move_to(_x[0], _y[0]); ! if (_curved) { ! for (int i = 1; i < _ctrlpts; i += 3) { ! c->curve_to( ! _x[i + 2], _y[i + 2], ! _x[i], _y[i], ! _x[i + 1], _y[i + 1] ! ); ! } ! } else { ! for (int i = 1; i < _ctrlpts; ++i) { ! c->line_to(_x[i], _y[i]); ! } ! } ! if (_closed) { ! c->close_path(); ! } ! if (fill != nil) { ! c->fill(fill); ! } ! if (brush != nil && stroke != nil) { ! c->stroke(stroke, brush); ! } ! if (tx != nil) { ! c->pop_transform(); ! } ! } ! ! void Graphic31::drawclipped_gs ( ! Canvas* c, Coord l, Coord b, Coord r, Coord t, Graphic31* gs ! ) { ! Coord ll, bb, rr, tt; ! getbounds_gs(ll, bb, rr, tt, gs); ! ! BoxObj thisBox(ll, bb, rr, tt); ! BoxObj clipBox(l, b, r, t); ! if (clipBox.Intersects(thisBox)) { ! draw_gs(c, gs); ! } ! } ! ! void Graphic31::eqv_transformer (Transformer& total) { ! Graphic31* p = parent(); ! ! if (p == nil) { ! concatXform(nil, _t, &total); ! ! } else { ! p->eqv_transformer(total); ! concatXform(_t, &total, &total); ! } ! } ! ! void Graphic31::getextent_gs ( ! Coord& l, Coord& b, Coord& cx, Coord& cy, float& tol, Graphic31* gs ! ) { ! tol = 1.0; ! const Brush* br = gs->brush(); ! if (br != nil) { ! float width = float(br->Width()); ! tol = (width > 1) ? width : tol; ! } ! if (_ctrlpts > 0) { ! Coord left = _xmin, bottom = _ymin; ! Coord right = _xmax, top = _ymax; ! Transformer* t = gs->transformer(); ! ! if (t != nil) { ! corners(left, bottom, right, top, *t); ! } ! l = left; ! b = bottom; ! cx = (left + right)/2.0; ! cy = (top + bottom)/2.0; ! } ! } ! ! void Graphic31::getbounds_gs ( ! Coord& l, Coord& b, Coord& r, Coord& t, Graphic31* gs ! ) { ! float tol; ! ! getextent_gs(l, b, r, t, tol, gs); ! r += r - l; ! t += t - b; ! l -= tol; ! b -= tol; ! r += tol; ! t += tol; ! } ! ! static void invXform_gs (Coord& tx, Coord& ty, Graphic31* g) { ! Transformer* t = g->transformer(); ! if (t != nil) { ! t->inverse_transform(tx, ty); } } ! static void Xform_gs( ! Coord x[], Coord y[], int n, Coord tx[], Coord ty[], Graphic31* g ! ) { ! Transformer* t = g->transformer(); ! if (t != nil) { ! register Coord* ox, * oy, *nx, *ny; ! Coord* lim; ! ! lim = &x[n]; ! for ( ! ox = x, oy = y, nx = tx, ny = ty; ox < lim; ox++, oy++, nx++, ny++ ! ) { ! t->transform(*ox, *oy, *nx, *ny); ! } ! } else { ! Memory::copy(x, tx, n*sizeof(Coord)); ! Memory::copy(y, ty, n*sizeof(Coord)); ! } ! } ! ! boolean Graphic31::contains_gs (PointObj& po, Graphic31* gs) { ! Coord ll, bb, rr, tt; ! PointObj pt (&po); ! getbounds_gs(ll, bb, rr, tt, gs); ! BoxObj b(ll, bb, rr, tt);; ! ! if (!_curved && !_fill) { ! if (b.Contains(po)) { ! MultiLineObj ml (_x, _y, _ctrlpts); ! invXform_gs(pt._x, pt._y, gs); ! if (_closed) { ! LineObj l (_x[_ctrlpts - 1], _y[_ctrlpts - 1], *_x, *_y); ! return ml.Contains(pt) || l.Contains(pt); ! } else { ! return ml.Contains(pt); } ! } ! return false; ! ! } else if (!_curved && _fill) { ! if (b.Contains(pt)) { ! FillPolygonObj fp (_x, _y, _ctrlpts); ! invXform_gs(pt._x, pt._y, gs); ! return fp.Contains(pt); ! } ! return false; ! ! } else if (_curved && !_fill) { ! if (b.Contains(pt)) { ! MultiLineObj ml; ! if (_closed) { ! ml.ClosedSplineToPolygon(_x, _y, _ctrlpts); ! } else { ! ml.SplineToMultiLine(_x, _y, _ctrlpts); } + invXform_gs(pt._x, pt._y, gs); + return ml.Contains(pt); } ! return false; ! ! } else { ! if (b.Contains(pt)) { ! FillPolygonObj fp; ! fp.ClosedSplineToPolygon(_x, _y, _ctrlpts); ! invXform_gs(pt._x, pt._y, gs); ! return fp.Contains(pt); } ! return false; ! } ! } ! ! boolean Graphic31::intersects_gs (BoxObj& userb, Graphic31* gs) { ! Coord* convx, *convy; ! Coord ll, bb, rr, tt; ! getbounds_gs(ll, bb, rr, tt, gs); ! BoxObj b(ll, bb, rr, tt);; ! boolean result = false; ! ! if (!_curved && !_fill) { ! if (b.Intersects(userb)) { ! convx = new Coord[_ctrlpts+1]; ! convy = new Coord[_ctrlpts+1]; ! Xform_gs(_x, _y, _ctrlpts, convx, convy, gs); ! if (_closed) { ! convx[_ctrlpts] = *convx; ! convy[_ctrlpts] = *convy; ! MultiLineObj ml(convx, convy, _ctrlpts+1); ! result = ml.Intersects(userb); ! } else { ! MultiLineObj ml(convx, convy, _ctrlpts); ! result = ml.Intersects(userb); ! } ! delete convx; ! delete convy; ! } ! return result; ! ! } else if (!_curved && _fill) { ! if (b.Intersects(userb)) { ! convx = new Coord[_ctrlpts]; ! convy = new Coord[_ctrlpts]; ! Xform_gs(_x, _y, _ctrlpts, convx, convy, gs); ! FillPolygonObj fp (convx, convy, _ctrlpts); ! result = fp.Intersects(userb); ! delete convx; ! delete convy; ! } ! return result; ! ! } else if (_curved && !_fill) { ! if (b.Intersects(userb)) { ! convx = new Coord[_ctrlpts]; ! convy = new Coord[_ctrlpts]; ! Xform_gs(_x, _y, _ctrlpts, convx, convy, gs); ! MultiLineObj ml; ! if (_closed) { ! ml.ClosedSplineToPolygon(convx, convy, _ctrlpts); ! } else { ! ml.SplineToMultiLine(convx, convy, _ctrlpts); ! } ! result = ml.Intersects(userb); ! delete convx; ! delete convy; ! } ! return result; ! ! } else { ! if (b.Intersects(userb)) { ! convx = new Coord[_ctrlpts]; ! convy = new Coord[_ctrlpts]; ! Xform_gs(_x, _y, _ctrlpts, convx, convy, gs); ! FillPolygonObj fp; ! fp.ClosedSplineToPolygon(convx, convy, _ctrlpts); ! result = fp.Intersects(userb); ! delete convx; ! delete convy; ! } ! return result; ! } ! } ! ! void Graphic31::parentXform (Transformer& t) { ! Transformer identity; ! Graphic31* p = parent(); ! ! if (p == nil) { ! *(&t) = *(&identity); ! } else { ! p->eqv_transformer(t); ! } ! } ! ! void Graphic31::concat_gs (Graphic31* a, Graphic31* b, Graphic31* dest) { ! const Color* stroke, *fill; ! const Font* font; ! const Brush* br; ! ! if (a == nil) { ! *dest = *b; ! return; ! } else if (b == nil) { ! *dest = *a; ! return; ! } ! ! if ((fill = b->fill()) == nil) { ! fill = a->fill(); ! } ! dest->fill(fill); ! ! if ((stroke = b->stroke()) == nil) { ! stroke = a->stroke(); ! } ! dest->stroke(stroke); ! ! if ((font = b->font()) == nil) { ! font = a->font(); ! } ! dest->font(font); ! ! if ((br = b->brush()) == nil) { ! br = a->brush(); ! } ! dest->brush(br); ! } ! ! void Graphic31::concatXform ( ! Transformer* a, Transformer* b, Transformer* dest ! ) { ! Transformer identity; ! if (a == nil) { ! *dest = (b == nil) ? *(&identity) : *b; ! ! } else if (b == nil) { ! *dest = *a; ! ! } else { ! Transformer tmp(a); ! tmp.Postmultiply(b); ! *dest = tmp; ! } ! } ! ! void Graphic31::concat (Graphic31* a, Graphic31* b, Graphic31* dest) { ! Transformer* ta = (a == nil) ? nil : a->transformer(); ! Transformer* tb = (b == nil) ? nil : b->transformer(); ! Transformer* td = dest->transformer(); ! if (td == nil) { ! td = new Transformer; ! } else { ! Resource::ref(td); ! } ! concatXform(ta, tb, td); ! dest->transformer(td); ! concat_gs(a, b, dest); ! Resource::unref(td); ! } ! ! boolean Graphic31::contains_ (Graphic31* g, PointObj& p, Graphic31* gs) { ! return g->contains_gs(p, gs); ! } ! boolean Graphic31::intersects_ (Graphic31* g, BoxObj& b, Graphic31* gs) { ! return g->intersects_gs(b, gs); ! } ! void Graphic31::getbounds_ ( ! Graphic31* g, Coord& l, Coord& b, Coord& r, Coord& t, Graphic31* gs ! ) { ! g->getbounds_gs(l, b, r, t, gs); ! } ! void Graphic31::total_gs_(Graphic31* gr, Graphic31& gs) { ! gr->total_gs(gs); ! } ! void Graphic31::concatgs_ (Graphic31* gr, Graphic31* a, Graphic31* b, Graphic31* dest) { ! gr->concat_gs(a, b, dest); ! } ! void Graphic31::concatXform_ ( ! Graphic31* gr, Transformer* a, Transformer* b, Transformer* dest ! ) { ! gr->concatXform(a, b, dest); ! } ! void Graphic31::concat_ (Graphic31* g, Graphic31* a, Graphic31* b, Graphic31* d) { ! g->concat(a, b, d); ! } ! void Graphic31::getextent_ ( ! Graphic31* gr,Coord& l, Coord& b, Coord& r, Coord& t, float& tol, Graphic31* gs ! ) { ! gr->getextent_gs(l, b, r, t, tol, gs); ! } ! void Graphic31::draw_ (Graphic31* gr, Canvas* c, Graphic31* gs) { ! gr->draw_gs(c, gs); ! } ! void Graphic31::drawclipped_ ( ! Graphic31* gr, Canvas* c, Coord l, Coord b, Coord r, Coord t, Graphic31* gs ! ) { ! gr->drawclipped_gs(c, l, b, r, t, gs); ! } ! void Graphic31::transform_ (Coord x, Coord y, Coord& tx, Coord& ty, Graphic31* g) { ! Transformer* t = (g == nil) ? transformer() : g->transformer(); ! ! if (t != nil) { ! t->Transform(x, y, tx, ty); ! } else { ! tx = x; ! ty = y; ! } ! } ! ! /************************************************************************/ ! ! PolyGraphic::PolyGraphic (Graphic31* gr) : Graphic31 (gr) { ! LayoutKit* layout = LayoutKit::instance(); ! _body = layout->overlay(); ! } ! ! PolyGraphic::~PolyGraphic () { ! delete _body; ! } ! ! void PolyGraphic::request (Requisition& req) const { ! _body->request(req); ! Requirement& rx = req.x_requirement(); ! Requirement& ry = req.y_requirement(); ! ! Coord left, bottom, right, top; ! left = -rx.natural()*rx.alignment(); ! right = left + rx.natural(); ! bottom = -ry.natural()*ry.alignment(); ! top = bottom + ry.natural(); ! ! if (_t != nil) { ! corners(left, bottom, right, top, *_t); ! } ! rx.natural(right - left); ! rx.stretch(0.0); ! rx.shrink(0.0); ! rx.alignment(-left / rx.natural()); ! ! ry.natural(top - bottom); ! ry.stretch(0.0); ! ry.shrink(0.0); ! ry.alignment(-bottom / ry.natural()); ! } ! ! void PolyGraphic::allocate (Canvas* c, const Allocation& a, Extension& ext) { ! if (_t != nil) { ! c->push_transform(); ! c->transform(*_t); ! } ! _body->allocate(c, a, ext); ! if (_t != nil) { ! c->pop_transform(); ! } ! } ! ! void PolyGraphic::undraw () { _body->undraw(); } ! ! void PolyGraphic::append_ (Graphic31* g) { ! _body->append(g); ! g->parent(this); ! } ! ! void PolyGraphic::prepend_ (Graphic31* g) { ! _body->prepend(g); ! g->parent(this); ! } ! ! void PolyGraphic::insert_ (GlyphIndex i, Graphic31* g) { ! _body->insert(i, g); ! g->parent(this); ! } ! ! void PolyGraphic::remove_ (GlyphIndex i) { ! Graphic31* gr = (Graphic31*)_body->component(i); ! if (gr != nil) { ! gr->parent(nil); ! } ! _body->remove(i); ! } ! ! void PolyGraphic::replace_ (GlyphIndex i, Graphic31* g) { ! Graphic31* gr = (Graphic31*) _body->component(i); ! gr->parent(nil); ! _body->replace(i, g); ! g->parent(this); ! } ! ! void PolyGraphic::change_ (GlyphIndex i) { _body->change(i); } ! ! void PolyGraphic::modified_ (GlyphIndex i) { _body->modified(i); } ! ! void PolyGraphic::flush () { ! GlyphIndex count = count_(); ! ! for (GlyphIndex i = 0; i < count; i++) { ! Graphic31* gr = component_(i); ! concat_(gr, gr, this, gr); ! gr->flush(); ! } ! Graphic31 n; ! *((Graphic31*) this) = *(&n); ! } ! ! Glyph* PolyGraphic::clone () const { ! Graphic31* pg = new PolyGraphic((Graphic31*)this); ! ! GlyphIndex count = _body->count(); ! for (GlyphIndex i = 0; i < count; i++) { ! Glyph* gr = _body->component(i); ! pg->append(gr->clone()); ! } ! return pg; ! } ! ! GlyphIndex PolyGraphic::count_ () const { return _body->count(); } ! ! Graphic31* PolyGraphic::component_ (GlyphIndex i) const { ! return (Graphic31*) _body->component(i); ! } ! ! Graphic31* PolyGraphic::first_containing (PointObj& pt) { ! GlyphIndex count = _body->count(); ! ! for (GlyphIndex i = 0; i < count; i++) { ! Graphic31* gr = (Graphic31*) _body->component(i); ! ! if (gr->contains(pt)) { ! return gr; ! } ! } ! return nil; ! } ! ! Graphic31* PolyGraphic::last_containing (PointObj& pt) { ! GlyphIndex count = _body->count(); ! ! for (GlyphIndex i = count-1; i >= 0; i--) { ! Graphic31* gr = (Graphic31*) _body->component(i); ! ! if (gr->contains(pt)) { ! return gr; } ! } ! return nil; ! } ! ! Graphic31* PolyGraphic::first_intersecting (BoxObj& b) { ! GlyphIndex count = _body->count(); ! ! for (GlyphIndex i = 0; i < count; i++) { ! Graphic31* gr = (Graphic31*) _body->component(i); ! ! if (gr->intersects(b)) { ! return gr; } } + return nil; } + + Graphic31* PolyGraphic::last_intersecting (BoxObj& b) { + GlyphIndex count = _body->count(); + + for (GlyphIndex i = count-1; i >= 0; i--) { + Graphic31* gr = (Graphic31*) _body->component(i); ! if (gr->intersects(b)) { ! return gr; ! } ! } ! return nil; ! } ! ! Graphic31* PolyGraphic::first_within (BoxObj& gb) { ! GlyphIndex count = _body->count(); ! Coord l, b, r, t; ! ! for (GlyphIndex i = 0; i < count; i++) { ! Graphic31* gr = (Graphic31*) _body->component(i); ! gr->getbounds(l, b, r, t); ! ! BoxObj box(l, b, r, t); ! if (box.Within(gb)) { ! return gr; ! } ! } ! return nil; ! } ! ! Graphic31* PolyGraphic::last_within (BoxObj& gb) { ! GlyphIndex count = _body->count(); ! Coord l, b, r, t; ! ! for (GlyphIndex i = count-1; i >= 0; i--) { ! Graphic31* gr = (Graphic31*) _body->component(i); ! gr->getbounds(l, b, r, t); ! ! BoxObj box(l, b, r, t); ! if (box.Within(gb)) { ! return gr; ! } ! } ! return nil; ! } ! ! void PolyGraphic::draw_gs (Canvas* c, Graphic31* gs) { ! Graphic31 gstemp; ! ! GlyphIndex count = _body->count(); ! for (GlyphIndex i = 0; i < count; i++) { ! Graphic31* gr = (Graphic31*) _body->component(i); ! concat_(gr, gr, gs, &gstemp); ! draw_(gr, c, &gstemp); ! } ! } ! ! void PolyGraphic::drawclipped_gs ( ! Canvas* c, Coord l, Coord b, Coord r, Coord t, Graphic31* gs ! ) { ! Graphic31 gstemp; ! ! GlyphIndex count = _body->count(); ! for (GlyphIndex i = 0; i < count; i++) { ! Graphic31* gr = (Graphic31*) _body->component(i); ! concat_(gr, gr, gs, &gstemp); ! drawclipped_(gr, c, l, b, r, t, &gstemp); ! } ! } ! ! void PolyGraphic::getextent_gs ( ! Coord& l, Coord& b, Coord& cx, Coord& cy, float& tol, Graphic31* gs ! ) { ! Extent e; ! l = b = cx = cy = tol = 0.0; ! ! Graphic31 gstemp; ! Transformer ttemp; ! Extent te; ! gstemp.transformer(&ttemp); ! ! GlyphIndex count = _body->count(); ! for (GlyphIndex i = 0; i < count; i++) { ! Graphic31* gr = (Graphic31*) _body->component(i); ! ! concatgs_(gr, gr, gs, &gstemp); ! concatXform_(gr, nil, gr->transformer(), &ttemp); ! getextent_(gr, te._left, te._bottom, te._cx, te._cy, te._tol, &gstemp); ! e.Merge(te); ! } ! gstemp.transformer(nil); // to avoid deleting ttemp explicitly ! l = e._left; b = e._bottom; cx = l+(e._cx-l)*2.0; cy = b+(e._cy-b)*2.0; ! tol = e._tol; ! ! Transformer* tx = gs->transformer(); ! if (tx != nil) { ! corners(l, b, cx, cy, *tx); ! } ! cx = (cx + l)/2.0; ! cy = (cy + b)/2.0; ! } ! ! boolean PolyGraphic::contains_gs (PointObj& po, Graphic31* gs) { ! GlyphIndex count = _body->count(); ! Graphic31 gstemp; ! Transformer ttemp; ! ! gstemp.transformer(&ttemp); ! for (GlyphIndex i = 0; i < count; i++) { ! Graphic31* gr = (Graphic31*) _body->component(i); ! concat_(gr, gr, gs, &gstemp); ! ! if (contains_(gr, po, &gstemp)) { ! gstemp.transformer(nil); ! return true; ! } ! } ! gstemp.transformer(nil); /* to avoid deleting ttemp explicitly*/ ! return false; ! } ! ! boolean PolyGraphic::intersects_gs (BoxObj& box, Graphic31* gs) { ! GlyphIndex count = _body->count(); ! Graphic31 gstemp; ! Transformer ttemp; ! ! gstemp.transformer(&ttemp); ! for (GlyphIndex i = 0; i < count; i++) { ! Graphic31* gr = (Graphic31*) _body->component(i); ! concat_(gr, gr, gs, &gstemp); ! ! if (intersects_(gr, box, &gstemp)) { ! gstemp.transformer(nil); ! return true; ! } ! } ! gstemp.transformer(nil); /* to avoid deleting ttemp explicitly*/ ! return false; ! } ! ! /**********************************************************************/ ! declarePtrList(GraphicList, Graphic31); ! implementPtrList(GraphicList, Graphic31); ! ! static Cursor* grabber_cursor = nil; ! static Cursor* window_cursor = nil; ! ! GraphicMaster::GraphicMaster (Graphic31* gr, const Color* bg) : PolyGraphic(gr) { ! _gr_list = new GraphicList; ! if (grabber_cursor == nil) { ! Bitmap* grabber = new Bitmap( ! grabber_bits, grabber_width, grabber_height, ! grabber_x_hot, grabber_y_hot ! ); ! Bitmap* grabber_mask = new Bitmap( ! grabberMask_bits, grabberMask_width, grabberMask_height, ! grabberMask_x_hot, grabberMask_y_hot ! ); ! grabber_cursor = new Cursor(grabber, grabber_mask); ! } ! _bg = bg; ! Resource::ref(_bg); ! } ! ! GraphicMaster::~GraphicMaster () { ! delete _gr_list; ! Resource::unref(_bg); ! } ! ! void GraphicMaster::background(const Color* bg) { ! if (bg != nil) { ! Resource::ref(bg); ! } ! if (_bg != nil) { ! Resource::unref(_bg); ! } ! _bg = bg; ! } ! ! Glyph* GraphicMaster::clone () const { ! Graphic31* pg = new GraphicMaster((Graphic31*)this); ! ! GlyphIndex count = _body->count(); ! for (GlyphIndex i = 0; i < count; i++) { ! Glyph* gr = _body->component(i); ! pg->append(gr->clone()); ! } ! return pg; ! } ! ! void GraphicMaster::request(Requisition& req) const { ! PolyGraphic::request(req); ! Requirement& rx = req.x_requirement(); ! rx.alignment(0.0); ! ! Requirement& ry = req.y_requirement(); ! ry.alignment(0.0); ! } ! ! void GraphicMaster::allocate (Canvas* c, const Allocation& a, Extension& ext) { ! if (!_a.equals(a, 0.001)) { ! Allocation b(a); ! Allotment& ax = _a.x_allotment(); ! Allotment& ay = _a.y_allotment(); ! Allotment& bx = b.x_allotment(); ! Allotment& by = b.y_allotment(); ! translate((bx.span()-ax.span())/2.0, (by.span()-ay.span())/2.0); ! translate(bx.begin()-ax.begin(), by.begin()-ay.begin()); ! _a = a; ! } ! if (c != nil) { ! PolyGraphic::allocate(c, a, ext); ! } ! } ! ! void GraphicMaster::drawclipped_gs( ! Canvas* c, Coord l, Coord b, Coord r, Coord t, Graphic31* gs ! ) { ! c->push_clipping(); ! c->clip_rect(_a.left(), _a.bottom(), _a.right(), _a.top()); ! if (_bg != nil) { ! c->fill_rect(l, b, r, t, _bg); ! } ! PolyGraphic::drawclipped_gs(c, l, b, r, t, gs); ! c->pop_clipping(); ! } ! ! boolean GraphicMaster::grasp (const Event& e, Tool31& tool) { ! if (window_cursor == nil) { ! window_cursor = e.window()->cursor(); ! } ! boolean flag = false; ! unsigned int tool_type = tool.tool(); ! switch (tool_type) { ! case Tool31::move: ! case Tool31::scale: ! case Tool31::rotate: ! { ! float tol = 2.0; ! BoxObj box( ! e.pointer_x()-tol, e.pointer_y()-tol, ! e.pointer_x()+tol, e.pointer_y()+tol ! ); ! Graphic31* target = last_intersecting(box); ! if (target != nil) { ! Window* w = e.window(); ! Canvas* c = w->canvas(); ! w->cursor(grabber_cursor); ! ! ToolState& ts = tool.toolstate(); ! total_gs(ts._gs); ! ! _gr_list->append(target); ! Coord l, b, r, t; ! target->getbounds(l, b, r, t); ! c->damage(l, b, r, t); ! flag = target->grasp(e, tool); ! if (flag) { ! target->getbounds(l, b, r, t); ! c->damage(l, b, r, t); ! } ! CanvasRep& rep = *c->rep(); ! CanvasDamage& cd = rep.damage_; ! rep.start_repair(); ! drawclipped(c, cd.left, cd.bottom, cd.right, cd.top); ! rep.finish_repair(); ! } ! break; ! } ! } ! return flag; ! } ! ! boolean GraphicMaster::manipulating (const Event& e, Tool31& tool) { ! boolean flag = true; ! long count = _gr_list->count(); ! Coord l, b, r, t; ! Window* w = e.window(); ! Canvas* c = w->canvas(); ! for (long i = 0; i < count && flag; i++) { ! Graphic31* target = _gr_list->item(i); ! target->getbounds(l, b, r, t); ! c->damage(l, b, r, t); ! flag = target->manipulating(e, tool); ! if (flag) { ! target->getbounds(l, b, r, t); ! c->damage(l, b, r, t); ! } ! CanvasRep& rep = *c->rep(); ! CanvasDamage& cd = rep.damage_; ! rep.start_repair(); ! drawclipped(c, cd.left, cd.bottom, cd.right, cd.top); ! rep.finish_repair(); ! w->display()->flush(); ! } ! return flag; ! } ! ! boolean GraphicMaster::effect (const Event& e, Tool31& tool) { ! boolean flag = true; ! Window* w = e.window(); ! if (w != nil) { ! w->cursor(window_cursor); ! Canvas* c = w->canvas(); ! long count = _gr_list->count(); ! Coord l, b, r, t; ! for (long i = 0; i < count && flag; i++) { ! Graphic31* target = _gr_list->item(i); ! target->getbounds(l, b, r, t); ! c->damage(l, b, r, t); ! flag = target->effect(e, tool); ! if (flag) { ! target->getbounds(l, b, r, t); ! c->damage(l, b, r, t); ! } ! target->flush(); ! CanvasRep& rep = *c->rep(); ! CanvasDamage& cd = rep.damage_; ! rep.start_repair(); ! drawclipped(c, cd.left, cd.bottom, cd.right, cd.top); ! rep.finish_repair(); ! } ! _gr_list->remove_all(); ! } ! return flag; ! } ! ! /**********************************************************************/ ! ! Line31::Line31( const Brush* brush, const Color* stroke, const Color* fill, ! Coord x1, Coord y1, Coord x2, Coord y2, Transformer* t ! ) : Graphic31(brush, stroke, fill, nil, false, false, 2, t) { add_point(x1, y1); add_point(x2, y2); } + + Line31::~Line31 () { } ! Glyph* Line31::clone () const { ! return new Line31(_brush, _stroke, _fill, _x[0], _y[0], _x[1], _y[1], _t); ! } ! /**********************************************************************/ ! Rectangle31::Rectangle31 ( const Brush* brush, const Color* stroke, const Color* fill, ! Coord l, Coord b, Coord r, Coord t, Transformer* tx ! ) : Graphic31(brush, stroke, fill, nil, true, false, 4, tx) { add_point(r, b); + add_point(r, t); + add_point(l, t); + add_point(l, b); } + + Rectangle31::~Rectangle31 () { } ! Glyph* Rectangle31::clone () const { ! return new Rectangle31( ! _brush, _stroke, _fill, _x[0], _y[0], _x[1], _y[1], _t ! ); ! } + /**********************************************************************/ static float p0 = 1.00000000; static float p1 = 0.89657547; // cos 30 * sqrt(1 + tan 15 * tan 15) static float p2 = 0.70710678; // cos 45 static float p3 = 0.51763809; // cos 60 * sqrt(1 + tan 15 * tan 15) static float p4 = 0.26794919; // tan 15 ! Circle31::Circle31 ( const Brush* brush, const Color* stroke, const Color* fill, ! Coord x, Coord y, Coord r, Transformer* t ! ) : Graphic31(brush, stroke, fill, nil, true, true, 25, t) { float px0 = p0 * r, py0 = p0 * r; float px1 = p1 * r, py1 = p1 * r; float px2 = p2 * r, py2 = p2 * r; *************** *** 202,214 **** add_curve(x + px2, y - py2, x + px4, y - py0, x + px3, y - py1); add_curve(x + r, y, x + px1, y - py3, x + px0, y - py4); } ! Fig31Circle::~Fig31Circle () { } ! Fig31Ellipse::Fig31Ellipse ( const Brush* brush, const Color* stroke, const Color* fill, ! Coord x, Coord y, Coord rx, Coord ry ! ) : Fig31(brush, stroke, fill, true, true, 25) { float px0 = p0 * rx, py0 = p0 * ry; float px1 = p1 * rx, py1 = p1 * ry; float px2 = p2 * rx, py2 = p2 * ry; --- 1634,1654 ---- add_curve(x + px2, y - py2, x + px4, y - py0, x + px3, y - py1); add_curve(x + r, y, x + px1, y - py3, x + px0, y - py4); } + + Circle31::~Circle31 () { } ! Glyph* Circle31::clone () const { ! Coord r = _x[0] - _x[4]; ! Coord x = _x[4]; ! Coord y = _y[0]; ! return new Circle31(_brush, _stroke, _fill, x, y, r, _t); ! } ! /**********************************************************************/ ! Ellipse31::Ellipse31 ( const Brush* brush, const Color* stroke, const Color* fill, ! Coord x, Coord y, Coord rx, Coord ry, Transformer* t ! ) : Graphic31(brush, stroke, fill, nil, true, true, 25, t) { float px0 = p0 * rx, py0 = p0 * ry; float px1 = p1 * rx, py1 = p1 * ry; float px2 = p2 * rx, py2 = p2 * ry; *************** *** 226,237 **** add_curve(x + rx, y, x + px1, y - py3, x + px0, y - py4); } ! Fig31Ellipse::~Fig31Ellipse () { } ! Fig31Open_BSpline::Fig31Open_BSpline ( ! const Brush* brush, const Color* stroke, const Color* fill, ! Coord* x, Coord* y, int n ! ) : Fig31(brush, stroke, fill, false, true, (n + 2) * 3 + 1) { Bspline_move_to(x[0], y[0], x[0], y[0], x[0], y[0]); Bspline_curve_to(x[0], y[0], x[0], y[0], x[1], y[1]); for (int i = 1; i < n - 1; ++i) { --- 1666,1686 ---- add_curve(x + rx, y, x + px1, y - py3, x + px0, y - py4); } ! Ellipse31::~Ellipse31 () { } ! Glyph* Ellipse31::clone () const { ! Coord rx = _x[0] - _x[4]; ! Coord ry = _y[4] - _x[0]; ! Coord x = _x[4]; ! Coord y = _y[0]; ! return new Ellipse31(_brush, _stroke, _fill, x, y, rx, ry, _t); ! } ! ! /**********************************************************************/ ! Open_BSpline31::Open_BSpline31 ( ! const Brush* brush, const Color* stroke, const Color* fill, ! Coord* x, Coord* y, int n, Transformer* t ! ) : Graphic31(brush, stroke, fill, nil, false, true, (n + 2) * 3 + 1, t) { Bspline_move_to(x[0], y[0], x[0], y[0], x[0], y[0]); Bspline_curve_to(x[0], y[0], x[0], y[0], x[1], y[1]); for (int i = 1; i < n - 1; ++i) { *************** *** 241,252 **** Bspline_curve_to(x[n-1], y[n-1], x[n-1], y[n-1], x[n-1], y[n-1]); } ! Fig31Open_BSpline::~Fig31Open_BSpline () { } ! Fig31Closed_BSpline::Fig31Closed_BSpline ( ! const Brush* brush, const Color* stroke, const Color* fill, ! Coord* x, Coord* y, int n ! ) : Fig31(brush, stroke, fill, true, true, n * 3 + 1) { Bspline_move_to(x[0], y[0], x[n-1], y[n-1], x[1], y[1]); for (int i = 1; i < n - 1; ++i) { Bspline_curve_to(x[i], y[i], x[i-1], y[i-1], x[i+1], y[i+1]); --- 1690,1709 ---- Bspline_curve_to(x[n-1], y[n-1], x[n-1], y[n-1], x[n-1], y[n-1]); } ! Open_BSpline31::Open_BSpline31 (Open_BSpline31* gr) : Graphic31(gr) {} ! ! Open_BSpline31::~Open_BSpline31 () { } ! ! Glyph* Open_BSpline31::clone () const { ! return new Open_BSpline31((Open_BSpline31*) this); ! } ! ! /**********************************************************************/ ! Closed_BSpline31::Closed_BSpline31 ( ! const Brush* brush, const Color* stroke, const Color* fill, ! Coord* x, Coord* y, int n, Transformer* t ! ) : Graphic31(brush, stroke, fill, nil, true, true, n * 3 + 1, t) { Bspline_move_to(x[0], y[0], x[n-1], y[n-1], x[1], y[1]); for (int i = 1; i < n - 1; ++i) { Bspline_curve_to(x[i], y[i], x[i-1], y[i-1], x[i+1], y[i+1]); *************** *** 255,283 **** Bspline_curve_to(x[0], y[0], x[n-1], y[n-1], x[1], y[1]); } ! Fig31Closed_BSpline::~Fig31Closed_BSpline () { } ! Fig31Polyline::Fig31Polyline ( const Brush* brush, const Color* stroke, const Color* fill, ! Coord* x, Coord* y, int n ! ) : Fig31(brush, stroke, fill, false, false, n) { add_point(x[0], y[0]); for (int i = 1; i < n; ++i) { add_point(x[i], y[i]); } } ! Fig31Polyline::~Fig31Polyline () { } ! Fig31Polygon::Fig31Polygon ( ! const Brush* brush, const Color* stroke, const Color* fill, ! Coord* x, Coord* y, int n ! ) : Fig31(brush, stroke, fill, true, false, n) { add_point(x[0], y[0]); for (int i = 1; i < n; ++i) { add_point(x[i], y[i]); } } ! Fig31Polygon::~Fig31... [truncated message content] |
From: <ivt...@li...> - 2000-07-22 18:08:05
|
Patch: ivtools-000723-johnston-084 For: ivtools-0.8.3 Author: joh...@us... Subject: add floor, ceil, and round commands to comterp Requires: This is an intermediate patch to ivtools-0.8.3. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - add floor, ceil, and round commands to comterp. In each case a long integer is returned when the argument is a float or double. Index: ComTerp/comterp.c diff -c ComTerp/comterp.c:1.22 ComTerp/comterp.c:1.23 *** ComTerp/comterp.c:1.22 Fri Jul 21 01:15:11 2000 --- src/ComTerp/comterp.c Sun Jul 23 00:19:36 2000 *************** *** 896,901 **** --- 896,905 ---- add_command("tan", new TanFunc(this)); add_command("sqrt", new SqrtFunc(this)); + add_command("floor", new FloorFunc(this)); + add_command("ceil", new CeilFunc(this)); + add_command("round", new RoundFunc(this)); + add_command("xform", new XformFunc(this)); add_command("invert", new InvertXformFunc(this)); Index: ComTerp/numfunc.c diff -c ComTerp/numfunc.c:1.2 ComTerp/numfunc.c:1.3 *** ComTerp/numfunc.c:1.2 Sun May 21 02:14:05 2000 --- src/ComTerp/numfunc.c Sun Jul 23 00:19:36 2000 *************** *** 1,5 **** /* ! * Copyright (c) 1994,1995,1999 Vectaport Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided --- 1,5 ---- /* ! * Copyright (c) 1994,1995,1999,2000 Vectaport Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided *************** *** 24,29 **** --- 24,30 ---- #include <ComTerp/numfunc.h> #include <ComTerp/comvalue.h> #include <ComTerp/comterp.h> + #include <math.h> #define TITLE "NumFunc" *************** *** 707,710 **** --- 708,811 ---- reset_stack(); push_stack(result); } + + FloorFunc::FloorFunc(ComTerp* comterp) : NumFunc(comterp) { + } + + void FloorFunc::execute() { + ComValue& operand1 = stack_arg(0); + ComValue result(operand1); + switch (result.type()) { + case ComValue::CharType: + case ComValue::UCharType: + case ComValue::ShortType: + case ComValue::UShortType: + case ComValue::IntType: + case ComValue::UIntType: + case ComValue::LongType: + case ComValue::ULongType: + break; + case ComValue::FloatType: + { + ComValue val((long)floor((double) operand1.float_val())); + result.assignval(val); + } + break; + case ComValue::DoubleType: + { + ComValue val((long)floor(operand1.double_val())); + result.assignval(val); + } + break; + } + reset_stack(); + push_stack(result); + } + + CeilFunc::CeilFunc(ComTerp* comterp) : NumFunc(comterp) { + } + + void CeilFunc::execute() { + ComValue& operand1 = stack_arg(0); + ComValue result(operand1); + switch (result.type()) { + case ComValue::CharType: + case ComValue::UCharType: + case ComValue::ShortType: + case ComValue::UShortType: + case ComValue::IntType: + case ComValue::UIntType: + case ComValue::LongType: + case ComValue::ULongType: + break; + case ComValue::FloatType: + { + ComValue val((long)ceil((double) operand1.float_val())); + result.assignval(val); + } + break; + case ComValue::DoubleType: + { + ComValue val((long)ceil(operand1.double_val())); + result.assignval(val); + } + break; + } + reset_stack(); + push_stack(result); + } + + RoundFunc::RoundFunc(ComTerp* comterp) : NumFunc(comterp) { + } + + void RoundFunc::execute() { + ComValue& operand1 = stack_arg(0); + ComValue result(operand1); + switch (result.type()) { + case ComValue::CharType: + case ComValue::UCharType: + case ComValue::ShortType: + case ComValue::UShortType: + case ComValue::IntType: + case ComValue::UIntType: + case ComValue::LongType: + case ComValue::ULongType: + break; + case ComValue::FloatType: + { + ComValue val((long)floor((double) operand1.float_val()+0.5)); + result.assignval(val); + } + break; + case ComValue::DoubleType: + { + ComValue val((long)floor(operand1.double_val()+0.5)); + result.assignval(val); + } + break; + } + reset_stack(); + push_stack(result); + } + Index: ComTerp/numfunc.h diff -c ComTerp/numfunc.h:1.1 ComTerp/numfunc.h:1.2 *** ComTerp/numfunc.h:1.1 Tue Jan 18 03:07:04 2000 --- src/ComTerp/numfunc.h Sun Jul 23 00:19:36 2000 *************** *** 1,5 **** /* ! * Copyright (c) 1994,1995,1999 Vectaport Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided --- 1,5 ---- /* ! * Copyright (c) 1994,1995,1999,2000 Vectaport Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided *************** *** 142,147 **** --- 142,183 ---- virtual void execute(); virtual const char* docstring() { return "n=%s(a) -- return absolute value of a"; } + + }; + + //: floor command for ComTerp. + // num=floor(num) -- return closest integer value less than or equal to argument + class FloorFunc : public NumFunc { + public: + FloorFunc(ComTerp*); + + virtual void execute(); + virtual const char* docstring() { + return "num=%s(num) -- return closest integer value less than or equal to argument"; } + + }; + + //: ceiling command for ComTerp. + // num=ceil(num) -- return closest integer value greater than or equal to argument + class CeilFunc : public NumFunc { + public: + CeilFunc(ComTerp*); + + virtual void execute(); + virtual const char* docstring() { + return "num=%s(num) -- return closest integer value greater than or equal to argument"; } + + }; + + //: ceiling command for ComTerp. + // num=round(num) -- return closest integer value + class RoundFunc : public NumFunc { + public: + RoundFunc(ComTerp*); + + virtual void execute(); + virtual const char* docstring() { + return "num=%s(num) -- return closest integer value"; } }; Index: comterp/README diff -c comterp/README:1.13 comterp/README:1.14 *** comterp/README:1.13 Thu Jul 20 03:27:19 2000 --- src/comterp_/README Sun Jul 23 00:19:38 2000 *************** *** 74,80 **** Operators Command Name Priority Order Type --------- ------------ -------- ----- ---- ! . dot 130 R-to-L binary ^ power 120 R-to-L binary ! negate 110 R-to-L unary-prefix ++ incr 110 R-to-L unary-prefix --- 74,81 ---- Operators Command Name Priority Order Type --------- ------------ -------- ----- ---- ! . dot 130 L-to-R binary ! ` bquote 125 R-to-L unary-prefix ^ power 120 R-to-L binary ! negate 110 R-to-L unary-prefix ++ incr 110 R-to-L unary-prefix *************** *** 138,143 **** --- 139,150 ---- dbl=sqrt(x) -- returns square root of x + num=floor(num) -- return closest integer value less than or equal to argument + + num=ceil(num) -- return closest integer value greater than or equal to argument + + num=round(num) -- return closest integer value + AFFINE TRANSFORM COMMANDS: point=xform(x,y a00,a01,a10,a11,a20,a21) -- affine transform of x,y coordinates *************** *** 210,216 **** arr=posteval(arg1 [arg2 [arg3 ... [argn]]]) -- post-evaluate every fixed argument (until nil) and return array ! sym=attrname(attribute) -- return name field of dotted pair. quit() -- quit the interpreter --- 217,224 ---- arr=posteval(arg1 [arg2 [arg3 ... [argn]]]) -- post-evaluate every fixed argument (until nil) and return array ! sym=attrname(attribute) -- return name field of dotted pair ! val=attrval(attribute) -- return value field of dotted pair quit() -- quit the interpreter Index: man1_ivtools/comterp.1 diff -c man1_ivtools/comterp.1:1.13 man1_ivtools/comterp.1:1.14 *** man1_ivtools/comterp.1:1.13 Thu Jul 20 03:29:23 2000 --- src/man/man1/comterp.1 Sun Jul 23 00:20:22 2000 *************** *** 85,90 **** --- 85,91 ---- Operators Command Name Priority Order Type --------- ------------ -------- ----- ---- . dot 130 R-to-L binary + ` bquote 125 R-to-L unary-prefix ^ power 120 R-to-L binary ! negate 110 R-to-L unary-prefix ++ incr 110 R-to-L unary-prefix *************** *** 149,154 **** --- 150,161 ---- dbl=sqrt(x) -- returns square root of x + num=floor(num) -- return closest integer value less than or equal to argument + + num=ceil(num) -- return closest integer value greater than or equal to argument + + num=round(num) -- return closest integer value + .SH AFFINE TRANSFORM COMMANDS: point=xform(x,y a00,a01,a10,a11,a20,a21) -- affine transform of x,y coordinates *************** *** 216,222 **** arr=posteval(arg1 [arg2 [arg3 ... [argn]]]) -- post-evaluate every fixed argument (until nil) and return array ! sym=attrname(attribute) -- return name field of dotted pair. quit() -- quit the interpreter --- 223,230 ---- arr=posteval(arg1 [arg2 [arg3 ... [argn]]]) -- post-evaluate every fixed argument (until nil) and return array ! sym=attrname(attribute) -- return name field of dotted pair ! val=attrval(attribute) -- return value field of dotted pair quit() -- quit the interpreter *** /dev/null Sun Jul 23 00:20:28 PDT 2000 --- patches/ivtools-000723-johnston-084 *************** patches/ivtools-000723-johnston-084 *** 0 **** --- 1 ---- + ivtools-000723-johnston-084 |
From: <ivt...@li...> - 2000-07-20 19:06:19
|
Patch: ivtools-000721-johnston-083 For: ivtools-0.8.3 Author: joh...@us... Subject: add a LISP-like backquote operator to comterp Requires: This is an intermediate patch to ivtools-0.8.3. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - add a LISP-like backquote operator to comterp. Works for attributes as well. Index: top_ivtools/MANIFEST diff -c top_ivtools/MANIFEST:1.13 top_ivtools/MANIFEST:1.14 *** top_ivtools/MANIFEST:1.13 Thu Jul 20 03:27:03 2000 --- ./MANIFEST Fri Jul 21 01:14:52 2000 *************** *** 140,145 **** --- 140,147 ---- ivtools-0.8/src/ComTerp/assignfunc.h ivtools-0.8/src/ComTerp/boolfunc.c ivtools-0.8/src/ComTerp/boolfunc.h + ivtools-0.8/src/ComTerp/bquotefunc.c + ivtools-0.8/src/ComTerp/bquotefunc.h ivtools-0.8/src/ComTerp/comfunc.c ivtools-0.8/src/ComTerp/comfunc.h ivtools-0.8/src/ComTerp/comhandler.c Index: top_ivtools/MANIFEST.perceps diff -c top_ivtools/MANIFEST.perceps:1.9 top_ivtools/MANIFEST.perceps:1.10 *** top_ivtools/MANIFEST.perceps:1.9 Thu Jul 20 03:27:04 2000 --- ./MANIFEST.perceps Fri Jul 21 01:14:52 2000 *************** *** 20,25 **** --- 20,26 ---- ComTerp/_comutil.h ComTerp/assignfunc.h ComTerp/boolfunc.h + ComTerp/bquotefunc.h ComTerp/comfunc.h ComTerp/comhandler.h ComTerp/commodule.h Index: ComUtil/optable.c diff -c ComUtil/optable.c:1.2 ComUtil/optable.c:1.3 *** ComUtil/optable.c:1.2 Sun Feb 13 21:43:31 2000 --- src/ComUtil/optable.c Fri Jul 21 01:14:59 2000 *************** *** 80,85 **** --- 80,86 ---- unsigned optype; } DefaultOperatorTable[] = { {".", "dot", 130, FALSE, OPTYPE_BINARY }, + {"`", "bquote", 125, TRUE, OPTYPE_UNARY_PREFIX }, {"^", "power", 120, TRUE, OPTYPE_BINARY }, {"!", "negate", 110, TRUE, OPTYPE_UNARY_PREFIX }, {"++", "incr", 110, TRUE, OPTYPE_UNARY_PREFIX }, *************** *** 894,900 **** Operator Command Priority RtoL Type -------- ------- -------- ---- ---- ! . dot 130 Y BINARY ^ power 120 Y BINARY ! negate 110 Y UNARY PREFIX ++ incr 110 Y UNARY PREFIX --- 895,902 ---- Operator Command Priority RtoL Type -------- ------- -------- ---- ---- ! . dot 130 N BINARY ! ` bquote 125 Y UNARY PREFIX ^ power 120 Y BINARY ! negate 110 Y UNARY PREFIX ++ incr 110 Y UNARY PREFIX Index: ComTerp/Imakefile diff -c ComTerp/Imakefile:1.4 ComTerp/Imakefile:1.5 *** ComTerp/Imakefile:1.4 Thu Jul 20 03:27:13 2000 --- src/ComTerp/Imakefile Fri Jul 21 01:15:10 2000 *************** *** 19,24 **** --- 19,25 ---- Obj(assignfunc) Obj(boolfunc) + Obj(bquotefunc) Obj(comfunc) ObjA(comterpserv) Obj(comvalue) Index: ComTerp/bquotefunc.c diff -c /dev/null ComTerp/bquotefunc.c:1.1 *** /dev/null Fri Jul 21 01:15:12 2000 --- src/ComTerp/bquotefunc.c Fri Jul 21 01:15:10 2000 *************** *** 0 **** --- 1,41 ---- + /* + * Copyright (c) 2000 IET Inc. + * Copyright (c) 1998,1999,2000 Vectaport Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the names of the copyright holders not be used in + * advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. The copyright holders make + * no representations about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, + * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING + * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + + #include <ComTerp/bquotefunc.h> + #include <ComTerp/comvalue.h> + #include <ComTerp/comterp.h> + + #define TITLE "BackQuoteFunc" + + /*****************************************************************************/ + + BackQuoteFunc::BackQuoteFunc(ComTerp* comterp) : ComFunc(comterp) { + } + + void BackQuoteFunc::execute() { + ComValue retval(stack_arg(0, true)); + reset_stack(); + retval.bquote(1); + push_stack(retval); + } Index: ComTerp/bquotefunc.h diff -c /dev/null ComTerp/bquotefunc.h:1.1 *** /dev/null Fri Jul 21 01:15:12 2000 --- src/ComTerp/bquotefunc.h Fri Jul 21 01:15:11 2000 *************** *** 0 **** --- 1,49 ---- + /* + * Copyright (c) 2000 IET Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the names of the copyright holders not be used in + * advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. The copyright holders make + * no representations about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, + * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING + * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + + /* + * LISP-like backquote command + */ + + #if !defined(_bquotefunc_h) + #define _bquotefunc_h + + #include <ComTerp/comfunc.h> + + class ComTerp; + + //: backquote operator, similar to LISP + class BackQuoteFunc : public ComFunc { + public: + BackQuoteFunc(ComTerp*); + + virtual void execute(); + virtual const char* docstring() { + return "` is the LISP-like backquote operator"; } + }; + + + #endif /* !defined(_bquotefunc_h) */ + + + Index: ComTerp/comfunc.c diff -c ComTerp/comfunc.c:1.5 ComTerp/comfunc.c:1.6 *** ComTerp/comfunc.c:1.5 Thu Jul 20 03:27:13 2000 --- src/ComTerp/comfunc.c Fri Jul 21 01:15:11 2000 *************** *** 68,74 **** keyref.keynarg_val()) return ComValue::nullval(); } ! if (!symbol) argref = _comterp->lookup_symval(argref); return argref; } --- 68,74 ---- keyref.keynarg_val()) return ComValue::nullval(); } ! if (!symbol) argref = _comterp->lookup_symval(argref); return argref; } *************** *** 98,104 **** else return dflt; } else { ! if (!symbol) valref = _comterp->lookup_symval(valref); return valref; } --- 98,104 ---- else return dflt; } else { ! if (!symbol) valref = _comterp->lookup_symval(valref); return valref; } Index: ComTerp/comterp.c diff -c ComTerp/comterp.c:1.21 ComTerp/comterp.c:1.22 *** ComTerp/comterp.c:1.21 Thu Jul 20 03:27:13 2000 --- src/ComTerp/comterp.c Fri Jul 21 01:15:11 2000 *************** *** 26,31 **** --- 26,32 ---- #include <ComTerp/_comutil.h> #include <ComTerp/assignfunc.h> #include <ComTerp/boolfunc.h> + #include <ComTerp/bquotefunc.h> #include <ComTerp/comfunc.h> #include <ComTerp/comhandler.h> #include <ComTerp/comterp.h> *************** *** 665,670 **** --- 666,673 ---- } ComValue& ComTerp::lookup_symval(ComValue& comval) { + if (comval.bquote()) return comval; + if (comval.type() == ComValue::SymbolType) { void* vptr = nil; *************** *** 865,870 **** --- 868,874 ---- add_command("dot", new DotFunc(this)); add_command("attrname", new DotNameFunc(this)); + add_command("attrval", new DotValFunc(this)); add_command("list", new ListFunc(this)); add_command("at", new ListAtFunc(this)); *************** *** 911,916 **** --- 915,922 ---- add_command("type", new TypeSymbolFunc(this)); add_command("class", new ClassSymbolFunc(this)); + + add_command("bquote", new BackQuoteFunc(this)); add_command("postfix", new PostFixFunc(this)); add_command("posteval", new PostEvalFunc(this)); Index: ComTerp/comvalue.c diff -c ComTerp/comvalue.c:1.17 ComTerp/comvalue.c:1.18 *** ComTerp/comvalue.c:1.17 Sun Jun 11 00:18:56 2000 --- src/ComTerp/comvalue.c Fri Jul 21 01:15:11 2000 *************** *** 118,123 **** --- 118,124 ---- _nids = token->nids; _aggregate_type = UnknownType; _pedepth = 0; + _bquote = 0; } ComValue& ComValue::operator= (const ComValue& sv) { *************** *** 126,137 **** --- 127,140 ---- _nkey = sv._nkey; _nids = sv._nids; _pedepth = sv._pedepth; + _bquote = sv._bquote; return *this; } int ComValue::narg() const { return _narg; } int ComValue::nkey() const { return _nkey; } int ComValue::nids() const { return _nids; } + int ComValue::bquote() const { return _bquote; } ostream& operator<< (ostream& out, const ComValue& sv) { ComValue* svp = (ComValue*)&sv; Index: ComTerp/comvalue.h diff -c ComTerp/comvalue.h:1.11 ComTerp/comvalue.h:1.12 *** ComTerp/comvalue.h:1.11 Fri May 19 11:20:02 2000 --- src/ComTerp/comvalue.h Fri Jul 21 01:15:11 2000 *************** *** 101,112 **** --- 101,116 ---- // number of keywords associated with this command. int nids() const; // number of subordinate identifiers associated with this identifier (not used). + int bquote() const; + // return backquote flag void narg(int n) {_narg = n; } // set number of arguments associated with this command or keyword. void nkey(int n) {_nkey = n; } // set number of keywords associated with this command. void nids(int n) {_nids = n; } // set number of subordinate identifiers associated with this identifier (not used). + void bquote(int flag) {_bquote = flag; } + // set backquote flag int& pedepth() { return _pedepth; } // set/get depth of nesting in post-evaluated blocks of control commands. *************** *** 146,157 **** static ComValue& minusoneval(); // returns reference to IntType ComValue with value of -1. protected: ! void zero_vals() { _narg = _nkey = _nids = _pedepth = 0; } int _narg; int _nkey; int _nids; int _pedepth; static const ComTerp* _comterp; static ComValue _nullval; --- 150,162 ---- static ComValue& minusoneval(); // returns reference to IntType ComValue with value of -1. protected: ! void zero_vals() { _narg = _nkey = _nids = _pedepth = _bquote = 0; } int _narg; int _nkey; int _nids; int _pedepth; + int _bquote; static const ComTerp* _comterp; static ComValue _nullval; Index: ComTerp/dotfunc.c diff -c ComTerp/dotfunc.c:1.7 ComTerp/dotfunc.c:1.8 *** ComTerp/dotfunc.c:1.7 Wed May 17 06:58:39 2000 --- src/ComTerp/dotfunc.c Fri Jul 21 01:15:11 2000 *************** *** 96,102 **** } void DotNameFunc::execute() { ! ComValue dotted_pair(stack_arg(0, true)); reset_stack(); if (dotted_pair.class_symid() != Attribute::class_symid()) return; Attribute *attr = (Attribute*)dotted_pair.obj_val(); --- 96,102 ---- } void DotNameFunc::execute() { ! ComValue dotted_pair(stack_arg(0)); reset_stack(); if (dotted_pair.class_symid() != Attribute::class_symid()) return; Attribute *attr = (Attribute*)dotted_pair.obj_val(); Index: ComTerp/helpfunc.c diff -c ComTerp/helpfunc.c:1.2 ComTerp/helpfunc.c:1.3 *** ComTerp/helpfunc.c:1.2 Sun Feb 13 21:43:36 2000 --- src/ComTerp/helpfunc.c Fri Jul 21 01:15:11 2000 *************** *** 147,153 **** } if (!printed && command_ids[i]>=0) { /* if symid is smaller than the highest operator it must be one */ ! if (command_ids[i] && command_ids[i]<=opr_tbl_topstr()) { int op_ids[OPTYPE_NUM]; char* opstr = symbol_pntr(command_ids[i]); unsigned int charcnt; --- 147,153 ---- } if (!printed && command_ids[i]>=0) { /* if symid is smaller than the highest operator it must be one */ ! if (command_ids[i]>=0 && command_ids[i]<=opr_tbl_topstr()) { int op_ids[OPTYPE_NUM]; char* opstr = symbol_pntr(command_ids[i]); unsigned int charcnt; *** /dev/null Fri Jul 21 01:18:12 PDT 2000 --- patches/ivtools-000721-johnston-083 *************** patches/ivtools-000721-johnston-083 *** 0 **** --- 1 ---- + ivtools-000721-johnston-083 |
From: <ivt...@li...> - 2000-07-19 22:03:27
|
Patch: ivtools-000720-johnston-082 For: ivtools-0.8.3 Author: joh...@us... Subject: add type and class commands to comterp, modify assignment operators to look up attributes Requires: This is an intermediate patch to ivtools-0.8.3. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - add method to return symbol associated with type of an AttributeValue (AttributeValue::type_symid()). - add comterp commands for returning the type of a value, and the class of a value of object type. - modify the various comterp assignment operators to look up the value of an attribute given as the second, or right-hand side operand. Symbols are treated differently, in that they behave like attributes when explicitly given, but get assigned as symbols when they are computed and returned from some other expression. - add a symbol comparison option to EqualFunc, i.e.: eq(sym1 sym2 :sym) This assumes sym1 and sym2 are computed by an expression that returns symbols, and then subsequent lookup is suppressed. - set limits on the traversal of the posteval expression buffer by adding an offlimit argument to the various ComTerp::skip_* methods (i.e. ::skip_func, ::skip_arg, and ::skip_key). Now you get a warning when this condition occurs, and the related segfault is avoided. - remove printf in EivTextBuffer that squawked when the text buffer was reallocated into large space. Index: top_ivtools/MANIFEST diff -c top_ivtools/MANIFEST:1.12 top_ivtools/MANIFEST:1.13 *** top_ivtools/MANIFEST:1.12 Tue Jun 20 06:20:18 2000 --- ./MANIFEST Thu Jul 20 03:27:03 2000 *************** *** 184,189 **** --- 184,191 ---- ivtools-0.8/src/ComTerp/strmfunc.h ivtools-0.8/src/ComTerp/symbolfunc.c ivtools-0.8/src/ComTerp/symbolfunc.h + ivtools-0.8/src/ComTerp/typefunc.c + ivtools-0.8/src/ComTerp/typefunc.h ivtools-0.8/src/ComTerp/xformfunc.c ivtools-0.8/src/ComTerp/xformfunc.h ivtools-0.8/src/ComUnidraw/Imakefile Index: top_ivtools/MANIFEST.perceps diff -c top_ivtools/MANIFEST.perceps:1.8 top_ivtools/MANIFEST.perceps:1.9 *** top_ivtools/MANIFEST.perceps:1.8 Tue Jun 20 06:20:18 2000 --- ./MANIFEST.perceps Thu Jul 20 03:27:04 2000 *************** *** 43,48 **** --- 43,49 ---- ComTerp/statfunc.h ComTerp/strmfunc.h ComTerp/symbolfunc.h + ComTerp/typefunc.h ComTerp/xformfunc.h ComUnidraw/comeditor.h ComUnidraw/comterp-acehandler.h Index: Attribute/attrvalue.c diff -c Attribute/attrvalue.c:1.10 Attribute/attrvalue.c:1.11 *** Attribute/attrvalue.c:1.10 Mon May 22 02:09:47 2000 --- src/Attribute/attrvalue.c Thu Jul 20 03:27:09 2000 *************** *** 36,41 **** --- 36,43 ---- /*****************************************************************************/ + int* AttributeValue::_type_syms = nil; + AttributeValue::AttributeValue(ValueType valtype) { clear(); type(valtype); *************** *** 571,577 **** } unsigned int& AttributeValue::class_symid() { ! return _v.objval.type; } AttributeValueList* AttributeValue::array_val() { --- 573,579 ---- } unsigned int& AttributeValue::class_symid() { ! return _v.objval.type; } AttributeValueList* AttributeValue::array_val() { *************** *** 902,904 **** --- 904,938 ---- return nil; } + int AttributeValue::type_symid() const { + if (!_type_syms) { + int i = 0; + _type_syms = new int[((int)BlankType)+1]; + _type_syms[i++] = symbol_add("UnknownType"); + _type_syms[i++] = symbol_add("CharType"); + _type_syms[i++] = symbol_add("UCharType"); + _type_syms[i++] = symbol_add("ShortType"); + _type_syms[i++] = symbol_add("UShortType"); + _type_syms[i++] = symbol_add("IntType"); + _type_syms[i++] = symbol_add("UIntType"); + _type_syms[i++] = symbol_add("LongType"); + _type_syms[i++] = symbol_add("ULongType"); + _type_syms[i++] = symbol_add("FloatType"); + _type_syms[i++] = symbol_add("DoubleType"); + _type_syms[i++] = symbol_add("StringType"); + _type_syms[i++] = symbol_add("SymbolType"); + _type_syms[i++] = symbol_add("ArrayType"); + _type_syms[i++] = symbol_add("StreamType"); + _type_syms[i++] = symbol_add("CommandType"); + _type_syms[i++] = symbol_add("KeywordType"); + _type_syms[i++] = symbol_add("ObjectType"); + _type_syms[i++] = symbol_add("EofType"); + _type_syms[i++] = symbol_add("BooleanType"); + _type_syms[i++] = symbol_add("OperatorType"); + _type_syms[i++] = symbol_add("BlankType"); + } + if (type()>=UnknownType && type()<=BlankType) + return _type_syms[(int)type()]; + else + return -1; + } Index: Attribute/attrvalue.h diff -c Attribute/attrvalue.h:1.12 Attribute/attrvalue.h:1.13 *** Attribute/attrvalue.h:1.12 Sat May 20 02:22:18 2000 --- src/Attribute/attrvalue.h Thu Jul 20 03:27:09 2000 *************** *** 154,159 **** --- 154,161 ---- // return sizeof of value of this type. static int type_size(ValueType); // return sizeof of value of given type. + int type_symid() const; + // return symbol id corresponding to type void assignval (const AttributeValue&); // copy contents of AttributeValue *************** *** 322,327 **** --- 324,330 ---- unsigned int _command_symid; // used for CommandType. boolean _object_compview; // used for ObjectType. }; + static int* _type_syms; }; Index: ComTerp/Imakefile diff -c ComTerp/Imakefile:1.3 ComTerp/Imakefile:1.4 *** ComTerp/Imakefile:1.3 Tue Jun 20 06:20:22 2000 --- src/ComTerp/Imakefile Thu Jul 20 03:27:13 2000 *************** *** 38,43 **** --- 38,44 ---- Obj(statfunc) Obj(strmfunc) Obj(symbolfunc) + Obj(typefunc) Obj(xformfunc) #ifdef AceDir Index: ComTerp/assignfunc.c diff -c ComTerp/assignfunc.c:1.5 ComTerp/assignfunc.c:1.6 *** ComTerp/assignfunc.c:1.5 Wed May 17 06:58:39 2000 --- src/ComTerp/assignfunc.c Thu Jul 20 03:27:13 2000 *************** *** 44,50 **** if (operand1.type() != ComValue::SymbolType) { operand1.assignval(stack_arg_post_eval(0, true /* no symbol lookup */)); } ! ComValue* operand2 = new ComValue(stack_arg_post_eval(1, true)); reset_stack(); if (operand1.type() == ComValue::SymbolType) { AttributeList* attrlist = comterp()->get_attributes(); --- 44,51 ---- if (operand1.type() != ComValue::SymbolType) { operand1.assignval(stack_arg_post_eval(0, true /* no symbol lookup */)); } ! ComValue* operand2 = new ComValue(stack_arg_post_eval(1, true /* no symbol lookup */)); ! if (operand2->is_attribute()) lookup_symval(*operand2); reset_stack(); if (operand1.type() == ComValue::SymbolType) { AttributeList* attrlist = comterp()->get_attributes(); *************** *** 64,69 **** --- 65,71 ---- } else { cerr << "assignment to something other than a symbol ignored\n"; // should say something about assignment from something other than a symbol as well. + delete operand2; } push_stack(*operand2); } *************** *** 77,83 **** if (operand1.type() != ComValue::SymbolType) { operand1.assignval(stack_arg_post_eval(0, true /* no symbol lookup */)); } ! ComValue operand2(stack_arg_post_eval(1, true)); reset_stack(); if (operand1.type() == ComValue::SymbolType) { void* op1val = nil; --- 79,86 ---- if (operand1.type() != ComValue::SymbolType) { operand1.assignval(stack_arg_post_eval(0, true /* no symbol lookup */)); } ! ComValue operand2(stack_arg_post_eval(1, true /* no symbol lookup */)); ! if (operand2.is_attribute()) lookup_symval(operand2); reset_stack(); if (operand1.type() == ComValue::SymbolType) { void* op1val = nil; *************** *** 109,115 **** if (operand1.type() != ComValue::SymbolType) { operand1.assignval(stack_arg_post_eval(0, true /* no symbol lookup */)); } ! ComValue operand2(stack_arg_post_eval(1, true)); reset_stack(); if (operand1.type() == ComValue::SymbolType) { void* op1val = nil; --- 112,119 ---- if (operand1.type() != ComValue::SymbolType) { operand1.assignval(stack_arg_post_eval(0, true /* no symbol lookup */)); } ! ComValue operand2(stack_arg_post_eval(1, true /* no symbol lookup */)); ! if (operand2.is_attribute()) lookup_symval(operand2); reset_stack(); if (operand1.type() == ComValue::SymbolType) { void* op1val = nil; *************** *** 141,147 **** if (operand1.type() != ComValue::SymbolType) { operand1.assignval(stack_arg_post_eval(0, true /* no symbol lookup */)); } ! ComValue operand2(stack_arg_post_eval(1, true)); reset_stack(); if (operand1.type() == ComValue::SymbolType) { void* op1val = nil; --- 145,152 ---- if (operand1.type() != ComValue::SymbolType) { operand1.assignval(stack_arg_post_eval(0, true /* no symbol lookup */)); } ! ComValue operand2(stack_arg_post_eval(1, true /* no symbol lookup */)); ! if (operand2.is_attribute()) lookup_symval(operand2); reset_stack(); if (operand1.type() == ComValue::SymbolType) { void* op1val = nil; *************** *** 173,179 **** if (operand1.type() != ComValue::SymbolType) { operand1.assignval(stack_arg_post_eval(0, true /* no symbol lookup */)); } ! ComValue operand2(stack_arg_post_eval(1, true)); reset_stack(); if (operand1.type() == ComValue::SymbolType) { void* op1val = nil; --- 178,185 ---- if (operand1.type() != ComValue::SymbolType) { operand1.assignval(stack_arg_post_eval(0, true /* no symbol lookup */)); } ! ComValue operand2(stack_arg_post_eval(1, true /* no symbol lookup */)); ! if (operand2.is_attribute()) lookup_symval(operand2); reset_stack(); if (operand1.type() == ComValue::SymbolType) { void* op1val = nil; *************** *** 205,211 **** if (operand1.type() != ComValue::SymbolType) { operand1.assignval(stack_arg_post_eval(0, true /* no symbol lookup */)); } ! ComValue operand2(stack_arg_post_eval(1, true)); reset_stack(); if (operand1.type() == ComValue::SymbolType) { void* op1val = nil; --- 211,218 ---- if (operand1.type() != ComValue::SymbolType) { operand1.assignval(stack_arg_post_eval(0, true /* no symbol lookup */)); } ! ComValue operand2(stack_arg_post_eval(1, true /* no symbol lookup */)); ! if (operand2.is_attribute()) lookup_symval(operand2); reset_stack(); if (operand1.type() == ComValue::SymbolType) { void* op1val = nil; Index: ComTerp/boolfunc.c diff -c ComTerp/boolfunc.c:1.5 ComTerp/boolfunc.c:1.6 *** ComTerp/boolfunc.c:1.5 Sun Jun 11 00:18:56 2000 --- src/ComTerp/boolfunc.c Thu Jul 20 03:27:13 2000 *************** *** 190,197 **** } void EqualFunc::execute() { ! ComValue& operand1 = stack_arg(0); ! ComValue& operand2 = stack_arg(1); static int n_symid = symbol_add("n"); ComValue& nval =stack_key(n_symid); promote(operand1, operand2); --- 190,199 ---- } void EqualFunc::execute() { ! static int sym_symid = symbol_add("sym"); ! boolean symflag = stack_key(sym_symid).is_true(); ! ComValue& operand1 = stack_arg(0, symflag); ! ComValue& operand2 = stack_arg(1, symflag); static int n_symid = symbol_add("n"); ComValue& nval =stack_key(n_symid); promote(operand1, operand2); Index: ComTerp/boolfunc.h diff -c ComTerp/boolfunc.h:1.2 ComTerp/boolfunc.h:1.3 *** ComTerp/boolfunc.h:1.2 Sun Jun 11 00:18:56 2000 --- src/ComTerp/boolfunc.h Thu Jul 20 03:27:13 2000 *************** *** 74,80 **** virtual void execute(); virtual const char* docstring() { ! return "== is the equal operator\nbool=eq(str1 str2 :n len) -- partial string comparison"; } }; --- 74,80 ---- virtual void execute(); virtual const char* docstring() { ! return "== is the equal operator\nbool=eq(str1 str2 :n len) -- partial string comparison\nbool=eq(sym1 sym2 :sym) -- symbol comparison"; } }; Index: ComTerp/comfunc.c diff -c ComTerp/comfunc.c:1.4 ComTerp/comfunc.c:1.5 *** ComTerp/comfunc.c:1.4 Tue Jun 6 11:50:19 2000 --- src/ComTerp/comfunc.c Thu Jul 20 03:27:13 2000 *************** *** 201,221 **** } boolean ComFunc::skip_key_on_stack(int& stackptr, int& argcnt) { ! return comterp()->skip_key(&comterp()->stack_top(), stackptr, argcnt); } boolean ComFunc::skip_arg_on_stack(int& stackptr, int& argcnt) { ! return comterp()->skip_arg(&comterp()->stack_top(), stackptr, argcnt); } boolean ComFunc::skip_key_in_expr(int& offtop, int& argcnt) { return comterp()->skip_key(&comterp()->_pfcomvals[comterp()->_pfnum-1], ! offtop, argcnt); } boolean ComFunc::skip_arg_in_expr(int& offtop, int& argcnt) { return comterp()->skip_arg(&comterp()->_pfcomvals[comterp()->_pfnum-1], ! offtop, argcnt); } ComValue& ComFunc::pop_stack() { --- 201,223 ---- } boolean ComFunc::skip_key_on_stack(int& stackptr, int& argcnt) { ! return comterp()->skip_key(&comterp()->stack_top(), stackptr, ! -comterp()->stack_height(), argcnt); } boolean ComFunc::skip_arg_on_stack(int& stackptr, int& argcnt) { ! return comterp()->skip_arg(&comterp()->stack_top(), stackptr, ! -comterp()->stack_height(), argcnt); } boolean ComFunc::skip_key_in_expr(int& offtop, int& argcnt) { return comterp()->skip_key(&comterp()->_pfcomvals[comterp()->_pfnum-1], ! offtop, -comterp()->_pfnum, argcnt); } boolean ComFunc::skip_arg_in_expr(int& offtop, int& argcnt) { return comterp()->skip_arg(&comterp()->_pfcomvals[comterp()->_pfnum-1], ! offtop, -comterp()->_pfnum, argcnt); } ComValue& ComFunc::pop_stack() { Index: ComTerp/comterp.c diff -c ComTerp/comterp.c:1.20 ComTerp/comterp.c:1.21 *** ComTerp/comterp.c:1.20 Wed Jun 21 11:38:50 2000 --- src/ComTerp/comterp.c Thu Jul 20 03:27:13 2000 *************** *** 44,49 **** --- 44,50 ---- #include <ComTerp/statfunc.h> #include <ComTerp/strmfunc.h> #include <ComTerp/symbolfunc.h> + #include <ComTerp/typefunc.h> #include <ComTerp/xformfunc.h> #include <Attribute/attrlist.h> #include <Attribute/attribute.h> *************** *** 312,318 **** ComFunc* func = (ComFunc*)sv->obj_val(); if (func && func->post_eval()) { int newoffset = offset; ! skip_func(_pfcomvals+_pfnum-1, newoffset); int start = i-1; int stop = _pfnum+newoffset; for (int j=start; j>=stop; j--) --- 313,319 ---- ComFunc* func = (ComFunc*)sv->obj_val(); if (func && func->post_eval()) { int newoffset = offset; ! skip_func(_pfcomvals+_pfnum-1, newoffset, -_pfnum); int start = i-1; int stop = _pfnum+newoffset; for (int j=start; j>=stop; j--) *************** *** 417,422 **** --- 418,424 ---- if (stack_top().is_type(ComValue::CommandType) && stack_top().pedepth() == pedepth) break; } + // if (!stack_top().is_symbol()) eval_expr_internals(pedepth); } *************** *** 424,457 **** return FUNCOK; } ! boolean ComTerp::skip_func(ComValue* topval, int& offset) { ComValue* sv = topval + offset; int nargs = sv->narg(); int nkeys = sv->nkey(); offset--; while(nargs>0 || nkeys>0) { ComValue* nv = topval + offset; int tokcnt; if (nv->is_type(ComValue::KeywordType)) { ! skip_key(topval, offset, tokcnt); nkeys--; nargs -= tokcnt ? 1 : 0; } else { ! skip_arg(topval, offset, tokcnt); nargs--; } } return true; } ! boolean ComTerp::skip_key(ComValue* topval, int& offset, int& tokcnt) { ComValue& curr = *(topval+offset); tokcnt = 0; if (curr.is_type(ComValue::KeywordType)) { offset--; if (curr.keynarg_val()) { int subtokcnt; ! skip_arg(topval, offset, subtokcnt); tokcnt += subtokcnt; } --- 426,467 ---- return FUNCOK; } ! boolean ComTerp::skip_func(ComValue* topval, int& offset, int offlimit) { ComValue* sv = topval + offset; int nargs = sv->narg(); int nkeys = sv->nkey(); + if (offlimit == offset) { + cerr << "offlimit hit by ComTerp::skip_func\n"; + return false; + } offset--; while(nargs>0 || nkeys>0) { ComValue* nv = topval + offset; int tokcnt; if (nv->is_type(ComValue::KeywordType)) { ! skip_key(topval, offset, offlimit, tokcnt); nkeys--; nargs -= tokcnt ? 1 : 0; } else { ! skip_arg(topval, offset, offlimit, tokcnt); nargs--; } } return true; } ! boolean ComTerp::skip_key(ComValue* topval, int& offset, int offlimit, int& tokcnt) { ComValue& curr = *(topval+offset); tokcnt = 0; if (curr.is_type(ComValue::KeywordType)) { + if (offlimit == offset) { + cerr << "offlimit hit by ComTerp::skip_key\n"; + return false; + } offset--; if (curr.keynarg_val()) { int subtokcnt; ! skip_arg(topval, offset, offlimit, subtokcnt); tokcnt += subtokcnt; } *************** *** 460,466 **** return false; } ! boolean ComTerp::skip_arg(ComValue* topval, int& offset, int& tokcnt) { tokcnt = 0; ComValue& curr = *(topval+offset); if (curr.is_type(ComValue::KeywordType)) { --- 470,476 ---- return false; } ! boolean ComTerp::skip_arg(ComValue* topval, int& offset, int offlimit, int& tokcnt) { tokcnt = 0; ComValue& curr = *(topval+offset); if (curr.is_type(ComValue::KeywordType)) { *************** *** 470,480 **** cerr << "unexpected unknown found by ComTerp::skip_arg\n"; return false; } else if (curr.is_type(ComValue::BlankType)) { offset--; ! boolean val = skip_arg(topval, offset, tokcnt); tokcnt++; return val; } else { offset--; tokcnt++; --- 480,498 ---- cerr << "unexpected unknown found by ComTerp::skip_arg\n"; return false; } else if (curr.is_type(ComValue::BlankType)) { + if (offlimit == offset) { + cerr << "offlimit hit by ComTerp::skip_arg\n"; + return false; + } offset--; ! boolean val = skip_arg(topval, offset, offlimit, tokcnt); tokcnt++; return val; } else { + if (offlimit == offset) { + cerr << "offlimit hit by ComTerp::skip_arg\n"; + return false; + } offset--; tokcnt++; *************** *** 484,501 **** ComValue& next = *(topval+offset); int subtokcnt = 0; if (next.is_type(ComValue::KeywordType)) { ! skip_key(topval, offset, subtokcnt); tokcnt += subtokcnt + 1; if (subtokcnt) count++; } else if (next.is_type(ComValue::CommandType) || next.is_type(ComValue::SymbolType)) { ! skip_arg(topval, offset, subtokcnt); tokcnt += subtokcnt; } else if (next.is_type(ComValue::BlankType)) { offset--; ! skip_arg(topval, offset, subtokcnt); tokcnt += subtokcnt+1; } else { offset--; tokcnt++; } --- 502,527 ---- ComValue& next = *(topval+offset); int subtokcnt = 0; if (next.is_type(ComValue::KeywordType)) { ! skip_key(topval, offset, offlimit, subtokcnt); tokcnt += subtokcnt + 1; if (subtokcnt) count++; } else if (next.is_type(ComValue::CommandType) || next.is_type(ComValue::SymbolType)) { ! skip_arg(topval, offset, offlimit, subtokcnt); tokcnt += subtokcnt; } else if (next.is_type(ComValue::BlankType)) { + if (offlimit == offset) { + cerr << "offlimit hit by ComTerp::skip_arg\n"; + return false; + } offset--; ! skip_arg(topval, offset, offlimit, subtokcnt); tokcnt += subtokcnt+1; } else { + if (offlimit == offset) { + cerr << "offlimit hit by ComTerp::skip_arg\n"; + return false; + } offset--; tokcnt++; } *************** *** 621,638 **** } void ComTerp::decr_stack(int n) { ! for (int i=0; i<n; i++) { ComValue& stacktop = _stack[_stack_top--]; stacktop.AttributeValue::~AttributeValue(); } } ComValue& ComTerp::pop_stack(boolean lookupsym) { ComValue& stacktop = _stack[_stack_top--]; if (lookupsym) return lookup_symval(stacktop); else return stacktop; } ComValue& ComTerp::lookup_symval(ComValue& comval) { --- 647,667 ---- } void ComTerp::decr_stack(int n) { ! for (int i=0; i<n && _stack_top>=0; i++) { ComValue& stacktop = _stack[_stack_top--]; stacktop.AttributeValue::~AttributeValue(); } } ComValue& ComTerp::pop_stack(boolean lookupsym) { + if (!stack_empty()) { ComValue& stacktop = _stack[_stack_top--]; if (lookupsym) return lookup_symval(stacktop); else return stacktop; + } else + return ComValue::nullval(); } ComValue& ComTerp::lookup_symval(ComValue& comval) { *************** *** 880,885 **** --- 909,917 ---- add_command("split", new SplitStrFunc(this)); add_command("join", new JoinStrFunc(this)); + add_command("type", new TypeSymbolFunc(this)); + add_command("class", new ClassSymbolFunc(this)); + add_command("postfix", new PostFixFunc(this)); add_command("posteval", new PostEvalFunc(this)); *************** *** 1209,1215 **** _buffer = new char[_bufsiz]; _bufptr = 0; _linenum = 0; ! _just_reset = false; _pfcomvals = nil; if (_ctsstack_top+1 == _ctsstack_siz) { --- 1241,1247 ---- _buffer = new char[_bufsiz]; _bufptr = 0; _linenum = 0; ! // _just_reset = false; _pfcomvals = nil; if (_ctsstack_top+1 == _ctsstack_siz) { Index: ComTerp/comterp.h diff -c ComTerp/comterp.h:1.10 ComTerp/comterp.h:1.11 *** ComTerp/comterp.h:1.10 Tue Jun 20 06:20:22 2000 --- src/ComTerp/comterp.h Thu Jul 20 03:27:13 2000 *************** *** 237,245 **** void incr_stack(int n); void decr_stack(int n=1); ! boolean skip_func(ComValue* topval, int& offset); ! boolean skip_key(ComValue* topval, int& offset, int& argcnt); ! boolean skip_arg(ComValue* topval, int& offset, int& argcnt); void push_stack(postfix_token*); void token_to_comvalue(postfix_token*, ComValue*); --- 237,245 ---- void incr_stack(int n); void decr_stack(int n=1); ! boolean skip_func(ComValue* topval, int& offset, int offlimit); ! boolean skip_key(ComValue* topval, int& offset, int offlimit, int& argcnt); ! boolean skip_arg(ComValue* topval, int& offset, int offlimit, int& argcnt); void push_stack(postfix_token*); void token_to_comvalue(postfix_token*, ComValue*); *************** *** 255,269 **** virtual void pop_funcstate(); // pop ComFuncState off stack ! ComValue* _stack; ! int _stack_top; ! unsigned int _stack_siz; ! boolean _quitflag; ! char* _errbuf; ! char* _errbuf2; ! int _pfoff; boolean _brief; // when used to produce ComValue output ! boolean _just_reset; boolean _defaults_added; // flag for base set of commands added ComValueTable* _localtable; // per interpreter symbol table --- 255,269 ---- virtual void pop_funcstate(); // pop ComFuncState off stack ! ComValue* _stack; // stack of multi-value objects, central to the interpreter ! int _stack_top; // current top of stack, -1 indicates empty ! unsigned int _stack_siz; // current maximum stack size ! boolean _quitflag; // flag that can be set to terminate interpreter ! char* _errbuf; // buffer used for rendering error messages ! char* _errbuf2; // ancillary buffer for rendering error messages ! int _pfoff; // current offset in _pfbuf boolean _brief; // when used to produce ComValue output ! boolean _just_reset; // flag that gets set after call to ::reset_stack() boolean _defaults_added; // flag for base set of commands added ComValueTable* _localtable; // per interpreter symbol table Index: ComTerp/typefunc.c diff -c /dev/null ComTerp/typefunc.c:1.1 *** /dev/null Thu Jul 20 03:27:17 2000 --- src/ComTerp/typefunc.c Thu Jul 20 03:27:13 2000 *************** *** 0 **** --- 1,113 ---- + /* + * Copyright (c) 2000 IET Inc. + * Copyright (c) 1998,1999,2000 Vectaport Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the names of the copyright holders not be used in + * advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. The copyright holders make + * no representations about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, + * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING + * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + + #include <ComTerp/typefunc.h> + #include <ComTerp/comvalue.h> + #include <ComTerp/comterp.h> + + #include <Attribute/attrlist.h> + #include <Attribute/attrvalue.h> + + #include <Unidraw/iterator.h> + + #include <iostream.h> + + #define TITLE "TypeFunc" + + /*****************************************************************************/ + + TypeSymbolFunc::TypeSymbolFunc(ComTerp* comterp) : ComFunc(comterp) { + } + + void TypeSymbolFunc::execute() { + // return type symbol for each argumen + boolean noargs = !nargs() && !nkeys(); + int numargs = nargs(); + if (!numargs) return; + int type_syms[numargs]; + for (int i=0; i<numargs; i++) { + ComValue& val = stack_arg(i); + type_syms[i] = val.type_symid(); + } + reset_stack(); + + if (numargs>1) { + AttributeValueList* avl = new AttributeValueList(); + ComValue retval(avl); + for (int i=0; i<numargs; i++) + if (type_syms[i]<0) + avl->Append(new AttributeValue()); + else + avl->Append(new AttributeValue(type_syms[i], AttributeValue::SymbolType)); + push_stack(retval); + } else { + if (type_syms[0]<0) + push_stack(ComValue::nullval()); + else { + ComValue retval (type_syms[0], AttributeValue::SymbolType); + push_stack(retval); + } + } + + } + + /*****************************************************************************/ + + ClassSymbolFunc::ClassSymbolFunc(ComTerp* comterp) : ComFunc(comterp) { + } + + void ClassSymbolFunc::execute() { + // return type symbol for each argumen + boolean noargs = !nargs() && !nkeys(); + int numargs = nargs(); + if (!numargs) return; + int class_syms[numargs]; + for (int i=0; i<numargs; i++) { + ComValue& val = stack_arg(i); + if (val.is_object()) + class_syms[i] = val.class_symid(); + else + class_syms[i] = -1; + } + reset_stack(); + + if (numargs>1) { + AttributeValueList* avl = new AttributeValueList(); + ComValue retval(avl); + for (int i=0; i<numargs; i++) + if (class_syms[i]<0) + avl->Append(new AttributeValue()); + else + avl->Append(new AttributeValue(class_syms[i], AttributeValue::SymbolType)); + push_stack(retval); + } else { + if (class_syms[0]<0) + push_stack(ComValue::nullval()); + else { + ComValue retval (class_syms[0], AttributeValue::SymbolType); + push_stack(retval); + } + } + + } Index: ComTerp/typefunc.h diff -c /dev/null ComTerp/typefunc.h:1.1 *** /dev/null Thu Jul 20 03:27:17 2000 --- src/ComTerp/typefunc.h Thu Jul 20 03:27:13 2000 *************** *** 0 **** --- 1,60 ---- + /* + * Copyright (c) 2000 IET Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the names of the copyright holders not be used in + * advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. The copyright holders make + * no representations about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, + * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING + * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + + /* + * collection of type functions + */ + + #if !defined(_typefunc_h) + #define _typefunc_h + + #include <ComTerp/comfunc.h> + + class ComTerp; + + //: command to return type symbols for values + // sym|lst=type(val [val ...]) -- return type symbol(s) for value(s) + class TypeSymbolFunc : public ComFunc { + public: + TypeSymbolFunc(ComTerp*); + virtual void execute(); + + virtual const char* docstring() { + return "sym|lst=%s(val [ ...]) -- return type symbol(s) for value(s)"; } + }; + + //: command to return class symbols for values of object type + // sym|lst=type(val [val ...]) -- return type symbol(s) for value(s) + class ClassSymbolFunc : public ComFunc { + public: + ClassSymbolFunc(ComTerp*); + virtual void execute(); + + virtual const char* docstring() { + return "sym|lst=%s(val [ ...]) -- return class symbol(s) for value(s) of object type"; } + }; + + #endif /* !defined(_typefunc_h) */ + + + Index: comterp/README diff -c comterp/README:1.12 comterp/README:1.13 *** comterp/README:1.12 Tue Jun 20 06:20:25 2000 --- src/comterp_/README Thu Jul 20 03:27:19 2000 *************** *** 201,206 **** --- 201,208 ---- bool=eq(str1 str2 :n len) -- partial string comparison + bool=eq(sym1 sym2 :sym) -- symbol comparison + postfix(arg1 [arg2 [arg3 ... [argn]]]) -- echo unevaluated postfix arguments (with [narg|nkey] after defined commands, {narg|nkey} after undefined commands, (narg) after keys, and a * following post-evaluation commands) *************** *** 237,242 **** --- 239,248 ---- f=float(num) -- convert any numeric to a float d=double(num) -- convert any numeric to a double + + sym|lst=type(val [val ...]) -- return type symbol(s) for value(s) + + sym|lst=class(val [val ...]) -- return class symbol(s) for value(s) of object type ONLY IN SERVER MODE Index: IVGlyph/textbuff.c diff -c IVGlyph/textbuff.c:1.1 IVGlyph/textbuff.c:1.2 *** IVGlyph/textbuff.c:1.1 Tue Jan 18 03:08:21 2000 --- src/IVGlyph/textbuff.c Thu Jul 20 03:27:39 2000 *************** *** 114,121 **** count * (1 + allocate_extra), size * allocate_extra));; // re-allocate ! printf("EivTextBuffer::allocating more memory\n"); ! printf("\t add:%d bytes\n", add_size); char* buffer = (char *)realloc(text, size + add_size); if (buffer == nil) return; // quitely ??? --- 114,121 ---- count * (1 + allocate_extra), size * allocate_extra));; // re-allocate ! // printf("EivTextBuffer::allocating more memory\n"); ! // printf("\t add:%d bytes\n", add_size); char* buffer = (char *)realloc(text, size + add_size); if (buffer == nil) return; // quitely ??? Index: man1_ivtools/comterp.1 diff -c man1_ivtools/comterp.1:1.12 man1_ivtools/comterp.1:1.13 *** man1_ivtools/comterp.1:1.12 Tue Jun 20 06:21:08 2000 --- src/man/man1/comterp.1 Thu Jul 20 03:29:23 2000 *************** *** 210,215 **** --- 210,217 ---- bool=eq(str1 str2 :n len) -- partial string comparison + bool=eq(sym1 sym2 :sym) -- symbol comparison + postfix(arg1 [arg2 [arg3 ... [argn]]]) -- echo unevaluated postfix arguments (with [narg|nkey] after defined commands, {narg|nkey} after undefined commands, (narg) after keys, and a * following post-evaluation commands) arr=posteval(arg1 [arg2 [arg3 ... [argn]]]) -- post-evaluate every fixed argument (until nil) and return array *************** *** 241,246 **** --- 243,252 ---- f=float(num) -- convert any numeric to a float d=double(num) -- convert any numeric to a double + + sym|lst=type(val [val ...]) -- return type symbol(s) for value(s) + + sym|lst=class(val [val ...]) -- return class symbol(s) for value(s) of object type .SH ONLY IN SERVER MODE *** /dev/null Thu Jul 20 03:29:43 PDT 2000 --- patches/ivtools-000720-johnston-082 *************** patches/ivtools-000720-johnston-082 *** 0 **** --- 1 ---- + ivtools-000720-johnston-082 |
From: <ivt...@li...> - 2000-06-24 16:38:07
|
Patch: ivtools-000624-johnston-081 For: ivtools-0.8.3 Author: joh...@us... Subject: fix bug in use of ComTerpState Requires: This is an intermediate patch to ivtools-0.8.3. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - fix bug in use of ComTerpState. The ComTerp::pop_servstate method always deletes the _pfnum member variable, but in the case of the ComTerpServ::run method that takes a buffer of tokens as an argument, you don't want to do this. The fix was to nil out _pfbuf before popping the state. Index: ComTerp/comterpserv.c diff -c ComTerp/comterpserv.c:1.5 ComTerp/comterpserv.c:1.6 *** ComTerp/comterpserv.c:1.5 Tue Jun 20 04:31:39 2000 --- src/ComTerp/comterpserv.c Sat Jun 24 22:37:42 2000 *************** *** 431,436 **** --- 431,437 ---- _linenum = save_linenum; _just_reset = save_just_reset; #else + _pfbuf = nil; pop_servstate(); #endif return retval; Index: OverlayUnidraw/ovimport.c diff -c OverlayUnidraw/ovimport.c:1.3 OverlayUnidraw/ovimport.c:1.4 *** OverlayUnidraw/ovimport.c:1.3 Thu Jan 27 01:51:55 2000 --- src/OverlayUnidraw/ovimport.c Sat Jun 24 22:38:07 2000 *************** *** 836,842 **** } return creator; } else { ! cerr << "Unable to access image file: " << pathname << "\n"; return nil; } } --- 836,842 ---- } return creator; } else { ! cerr << "Unable to access graphic file: " << pathname << "\n"; return nil; } } *** /dev/null Sat Jun 24 22:38:23 PDT 2000 --- patches/ivtools-000624-johnston-081 *************** patches/ivtools-000624-johnston-081 *** 0 **** --- 1 ---- + ivtools-000624-johnston-081 |
From: <ivt...@li...> - 2000-06-21 21:09:35
|
Patch: ivtools-000622-johnston-080 For: ivtools-0.8.3 Author: joh...@us... Subject: attempt to workaround an ACE-related NetBSD bug, plus TextView initialization fix. Requires: This is an intermediate patch to ivtools-0.8.3. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - attempt to workaround an ACE-related NetBSD bug. Todd Gruhn has been faced with the problem comterp doesn't work in server mode when compiled with ACE on NetBSD for quite a while. We confirmed that for whatever reason, ACE would accept the connection to the port, and construct the handler, but subsequent data transmitted to the port would not cause select() to return. We also confirmed that ACE_wrappers/examples/Logger did work on NetBSD (the Acceptor-server version). Since this was the example from which comterp's use of ACE was derived, the next thing to do was a line-by-line comparison of the comterp ACE code to the Logger example. I found that little had changed in the past five years regarding the ACE Acceptor/Handler/Reactor API. But I did find two differences between how that API was used in the Logger example, and how it was used by comterp in server mode. The first was I had removed the call to Reactor::schedule_timerin ComterpHandler::open, something that had been used in Logging_Handler::open. I was trying to avoid the use of timers in the case of comterp in server mode. This patch conditionally enables this again for NetBSD. The second was I had added a call to Reactor::register_handler in comterp's main.c (to register the templated Acceptor object) that wasn't to be found in the main program of the Logger Acceptor-server example. This patch backs that out for NetBSD. I think I had done this to fix things after the change described in the previous paragraph. The pair of changes worked quite well on Linux, but might be the cause of the problem on NetBSD. - this patch also fixes an initialization bug in the TextView object, one that only recently surfaced. Index: ComTerp/comhandler.c diff -c ComTerp/comhandler.c:1.12 ComTerp/comhandler.c:1.13 *** ComTerp/comhandler.c:1.12 Sun Jun 11 00:18:56 2000 --- src/ComTerp/comhandler.c Thu Jun 22 03:01:33 2000 *************** *** 196,202 **** (this, ACE_Event_Handler::READ_MASK) == -1) ACE_ERROR_RETURN ((LM_ERROR, "(%P|%t) can't register with reactor\n"), -1); ! #if 0 else if (COMTERP_REACTOR::instance ()->schedule_timer (this, (const void *) this, --- 196,202 ---- (this, ACE_Event_Handler::READ_MASK) == -1) ACE_ERROR_RETURN ((LM_ERROR, "(%P|%t) can't register with reactor\n"), -1); ! #if defined(__NetBSD__) /* this seems to be required for NetBSD */ else if (COMTERP_REACTOR::instance ()->schedule_timer (this, (const void *) this, Index: comterp/main.c diff -c comterp/main.c:1.3 comterp/main.c:1.4 *** comterp/main.c:1.3 Thu Jun 8 03:56:59 2000 --- src/comterp_/main.c Thu Jun 22 03:01:36 2000 *************** *** 71,79 **** --- 71,81 ---- if (peer_acceptor->open (ACE_INET_Addr (portnum)) == -1) cerr << "comterp: unable to open port " << portnum << " with ACE\n"; + #if !defined(__NetBSD__) /* this is not the way to do it for NetBSD */ else if (COMTERP_REACTOR::instance ()->register_handler (peer_acceptor, ACE_Event_Handler::READ_MASK) == -1) cerr << "comterp: error registering acceptor with ACE reactor\n"; + #endif else if (ComterpHandler::logger_mode()==0) cerr << "accepting comterp port (" << portnum << ") connections\n"; Index: IVGlyph/textview.c diff -c IVGlyph/textview.c:1.1 IVGlyph/textview.c:1.2 *** IVGlyph/textview.c:1.1 Tue Jan 18 03:08:21 2000 --- src/IVGlyph/textview.c Thu Jun 22 03:01:43 2000 *************** *** 144,149 **** --- 144,150 ---- chooser_ = nil; // init key map + for (int i=0; i<keymap_size; i++) key_[i] = nil; for (TE_ViewKeyInfo* k = &default_key_map[0]; k->key != 0; k++) { key_[k->key] = k->func; } *** /dev/null Thu Jun 22 03:02:22 PDT 2000 --- patches/ivtools-000622-johnston-080 *************** patches/ivtools-000622-johnston-080 *** 0 **** --- 1 ---- + ivtools-000622-johnston-080 |
From: <ivt...@li...> - 2000-06-21 19:15:36
|
Patch: ivtools-000622-johnston-079 For: ivtools-0.8.3 Author: joh...@us... Subject: launch drawing editor ready to edit non-existent pathname Requires: This is an intermediate patch to ivtools-0.8.3. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - if the pathname given to drawing editor doesn't exist, launch the drawing editor so that it is ready to edit a file of that name. The file won't come into existence until a File/Save is done, but the user doesn't have to enter the pathname again if they don't want to. Index: OverlayUnidraw/oved.c diff -c OverlayUnidraw/oved.c:1.3 OverlayUnidraw/oved.c:1.4 *** OverlayUnidraw/oved.c:1.3 Sat Apr 15 03:30:56 2000 --- src/OverlayUnidraw/oved.c Thu Jun 22 01:18:27 2000 *************** *** 1,4 **** --- 1,5 ---- /* + * Copyright (c) 2000 Vectaport Inc, IET Inc. * Copyright (c) 1994-1999 Vectaport Inc. * Copyright (c) 1990, 1991 Stanford University * *************** *** 129,135 **** Init(comp); } else { ! Init(); fprintf(stderr, "drawtool: couldn't open %s\n", file); } } --- 130,140 ---- Init(comp); } else { ! OverlayIdrawComp* comp = new OverlayIdrawComp; ! comp->SetPathName(file); ! catalog->Register(comp, file); ! Init(comp, file); ! fprintf(stderr, "drawtool: couldn't open %s\n", file); } } Index: FrameUnidraw/frameeditor.c diff -c FrameUnidraw/frameeditor.c:1.6 FrameUnidraw/frameeditor.c:1.7 *** FrameUnidraw/frameeditor.c:1.6 Sat Apr 15 03:31:03 2000 --- src/FrameUnidraw/frameeditor.c Thu Jun 22 01:18:34 2000 *************** *** 1,5 **** /* ! * Copyright (c) 1994-2000 Vectaport Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided --- 1,6 ---- /* ! * Copyright (c) 2000 Vectaport Inc, IET Inc. ! * Copyright (c) 1994-1999 Vectaport Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided *************** *** 84,90 **** Init(comp); } else { ! Init(); fprintf(stderr, "flipbook: couldn't open %s\n", file); } } --- 85,94 ---- Init(comp); } else { ! FrameIdrawComp* comp = new FrameIdrawComp; ! comp->SetPathName(file); ! catalog->Register(comp, file); ! Init(comp, file); fprintf(stderr, "flipbook: couldn't open %s\n", file); } } Index: include_unidraw/catalog.h diff -c include_unidraw/catalog.h:1.1 include_unidraw/catalog.h:1.2 *** include_unidraw/catalog.h:1.1 Tue Jan 18 03:12:48 2000 --- src/include/Unidraw/catalog.h Thu Jun 22 01:18:43 2000 *************** *** 175,181 **** PSPattern* FindNonePattern(); PSPattern* FindGrayLevel(float); PSPattern* FindPattern(int[], int); - protected: void Register(EditorInfo*, const char*); void Register(Component*, const char*); void Register(Command*, const char*); --- 175,180 ---- *** /dev/null Thu Jun 22 01:18:57 PDT 2000 --- patches/ivtools-000622-johnston-079 *************** patches/ivtools-000622-johnston-079 *** 0 **** --- 1 ---- + ivtools-000622-johnston-079 |