1 Cassowary Constraint Solving Toolkit for C++, Java, and Smalltalk
4 Web Page: http://www.cs.washington.edu/research/constraints/cassowary
5 Contact: cassowary@cs.washington.edu
7 Greg J. Badros <gjb@cs.washington.edu> and
8 Alan Borning <borning@cs.washington.edu>
9 University of Washington
10 Computer Science and Engineering
11 Seattle, WA 98195-2350
14 with Constraint Drawing Applet (CDA) by Michael Noth <noth@cs.washington.edu>
16 See ANNOUNCE for a brief description and announcement of this distribution.
17 See NEWS for a history of user-visible changes.
18 See ChangeLog for a detailed listing of the changes to each source file.
19 See LICENSE for legalese regarding use of this distribution.
21 The Smalltalk implementation is in the public domain -- see smalltalk/README.
23 Please send bug reports to cassowary@cs.washington.edu
25 Also, send mail to cassowary@cs.washington.edu if you would like to be
26 informed about bug fixes, feature enhancements, etc. Let us know what
27 implementation(s) you are using, too.
29 ------------------------------------------------------------------
33 The Cassowary library uses GNU autoconf to permit easy building on
34 various platforms. You should be able to do:
39 and everything will work. A more complex, but realistic example is:
41 ./configure --with-prefix=/usr/contrib \
42 --with-guile-prefix=/usr/contrib \
43 --with-python-headers=/usr/include/python1.5 \
45 --with-gtl=/usr/contrib \
46 --with-java-class-path=/usr/contrib/share/java/site \
50 Be sure to give the extra --enable-permissive flag to configure if
51 you are building with gcc-2.95 or more recent.
53 As yet another data point, I build Cassowary with:
55 ./configure --with-guile-exec-prefix=/uns/bin \
56 --with-guile-prefix=/uns/share --prefix=/uns/share \
57 --exec-prefix=/uns --enable-maintainer-mode
59 See the file "INSTALL" for more details about
60 autoconf support and the options that the "configure" takes. You can
61 also do "./configure --help" for the list of the options that configure
64 If the make in any of the subdirectories fails, you can turn on the "-k"
65 option to make, or just do make in the subdirectories that you want
66 build. E.g., if you do not have the JDK installed, the Java version of
67 Cassowary might not compile; if you still want the guile version, just
70 Be sure that configure detects the validity of using the "-fpermissive"
71 flag of more recent g++/egcs compilers to work around some
72 const-discrepancies between the const-challenged guile header files and
73 Cassowary's more const-correct usage. You should get a message like:
75 checking whether gcc understands -fpermissive option... yes
77 when running configure if you're using, e.g., gcc-2.95 or later.
79 You need to apply GTL.h.patch to the installed GTL.h header file for
80 Cassowary to compile with recent versions of egcs/gcc (e.g., gcc-2.95).
82 Also, you may need to change libguile/gsubr.h from:
84 extern SCM scm_make_gsubr SCM_P ((char *name, int req, int opt,
85 int rst, SCM (*fcn)()));
88 extern SCM scm_make_gsubr SCM_P ((char *name, int req, int opt,
91 or patch guile's snarf.h to insert the appropriate case at each call to
92 SCM_PROC and SCM_PROC1. (Thanks to Alexandre Duret-Lutz for the above
93 information about more recent g++/egcs compilers).
95 Note that the generated Makefiles depend upon features of GNU Make. See:
97 ftp://ftp.gnu.org/pub/gnu/
99 for a version of make that you can build first to then build Cassowary.
101 Example applications exist in subdirectories of the top-level
102 implementation subdirectories (e.g., c++/qdemos contains demos for C++
103 that use the Qt Widget toolkit).
105 Please send mail to cassowary@cs.washington.edu if you are using this
106 toolkit so we know how to reach you for bug fixes, updates, etc.
108 ------------------------------------------------------------------
110 WHAT THE DISTRIBUTION CONTAINS
112 This distribution contains 3 implementations of the Cassowary constraint
119 For each implementation language, there is at least one example program;
120 for some there are many.
122 There is a wrapping of the C++ solver in Guile-Scheme -- see the guile/
123 subdirectory. Also, Anthony Beuriv� has wrapped Cassowary for
124 STk/Scheme. His code is available at:
126 http://dept-info.labri.u-bordeaux.fr/~beurive/Code
128 and the STk Scheme system is available at:
130 http://kaolin.unice.fr/STk/
132 There is also a SWIG-generated wrapper of the C++ library making the
133 solver available from the Python language.
135 A technical report describing the solver, its interface, and its
136 implementation is in cassowary-tr.ps (pdf version in cassowary-tr.pdf).
137 This paper is required reading if you intend to use the solver in your
140 See also the Scwm (Scheme Constraints Window Manager) web page:
142 http://scwm.mit.edu/scwm/
144 Scwm, also by Greg Badros (and Maciej Stachowiak), is the most
145 substantial application using this toolkit that we are aware of.
147 ------------------------------------------------------------------
149 VARIOUS IMPLEMENTATION NOTES
151 Cassowary/C++ needs to be compiled using a modern C++ compiler.
152 At one time or another, it has compiled using:
157 o gcc-2.8.1 (needs libstdc++-2.8.x, too)
158 o Visual C++ 5.0 (not tried recently)
160 In particular, Cassowary will *not* build with gcc-2.7.x.x!
162 See c++/README for more details about building the C++ version.
164 The C++ implementation of the toolkit also has an optional finite domain
165 subsolver. You need to build and install the GTL -- the Graph Template
166 Library -- and use the "--with-gtl=DIR" configure option for the finite
167 domain subsolver to be built. GTL is available from:
169 http://www.fmi.uni-passau.de/Graphlet/GTL/
171 Cassowary was tested against GTL-0.3.1; it may work with later
172 versions, but I have not tried it. You need to apply GTL.h.patch to
173 the installed GTL.h header file for Cassowary to compile with recent
174 versions of egcs/gcc (e.g., gcc-2.95).
176 Cassowary/Java was developed using Sun's JDK-1.1.x, ported to Linux
177 More recent versions should work fine.
179 See java/README for more details about building the Java version.
182 Cassowary/Smalltalk was written under OTI Smalltalk-- other versions of
183 smalltalk will likely require (possibly significant) changes.
185 See smalltalk/README for more details about the Smalltalk version.
187 See guile/README for details about the Guile Scheme wrapper of the C++
188 implementation, and for a pointer to SCWM, the Scheme Constraints Window
189 Manager which uses Cassowary.
191 The Python bindings (by Tessa Lau) bindings for the Cassowary library
192 are in the wrappers/ subdirectory. SWIG was used in wrapping the
193 library. These bindings may no longer work, and are provided only for
194 your hacking pleasure (please send back useful patches if you do get the
197 For more information about SWIG, see:
202 For more information about the Python language, see:
204 http://www.python.org/
207 For more information about the Guile-Scheme language, see:
209 http://www.red-bean.com/guile/
210 http://www.fsf.org/software/guile/guile.html
213 ------------------------------------------------------------------
215 DEMONSTRATION APPLICATION
217 A standard demonstration application is included for each implementation
218 of the Cassowary solver. The application builds a quadrilateral and
219 connects the neighboring midpoints of each of the outer edges to form an
220 interior quadrilateral which is provably a parallelogram. The
221 constraint solver manages the constraints to keep the outer
222 quadrilateral inside the window, keep the midpoints properly positioned,
223 and keep the outer quadrilateral from turning "inside out."
225 The user is able to select points (draggable boxes) and move them around
226 within the window (both midpoints and endpoints can be selected, of
227 course). The solver updates the figure, and redraws.
230 ------------------------------------------------------------------
232 FUNDING ACKNOWLEDGEMENTS
234 This work has been funded in part by the National Science Foundation under
235 Grants IRI-9302249 and CCR-9402551, by Object Technology International, and
236 by a Fulbright Award from the Australian-American Educational
239 Additionally, Greg Badros is supported by a National Science Foundation
240 Graduate Research Fellowship. Parts of this material are based upon
241 work supported under that fellowship.