-
Notifications
You must be signed in to change notification settings - Fork 0
/
README-constraints
113 lines (86 loc) · 4.9 KB
/
README-constraints
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
Scwm Constraint Solver Readme
-----------------------------
By Greg J. Badros -- 14 August 1998
updated 18 March 1999, 12 July 1999, 26 October 1999
For any of you interested in playing the the constraint-solving
extension to Scwm, here are some brief instructions on getting started.
First, you'll need my Cassowary constraint solving toolkit. It's
available from:
http://www.cs.washington.edu/research/constraints/cassowary/
The latest version is v0.51. It's C++ code, and it builds using
egcs-1.01 or newer, or gcc-2.8.1, and hopefully other C++ compilers that
support the STL reasonably well. Cassowary does (as of v0.4) support
autoconf and automake, so you should just be able to "./configure; make"
and go. See the README file included with the Cassowary distribution
for more details. In particular, you will need to give configure the
--enable-guile-build option and might need to give it the
--with-guile-prefix=DIR option to tell it where your installation of
Guile is. Also, you might want to set --prefix=$HOME if you do not have
superuser privileges.
After building Cassowary, trying running "ClTests" (in the c++/
subdirectory of the distribution) to do a quick test. If the program
fails in any way, please let me know!
If ClTests runs successfully for you, you should also test the
Guile/Scheme wrapper of Cassowary. To do this, cd to the "guile"
subdirectory of the distribution, and "make test" or run "guile -s
cltests.scm". Again, if this fails in any way, please let me know.
(You may just need to tweak your GUILE_LOAD_PATH environment variable --
see the explanation below.)
If the tests succeeded, do a "make install".
Also included with Cassowary is cassowary_scm.sgml and
cassowary_scm-procedures.txt for documentation. The latter integrates
smoothly w/ scwm.el and scwm-procedures.txt -- just set your scwm
`doc-files' variable to point at both.
Then you need to rebuild Scwm w/ constraint-solver support. Do this
using a recent dev snapshot (18-March-1999 or later should be fine;
earlier may work). When you configure Scwm be sure to give at least
the --with-cassowary=CASSOWARY_INSTALLATION_PREFIX an argument to Scwm's
configure. I use "--with-cassowary=/usr/contrib" for Scwm's configure
after building Cassowary with "--prefix=/usr/contrib" and installing.
Now do a clean build of Scwm with:
make clean
make all
All the normal Scwm files will build with the C compiler, but the couple
of .cc files must be built with the same C++ compiler as you used to
build Cassowary, and the link step must be done by a C++ compiler, too.
If you get an error after symbol extraction for dynamic loading, you may
need to add "grep -v __throw_type_match_rtti | " to the beginning of
the global_symbol_pipe variable in the "libtool" script generated by
configure. (This is necessary with egcs-1.1b under Linux for me). You can
do "patch <libtool.patch" to perform the edits automatically.
If all has gone well, you should be able to run the new binary just as
you would an ordinary Scwm binary. You should then evaluate
"(use-modules (app scwm constraints))" to start the UI for the
constraint solver. The interface is still under development, but it's a
place to start. Use the button bar (w/ tooltip help) to add
constraints, and use C-M-S-c to bring up a menu to list/enable/disable
constraints you've already added. Hover over a constraint menu item to
get more information about which windows are involved in each
constraint.
If Scwm has problems finding the libconstraints module, consider setting
the GUILE_LOAD_PATH environment variable. It can contain a
colon-separated list of directories that are the bases of directory
hierarchies that contain dynamically-loadable Guile modules. E.g., if
libconstraints.a (from the cassowary/guile directory) is installed in
/usr/share/guile/site/cassowary/libconstraints.a
then GUILE_LOAD_PATH could contain:
/usr/share/guile/site/
the "cassowary" subdirectory is not needed since the full module name
is "(cassowary constraints)". Setting GUILE_LOAD_PATH (or its
Scwm-specific cousin, SCWM_LOAD_PATH) is not necessary if Cassowary and
Scwm are both installed with the same prefix.
See also the code in scheme/*constraints*.scm
Note that when the constraint solver is in use, all interactive resizes
and moves are done opaquely, no matter what options you give to the
interactive-move or interactive-resize primitives.
Please let me know of successes and failures. Consider the constraint
code beta. My main wm has had the constraint solver embedded for many
months now, and I do turn on the constraint solver w/o fear of losing
work (but your mileage may vary, of course). The behaviour of Scwm
built w/ constraints w/o ever using the constraint primitives should be
nearly identical to Scwm w/o constraints. The procedure
`scwm-is-constraint-enabled?' will return #t if the running Scwm was
built with csontraint support, and #f otherwise.
Good luck.
Greg J. Badros
http://www.cs.washington.edu/homes/gjb